/* Look follows the Trademark Desk product: ink navy, cream paper, gold accents.
   Token values copied from design/tokens/tokens.ts (read only reference). */
:root {
  --ink: #0F1C39; --ink-2: #122341; --ink-3: #1D3058; --ink-4: #294269;
  --paper: #F5F3EE; --paper-2: #FBFAF6; --paper-3: #EDEAE2;
  --line: rgba(10,18,38,.12); --line-2: rgba(10,18,38,.07);
  --line-dark: rgba(255,255,255,.10);
  --muted: #6C7079; --muted-text: #565A63; --muted-dark: #A9AFBA;
  --gold: #C69A4C; --gold-2: #E2C079; --gold-soft: rgba(198,154,76,.12); --gold-line: rgba(198,154,76,.32);
  --gold-ink: color-mix(in oklab, var(--gold) 48%, black);
  --teal: #4E8F82; --red: #C05F45; --amber: #CFA04E; --slate: #5E6E80; --green: #5B9A72; --violet: #7B6E9E;
  --teal-ink: color-mix(in oklab, var(--teal) 52%, black);
  --red-ink: color-mix(in oklab, var(--red) 56%, black);
  --amber-ink: color-mix(in oklab, var(--amber) 46%, black);
  --slate-ink: color-mix(in oklab, var(--slate) 62%, black);
  --green-ink: color-mix(in oklab, var(--green) 50%, black);
  --violet-ink: color-mix(in oklab, var(--violet) 58%, black);
  --white: #fff;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --head: 'Inter Tight', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r-sm: 8px; --r-md: 12px; --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(10,18,38,.06);
  --shadow-md: 0 6px 24px rgba(10,18,38,.10);
  --shadow-lg: 0 18px 48px rgba(10,18,38,.16);
  --ease: cubic-bezier(.22,.61,.36,1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper-3); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.5; letter-spacing: -.006em; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin: 0; }
h2 { font-size: 15px; } h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--ink); text-decoration-color: var(--gold-line); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--gold); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.sidebar :focus-visible, .bottombar :focus-visible, .btn.primary:focus-visible { outline-color: var(--gold-2); }
.btn.primary:focus-visible { outline-color: var(--ink); }
::selection { background: var(--gold); color: var(--ink); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.num, .mono { font-family: var(--mono); font-feature-settings: 'tnum'; letter-spacing: -.02em; }
.muted { color: var(--muted-text); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.red-t { color: var(--red-ink); } .green-t { color: var(--green-ink); }

/* ---------- frame ---------- */
.frame { min-height: 100dvh; }
.sidebar { display: none; }
.panel { background: var(--paper); min-width: 0; min-height: 100dvh; padding-bottom: 76px; }
.protonote { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 16px; font-size: 12px; color: var(--muted-text); border-bottom: 1px solid var(--line-2); background: var(--paper-2); }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; text-decoration-color: var(--gold-line); text-underline-offset: 2px; font-size: 12px; }
.linkbtn:hover { text-decoration-color: var(--gold); }
.linkbtn.dark { color: var(--muted-dark); }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 16px; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { flex: 1; min-width: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewas { display: flex; align-items: center; gap: 8px; min-width: 0; }
.viewas label { font-size: 12px; color: var(--muted-text); white-space: nowrap; display: none; }
.viewas select { max-width: 190px; font-weight: 500; }
#main { padding: 16px 16px 24px; outline: none; max-width: 1560px; margin: 0 auto; }
@media (min-width: 640px) { .viewas label { display: block; } .viewas select { max-width: 260px; } }
@media (min-width: 640px) { #main { padding: 20px 24px 28px; } .topbar, .protonote { padding-left: 24px; padding-right: 24px; } }
@media (min-width: 1024px) {
  .frame { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 10px; height: calc(100dvh - 20px); background: var(--ink); color: var(--paper); border-radius: var(--r-lg); background-image: radial-gradient(100% 30% at 20% 0%, rgba(198,154,76,.15), transparent 70%); }
  .panel { border-radius: var(--r-lg); min-height: calc(100dvh - 20px); padding-bottom: 0; overflow: clip; }
  .topbar { border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .bottombar { display: none !important; }
  .protonote .mobonly { display: none; }
}
.brand { padding: 16px 16px 12px; }
.brandname { font-family: var(--head); font-weight: 600; font-size: 15px; letter-spacing: -.02em; line-height: 1.2; color: #fff; }
.brandfirm { font-size: 12px; color: var(--muted-dark); margin-top: 2px; }
.sidebar nav { flex: 1; padding: 6px 8px; overflow-y: auto; }
.sidebar ul, .bottombar ul { list-style: none; margin: 0; padding: 0; }
.sidebar nav ul { display: flex; flex-direction: column; gap: 2px; }
.navlink { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--muted-dark); text-decoration: none; font-family: var(--head); font-weight: 500; font-size: 14px; }
.navlink span:nth-child(2) { flex: 1; }
.navlink:hover { background: rgba(255,255,255,.06); color: #fff; }
.navlink.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 1px 2px rgba(10,28,57,.25); }
.navcount { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; font-size: 11px; font-weight: 600; text-align: center; line-height: 18px; font-family: var(--mono); }
.navcount.red { background: var(--red-ink); }
.navlink.on .navcount { background: rgba(15,28,57,.18); color: var(--ink); }
.sidefoot { padding: 12px 16px; border-top: 1px solid var(--line-dark); }
.bottombar { position: fixed; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 40; background: var(--ink); border-radius: var(--r-lg); padding: 4px; box-shadow: var(--shadow-lg); }
.bottombar > ul { display: grid; grid-template-columns: repeat(6, 1fr); max-width: 560px; margin: 0 auto; }
.bblink { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; color: var(--muted-dark); text-decoration: none; font-size: 10.5px; font-weight: 500; background: none; border: 0; width: 100%; font-family: var(--head); }
.bblink.on { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink); }
.morewrap { position: relative; }
.moremenu { position: absolute; right: 0; bottom: calc(100% + 10px); min-width: 170px; background: var(--ink); border: 1px solid var(--line-dark); border-radius: 12px; padding: 4px; box-shadow: var(--shadow-lg); }
.moremenu[hidden] { display: none; }
.moremenu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #fff; text-decoration: none; border-radius: 8px; font-family: var(--head); font-weight: 500; }
.moremenu a:hover, .moremenu a[aria-current] { background: rgba(255,255,255,.1); }
.toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 8px); max-width: min(92vw, 520px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 1024px) { .toast { bottom: 24px; } }

/* ---------- buttons and forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); color: var(--ink); font-weight: 500; font-size: 13px; text-decoration: none; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--ink-4); }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: var(--gold); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 1px 2px rgba(10,28,57,.2); font-weight: 600; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.04); border-color: var(--gold); }
.btn.danger { color: var(--red-ink); border-color: color-mix(in srgb, var(--red) 45%, white); }
.btn.sm { min-height: 28px; padding: 3px 10px; font-size: 12px; border-radius: 8px; }
.btn:disabled { background: var(--paper-3); border-color: var(--line-2); color: var(--muted-text); box-shadow: none; opacity: .75; filter: none; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.why { font-size: 12.5px; color: var(--muted-text); }
.why .btn { margin-left: 4px; }
label.l, .field > span { display: block; font-size: 12px; font-weight: 500; color: var(--muted-text); margin-bottom: 3px; }
input[type=text], input[type=number], input[type=search], input[type=date], select, textarea { width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--ink); font: inherit; font-size: 13px; }
select { padding-right: 26px; text-overflow: ellipsis; }
textarea { min-height: 66px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #727680; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }
.formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.formgrid .full { grid-column: 1 / -1; }
@media (min-width: 900px) { .formgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .formgrid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .formgrid { grid-template-columns: minmax(0, 1fr); } }
.err { color: var(--red-ink); font-size: 12.5px; }

/* ---------- cards, layout ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); min-width: 0; }
.card + .card, .stack > * + * { margin-top: 14px; }
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.cardhead .sub { font-size: 12px; color: var(--muted-text); font-weight: 400; }
.cardbody { padding: 12px 14px; }
.cols2, .cols3, .cols21, .cols12 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.cols2 > .card + .card, .cols3 > .card + .card, .cols21 > * + *, .cols12 > * + * { margin-top: 0; }
@media (min-width: 900px) { .cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cols21 { grid-template-columns: minmax(0, 1fr) 340px; } .cols12 { grid-template-columns: 340px minmax(0, 1fr); } }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pagehead p { font-size: 13px; color: var(--muted-text); }
.pagehead h2 { font-size: 18px; }
.crumb { font-size: 12.5px; margin-bottom: 8px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); margin-bottom: 14px; overflow: hidden; }
.kpi { padding: 12px 14px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); min-width: 0; text-decoration: none; display: block; }
a.kpi:hover { background: var(--paper-2); }
.kpi b { display: block; font-family: var(--mono); font-weight: 500; font-size: 22px; letter-spacing: -.03em; line-height: 1.2; }
.kpi span { display: block; font-size: 12px; color: var(--muted-text); }
.kpi small { display: block; font-size: 11.5px; color: var(--muted-text); margin-top: 2px; }
@media (min-width: 900px) { .kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } .kpi { border-bottom: 0; } .kpi:last-child { border-right: 0; } }
@media (max-width: 899px) { .kpi:nth-child(2n) { border-right: 0; } }

/* chips */
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; line-height: 18px; white-space: nowrap; border: 1px solid transparent; }
.chip.slate { background: color-mix(in srgb, var(--slate) 14%, white); color: var(--slate-ink); }
.chip.amber { background: color-mix(in srgb, var(--amber) 22%, white); color: var(--amber-ink); }
.chip.violet { background: color-mix(in srgb, var(--violet) 16%, white); color: var(--violet-ink); }
.chip.red { background: color-mix(in srgb, var(--red) 15%, white); color: var(--red-ink); }
.chip.green { background: color-mix(in srgb, var(--green) 17%, white); color: var(--green-ink); }
.chip.teal { background: color-mix(in srgb, var(--teal) 16%, white); color: var(--teal-ink); }
.chip.gold { background: var(--gold-soft); color: var(--gold-ink); }
.help { border-bottom: 1px dotted var(--muted); cursor: help; }
.helptext { font-size: 12.5px; color: var(--muted-text); }
.callout { padding: 9px 12px; border-radius: 10px; font-size: 13px; background: var(--gold-soft); border: 1px solid var(--gold-line); }
.callout.red { background: color-mix(in srgb, var(--red) 10%, white); border-color: color-mix(in srgb, var(--red) 35%, white); }
.callout.plain { background: var(--paper-2); border-color: var(--line); }

/* tables: stacked rows on phones */
.tablewrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted-text); padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--paper-2); white-space: nowrap; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--paper-2); }
.tbl .r, .tbl th.r { text-align: right; }
.tbl tfoot td { font-weight: 600; background: var(--paper-2); border-top: 1px solid var(--line); }
.tbl td.act { white-space: nowrap; }
.tbl td .sub { display: block; font-size: 12px; color: var(--muted-text); }
@media (max-width: 719px) {
  table.tbl, .tbl tbody, .tbl tfoot, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl tr { padding: 8px 12px; border-bottom: 1px solid var(--line); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right !important; overflow-wrap: anywhere; }
  .tbl td::before { content: attr(data-label); color: var(--muted-text); font-size: 12px; text-align: left; flex: none; max-width: 42%; }
  .tbl td.first { font-weight: 600; text-align: left !important; }
  .tbl td.first::before, .tbl td[data-label=""]::before { display: none; }
  .tbl td.act { justify-content: flex-end; white-space: normal; }
  .tbl tfoot tr { display: flex; justify-content: space-between; }
  .tbl tfoot td { width: auto; }
  .tbl tfoot td::before { display: none; }
}
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.filters .search { grid-column: 1 / -1; }
@media (min-width: 900px) { .filters { grid-template-columns: 2fr repeat(5, 1fr); } .filters .search { grid-column: auto; } }
.empty { padding: 20px 14px; text-align: center; color: var(--muted-text); }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { background: none; border: 0; padding: 9px 13px; font-family: var(--head); font-weight: 500; font-size: 13.5px; color: var(--muted-text); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab[aria-selected=true] { color: var(--ink); border-bottom-color: var(--gold); }
.tab:hover { color: var(--ink); }
.tab .n { font-family: var(--mono); font-size: 11px; margin-left: 5px; color: var(--muted-text); }

/* bars */
.bar { height: 6px; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink-4); border-radius: 99px; }
.bar.gold > i { background: var(--gold); }
.bar.red > i { background: var(--red); }
.pipeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stagecell { padding: 12px 14px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); text-decoration: none; display: block; min-width: 0; }
a.stagecell:hover { background: var(--paper-2); }
.stagecell .big { font-family: var(--mono); font-size: 26px; font-weight: 500; letter-spacing: -.04em; line-height: 1.1; }
.stagecell .nm { font-size: 12.5px; margin: 2px 0 8px; min-height: 2.8em; line-height: 1.35; }
.stagecell .wait { font-size: 11.5px; color: var(--muted-text); margin-top: 6px; }
@media (min-width: 900px) { .pipeline { grid-template-columns: repeat(6, minmax(0, 1fr)); } .stagecell { border-bottom: 0; } .stagecell:last-child { border-right: 0; } }
.workrow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 56px; gap: 10px; align-items: center; padding: 6px 14px; font-size: 13px; }
.workrow a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workrow .bar { height: 8px; }
.liststrip { list-style: none; margin: 0; padding: 0; }
.liststrip li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line-2); min-width: 0; }
.liststrip li:last-child { border-bottom: 0; }
.liststrip .main { min-width: 0; }
.liststrip .main a { font-weight: 500; }
.liststrip .sub { font-size: 12px; color: var(--muted-text); display: block; overflow: hidden; text-overflow: ellipsis; }
.liststrip .side { text-align: right; font-size: 12px; white-space: nowrap; color: var(--muted-text); }

/* matter page */
.mhead { padding: 14px; }
.mhead .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.mhead h2 { font-size: 20px; }
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 12px 0 0; }
.dl div { min-width: 0; }
.dl dt { font-size: 12px; color: var(--muted-text); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 900px) { .dl { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.stepper { list-style: none; margin: 0; padding: 4px 6px; display: grid; grid-template-columns: minmax(0, 1fr); }
.step { position: relative; }
.step button { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; background: none; border: 0; padding: 8px; border-radius: 10px; color: inherit; }
.step button:hover { background: var(--paper-2); }
.step.view button { background: var(--paper-2); }
.dot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; font-family: var(--mono); border: 1.5px solid var(--line); color: var(--muted-text); background: var(--white); }
.step.done .dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.step.cur .dot { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); box-shadow: 0 0 0 3px var(--gold-soft); }
.step .st { font-weight: 500; font-size: 13px; line-height: 1.3; display: block; }
.step .ss { font-size: 11.5px; color: var(--muted-text); display: block; margin-top: 1px; }
.step.future .st { color: var(--muted-text); }
@media (min-width: 900px) {
  .stepper { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 8px; gap: 4px; }
  .step:not(:last-child)::after { content: ''; position: absolute; top: 20px; left: calc(50% + 0px); right: -4px; height: 0; }
  .step button { flex-direction: column; align-items: flex-start; }
}
.approval { display: grid; gap: 10px; }
.apstep { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.apstep .dot { width: 22px; height: 22px; font-size: 11px; }
.apstep.ok .dot { background: var(--green-ink); border-color: var(--green-ink); color: #fff; }
.apstep.now .dot { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist label { display: flex; align-items: center; gap: 9px; padding: 6px 4px; border-radius: 8px; font-size: 13px; }
.checklist input { width: 17px; height: 17px; accent-color: var(--ink); flex: none; }
.checklist input:disabled + span { color: var(--muted-text); }
.checklist label:hover { background: var(--paper-2); }
.timeline { list-style: none; margin: 0; padding: 4px 14px 8px; }
.timeline li { position: relative; padding: 8px 0 8px 18px; border-left: 1px solid var(--line); margin-left: 4px; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: -4.5px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--white); border: 1.5px solid var(--muted); }
.timeline li.k-mgr_approved::before, .timeline li.k-acct_approved::before, .timeline li.k-completed::before { background: var(--green-ink); border-color: var(--green-ink); }
.timeline li.k-sent_back::before { background: var(--red-ink); border-color: var(--red-ink); }
.timeline li.k-ready::before { background: var(--gold); border-color: var(--gold); }
.timeline .when { display: block; font-size: 11.5px; color: var(--muted-text); }
.timeline .quote { display: block; margin-top: 5px; padding: 7px 10px; background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 8px; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.scroller { max-height: 640px; overflow-y: auto; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* report (screen) */
.reportbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sheet { background: #fff; color: #111827; max-width: 210mm; margin: 0 auto; padding: 14mm 14mm 16mm; border: 1px solid var(--line); box-shadow: var(--shadow-md); font-size: 10.5pt; line-height: 1.45; }
.sheet h1 { font-size: 20pt; }
.sheet h2 { font-size: 12.5pt; margin: 16px 0 6px; padding-bottom: 4px; border-bottom: 1px solid #cbd0d8; }
.sheet h3 { font-size: 11pt; margin: 12px 0 4px; }
.letterhead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 10px; flex-wrap: wrap; }
.letterhead .firm { font-family: var(--head); font-weight: 700; font-size: 17pt; color: var(--ink); letter-spacing: -.02em; }
.letterhead .addr { font-size: 9pt; color: #4b5260; text-align: right; }
.sheet .meta { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 12px 0; font-size: 10pt; }
.sheet .summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid #cbd0d8; margin: 10px 0; }
.sheet .summary div { padding: 8px 10px; border-right: 1px solid #cbd0d8; }
.sheet .summary div:last-child { border-right: 0; }
.sheet .summary.s3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sheet .summary b { display: block; font-family: var(--mono); font-size: 16pt; font-weight: 500; }
.sheet .summary span { font-size: 9pt; color: #4b5260; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.sheet th { text-align: left; font-weight: 600; font-size: 8.5pt; color: #374151; padding: 5px 6px; border-bottom: 1px solid #111827; background: #f3f4f6; }
.sheet td { padding: 5px 6px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.sheet td.r, .sheet th.r { text-align: right; }
.sheet tr { break-inside: avoid; }
.sheet .case { margin-top: 10px; break-inside: avoid; }
.sheet .case ul { margin: 4px 0 0; padding-left: 16px; font-size: 9.5pt; }
.sheet .foot { margin-top: 18px; padding-top: 8px; border-top: 1px solid #cbd0d8; font-size: 8.5pt; color: #4b5260; }
.sheet .tw { overflow-x: auto; }
.sheet .chip { border: 1px solid #cbd0d8; background: #fff; color: #111827; }
@media (max-width: 640px) { .sheet .summary.s3 { grid-template-columns: minmax(0, 1fr); } .sheet .summary.s3 div { border-right: 0 !important; border-bottom: 1px solid #cbd0d8; } .sheet .summary.s3 div:last-child { border-bottom: 0; } .sheet { padding: 14px; } .sheet .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sheet .summary div:nth-child(2) { border-right: 0; } .sheet .summary div:nth-child(-n+2) { border-bottom: 1px solid #cbd0d8; } .letterhead .addr { text-align: left; } }

@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  html, body { background: #fff !important; }
  .sidebar, .topbar, .protonote, .bottombar, .toast, .noprint, .skip { display: none !important; }
  .frame { display: block; padding: 0; }
  .panel { background: #fff; border-radius: 0; min-height: 0; padding: 0; overflow: visible; }
  #main { padding: 0; max-width: none; }
  .sheet { border: 0; box-shadow: none; max-width: none; padding: 0; margin: 0; font-size: 10pt; }
  .sheet .tw { overflow: visible; }
  .sheet h2 { break-after: avoid; }
  a { color: inherit; text-decoration: none; }
}
