/* IQV Gather — design system.
   One family (IBM Plex Sans) with Plex Mono for references and codes.
   Palette: ink on a cool canvas; teal is the single signal colour; amber
   marks waiting/overdue; status is encoded in a left rule, not a card.   */
@import url("/static/fonts/fonts.css");

:root {
  --ink: #0f1a2a;
  --ink-2: #3b4a5c;
  --ink-3: #6b7a8c;
  --line: #d9dfe6;
  --line-2: #e8edf2;
  --canvas: #f2f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --teal: #0b7a75;
  --teal-2: #0a6460;
  --teal-soft: #e3f3f2;
  --amber: #c77a00;
  --amber-soft: #fff4de;
  --green: #2f7d4a;
  --green-soft: #e6f4ea;
  --red: #b3261e;
  --red-soft: #fbe9e7;
  --blue: #2b5fb8;
  --blue-soft: #e8eefb;
  --radius: 8px;
  --radius-s: 5px;
  --shadow: 0 1px 2px rgba(15, 26, 42, .06), 0 0 0 1px rgba(15, 26, 42, .04);
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar: 236px;
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink);
  background: var(--canvas); -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
pre { font-family: var(--mono); font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; overflow: auto; }
small, .muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-2); }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[x-cloak] { display: none !important; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink); color: #d7dee7; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: #fff; font-weight: 600; font-size: 16px; }
.brand svg { width: 28px; height: 28px; }
.brand span small { display: block; font-weight: 400; font-size: 11.5px; color: #93a3b5; letter-spacing: .02em; }
.nav-group { margin-top: 14px; padding: 0 8px 6px; font-size: 11.5px; color: #8fa0b3; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); color: #d7dee7; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.nav a.active { background: var(--teal); color: #fff; }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav .count { margin-left: auto; font-size: 11.5px; background: rgba(255,255,255,.12); padding: 1px 7px; border-radius: 10px; }
.sidebar .who { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12.5px; flex: none; }
.sidebar .avatar { background: #24344a; color: #d7dee7; }
.who .name { font-size: 13.5px; color: #fff; line-height: 1.2; }
.who .role { font-size: 11.5px; color: #93a3b5; }
.who form { margin-left: auto; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 18px; }
.topbar .crumbs { font-size: 13.5px; color: var(--ink-3); }
.topbar .crumbs a { color: var(--ink-2); }
.topbar .spacer { flex: 1; }
.content { padding: 24px 28px 48px; max-width: var(--max); }
.content.narrow { max-width: 760px; }
.menu-btn { display: none; }

/* ---------- public / auth shells ---------- */
.public { background: var(--surface); }
.site-head { display: flex; align-items: center; gap: 24px; padding: 18px 32px; max-width: 1120px; margin: 0 auto; }
.site-head .brand { color: var(--ink); padding: 0; }
.site-head nav { margin-left: auto; display: flex; gap: 22px; align-items: center; font-weight: 500; }
.site-head nav a { color: var(--ink-2); }
.site-head nav a.btn-primary { color: #fff; }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--ink); color: #d7dee7; padding: 48px; display: flex; flex-direction: column; }
.auth-side .brand { color: #fff; }
.auth-side .pitch { margin: auto 0; max-width: 420px; }
.auth-side .pitch h2 { color: #fff; font-size: 28px; font-weight: 600; margin-bottom: 14px; }
.auth-side .pitch p { color: #a9b6c5; font-size: 15.5px; }
.auth-side .fine { font-size: 12.5px; color: #7f8fa3; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form .box { width: 100%; max-width: 400px; }
.auth-form h1 { font-size: 24px; margin-bottom: 6px; }
.auth-form .lead { color: var(--ink-3); margin-bottom: 24px; }
.code-input { font-family: var(--mono); font-size: 28px; letter-spacing: .5em; text-align: center; padding: 14px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; font-size: 14px;
  cursor: pointer; line-height: 1.2; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-2); border-color: var(--teal-2); }
.btn-danger { color: var(--red); border-color: #efc2be; }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label { display: block; font-weight: 500; font-size: 13.5px; margin-bottom: 5px; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); font: inherit; font-size: 14.5px; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: 2px solid rgba(11,122,117,.18); outline-offset: 0; }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 16px; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.field.inline label { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; font-size: 14px; color: var(--ink); }
.check input { margin-top: 3px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.form-actions .right { margin-left: auto; }
.invalid { color: var(--red); font-size: 13px; margin-top: 5px; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { font-size: 16px; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }
.section { margin-bottom: 26px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 17px; }
.section-head .spacer { flex: 1; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=search] { width: 260px; }
.toolbar select { width: auto; }
.toolbar .spacer { flex: 1; }

/* stat tiles: only on the dashboard */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.stat.warn .n { color: var(--amber); }
.stat.ok .n { color: var(--green); }

/* tables */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #fbfcfd; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data .sub { font-size: 12.5px; color: var(--ink-3); }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.empty strong { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }
.pagination { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line-2); font-size: 13.5px; color: var(--ink-3); }
.pagination .spacer { flex: 1; }

/* ---------- the question row (signature element) ---------- */
.qlist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.qrow { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; padding: 13px 16px 13px 14px; border-bottom: 1px solid var(--line-2); border-left: 3px solid var(--line); align-items: start; }
.qrow:last-child { border-bottom: 0; }
.qrow:hover { background: #fbfcfd; }
.qrow.s-open { border-left-color: var(--amber); }
.qrow.s-answered { border-left-color: var(--blue); }
.qrow.s-accepted { border-left-color: var(--green); }
.qrow.s-closed { border-left-color: var(--line); }
.qrow.s-draft { border-left-color: #c9d1da; border-left-style: dashed; }
.qrow.overdue { background: #fffaf0; }
.qref { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); padding-top: 3px; }
.qref small { display: block; color: var(--ink-3); font-family: var(--font); font-size: 11.5px; }
.qtitle { font-weight: 500; color: var(--ink); }
.qtitle a { color: inherit; }
.qmeta { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.qside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12.5px; color: var(--ink-3); }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.6; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.open { background: var(--amber-soft); color: var(--amber); }
.pill.answered { background: var(--blue-soft); color: var(--blue); }
.pill.accepted { background: var(--green-soft); color: var(--green); }
.pill.closed { background: var(--line-2); color: var(--ink-3); }
.pill.draft { background: var(--surface-2); color: var(--ink-3); }
.pill.overdue, .pill.critical, .pill.failed, .pill.locked { background: var(--red-soft); color: var(--red); }
.pill.high { background: var(--amber-soft); color: var(--amber); }
.pill.ok, .pill.sent, .pill.active { background: var(--green-soft); color: var(--green); }
.pill.plain::before { display: none; }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 4px; background: var(--teal-soft); color: var(--teal-2); }

/* flash */
.flash { padding: 11px 14px; border-radius: var(--radius-s); margin-bottom: 18px; border: 1px solid; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.flash.success { background: var(--green-soft); border-color: #bfe0c8; color: #1f5a33; }
.flash.error { background: var(--red-soft); border-color: #f0c2bd; color: #8c1d16; }
.flash.info { background: var(--blue-soft); border-color: #c4d3f3; color: #1f4690; }
.flash.warn { background: var(--amber-soft); border-color: #f1d9a6; color: #7a4b00; }

/* question detail */
.qhead { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.qhead .qref { font-size: 14px; padding-top: 6px; }
.qhead h1 { font-size: 22px; }
.qbody { white-space: pre-wrap; color: var(--ink-2); font-size: 15px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.answer { padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.answer:last-child { border-bottom: 0; }
.answer.accepted { background: #f3faf5; }
.answer .by { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.answer .by strong { color: var(--ink); font-weight: 500; }
.answer .text { white-space: pre-wrap; font-size: 15px; }
.assignee { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.assignee:last-child { border-bottom: 0; }
.assignee .st { margin-left: auto; }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; font-weight: 400; }
.choice:hover { border-color: var(--teal); }
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--ink-3); font-size: 13.5px; background: var(--surface-2); }
.dropzone input { display: none; }
.files { font-size: 13.5px; }
.files li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.files li:last-child { border-bottom: 0; }

/* wizard */
.steps { display: flex; gap: 0; margin-bottom: 26px; counter-reset: step; }
.steps .step { flex: 1; padding: 10px 12px; border-bottom: 2px solid var(--line); font-size: 13.5px; color: var(--ink-3); }
.steps .step.active { border-color: var(--teal); color: var(--teal-2); font-weight: 500; }
.steps .step.done { border-color: var(--green); color: var(--green); }
.steps .step::before { counter-increment: step; content: counter(step) ". "; font-family: var(--mono); }

/* secret reveal */
.secret { font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; word-break: break-all; }

/* ---------- landing page ---------- */
.hero { max-width: 1120px; margin: 0 auto; padding: 56px 32px 40px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 44px; line-height: 1.1; letter-spacing: -.02em; margin-bottom: 18px; }
.hero .lead { font-size: 18px; color: var(--ink-2); max-width: 520px; margin-bottom: 26px; }
.hero .cta { display: flex; gap: 12px; align-items: center; }
.hero .demo { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 40px rgba(15,26,42,.08); overflow: hidden; }
.hero .demo .bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-3); }
.hero .demo .qrow { grid-template-columns: 64px 1fr auto; }
.hero .demo .answer { background: var(--surface-2); }
.band { max-width: 1120px; margin: 0 auto; padding: 36px 32px; }
.band h2 { font-size: 26px; letter-spacing: -.015em; margin-bottom: 8px; }
.band .sub { color: var(--ink-2); font-size: 16px; max-width: 620px; margin-bottom: 28px; }
.channels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.channel { padding: 18px 0 0; border-top: 2px solid var(--ink); }
.channel h3 { font-size: 16px; margin-bottom: 6px; }
.channel p { font-size: 14px; color: var(--ink-2); margin: 0; }
.channel.agent { border-top-color: var(--teal); }
.flow { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.flow ol { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; }
.flow li { margin-bottom: 10px; }
.flow pre { margin: 0; font-size: 12.5px; }
.trust { background: var(--ink); color: #d7dee7; }
.trust .band h2 { color: #fff; }
.trust .band .sub { color: #a9b6c5; }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.trust-grid h3 { color: #fff; font-size: 15.5px; margin-bottom: 6px; }
.trust-grid p { color: #a9b6c5; font-size: 14px; margin: 0; }
.site-foot { max-width: 1120px; margin: 0 auto; padding: 24px 32px 40px; font-size: 13px; color: var(--ink-3); display: flex; gap: 20px; }
.site-foot .spacer { flex: 1; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .hero h1 { font-size: 34px; }
  .channels, .trust-grid { grid-template-columns: 1fr 1fr; }
  .flow { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); transform: translateX(-100%); transition: transform .18s; z-index: 20; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .channels, .trust-grid { grid-template-columns: 1fr; }
  .qrow { grid-template-columns: 1fr; gap: 6px; }
  .qside { flex-direction: row; align-items: center; }
  .site-head { padding: 14px 16px; }
  .site-head nav { gap: 14px; }
  .hero, .band, .site-foot { padding-left: 16px; padding-right: 16px; }
  .toolbar input[type=search] { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .sidebar, .topbar, .btn, .toolbar { display: none !important; } .shell { display: block; } }
