/* Cyrapid design tokens. Light, calm, one accent. Manrope throughout, mono for clauses and dates. */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --ink: #141b24;
  --ink-2: #4b5563;
  --ink-3: #6b7482;
  --line: rgba(20, 27, 36, 0.10);
  --line-s: rgba(20, 27, 36, 0.22);
  --accent: #1f4fd1;
  --accent-ink: #173f9f;
  --accent-soft: rgba(31, 79, 209, 0.08);
  --accent-line: rgba(31, 79, 209, 0.35);
  --crit: #b3261e; --crit-soft: rgba(179, 38, 30, 0.10);
  --high: #a8620f; --high-soft: rgba(168, 98, 15, 0.12);
  --ok: #1e7a4b;   --ok-soft: rgba(30, 122, 75, 0.11);
  --font: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 10px;
  --shadow: 0 1px 2px rgba(20, 27, 36, 0.04), 0 8px 24px -12px rgba(20, 27, 36, 0.12);
  --t: 160ms cubic-bezier(.3,.7,.4,1);
  --rail: 232px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 28px; letter-spacing: -0.02em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); font-size: 13px; }
button { font: inherit; }
[hidden] { display: none !important; }

/* Layout */
.app { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 18px; padding: 22px 16px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; padding: 2px 6px; }
.brand:hover { text-decoration: none; }
.brand svg { color: var(--accent); }
.nav, .rail-foot { display: flex; flex-direction: column; gap: 2px; }
.nav a, .rail-foot a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: 14px; transition: background var(--t), color var(--t); }
.nav a:hover, .rail-foot a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.active, .rail-foot a.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav a .count { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.nav-label { padding: 12px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.rail-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.org-switch select { width: 100%; padding: 9px 10px; border: 1px solid var(--line-s); border-radius: 8px; background: var(--surface); font: inherit; font-weight: 600; color: var(--ink); }
.org-switch .faint { display: block; margin: 6px 0 0 2px; }
.main { padding: 36px 44px 80px; max-width: 1180px; width: 100%; }

/* Page header with Cy's one line */
.page-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.page-head .cy { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); max-width: 68ch; }
.page-head .cy::before { content: ""; flex: 0 0 3px; align-self: stretch; border-radius: 3px; background: var(--accent); margin-top: 3px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* Buttons and inputs. One radius everywhere. */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line-s); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; transition: background var(--t), border-color var(--t), transform var(--t); white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.danger { color: var(--crit); }
.btn:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=number], input[type=password], select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-s); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; transition: border-color var(--t), box-shadow var(--t); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.help { color: var(--ink-3); font-size: 13px; margin-top: 6px; }

/* Cards and lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; }
.card + .card { margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.section { margin-top: 36px; }
.section > h2 { margin-bottom: 14px; }
.section-note { color: var(--ink-2); margin: -8px 0 16px; max-width: 70ch; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.01em; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip.crit { background: var(--crit-soft); color: var(--crit); }
.chip.high { background: var(--high-soft); color: var(--high); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.mono { font-family: var(--mono); font-weight: 500; white-space: normal; max-width: 100%; text-align: left; }

/* Instrument tiles (the live applicability panel and the obligations page) */
.tile { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); transition: border-color var(--t), background var(--t), opacity var(--t); }
.tile.on { border-color: var(--accent-line); }
.tile.off { opacity: .55; }
.tile.unsure { border-style: dashed; }
.tile .t-title { font-weight: 700; }
.tile .t-sub { color: var(--ink-2); font-size: 13.5px; grid-column: 1 / -1; }
.tile .t-why { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.tile .t-cite { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tiles { display: flex; flex-direction: column; gap: 8px; }

/* Table for controls */
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.list th { text-align: left; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-weight: 700; }
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr:hover td { background: rgba(31, 79, 209, 0.025); }
.table-wrap { overflow-x: auto; }

/* Status marks */
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.status.covered::before { background: var(--ok); }
.status.partial::before { background: var(--high); }
.status.missing::before { background: var(--crit); }

/* Intake conversation */
.intake { max-width: 640px; }
.q { padding: 22px 0; border-bottom: 1px solid var(--line); }
.q:last-child { border-bottom: 0; }
.q h3 { font-size: 17px; margin-bottom: 4px; }
.q .help { margin-bottom: 12px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--line-s); border-radius: 8px; background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; transition: border-color var(--t), background var(--t); }
.opt:hover { border-color: var(--accent-line); }
.opt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.opt input { margin: 3px 0 0; accent-color: var(--accent); }
.opt small { display: block; color: var(--ink-3); font-weight: 500; font-size: 12.5px; margin-top: 2px; }
.opts.one { grid-template-columns: 1fr; }
.side-panel { position: sticky; top: 28px; }
.side-panel h3 { margin-bottom: 4px; }
.side-panel .faint { margin-bottom: 12px; display: block; }

/* Calendar */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-item .when { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.tl-item .when b { display: block; color: var(--ink); font-weight: 500; }
.tl-item.past { opacity: .6; }
.tl-item.soon .when b { color: var(--crit); }

/* Progress meter (coverage) */
.meter { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.meter span { display: block; height: 100%; }
.meter .m-cov { background: var(--ok); } .meter .m-par { background: var(--high); } .meter .m-mis { background: var(--crit); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }

/* Empty state */
.empty { padding: 40px 24px; text-align: center; border: 1px dashed var(--line-s); border-radius: var(--r); color: var(--ink-2); }
.empty h3 { margin-bottom: 6px; }

/* Drop zone */
.drop { padding: 34px 24px; text-align: center; border: 1.5px dashed var(--line-s); border-radius: var(--r); background: var(--surface); transition: border-color var(--t), background var(--t); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); opacity: 0; transition: opacity var(--t); pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; }

/* Access gate */
.gate { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 30; }
.gate-card { width: min(380px, 92vw); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px 30px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.gate-card svg { color: var(--accent); }
.gate-card h1 { font-size: 24px; }
.gate-card p { color: var(--ink-2); margin-bottom: 8px; }
.gate-card label { margin-top: 6px; }
.gate-error { color: var(--crit); font-weight: 600; font-size: 13.5px; }
.gate-card .btn { margin-top: 8px; justify-content: center; }

/* Print: the evidence pack */
@media print {
  .rail, .page-actions, .no-print { display: none !important; }
  .app { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12px; }
  .card, table.list { break-inside: avoid; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; }
  .nav, .rail-foot { flex-direction: row; flex-wrap: wrap; margin: 0; padding: 0; border: 0; }
  .nav-label { display: none; }
  .org-switch { flex: 1 1 200px; }
  .org-switch .faint { display: none; }
  .main { padding: 22px 16px 60px; }
  .split, .grid-2, .grid-3, .opts { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .tl-item { grid-template-columns: 1fr; gap: 4px; }
  h1 { font-size: 24px; }
}
