:root {
  --bg: #0d1117;
  --panel: #151b23;
  --panel-2: #1b232d;
  --line: #2a3542;
  --ink: #e6edf3;
  --ink-2: #b4c0cc;
  --muted: #8593a3;
  --accent: #4f9cf0;
  --accent-ink: #0b1a2b;
  --good: #3fb37f;
  --warn: #d9a43b;
  --serious: #e07a3b;
  --critical: #e5534b;
  --info: #4f9cf0;
  --bar: #4f9cf0;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
code, .mono { font-family: var(--mono); font-size: .9em; }
small { color: var(--muted); }
.muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

#app { display: flex; height: 100vh; }
.sidebar { width: 232px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; gap: .6rem; align-items: center; padding: 1rem; border-bottom: 1px solid var(--line); }
.brand strong { display: block; letter-spacing: .02em; }
.brand small { display: block; font-size: .75rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; }
.brand.big .brand-mark { width: 44px; height: 44px; font-size: 1.4rem; }
#nav { flex: 1; overflow-y: auto; padding: .5rem; }
#nav a { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: var(--radius-sm); color: var(--ink-2); }
#nav a:hover { background: var(--panel-2); text-decoration: none; color: var(--ink); }
#nav a.active { background: var(--panel-2); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.nav-icon { width: 1.2rem; text-align: center; color: var(--muted); }
#nav .count { margin-left: auto; background: var(--critical); color: #fff; border-radius: 10px; padding: 0 .45rem; font-size: .75rem; font-weight: 700; }
.sidebar-foot { border-top: 1px solid var(--line); padding: .75rem 1rem; display: grid; gap: .5rem; }
.conn { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.me { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.me small { display: block; }
main { flex: 1; overflow-y: auto; }
.view { padding: 1.5rem 2rem 3rem; max-width: 1400px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.good { background: var(--good); box-shadow: 0 0 6px var(--good); }
.dot.critical { background: var(--critical); }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: var(--radius-sm); padding: .45rem .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
button:hover, .btn:hover { border-color: var(--muted); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.danger { background: transparent; border-color: var(--critical); color: var(--critical); }
button.danger.solid { background: var(--critical); color: #fff; }
button.small { padding: .2rem .55rem; font-size: .82rem; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; }
button:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 1rem; padding: .25rem .4rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .45rem .6rem; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
select[multiple] { min-height: 110px; }
input[type="checkbox"], input[type="radio"] { width: auto; }
label { display: grid; gap: .25rem; font-size: .85rem; color: var(--ink-2); }
label.check { display: flex; align-items: center; gap: .5rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .85rem 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0 0 1rem; }
legend { padding: 0 .4rem; color: var(--ink-2); font-weight: 600; }
.row-grid { display: grid; gap: .5rem; align-items: end; margin-bottom: .5rem; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.card > h2, .card > h3 { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.grid { display: grid; gap: 1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.stack { display: grid; gap: 1rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.tile .label { color: var(--muted); font-size: .8rem; }
.tile .value { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: .8rem; color: var(--ink-2); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.compact th, table.compact td { padding: .3rem .45rem; font-size: .85rem; }

/* ---------- callout replies and responder board ---------- */
.reply-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
select.small { padding: .2rem .4rem; font-size: .82rem; width: auto; }
.responders { display: grid; gap: .5rem; }
.field-alert { display: grid; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.field-alert:last-child { border-bottom: 0; }
.field-alert .reply-row select { flex: 1 1 100%; }
.field-alert .reply-row button { flex: 1 1 40%; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: .05rem .5rem; border-radius: 10px; font-size: .75rem; font-weight: 600; border: 1px solid var(--line); color: var(--ink-2); text-transform: capitalize; white-space: nowrap; }
.badge.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.badge.serious { color: var(--serious); border-color: color-mix(in srgb, var(--serious) 50%, transparent); }
.badge.critical { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 50%, transparent); }
.badge.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 50%, transparent); }
.badge.muted { color: var(--muted); }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .55rem .85rem; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
.tabs .count { color: var(--muted); font-size: .8rem; }

.list { display: grid; gap: .5rem; }
.list-item { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem .8rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.list-item:hover { border-color: var(--muted); }
a.list-item { color: inherit; }
a.list-item:hover { text-decoration: none; }
.empty { color: var(--muted); padding: 1rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius-sm); }

.log { display: grid; gap: 0; max-height: 520px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.log-row { display: grid; grid-template-columns: 82px 1fr; gap: .75rem; padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: 0; }
.log-row time { font-family: var(--mono); color: var(--muted); font-size: .82rem; }
.log-row .who { color: var(--ink-2); font-size: .8rem; }
.log-row.priority { box-shadow: inset 3px 0 0 var(--critical); }
.quick { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.compose { display: flex; gap: .5rem; margin-top: .75rem; }
.compose input, .compose textarea { flex: 1; }

.chat { display: flex; flex-direction: column; gap: .5rem; max-height: 520px; min-height: 300px; overflow-y: auto; padding: .75rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.msg { max-width: 75%; padding: .5rem .75rem; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 18%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.msg .meta { font-size: .75rem; color: var(--muted); margin-bottom: .15rem; }
.msg.locked { color: var(--muted); font-style: italic; }

.map { height: 600px; border-radius: var(--radius); border: 1px solid var(--line); }
.map-note { max-width: 260px; padding: 8px 10px; border-radius: var(--radius-sm); background: rgba(12,18,26,.9); color: #dfe6ee; font: 12px/1.4 system-ui, sans-serif; border: 1px solid #2c3a4a; }
.map.leaflet-container { background-color: #1b2430; background-image: linear-gradient(#26313f 1px, transparent 1px), linear-gradient(90deg, #26313f 1px, transparent 1px); background-size: 40px 40px; }
.map-wrap { display: grid; grid-template-columns: 1fr 280px; gap: 1rem; }
.map-tools { display: grid; gap: .75rem; align-content: start; }
.map-pin { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.leaflet-container { background: #1b232d; font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink); }
.legend-row { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.legend-row .map-pin { width: 20px; height: 20px; font-size: 10px; border-width: 1px; }
.mode-on { outline: 2px solid var(--warn); }

.risk-q { display: grid; grid-template-columns: 1fr 260px; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.risk-meter { height: 12px; border-radius: var(--radius-sm); background: var(--panel-2); overflow: hidden; display: flex; gap: 2px; }
.risk-meter span { display: block; height: 100%; }
.level { font-size: 1.4rem; font-weight: 800; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.gallery figure { margin: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.gallery img, .gallery video { width: 100%; height: 170px; object-fit: cover; display: block; background: #000; }
.gallery figcaption { padding: .5rem .65rem; font-size: .82rem; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.25rem; text-align: center; color: var(--muted); }
.dropzone.over { border-color: var(--accent); color: var(--ink); }

/* minmax(0, 1fr): long event titles truncate instead of widening their day's column. */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.cal .dow { padding: .4rem; font-size: .75rem; color: var(--muted); text-transform: uppercase; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); }
.cal .day { min-height: 110px; padding: .3rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); }
.cal .day.other { background: var(--bg); color: var(--muted); }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal .day .n { font-size: .8rem; color: var(--muted); }
.cal .ev, .cal-key .ev { display: block; font-size: .75rem; padding: .1rem .35rem; margin-top: .2rem; border-radius: var(--radius-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); background: var(--panel-2); border-left: 3px solid var(--muted); }
.cal .ev.op, .cal-key .ev.op { border-left-color: var(--critical); }
.cal .ev.training, .cal-key .ev.training { border-left-color: var(--good); }
.cal .ev.meeting, .cal-key .ev.meeting { border-left-color: var(--info); }
.cal .ev.other, .cal-key .ev.other { border-left-color: var(--warn); }

.bars { display: grid; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 48px; gap: .6rem; align-items: center; font-size: .85rem; position: relative; }
.bar-row .track { height: 14px; }
.bar-row .fill { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.bar-row:hover .fill { filter: brightness(1.2); }
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 180px; border-bottom: 1px solid var(--line); padding-top: 1rem; }
.vbars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.vbars .fill { width: 70%; max-width: 46px; background: var(--bar); border-radius: 4px 4px 0 0; min-height: 2px; }
.vbars .col:hover .fill { filter: brightness(1.2); }
.vbars .tip { position: absolute; bottom: calc(100% + 4px); display: none; background: var(--panel-2); border: 1px solid var(--line); padding: .2rem .45rem; border-radius: var(--radius-xs); font-size: .78rem; white-space: nowrap; }
.vbars .col:hover .tip { display: block; }
.vlabels { display: flex; gap: 6px; }
.vlabels span { flex: 1; text-align: center; font-size: .75rem; color: var(--muted); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 2000; padding: 1rem; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; width: min(640px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.modal.wide { width: min(980px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; }
.modal-body { padding: 1.1rem; overflow-y: auto; }

#toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 3000; }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: .7rem 1rem; border-radius: var(--radius-sm); max-width: 360px; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.toast.critical { border-left-color: var(--critical); }
.toast.good { border-left-color: var(--good); }

.login { display: grid; place-items: center; width: 100%; padding: 1rem; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem; width: min(560px, 100%); }
.login-card .brand { border: 0; padding: 0 0 1rem; }
.login-list { display: grid; gap: .4rem; max-height: 60vh; overflow-y: auto; }
.login-list button { display: block; text-align: left; width: 100%; }
.login-list small { display: block; }

.banner { padding: .65rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid var(--line); background: var(--panel); }
.banner.critical { border-color: var(--critical); background: color-mix(in srgb, var(--critical) 14%, var(--panel)); }
.banner.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--panel)); }
.banner.good { border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--panel)); }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: .35rem 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.timer { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; color: var(--critical); }

@media (max-width: 900px) {
  #app { flex-direction: column; height: auto; }
  .sidebar { width: 100%; }
  #nav { display: flex; overflow-x: auto; }
  main { overflow: visible; }
  .view { padding: 1rem; }
  .map-wrap { grid-template-columns: 1fr; }
  .grid.two { grid-template-columns: minmax(0, 1fr); }
  .risk-q { grid-template-columns: 1fr; }
  /* Grid children may shrink below their content; wide tables scroll inside their card. */
  .grid > *, .card { min-width: 0; }
  .card, .doc { overflow-x: auto; }
  .kv { grid-template-columns: minmax(0, 110px) minmax(0, 1fr); }
}

/* ---------- field mode (phones) ---------- */
body.field #app { display: block; height: auto; }
.field-wrap { max-width: 560px; margin: 0 auto; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.field-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding-top: env(safe-area-inset-top); }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
button.big { min-height: 56px; font-size: 1rem; justify-content: center; text-transform: capitalize; white-space: normal; }
body.field .compose { margin-top: .75rem; }
body.field .chat { max-height: 360px; min-height: 200px; }
body.field .msg { max-width: 90%; }
body.field input, body.field select { font-size: 16px; }

/* ---------- print / discovery package ---------- */
.doc { background: #fff; color: #111; padding: 2rem; border-radius: var(--radius-sm); font-size: 13px; }
.doc h1, .doc h2, .doc h3 { color: #111; }
.doc h2 { border-bottom: 2px solid #111; padding-bottom: .2rem; margin-top: 1.5rem; }
.doc table th, .doc table td { border-bottom: 1px solid #ccc; color: #111; }
.doc table th { color: #444; }
.doc .muted, .doc small { color: #555; }
.doc .kv dt { color: #555; }
.doc tbody tr:hover { background: none; }
.doc .mono { word-break: break-all; }
/* ---------- demo mode ---------- */
.demo-banner { margin: 0 .5rem .5rem; padding: .5rem .6rem; border-radius: var(--radius-sm); background: var(--info, #1f6feb); color: #fff; font-size: .82rem; font-weight: 600; }
.demo-banner a, .demo-banner small { color: #fff; }
.demo-banner a { text-decoration: underline; }
.demo-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: .5rem; margin: 1rem 0; }
.demo-role { display: grid; gap: .2rem; text-align: left; padding: .75rem; white-space: normal; height: auto; }
.demo-role small { font-weight: 600; }
.demo-role .muted { font-size: .8rem; font-weight: 400; }

/* ---------- mutual aid ---------- */
.guest-banner { margin: 0 .5rem .5rem; padding: .5rem .6rem; border-radius: var(--radius-sm); background: var(--warn); color: #111; font-size: .82rem; font-weight: 600; }
.guest-banner small { color: #111; font-weight: 500; }

/* ---------- live video ---------- */
.feed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: .75rem; }
.feed { border: 1px solid var(--line); border-radius: 8px; padding: .5rem; display: grid; gap: .35rem; background: var(--panel-2); }
.feed-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.feed-head .actions { margin-left: auto; }
.feed-video { width: 100%; aspect-ratio: 16 / 9; background: #000; border: 0; border-radius: var(--radius-sm); display: block; }
.feed-status { font-size: .8rem; min-height: 1em; }
/* A phone camera held upright sends sideways video; turned here so it shows upright. */
.feed-view.rot { position: relative; width: min(100%, calc(70vh * 9 / 16)); aspect-ratio: 9 / 16; margin: 0 auto; overflow: hidden; background: #000; border-radius: var(--radius-sm); }
.feed-view.rot .feed-video { position: absolute; left: 50%; top: 50%; width: 177.78%; height: 56.25%; aspect-ratio: auto; border-radius: 0;
  object-fit: contain; transform: translate(-50%, -50%) rotate(var(--rot)); }
.feed-view.rot180 .feed-video { transform: rotate(180deg); }
.live-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--critical); margin-right: .25rem; animation: livepulse 1.4s infinite; }
@keyframes livepulse { 50% { opacity: .3; } }

/* ---------- encrypted attachments ---------- */
.msg .att { margin-top: .35rem; }
.msg .att img { max-width: min(320px, 100%); max-height: 240px; border-radius: var(--radius-sm); display: block; }
.compose .attach { cursor: pointer; }
.attach-note { font-size: .82rem; margin-top: .35rem; }

/* ---------- scribe mode (full screen) ---------- */
.scribe { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: grid; grid-template-rows: auto 1fr auto auto; }
.scribe header { display: flex; gap: .75rem; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.scribe .scribe-clock { margin-left: auto; font-family: var(--mono); font-size: 1.3rem; font-weight: 700; }
.scribe-log { overflow-y: auto; padding: .5rem 1rem; font-size: 1.05rem; }
.scribe-row { display: grid; grid-template-columns: 90px 1fr; gap: .75rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.scribe-row time { font-family: var(--mono); color: var(--muted); }
.scribe-row.priority { color: var(--critical); font-weight: 600; }
.scribe-row .who { color: var(--muted); font-size: .8rem; margin-right: .4rem; }
.scribe-orig { color: var(--muted); font-size: .85rem; font-weight: 400; }
.scribe-input { padding: .6rem 1rem; border-top: 1px solid var(--line); background: var(--panel); }
.scribe-input input { font-size: 1.25rem; padding: .7rem .8rem; width: 100%; }
.scribe-status { font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
.scribe-codes { padding: .4rem 1rem .8rem; background: var(--panel); }

/* ---------- briefing pack ---------- */
.brief .brief-mark { color: var(--critical); font-weight: 700; font-size: .8rem; letter-spacing: .04em; }
.brief .brief-map { width: 100%; max-width: 760px; height: auto; display: block; margin: .5rem 0; }
.brief .brief-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; margin-top: .75rem; }
.brief figure { margin: 0; } .brief figure img { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius-xs); }
.brief figcaption { font-size: .8rem; color: var(--muted); }
.brief table.kvt th { width: 170px; text-transform: none; letter-spacing: 0; font-size: .85rem; }
.brief .brief-foot { color: var(--muted); font-size: .8rem; margin-top: 2rem; }

@media print {
  body { background: #fff; }
  .sidebar, .no-print, #toasts { display: none !important; }
  #app, main { display: block; height: auto; overflow: visible; }
  .view { padding: 0; max-width: none; }
  .doc { padding: 0; }
  .doc h2 { break-after: avoid; }
  .doc tr { break-inside: avoid; }
  .brief .brief-map, .brief figure { break-inside: avoid; }
}
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
