/* Logbook – themed stylesheet (light + dark). All colours come from the variables below. */
:root {
  color-scheme: light;
  --bg: #f4f3ee; --surface: #ffffff; --surface2: #faf9f6; --surface3: #f1efe9; --hover: #fcfbf8;
  --ink: #1c1b19; --ink2: #4a4742; --muted: #86817a; --on-accent: #231b00;
  --line: #e8e5dd; --line2: #f1efe9; --line3: #d8d4ca;
  --gold: #f5b700; --gold-d: #c99200; --gold-soft: #fff6d6; --gold-line: #f2d47a; --gold-ink: #6b4f00;
  --good: #0f9d6b; --good-bg: #e0f6ec; --good-ink: #0b6b49; --good-line: #a9e2c8;
  --warn-bg: #fff0cf; --warn-ink: #b45309; --warn-line: #f5d28b;
  --bad: #d1344f; --bad-bg: #fde8ec; --bad-ink: #a3213a; --bad-line: #f4b6c0;
  --info: #2f6fed; --info-bg: #e8f0ff; --info-ink: #1e4fb8; --info-line: #c4d7fb;
  --link: #1d4ed8;
  --topbar-bg: rgba(255,255,255,.82);
  --ring-track: #ece9e2; --ph-from: #f3efe4; --ph-to: #e6e0d0; --ph-ink: #b9b19c;
  --hero-from: #2a2823; --hero-to: #181714; --hero-line: #3a3733;
  --scrim: rgba(20,18,15,.55);
  --r: 16px; --r-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(28,27,25,.05);
  --shadow: 0 1px 2px rgba(28,27,25,.04), 0 8px 24px -10px rgba(28,27,25,.14);
  --shadow-lg: 0 28px 70px -14px rgba(28,27,25,.4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #100f0e; --surface: #1b1a18; --surface2: #222120; --surface3: #2b2926; --hover: #212019;
    --ink: #f2f0ea; --ink2: #cbc7bd; --muted: #96918a;
    --line: #353330; --line2: #2a2926; --line3: #47443f;
    --gold-soft: rgba(245,183,0,.13); --gold-line: rgba(245,183,0,.38); --gold-ink: #ffd35c;
    --good-bg: rgba(16,185,129,.16); --good-ink: #6ee7b7; --good-line: rgba(16,185,129,.4);
    --warn-bg: rgba(245,158,11,.16); --warn-ink: #fcd34d; --warn-line: rgba(245,158,11,.4);
    --bad-bg: rgba(244,63,94,.16); --bad-ink: #fda4af; --bad-line: rgba(244,63,94,.42);
    --info-bg: rgba(59,130,246,.16); --info-ink: #93c5fd; --info-line: rgba(59,130,246,.4);
    --link: #8ab4ff;
    --topbar-bg: rgba(16,15,14,.8);
    --ring-track: #35332f; --ph-from: #2a2823; --ph-to: #201f1c; --ph-ink: #5d5850;
    --hero-from: #2b2924; --hero-to: #151413; --hero-line: #413e38;
    --scrim: rgba(0,0,0,.65);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px -12px rgba(0,0,0,.6);
    --shadow-lg: 0 28px 70px -14px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #100f0e; --surface: #1b1a18; --surface2: #222120; --surface3: #2b2926; --hover: #212019;
  --ink: #f2f0ea; --ink2: #cbc7bd; --muted: #96918a;
  --line: #353330; --line2: #2a2926; --line3: #47443f;
  --gold-soft: rgba(245,183,0,.13); --gold-line: rgba(245,183,0,.38); --gold-ink: #ffd35c;
  --good-bg: rgba(16,185,129,.16); --good-ink: #6ee7b7; --good-line: rgba(16,185,129,.4);
  --warn-bg: rgba(245,158,11,.16); --warn-ink: #fcd34d; --warn-line: rgba(245,158,11,.4);
  --bad-bg: rgba(244,63,94,.16); --bad-ink: #fda4af; --bad-line: rgba(244,63,94,.42);
  --info-bg: rgba(59,130,246,.16); --info-ink: #93c5fd; --info-line: rgba(59,130,246,.4);
  --link: #8ab4ff;
  --topbar-bg: rgba(16,15,14,.8);
  --ring-track: #35332f; --ph-from: #2a2823; --ph-to: #201f1c; --ph-ink: #5d5850;
  --hero-from: #2b2924; --hero-to: #151413; --hero-line: #413e38;
  --scrim: rgba(0,0,0,.65);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 28px 70px -14px rgba(0,0,0,.8);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; transition: background-color .25s, color .25s; }
::selection { background: var(--gold); color: #231b00; }
h1, h2, h3, h4 { margin: 0; font-family: Inter, system-ui, sans-serif; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); }
code { background: var(--surface3); padding: 1px 6px; border-radius: 5px; font-size: .88em; }
kbd { background: rgba(255,255,255,.1); color: #e7e5e4; border: 1px solid rgba(255,255,255,.2); border-radius: 5px; padding: 0 6px; font-size: 11px; }
[hidden] { display: none !important; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.row { display: flex; align-items: center; } .gap { gap: 8px; }
.muted { color: var(--muted); }
.muted-d { color: #a29d94; font-size: 12.5px; margin: 4px 0 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
input, select, textarea { color-scheme: inherit; }
* { scrollbar-width: thin; scrollbar-color: var(--line3) transparent; }

/* ---------- Buttons ---------- */
.btn { border: 1px solid transparent; border-radius: 10px; padding: 8px 15px; font-weight: 600; font-size: 13px; transition: background .15s, box-shadow .15s, transform .06s, border-color .15s; white-space: nowrap; line-height: 1.2; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #ffc61a, var(--gold)); color: var(--on-accent); box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 4px 12px -4px rgba(245,183,0,.6); font-weight: 700; }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffd03d, #f0b000); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink2); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--surface2); border-color: var(--line3); }
.btn-dark { background: var(--ink); color: var(--surface); }
.btn-dark:hover { opacity: .88; }
.btn-danger { background: var(--surface); border-color: var(--bad-line); color: var(--bad-ink); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-icon { padding: 8px 11px; font-size: 15px; line-height: 1; }
.link { background: none; border: 0; color: var(--ink2); text-decoration: underline; padding: 0; }
.icon-btn { background: none; border: 0; border-radius: 8px; padding: 5px 7px; color: var(--muted); font-size: 15px; line-height: 1; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--surface3); color: var(--ink); }
.icon-btn.del:hover { background: var(--bad-bg); color: var(--bad-ink); }
.icon-btn.spin { animation: spin 1s linear infinite; color: var(--gold-d); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Top bar ---------- */
.topbar { background: var(--topbar-bg); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-in { display: flex; align-items: center; gap: 18px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, #ffcb2e, #f0a800); display: grid; place-items: center; font: 700 20px Oswald, sans-serif; color: var(--on-accent); box-shadow: 0 6px 14px -6px rgba(240,168,0,.8); }
.brand h1 { font: 700 21px/1 Oswald, sans-serif; text-transform: uppercase; letter-spacing: .06em; }
.brand p { margin: 3px 0 0; font-size: 11px; color: var(--muted); }
.topbar-stats { display: flex; gap: 6px; margin-left: 6px; }
.stat { text-align: center; line-height: 1.1; padding: 5px 14px; background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; }
.stat b { font: 700 16px Oswald, sans-serif; display: block; }
.stat span { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sync { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 11px; border-radius: 999px; background: var(--surface3); }
.sync.ok { color: var(--good-ink); background: var(--good-bg); } .sync.err { color: var(--bad-ink); background: var(--bad-bg); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.seg-btn { background: transparent; border: 0; padding: 7px 13px; font-weight: 600; font-size: 13px; color: var(--ink2); }
.seg-btn.on { background: var(--ink); color: var(--surface); }

/* ---------- Add-a-car hero ---------- */
.addcar { padding-top: 22px; }
.assistant { position: relative; overflow: hidden; background: radial-gradient(900px 260px at 100% -40%, rgba(245,183,0,.22), transparent 60%), linear-gradient(160deg, var(--hero-from), var(--hero-to)); color: #f5f4f0; border-radius: 20px; padding: 22px 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--hero-line); }
.assistant-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.assistant h2 { color: #fff; font-size: 20px; }
.url-row { margin-top: 14px; }
.url-row input, .assistant textarea { width: 100%; background: rgba(0,0,0,.4); border: 1px solid #45413b; border-radius: 12px; padding: 12px 14px; color: #f5f4f0; line-height: 1.55; transition: border-color .15s, box-shadow .15s; }
.assistant textarea { margin-top: 10px; min-height: 100px; resize: vertical; }
.url-row input::placeholder, .assistant textarea::placeholder, .nl-form input::placeholder { color: #8d887f; }
.url-row input:focus, .assistant textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,183,0,.2); }
.assistant-foot { display: flex; gap: 10px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.assistant .chip { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); color: #d6d2c8; }
.assistant .chip:hover { background: rgba(255,255,255,.14); color: #fff; }
.assistant .btn-dark { background: rgba(255,255,255,.12); color: #f5f4f0; }
.pill { font-size: 11px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.pill-dark { background: rgba(255,255,255,.1); color: #d6d2c8; border: 1px solid rgba(255,255,255,.16); }
.pill-gold { background: rgba(245,183,0,.18); color: #ffd54a; border: 1px solid rgba(245,183,0,.4); }
.pill-warn { background: rgba(244,63,94,.16); color: #ffb3c0; border: 1px solid rgba(244,63,94,.45); }
.ai-notice { margin: 12px 0 0; padding: 10px 13px; border-radius: 10px; background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.45); color: #ffd0d8; font-size: 12.5px; }
.ai-banner { margin-top: 16px; padding: 14px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid rgba(52,211,153,.4); font-size: 13px; }
.ai-banner h4 { margin: 0; font: 700 13px Inter, sans-serif; text-transform: uppercase; color: #34d399; letter-spacing: .06em; }
.ai-banner .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-banner .tag { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 6px; padding: 1px 9px; font-size: 12px; }
.ai-banner .verdict { margin-top: 10px; color: #d6d2c8; font-style: italic; }
.ai-banner .x { float: right; background: none; border: 0; color: #a29d94; font-size: 16px; }
.attach-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.att { position: relative; width: 84px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,.25); }
.att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; line-height: 1; }

/* ---------- Buyer profile ---------- */
.profile-wrap { padding-top: 18px; }
.profile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; box-shadow: var(--shadow); }
.profile h2 { font-size: 16px; }
.profile-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.profile-head .chips-row { margin-top: 8px; }
.profile .muted-d { color: var(--muted); }
.profile .btn-dark { background: var(--surface); color: var(--ink2); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.profile .btn-dark:hover { background: var(--surface2); opacity: 1; }
.nl-form { display: flex; gap: 8px; margin-top: 14px; }
.nl-form input { flex: 1; min-width: 0; background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px; }
.nl-form input:focus { outline: none; border-color: var(--gold-d); box-shadow: 0 0 0 3px rgba(245,183,0,.2); background: var(--surface); }
.nl-form input::placeholder { color: var(--muted); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.chip { border: 1px solid var(--line); background: var(--surface2); color: var(--ink2); border-radius: 999px; padding: 3px 11px; font-size: 12px; transition: background .12s, border-color .12s; text-align: left; max-width: 100%; }
.chip:hover { background: var(--surface3); border-color: var(--line3); }
.chip.on { background: var(--gold-soft); color: var(--gold-ink); border-color: var(--gold); font-weight: 600; }
.chip-static { cursor: default; background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-ink); font-weight: 500; }
.chip-static:hover { background: var(--gold-soft); border-color: var(--gold-line); }
.filters { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line2); }
.filters.hidden { display: none; }
.grid6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.fcell { background: var(--surface2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: block; }
.fcell input, .fcell select { width: 100%; margin-top: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink); }
.quick { display: flex; gap: 4px; margin-top: 7px; }
.quick button { background: var(--surface); border: 1px solid var(--line); color: var(--ink2); border-radius: 999px; font-size: 11px; padding: 1px 8px; }
.quick button.on { background: var(--gold); border-color: var(--gold-d); color: var(--on-accent); font-weight: 700; }
.prio { margin-top: 12px; } .prio-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---------- Highlights ---------- */
.highlights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; }
.hl { --a: var(--gold); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--a); border-radius: var(--r); padding: 14px 16px 15px; box-shadow: var(--shadow); text-align: left; display: block; width: 100%; transition: transform .15s, box-shadow .15s; color: var(--ink); }
.hl:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -12px rgba(0,0,0,.28); }
.hl-overall { --a: var(--gold); background: linear-gradient(180deg, var(--gold-soft), var(--surface) 65%); }
.hl-budget { --a: var(--info); } .hl-value { --a: var(--good); } .hl-running_costs { --a: #14a3a8; }
.hl-badge { display: inline-block; font: 600 10px Oswald, sans-serif; letter-spacing: .1em; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--a) 20%, transparent); color: color-mix(in srgb, var(--a) 65%, var(--ink)); }
.hl h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 2px; font-weight: 600; }
.hl .name { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.hl .tag { font-size: 12px; color: var(--ink2); margin: 6px 0 10px; min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hl-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.hl-stats span { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface3); border: 1px solid var(--line); color: var(--ink2); }

/* ---------- Main ---------- */
.main { padding-top: 24px; padding-bottom: 40px; display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr); }
.list-head { margin-bottom: 10px; }
.count { font: 600 12px Inter, sans-serif; background: var(--surface3); border-radius: 999px; padding: 2px 10px; text-transform: none; vertical-align: middle; margin-left: 6px; color: var(--ink2); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; position: sticky; top: var(--topbar-h, 59px); z-index: 10; background: var(--bg); padding: 8px 0; margin-bottom: 4px; }
.toolbar input, .toolbar select, .inline select { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 11px; box-shadow: var(--shadow-sm); }
.toolbar input[type=search] { flex: 1; min-width: 220px; max-width: 440px; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--gold-d); box-shadow: 0 0 0 3px rgba(245,183,0,.2); }
.inline { font-size: 12.5px; color: var(--ink2); display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }

/* ---------- Table ---------- */
.tablebox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.tscroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 800px; }
th { text-align: left; background: var(--surface2); font: 600 10.5px Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; } th.sortable:hover { color: var(--ink); }
th.sortable.active { color: var(--ink); } th.sortable.active::after { content: " ▾"; } th.sortable.active.asc::after { content: " ▴"; }
td { padding: 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
tbody tr { transition: background .1s; } tbody tr:hover { background: var(--hover); } tbody tr:last-child td { border-bottom: 0; }
tr.rejected { opacity: .5; }
.c-score { width: 72px; text-align: center; }
.c-price { white-space: nowrap; min-width: 128px; }
.c-price .price { font: 700 20px/1.1 Oswald, sans-serif; letter-spacing: .01em; }
.c-price .ideal-line { font-size: 12px; margin: 3px 0 5px; color: var(--ink2); }
.c-price .ideal-line .ed { font-weight: 600; }
.c-mot { min-width: 150px; max-width: 200px; }
.ed { cursor: pointer; border-radius: 6px; padding: 1px 5px; display: inline-block; min-width: 24px; transition: background .1s; }
.ed:hover { background: var(--surface3); }
.c-mot .ed { padding-left: 0; }
.cell-input { border: 1px solid var(--gold-d); border-radius: 7px; padding: 4px 7px; font-size: 12.5px; width: 100%; min-width: 80px; box-shadow: 0 0 0 3px rgba(245,183,0,.2); outline: none; background: var(--surface); }
.vehicle { display: flex; gap: 11px; align-items: center; min-width: 230px; }
.vtext { min-width: 0; }
.thumb { width: 68px; height: 50px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); flex: none; background: var(--surface3); }
.thumb.ph, .ph { display: grid; place-items: center; background: linear-gradient(145deg, var(--ph-from), var(--ph-to)); color: var(--ph-ink); }
.thumb.ph svg { width: 46px; }
.vname { font-weight: 700; cursor: pointer; font-size: 14.5px; line-height: 1.3; } .vname:hover { color: var(--link); }
.vmeta { font-size: 12.5px; color: var(--ink2); margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.vmeta i { font-style: normal; color: var(--line3); }
.vsub { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.mnote { font-size: 11.5px; color: var(--ink2); margin-top: 4px; }
.mnote .ed { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-left: 0; }
.specs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.spec { font-size: 10.5px; padding: 1px 8px; border-radius: 999px; background: var(--surface3); border: 1px solid var(--line); color: var(--ink2); }
.spec.g { background: var(--good-bg); border-color: var(--good-line); color: var(--good-ink); } .spec.b { background: var(--info-bg); border-color: var(--info-line); color: var(--info-ink); }
.spec.reg { background: #ffd43b; border-color: #e0b100; color: #1c1b19; font-weight: 700; letter-spacing: .05em; font-family: ui-monospace, Consolas, monospace; border-radius: 5px; padding: 0 7px; }
.status-sel { background: var(--surface2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 500; max-width: 118px; }
.actions { white-space: nowrap; text-align: right; }
.empty { padding: 56px 16px; text-align: center; color: var(--muted); }
.empty b { color: var(--ink); font-size: 16px; }
.empty p { margin: 6px 0 16px; }
.empty-ico { font-size: 34px; margin-bottom: 8px; opacity: .85; }
.tfoot { padding: 10px 14px; background: var(--surface2); border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); text-align: center; }

/* Score ring */
.score { --c: #b8b3a8; --p: 0; position: relative; isolation: isolate; width: 54px; height: 54px; border-radius: 50%; border: 0; padding: 0; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--ring-track) 0); display: inline-grid; place-items: center; align-content: center; font: 700 16px/1 Oswald, sans-serif; cursor: pointer; transition: transform .12s; color: var(--ink); }
.score::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); z-index: -1; }
.score:hover { transform: scale(1.06); }
.score small { font: 600 8px/1.1 Inter, sans-serif; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 1px; }
.score-good { --c: #10b981; color: var(--good-ink); } .score-fair { --c: #f5a30b; color: var(--warn-ink); } .score-bad { --c: #f43f5e; color: var(--bad-ink); } .score-none { --c: #b8b3a8; color: var(--muted); }
.fit { display: block; margin: 5px auto 0; width: max-content; font-size: 10px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold-ink); white-space: nowrap; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.badge-green { background: var(--good-bg); color: var(--good-ink); border-color: var(--good-line); }
.badge-amber { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.badge-red { background: var(--bad-bg); color: var(--bad-ink); border-color: var(--bad-line); }
.badge-grey { background: var(--surface3); color: var(--ink2); border-color: var(--line); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.ccard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.ccard:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -14px rgba(0,0,0,.3); }
.ccard.rejected { opacity: .55; }
.cphoto { height: 140px; background: linear-gradient(145deg, var(--ph-from), var(--ph-to)) center/cover no-repeat; position: relative; display: grid; place-items: center; color: var(--ph-ink); }
.cphoto svg { width: 96px; }
.cphoto .score { position: absolute; top: 10px; right: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.cbody { padding: 14px; flex: 1; display: grid; gap: 7px; align-content: start; }
.cprice { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cprice b { font: 700 22px Oswald, sans-serif; }
.cfoot { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line2); background: var(--surface2); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; color: var(--ink2); }

/* ---------- Compare ---------- */
.compare { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.compare p { margin: 4px 0 0; }
.cmp-summary { margin-top: 14px; padding: 13px 15px; background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 12px; }
.rank { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; background: var(--surface); cursor: pointer; text-align: left; width: 100%; transition: border-color .12s, transform .12s; color: var(--ink); }
.rank:hover { border-color: var(--gold-d); transform: translateX(2px); }
.rank.top { border-color: var(--gold); background: linear-gradient(90deg, var(--gold-soft), var(--surface)); }
.rank-n { font: 700 20px Oswald, sans-serif; width: 28px; text-align: center; color: var(--muted); }
.rank .score { cursor: inherit; }

/* ---------- Modals ---------- */
.overlay { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow-y: auto; animation: fade .15s ease-out; }
.modal { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.modal.wide { max-width: 800px; } .modal.small { max-width: 460px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line2); }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 13px 20px; border-top: 1px solid var(--line2); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--surface2); border-radius: 0 0 18px 18px; }
.modal-f .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } } @keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.modal.zoom { max-width: min(1100px, 96vw); background: transparent; border: 0; box-shadow: none; }
.zoom-img { width: 100%; max-height: 90vh; object-fit: contain; border-radius: 12px; display: block; background: #000; }
.err-head { background: var(--bad-bg); border-bottom-color: var(--bad-line); border-radius: 18px 18px 0 0; }
.err-head h2 { display: flex; align-items: center; gap: 10px; color: var(--bad-ink); }
.err-ico { width: 26px; height: 26px; border-radius: 50%; background: var(--bad); color: #fff; display: inline-grid; place-items: center; font: 700 15px Inter, sans-serif; flex: none; }
.err-hint { margin: 0 0 12px; font-size: 14px; }
.modal details { font-size: 12.5px; } .modal summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.err-detail { display: block; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--line); border-radius: 9px; white-space: pre-wrap; word-break: break-word; font-size: 12px; max-height: 180px; overflow: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.fld { display: block; font-size: 12px; font-weight: 600; color: var(--ink2); }
.fld input, .fld select, .fld textarea { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-weight: 400; background: var(--surface2); color: var(--ink); transition: border-color .12s, box-shadow .12s, background .12s; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--gold-d); box-shadow: 0 0 0 3px rgba(245,183,0,.2); background: var(--surface); }
.fld .err { color: var(--bad-ink); font-weight: 500; font-size: 11.5px; }
.fld.invalid input, .fld.invalid select { border-color: var(--bad); }
.fld .hint { display: block; color: var(--warn-ink); font-weight: 500; font-size: 11.5px; } .fld .hint:empty { display: none; }
.fld.missing input, .fld.missing select { border-color: var(--gold); background: var(--gold-soft); }
.review-banner { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 12px; padding: 11px 14px; margin-bottom: 16px; font-size: 13px; }
.review-banner.warn { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-ink); }
.detail-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; cursor: zoom-in; border: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.dcell { background: var(--surface2); border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; }
.dcell span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.dcell b { font-size: 14px; }
.pc { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pc h4 { margin: 0 0 5px; font: 700 11px Inter, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.pc ul { margin: 0; padding-left: 18px; font-size: 13px; }
.pros h4 { color: var(--good-ink); } .cons h4 { color: var(--bad-ink); }
.note-box { background: var(--surface2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; margin-top: 10px; font-size: 13px; white-space: pre-wrap; }
.difftable { width: 100%; min-width: 0; font-size: 13px; margin-top: 4px; }
.difftable th { background: none; border-bottom: 1px solid var(--line); }
.difftable td { padding: 9px 8px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.radio-row { display: flex; gap: 16px; margin: 10px 0; font-size: 13px; flex-wrap: wrap; }
.photo-box { display: flex; gap: 16px; align-items: center; padding: 12px; margin-bottom: 14px; border: 1px dashed var(--line3); border-radius: 14px; background: var(--surface2); }
.photo-prev { width: 168px; height: 112px; flex: none; border-radius: 10px; overflow: hidden; background: var(--surface3); display: grid; place-items: center; color: var(--ph-ink); position: relative; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-prev svg { width: 80px; }
.photo-prev.loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.35) 50%, transparent 80%); animation: shimmer 1.1s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.photo-side p { margin: 2px 0 8px; font-size: 12px; }
.photo-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); min-height: 1em; }
.wrapbtns { flex-wrap: wrap; }
.wrapbtns .btn { padding: 6px 12px; font-size: 12.5px; }

/* ---------- AI progress popup ---------- */
.prog { padding: 22px 22px 8px; }
.prog-top { display: flex; gap: 14px; align-items: flex-start; }
.prog-top h2 { font-size: 17px; }
.prog-top p { margin: 2px 0 0; font-size: 12.5px; max-width: 300px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prog-ico { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg, #ffcb2e, #f0a800); color: var(--on-accent); display: grid; place-items: center; font-size: 20px; flex: none; animation: pulse 1.6s ease-in-out infinite; box-shadow: 0 6px 16px -6px rgba(240,168,0,.9); }
@keyframes pulse { 50% { transform: scale(1.08); } }
.prog-steps { list-style: none; margin: 18px 0 14px; padding: 0; display: grid; gap: 9px; }
.prog-steps li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); transition: color .2s; }
.prog-steps .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line3); flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; transition: all .2s; }
.prog-steps li.active { color: var(--ink); font-weight: 600; }
.prog-steps li.active .dot { border-color: var(--gold-d); border-top-color: transparent; animation: spin .8s linear infinite; }
.prog-steps li.done { color: var(--ink2); }
.prog-steps li.done .dot { background: var(--good); border-color: var(--good); }
.prog-steps li.done .dot::after { content: "✓"; }
.prog-bar { height: 6px; border-radius: 99px; background: var(--surface3); overflow: hidden; position: relative; }
.prog-bar i { position: absolute; inset: 0 auto 0 0; width: 35%; border-radius: 99px; background: linear-gradient(90deg, #ffcb2e, #f0a800); animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { left: -35%; } 100% { left: 100%; } }
.prog-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; margin: 8px 0 12px; font-variant-numeric: tabular-nums; }
.prog-meta [data-elapsed] { font-weight: 700; color: var(--ink2); }

/* ---------- Footer / toasts / misc ---------- */
.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 16px 0; font-size: 12px; color: var(--muted); }
.foot-in { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: #1c1b19; color: #fff; border: 1px solid #3a3733; border-radius: 12px; padding: 11px 15px; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center; justify-content: space-between; animation: rise .2s ease-out; }
.toast.ok { background: #0b6b49; border-color: #0f9d6b; }
.toast button { background: none; border: 0; color: var(--gold); font-weight: 700; text-decoration: underline; padding: 0; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -1px; margin-right: 7px; }

@media (max-width: 1100px) { .grid6 { grid-template-columns: repeat(3, 1fr); } .highlights { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .wrap { padding: 0 14px; } .grid6 { grid-template-columns: repeat(2, 1fr); } .highlights { grid-template-columns: 1fr; }
  .form-grid, .pc { grid-template-columns: 1fr; } .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-stats { display: none; } .nl-form { flex-direction: column; } .toolbar { position: static; }
  .assistant { padding: 16px; border-radius: 16px; }
  .photo-box { flex-direction: column; align-items: stretch; } .photo-prev { width: 100%; height: 160px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }
