/* VOYAGE-DESK v2 web UI (DESIGN §11). Teal palette carried over from the v1 desk.
   No inline styles anywhere: every visual state is a class toggled by the scripts. */
:root {
  --bg: #f3f5f3;
  --panel: #ffffff;
  --ink: #172e35;
  --ink-soft: #36545a;
  --muted: #63777b;
  --line: #dce5e0;
  --line-soft: #edf0ed;
  --head: #15363b;
  --brand: #9de0c4;
  --primary: #226754;
  --primary-hover: #1b5646;
  --accent: #348872;
  --accent-soft: #edf4ef;
  --focus: #72b5a1;
  --warn: #bc9551;
  --warn-bg: #fff8e9;
  --warn-ink: #78603b;
  --danger: #b74d41;
  --danger-bg: #fff0ec;
  --danger-ink: #913d34;
  --ok-bg: #edf7ef;
  --ok-ink: #226754;
  --radius: 10px;
  --drawer-w: min(640px, 56vw);
  --nav-h: 60px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100vh; overflow-x: hidden; }
a { color: var(--primary); }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #ba8640; outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }
pre, .preserve { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
pre { background: #f4f7f5; border: 1px solid #e0e8e2; border-radius: 6px; padding: 12px; font-size: 12px; line-height: 1.6; max-height: 60vh; overflow: auto; margin: 8px 0; }
pre.body-text { font-family: inherit; font-size: 14px; max-height: none; background: #fafcfa; }
code, .mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1 1 auto; }
.booting { padding: 40px; color: var(--muted); }

/* ------------------------------------------------------------------ shell */
.topbar { position: sticky; top: 0; z-index: 30; height: 56px; background: var(--head); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 20px; }
.brand { font-weight: 800; color: var(--brand); text-decoration: none; font-size: 20px; letter-spacing: .5px; white-space: nowrap; }
.brand small { color: #c8ded6; font-size: 11px; font-weight: 600; letter-spacing: 2px; margin-left: 8px; }
.topnav { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.topnav a { color: #d7e9e2; text-decoration: none; padding: 8px 12px; border-radius: 6px; white-space: nowrap; font-weight: 600; }
.topnav a:hover { background: rgba(255,255,255,.08); }
.topnav a.active { background: var(--primary); color: #fff; }
.topbar .user { display: flex; align-items: center; gap: 10px; color: #c8ded6; font-size: 12px; white-space: nowrap; }
.topbar .user button { background: transparent; color: #d7e9e2; border-color: #4c6f6f; padding: 4px 10px; min-height: 0; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #6fcf97; display: inline-block; }
.live-dot.off { background: #d6a14b; }
.bottomnav { display: none; }
.page { max-width: 1400px; margin: 0 auto; padding: 22px 24px 40px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin-right: auto; }
body.has-drawer .page { padding-right: calc(var(--drawer-w) + 24px); }

/* ------------------------------------------------------------------ forms */
label { display: block; font-size: 12px; font-weight: 600; color: #536c6c; margin: 10px 0 0; }
label.inline, .check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 0 12px 0 0; }
input, textarea, select { font: inherit; width: 100%; border: 1px solid #cedbd4; border-radius: 6px; background: #fcfdfb; color: #193b3d; padding: 8px 10px; display: block; margin-top: 4px; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; display: inline-block; margin: 0; }
textarea { resize: vertical; min-height: 70px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); background: var(--danger-bg); }
.field-error { color: var(--danger-ink); font-size: 12px; margin-top: 3px; }
.field-hint { color: var(--muted); font-size: 11px; margin-top: 3px; }
button { font: inherit; cursor: pointer; border: 1px solid #b9cdc3; border-radius: 6px; padding: 7px 14px; background: #fff; color: #244e45; white-space: nowrap; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .55; cursor: not-allowed; }
button.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
button.primary:hover { background: var(--primary-hover); }
button.danger { color: var(--danger-ink); border-color: #d4aaa3; }
button.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
button.link { border: 0; background: none; padding: 2px 4px; color: var(--primary); text-decoration: underline; }
button.small, .small-btn { padding: 3px 9px; font-size: 12px; }
button.icon { padding: 2px 8px; min-width: 30px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.toolbar { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.toolbar > label { margin: 0; }
.toolbar input, .toolbar select { margin-top: 2px; }
.searchbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.searchbar .q { flex: 1 1 280px; }

/* ------------------------------------------------------------------ pills, badges, chips */
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { border-radius: 16px; padding: 5px 13px; color: #526d70; border-color: var(--line); }
.pills button.active { background: #163e40; color: #fff; border-color: #163e40; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 4px; background: var(--accent-soft); color: #366858; white-space: nowrap; vertical-align: middle; }
.badge.grey { background: #eef1ef; color: #5f7471; }
.badge.warn { background: #fff0db; color: #895016; }
.badge.red { background: var(--danger-bg); color: var(--danger-ink); }
.badge.ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge.blue { background: #e8f0fb; color: #2d5a8f; }
.badge.dark { background: #163e40; color: #fff; }
.phase-on_hire { background: var(--ok-bg); color: var(--ok-ink); }
.phase-prospective { background: #e8f0fb; color: #2d5a8f; }
.phase-redelivered_open { background: #fff0db; color: #895016; }
.phase-closed { background: #eef1ef; color: #5f7471; }
.lock { cursor: pointer; border: 0; background: none; padding: 0 3px; font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #bfd9c8; background: #f5faf6; border-radius: 16px; padding: 2px 4px 2px 10px; font-size: 12px; max-width: 100%; }
.chip .chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chip button { border: 0; background: transparent; padding: 2px 6px; border-radius: 12px; min-height: 0; }
.chip button:hover { background: #e2efe7; }
.chip.weak { border-style: dashed; background: #fbfcfb; }
.chip.link-auto { border-color: #bfd9c8; }
.chip.link-suggested { border-style: dashed; border-color: #d4b98b; background: var(--warn-bg); }
.chip.link-confirmed { border-color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }

/* ------------------------------------------------------------------ banners */
.banners { display: grid; gap: 8px; margin-bottom: 14px; }
.banner { border-left: 4px solid var(--warn); background: var(--warn-bg); color: var(--warn-ink); padding: 10px 14px; border-radius: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.red { border-left-color: var(--danger); background: var(--danger-bg); color: var(--danger-ink); }
.banner.info { border-left-color: var(--accent); background: var(--accent-soft); color: #245446; }
.banner a { color: inherit; font-weight: 600; }
.banner .grow { min-width: 200px; }

/* ------------------------------------------------------------------ panels, cards */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 14px; min-width: 0; }
.panel > h2, .panel > h3 { margin-bottom: 10px; }
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h2, .panel-head h3 { margin-right: auto; }
.vessel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.card:hover { border-color: var(--accent); }
.card.att-ok { border-left-color: #8cc5ad; }
.card.att-watch { border-left-color: #d6a14b; }
.card.att-action { border-left-color: var(--danger); }
.card.general { border-left-color: #6d8f96; background: #f7faf9; }
.card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-top h2 { margin-right: auto; font-size: 17px; }
.card .headline { color: var(--ink-soft); font-size: 13px; overflow-wrap: anywhere; }
.card .voy { font-size: 12px; color: var(--muted); }
.counts { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.counts b { color: var(--ink); }
.counts .hot b { color: var(--danger-ink); }
.card-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 11px; color: #728582; border-top: 1px solid var(--line-soft); padding-top: 8px; margin-top: auto; }
details.closed-vessels { margin-top: 16px; }
details.closed-vessels > summary { color: var(--muted); padding: 8px 0; }
.empty { padding: 26px 18px; color: #789087; background: #f9fbf8; border: 1px dashed #d1ded5; border-radius: 8px; text-align: center; }
.loading { padding: 20px; color: var(--muted); }
.error-box { padding: 14px; border-radius: 8px; background: var(--danger-bg); color: var(--danger-ink); border: 1px solid #efc9c1; }

/* ------------------------------------------------------------------ lists and tables */
.list { display: grid; gap: 0; }
.row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row.clickable { cursor: pointer; }
.row.clickable:hover { background: #f7faf8; }
.row.selected { background: #eef6f1; box-shadow: inset 3px 0 var(--accent); }
.row .main { flex: 1 1 auto; min-width: 0; }
.row .title { font-weight: 600; overflow-wrap: anywhere; }
.row .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.row .snippet { font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; margin-top: 3px; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; }
.group-head { display: flex; gap: 8px; align-items: center; padding: 12px 2px 4px; border-bottom: 2px solid var(--line); font-weight: 700; }
.group-head a { text-decoration: none; }
.overdue { color: var(--danger-ink); font-weight: 600; }
.table-scroll { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 7px 9px; border-bottom: 1px solid #e1e9e4; vertical-align: top; overflow-wrap: anywhere; }
th { font-weight: 600; color: #58756c; background: #f5f8f5; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
tr.hl td { background: #fffbef; }
tr.bad td { background: var(--danger-bg); }
.kv { display: grid; grid-template-columns: minmax(110px, 190px) minmax(0, 1fr); gap: 4px 16px; margin: 0; }
.kv dt { color: #687c74; font-size: 12px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.bulkbar { position: sticky; top: 56px; z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #163e40; color: #fff; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.bulkbar select { width: auto; margin: 0; max-width: 220px; }
.bulkbar button { background: #fff; }

/* ------------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid #cfddd3; margin: 14px 0; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 9px 12px; color: #526d70; font-weight: 600; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.vessel-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.vessel-head .ident { flex: 1 1 320px; min-width: 0; }
.vessel-head .ident h1 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin-top: 10px; }
.status-grid select { margin-top: 2px; }
.rec-banner { border: 1px solid #bfd9c8; background: #f5faf6; border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.rec-banner .rec { padding: 6px 0; border-bottom: 1px dashed #d3e4d9; }
.rec-banner .rec:last-child { border-bottom: 0; }
.timeline-item { padding: 9px 0 9px 16px; border-left: 2px solid #c5dbce; position: relative; }
.timeline-item::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #568d73; position: absolute; left: -5px; top: 15px; }
.timeline-item.run::before { background: #2d5a8f; }
.timeline-item.todo_event::before { background: #d6a14b; }
.checklist .row { align-items: center; }

/* ------------------------------------------------------------------ drawer and modal */
.drawer { position: fixed; top: 56px; right: 0; bottom: 0; width: var(--drawer-w); background: var(--panel); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(21, 54, 59, .08); z-index: 25; display: flex; flex-direction: column; }
.drawer-head { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.drawer-head .grow { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { overflow-y: auto; padding: 14px 18px 40px; flex: 1 1 auto; min-width: 0; }
.drawer-body h2 { margin: 0 0 6px; }
.drawer-body h3 { margin: 18px 0 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(12, 30, 33, .45); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--panel); border-radius: 12px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.modal.wide { width: min(760px, 100%); }
.modal h2 { margin-bottom: 10px; }
.modal .actions { justify-content: flex-end; margin-top: 16px; }
.secret { font-family: Consolas, monospace; font-size: 16px; background: #163e40; color: #9de0c4; padding: 12px; border-radius: 6px; overflow-wrap: anywhere; user-select: all; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { background: #163e40; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 8px 20px rgba(0, 0, 0, .2); overflow-wrap: anywhere; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--primary); }

/* ------------------------------------------------------------------ execute */
.exec { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 12px; background: #fbfdfc; }
.exec.state-queued, .exec.state-claimed, .exec.state-running { border-color: #9cc6b6; background: #f3faf6; }
.exec.state-saved, .exec.state-read_ok { border-color: #8cc5ad; background: var(--ok-bg); }
.exec.state-failed, .exec.state-expired, .exec.state-aborted { border-color: #e2b7ae; background: var(--danger-bg); }
.exec.state-uncertain { border: 2px solid var(--danger); background: var(--danger-bg); }
.exec.state-cancelled { background: #f3f5f3; }
.exec.state-resolved { background: #f3f5f3; }
.exec .exec-status { font-weight: 700; font-size: 15px; }
.progress { height: 6px; background: #e1e9e4; border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.progress > div.p0 { width: 4%; } .progress > div.p1 { width: 10%; } .progress > div.p2 { width: 20%; } .progress > div.p3 { width: 30%; }
.progress > div.p4 { width: 40%; } .progress > div.p5 { width: 50%; } .progress > div.p6 { width: 60%; } .progress > div.p7 { width: 70%; }
.progress > div.p8 { width: 80%; } .progress > div.p9 { width: 90%; } .progress > div.p10 { width: 100%; }
.input-table input { margin: 0; }
.input-table td.name { white-space: nowrap; font-family: Consolas, monospace; font-size: 12px; }
.machines .row { align-items: center; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--head); }
.login-card { background: var(--panel); border-radius: 14px; padding: 28px; width: min(380px, 100%); }
.login-card h1 { color: var(--primary); margin-bottom: 4px; }
.login-card button.primary { width: 100%; margin-top: 18px; padding: 10px; }
.more-menu a { display: flex; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ board summary: 现状, 要事, 新, 最新进展 */
.badge.new { background: #163e40; color: #fff; }
.status-note { display: grid; gap: 1px; min-width: 0; }
.status-note .status-text { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.status-note .status-meta { font-size: 11px; color: var(--muted); }
.status-note.stale .status-text { font-weight: 400; color: var(--ink-soft); }
.headline.rules, .card .headline.rules { font-size: 12px; color: var(--muted); }
.counts .soon, .counts .soon b, .row .meta .soon { color: #895016; }
.row .meta .soon { font-weight: 600; }
.latest { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 12px; color: var(--ink-soft); text-decoration: none; margin-top: 3px; }
.latest b { color: var(--accent); }
.latest:hover { text-decoration: underline; }
.since-bar { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-size: 13px; color: var(--ink-soft); }
.since-bar b { color: var(--ink); font-variant-numeric: tabular-nums; }
.since-bar .since-toggle { flex: 1 1 16em; min-width: 0; text-align: left; white-space: normal; border: 0; padding: 0; background: none; color: inherit; }
.since-bar .hint-more, .since-bar .hint-less { margin-left: 8px; color: var(--primary); text-decoration: underline; }
.since-bar .hint-less, .since-bar .since-toggle[aria-expanded="true"] .hint-more { display: none; }
.since-bar .since-toggle[aria-expanded="true"] .hint-less { display: inline; }
.since-list { flex: 1 1 100%; min-width: 0; display: grid; gap: 8px; }
.since-list[hidden] { display: none; }
.since-list .bchanges { gap: 8px; }
.focus-head { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 4px; }
.focus-grid { display: grid; gap: 0 28px; grid-template-columns: minmax(0, 1fr); }
.fcol { min-width: 0; }
.fcol h3 { font-size: 12px; letter-spacing: .06em; color: var(--muted); margin: 12px 0 2px; display: flex; gap: 6px; align-items: center; }
.fcol h3 .cnt { color: var(--ink); font-variant-numeric: tabular-nums; }
.flist { list-style: none; margin: 0; padding: 0; }
.fitem { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line-soft); border-radius: 6px; cursor: pointer; }
.fitem:last-child { border-bottom: 0; }
.fitem:hover { background: #f7faf8; }
.ftag { font-weight: 700; line-height: 1.25; padding-top: 1px; font-variant-numeric: tabular-nums; }
.ftag small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.ftag.soon { color: #895016; }
.ftag.me { color: var(--danger-ink); }
.ftag.imos { color: #2d5a8f; }
.fmain { min-width: 0; }
.fline { display: flex; gap: 2px 8px; flex-wrap: wrap; align-items: baseline; min-width: 0; }
.fv { font-weight: 700; font-size: 12px; letter-spacing: .02em; color: var(--primary); white-space: nowrap; }
.ft { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; min-width: 0; }
.ft:hover { text-decoration: underline; }
.ftail { font-size: 12px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.fmeta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); margin-top: 2px; }
.more { display: inline-block; margin-top: 8px; font-size: 13px; }
/* a number that opens the list it counts (cards, 要事 headings, 简报): the figure carries the dotted underline */
a.num { color: inherit; text-decoration: none; }
a.num b, a.num .cnt { text-decoration: underline dotted; text-underline-offset: 3px; }
a.num:hover b, a.num:hover .cnt, a.num:focus-visible b, a.num:focus-visible .cnt { text-decoration-style: solid; }
a.num.badge b { text-decoration: none; font-weight: inherit; }
.fcol h3 .num { display: inline-flex; gap: 6px; align-items: center; }
.fmore { padding: 4px 6px 8px; border-bottom: 1px solid var(--line-soft); }
.fmore .more { margin-top: 0; }
.filter-line { display: flex; gap: 6px 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; min-width: 0; }
details.rec-rest > summary { color: var(--muted); font-size: 12px; padding: 6px 0; cursor: pointer; }

/* ------------------------------------------------------------------ 简报 */
.issue-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.issue-bar select { width: auto; margin: 0; max-width: 240px; }
.brief-lead { font-size: 15px; line-height: 1.7; margin: 0; max-width: 62em; }
.brief-stats { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.brief-stats b { color: var(--ink); font-size: 15px; margin-right: 3px; }
.section-title { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin: 20px 0 10px; }
.section-title h2 { font-size: 16px; }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 14px; }
.bcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.bcard h3 { margin-right: auto; }
.bcard h3 a { text-decoration: none; }
.bchanges { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.bchanges li { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.bchanges a { overflow-wrap: anywhere; min-width: 0; }
.bchanges .ttl { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
.bchanges .tail { margin-left: 6px; color: var(--ink-soft); font-size: 12px; }
.bchanges .note { flex-basis: 100%; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec-row { display: grid; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.rec-row:last-child { border-bottom: 0; }
.rec-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.sys { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sys li { display: flex; gap: 8px; flex-wrap: wrap; }
.sys .k { color: var(--muted); min-width: 7em; }
@media (min-width: 960px) {
  .focus-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ phone layout (< 850 px) */
@media (max-width: 849px) {
  .topbar { height: 52px; padding: 0 14px; }
  .topnav { display: none; }
  .brand small { display: none; }
  .bottomnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom); background: var(--panel); border-top: 1px solid var(--line); z-index: 40; }
  .bottomnav a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; gap: 2px; min-width: 0; }
  .bottomnav a .ico { font-size: 18px; line-height: 1; }
  .bottomnav a.active { color: var(--primary); }
  .page { padding: 14px 16px calc(var(--nav-h) + 28px); }
  body.has-drawer .page { padding-right: 16px; }
  .drawer { top: 52px; width: 100%; bottom: var(--nav-h); border-left: 0; }
  .drawer-body { padding: 12px 16px 30px; }
  .toasts { bottom: calc(var(--nav-h) + 12px); right: 12px; }
  .vessel-grid { grid-template-columns: 1fr; }
  .form-grid, .status-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { font-weight: 700; margin-top: 6px; }
  input, select, textarea { font-size: 16px; }
  button { min-height: 40px; }
  button.small, .chip button, .lock, button.link { min-height: 0; }
  .row { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-start; }
  .bulkbar { top: 52px; }
  h1 { font-size: 21px; }
  .modal { padding: 16px; }
}
@media (max-width: 420px) {
  .topbar .user span { display: none; }
  .panel { padding: 12px; }
  .card { padding: 12px; }
}

@media (max-width: 849px) {
  .brief-grid { grid-template-columns: minmax(0, 1fr); }
  .latest { -webkit-line-clamp: 2; }
  .counts a.num, .brief-stats a.num, .fcol h3 a.num { padding: 5px 0; }   /* a finger-sized target for each number */
  .more { padding: 5px 0; }
}

/* The dossiers (views/dossier.js): markdown written by the agents, shown as plain blocks. */
.md { line-height: 1.7; overflow-wrap: anywhere; }
.md .md-h { margin: 18px 0 6px; scroll-margin-top: 64px; }
.md h2.md-h { font-size: 19px; margin-top: 4px; }
.md h3.md-h { font-size: 16px; padding-top: 10px; border-top: 1px solid var(--line); }
.md h4.md-h { font-size: 14px; color: #315a55; }
.md h5.md-h, .md h6.md-h { font-size: 13px; color: var(--muted); }
.md .md-p { margin: 6px 0; white-space: pre-line; }
.md .md-list { margin: 4px 0 8px; padding-left: 20px; }
.md .md-list li { margin: 3px 0; white-space: pre-line; }
.md .md-list li.md-depth-1 { margin-left: 18px; }
.md .md-list li.md-depth-2 { margin-left: 36px; }
.md .md-list li.md-depth-3 { margin-left: 54px; }
.md .md-code { max-height: 40vh; }
.md .md-ref { color: #315a55; border-bottom: 1px dotted #9db5ae; }
.md table.md-table { font-size: 12px; }
.md-jump { margin: 8px 0 12px; }
.md-jump button { font-size: 12px; padding: 3px 10px; }
details.md-history { margin-bottom: 12px; }
details.md-history > summary { color: var(--muted); cursor: pointer; }
