/* 차르르(Charrr) v2 — Ops UI (admin console · dealer magic link · dealer portal)
   Light, calm, trustworthy. One mint accent shared with the brand; amber/red for flags. */

:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e4e8e6;
  --border-strong: #cfd6d3;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;

  --accent: #10b981;
  --accent-strong: #059669;
  --accent-ink: #065f46;
  --accent-soft: #ecfdf5;
  --accent-line: #a7f3d0;

  --amber: #d97706;
  --amber-soft: #fffbeb;
  --amber-line: #fcd34d;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --red-line: #fca5a5;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 1px 3px rgba(17, 24, 39, .06);
  --shadow-lg: 0 10px 30px rgba(17, 24, 39, .12);

  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕",
    "Noto Sans KR", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
img, video { max-width: 100%; display: block; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(16, 185, 129, .45); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, #19e3a1, var(--accent-strong));
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 900;
  box-shadow: 0 2px 6px rgba(16, 185, 129, .35);
}
.brand-sub { font-weight: 600; color: var(--muted); font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 650; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-dark { background: #111827; border-color: #111827; color: #fff; }
.btn-dark:hover { background: #1f2937; }
.btn-danger { color: var(--red); border-color: var(--red-line); background: #fff; }
.btn-danger:hover { background: var(--red-soft); }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-solid:hover { background: #b91c1c; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(17, 24, 39, .05); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 52px; padding: 12px 22px; font-size: 17px; border-radius: 14px; }
.btn-xl { min-height: 60px; padding: 14px 24px; font-size: 19px; border-radius: 16px; width: 100%; }
.btn-block { width: 100%; }
.btn .kbd { margin-left: 4px; }
.kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, .15); border-bottom-width: 2px;
  font: 600 11px/16px var(--mono); text-align: center; color: inherit; opacity: .8;
  background: rgba(255, 255, 255, .25);
}
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-strong); font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s, background .3s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 185, 129, .18);
}
.input.ai-filled, .select.ai-filled {
  background: var(--accent-soft); border-color: var(--accent-line);
}
.input-lg { min-height: 52px; font-size: 17px; }
.grid-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid-2 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: #fff;
}
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check.is-checked { border-color: var(--accent); background: var(--accent-soft); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 650; background: #fff; user-select: none;
}
.seg input:checked + label { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + label { outline: 3px solid rgba(16, 185, 129, .45); outline-offset: 2px; }

/* ---------- Surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.card-title { margin: 0 0 12px; font-size: 16px; font-weight: 750; display: flex; align-items: center; gap: 8px; }
.card-title .muted { font-weight: 500; font-size: 13px; }
.section-title { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.empty {
  text-align: center; color: var(--muted); padding: 36px 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface);
}
.empty .big { font-size: 28px; margin-bottom: 6px; }
.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px;
  font-size: 14px; border: 1px solid var(--border); background: var(--surface-2);
}
.notice-warn { background: var(--red-soft); border-color: var(--red-line); color: #991b1b; font-weight: 650; }
.notice-amber { background: var(--amber-soft); border-color: var(--amber-line); color: #92400e; }
.notice-ok { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.notice-info { background: var(--blue-soft); border-color: #bfdbfe; color: #1e40af; }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 20px; white-space: nowrap;
  background: #f3f4f6; color: var(--text-2); border: 1px solid transparent;
}
.chip-green { background: var(--accent-soft); color: var(--accent-ink); }
.chip-amber { background: var(--amber-soft); color: #92400e; }
.chip-red { background: var(--red-soft); color: #991b1b; }
.chip-blue { background: var(--blue-soft); color: #1e40af; }
.chip-violet { background: var(--violet-soft); color: #5b21b6; }
.chip-gray { background: #f3f4f6; color: var(--muted); }
.chip-dark { background: #111827; color: #fff; }
.chip-outline { background: #fff; border-color: var(--border-strong); }
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800;
}
.badge-zero { background: #d1d5db; color: #fff; }
.verified { color: var(--accent-strong); font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcfb; }
.table .thumb { width: 40px; height: 56px; border-radius: 6px; object-fit: cover; background: #e5e7eb; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Toast ---------- */
.toast-host {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 1000; width: min(92vw, 420px); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  background: #111827; color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 600; animation: toast-in .18s ease-out;
}
.toast.ok::before { content: "✓"; color: #6ee7b7; font-weight: 900; }
.toast.err { background: #7f1d1d; }
.toast.err::before { content: "!"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #7f1d1d; font-weight: 900; font-size: 12px; }
.toast .toast-action { margin-left: auto; background: none; border: 0; color: #6ee7b7; font-weight: 800; cursor: pointer; padding: 2px 4px; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: all .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(17, 24, 39, .45); z-index: 900;
  display: grid; place-items: center; padding: 16px; animation: fade-in .15s;
}
.modal {
  width: min(100%, 440px); max-height: calc(100vh - 32px); overflow: auto;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px;
}
.modal h2 { margin: 0 0 6px; font-size: 20px; }
.modal p { margin: 0 0 12px; color: var(--text-2); }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Progress / spinner ---------- */
.progress { height: 12px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #19e3a1, var(--accent-strong)); border-radius: 999px; transition: width .2s; }
.progress.indeterminate > span { width: 35% !important; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(16, 185, 129, .25); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
.spinner-lg { width: 42px; height: 42px; border-width: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 24px 4px; }

/* ---------- Bars (dashboard) ---------- */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 120px) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bar-row .bar-label { color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 22px; background: #f1f3f2; border-radius: 6px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 6px; min-width: 2px; transition: width .4s ease-out; }
.bar-fill.alt { background: #34d399; }
.bar-fill.blue { background: #60a5fa; }
.bar-fill.wa { background: #22c55e; }
.bar-fill.tg { background: #38bdf8; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 40px; text-align: right; }
.bar-value .muted { font-weight: 500; font-size: 12px; margin-left: 4px; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 12px; box-shadow: var(--shadow); }
.kpi .kpi-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi .kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 4px; }
.kpi.accent { border-color: var(--accent-line); background: linear-gradient(180deg, #fff, var(--accent-soft)); }
.kpi.warn .kpi-value { color: var(--amber); }
.kpi a.kpi-link { font-size: 12px; font-weight: 650; }

/* =================================================================
   ADMIN CONSOLE
   ================================================================= */
.admin-top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.admin-top-inner { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 16px; min-height: 58px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1 1 auto; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; min-height: 58px;
  border: 0; background: none; cursor: pointer; font-weight: 650; color: var(--muted);
  border-bottom: 3px solid transparent; white-space: nowrap; text-decoration: none;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab .tab-key { font: 600 10px var(--mono); color: var(--faint); }
.admin-top-right { display: flex; align-items: center; gap: 8px; flex: none; }
.admin-main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 80px; }
.admin-foot { max-width: 1240px; margin: 0 auto; padding: 0 16px 28px; color: var(--faint); font-size: 12px; }

.dash-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
.dash-grid .span-2 { grid-column: 1 / -1; }

.funnel .bar-row { grid-template-columns: minmax(110px, 150px) 1fr auto; }
.funnel .conv { font-size: 11px; color: var(--muted); font-weight: 600; display: block; text-align: right; }

/* Intake */
.intake-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
.intake-grid .card + .card { margin-top: 0; }
.platforms .seg label { padding: 8px 14px; font-size: 14px; }
.ai-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.ai-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 800; border: 1px solid var(--accent-line); }
.ai-notes { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.ai-notes li { font-size: 13px; color: #92400e; background: var(--amber-soft); border-radius: 8px; padding: 6px 10px; }
.dealer-pick { display: flex; flex-direction: column; gap: 10px; }
.dealer-selected { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
.dealer-list { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.dealer-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--border); background: #fff; cursor: pointer; }
.dealer-opt:last-child { border-bottom: 0; }
.dealer-opt:hover, .dealer-opt.active { background: var(--accent-soft); }
.dealer-opt .h { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.new-dealer { border: 1px dashed var(--accent-line); border-radius: 12px; padding: 12px; background: #fcfffd; }
.langs { display: flex; flex-wrap: wrap; gap: 6px; }

.result-card { border: 2px solid var(--accent); background: linear-gradient(180deg, #fff, #f6fefb); }
.link-box { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.link-box .link-text {
  flex: 1 1 240px; min-width: 0; font-family: var(--mono); font-size: 14px; padding: 12px; border-radius: 10px;
  background: #fff; border: 1px solid var(--accent-line); overflow-wrap: anywhere; user-select: all;
}
.msg-block { border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; }
.msg-block header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 8px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.msg-block pre { margin: 0; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; font-family: var(--font); font-size: 14px; line-height: 1.6; max-height: 260px; overflow: auto; }
.btn-copy { min-width: 96px; }
.btn-copy.copied { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

.intake-list { display: flex; flex-direction: column; gap: 8px; }
.intake-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.intake-row .cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.intake-row .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.plat { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; flex: none; }
.plat-instagram { background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af); }
.plat-tiktok { background: #111827; }
.plat-youtube { background: #ef4444; }
.plat-facebook { background: #1877f2; }
.plat-other { background: #6b7280; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chips button { border: 1px solid var(--border-strong); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 650; cursor: pointer; }
.filter-chips button[aria-pressed="true"] { background: #111827; color: #fff; border-color: #111827; }

/* Queue */
.queue { display: flex; flex-direction: column; gap: 14px; }
.qcard {
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 0; overflow: hidden; padding: 0;
  transition: opacity .25s, transform .25s, box-shadow .15s, border-color .15s;
}
.qcard:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 185, 129, .25), var(--shadow); }
.qcard.removing { opacity: 0; transform: translateX(30px); }
.qmedia { background: #0b0f0e; position: relative; display: flex; flex-direction: column; }
.qposter { position: relative; aspect-ratio: 9 / 16; max-height: 340px; width: 100%; overflow: hidden; cursor: pointer; border: 0; padding: 0; background: #0b0f0e; }
.qposter img, .qposter video { width: 100%; height: 100%; object-fit: cover; }
.qposter video { object-fit: contain; background: #000; }
.qposter .play {
  position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; font-size: 22px;
  border: 2px solid rgba(255, 255, 255, .8); pointer-events: none;
}
.qposter .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.qsnap { position: relative; border-top: 2px solid #0b0f0e; }
.qsnap img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.qsnap .snap-t { position: absolute; left: 6px; top: 6px; background: rgba(0, 0, 0, .7); color: #fff; font: 700 11px var(--mono); padding: 1px 6px; border-radius: 5px; }
.qbody { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.qhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.qhead .code { font-family: var(--mono); font-weight: 700; color: var(--text); }
.core4 { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1.2fr; gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.core4 > div { padding: 10px 14px; border-right: 1px solid var(--border); min-width: 0; }
.core4 > div:last-child { border-right: 0; }
.core4 .k { font-size: 12px; font-weight: 700; color: var(--muted); }
.core4 .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.core4 .v small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.core4 .v.flagged { color: var(--red); }
.core4 .input { min-height: 40px; font-size: 18px; font-weight: 700; padding: 6px 10px; }
.conflicts { display: flex; flex-direction: column; gap: 6px; }
.qmeta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.defects-mini { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.defects-mini li { list-style: none; display: flex; gap: 8px; align-items: baseline; }
.defects-mini ul { margin: 0; padding: 0; }
.tstamp { font: 700 12px var(--mono); color: var(--text-2); background: #f3f4f6; border-radius: 5px; padding: 0 5px; flex: none; }
.tstamp.red { background: var(--red-soft); color: #991b1b; }
.tstamp.amber { background: var(--amber-soft); color: #92400e; }
.qactions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: 4px; }
.qactions .btn-primary { min-width: 150px; }
.reject-box { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; padding: 10px; background: var(--red-soft); border-radius: 10px; border: 1px solid var(--red-line); }
.reject-box .input { flex: 1 1 220px; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.reasons button { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--red-line); background: #fff; color: #991b1b; cursor: pointer; font-weight: 650; }
.kbd-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* Token gate */
.gate { min-height: 70vh; display: grid; place-items: center; padding: 16px; }
.gate .card { width: min(100%, 400px); padding: 24px; }
.gate h1 { font-size: 20px; margin: 14px 0 4px; }

/* =================================================================
   DEALER (magic link + portal) — mobile first
   ================================================================= */
.m-body { background: #f3f6f5; }
.m-top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.m-top-inner { max-width: 560px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; }
.lang-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px; background: #fff; }
.lang-toggle button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-weight: 750; font-size: 13px; cursor: pointer; color: var(--muted); min-height: 32px; }
.lang-toggle button[aria-pressed="true"] { background: #111827; color: #fff; }
.m-main { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }
.m-foot { max-width: 560px; margin: 0 auto; padding: 8px 16px 32px; text-align: center; color: var(--faint); font-size: 12px; }
.m-foot a { color: var(--muted); font-weight: 600; }

.context-banner {
  border-radius: var(--radius-lg); padding: 18px; color: #053b2c;
  background: linear-gradient(135deg, #d1fae5, #ecfdf5 60%, #fff);
  border: 1px solid var(--accent-line); margin-bottom: 14px;
}
.context-banner .hello { font-size: 13px; font-weight: 700; color: var(--accent-ink); margin-bottom: 4px; }
.context-banner h1 { margin: 0; font-size: 19px; line-height: 1.45; font-weight: 800; letter-spacing: -.01em; }
.context-banner .quote { color: var(--accent-strong); }
.context-banner .src { margin-top: 8px; font-size: 12px; }

.steps { display: flex; gap: 6px; margin: 4px 0 14px; }
.steps .s { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 8px; white-space: nowrap; overflow: hidden; border-radius: 12px; background: #fff; border: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--muted); }
.steps .s .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #e5e7eb; color: #fff; font-size: 12px; flex: none; }
.steps .s.on { border-color: var(--accent); color: var(--text); }
.steps .s.on .n { background: var(--accent); }
.steps .s.done { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-line); }
.steps .s.done .n { background: var(--accent-strong); }

.m-card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.m-card h2 { margin: 0 0 12px; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.m-card h2 .n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 14px; flex: none; }
.m-card.collapsed { padding: 12px 16px; }
.m-card.collapsed h2 { margin: 0; font-size: 15px; }
.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.spec-list > div { padding: 12px 14px; border-bottom: 1px solid var(--border); min-width: 0; }
.spec-list > div.c1 { border-right: 1px solid var(--border); }
.spec-list > div:last-child { border-bottom: 0; }
.spec-list .k { font-size: 12px; font-weight: 700; color: var(--muted); }
.spec-list .v { font-size: 19px; font-weight: 800; letter-spacing: -.01em; margin-top: 2px; }
.spec-list .v.empty-v { color: var(--faint); font-weight: 600; font-size: 15px; }
.spec-list .full { grid-column: 1 / -1; }

.pick-video {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 150px; border: 2px dashed var(--accent-line); border-radius: 16px; background: #f8fffc;
  cursor: pointer; text-align: center; padding: 16px; color: var(--accent-ink); font-weight: 750; font-size: 17px;
}
.pick-video:hover { background: var(--accent-soft); }
.pick-video .ico { font-size: 34px; line-height: 1; }
.pick-video .sub { font-size: 13px; font-weight: 500; color: var(--muted); }
.pick-video input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.video-preview { border-radius: 14px; overflow: hidden; background: #000; position: relative; }
.video-preview video { width: 100%; max-height: 420px; object-fit: contain; background: #000; }
#done-video { max-height: 300px; }
.file-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.upload-state { text-align: center; padding: 10px 0; }
.upload-state .pct { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 6px 0; }
.ai-wait { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0 8px; text-align: center; }
.ai-wait h3 { margin: 0; font-size: 18px; }
.ai-wait ol { text-align: left; margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; }
.ai-wait ol li.on { color: var(--text); font-weight: 700; }
.ai-wait ol li.ok { color: var(--accent-ink); }

.done-hero { text-align: center; padding: 8px 0 4px; }
.done-hero .big { font-size: 46px; line-height: 1; }
.done-hero h2 { justify-content: center; margin: 10px 0 6px; font-size: 21px; }
.done-hero p { margin: 0; color: var(--text-2); }
.zero-fee { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: 13px; }
.preview-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.preview-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: #fff; font-size: 14px; }
.preview-list li.red { border-color: var(--red-line); background: var(--red-soft); }
.preview-list li.amber { border-color: var(--amber-line); background: var(--amber-soft); }
.preview-list .snap { width: 72px; aspect-ratio: 16 / 9; border-radius: 6px; object-fit: cover; flex: none; background: #e5e7eb; }
.highlights { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.highlights li { padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.highlights li::before { content: "✓ "; font-weight: 900; }
.sub-h { font-size: 14px; font-weight: 800; color: var(--text-2); margin: 16px 0 8px; }
.benefits { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.benefits li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-weight: 600; font-size: 14px; }
.benefits li .n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.error-screen { text-align: center; padding: 40px 18px; }
.error-screen .big { font-size: 48px; }
.error-screen h1 { font-size: 20px; margin: 12px 0 6px; }
.error-screen p { color: var(--muted); margin: 0; }

/* Dealer portal */
.d-tabs { display: flex; gap: 4px; background: #e8ecea; padding: 4px; border-radius: 14px; margin: 14px 0; }
.d-tabs button { flex: 1; border: 0; background: none; padding: 10px 6px; border-radius: 10px; font-weight: 750; font-size: 14px; color: var(--muted); cursor: pointer; min-height: 42px; }
.d-tabs button[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.totals .kpi { padding: 12px; text-align: center; }
.totals .kpi .kpi-value { font-size: 24px; }
.showroom-card { background: #111827; color: #fff; border-radius: var(--radius-lg); padding: 16px; margin-top: 12px; }
.showroom-card .url { font-family: var(--mono); font-size: 14px; background: rgba(255, 255, 255, .08); border-radius: 10px; padding: 10px 12px; margin: 8px 0 10px; overflow-wrap: anywhere; }
.showroom-card .tip { font-size: 12px; color: #a7f3d0; margin-top: 8px; }
.showroom-card a { color: #6ee7b7; }
.vlist { display: flex; flex-direction: column; gap: 10px; }
.vitem { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 14px; align-items: center; }
.vitem img { width: 64px; height: 90px; object-fit: cover; border-radius: 8px; background: #e5e7eb; }
.vitem .t { font-weight: 750; font-size: 15px; }
.vitem .s { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 2px; }
.vitem .a { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.vitem.sold img { opacity: .45; }
.login-wrap { max-width: 420px; margin: 24px auto 0; }
.demo-hint { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); border: 1px solid var(--amber-line); color: #92400e; font-size: 14px; }
.demo-hint b { font-family: var(--mono); font-size: 17px; letter-spacing: .12em; color: #78350f; }
.otp { letter-spacing: .4em; text-align: center; font-family: var(--mono); font-size: 22px; font-weight: 800; }

/* ---------- v1.1 additions ---------- */
/* Honest checkpoints — calm disclosure, not red warnings */
.trust-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.cp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cp-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); border-left: 4px solid #94a3b8; background: #fff; font-size: 14px; }
.cp-list li.major { border-left-color: #f59e0b; }
.cp-list .snap { width: 72px; aspect-ratio: 16 / 9; border-radius: 6px; object-fit: cover; flex: none; background: #e5e7eb; }
.cp-list .quote { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); font-style: italic; }
.cp-t { font: 700 12px var(--mono); color: #334155; background: #f1f5f9; border: 0; border-radius: 6px; padding: 1px 6px; cursor: pointer; }
.cp-t:hover { background: #e2e8f0; }
.cp-t[disabled] { cursor: default; }
.ops-memo { font-size: 13px; padding: 8px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid var(--border); color: var(--text-2); margin-bottom: 6px; }

/* Bookmark / sold-in-1-second card */
.bookmark-card { border: 2px dashed var(--accent-line); background: linear-gradient(180deg, #fff, #f6fefb); }
.bookmark-card .bm-title { font-size: 17px; font-weight: 800; line-height: 1.4; margin: 0 0 10px; }
.bookmark-card .bm-link { display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.bookmark-card .bm-link .url { flex: 1 1 auto; min-width: 0; font-family: var(--mono); font-size: 13px; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--accent-line); overflow-wrap: anywhere; }
.bm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bm-actions .btn { min-height: 56px; font-size: 16px; }
.bm-hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

/* Conflict severity in approval queue */
.notice-critical { background: #dc2626; border-color: #b91c1c; color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 2px 8px rgba(220, 38, 38, .25); }
.notice-soft { background: var(--amber-soft); border-color: var(--amber-line); color: #92400e; font-weight: 600; font-size: 13px; }
.qcard.has-critical { border-color: #fca5a5; box-shadow: inset 4px 0 0 #dc2626, var(--shadow); }
.qcard.has-critical:focus { box-shadow: inset 4px 0 0 #dc2626, 0 0 0 3px rgba(220, 38, 38, .25); }
.defects-mini .quote { color: var(--muted); font-style: italic; font-size: 12px; }

/* Outreach counter */
.outreach { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: #fff; font-size: 13px; margin-bottom: 14px; }
.outreach .big { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.outreach .cap { display: flex; flex-direction: column; gap: 3px; min-width: 150px; flex: 1 1 150px; }
.outreach .cap .progress { height: 8px; }
.outreach .cap.over .progress > span { background: #f59e0b; }
.outreach .rule { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.chip-regular { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .intake-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .admin-top-inner { flex-wrap: wrap; gap: 0 10px; padding: 0 12px; min-height: 0; }
  .admin-top-inner .brand { min-height: 48px; }
  .admin-top-right { margin-left: auto; }
  .tabs { order: 3; flex-basis: 100%; margin: 0 -12px; padding: 0 6px; }
  .tab { min-height: 44px; padding: 0 10px; }
  .tab .tab-key { display: none; }
  .admin-main { padding: 14px 12px 80px; }
  .dash-grid { grid-template-columns: 1fr; }
  .qcard { grid-template-columns: 1fr; }
  .qmedia { flex-direction: row; }
  .qposter { aspect-ratio: auto; height: 220px; max-height: none; flex: 1 1 50%; }
  .qsnap { flex: 1 1 50%; border-top: 0; border-left: 2px solid #0b0f0e; }
  .qsnap img { height: 220px; aspect-ratio: auto; }
  .core4 { grid-template-columns: 1fr 1fr; }
  .core4 > div:nth-child(2) { border-right: 0; }
  .core4 > div:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
  .core4 .v { font-size: 21px; }
  .qactions .btn { flex: 1 1 auto; }
  .kbd-legend { display: none; }
  .intake-row { grid-template-columns: auto minmax(0, 1fr); }
  .intake-row .actions { grid-column: 1 / -1; }
  .grid-2 { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
}
@media (max-width: 420px) {
  .context-banner h1 { font-size: 17px; }
  .spec-list .v { font-size: 17px; }
  .kpi .kpi-value { font-size: 24px; }
}
