/* Practice Desk POC. Navy / slate, 16px base, contrast checked against WCAG AA. */
:root {
  --navy: #14284b; --navy-2: #1d3a68; --navy-3: #2b4f86; --ink: #172033; --text: #26324a; --muted: #55627a;
  --hair: #dde3ec; --line: #c9d2df; --page: #f4f6f9; --card: #ffffff; --wash: #eef2f7;
  --accent: #1f5fae; --accent-ink: #ffffff; --good: #1d6b43; --good-bg: #e5f3eb; --warn: #8a5200; --warn-bg: #fdf1dc;
  --bad: #a3271b; --bad-bg: #fbe9e7; --info-bg: #e8f0fb;
  --radius: 10px; --nav-w: 248px; --safe-top: env(safe-area-inset-top, 0px);
  font-size: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text); }
body { font: 400 1rem/1.5 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0; }
h1 { font-size: 1.35rem; font-weight: 650; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .6rem; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #7aa7e6; outline-offset: 2px; }
.boot { padding: 2rem; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* iOS top: one colour per column, below every dialog */
.ios-top { position: fixed; top: 0; left: 0; right: 0; height: var(--safe-top); background: var(--card); z-index: 30; }
.ios-top-nav { display: none; }

/* ---------------------------------------------------------------- shell: an application window, not a page.
   The window fills the viewport; the sidebar is full height and the content pane scrolls inside it. */
html, body { height: 100%; }
.shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.nav { background: var(--navy); color: #e8edf5; display: flex; flex-direction: column; padding: calc(var(--safe-top) + 12px) 10px 12px; overflow-y: auto; overflow-x: hidden; }
.nav .brand { display: flex; gap: 10px; align-items: center; padding: 2px 6px 14px; min-height: 48px; }
.nav .brand img { width: 34px; height: 34px; border-radius: 8px; flex: none; }
.nav .brand b { display: block; font-size: 1.05rem; color: #fff; white-space: nowrap; }
.nav .brand span { display: block; font-size: .78rem; color: #b9c6dc; white-space: nowrap; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav .grp { margin-top: 10px; }
.nav .grp > span { display: block; padding: 6px 12px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8fa2c2; white-space: nowrap; }
.nav li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #dfe6f1; text-decoration: none; font-weight: 500; white-space: nowrap; }
.nav li a .ic { width: 20px; height: 20px; flex: none; opacity: .9; }
.nav li a .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav li a:hover { background: var(--navy-2); color: #fff; }
.nav li a[aria-current="page"] { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 0 #8fb6ee; }
.nav .count { background: #e8edf5; color: var(--navy); border-radius: 999px; font-size: .76rem; font-weight: 700; padding: 0 7px; min-width: 22px; text-align: center; }
.nav .foot { margin-top: auto; padding: 12px 6px 0; border-top: 1px solid #2c4672; }
.nav .poc { margin: 0; font-size: .75rem; color: #b9c6dc; }
.rail-btn { display: none; margin-top: 10px; width: 100%; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; border: 1px solid #2c4672; background: transparent; color: #cbd6e8; cursor: pointer; font-size: .85rem; white-space: nowrap; }
.rail-btn:hover { background: var(--navy-2); color: #fff; }
.rail-btn svg { width: 18px; height: 18px; flex: none; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar { flex: none; z-index: 20; background: var(--card); display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-top) + 8px) 18px 8px; border-bottom: 1px solid var(--hair); min-height: 60px; }
.topbar .ttl { flex: 1; min-width: 0; }
.topbar h1 { font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .crumb { display: block; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.firm { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--ink); background: var(--wash); border: 1px solid var(--hair); border-radius: 8px; padding: 5px 10px; white-space: nowrap; }
.firm svg { width: 16px; height: 16px; color: var(--navy-3); }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; flex: none; }
.menu-btn svg { width: 20px; height: 20px; }
.tag-poc { font-size: .72rem; font-weight: 650; color: var(--warn); background: var(--warn-bg); border: 1px solid #f0d9ae; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.user { position: relative; flex: none; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--hair); background: var(--card); border-radius: 999px; padding: 3px 10px 3px 3px; cursor: pointer; }
.user-btn:hover { border-color: var(--line); background: var(--wash); }
.user-btn .avatar { width: 34px; height: 34px; font-size: .8rem; }
.user-btn .u { text-align: left; line-height: 1.15; }
.user-btn .u b { display: block; font-size: .88rem; color: var(--ink); white-space: nowrap; }
.user-btn .u span { display: block; font-size: .74rem; color: var(--muted); white-space: nowrap; }
.user-btn .caret { width: 14px; height: 14px; color: var(--muted); }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); width: 280px; background: var(--card); border: 1px solid var(--hair); border-radius: 12px; box-shadow: 0 16px 40px rgba(10, 20, 40, .18); padding: 12px; z-index: 50; }
.user-menu[hidden] { display: none; }
.user-menu .me { padding: 2px 4px 10px; border-bottom: 1px solid var(--hair); margin-bottom: 8px; }
.user-menu .me b { display: block; color: var(--ink); }
.user-menu .me span { display: block; font-size: .84rem; color: var(--muted); }
.user-menu label { display: block; font-size: .82rem; color: var(--muted); margin: 6px 4px 8px; }
.user-menu select { width: 100%; margin-top: 4px; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.user-menu a, .user-menu button.mi { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 8px; color: var(--text); text-decoration: none; border: 0; background: none; cursor: pointer; text-align: left; }
.user-menu a:hover, .user-menu button.mi:hover { background: var(--wash); }
.user-menu button.mi.danger { color: var(--bad); }
main[data-stx-main] { flex: 1; min-height: 0; min-width: 0; overflow: auto; padding: 20px; overscroll-behavior: contain; }
main[data-stx-main] > .page { max-width: 1480px; margin: 0 auto; }

@media (max-width: 767px) {
  .nav.stx-drawer { width: min(300px, 86vw); }
  main[data-stx-main] { padding: 14px; }
  .topbar { padding-left: 10px; padding-right: 10px; gap: 8px; min-height: 56px; }
  .topbar h1 { font-size: 1.08rem; }
  .firm, .tag-poc, .user-btn .u, .user-btn .caret { display: none; }
  .user-btn { padding: 2px; }
}
@media (min-width: 768px) and (max-width: 1099px) { .firm .long { display: none; } }
@media (min-width: 768px) {
  .nav.stx-drawer { position: relative; height: 100%; width: var(--nav-w); flex: none; transform: none !important; transition: width .18s ease; box-shadow: none; z-index: 1; }
  .menu-btn, .stx-scrim { display: none !important; }
  .rail-btn { display: flex; }
  .ios-top-nav { display: block; position: fixed; top: 0; left: 0; width: var(--nav-w); height: var(--safe-top); background: var(--navy); z-index: 31; }
  /* collapsed to an icon rail */
  .shell.rail .nav.stx-drawer { width: 68px; }
  .shell.rail .nav .brand div, .shell.rail .nav .grp > span, .shell.rail .nav .lbl, .shell.rail .nav .poc, .shell.rail .rail-btn .lbl { display: none; }
  .shell.rail .nav .grp > span { display: block; height: 1px; padding: 0; margin: 6px 10px; background: #2c4672; font-size: 0; }
  .shell.rail .nav li a { justify-content: center; position: relative; padding: 10px; }
  .shell.rail .nav .count { position: absolute; top: 2px; right: 2px; font-size: .64rem; min-width: 16px; padding: 0 4px; }
  .shell.rail .rail-btn { justify-content: center; }
  .shell.rail .rail-btn svg { transform: scaleX(-1); }
  .shell.rail ~ .ios-top-nav, .ios-top-nav.rail { width: 68px; }
}

/* ---------------------------------------------------------------- building blocks */
.card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-h p { margin: 0; color: var(--muted); font-size: .88rem; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.grid > .card + .card { margin-top: 0; }
@media (min-width: 1100px) { .grid > .wide { grid-column: span 2; } }
.stack > * + * { margin-top: 16px; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: inherit; display: block; }
a.tile:hover { border-color: var(--accent); }
.tile b { display: block; font-size: 1.7rem; color: var(--ink); font-weight: 700; line-height: 1.2; }
.tile span { color: var(--muted); font-size: .88rem; }
.tile.alert b { color: var(--bad); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.empty { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--card); }
.sim { font-size: .8rem; color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 2px 8px; display: inline-block; }
.note { background: var(--info-bg); border-radius: 8px; padding: 10px 12px; font-size: .9rem; color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #184f93; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.danger { color: var(--bad); border-color: #e3b4ae; }
.btn.sm { min-height: 34px; padding: 4px 10px; font-size: .88rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; font: inherit; text-align: left; }

.chip { display: inline-block; font-size: .78rem; font-weight: 650; border-radius: 999px; padding: 1px 9px; background: var(--wash); color: var(--text); white-space: nowrap; }
.chip.High { background: var(--bad-bg); color: var(--bad); }
.chip.Medium { background: var(--warn-bg); color: var(--warn); }
.chip.Low { background: var(--wash); color: var(--muted); }
.chip.ok { background: var(--good-bg); color: var(--good); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.info { background: var(--info-bg); color: var(--navy-2); }
.st-todo { background: var(--wash); color: var(--text); }
.st-drafting { background: var(--info-bg); color: var(--navy-2); }
.st-review { background: var(--warn-bg); color: var(--warn); }
.st-revision { background: var(--bad-bg); color: var(--bad); }
.st-done { background: var(--good-bg); color: var(--good); }

/* lists and tables */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--hair); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .t { font-weight: 600; color: var(--ink); }
.list .m { font-size: .86rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.t th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--wash); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  table.t.cards thead { display: none; }
  table.t.cards, table.t.cards tbody, table.t.cards tr, table.t.cards td { display: block; width: 100%; }
  table.t.cards tr { border: 1px solid var(--hair); border-radius: var(--radius); background: var(--card); padding: 8px 12px; margin-bottom: 10px; }
  table.t.cards td { border: 0; padding: 3px 0; display: flex; gap: 10px; justify-content: space-between; text-align: right; }
  table.t.cards td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; text-align: left; flex: none; }
  table.t.cards td.lead { display: block; text-align: left; font-weight: 600; }
  table.t.cards td.lead::before { content: none; }
}

.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; gap: 10px; align-items: center; padding: 5px 0; font-size: .92rem; }
.bars .bar { height: 12px; background: var(--wash); border-radius: 6px; overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: var(--navy-3); border-radius: 6px; }
.bars b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* filters, tabs */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: end; }
.filters label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); gap: 3px; min-width: 0; }
.filters input, .filters select { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); max-width: 100%; }
.filters .grow { flex: 1 1 200px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem; }
.tabs a[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.tabs .n { margin-left: 6px; font-weight: 700; }

/* forms */
.form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: .88rem; font-weight: 600; color: var(--ink); }
.field small { color: var(--muted); font-size: .8rem; }
.field input, .field select, .field textarea { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
.field textarea { min-height: 84px; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.err { color: var(--bad); font-size: .84rem; margin: 0; font-weight: 600; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; grid-column: 1 / -1; }

/* ---------------------------------------------------------------- kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--wash); border-radius: var(--radius); padding: 10px; min-height: 140px; border: 2px solid transparent; }
.col.drop { border-color: var(--accent); background: var(--info-bg); }
.col-h { display: flex; justify-content: space-between; align-items: center; margin: 2px 4px 10px; }
.col-h h2 { font-size: .95rem; }
.col-h .n { font-weight: 700; color: var(--muted); }
.kcard { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--hair); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; color: inherit; }
.kcard:hover { border-color: var(--accent); }
.kcard[draggable="true"] { cursor: grab; }
.kcard .t { font-weight: 600; color: var(--ink); display: block; margin-bottom: 4px; }
.kcard .m { font-size: .82rem; color: var(--muted); display: block; }
.kcard .row { margin-top: 6px; gap: 6px; }
.age { font-size: .76rem; font-weight: 700; border-radius: 6px; padding: 1px 7px; background: var(--wash); color: var(--muted); }
.age.stale { background: var(--bad-bg); color: var(--bad); }
.avatar { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; background: var(--navy-2); color: #fff; font-size: .72rem; font-weight: 700; flex: none; }
@media (min-width: 1024px) { .board { grid-auto-columns: minmax(180px, 1fr); } }
@media (max-width: 767px) { .board { grid-auto-columns: 82%; scroll-snap-type: x mandatory; } .col { scroll-snap-align: start; } }

/* stage stepper */
.steps { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.steps li { flex: 1 1 120px; padding: 8px 10px; border-radius: 8px; background: var(--wash); font-size: .86rem; color: var(--muted); border: 1px solid transparent; }
.steps li.past { background: var(--good-bg); color: var(--good); }
.steps li.now { background: var(--navy); color: #fff; font-weight: 650; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px 16px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { font-size: .8rem; color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--hair); }
.timeline li { padding: 0 0 12px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--navy-3); }
.timeline .when { font-size: .82rem; color: var(--muted); }

/* ---------------------------------------------------------------- dialog */
dialog#dlg { border: 0; border-radius: 12px; padding: 0; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); color: var(--text); box-shadow: 0 20px 60px rgba(10, 20, 40, .3); }
dialog#dlg::backdrop { background: rgba(15, 25, 45, .45); }
.dlg-h { position: sticky; top: 0; background: #fff; display: flex; justify-content: space-between; align-items: start; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--hair); z-index: 1; }
.dlg-b { padding: 16px 18px 20px; }
.dlg-b section + section { margin-top: 18px; }
.dlg-b h3 { margin-bottom: 8px; }
.x { border: 0; background: var(--wash); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; font-size: 1.2rem; line-height: 1; flex: none; }
@media (max-width: 767px) { dialog#dlg { width: 100vw; max-width: 100vw; max-height: 100%; height: 100%; margin: 0; border-radius: 0; } .dlg-h { padding-top: calc(var(--safe-top) + 12px); } }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; z-index: 300; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; width: min(460px, calc(100vw - 24px)); pointer-events: none; }
.toast { background: var(--ink); color: #fff; border-radius: 10px; padding: 12px 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.2); pointer-events: auto; }
.toast.error { background: var(--bad); }
.toast.good { background: var(--good); }

/* ---------------------------------------------------------------- login and public form */
.public { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: calc(var(--safe-top) + 32px) 16px 32px; }
.public .panel { width: min(560px, 100%); }
.public header { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.public header img { width: 46px; height: 46px; border-radius: 10px; }
.public header p { margin: 0; color: var(--muted); }
.people { display: grid; gap: 8px; }
.people button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.people button:hover { border-color: var(--accent); background: var(--info-bg); }
.people b { display: block; color: var(--ink); }
.people span.r { display: block; font-size: .85rem; color: var(--muted); }
.people h3 { margin: 10px 0 2px; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }


/* ---------------------------------------------------------------- app pages added for the OS shell */
button.tile { font: inherit; text-align: left; cursor: pointer; width: 100%; }
.tile:hover { border-color: var(--line); }
.tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--info-bg); }
.form.one { grid-template-columns: 1fr; }
.btn.wide { width: 100%; }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
.split > .card + .card { margin-top: 0; }
@media (max-width: 1099px) { .split { grid-template-columns: 1fr; } }
.letter-text { white-space: pre-wrap; background: var(--wash); border: 1px solid var(--hair); border-radius: 8px; padding: 12px 14px; font-size: .95rem; overflow-wrap: anywhere; }
.letter-text.plain { background: none; border: 0; padding: 0; }
.path { font-family: Consolas, "Cascadia Mono", monospace; font-size: .82rem; overflow-wrap: anywhere; }
.letterhead { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 18px 20px; box-shadow: 0 2px 10px rgba(20, 40, 75, .06); }
.letterhead .lh { border-bottom: 2px solid var(--navy); padding-bottom: 10px; margin-bottom: 12px; text-align: center; }
.letterhead .lh b { display: block; font-family: Georgia, "Times New Roman", serif; letter-spacing: .08em; color: var(--navy); font-size: 1.15rem; }
.letterhead .lh span { display: block; font-size: .78rem; color: var(--muted); }
.letterhead .lh-date { text-align: right; font-size: .9rem; margin: 0 0 4px; }
.letterhead .lh-to { font-weight: 600; margin: 0 0 10px; }
.letterhead textarea { width: 100%; min-height: 300px; font-family: Georgia, "Times New Roman", serif; font-size: .95rem; line-height: 1.55; }
table.t tfoot th { text-align: left; border-top: 2px solid var(--line); padding-top: 10px; }
table.t tfoot th.num { text-align: right; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--hair); }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed .fi { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--info-bg); color: var(--navy-3); display: grid; place-items: center; }
.feed .fi svg { width: 16px; height: 16px; }
.feed a { color: var(--ink); text-decoration: none; font-weight: 500; }
.feed a:hover { color: var(--accent); text-decoration: underline; }
.feed .m { font-size: .8rem; color: var(--muted); }

/* sign-in: a full window, brand panel beside the form */
.signin { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(320px, 42%) 1fr; }
.signin-brand { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 60%, var(--navy-3) 100%); color: #dfe6f1; padding: calc(var(--safe-top) + 48px) 48px 36px; display: flex; flex-direction: column; }
.signin-brand div { display: grid; grid-template-columns: 52px 1fr; column-gap: 14px; align-items: center; }
.signin-brand img { width: 52px; height: 52px; border-radius: 12px; grid-row: span 2; }
.signin-brand b { color: #fff; font-size: 1.5rem; }
.signin-brand div span { color: #b9c6dc; }
.signin-brand ul { margin: 48px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; font-size: 1.02rem; }
.signin-brand li { padding-left: 26px; position: relative; }
.signin-brand li::before { content: ""; position: absolute; left: 0; top: .5em; width: 12px; height: 2px; background: #8fb6ee; }
.signin-brand p { margin-top: auto; font-size: .82rem; color: #b9c6dc; }
.signin-panel { display: flex; align-items: flex-start; justify-content: center; padding: calc(var(--safe-top) + 40px) 20px 40px; overflow-y: auto; }
.signin-card { width: min(460px, 100%); padding: 24px; }
.signin-card header { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.signin-card header img { width: 42px; height: 42px; border-radius: 10px; }
.signin-card header p { margin: 0; color: var(--muted); font-size: .9rem; }
.demo-people { margin-top: 18px; border-top: 1px solid var(--hair); padding-top: 14px; }
.demo-people h2 { font-size: 1rem; }
.demo-people .people { grid-template-columns: 1fr 1fr; }
.demo-people .people h3 { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .signin { grid-template-columns: 1fr; }
  .signin-brand { display: none; }
  .signin-panel { padding-top: calc(var(--safe-top) + 20px); }
  .signin-card { padding: 18px; }
}
@media (max-width: 420px) { .demo-people .people { grid-template-columns: 1fr; } }

@media (min-width: 768px) { .toasts { left: auto; right: 20px; transform: none; width: 380px; } }

@media print {
  html, body, .shell, .main-col, main[data-stx-main] { height: auto !important; overflow: visible !important; display: block; }
  .nav, .topbar, .ios-top, .ios-top-nav, .no-print, .toasts { display: none !important; }
  main[data-stx-main] { padding: 0; }
  .card { border: 0; padding: 0; }
}
