:root {
  --navy: #14213D; --navy-2: #22335A; --navy-line: #33456E; --navy-text: #E9E4D6; --navy-muted: #B8B2A3;
  --paper: #F6F3EA; --paper-2: #FBF9F3; --card: #FFFFFF; --line: #DDD6C6; --line-soft: #ECE6D8; --line-strong: #C9BFA9;
  --ink: #1C1F26; --ink-2: #2F333B; --ink-3: #3B3F48; --muted: #5A5F6B;
  --brass: #8A5A12; --brass-dark: #5E3D0B; --gold: #D9B26A;
  --high-fg: #8E2414; --high-bg: #F8E3DD; --med-fg: #7A4E0E; --med-bg: #F6E9CF; --low-fg: #22416B; --low-bg: #E3EAF4;
  --ok-fg: #1F4A2E; --ok-bg: #E2EFE5; --clear-bg: #EDE7D9;
  --cite-bg: #F1F4F9; --cite-fg: #22416B;
  --serif: 'Source Serif 4', Georgia, serif; --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --r: 14px; --r-sm: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
a { color: var(--brass); } a:hover { color: var(--brass-dark); }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); font-weight: 600; margin: 0; line-height: 1.2; }
h1 { font-size: clamp(28px, 3.2vw, 38px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; display: flex; }
.side { width: 256px; flex: none; background: var(--navy); color: var(--navy-text); padding: 24px 16px;
  display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { display: flex; align-items: center; gap: 12px; padding: 0 6px; text-decoration: none; }
.side .logo b { font-family: var(--serif); font-size: 21px; color: #fff; line-height: 1.1; display: block; }
.side .logo span { font-size: 12px; color: var(--navy-muted); }
.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navgroup > span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--navy-muted); padding: 0 12px 6px; }
.navlink { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 8px;
  color: var(--navy-text); text-decoration: none; }
.navlink:hover { background: rgba(255,255,255,.06); color: #fff; }
.navlink[aria-current="page"] { background: var(--navy-2); color: #fff; font-weight: 500; }
.navlink svg { width: 18px; height: 18px; flex: none; }
.navlink .count { margin-left: auto; font-size: 12px; background: var(--high-bg); color: var(--high-fg); border-radius: 999px; padding: 0 8px; font-weight: 600; }
.juris-box { margin-top: auto; padding: 14px; border: 1px solid var(--navy-line); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; }
.juris-box small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--navy-muted); }
.juris-box strong { font-family: var(--serif); font-size: 18px; color: #fff; font-weight: 500; }
.juris-box p { margin: 0; font-size: 12px; color: var(--navy-muted); }
.juris-box a { color: var(--gold); font-size: 13px; font-weight: 600; }
.brandrow { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 6px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--line); background: rgba(246,243,234,.94); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px); }
.menu-btn { display: none; }
.search { flex: 1 1 280px; max-width: 520px; position: relative; }
.search label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.search input { border: 0; outline: none; background: transparent; width: 100%; }
.search-results { position: absolute; left: 0; right: 0; top: 50px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: 0 12px 32px rgba(20,33,61,.14); max-height: 60vh; overflow: auto; z-index: 20; padding: 6px; }
.search-results a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a:focus { background: var(--paper); }
.search-results small { color: var(--muted); margin-left: auto; }
.topbar .spacer { flex: 1; }
.content { flex: 1; padding: 32px clamp(16px, 3vw, 44px) 24px; display: flex; flex-direction: column; gap: 28px; max-width: 1480px; width: 100%; }
.disclaimer { margin: 0; padding: 14px clamp(16px, 3vw, 44px) 28px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-soft); }
.disclaimer b { color: var(--ink-3); }

/* ---------- building blocks ---------- */
.eyebrow { font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); font-weight: 600; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head > div:first-child { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 420px; }
.lede { margin: 0; color: var(--ink-3); max-width: 760px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.card.pad { padding: 22px 24px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.card-body { padding: 18px 22px; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.row > .wide { flex: 3 1 480px; min-width: 0; }
.row > .narrow { flex: 2 1 320px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; color: var(--cite-fg); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: #fff; color: var(--navy); font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--paper-2); color: var(--navy); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); color: #fff; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.link { border: 0; background: none; padding: 0; min-height: 32px; color: var(--brass); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn svg { width: 18px; height: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--clear-bg); color: var(--ink-3); white-space: nowrap; }
.pill.navy { background: #E3E8F2; color: var(--navy); }
.sev { display: inline-block; flex: none; min-width: 64px; text-align: center; padding: 2px 8px; border-radius: 6px; font-size: 12px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.sev.High { background: var(--high-bg); color: var(--high-fg); } .sev.Medium { background: var(--med-bg); color: var(--med-fg); }
.sev.Low { background: var(--low-bg); color: var(--low-fg); } .sev.Clear { background: var(--clear-bg); color: var(--ink-3); }
.status.Growing, .status.won { background: var(--ok-bg); color: var(--ok-fg); }
.status.Building, .status.Testing { background: var(--med-bg); color: var(--med-fg); }
.status.lost { background: var(--high-bg); color: var(--high-fg); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { font-family: var(--serif); font-size: 28px; color: var(--navy); font-weight: 600; line-height: 1.15; }
.kpi small { font-size: 12.5px; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 22px; border-bottom: 1px solid var(--line-soft); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list .title { font-weight: 600; }
.empty { padding: 22px; color: var(--muted); }
.mark { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 9px; color: #fff;
  font-family: var(--serif); font-weight: 600; letter-spacing: .02em; overflow: hidden; }
.mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.field input, .field select, .field textarea { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; font-size: 15px; font-weight: 400; color: var(--ink); }
.field textarea { min-height: 96px; resize: vertical; }
.form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form .full { grid-column: 1 / -1; }
.checks { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; }
.checks legend { font-size: 13px; font-weight: 500; color: var(--ink-3); padding-bottom: 6px; }
.checks label { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.checks input { width: 18px; height: 18px; accent-color: var(--navy); }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px; padding: 18px;
  border: 1.5px dashed #B9AE95; border-radius: 12px; background: var(--paper-2); text-align: center; cursor: pointer; }
.drop.over { background: #F1ECDD; border-color: var(--navy); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop strong { color: var(--navy); }
.tbl-wrap { position: relative; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.toggle { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.toggle button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--navy);
  font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.toggle button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px;
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 50; max-width: 90vw; }
.toast.error { background: var(--high-fg); }
.loading { display: flex; align-items: center; gap: 12px; padding: 22px; color: var(--muted); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--navy); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
dialog { border: 1px solid var(--line); border-radius: var(--r); padding: 0; width: min(640px, 94vw); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(20,33,61,.45); }
dialog form > header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
dialog form > .form { padding: 20px 22px; }
dialog form > footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-soft); background: var(--paper-2); }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--med-bg); color: var(--med-fg); font-size: 14px; }
.notice.info { background: var(--low-bg); color: var(--low-fg); }

/* ---------- Today ---------- */
.day { display: grid; grid-template-columns: 92px 1fr; gap: 0 18px; }
.day .time { font-family: var(--mono); font-size: 13px; color: var(--brass); padding-top: 22px; text-align: right; position: relative; }
.day .slot { padding: 14px 0 22px; border-left: 2px solid var(--line); padding-left: 22px; position: relative; display: flex; flex-direction: column; gap: 12px; }
.day .slot::before { content: ""; position: absolute; left: -7px; top: 24px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--brass); }
.day .slot.now::before { background: var(--brass); }
.slot-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brief { font-family: var(--serif); font-size: 19px; line-height: 1.55; color: var(--ink-2); margin: 0; }
.focus-input { display: flex; gap: 10px; flex-wrap: wrap; }
.focus-input input { flex: 1 1 260px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.stream-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.stile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
.stile:hover { border-color: var(--navy); color: inherit; }
.stile .top { display: flex; gap: 10px; align-items: center; }
.stile .num { font-family: var(--mono); font-size: 12px; color: var(--brass); }
.stile b { font-family: var(--serif); color: var(--navy); font-size: 16px; line-height: 1.25; }
.stile .figs { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.stile .figs strong { color: var(--ink); font-weight: 600; }

/* ---------- pipeline ---------- */
.board { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.col { background: #EFEADD; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 240px; }
.col.over { outline: 2px dashed var(--navy); }
.col-head { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 6px; }
.col-head b { font-family: var(--serif); color: var(--navy); text-transform: capitalize; }
.col-head small { color: var(--muted); }
.deal { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; cursor: grab; }
.deal:active { cursor: grabbing; }
.deal.dragging { opacity: .5; }
.deal .t { font-weight: 600; line-height: 1.3; }
.deal .o { font-size: 13px; color: var(--muted); }
.deal .m { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 13px; flex-wrap: wrap; }
.deal .money { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.deal .move { display: flex; gap: 6px; }
.deal .move select { font-size: 13px; min-height: 32px; border-radius: 6px; border: 1px solid var(--line-strong); background: #fff; padding: 0 6px; }

/* ---------- client record ---------- */
.record-head { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.avatar { width: 64px; height: 64px; border-radius: 16px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 26px; font-weight: 600; flex: none; }
.timeline { list-style: none; margin: 0; padding: 0 22px 10px; }
.timeline li { position: relative; padding: 12px 0 12px 22px; border-left: 2px solid var(--line-soft); }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--brass); }
.timeline time { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- law ---------- */
.client-card { display: flex; flex-direction: column; gap: 16px; }
.client-card .figs { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.client-card .figs span { font-size: 13px; color: var(--muted); display: block; }
.client-card .figs b { font-family: var(--serif); font-size: 26px; color: var(--navy); font-weight: 600; }
.doc { font-family: var(--serif); font-size: 16.5px; line-height: 1.7; color: #23262E; padding: 34px clamp(18px, 4vw, 52px); display: flex; flex-direction: column; gap: 16px; }
.doc h3 { font-size: 18px; margin-top: 6px; }
.doc p { margin: 0; padding: 6px 10px; border-radius: 6px; }
.doc .ref { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-right: 8px; }
.doc p.flagged { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; }
.doc p.flagged.High { text-decoration-color: #B3261E; } .doc p.flagged.Medium { text-decoration-color: #A8731A; } .doc p.flagged.Low { text-decoration-color: #2D4F7C; }
.doc p.sel { text-decoration: none; }
.doc p.sel.High { background: rgba(179,38,30,.10); box-shadow: inset 3px 0 0 #B3261E; }
.doc p.sel.Medium { background: rgba(176,122,24,.14); box-shadow: inset 3px 0 0 #A8731A; }
.doc p.sel.Low { background: rgba(45,79,124,.10); box-shadow: inset 3px 0 0 #2D4F7C; }
.flagbtn { display: flex; gap: 12px; align-items: flex-start; width: 100%; min-height: 56px; padding: 12px 14px; border-radius: 10px; cursor: pointer;
  background: var(--paper-2); border: 1px solid var(--line); text-align: left; }
.flagbtn[aria-pressed="true"] { background: #fff; border: 2px solid var(--navy); padding: 11px 13px; }
.flagbtn.dismissed { opacity: .55; }
.cite { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--cite-bg); border-radius: 8px; }
.cite q { font-family: var(--serif); font-size: 14.5px; color: var(--ink-2); quotes: "“" "”"; }
.redline { padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 8px; font-family: var(--serif); font-size: 15.5px; line-height: 1.6; display: flex; flex-direction: column; gap: 6px; }
.redline del { color: var(--high-fg); }
.redline ins { color: var(--ok-fg); text-decoration-color: #6E9B7C; }
.verdict { font-family: var(--serif); font-size: 20px; color: var(--navy); font-weight: 600; }
.chat { display: flex; flex-direction: column; gap: 18px; }
.bubble-q { align-self: flex-end; max-width: 82%; background: var(--navy); color: #fff; padding: 14px 18px; border-radius: 16px 16px 4px 16px; }
.answer { display: flex; gap: 14px; align-items: flex-start; }
.answer .who { width: 38px; height: 38px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; }
.answer .body { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.answer h4 { margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--brass); }
.answer p, .answer ol { margin: 0; }
.answer ol { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.answer sup a { font-family: var(--mono); font-size: 11px; text-decoration: none; }
.next { background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; }
.composer { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 12px; position: sticky; bottom: 12px; box-shadow: 0 -6px 24px rgba(246,243,234,.9); }
.composer textarea { border: 0; outline: none; resize: vertical; min-height: 64px; background: transparent; width: 100%; }
.composer .bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.composer .bar .field { flex: 1 1 150px; }
.law-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.law-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.law-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.law-card .lvl { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.law-card b { font-family: var(--serif); font-size: 17px; color: var(--navy); font-weight: 600; }
.law-card .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; width: 272px; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(20,33,61,.4); }
  .menu-btn { display: inline-flex; }
  .day { grid-template-columns: 1fr; }
  .day .time { text-align: left; padding: 10px 0 0 24px; }
  .bubble-q { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } .side { transition: none; } }

/* polish */
.topbar .menu-btn { display: none; }
#view:focus { outline: none; }
.side .mark { box-shadow: 0 0 0 1.5px rgba(255,255,255,.6); }
.kpis.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kpis.compact .kpi { padding: 10px 12px; }
.kpis.compact .kpi b { font-size: 22px; }
@media (max-width: 900px) { .topbar .menu-btn { display: inline-flex; } }

/* ---------- bids & calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); }
.cal .dow { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.cal .day-cell { min-height: 104px; padding: 6px 8px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal .day-cell:nth-child(7n) { border-right: 0; }
.cal .day-cell.out { background: var(--paper-2); }
.cal .day-cell.out .n { color: #A8A396; }
.cal .day-cell.today { background: #FBF4E4; }
.cal .n { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.cal .day-cell.today .n { color: var(--brass); font-weight: 600; }
.ev { display: block; font-size: 12px; line-height: 1.3; padding: 3px 6px; border-radius: 5px; text-decoration: none; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--line-strong); background: var(--paper-2); }
.ev:hover { color: var(--ink); filter: brightness(.97); }
.ev.bid_due { border-color: #B3261E; background: var(--high-bg); }
.ev.bid_due.urgent { font-weight: 600; }
.ev.questions_due { border-color: #A8731A; background: var(--med-bg); }
.ev.erate_clock, .ev.key_erate { border-color: #1F5C4A; background: #E2EFE5; }
.ev.key_registration, .ev.key_procurement, .ev.key_grant, .ev.key_other { border-color: var(--navy); background: #E3E8F2; }
.ev.key_budget { border-color: var(--brass); background: #F3EAD7; }
.ev.renewal, .ev.contract { border-color: #2D4F7C; background: var(--low-bg); }
.ev.deal_close { border-color: #6B3FA0; background: #EEE6F6; }
.ev.milestone { border-color: #1F4A2E; background: var(--ok-bg); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12.5px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.countdown { font-family: var(--mono); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.countdown.late { color: var(--high-fg); } .countdown.soon { color: var(--med-fg); } .countdown.ok { color: var(--ink-3); }
.progress { height: 6px; background: var(--line-soft); border-radius: 99px; overflow: hidden; min-width: 70px; }
.progress b { display: block; height: 100%; background: var(--navy); }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.check-list li { border-bottom: 1px solid var(--line-soft); }
.check-list li:last-child { border-bottom: 0; }
.check-list label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 22px; cursor: pointer; }
.check-list input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--navy); flex: none; }
.check-list .rule { font-size: 12px; color: var(--muted); }
.keydate { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 22px; border-bottom: 1px solid var(--line-soft); align-items: center; }
.keydate:last-child { border-bottom: 0; }
.keydate input[type=date] { min-height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: #fff; }
.keydate .where { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
@media (max-width: 760px) {
  .cal { grid-template-columns: 1fr; }
  .cal .dow, .cal .day-cell.out, .cal .day-cell.empty { display: none; }
  .cal .day-cell { min-height: 0; border-right: 0; }
}
.bid-title-cell { min-width: 260px; }
.calllist-link { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px; text-decoration: none; color: inherit; }
.calllist-link:hover { background: var(--paper-2); color: inherit; }
.calllist-link[aria-current="page"] { background: #EEF1F7; box-shadow: inset 3px 0 0 var(--navy); }
#items input, #items select { min-height: 36px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 8px; background: #fff; }
#items td { vertical-align: middle; }

/* Inbox review */
.inbox-item { align-items: flex-start; }
.inbox-item .grow { display: flex; flex-direction: column; gap: 3px; }
.inbox-item .snippet { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inbox-item .match { color: var(--ok-fg); }
.inbox-item .match.none { color: var(--med-fg); }
.inbox-item.unmatched { background: var(--paper-2); }
.inbox-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; max-width: 260px; }
@media (max-width: 640px) { .inbox-acts { max-width: none; justify-content: flex-start; } .inbox-item { flex-direction: column; gap: 8px; } }

/* Projects */
.pill.health.med { background: var(--med-bg); color: var(--med-fg); }
.pill.health.high { background: var(--high-bg); color: var(--high-fg); }
.progress.over b { background: var(--high-fg); }
.kpi .progress { margin: 6px 0 2px; }
.check-list input[type=date] { width: auto; height: auto; min-height: 36px; margin: 0; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 8px; background: #fff; font-size: 13px; }
.check-list li > .small { padding: 8px 0 8px 22px; }
.page-head select { min-height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 0 10px; background: #fff; }

/* Morning encouragement */
.cheer { margin: 0 0 16px; padding: 20px 22px 14px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--r); }
.cheer blockquote { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.4; font-style: italic; color: var(--navy); }
.cheer figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.cheer cite { font-style: italic; }
.cheer .verse { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); font-family: var(--serif); font-size: 16px; color: var(--ink-2); }
.cheer .verse span { font-family: var(--sans); font-size: 13px; color: var(--brass); white-space: nowrap; }
.cheer .note { margin: 12px 0 0; font-weight: 600; color: var(--ink); }
.cheer-acts { display: flex; gap: 12px; margin-top: 8px; }
@media (max-width: 640px) { .cheer blockquote { font-size: 19px; } }
.cur-select { min-height: 30px; border: 1px solid var(--line-strong); border-radius: 99px; padding: 0 10px; background: #fff; font-size: 13px; font-weight: 600; }

/* Events */
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.ev-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; text-decoration: none; color: var(--ink); border-top: 4px solid var(--brass); }
.ev-card:hover { box-shadow: 0 2px 10px rgba(20, 33, 61, .08); }
.ev-card b { font-family: var(--serif); font-size: 19px; line-height: 1.3; color: var(--navy); }
.ev-figs { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; margin-top: 6px; }
.ev-card .progress { margin-top: 6px; }
.pill.med { background: var(--med-bg); color: var(--med-fg); }
td select, td input[type=number] { min-height: 34px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 6px; background: #fff; }

/* Doc — AI chief of staff */
#doc-fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; display: flex; align-items: center; gap: 10px;
  padding: 6px 18px 6px 6px; border-radius: 99px; border: 2px solid var(--gold); background: var(--navy); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 6px 22px rgba(20, 33, 61, .28); }
#doc-fab:hover { background: var(--navy-2); }
#doc-fab img { border-radius: 50%; }
#doc-panel { position: fixed; right: 22px; bottom: 22px; z-index: 50; width: min(440px, calc(100vw - 32px)); height: min(720px, calc(100vh - 44px));
  display: flex; flex-direction: column; background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: 18px;
  box-shadow: 0 18px 48px rgba(20, 33, 61, .28); overflow: hidden; }
#doc-panel[hidden] { display: none; }
#doc-panel header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--navy); color: #fff; }
#doc-panel header div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#doc-panel header b { font-family: var(--serif); font-size: 17px; }
#doc-panel header span { font-size: 12.5px; color: var(--navy-muted); }
#doc-panel header .btn { background: transparent; color: #fff; border-color: var(--navy-line); }
#doc-panel header .btn.link { border: 0; color: var(--gold); }
#doc-msgs { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.doc-msg { display: flex; gap: 8px; align-items: flex-start; }
.doc-msg.user { justify-content: flex-end; }
.doc-msg .doc-body { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; }
.doc-msg.assistant .doc-body { background: #fff; border: 1px solid var(--line); border-top-left-radius: 4px; }
.doc-msg.user .doc-body { background: var(--navy); color: #fff; border-top-right-radius: 4px; }
.doc-body p { margin: 0 0 8px; } .doc-body p:last-child { margin-bottom: 0; }
.doc-body h4 { margin: 10px 0 4px; font-family: var(--serif); font-size: 16px; color: var(--navy); }
.doc-body ul, .doc-body ol { margin: 4px 0 8px; padding-left: 20px; } .doc-body li { margin: 2px 0; }
.doc-body code { font-family: var(--mono); font-size: 13px; background: var(--paper); padding: 0 4px; border-radius: 4px; }
.doc-mini { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.doc-suggest { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.doc-suggest .btn { text-align: left; justify-content: flex-start; white-space: normal; height: auto; padding: 8px 10px; }
.doc-looked { margin-top: 8px; font-size: 12px; color: var(--muted); }
.doc-thinking span { animation: docdot 1.2s infinite; } .doc-thinking span:nth-child(2) { animation-delay: .2s; } .doc-thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes docdot { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .doc-thinking span { animation: none; } }
.doc-err { color: var(--high-fg); }
.doc-starters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.doc-starters.used { display: none; }
.chip { font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--brass); }
#doc-panel form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: #fff; }
#doc-panel textarea { flex: 1; resize: none; font: inherit; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; }
.doc-note { margin: 0; padding: 6px 14px 10px; font-size: 11.5px; color: var(--muted); background: #fff; }
@media (max-width: 640px) {
  #doc-fab { right: 12px; bottom: 12px; padding-right: 14px; }
  #doc-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
}
.look-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.look-row img { border-radius: 50%; flex: none; }
.look-grid { flex: 1 1 320px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* ===== Energy: Today hero, rings, streak, celebrations, motion ===== */
.hero { display: flex; flex-wrap: wrap; gap: 20px 28px; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-radius: 20px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, #2B3F6B 0%, var(--navy) 55%, #0E182E 100%); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 178, 106, .35), transparent 70%); pointer-events: none; }
.hero-doc { display: flex; gap: 16px; align-items: flex-start; flex: 1 1 380px; min-width: 0; }
.hero-doc img { border-radius: 50%; flex: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.hero .bubble { position: relative; background: var(--paper-2); color: var(--ink); border-radius: 16px; padding: 14px 18px; flex: 1; min-width: 0; }
.hero .bubble::before { content: ""; position: absolute; left: -9px; top: 26px; border: 10px solid transparent; border-right-color: var(--paper-2); border-left: 0; }
.hero .bubble h1 { font-size: 30px; margin: 2px 0 6px; color: var(--navy); }
.hero .bubble p { margin: 0 0 12px; font-size: 15.5px; }
.momentum { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; position: relative; z-index: 1; }
.rings { display: flex; gap: 14px; flex-wrap: wrap; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 128px; text-align: center; }
.ring svg { transform: rotate(-90deg); }
.ring .track { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 8; }
.ring .fill { fill: none; stroke-width: 8; stroke-linecap: round; animation: ringfill 1.1s cubic-bezier(.2, .8, .2, 1); }
.ring.cash .fill { stroke: #F2D23C; } .ring.won .fill { stroke: #6FCF97; } .ring.touches .fill { stroke: #F2A07B; }
.ring.met .fill { filter: drop-shadow(0 0 6px rgba(242, 210, 60, .7)); }
@keyframes ringfill { from { stroke-dashoffset: var(--c); } }
.ring-dial { position: relative; width: 96px; height: 96px; }
.ring-dial .ring-val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 15px; letter-spacing: -.2px; }
.ring-pct { font-size: 12px; color: #F3EAD7; font-weight: 600; }
.ring-pct a { color: var(--gold); }
.ring small { font-size: 11.5px; color: var(--navy-muted); line-height: 1.25; }
.streak { display: flex; flex-direction: column; align-items: center; text-align: center; width: 150px; padding: 10px 12px;
  border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.streak .flame { font-size: 30px; filter: grayscale(1) opacity(.5); }
.streak.on .flame { filter: none; animation: flicker 1.8s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.12) rotate(3deg); } }
.streak b { font-family: var(--serif); font-size: 17px; }
.streak small { font-size: 11.5px; color: var(--navy-muted); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.cheer-pop { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 95; display: flex; gap: 12px; align-items: center;
  width: min(520px, calc(100vw - 32px)); padding: 12px 16px; background: var(--paper-2); border: 2px solid var(--gold); border-radius: 18px;
  box-shadow: 0 14px 40px rgba(20, 33, 61, .3); animation: popin .45s cubic-bezier(.2, 1.4, .4, 1); }
.cheer-pop img { border-radius: 50%; flex: none; }
.cheer-pop div { display: flex; flex-direction: column; } .cheer-pop b { font-family: var(--serif); font-size: 19px; color: var(--navy); }
.cheer-pop small { color: var(--brass); font-weight: 600; }
@keyframes popin { from { transform: translate(-50%, 30px) scale(.85); opacity: 0; } }
/* Lift on hover: cards you can click feel alive */
.kpi, .stile, .ev-card, a.card { transition: transform .15s ease, box-shadow .15s ease; }
.kpi:hover, .stile:hover, .ev-card:hover, a.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(20, 33, 61, .1); }
/* Doc keeps you company on empty screens */
.empty::before { content: ""; display: block; width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--doc-avatar) center / cover no-repeat; }
.empty { text-align: center; }
@media (prefers-reduced-motion: reduce) {
  .ring .fill, .streak.on .flame, .cheer-pop { animation: none; }
  .kpi, .stile, .ev-card, a.card { transition: none; }
  .kpi:hover, .stile:hover, .ev-card:hover, a.card:hover { transform: none; }
}
@media (max-width: 640px) {
  .hero { padding: 16px; } .hero .bubble h1 { font-size: 24px; }
  .hero-doc img { width: 72px; height: 72px; }
  .momentum, .rings { width: 100%; } .rings { gap: 6px; flex-wrap: nowrap; justify-content: space-between; }
  .ring { flex: 1 1 0; min-width: 0; width: auto; }
  .ring-dial, .ring-dial svg { width: 80px; height: 80px; } .ring-dial .ring-val { font-size: 13px; }
  .streak { width: 100%; flex-direction: row; gap: 10px; text-align: left; }
}

/* ---------- signed-in person (hosted hub) ---------- */
.who { display: flex; flex-direction: column; gap: 8px; padding: 12px 6px 0; border-top: 1px solid var(--navy-line); font-size: 13px; color: var(--navy-muted); }
.who b { color: #fff; font-weight: 500; }
.who .btn { align-self: flex-start; background: transparent; color: var(--navy-text); border-color: var(--navy-line); }
.codes-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: var(--mono); list-style: none; padding: 12px; margin: 0; background: var(--paper); border-radius: 8px; text-align: center; }

/* ---------- Capture Desk ---------- */
.plain-list { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.plain-list.warn li::marker { color: var(--med-fg); }

/* ---------- Your checklist ---------- */
.cl-bar { flex: 1 1 200px; height: 10px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.cl-bar span { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.cl-list { list-style: none; margin: 0; padding: 0; }
.cl-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 22px; border-bottom: 1px solid var(--line-soft); }
.cl-item:last-child { border-bottom: 0; }
.cl-item > input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--navy); }
.cl-item details { flex: 1; min-width: 0; }
.cl-item summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.cl-item summary::-webkit-details-marker { display: none; }
.cl-item summary .title { font-weight: 600; cursor: pointer; }
.cl-item.is-done summary .title { text-decoration: line-through; color: var(--muted); }
.cl-body { padding-top: 10px; display: grid; gap: 8px; font-size: 14.5px; }
.cl-body p, .cl-body ol { margin: 0; }
.cl-body ol { padding-left: 20px; display: grid; gap: 4px; }
