/* Kukhulu Workshop. Built for phones in a sunny yard and greasy hands:
   high contrast, big targets, one bold element (the yellow fleet plate). */

:root {
  --ink: #17212B;
  --ink-2: #3C4955;
  --muted: #5A6774;
  --steel: #E4E8EC;
  --panel: #FFFFFF;
  --line: #C3CBD3;
  --line-2: #DCE1E6;
  --hivis: #FFC20E;
  --hivis-ink: #1A1300;
  --teal: #0D5C6B;
  --teal-dark: #093F4A;
  --pass: #1B7A41;
  --pass-bg: #E3F3E9;
  --fail: #C1272D;
  --fail-bg: #FBE6E7;
  --na: #5E6B78;
  --na-bg: #E8ECF0;
  --amber: #A35F00;
  --amber-bg: #FFF3D6;

  --font-display: "Bahnschrift", "DIN Alternate", "D-DIN", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r-sm: 4px;
  --r: 8px;
  --tap: 52px;
  --gutter: 16px;
  --maxw: 1100px;
  --nav-h: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--steel);
  color: var(--ink);
  font: 17px/1.5 var(--font-body);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
img { max-width: 100%; display: block; }
a { color: var(--teal); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .5em; letter-spacing: 0; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 3px solid var(--hivis); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--hivis); color: var(--hivis-ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }

/* ---------- top bar & nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  min-height: var(--nav-h);
  padding: 8px var(--gutter);
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--teal-dark);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; flex: none; }
.brand img { border-radius: 6px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.page-title { flex: 1; min-width: 0; margin: 0; font-size: 1.05rem; font-weight: 600; color: #CFE3E7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offline-flag { display: none; font-size: .8rem; font-weight: 700; color: var(--hivis-ink); background: var(--hivis); padding: 2px 8px; border-radius: 99px; }
body.offline .offline-flag { display: inline-block; }
.sync {
  flex: none; min-height: 40px; padding: 6px 12px; border-radius: 99px; border: 0;
  font: 600 .9rem var(--font-body); cursor: pointer;
}
.sync-pending { background: var(--amber-bg); color: var(--amber); }
.sync-failed { background: var(--fail); color: #fff; }

.nav { background: var(--teal); position: sticky; top: var(--nav-h); z-index: 19; }
.nav ul { list-style: none; margin: 0 auto; padding: 0 8px; display: flex; overflow-x: auto; scrollbar-width: none; max-width: var(--maxw); }
.nav ul::-webkit-scrollbar { display: none; }
.nav a {
  display: flex; align-items: center; min-height: 48px; padding: 0 14px;
  color: #E6F1F3; text-decoration: none; font-weight: 600; white-space: nowrap;
  border-bottom: 4px solid transparent;
}
.nav a.active { color: #fff; border-bottom-color: var(--hivis); }
.nav .nav-account { margin-left: auto; }
body.gated .nav, body.gated .topbar .sync { display: none; }

/* ---------- layout ---------- */
.view { outline: none; }
.page { max-width: var(--maxw); margin: 0 auto; padding: var(--gutter); padding-bottom: 120px; }
body:not(.staff) .page { max-width: 640px; }
.card { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); padding: var(--gutter); margin-bottom: var(--gutter); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-warn { border-left: 6px solid var(--amber); }
.card-error { border-left: 6px solid var(--fail); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--gutter); }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; background: var(--steel); padding: 12px 0; border-top: 1px solid var(--line); justify-content: flex-end; }
.grid-2 { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.grid-4 { display: grid; gap: 8px; grid-template-columns: 2fr 1fr 1fr 1fr; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: 1fr 1fr; } }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.empty { text-align: center; padding: 40px 16px; color: var(--ink-2); }
.empty p { max-width: 40ch; margin: 0 auto 16px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.banner { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.banner-offline { background: var(--amber-bg); border-color: #E9C46A; color: #5A3A00; }
.banner-error { background: var(--fail-bg); border-color: #E5A0A3; color: #7A1015; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px;
  border: 2px solid var(--ink); border-radius: var(--r);
  background: var(--panel); color: var(--ink);
  font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--hivis); border-color: var(--hivis-ink); color: var(--hivis-ink); }
.btn-danger { background: var(--panel); border-color: var(--fail); color: var(--fail); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--teal); }
.btn-block { display: flex; width: 100%; margin-top: 8px; }
.btn-big { min-height: 64px; font-size: 1.15rem; }
.btn-icon { min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-sm); font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.btn-icon:disabled { opacity: .35; }
.btn-link { background: none; border: 0; color: var(--teal); font: 600 1rem var(--font-body); cursor: pointer; min-height: 44px; padding: 0 6px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label, .filters label, .editor-more label, .inline-field span { display: block; font-weight: 600; margin-bottom: 4px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px;
  border: 2px solid var(--line); border-radius: var(--r);
  background: #fff; color: var(--ink); font: 1.05rem var(--font-body);
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(13, 92, 107, .25); }
.hint { font-size: .9rem; color: var(--muted); margin: 4px 0 0; }
.field-error { color: var(--fail); font-weight: 600; font-size: .95rem; margin: 4px 0 0; }
.field-error:empty { display: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea, .has-error { border-color: var(--fail) !important; }
.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); font-weight: 600; cursor: pointer; }
.check input { width: 26px; height: 26px; accent-color: var(--teal); }
.search { margin-bottom: 12px; }
.inline-field { display: flex; align-items: center; gap: 8px; }
.inline-field select { width: auto; }

/* ---------- the fleet plate (the one bold thing) ---------- */
.plate {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 88px; padding: 6px 12px;
  background: var(--hivis); color: var(--hivis-ink);
  border: 3px solid var(--hivis-ink); border-radius: var(--r-sm);
  font: 800 1.35rem/1 var(--font-display); font-stretch: condensed; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: inset 0 0 0 2px var(--hivis);
}
.plate-sm { min-width: 64px; padding: 4px 8px; font-size: 1rem; border-width: 2px; }

/* ---------- chips & dots ---------- */
.chip { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .85rem; font-weight: 700; white-space: nowrap; background: var(--na-bg); color: var(--ink-2); }
.chip-in_progress, .chip-draft { background: var(--amber-bg); color: var(--amber); }
.chip-submitted, .chip-approved { background: #DDEFF2; color: var(--teal-dark); }
.chip-sent, .chip-received { background: var(--pass-bg); color: var(--pass); }
.chip-rejected { background: var(--fail-bg); color: var(--fail); }
.chip-flag { background: var(--amber-bg); color: var(--amber); margin-left: 6px; }
.dot-label { font-size: .85rem; font-weight: 700; }
.dot-queued { color: var(--amber); }
.result-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 2px solid var(--na); }
.result-dot.r-pass { background: var(--pass); border-color: var(--pass); }
.result-dot.r-fail { background: var(--fail); border-color: var(--fail); }
.result-dot.r-na { background: var(--na); border-color: var(--na); }
.r-pass { color: var(--pass); } .r-fail { color: var(--fail); } .r-na { color: var(--na); } .r-pending { color: var(--muted); }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sync-dot.dot-queued { background: var(--amber); }
.sync-dot.dot-failed { background: var(--fail); }

/* ---------- progress ---------- */
.progress { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.progress span { display: block; height: 100%; background: var(--teal); }
.progress-lg { height: 12px; }

/* ---------- job cards & lists ---------- */
.job-list, .row-list, .pick-list, .link-list, .queue-list, .flag-list, .step-list, .timeline, .detail-steps, .editor-steps { list-style: none; margin: 0; padding: 0; }
.job-list li + li { margin-top: 12px; }
.job-card { display: block; background: var(--panel); border: 1px solid var(--line-2); border-left: 6px solid var(--teal); border-radius: var(--r); padding: 14px var(--gutter); color: inherit; text-decoration: none; }
.job-card.is-disabled { opacity: .55; }
.job-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.job-card-title { display: block; font-size: 1.1rem; }
.job-card-foot { display: flex; gap: 12px; justify-content: space-between; font-size: .9rem; }
.row-list li + li { border-top: 1px solid var(--line-2); }
.row-link { display: flex; align-items: center; gap: 12px; padding: 12px 4px; min-height: 64px; color: inherit; text-decoration: none; }
a.row-link:hover strong { text-decoration: underline; }
.pick-list li + li { margin-top: 8px; }
.pick { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 10px 14px; background: var(--panel); border: 2px solid var(--line-2); border-radius: var(--r); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.pick span:last-child { display: flex; flex-direction: column; }
.pick:active { border-color: var(--teal); }
.chosen { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.radio-cards { border: 0; padding: 0; margin: 0 0 14px; }
.radio-cards legend { font-weight: 600; margin-bottom: 6px; }
.radio-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 2px solid var(--line-2); border-radius: var(--r); margin-bottom: 8px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--teal); background: #EEF6F7; }
.radio-card input { width: 24px; height: 24px; accent-color: var(--teal); }
.radio-card span { display: flex; flex-direction: column; }
.link-list li { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.link-list a { font-weight: 600; }

/* ---------- job overview ---------- */
.job-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.job-head > div { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.job-head strong { font-family: var(--font-display); font-size: 1.2rem; }
.section-block { margin-top: 20px; }
.section-block h2 { display: flex; justify-content: space-between; font-size: 1.05rem; color: var(--ink-2); border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.step-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; margin-top: 6px; background: var(--panel); border-radius: var(--r); color: inherit; text-decoration: none; border: 1px solid var(--line-2); }
.step-row-title { flex: 1; min-width: 0; }
.step-row-state { font-weight: 700; font-size: .9rem; }
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: flex; gap: 10px; padding: 12px var(--gutter); padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(228, 232, 236, .96); border-top: 1px solid var(--line);
}
.bottom-bar .btn { flex: 1; }
.step-nav .btn:first-child { flex: 0 0 34%; }
@media (min-width: 700px) { .bottom-bar { position: sticky; background: transparent; border: 0; padding-left: 0; padding-right: 0; } }

/* ---------- step screen ---------- */
.step-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.crumb { display: flex; align-items: center; gap: 8px; color: var(--ink-2); text-decoration: none; font-weight: 600; min-height: 44px; }
.step-title { font-size: 1.65rem; margin-bottom: 8px; }
.step-instr { font-size: 1.05rem; }
.step-where { display: flex; gap: 10px; align-items: baseline; background: var(--panel); border-left: 6px solid var(--teal); padding: 10px 12px; border-radius: var(--r-sm); }
.where-label { font-family: var(--font-display); font-weight: 700; color: var(--teal); flex: none; }
.ref-photo { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); cursor: zoom-in; margin-bottom: 14px; font: inherit; color: var(--muted); }
.ref-photo img { width: 100%; max-height: 240px; object-fit: cover; }
.ref-photo span { display: block; padding: 6px 10px; font-size: .9rem; }
.reading-field input { font-size: 1.6rem; font-family: var(--font-display); font-weight: 700; max-width: 220px; }
.reading-field input.is-out { border-color: var(--amber); background: var(--amber-bg); }
.reading-field input.is-bad { border-color: var(--fail); }
.reading-state { font-weight: 700; color: var(--amber); }

.result-bar { display: grid; grid-template-columns: 1fr 1fr .7fr; gap: 8px; margin: 18px 0 6px; }
.result-btn {
  min-height: 72px; border-radius: var(--r); border: 3px solid currentColor; background: var(--panel);
  font: 800 1.3rem var(--font-display); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.rb-pass { color: var(--pass); } .rb-fail { color: var(--fail); } .rb-na { color: var(--na); }
.result-btn[aria-pressed="true"] { color: #fff; }
.rb-pass[aria-pressed="true"] { background: var(--pass); border-color: var(--pass); }
.rb-fail[aria-pressed="true"] { background: var(--fail); border-color: var(--fail); }
.rb-na[aria-pressed="true"] { background: var(--na); border-color: var(--na); }
.result-btn:disabled { opacity: .6; cursor: default; }
.step-msg { min-height: 0; margin: 4px 0 12px; font-weight: 700; }
.step-msg-error { color: var(--fail); background: var(--fail-bg); padding: 10px 12px; border-radius: var(--r-sm); }
.step-msg-info { color: var(--ink-2); background: var(--amber-bg); padding: 10px 12px; border-radius: var(--r-sm); }

.photo-block { margin: 16px 0; padding: 12px; border: 2px dashed transparent; border-radius: var(--r); }
.photo-block.needs-photo { border-color: var(--amber); background: var(--amber-bg); }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photo-tile { position: relative; margin: 0; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--line-2); display: block; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-open { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.photo-tile.is-queued { outline: 3px solid var(--amber); outline-offset: -3px; }
.photo-badge { position: absolute; left: 4px; bottom: 4px; background: var(--amber); color: #fff; font-size: .75rem; font-weight: 700; padding: 1px 6px; border-radius: 99px; }
.photo-del { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(23, 33, 43, .8); color: #fff; font-size: 1rem; cursor: pointer; }
.photo-add { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 2px dashed var(--ink-2); border-radius: var(--r-sm); background: var(--panel); font: 700 .95rem var(--font-body); color: var(--ink); cursor: pointer; }
.photo-add-icon { font-size: 2rem; line-height: 1; }
.zoom-img { width: 100%; height: auto; border-radius: var(--r-sm); }

.part-block { margin: 16px 0; }
.part-head { display: flex; justify-content: space-between; align-items: center; }
.flag-list li { padding: 10px 12px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-sm); margin-top: 6px; display: flex; flex-direction: column; }
.flag-list li.is-urgent { border-left: 6px solid var(--fail); }
.sync-state { display: block; font-size: .9rem; font-weight: 700; margin: 8px 0; }
.st-queued { color: var(--amber); }
.st-failed { color: var(--fail); }
.st-synced { color: var(--pass); }

/* ---------- submit & done ---------- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 12px 0 16px; }
.summary div { background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; }
.summary dt { font-size: .85rem; color: var(--muted); }
.summary dd { margin: 0; font: 700 1.3rem var(--font-display); }
.done { text-align: center; padding: 40px 0; }
.done-mark { width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 50%; background: var(--pass); color: #fff; font-size: 3rem; display: flex; align-items: center; justify-content: center; }
.queue-list li { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.queue-list li > div:first-child { display: flex; flex-direction: column; }

/* ---------- sign in ---------- */
.gate { min-height: calc(100vh - var(--nav-h)); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--gutter); }
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.gate-brand img { border-radius: 12px; }
.gate-brand div { display: flex; flex-direction: column; font-family: var(--font-display); }
.gate-brand strong { font-size: 1.35rem; }
.gate-brand span { color: var(--muted); }
.gate-card { width: 100%; max-width: 420px; border-top: 6px solid var(--hivis); }
.pin-input { font: 700 2rem var(--font-display) !important; letter-spacing: .4em; text-align: center; }
.unlock .btn-block { margin-top: 12px; }
.temp-pass { font: 700 1.8rem var(--font-display); letter-spacing: .06em; text-align: center; background: var(--hivis); color: var(--hivis-ink); padding: 12px; border-radius: var(--r); user-select: all; }

/* ---------- sheets & toasts ---------- */
.sheet {
  width: min(560px, 100%); max-height: 92vh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: 14px 14px 0 0; background: var(--panel); color: var(--ink);
}
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 14px; } }
.sheet::backdrop { background: rgba(9, 22, 30, .55); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px var(--gutter); border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--panel); }
.sheet-head h2 { margin: 0; }
.sheet-body { padding: var(--gutter); padding-bottom: max(var(--gutter), env(safe-area-inset-bottom)); overflow-y: auto; }
.toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(480px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r); font-weight: 600; transition: opacity .3s, transform .3s; }
.toast-ok { background: var(--pass); }
.toast-error { background: var(--fail); }
.toast-out { opacity: 0; transform: translateY(8px); }

/* ---------- office screens ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: var(--gutter); }
.stat { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px; color: inherit; text-decoration: none; }
.stat-n { font: 800 2.2rem/1 var(--font-display); }
.stat-l { color: var(--ink-2); font-weight: 600; margin-top: 4px; }
.stat-hot { border-left: 6px solid var(--hivis); }
.stat-warn { border-left: 6px solid var(--amber); }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 12px; border-bottom: 2px solid var(--line); }
.tabs a { min-height: 48px; display: flex; align-items: center; padding: 0 14px; color: var(--ink-2); font-weight: 600; text-decoration: none; border-bottom: 4px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--teal); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 700; color: var(--ink-2); border-bottom: 2px solid var(--line); padding: 8px; white-space: nowrap; }
.table td { border-bottom: 1px solid var(--line-2); padding: 8px; vertical-align: middle; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table input { min-height: 44px; padding: 6px 8px; font-size: .95rem; }
.table input.qty { width: 90px; text-align: right; }
.table input.unit { width: 80px; }
.table tr.is-removed td { opacity: .4; text-decoration: line-through; }
tr.is-inactive td { color: var(--muted); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.timeline li { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.tl-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.detail-step { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.detail-step-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-step-head strong { flex: 1; min-width: 160px; }
.detail-step .comment { background: var(--steel); padding: 8px 10px; border-radius: var(--r-sm); margin: 8px 0; }
.detail-step .photo-strip { margin: 8px 0; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }

/* ---------- template editor ---------- */
.editor-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.save-state { color: var(--pass); font-weight: 700; }
.save-state.is-dirty { color: var(--amber); }
.editor-row { display: flex; align-items: center; gap: 8px; }
.editor-num { font: 700 1rem var(--font-display); color: var(--muted); min-width: 36px; }
.editor-title { flex: 1; font-weight: 600; }
.editor-tools { display: flex; gap: 4px; flex: none; }
.editor-section > .editor-row .editor-title { font-family: var(--font-display); font-size: 1.15rem; }
.editor-steps { margin: 12px 0; }
.editor-step { border-left: 4px solid var(--line); padding: 8px 0 8px 10px; margin-bottom: 10px; }
.editor-step.has-error, .editor-section.has-error { border-left-color: var(--fail) !important; }
.editor-more { margin: 6px 0 0 44px; }
.editor-more summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; color: var(--teal); font-weight: 600; }
.editor-more > label, .editor-more .grid-4 { margin-bottom: 10px; }
.ref-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.ref-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r-sm); }
.parts-editor { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

@media (min-width: 900px) {
  :root { --gutter: 20px; }
  .step-title { font-size: 2rem; }
}
