/* Ironwood Reports: interface styles
   Daytime: Porcelain (light grays, white surfaces, ember only on the main action)
   Dark mode: Midnight (Ironwood navy, follows the device setting) */

:root {
  --canvas: #F5F5F7;
  --surface: #FFFFFF;
  --surface-2: #F5F5F7;
  --raised: #FFFFFF;
  --ink: #1D1D1F;
  --ink-2: #6E6E73;
  --ink-3: #8E8E93;
  --hair: rgba(0, 0, 0, .08);
  --hair-strong: rgba(0, 0, 0, .14);
  --fill: rgba(118, 118, 128, .12);      /* quiet buttons, search, segmented track */
  --fill-hover: rgba(118, 118, 128, .18);
  --fill-press: rgba(118, 118, 128, .24);
  --placeholder: #E8E8ED;
  --ember: #B8502E;
  --ember-press: #A14424;
  --ember-tint: rgba(184, 80, 46, .10);
  --on-ember: #FFFFFF;
  --good: #1F8A55;       --good-text: #1A7A4B;       --good-tint: rgba(31, 138, 85, .10);
  --attention: #E8AA14;  --attention-text: #A87A00;  --attention-tint: rgba(232, 170, 20, .14);
  --replacement: #D1343F; --replacement-text: #C42E39; --replacement-tint: rgba(209, 52, 63, .09);
  --glass: rgba(245, 245, 247, .76);
  --glass-bar: rgba(255, 255, 255, .80);
  --seg-on: #FFFFFF;
  --seg-on-shadow: 0 3px 8px rgba(0, 0, 0, .08), 0 0 0 .5px rgba(0, 0, 0, .04);
  --float-shadow: 0 10px 40px rgba(0, 0, 0, .10), 0 0 0 .5px rgba(0, 0, 0, .06);
  --sheet-shadow: 0 24px 80px rgba(0, 0, 0, .18);
  --backdrop: rgba(0, 0, 0, .28);
  --preview-bg: #E8E8ED;
  --viewer-bg: #0B0D10;
  --toast-bg: rgba(29, 29, 31, .90);
  --toast-ink: #FFFFFF;
  --focus: 0 0 0 4px rgba(184, 80, 46, .26);
  --r-sm: 10px; --r-md: 16px; --r-lg: 22px;
  --ease: cubic-bezier(.25, .8, .25, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.32, 1.28, .6, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Inter", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Inter", system-ui, sans-serif;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M1.5 5L5 1.5 8.5 5M1.5 9L5 12.5 8.5 9' fill='none' stroke='%238E8E93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #101418;
    --surface: #1A2026;
    --surface-2: #222930;
    --raised: #222930;
    --ink: #F5F5F7;
    --ink-2: #A3AAB2;
    --ink-3: #79818A;
    --hair: rgba(255, 255, 255, .08);
    --hair-strong: rgba(255, 255, 255, .14);
    --fill: rgba(255, 255, 255, .07);
    --fill-hover: rgba(255, 255, 255, .11);
    --fill-press: rgba(255, 255, 255, .15);
    --placeholder: #242B32;
    --ember: #D2643F;
    --ember-press: #E07250;
    --ember-tint: rgba(210, 100, 63, .16);
    --good: #4CC38A;        --good-text: #5ED19A;        --good-tint: rgba(76, 195, 138, .14);
    --attention: #F5C451;   --attention-text: #F5C451;   --attention-tint: rgba(245, 196, 81, .14);
    --replacement: #FF6B6B; --replacement-text: #FF7B7B; --replacement-tint: rgba(255, 107, 107, .14);
    --glass: rgba(16, 20, 24, .74);
    --glass-bar: rgba(30, 37, 44, .80);
    --seg-on: #3A434C;
    --seg-on-shadow: 0 3px 8px rgba(0, 0, 0, .25);
    --float-shadow: 0 12px 44px rgba(0, 0, 0, .45), 0 0 0 .5px rgba(255, 255, 255, .08);
    --sheet-shadow: 0 24px 80px rgba(0, 0, 0, .55), 0 0 0 .5px rgba(255, 255, 255, .08);
    --backdrop: rgba(0, 0, 0, .55);
    --preview-bg: #0B0E11;
    --toast-bg: rgba(58, 67, 76, .94);
    --focus: 0 0 0 4px rgba(210, 100, 63, .34);
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M1.5 5L5 1.5 8.5 5M1.5 9L5 12.5 8.5 9' fill='none' stroke='%2379818A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 15px/1.47 var(--font); letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s var(--ease);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }
.only-sm { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--ember-tint); }

/* Content fades up gently on load */
.wrap { animation: rise .6s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Navigation bar ---------- */
.nav {
  position: sticky; top: 0; z-index: 40; height: 52px;
  display: flex; align-items: center; gap: 18px; padding: 0 max(24px, env(safe-area-inset-left));
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: .5px solid var(--hair);
}
.brand { display: flex; align-items: center; gap: 10px; font: 600 15px/1 var(--font-display); letter-spacing: -0.02em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: #1D1D1F; display: grid; place-items: center; }
.brand-mark img { width: 18px; }
@media (prefers-color-scheme: dark) { .brand-mark { background: #222930; box-shadow: inset 0 0 0 .5px rgba(255,255,255,.12); } }
.brand small { color: var(--ink-3); font-weight: 500; }
.nav-links { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav-link { padding: 6px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: 14px; transition: background .25s var(--ease), color .25s var(--ease); }
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--ink); background: var(--fill); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--ink);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; letter-spacing: 0; border: 0; cursor: pointer;
  transition: background .25s var(--ease); }
.avatar:hover { background: var(--fill-hover); }

/* ---------- Layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 48px max(24px, env(safe-area-inset-left)) 140px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 32px; }
.large-title { font: 700 40px/1.08 var(--font-display); letter-spacing: -0.032em; margin: 0; }
.subtitle { color: var(--ink-2); margin: 8px 0 0; font-size: 15px; }
.spacer { flex: 1; }
.back { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-weight: 500; margin-bottom: 16px; font-size: 14.5px; transition: color .2s var(--ease); }
.back:hover { color: var(--ink); }
.back svg { width: 8px; height: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; white-space: nowrap; user-select: none;
  transition: transform .3s var(--spring), background-color .25s var(--ease), color .25s var(--ease), opacity .25s var(--ease);
}
.btn:active { transform: scale(.96); transition-duration: .1s; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--ember); color: var(--on-ember); }
.btn-primary:hover { background: var(--ember-press); }
.btn-dark { background: var(--ink); color: var(--canvas); }
.btn-dark:hover { opacity: .86; }
.btn-plain { background: var(--fill); color: var(--ink); }
.btn-plain:hover { background: var(--fill-hover); }
.btn-ghost { background: transparent; color: var(--ink-2); padding: 0 12px; }
.btn-ghost:hover { background: var(--fill); color: var(--ink); }
.btn-danger { background: var(--replacement-tint); color: var(--replacement-text); }
.btn-danger:hover { background: var(--replacement-tint); opacity: .8; }
.btn-sm { height: 30px; padding: 0 13px; font-size: 13px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 16px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3);
  display: grid; place-items: center; cursor: pointer; transition: background .25s var(--ease), color .25s var(--ease), transform .3s var(--spring); }
.icon-btn:hover { background: var(--fill); color: var(--ink); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------- Form controls ---------- */
.field { display: grid; gap: 7px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, .select {
  height: 44px; width: 100%; padding: 0 14px; border-radius: 12px;
  border: 0; background: var(--fill); transition: background .25s var(--ease), box-shadow .25s var(--ease);
}
.input::placeholder { color: var(--ink-3); }
.input:hover, .select:hover { background: var(--fill-hover); }
.input:focus, .select:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 1px var(--ember), var(--focus); }
.select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--fill) var(--chev) no-repeat right 13px center; }
.select:hover { background: var(--fill-hover) var(--chev) no-repeat right 13px center; }
.select:focus { background: var(--surface) var(--chev) no-repeat right 13px center; }
.select option { background: var(--surface); color: var(--ink); }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 35px; height: 38px; border-radius: 11px; min-width: 280px; }

/* Segmented control */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; gap: 2px; width: 100%;
  background: var(--fill); border-radius: 10px; position: relative; }
.seg button { height: 32px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 500;
  color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px;
  transition: background-color .3s var(--ease), color .25s var(--ease), box-shadow .3s var(--ease); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--ink); box-shadow: var(--seg-on-shadow); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.good, .dot.green { background: var(--good); }
.dot.attention, .dot.yellow { background: var(--attention); }
.dot.replacement, .dot.red { background: var(--replacement); }

/* Switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--fill-press); border-radius: 999px; transition: background-color .3s var(--ease); }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.12); transition: transform .4s var(--spring); }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

/* ---------- Grouped lists (inset, like Settings) ---------- */
.group { background: var(--surface); border-radius: var(--r-md); overflow: hidden; }
.group-title { font-size: 13px; color: var(--ink-3); font-weight: 500; margin: 30px 16px 8px; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; min-height: 54px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 18px; border-top: .5px solid var(--hair-strong); }
.row.has-thumb + .row.has-thumb::before { left: 104px; }
a.row { transition: background-color .2s var(--ease); }
a.row:hover { background: var(--fill); }
a.row:active { background: var(--fill-hover); }
.chev { width: 7px; height: 12px; color: var(--ink-3); flex: none; opacity: .7; }

/* Inspections list */
.insp-thumb { width: 72px; height: 54px; border-radius: 10px; object-fit: cover; background: var(--placeholder); flex: none; }
.insp-thumb.empty { display: grid; place-items: center; color: var(--ink-3); }
.insp-thumb.empty svg { width: 20px; }
.insp-main { flex: 1; min-width: 0; }
.insp-address { font-weight: 600; font-size: 16px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-meta { color: var(--ink-3); font-size: 13.5px; display: flex; gap: 14px; margin-top: 2px; }
.capsule { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.capsule .dot { width: 6px; height: 6px; }
.capsule.green { background: var(--good-tint); color: var(--good-text); }
.capsule.yellow { background: var(--attention-tint); color: var(--attention-text); }
.capsule.red { background: var(--replacement-tint); color: var(--replacement-text); }
.capsule.none { background: var(--fill); color: var(--ink-2); }

.empty-state { text-align: center; padding: 88px 24px; }
.empty-state h2 { font: 600 24px/1.2 var(--font-display); letter-spacing: -0.025em; margin: 20px 0 8px; }
.empty-state p { color: var(--ink-2); margin: 0 auto 26px; max-width: 380px; }
.empty-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 18px; background: var(--surface); display: grid; place-items: center; color: var(--ink-3); }
.empty-icon svg { width: 28px; }

/* ---------- Sheets (modals) ---------- */
dialog.sheet-modal { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; margin: 0; color: var(--ink); }
dialog.sheet-modal::backdrop { background: var(--backdrop); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100% - 32px));
  max-height: calc(100% - 48px); overflow: auto; background: var(--raised); border-radius: var(--r-lg); box-shadow: var(--sheet-shadow); padding: 28px; }
dialog[open] .sheet-panel { animation: sheet-in .5s var(--ease-out); }
dialog[open]::backdrop { animation: fade-in .35s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.97); } }
@keyframes fade-in { from { opacity: 0; } }
.sheet-panel h2 { font: 700 22px/1.2 var(--font-display); letter-spacing: -0.025em; margin: 0 0 6px; }
.sheet-panel p.lede { color: var(--ink-2); margin: 0 0 22px; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.sheet-panel.wide { width: min(1040px, calc(100% - 32px)); height: min(760px, calc(100% - 48px)); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: .5px solid var(--hair-strong); }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-body { flex: 1; overflow: auto; padding: 18px 20px 26px; }

@media (max-width: 640px) {
  .sheet-panel { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; border-radius: 24px 24px 0 0; padding-bottom: max(28px, env(safe-area-inset-bottom)); }
  .sheet-panel::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--fill-press); margin: -14px auto 18px; }
  .sheet-panel.wide::before { margin: 8px auto 0; }
  .sheet-panel.wide { height: calc(100% - 40px); }
  dialog[open] .sheet-panel { animation: sheet-up .55s var(--ease-out); }
  @keyframes sheet-up { from { transform: translateY(100%); } }
}

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; top: 66px; transform: translate(-50%, -12px) scale(.96); opacity: 0; z-index: 100;
  background: var(--toast-bg); color: var(--toast-ink); padding: 10px 18px; border-radius: 999px; font-weight: 500; font-size: 14px;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--float-shadow); pointer-events: none;
  transition: opacity .3s var(--ease), transform .5s var(--spring); max-width: calc(100% - 40px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast.error { background: rgba(196, 46, 57, .95); color: #fff; }

/* ---------- Login ---------- */
.login-body { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--canvas); }
.login-art { position: relative; background: radial-gradient(120% 90% at 50% 40%, #1C232A 0%, #101418 70%); display: grid; place-items: center; overflow: hidden; }
.login-art img { width: min(260px, 52%); height: auto; animation: rise .9s var(--ease-out) both .1s; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: min(340px, 100%); animation: rise .7s var(--ease-out) both .15s; }
.login-card h1 { font: 700 34px/1.1 var(--font-display); letter-spacing: -0.032em; margin: 0 0 8px; }
.login-card .lede { color: var(--ink-2); margin: 0 0 30px; }
.login-card form { display: grid; gap: 14px; }
.login-card .btn { width: 100%; margin-top: 10px; }
.form-error { background: var(--replacement-tint); color: var(--replacement-text); border-radius: var(--r-sm); padding: 10px 13px; font-size: 14px; font-weight: 500; }
@media (max-width: 820px) {
  .login-body { grid-template-columns: 1fr; grid-template-rows: 30vh 1fr; }
  .login-art img { width: 170px; }
}

/* ---------- Property page ---------- */
.prop-title { display: flex; align-items: center; gap: 6px; }
.prop-title .icon-btn { margin-top: 6px; }
.dropzone {
  position: relative; border-radius: var(--r-lg); background: var(--surface);
  padding: 44px 24px; text-align: center; cursor: pointer;
  transition: background-color .3s var(--ease), transform .4s var(--spring), box-shadow .3s var(--ease);
}
.dropzone:hover { background: var(--surface-2); }
.dropzone:hover .dz-icon { transform: translateY(-2px); }
.dropzone.over { transform: scale(1.01); box-shadow: 0 0 0 2px var(--ember); background: var(--surface); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: var(--fill); color: var(--ink);
  transition: transform .4s var(--spring); }
.dz-icon svg { width: 22px; }
.dropzone strong { display: block; font: 600 19px/1.3 var(--font-display); letter-spacing: -0.02em; margin-bottom: 4px; }
.dropzone span { color: var(--ink-2); font-size: 14px; }
.dropzone.compact { padding: 14px 18px; display: flex; align-items: center; gap: 14px; text-align: left; border-radius: var(--r-md); }
.dropzone.compact .dz-icon { margin: 0; width: 40px; height: 40px; }
.dropzone.compact .dz-icon svg { width: 18px; }
.dropzone.compact strong { font-size: 15.5px; margin-bottom: 0; }
.dropzone.compact span { font-size: 13.5px; color: var(--ink-3); }

.upload-progress { margin-top: 14px; display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: var(--ink-2); }
.bar { flex: 1; height: 4px; background: var(--fill); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ember); border-radius: inherit; transition: width .5s var(--ease-out); }

.grid-toolbar { display: flex; align-items: baseline; gap: 10px; margin: 40px 2px 14px; }
.grid-toolbar h2 { font: 700 22px/1.2 var(--font-display); letter-spacing: -0.025em; margin: 0; }
.grid-toolbar .count { color: var(--ink-3); font-size: 15px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px; border-radius: var(--r-md); overflow: hidden; }
.tile { position: relative; aspect-ratio: 1; background: var(--placeholder); border: 0; padding: 0; cursor: pointer; overflow: hidden;
  animation: tile-in .5s var(--ease-out) both; }
@keyframes tile-in { from { opacity: 0; } }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out), opacity .4s var(--ease), filter .3s var(--ease); }
.tile:hover img { transform: scale(1.04); }
.tile .tag { position: absolute; left: 7px; bottom: 7px; right: 7px; display: flex; align-items: center; gap: 6px; }
.tile .chip { height: 22px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  background: rgba(0, 0, 0, .42); color: #fff; backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile .score { margin-left: auto; flex: none; }
.tile .in-report { position: absolute; right: 7px; top: 7px; width: 22px; height: 22px; border-radius: 50%; background: var(--ember); color: #fff;
  display: grid; place-items: center; box-shadow: 0 0 0 1.5px rgba(255,255,255,.9); }
.tile .in-report svg { width: 12px; }
.tile.pending img { opacity: .5; filter: saturate(.6); }
.tile .spinner { position: absolute; inset: 0; margin: auto; }

/* Floating action bar */
.action-bar {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 14px; padding: 9px 9px 9px 20px; width: min(680px, calc(100% - 28px));
  background: var(--glass-bar); border-radius: 999px; box-shadow: var(--float-shadow);
  backdrop-filter: saturate(180%) blur(28px); -webkit-backdrop-filter: saturate(180%) blur(28px);
  animation: bar-in .7s var(--ease-out) both .15s;
}
@keyframes bar-in { from { opacity: 0; transform: translate(-50%, 24px); } }
.action-bar .status { flex: 1; min-width: 0; }
.action-bar .status strong { display: block; font-weight: 600; font-size: 14.5px; }
.action-bar .status span { display: block; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.action-bar .btns { display: flex; gap: 8px; }
.ring { width: 34px; height: 34px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.5; }
.ring .track { stroke: var(--fill-hover); }
.ring .fill { stroke: var(--ember); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease-out); }
@media (max-width: 600px) {
  .action-bar { flex-wrap: wrap; padding: 14px; gap: 12px; border-radius: 24px; }
  .action-bar .btns { width: 100%; } .action-bar .btns .btn { flex: 1; }
}

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
.spinner.dark { border-color: var(--fill-hover); border-top-color: var(--ink-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Photo viewer */
.viewer { display: grid; grid-template-columns: 1fr 320px; height: 100%; }
.viewer-img { background: var(--viewer-bg); display: grid; place-items: center; min-height: 0; }
.viewer-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-info { padding: 22px; overflow: auto; display: flex; flex-direction: column; gap: 18px; }
.viewer-info h3 { margin: 0; font: 600 18px/1.3 var(--font-display); letter-spacing: -0.02em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 500; }
.meter { display: flex; align-items: center; gap: 8px; }
.meter .bar { max-width: 110px; } .meter .bar i { background: var(--ink); }
.quote { background: var(--fill); border-radius: 12px; padding: 12px 14px; color: var(--ink-2); font-size: 14px; }
.cand { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; font-size: 13.5px; }
.cand li { padding: 9px 12px; border-radius: 10px; background: var(--fill); }
@media (max-width: 760px) { .viewer { grid-template-columns: 1fr; grid-template-rows: 55% 1fr; } }

/* ---------- Editor ---------- */
.editor-body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.editor-bar { position: relative; z-index: 20; height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--glass); border-bottom: .5px solid var(--hair-strong); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); }
.editor-bar .title { min-width: 0; }
.editor-bar .title strong { display: block; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-bar .title span { display: block; font-size: 12px; color: var(--ink-3); }
.save-state { display: inline-flex; align-items: center; gap: 6px; }
.save-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--good); transition: background-color .3s var(--ease); }
.save-state.saving i { background: var(--attention); }
.save-state.error i { background: var(--replacement); }
.editor-main { flex: 1; display: grid; grid-template-columns: 400px 1fr; min-height: 0; }
.inspector { overflow: auto; background: var(--canvas); border-right: .5px solid var(--hair-strong); padding: 4px 16px 64px; overscroll-behavior: contain; }
.inspector .group-title:first-child { margin-top: 20px; }
.inspector .group-title { margin-left: 4px; }
.inspector .group { padding: 16px; display: grid; gap: 14px; }
.inspector .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview { position: relative; background: var(--preview-bg); min-height: 0; }
.preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; transition: opacity .35s var(--ease); }
.preview.loading iframe { opacity: .6; }
.reason { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.color-seg button[aria-pressed="true"][data-v="green"] { color: var(--good-text); }
.color-seg button[aria-pressed="true"][data-v="yellow"] { color: var(--attention-text); }
.color-seg button[aria-pressed="true"][data-v="red"] { color: var(--replacement-text); }

.summary-row { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.face-seg button { padding: 0; }
.face-seg svg { width: 20px; height: 20px; }

.cover-pick { display: flex; align-items: center; gap: 12px; }
.cover-pick img, .cover-pick .ph { width: 96px; height: 54px; border-radius: 10px; object-fit: cover; background: var(--placeholder); flex: none; }
.cover-pick .meta { flex: 1; font-size: 13.5px; color: var(--ink-2); }

.slots-head { display: flex; align-items: baseline; gap: 8px; margin: 30px 4px 8px; }
.slots-head .group-title { margin: 0; }
.slots-head .hint { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }
.page-label { font-size: 11.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; margin: 18px 6px 8px; display: flex; align-items: center; gap: 10px; }
.page-label::after { content: ""; flex: 1; border-top: .5px solid var(--hair-strong); }
.slot-card { background: var(--surface); border-radius: var(--r-md); padding: 12px; display: grid; gap: 10px; margin-bottom: 8px;
  transition: transform .4s var(--spring), box-shadow .3s var(--ease), opacity .25s var(--ease); }
.slot-card.dragging { opacity: .35; transform: scale(.98); }
.slot-card.drop-before { box-shadow: 0 -3px 0 var(--ember); }
.slot-top { display: grid; grid-template-columns: 112px 1fr; gap: 12px; }
.slot-photo { position: relative; width: 112px; height: 78px; border-radius: 10px; overflow: hidden; background: var(--placeholder); cursor: crosshair; }
.slot-photo img { width: 100%; height: 100%; object-fit: cover; }
.slot-photo .num { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.5); color: #fff; font: 600 11px/1 var(--font-display); padding: 4px 6px; border-radius: 6px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.slot-photo .focus { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); transform: translate(-50%, -50%); pointer-events: none;
  transition: left .35s var(--ease-out), top .35s var(--ease-out); }
.slot-side { display: grid; gap: 8px; align-content: start; min-width: 0; }
.slot-tools { display: flex; align-items: center; gap: 2px; }
.slot-tools .grip { cursor: grab; color: var(--ink-3); margin-right: auto; display: inline-flex; padding: 4px; }
.slot-tools .grip svg { width: 16px; height: 16px; }
.slot-tools .icon-btn { width: 30px; height: 30px; } .slot-tools .icon-btn svg { width: 15px; height: 15px; }
.status-seg button { height: 28px; font-size: 12px; }
.slot-card .select { height: 38px; font-size: 13.5px; }
.slot-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.add-slot { width: 100%; height: 46px; border-radius: var(--r-md); border: 0; background: var(--fill); color: var(--ink); font-weight: 600; cursor: pointer;
  transition: background-color .25s var(--ease), transform .3s var(--spring); }
.add-slot:hover { background: var(--fill-hover); }
.add-slot:active { transform: scale(.98); }

.mobile-tabs { display: none; }
@media (max-width: 900px) {
  .editor-main { grid-template-columns: 1fr; }
  .preview { display: none; }
  .editor-main.show-preview .inspector { display: none; }
  .editor-main.show-preview .preview { display: block; }
  .mobile-tabs { display: block; padding: 8px 14px; background: var(--glass); border-bottom: .5px solid var(--hair-strong); }
  .editor-bar .hide-sm { display: none; }
}

/* Picker */
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.pick { border: 0; padding: 0; background: transparent; border-radius: 12px; text-align: left; cursor: pointer; color: var(--ink);
  transition: transform .4s var(--spring), opacity .25s var(--ease); }
.pick:hover { transform: translateY(-2px); }
.pick:hover img { filter: brightness(1.04); }
.pick img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--placeholder); border-radius: 12px; transition: filter .3s var(--ease); }
.pick .pick-meta { padding: 8px 2px 4px; display: grid; gap: 2px; font-size: 12.5px; }
.pick .pick-meta strong { font-size: 13px; font-weight: 600; }
.pick .pick-meta span { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick.used { opacity: .45; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-row button { height: 30px; padding: 0 13px; border-radius: 999px; border: 0; background: var(--fill); font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-2);
  transition: background-color .25s var(--ease), color .25s var(--ease); }
.filter-row button:hover { color: var(--ink); }
.filter-row button[aria-pressed="true"] { background: var(--ink); color: var(--canvas); }

/* Share sheet */
.share-row { display: flex; align-items: center; gap: 14px; }
.share-row .label { flex: 1; }
.share-row .label strong { display: block; font-weight: 600; }
.share-row .label span { display: block; color: var(--ink-2); font-size: 13.5px; }
.link-box { display: flex; gap: 8px; }
.link-box .input { font-size: 13.5px; color: var(--ink-2); }
.divider { border: 0; border-top: .5px solid var(--hair-strong); margin: 20px 0; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.live-pill.on { color: var(--good-text); } .live-pill.off { color: var(--ink-3); }

/* Team */
.team-form { padding: 20px; display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.team-form .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--ember); }
.role { color: var(--ink-3); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  .nav { gap: 10px; padding: 0 16px; }
  .brand small { display: none; }
  .nav-link { padding: 6px 10px; }
  .wrap { padding-top: 26px; padding-left: 16px; padding-right: 16px; }
  .large-title { font-size: 32px; }
  .prop-title .large-title { font-size: 26px; line-height: 1.15; }
  .page-head { gap: 12px; margin-bottom: 24px; }
  .search, .search .input { width: 100%; min-width: 0; }
  .page-head > .btn { width: 100%; height: 44px; }
  .insp-meta { flex-wrap: wrap; gap: 0 10px; }
  .capsule .cap-text { display: none; }
  .capsule .only-sm { display: inline-block; }
  .capsule { padding: 0 8px; }
  .capsule .dot { width: 8px; height: 8px; }
  .row { padding: 11px 14px; }
  .insp-thumb { width: 58px; height: 46px; }
  .row.has-thumb + .row.has-thumb::before { left: 86px; }
  .dropzone { padding: 36px 20px; }
}
