:root {
  color-scheme: light;
  --navy: #0b2b52;
  --blue: #1f6fb2;
  --sky: #eaf4fb;
  --ink: #18263a;
  --muted: #68768a;
  --line: #d9e2ed;
  --paper: #ffffff;
  --canvas: #f4f7fb;
  --green: #188765;
  --amber: #b56d00;
  --red: #c9423a;
  --shadow: 0 16px 40px rgba(11, 43, 82, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.5 Inter, "Segoe UI", Arial, sans-serif;
}
button, input, select { font: inherit; }
button, select, label.dropzone { cursor: pointer; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px max(24px, calc((100vw - 1240px) / 2));
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand { display: flex; gap: 12px; align-items: center; color: var(--navy); text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  color: white; background: var(--navy); font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 12px; align-items: center; }
select, input {
  min-height: 40px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: white; color: var(--ink);
}
.shell { width: min(1240px, calc(100% - 36px)); margin: 38px auto 72px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.hero.compact { align-items: center; }
.room-actions { display: flex; align-items: center; gap: 12px; }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 42px); line-height: 1.12; color: var(--navy); }
h2 { margin-bottom: 6px; color: var(--navy); font-size: 21px; }
.eyebrow { margin-bottom: 6px; color: #7094b8; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, monospace; }
.button {
  border: 0; border-radius: 9px; padding: 11px 17px; font-weight: 700;
  transition: transform .15s ease, opacity .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--navy); color: white; }
.button.secondary { background: #eaf0f7; color: var(--navy); }
.notice {
  display: flex; gap: 8px; padding: 13px 16px; margin-bottom: 18px;
  border: 1px solid #bdd9ec; border-radius: 10px; background: var(--sky); color: #31587b;
}
.reference-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.reference-upload {
  display:grid; gap:5px; min-height:92px; padding:16px; border:1px dashed #91b5d2;
  border-radius:11px; background:#f7fbfe; color:var(--navy);
}
.reference-upload input { position:absolute; width:1px; height:1px; opacity:0; }
.reference-upload span { color:var(--blue); font-weight:800; }
.reference-upload strong { overflow:hidden; color:var(--ink); text-overflow:ellipsis; white-space:nowrap; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric, .panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.metric { padding: 18px; }
.metric strong { display: block; margin-top: 6px; color: var(--navy); font-size: 28px; }
.metric small { color: var(--muted); }
.panel { padding: 22px; margin-bottom: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.filters { display: flex; gap: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid #e7edf4; text-align: left; vertical-align: middle; }
th { color: #728197; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
td strong { color: var(--navy); }
.badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.badge.neutral, .badge.waiting { color: #5d6c80; background: #edf1f5; }
.badge.ready { color: #0e6a4f; background: #dff4ec; }
.badge.review { color: #965b00; background: #fff0d6; }
.badge.block { color: #a72f29; background: #fde6e4; }
.room-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.step { color: #8eb2d1; font-size: 30px; font-weight: 800; margin-bottom: 5px; }
.dropzone {
  display: grid; place-items: center; min-height: 112px; margin: 18px 0;
  border: 1.5px dashed #71a3cc; border-radius: 12px; background: #f7fbfe; color: var(--navy);
  font-weight: 700;
}
.dropzone:hover { background: #eff8fe; }
.dropzone.large { min-height: 170px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone small { color: var(--muted); font-weight: 400; }
.version {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px;
  padding: 11px 0; border-top: 1px solid #e7edf4;
}
.version strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.version small { color: var(--muted); }
.link-row { display: flex; gap: 10px; }
.link-row input { width: 100%; font-family: Consolas, monospace; color: #53657a; }
.breadcrumbs { display: flex; gap: 8px; margin-bottom: 18px; color: var(--muted); }
.breadcrumbs a { color: var(--blue); text-decoration: none; }
.activity-list { display: grid; gap: 0; }
.activity-item { display: flex; gap: 14px; padding: 13px 0; border-top: 1px solid #e7edf4; }
.activity-dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--blue); }
.activity-item p { margin: 0; }
.partner-hero { max-width: 720px; margin: 80px auto 22px; text-align: center; }
.partner-card { max-width: 720px; margin: 0 auto; padding: 34px; }
.shared-file {
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  margin:18px 0; padding:14px 16px; border:1px solid #cce0ef; border-radius:10px; background:#f3f9fd;
}
.shared-file strong, .shared-file small { display:block; }
.shared-file small { color:var(--muted); }
.partner-actions { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:20px; }
.partner-actions p { margin:0; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.row-link { color: var(--blue); text-decoration: none; font-weight: 700; }
.icon-button { border: 0; background: transparent; font-size: 28px; color: var(--muted); }
dialog { width: min(510px, calc(100% - 30px)); border: 0; border-radius: 16px; padding: 0; box-shadow: 0 24px 80px rgba(0,0,0,.22); }
dialog::backdrop { background: rgba(9, 24, 43, .46); backdrop-filter: blur(3px); }
dialog form { display: grid; gap: 16px; padding: 26px; }
dialog label span { display: block; margin-bottom: 6px; color: var(--navy); font-weight: 700; }
dialog label input { width: 100%; }
.dialog-heading, .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-actions { justify-content: flex-end; margin-top: 6px; }
.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 360px;
  padding: 12px 16px; border-radius: 9px; background: var(--navy); color: white;
  opacity: 0; transform: translateY(14px); pointer-events: none; transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.auth-card { max-width: 520px; margin: 90px auto 0; padding: 34px; }
.auth-card form { display: grid; gap: 16px; }
.auth-card label span { display: block; margin-bottom: 6px; color: var(--navy); font-weight: 700; }
.auth-card input { width: 100%; }
.auth-error { min-height: 22px; margin: 0; color: var(--red); }
.cloud-note { margin-top: 18px; color: var(--muted); }
.top-user { display: flex; align-items: center; gap: 8px; }
.top-user small { color: var(--muted); }

@media (max-width: 800px) {
  .shell { width: min(100% - 24px, 1240px); margin-top: 24px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .room-grid { grid-template-columns: 1fr; }
  .reference-grid { grid-template-columns:1fr; }
  .hero, .panel-heading { align-items: stretch; flex-direction: column; }
  .room-actions { align-items: stretch; flex-direction: column; }
  .topbar { padding: 10px 14px; }
  .brand small, #storageBadge { display: none; }
  .notice { flex-direction: column; }
  .shared-file, .partner-actions { align-items:stretch; flex-direction:column; }
}
