/* SLF Survey Lapangan — PT DNA Mitra Teknik
   Konsep tata letak: lembar kerja lapangan — app bar tipis, tab bawah ala clipboard, kartu formulir bergaris tegas. */
:root {
  --bg: #eef3f6;
  --surface: #ffffff;
  --surface-2: #f5f8fa;
  --ink: #17242d;
  --ink-2: #4d5e69;
  --line: #d3dee5;
  --brand: #0079b8;        /* biru DNA, digelapkan agar kontras pada teks */
  --brand-ink: #ffffff;
  --brand-soft: #e3f1f9;
  --green: #00853f;
  --yellow: #fff000;
  --ok: #157f45; --ok-bg: #e1f5e9;
  --warn: #8a5b00; --warn-bg: #fff3cf;
  --bad: #b3261e; --bad-bg: #fde4e2;
  --muted-bg: #e8eef2;
  --shadow: 0 1px 2px rgba(23, 36, 45, .06), 0 4px 14px rgba(23, 36, 45, .05);
  --f-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f171d; --surface: #172229; --surface-2: #1d2a32; --ink: #e5eef3; --ink-2: #9db0bc; --line: #2c3c46;
    --brand: #3fb3ec; --brand-ink: #06202f; --brand-soft: #143547; --green: #3fc27a;
    --ok: #6fd69c; --ok-bg: #12382a; --warn: #f2c25c; --warn-bg: #3b2f12; --bad: #ff8a80; --bad-bg: #4a1c1a; --muted-bg: #22313a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f171d; --surface: #172229; --surface-2: #1d2a32; --ink: #e5eef3; --ink-2: #9db0bc; --line: #2c3c46;
  --brand: #3fb3ec; --brand-ink: #06202f; --brand-soft: #143547; --green: #3fc27a;
  --ok: #6fd69c; --ok-bg: #12382a; --warn: #f2c25c; --warn-bg: #3b2f12; --bad: #ff8a80; --bad-bg: #4a1c1a; --muted-bg: #22313a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-tap-highlight-color: transparent; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -.005em; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 650; }
h4 { font-size: .85rem; margin: 12px 0 6px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
p { margin: 0 0 8px; }
a { color: var(--brand); }
code, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: .9em; }
.muted { color: var(--ink-2); }
.block { display: block; }
.center { text-align: center; }
.pad { padding: 16px; }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap { gap: 8px; }
.wrap { flex-wrap: wrap; }
.end { justify-content: flex-end; margin-top: 12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ico.spin { animation: none; } * { transition: none !important; } }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .92rem var(--f-body); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--brand); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger:not(.ghost) { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.sm { min-height: 34px; padding: 4px 10px; font-size: .84rem; }
.btn.block { width: 100%; }
.btn[aria-pressed="false"] { color: var(--ink-2); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--muted-bg); }
.icon-btn.sm { width: 32px; height: 32px; }

/* ---------- app bar & tabs */
.appbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.appbar-in { display: flex; align-items: center; gap: 10px; max-width: 1100px; margin: 0 auto; min-height: 58px; padding-block: 6px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
.appbar .brand-logo { height: 34px; width: auto; }
.appbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.appbar-title strong { font: 700 1.02rem var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-title span { font-size: .78rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#save-state[data-s="menyimpan"] { color: var(--warn); }
.sync-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 99px; padding: 4px 10px; font: 600 .76rem var(--f-body); cursor: pointer; white-space: nowrap; }
.sync-chip .ico { width: 15px; height: 15px; }
.sync-chip[data-s="synced"] { color: var(--ok); }
.sync-chip[data-s="offline"], .sync-chip[data-s="error"] { color: var(--warn); }
.sync-chip[data-s="conflict"] { color: var(--bad); }

.tabs { position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; border: 0; background: transparent; color: var(--ink-2); font: 600 .7rem var(--f-body); cursor: pointer; border-top: 3px solid transparent; }
.tab[aria-current="page"] { color: var(--brand); border-top-color: var(--brand); }
@media (min-width: 860px) {
  .tabs { position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); justify-content: center; }
  .tab { flex: 0 0 auto; flex-direction: row; gap: 8px; padding: 11px 18px; font-size: .88rem; border-top: 0; border-bottom: 3px solid transparent; }
  .tab[aria-current="page"] { border-bottom-color: var(--brand); }
}

/* ---------- page & cards */
.page { max-width: 1100px; margin: 0 auto; padding-block: 16px 110px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 14px; }
.page.narrow { max-width: 760px; }
@media (min-width: 860px) { .page { padding-bottom: 48px; } }
.tab-body { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.banner { background: var(--brand-soft); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.banner.bad { background: var(--bad-bg); }
.empty { text-align: center; padding: 36px 18px; border: 2px dashed var(--line); border-radius: var(--r); display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-2); }
.empty h3 { color: var(--ink); }
.sub-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub-head h2 { flex: 1; min-width: 160px; font-size: 1.2rem; }

/* ---------- forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .form-grid .span2 { grid-column: span 2; } }
@media (max-width: 759px) { .form-grid .span2 { grid-column: 1 / -1; } }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld > span { font-size: .78rem; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.fld > span em { font-style: normal; font-weight: 400; }
.fld small { color: var(--ink-2); font-size: .75rem; }
input, select, textarea { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); color: var(--ink); font: 400 .95rem var(--f-body); }
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); background: var(--surface); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
input:disabled, select:disabled, textarea:disabled { opacity: .75; }
.check { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); }
.form-err { color: var(--bad); min-height: 1.3em; font-size: .88rem; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; flex: 1; min-width: 200px; color: var(--ink-2); }
.search input { border: 0; background: transparent; padding-left: 0; box-shadow: none !important; }
.search.sm { min-width: 160px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--surface); padding: 8px 12px; font: 600 .8rem var(--f-body); color: var(--ink-2); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 6px 14px; margin: 0; }
.kv dt { font-weight: 600; color: var(--ink-2); font-size: .85rem; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- pills & tags */
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font: 700 .72rem var(--f-body); letter-spacing: .02em; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.muted { background: var(--muted-bg); color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; color: var(--ink-2); }
.tag .ico { width: 14px; height: 14px; }
.bar { height: 6px; background: var(--muted-bg); border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--green)); border-radius: 9px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-2); font-weight: 600; font-size: .86rem; }
.chip button { border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 99px; cursor: pointer; }
.chip .ico { width: 15px; height: 15px; }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); background:
  linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px, var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--yellow); border-radius: 12px; padding: 26px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.login-logo { width: 190px; height: auto; margin-bottom: 6px; }
.login-card h1 { font-size: 1.45rem; }
.login-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.login-foot { font-size: .8rem; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 10px; margin: 6px 0 0; }

/* ---------- home */
.home-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hello { color: var(--ink-2); margin: 0; }
.proj-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 640px) { .proj-list { grid-template-columns: 1fr; } }
.proj-card { display: flex; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.proj-card:hover { border-color: var(--brand); }
.proj-main { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; color: inherit; font: inherit; padding: 14px 4px 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.proj-main h3 { font-size: 1.05rem; }
.proj-main p { margin: 0; font-size: .86rem; }
.proj-card > .icon-btn { margin: 8px 6px 0 0; }
.proj-top { display: flex; justify-content: space-between; gap: 8px; }
.proj-code { font: 600 .74rem var(--f-mono); color: var(--brand); letter-spacing: .03em; }
.proj-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; }
.proj-stats b { font-family: var(--f-mono); }
.menu-list { display: flex; flex-direction: column; }
.menu-list button { display: flex; align-items: center; gap: 12px; padding: 13px 6px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font: 500 .95rem var(--f-body); cursor: pointer; text-align: left; }
.menu-list button:last-child { border-bottom: 0; }
.menu-list button.danger { color: var(--bad); }

/* ---------- team */
.team { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.team-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; width: 100%; }
@media (max-width: 560px) { .team-row { grid-template-columns: 1fr auto; } .team-row .fld:nth-child(2) { grid-column: 1; } }

/* ---------- rooms */
.floor-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.floor-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .floor-grid { grid-template-columns: 320px minmax(0, 1fr); align-items: start; } }
.denah-btn { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; color: var(--ink); }
.denah-thumb { aspect-ratio: 16 / 9; display: grid; place-items: center; background: #fff; max-width: 100%; }
.denah-thumb.empty { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 8px, var(--muted-bg) 8px, var(--muted-bg) 9px); color: var(--ink-2); font-size: .85rem; }
.denah-thumb img { width: 100%; height: 100%; object-fit: contain; }
.denah-label { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px; font-weight: 600; font-size: .88rem; border-top: 1px solid var(--line); }
.room-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); min-width: 0; }
.room-card { display: flex; gap: 12px; text-align: left; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 8px; cursor: pointer; color: inherit; font: inherit; min-width: 0; }
.room-card:hover { border-color: var(--brand); }
.room-thumb { width: 76px; height: 76px; border-radius: 7px; background: var(--surface-2) center / cover no-repeat; display: grid; place-items: center; color: var(--ink-2); flex: none; border: 1px solid var(--line); }
.room-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .84rem; }
.room-info strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.room-add { min-height: 92px; border-style: dashed; }
.area-out { justify-content: flex-end; }
.area-out output { font-size: 1.4rem; font-weight: 600; color: var(--brand); }
.sketch-box { border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; place-items: center; min-height: 120px; overflow: hidden; }
.sketch-box p { padding: 16px; color: #5a6b76; }
.sketch-box img { width: 100%; height: auto; }

/* ---------- photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.photo-tile, .photo-add { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; position: relative; max-width: 100%; }
.photo-tile { background: var(--muted-bg) center / cover no-repeat; }
.photo-tile.missing::after { content: "Belum diunduh"; position: absolute; inset: 0; display: grid; place-items: center; font-size: .7rem; color: var(--ink-2); }
.geo-dot { position: absolute; right: 4px; bottom: 4px; background: rgba(0, 0, 0, .55); color: #fff000; border-radius: 99px; display: grid; place-items: center; width: 22px; height: 22px; }
.geo-dot .ico { width: 14px; height: 14px; }
.photo-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--surface-2); border-style: dashed; color: var(--brand); font: 600 .76rem var(--f-body); }
.photo-view { display: flex; flex-direction: column; gap: 10px; }
.photo-view img { width: 100%; max-height: 62vh; object-fit: contain; background: #000; border-radius: 8px; }
.photo-meta { font-size: .86rem; display: flex; flex-direction: column; gap: 2px; }

/* ---------- checklist */
.sticky-sum { position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 5; box-shadow: var(--shadow); }
@media (min-width: 860px) { .sticky-sum { top: calc(105px + env(safe-area-inset-top, 0px)); } }
.simak { display: flex; flex-direction: column; gap: 14px; }
.aspect-title { font-size: 1.15rem; color: var(--brand); border-bottom: 2px solid var(--brand-soft); padding-bottom: 6px; }
.group { display: flex; flex-direction: column; gap: 8px; }
.group + .group { border-top: 1px solid var(--line); padding-top: 12px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.item { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.item.open { background: var(--surface); border-color: var(--brand); }
.item-toggle { display: flex; align-items: flex-start; gap: 10px; width: 100%; border: 0; background: transparent; color: inherit; font: inherit; padding: 2px 0; text-align: left; cursor: pointer; }
.item-id { color: var(--brand); font-weight: 600; min-width: 50px; padding-top: 1px; }
.item-label { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-label small { color: var(--ink-2); font-size: .78rem; }
.item-meta { display: flex; align-items: center; gap: 6px; }
.item-meta .chev { transition: transform .15s; color: var(--ink-2); }
.item.open .chev { transform: rotate(90deg); }
.kondisi { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.kondisi button { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; padding: 5px 11px; font: 600 .78rem var(--f-body); cursor: pointer; min-height: 32px; }
.kondisi button[aria-checked="true"][data-tone="ok"] { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.kondisi button[aria-checked="true"][data-tone="warn"] { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }
.kondisi button[aria-checked="true"][data-tone="bad"] { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.kondisi button[aria-checked="true"][data-tone="muted"] { background: var(--muted-bg); color: var(--ink); border-color: var(--ink-2); }
.item-detail:empty { display: none; }
.item-detail { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }

/* ---------- tests */
.test-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.test-card { display: flex; flex-direction: column; gap: 6px; text-align: left; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 14px; cursor: pointer; color: inherit; font: inherit; }
.test-card:hover { border-color: var(--brand); }
.test-card .muted { font-size: .84rem; }
.test-group { font: 600 .7rem var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--green); }
.pick { display: flex; flex-direction: column; gap: 16px; }
.pick h3 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--green); margin-bottom: 8px; }
.pick-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.pick-item { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); padding: 11px; cursor: pointer; color: inherit; font: inherit; }
.pick-item:hover { border-color: var(--brand); background: var(--surface); }
.pick-item small { font: 500 .74rem var(--f-mono); color: var(--brand); }
.pick-item .muted { font-size: .8rem; }
.std-card { background: var(--brand-soft); border-color: transparent; }
.std h3 { margin-bottom: 8px; }
.std .kv dd { font-size: .88rem; }
.rows { display: flex; flex-direction: column; gap: 10px; }
.trow { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; padding: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.trow-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.tcells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tcells .w2, .tcells .w3 { grid-column: 1 / -1; }
@media (min-width: 760px) { .tcells { grid-template-columns: repeat(6, minmax(0, 1fr)); } .tcells .w2 { grid-column: span 2; } .tcells .w3 { grid-column: span 3; } }
.tout { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: .84rem; }
.tout span { display: flex; flex-direction: column; }
.tout small { color: var(--ink-2); font-size: .7rem; }
.tout .note { color: var(--warn); flex-basis: 100%; }
.summary .sum { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 12px; border-radius: 8px; background: var(--surface-2); }
.summary .sum p { margin: 0; }

/* ---------- report */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); }
.stat b { font-size: 1.35rem; color: var(--ink); }
.stat span { font-size: .8rem; color: var(--ink-2); }
.export-opts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.export-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.export-btns .btn { flex: 1 1 160px; }

/* ---------- settings */
.logo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 200px; max-width: 100%; height: 90px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.user-list { display: flex; flex-direction: column; }
.user-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- modal */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(10, 20, 28, .5); display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.modal { background: var(--surface); color: var(--ink); width: 100%; max-width: 460px; max-height: 100%; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.modal.wide { max-width: 820px; }
.modal.full { max-width: none; height: 100%; border-radius: 10px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.02rem; }
.modal-body { padding: 16px; overflow: auto; flex: 1; min-height: 0; }
.modal.full .modal-body { padding: 0; display: flex; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); }
#toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #17242d; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: .88rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); transition: opacity .4s, transform .4s; border-left: 4px solid var(--yellow); }
.toast.ok { border-left-color: #3fc27a; }
.toast.bad { border-left-color: #ff6b5e; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- sketch editor */
.sk-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; }
.sk-tools { display: flex; gap: 4px; overflow-x: auto; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex: none; }
.sk-tool { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; padding: 6px 4px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink-2); font: 600 .7rem var(--f-body); cursor: pointer; }
.sk-tool[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
.sk-stage { flex: 1; min-height: 240px; position: relative; overflow: hidden; background: #fff; }
.sk-canvas { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.sk-status { position: absolute; left: 10px; top: 10px; right: 10px; pointer-events: none; font: 600 .8rem var(--f-mono); color: #1d2b36; background: rgba(255, 255, 255, .85); padding: 4px 8px; border-radius: 6px; width: fit-content; max-width: calc(100% - 20px); }
.sk-bar { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; border-top: 1px solid var(--line); background: var(--surface-2); flex: none; }
