/* Shared component kit (§4.0, WP0). Modules use these classes through /js/core/ui.js and never re-implement them.
   Module-specific styles live in /css/m/<module>.css, loaded by the module with loadCss(). */

/* ── buttons ─────────────────────────────────────────────────────────────────────────────────────────────── */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:var(--tap); padding:0 16px;
  border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); color:var(--ink);
  font-size:var(--fs-label); line-height:var(--lh-label); font-weight:600; white-space:nowrap; text-decoration:none;
  transition:transform var(--t-fast) var(--ease-out), background var(--t-fast);
}
.btn:hover{ border-color:var(--primary); text-decoration:none; }
.btn:active{ transform:scale(.97); }
.btn.primary{ background:var(--primary); border-color:var(--primary); color:var(--on-primary); }
.btn.primary:hover{ background:var(--primary-strong); border-color:var(--primary-strong); }
.btn.ghost{ background:transparent; border-color:transparent; }
.btn.danger{ background:var(--dnu); border-color:var(--dnu); color:#fff; }
.btn.ai{ background:var(--ai-soft); color:var(--ai); border-color:color-mix(in srgb,var(--ai) 35%,transparent); }
.btn.lg{ min-height:var(--tap-lg); font-size:var(--fs-body); padding:0 20px; border-radius:var(--r); }
.btn.block{ width:100%; }
.btn.sm{ min-height:36px; padding:0 12px; font-size:var(--fs-caption); }
.icon-btn{
  display:inline-grid; place-items:center; width:var(--tap); height:var(--tap); padding:0; border:0; border-radius:var(--r-pill);
  background:transparent; color:var(--ink); flex:none;
}
.icon-btn:hover{ background:var(--surface-2); }

/* ── chips, badges, status ───────────────────────────────────────────────────────────────────────────────── */
.chip{
  display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:0 12px; border-radius:var(--r-pill);
  background:var(--surface-2); color:var(--ink); border:1px solid transparent; font-size:var(--fs-label); font-weight:600; white-space:nowrap;
}
.chip .i{ width:16px; height:16px; }
button.chip{ cursor:pointer; min-height:36px; }
.chip.tone-ok{ background:var(--ready-soft); color:var(--ready); }
.chip.tone-due{ background:var(--due-soft); color:var(--due); }
.chip.tone-bad{ background:var(--dnu-soft); color:var(--dnu); }
.chip.tone-ai{ background:var(--ai-soft); color:var(--ai); }
.chip.tone-neutral{ background:var(--surface-2); color:var(--ink-2); }
.chip.tone-primary{ background:var(--primary-soft); color:var(--primary); }
.pill-count{ display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px; border-radius:var(--r-pill); background:var(--primary); color:var(--on-primary); font-size:.75rem; font-weight:700; }
.branch-dot{ display:inline-block; width:10px; height:10px; border-radius:50%; flex:none; background:var(--b1); }

.status-banner{
  display:flex; align-items:center; gap:12px; min-height:56px; padding:10px 16px; border-radius:var(--r);
  font-weight:600; border-left:4px solid currentColor;
}
.status-banner .word{ font-size:var(--fs-h2); line-height:var(--lh-h2); font-weight:800; }
.status-banner .reason{ color:var(--ink-2); font-weight:400; font-size:var(--fs-label); }
.st-ready{ color:var(--ready); background:var(--ready-soft); }
.st-in_use{ color:var(--inuse); background:var(--inuse-soft); }
.st-needs_cleaning{ color:var(--clean); background:var(--clean-soft); }
.st-due{ color:var(--due); background:var(--due-soft); }
.st-under_repair{ color:var(--repair); background:var(--repair-soft); }
.st-do_not_use{ color:var(--dnu); background:var(--dnu-soft); }
.st-stale{ color:var(--stale); background:var(--stale-soft); }

/* ── cards, lists ────────────────────────────────────────────────────────────────────────────────────────── */
.card{ background:var(--surface); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow-1); padding:16px; min-width:0; }
.card > h3{ margin:0 0 12px; color:var(--ink-2); text-transform:uppercase; letter-spacing:.05em; font-size:var(--fs-caption); display:flex; justify-content:space-between; align-items:center; gap:8px; }
.list{ list-style:none; margin:0; padding:0; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
.list-row{ display:flex; align-items:center; gap:12px; min-height:56px; padding:10px 16px; border-bottom:1px solid var(--line); color:var(--ink); text-decoration:none; background:var(--surface); width:100%; text-align:left; border-left:0; border-right:0; border-top:0; font:inherit; }
.list-row:last-child{ border-bottom:0; }
button.list-row,a.list-row{ cursor:pointer; }
button.list-row:hover,a.list-row:hover{ background:var(--surface-2); text-decoration:none; }
.list-row .main{ flex:1; min-width:0; }
.list-row .title{ font-weight:600; display:block; }
.list-row .sub{ display:block; color:var(--ink-2); font-size:var(--fs-caption); }
.page-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.page-head h1{ margin:0; }
.page-head p{ margin:2px 0 0; color:var(--ink-2); }
.section-title{ font-size:var(--fs-label); font-weight:600; color:var(--ink-2); margin:20px 0 8px; text-transform:uppercase; letter-spacing:.05em; }

/* ── AI line (§1.13): indigo edge, sparkle, why chips, accept/edit/dismiss ───────────────────────────────── */
.ai-line{ position:relative; border-left:3px solid var(--ai); background:var(--ai-soft); border-radius:0 var(--r-sm) var(--r-sm) 0; padding:12px 12px 12px 14px; }
.ai-line .ai-head{ display:flex; gap:8px; align-items:flex-start; color:var(--ink); }
.ai-line .ai-head .i{ color:var(--ai); width:18px; height:18px; margin-top:2px; }
.ai-line .why{ margin:8px 0 0; padding-left:18px; color:var(--ink-2); font-size:var(--fs-caption); }
.ai-line .ai-actions{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.engine-note{ font-size:var(--fs-caption); color:var(--ink-2); }

/* ── sheet (<dialog>, §2.8) — bottom sheet on phone, right drawer on desktop ─────────────────────────────── */
dialog.sheet{
  position:fixed; inset:auto 0 0 0; margin:0; width:100%; max-width:100%; max-height:92dvh; padding:0; border:0;
  background:var(--surface); color:var(--ink); border-radius:var(--r-lg) var(--r-lg) 0 0; box-shadow:var(--shadow-sheet);
  display:flex; flex-direction:column; overflow:hidden; transform:translateY(0);
}
dialog.sheet:not([open]){ display:none; }
dialog.sheet::backdrop{ background:var(--scrim); }
dialog.sheet[open]{ animation:sheet-in var(--t) var(--ease-out); }
dialog.sheet.closing{ animation:sheet-out var(--t) var(--ease) forwards; }
dialog.sheet[data-detent="peek"]{ height:40dvh; }
dialog.sheet[data-detent="half"]{ height:60dvh; }
dialog.sheet[data-detent="full"]{ height:92dvh; }
@keyframes sheet-in{ from{ transform:translateY(24px); opacity:0; } }
@keyframes sheet-out{ to{ transform:translateY(24px); opacity:0; } }
.sheet-grab{ display:block; margin:0 auto; width:64px; height:24px; border:0; background:transparent; padding:0; position:relative; flex:none; }
.sheet-grab::after{ content:''; position:absolute; left:16px; right:16px; top:10px; height:4px; border-radius:2px; background:var(--line); }
.sheet-head{ display:flex; align-items:center; gap:8px; padding:4px 8px 8px 16px; flex:none; }
.sheet-head h2{ flex:1; outline:none; }
.sheet-body{ padding:0 16px 16px; overflow:auto; flex:1; overscroll-behavior:contain; }
.sheet-actions{ display:flex; gap:8px; padding:12px 16px calc(12px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); flex:none; }
.sheet-actions .btn{ flex:1; }
@media (min-width:1024px){
  dialog.sheet{ inset:0 0 0 auto; width:var(--drawer-w); max-height:100dvh; height:100dvh!important; border-radius:0; }
  dialog.sheet.center{ inset:10vh auto auto 50%; transform:translateX(-50%); width:min(640px,92vw); height:auto!important; max-height:80vh; border-radius:var(--r-lg); }
  dialog.sheet[open]{ animation:drawer-in var(--t) var(--ease-out); }
  dialog.sheet.center[open]{ animation:none; }
  @keyframes drawer-in{ from{ transform:translateX(24px); opacity:0; } }
  .sheet-grab{ display:none; }
}

/* ── sticky primary bar (§1.3) ───────────────────────────────────────────────────────────────────────────── */
.primary-bar{
  position:sticky; bottom:calc(var(--tab-h) + env(safe-area-inset-bottom)); z-index:5; display:flex; gap:8px; padding:12px 0;
  background:linear-gradient(to top,var(--bg) 70%,transparent);
}
.primary-bar .btn.primary{ flex:1; min-height:var(--tap-lg); font-size:var(--fs-body); }
.primary-bar .icon-btn{ width:var(--tap-lg); height:var(--tap-lg); border:1px solid var(--line); background:var(--surface); border-radius:var(--r); }
@media (min-width:768px){ .primary-bar{ bottom:0; } }

/* ── hold-to-confirm (§1.6) ──────────────────────────────────────────────────────────────────────────────── */
.hold-btn{ position:relative; overflow:hidden; touch-action:none; user-select:none; -webkit-user-select:none; }
.hold-btn .hold-fill{ position:absolute; inset:0; background:color-mix(in srgb,var(--on-primary) 22%,transparent); transform-origin:left; transform:scaleX(0); }
.hold-btn.holding .hold-fill{ transition:transform var(--hold-ms,1200ms) linear; transform:scaleX(1); }
.hold-btn .hold-label{ position:relative; }

/* ── snackbar / undo toast (§2.7) ────────────────────────────────────────────────────────────────────────── */
.snackbar{
  position:fixed; left:50%; bottom:calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); z-index:90; transform:translateX(-50%);
  display:flex; align-items:center; gap:12px; min-height:48px; width:min(560px,calc(100vw - 32px)); padding:6px 8px 6px 16px;
  background:var(--ink); color:var(--bg); border-radius:var(--r); box-shadow:var(--shadow-sheet); overflow:hidden; animation:snack-in var(--t) var(--ease-out);
}
.snackbar .msg{ flex:1; }
.snackbar .btn{ background:transparent; border:0; color:var(--primary-soft); min-height:40px; }
.snackbar .countdown{ position:absolute; left:0; bottom:0; height:2px; width:100%; background:var(--marigold); transform-origin:left; animation:countdown var(--undo-ms,6000ms) linear forwards; }
@keyframes snack-in{ from{ transform:translate(-50%,16px); opacity:0; } }
@keyframes countdown{ to{ transform:scaleX(0); } }
@media (min-width:768px){ .snackbar{ bottom:24px; } }

/* ── segmented control ───────────────────────────────────────────────────────────────────────────────────── */
.segmented{ display:inline-flex; padding:3px; gap:3px; background:var(--surface-2); border-radius:var(--r-sm); border:1px solid var(--line); max-width:100%; overflow-x:auto; }
.segmented button{ min-height:40px; padding:0 14px; border:0; border-radius:8px; background:transparent; color:var(--ink-2); font-weight:600; font-size:var(--fs-label); white-space:nowrap; }
.segmented button[aria-pressed="true"],.segmented button[aria-checked="true"]{ background:var(--surface); color:var(--ink); box-shadow:var(--shadow-1); }
.segmented.lg{ display:flex; width:100%; }
.segmented.lg button{ flex:1; min-height:var(--tap-lg); font-size:var(--fs-body); }
.segmented.lg button[data-v="pass"][aria-checked="true"]{ background:var(--ready); color:#fff; }
.segmented.lg button[data-v="fail"][aria-checked="true"]{ background:var(--dnu); color:#fff; }

/* ── keypad ──────────────────────────────────────────────────────────────────────────────────────────────── */
.keypad input{ width:100%; font-size:var(--fs-display); line-height:var(--lh-display); font-weight:800; text-align:center; font-variant-numeric:tabular-nums; min-height:64px; }
.keypad .tol{ margin-top:6px; font-size:var(--fs-caption); color:var(--ink-2); text-align:center; }
.keypad .tol.bad{ color:var(--dnu); font-weight:600; }

/* ── skeletons (no spinners anywhere, §1.15) ─────────────────────────────────────────────────────────────── */
.skeleton{ border-radius:var(--r); background:linear-gradient(90deg,var(--surface-2) 0%,var(--surface) 50%,var(--surface-2) 100%); background-size:200% 100%; animation:shimmer 1.2s infinite linear; }
.skeleton.card-sk{ height:120px; } .skeleton.row-sk{ height:56px; border-radius:var(--r-sm); } .skeleton.tile-sk{ height:96px; }
@keyframes shimmer{ to{ background-position:-200% 0; } }
.sk-stack{ display:grid; gap:12px; }

/* ── empty state (§2.6) ──────────────────────────────────────────────────────────────────────────────────── */
.empty-state{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:12px; padding:32px 16px; color:var(--ink-2); }
.empty-state svg.art{ width:160px; height:120px; color:var(--primary); }
.empty-state p{ max-width:32ch; color:var(--ink); font-weight:600; margin:0; }

/* ── KPI tile, ring, timeline ────────────────────────────────────────────────────────────────────────────── */
.kpi-tile{ display:flex; flex-direction:column; gap:4px; padding:14px 16px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); color:var(--ink); text-decoration:none; min-width:0; }
a.kpi-tile:hover{ border-color:var(--primary); text-decoration:none; }
.kpi-tile .v{ font-size:var(--fs-display); line-height:var(--lh-display); font-weight:800; font-variant-numeric:tabular-nums; }
.kpi-tile .l{ color:var(--ink-2); font-size:var(--fs-label); font-weight:600; }
.kpi-tile .d{ font-size:var(--fs-caption); font-weight:600; }
.kpi-tile .d.up{ color:var(--ready); } .kpi-tile .d.down{ color:var(--dnu); }
.kpi-tile svg.spark{ width:100%; height:24px; color:var(--primary); }
.kpi-tile.tone-due .v{ color:var(--due); } .kpi-tile.tone-bad .v{ color:var(--dnu); } .kpi-tile.tone-ok .v{ color:var(--ready); }
.kpi-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
@media (min-width:768px){ .kpi-grid{ grid-template-columns:repeat(4,minmax(0,1fr)); } }
.ring96{ position:relative; width:96px; height:96px; flex:none; }
.ring96 svg{ width:96px; height:96px; transform:rotate(-90deg); }
.ring96 .c{ position:absolute; inset:0; display:grid; place-items:center; text-align:center; font-weight:800; font-variant-numeric:tabular-nums; line-height:1.1; }
.ring96 .c small{ display:block; font-weight:600; font-size:var(--fs-caption); color:var(--ink-2); }
.timeline2{ list-style:none; margin:0; padding:0 0 0 20px; border-left:2px solid var(--line); }
.timeline2 li{ position:relative; padding:0 0 16px 12px; }
.timeline2 li::before{ content:''; position:absolute; left:-27px; top:4px; width:12px; height:12px; border-radius:50%; background:var(--surface); border:2px solid var(--line); }
.timeline2 li.done::before{ background:var(--primary); border-color:var(--primary); }
.timeline2 li.live::before{ background:var(--marigold); border-color:var(--marigold); animation:breathe 1.6s infinite; }
.timeline2 .t{ font-weight:600; } .timeline2 .s{ color:var(--ink-2); font-size:var(--fs-caption); }
@keyframes breathe{ 50%{ opacity:.45; } }

/* ── data table (cards on phone, sortable on desktop) ────────────────────────────────────────────────────── */
.dtable{ width:100%; background:var(--surface); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; }
.dtable th{ text-align:left; font-size:var(--fs-caption); text-transform:uppercase; letter-spacing:.04em; color:var(--ink-2); padding:10px 12px; background:var(--surface-2); border-bottom:1px solid var(--line); white-space:nowrap; }
.dtable th button{ all:unset; cursor:pointer; display:inline-flex; gap:4px; align-items:center; }
.dtable th button:focus-visible{ outline:2px solid var(--primary); }
.dtable td{ padding:10px 12px; border-bottom:1px solid var(--line); vertical-align:middle; }
.dtable tr:last-child td{ border-bottom:0; }
.dtable tr[data-href]{ cursor:pointer; }
.dtable tr[data-href]:hover td{ background:var(--surface-2); }
@media (max-width:767px){
  .dtable thead{ display:none; }
  .dtable,.dtable tbody,.dtable tr,.dtable td{ display:block; width:100%; }
  .dtable tr{ padding:10px 14px; border-bottom:1px solid var(--line); }
  .dtable td{ padding:0; border:0; }
  .dtable td:first-child{ font-weight:600; }
  .dtable td:not(:first-child){ display:inline; color:var(--ink-2); font-size:var(--fs-caption); }
  .dtable td:not(:first-child):not(:empty)::after{ content:' · '; }
  .dtable td:last-child::after{ content:''!important; }
}

/* ── swipe rows ──────────────────────────────────────────────────────────────────────────────────────────── */
.swipe-wrap{ position:relative; overflow:hidden; }
.swipe-wrap .swipe-bg{ position:absolute; inset:0; display:flex; align-items:center; justify-content:space-between; padding:0 20px; color:#fff; font-weight:700; }
.swipe-wrap .swipe-bg.right{ background:var(--primary); } .swipe-wrap .swipe-bg.left{ background:var(--due); justify-content:flex-end; }
.swipe-wrap > .swipe-fg{ position:relative; touch-action:pan-y; transition:transform var(--t) var(--ease-out); background:var(--surface); }
.swipe-wrap > .swipe-fg.dragging{ transition:none; }

/* ── forms ───────────────────────────────────────────────────────────────────────────────────────────────── */
.field{ display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.field > label,.field > .lbl{ font-size:var(--fs-label); font-weight:600; color:var(--ink); }
.field .hint{ font-size:var(--fs-caption); color:var(--ink-2); }
.field .err{ font-size:var(--fs-caption); color:var(--dnu); font-weight:600; }
.input-row{ display:flex; gap:8px; align-items:stretch; }
.input-row > input{ flex:1; min-width:0; }
.prefix-input{ display:flex; align-items:stretch; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); overflow:hidden; }
.prefix-input:focus-within{ border-color:var(--primary); outline:2px solid var(--primary); outline-offset:0; }
.prefix-input span{ display:grid; place-items:center; padding:0 12px; background:var(--surface-2); color:var(--ink-2); font-weight:600; }
.prefix-input input{ border:0; border-radius:0; flex:1; min-width:0; outline:none!important; }
.otp-input{ letter-spacing:.5em; text-align:center; font-size:1.5rem!important; font-weight:800; font-variant-numeric:tabular-nums; }
.form-stripe{ height:4px; border-radius:2px; background:var(--branch-color,var(--b1)); margin-bottom:12px; }

/* ── avatar ──────────────────────────────────────────────────────────────────────────────────────────────── */
.avatar{ display:inline-grid; place-items:center; width:36px; height:36px; border-radius:50%; background:var(--primary-soft); color:var(--primary); font-weight:800; font-size:.8125rem; flex:none; }

/* ── signature pad, voice, photo ─────────────────────────────────────────────────────────────────────────── */
.sig-canvas{ width:100%; height:min(50dvh,320px); background:var(--surface); border:1px dashed var(--line); border-radius:var(--r); touch-action:none; display:block; }
.voice-chip{ display:inline-flex; align-items:center; gap:8px; }
.voice-chip .wave{ display:inline-flex; gap:2px; align-items:center; height:20px; }
.voice-chip .wave i{ width:3px; height:6px; background:currentColor; border-radius:2px; animation:wave 900ms infinite ease-in-out; }
.voice-chip .wave i:nth-child(2){ animation-delay:120ms; } .voice-chip .wave i:nth-child(3){ animation-delay:240ms; } .voice-chip .wave i:nth-child(4){ animation-delay:360ms; }
@keyframes wave{ 50%{ height:18px; } }
.recording{ background:var(--dnu)!important; color:#fff!important; }
.thumbs{ display:flex; gap:8px; flex-wrap:wrap; }
.thumbs figure{ position:relative; margin:0; width:72px; height:72px; border-radius:var(--r-sm); overflow:hidden; background:var(--surface-2); }
.thumbs img{ width:100%; height:100%; object-fit:cover; }
.thumbs figure button{ position:absolute; top:2px; right:2px; width:28px; height:28px; border-radius:50%; border:0; background:rgb(0 0 0/.6); color:#fff; display:grid; place-items:center; padding:0; }

/* ── picker rows (location / asset / branch) ─────────────────────────────────────────────────────────────── */
.picker-search{ position:sticky; top:0; z-index:1; background:var(--surface); padding-bottom:10px; }
.picker-search input{ width:100%; }
.crumbs{ display:flex; gap:4px; flex-wrap:wrap; align-items:center; margin:0 0 8px; font-size:var(--fs-label); }
.crumbs button{ border:0; background:var(--surface-2); border-radius:var(--r-pill); min-height:32px; padding:0 10px; color:var(--ink); font-weight:600; }
.traffic{ display:flex; gap:10px; flex-wrap:wrap; font-size:var(--fs-caption); color:var(--ink-2); margin-top:2px; }
.traffic b{ font-weight:700; color:var(--ink); }
.traffic .bad b{ color:var(--dnu); } .traffic .warn b{ color:var(--due); } .traffic .ok b{ color:var(--ready); }

/* ═══ v1 compatibility (§12 pre-split): the classes the v1 modules render with, mapped onto the v2 tokens. ═══
   Owners move what they still need into /css/m/<module>.css when they rewrite their module, then delete it here. */
:root{ --panel:var(--surface); --panel-2:var(--surface-2); --text:var(--ink); --muted:var(--ink-2); --border:var(--line); --primary-2:var(--primary);
  --ok:var(--ready); --ok-soft:var(--ready-soft); --warn:var(--due); --warn-soft:var(--due-soft); --bad:var(--dnu); --bad-soft:var(--dnu-soft);
  --info:var(--inuse); --info-soft:var(--inuse-soft); --shadow:var(--shadow-1); }
#view .grid{ display:grid; gap:16px; }
#view .g4{ grid-template-columns:repeat(4,minmax(0,1fr)); } #view .g3{ grid-template-columns:repeat(3,minmax(0,1fr)); }
#view .g2{ grid-template-columns:repeat(2,minmax(0,1fr)); } #view .g-21{ grid-template-columns:2fr 1fr; }
.stat{ display:flex; gap:14px; align-items:center; cursor:pointer; }
.stat .ic{ width:44px; height:44px; border-radius:12px; display:grid; place-items:center; font-size:20px; flex:none; }
.stat .v{ font-size:1.625rem; font-weight:800; letter-spacing:-.02em; line-height:1.1; font-variant-numeric:tabular-nums; }
.stat .l{ color:var(--ink-2); font-size:var(--fs-caption); }
.t-ok{ background:var(--ready-soft); color:var(--ready); } .t-warn{ background:var(--due-soft); color:var(--due); } .t-bad{ background:var(--dnu-soft); color:var(--dnu); }
.t-info{ background:var(--inuse-soft); color:var(--inuse); } .t-pri{ background:var(--primary-soft); color:var(--primary); }
.badge{ display:inline-flex; align-items:center; gap:4px; padding:2px 9px; border-radius:var(--r-pill); font-size:.75rem; font-weight:600; white-space:nowrap; }
.ai-card{ border-left:3px solid var(--ai); background:var(--ai-soft); }
.ai-tag{ font-size:.6875rem; font-weight:700; color:var(--ai); background:var(--ai-soft); padding:2px 8px; border-radius:var(--r-pill); text-transform:none; letter-spacing:0; }
.md p{ margin:0 0 6px; } .md ul,.md ol{ margin:4px 0 8px; padding-left:20px; } .md li{ margin:2px 0; }
.table-wrap{ overflow:auto; border:1px solid var(--line); border-radius:var(--r); background:var(--surface); max-width:100%; -webkit-overflow-scrolling:touch; }
.table-wrap table{ width:100%; border-collapse:collapse; }
.table-wrap th,#view table th{ text-align:left; font-size:.75rem; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-2); padding:11px 14px; background:var(--surface-2); border-bottom:1px solid var(--line); white-space:nowrap; }
.table-wrap td,#view table td{ padding:10px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
tr.click:hover td{ background:var(--surface-2); cursor:pointer; }
#view tr:last-child td{ border-bottom:0; }
.filters{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; align-items:center; }
.filters input[type=search]{ min-width:min(260px,100%); flex:1; }
.filters select{ max-width:100%; }
.tabs{ display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:16px; overflow-x:auto; }
.tabs button{ background:none; border:0; min-height:var(--tap); padding:0 14px; color:var(--ink-2); font-weight:600; border-bottom:2px solid transparent; white-space:nowrap; }
.tabs button.on{ color:var(--primary); border-color:var(--primary); }
.seg{ display:inline-flex; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-sm); padding:3px; }
.seg button{ border:0; background:none; min-height:36px; padding:0 12px; border-radius:7px; font-weight:600; color:var(--ink-2); }
.seg button.on{ background:var(--surface); color:var(--ink); box-shadow:var(--shadow-1); }
.bar-row{ display:grid; grid-template-columns:140px 1fr 60px; gap:10px; align-items:center; margin:7px 0; font-size:var(--fs-label); }
.bar{ height:10px; background:var(--surface-2); border-radius:var(--r-pill); overflow:hidden; border:1px solid var(--line); }
.bar > i{ display:block; height:100%; border-radius:var(--r-pill); }
.ring{ position:relative; width:120px; height:120px; } .ring .c{ position:absolute; inset:0; display:grid; place-items:center; text-align:center; }
.ring .c b{ font-size:1.75rem; display:block; line-height:1; }
.chart{ width:100%; height:180px; }
.kanban{ display:grid; grid-template-columns:repeat(5,minmax(220px,1fr)); gap:12px; overflow-x:auto; padding-bottom:8px; }
.col{ background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r); padding:10px; min-height:200px; }
.col h4{ margin:4px 4px 10px; font-size:.75rem; text-transform:uppercase; color:var(--ink-2); display:flex; justify-content:space-between; }
.kcard{ background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:10px 12px; margin-bottom:8px; cursor:pointer; border-left:3px solid var(--line); }
.kcard:hover{ border-color:var(--primary); }
.kcard.p-Critical{ border-left-color:var(--dnu); } .kcard.p-High{ border-left-color:var(--due); } .kcard.p-Medium{ border-left-color:var(--inuse); }
.form{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form label{ display:flex; flex-direction:column; gap:4px; font-size:var(--fs-caption); color:var(--ink-2); font-weight:600; }
.form .full{ grid-column:1 / -1; }
.kv{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.kv div small{ display:block; color:var(--ink-2); font-size:.75rem; text-transform:uppercase; letter-spacing:.04em; }
.kv div b{ font-weight:600; }
.timeline{ border-left:2px solid var(--line); margin-left:6px; padding-left:16px; }
.timeline .ev{ position:relative; margin-bottom:12px; }
.timeline .ev::before{ content:''; position:absolute; left:-22px; top:5px; width:10px; height:10px; border-radius:50%; background:var(--primary); }
.qr-box{ background:#fff; padding:10px; border-radius:10px; display:inline-block; }
.empty{ text-align:center; padding:40px 16px; color:var(--ink-2); }
.dot{ display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; }
.risk-meter{ width:46px; height:46px; border-radius:50%; display:grid; place-items:center; font-weight:700; font-size:13px; flex:none; }
/* v1 modal (openModal) → right drawer / bottom sheet */
.modal-wrap{ position:fixed; inset:0; background:var(--scrim); display:none; z-index:60; }
.modal-wrap.open{ display:flex; justify-content:flex-end; align-items:flex-end; }
.modal{ width:min(760px,100%); height:92dvh; background:var(--bg); overflow:auto; padding:20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius:var(--r-lg) var(--r-lg) 0 0; animation:sheet-in var(--t) var(--ease-out); }
@media (min-width:768px){ .modal-wrap.open{ align-items:stretch; } .modal{ height:100%; border-radius:0; padding:24px; } }
.toast{ position:fixed; bottom:calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%) translateY(160px); background:var(--ink); color:var(--bg); padding:12px 18px; border-radius:var(--r-sm); transition:transform var(--t) var(--ease-out); z-index:80; max-width:calc(100vw - 32px); }
.toast.show{ transform:translateX(-50%) translateY(0); }
@media (min-width:768px){ .toast{ bottom:24px; } }
@media (max-width:1100px){ #view .g4{ grid-template-columns:repeat(2,minmax(0,1fr)); } #view .g-21,#view .g3{ grid-template-columns:1fr; } }
@media (max-width:767px){
  #view .g2,#view .g4{ grid-template-columns:1fr; } .form,.kv{ grid-template-columns:1fr; } .bar-row{ grid-template-columns:96px 1fr 50px; }
  .page-head > div:last-child{ display:flex; gap:8px; flex-wrap:wrap; }
}
