/* ==========================================================================
   Dash360 Motors — dealer admin
   ========================================================================== */
:root {
  --ink: #0c0f14; --ink-2: #2a3039; --muted: #5f6672; --subtle: #8b919b;
  --line: #e4e6e9; --line-2: #cdd1d6; --bg: #f6f7f8; --panel: #fff;
  --accent: #c8f031; --accent-2: #b3dc18;
  --green: #1a8f4c; --red: #d4342a; --amber: #b7790a;
  --radius: 10px; --radius-sm: 6px;
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0 0 .6em; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1rem; font-weight: 700; }
img { max-width: 100%; display: block; }
.i { width: 17px; height: 17px; flex-shrink: 0; }
.i.filled { fill: currentColor; color: #e3a008; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.nowrap { white-space: nowrap; }
.hidden { display: none; }
.center { text-align: center; }
.center a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; }
.center a:hover { color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.logo-mark { width: 34px; height: 34px; color: var(--ink); flex-shrink: 0; }

/* Forms */
label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font: inherit; font-size: .92rem; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(12, 15, 20, .08); }
input:disabled { background: var(--bg); color: var(--muted); }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230c0f14' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer; }
label.check { display: flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 500; cursor: pointer; }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: inherit; font-weight: 650; font-size: .88rem; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink); }
.btn .i { width: 16px; height: 16px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #262b33; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: #fdf0ef; border-color: #f3c6c2; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #fff; border-color: var(--line); }
.btn-sm { height: 32px; padding: 0 10px; font-size: .8rem; }
.btn-sm .i { width: 15px; height: 15px; }
.btn-block { width: 100%; }

.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-size: .88rem; }
.alert a { font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.alert-success { background: #f1fbe0; border-color: #cfe9a0; color: #2f4a06; }
.alert-error { background: #fdf0ef; border-color: #f3c6c2; color: #8a1d16; }
.alert-warn { background: #fff7e6; border-color: #f1d79c; color: #6b4a00; }

/* Auth */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--ink) radial-gradient(1200px 600px at 80% -10%, #1f2630 0%, transparent 60%); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 32px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); }
.auth-card h1 { font-size: 1.6rem; font-stretch: 112%; font-weight: 800; margin: 0 0 18px; }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.auth-brand strong { font-stretch: 125%; font-weight: 400; font-size: 1.1rem; letter-spacing: .01em; }
.auth-brand strong b { font-weight: 850; }
.auth-brand small { display: block; color: var(--muted); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 650; }
.auth-card .btn-primary { height: 46px; margin-top: 4px; }

/* Shell */
.admin { display: flex; min-height: 100vh; }
.sidebar { width: 248px; background: var(--ink); color: #aeb4bd; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 20px; color: #fff; font-stretch: 125%; font-size: 1.05rem; letter-spacing: .01em; }
.brand b { font-weight: 850; }
.brand small { display: block; font-stretch: 100%; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: #7f8792; font-weight: 650; margin-top: 2px; }
.brand .logo-mark { color: #fff; }
.brand .logo-mark rect { fill: #1d222a; }
.sidebar nav { display: grid; gap: 18px; padding: 4px 12px 16px; flex: 1; align-content: start; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2c323b transparent; }
.nav-group { display: grid; gap: 2px; }
.nav-title { margin: 0 0 4px; padding: 0 12px; font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #737b87; }
.nav-external { padding-top: 14px; border-top: 1px solid #1f242c; }
.sidebar nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius-sm); color: #aeb4bd; font-weight: 550; transition: background .15s, color .15s; }
.sidebar nav a .i { width: 18px; height: 18px; }
.sidebar nav a:hover { background: #171b22; color: #fff; }
.sidebar nav a.active { background: #1a1f27; color: #fff; }
.sidebar nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sidebar nav a.active .i { color: var(--accent); }
.pill { margin-left: auto; background: var(--accent); color: var(--ink); font-style: normal; font-size: .7rem; font-weight: 750; padding: 1px 8px; border-radius: 999px; }
.logout { padding: 16px 20px 20px; border-top: 1px solid #1f242c; display: grid; gap: 10px; }
.logout small { color: #7f8792; }
.logout strong { color: #fff; font-weight: 600; }
.btn-sidebar { background: transparent; border-color: #2c323b; color: #d5d9de; }
.btn-sidebar:hover { border-color: #fff; color: #fff; }
.main { flex: 1; margin-left: 248px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; height: 72px; padding: 0 32px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar h1 { font-size: 1.3rem; font-stretch: 110%; font-weight: 750; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.menu-btn .i { width: 20px; height: 20px; }
.content { padding: 28px 32px 56px; max-width: 1400px; }

/* Panels */
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.box.pad, .pad { padding: 22px 24px; }
.box > h2, .box.pad > h2 { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.box-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 6px; }
.box-head h2 { margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.box-head a { font-size: .82rem; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.narrow { max-width: 540px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.filter-bar input, .filter-bar select { margin: 0; width: auto; height: 40px; }
.filter-bar input[type=search] { min-width: 260px; flex: 1; max-width: 380px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: border-color .15s; }
.stat span { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.stat strong { font-size: 1.7rem; font-stretch: 112%; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.15; }
.stat small { color: var(--muted); margin-top: 2px; }
a.stat:hover { border-color: var(--ink); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fafafb; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafafb; }
.table tr:last-child td { border-bottom: 0; }
.table tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--accent-2); }
.table a:hover { text-decoration: underline; text-underline-offset: 3px; }
.thumb-cell { width: 100px; }
.thumb-cell img { width: 88px; height: 60px; object-fit: cover; border-radius: 6px; background: var(--bg); }
.actions { white-space: nowrap; text-align: right; }
.actions .btn, .actions form { margin-left: 4px; }
form.inline { display: inline; }
.status-select { width: auto; margin: 0; height: 32px; padding: 0 30px 0 10px; font-weight: 650; font-size: .8rem; border-radius: 999px; background-position: right 10px center; }
.status-available { color: var(--green); background-color: #eefaf2; border-color: #c4e8d1; }
.status-reserved { color: var(--amber); background-color: #fff7e6; border-color: #f1d79c; }
.status-sold { color: var(--red); background-color: #fdf0ef; border-color: #f3c6c2; }
.status-draft { color: var(--muted); background-color: var(--bg); }
.tag { display: inline-block; font-size: .64rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px 2px; border-radius: 4px; background: var(--bg); color: var(--ink-2); margin-left: 6px; vertical-align: 2px; }
.tag-featured { background: var(--accent); color: var(--ink); }
.tag-new { background: var(--ink); color: #fff; }
.tag-marketing { background: #f3efff; color: #5b3fc4; }
.tag-test_drive { background: #eefaf2; color: var(--green); }
.tag-finance { background: #eef2fd; color: #2a4fb0; }
.pagination { display: flex; gap: 6px; justify-content: center; }
.pagination a { display: grid; place-items: center; min-width: 36px; height: 36px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); font-weight: 600; }
.pagination a.current { background: var(--ink); border-color: var(--ink); color: #fff; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; }
.tabs a { padding: 6px 12px; border-radius: 4px; color: var(--muted); font-weight: 600; font-size: .84rem; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { background: var(--ink); color: #fff; }

/* Leads */
.tab-count { margin-left: 4px; font-size: .74rem; font-weight: 600; opacity: .6; font-variant-numeric: tabular-nums; }
.lead-search { flex: 0 1 320px; }
.lead-search .search-field input { height: 40px; padding-left: 46px; }
.filter-note { margin: -8px 0 16px; font-size: .88rem; }
.filter-note a { margin-left: 8px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

/* Leads inbox: compact list + detail pane */
.leads-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: 20px; align-items: start; }
.leads-list { padding: 0; overflow: hidden; }
.leads-bar { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: #fafafb; }
.leads-bar [hidden] { display: none; }
.leads-range { margin-left: auto; }
.bulk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.check-all, .lead-check { display: grid; place-items: center; width: 20px; flex: none; cursor: pointer; }
.check-all input, .lead-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.lead-rows { list-style: none; margin: 0; padding: 0; }
.lead-row { display: flex; align-items: flex-start; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); position: relative; transition: background .12s; }
.lead-row:last-child { border-bottom: 0; }
.lead-row .lead-check { padding-top: 15px; }
.lead-row:hover { background: #fafafb; }
.lead-row.picked { background: #f6f8ec; }
.lead-row.open { background: #f4f5f6; box-shadow: inset 3px 0 0 var(--ink); }
.lead-row.unread { box-shadow: inset 3px 0 0 var(--accent-2); }
.lead-row.unread.open { box-shadow: inset 3px 0 0 var(--ink); }
.lead-link { flex: 1; min-width: 0; display: grid; gap: 3px; padding: 12px 0; color: inherit; }
.lead-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lead-line .tag { margin-left: 0; flex: none; }
.lead-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-row.unread .lead-name { font-weight: 750; }
.lead-row.unread .lead-name::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); margin-right: 7px; vertical-align: 2px; }
.lead-time { margin-left: auto; flex: none; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.lead-row.unread .lead-time { color: var(--ink); font-weight: 650; }
.lead-sub { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .82rem; color: var(--muted); }
.lead-car { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 600; }
.lead-snip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-car + .lead-snip::before { content: "· "; }
.lead-slot { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 1px 7px; border-radius: 4px; background: #eefaf2; color: #14532d; font-weight: 650; font-size: .76rem; }
.lead-slot svg { width: 13px; height: 13px; }
.lead-slot.is-past { background: var(--bg); color: var(--muted); }
.leads-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.leads-pager .btn svg { width: 14px; height: 14px; }

.lead-detail { position: sticky; top: 20px; }
.lead-empty { display: grid; justify-items: center; gap: 10px; padding: 48px 24px; text-align: center; color: var(--muted); }
.lead-empty svg { width: 32px; height: 32px; opacity: .5; }
.lead-empty p { margin: 0; max-width: 240px; font-size: .9rem; }
.lead-card { padding: 22px; display: grid; gap: 16px; max-height: calc(100vh - 40px); overflow-y: auto; }
.lead-back { display: none; align-items: center; gap: 4px; font-size: .86rem; font-weight: 650; }
.lead-back svg { width: 14px; height: 14px; }
.lead-card-head h2 { margin: 0 0 4px; font-size: 1.25rem; }
.lead-card-head .tag { margin: 0 6px 0 0; }
.lead-card-head p { margin: 0; }
.lead-contact { display: flex; gap: 8px; flex-wrap: wrap; }
.lead-contact .btn { flex: 1 1 auto; }
.lead-facts { display: grid; gap: 8px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.lead-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; }
.lead-facts dt { color: var(--muted); }
.lead-facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.lead-facts a:hover { text-decoration: underline; }
.lead-when { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); background: #eefaf2; color: #14532d; font-size: .9rem; }
.lead-when svg { width: 18px; height: 18px; flex: none; }
.lead-when.is-past { background: var(--bg); color: var(--ink-2); }
.lead-vehicle-card { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.lead-vehicle-card img { width: 96px; height: 68px; object-fit: cover; border-radius: 4px; flex: none; background: var(--bg); }
.lead-vehicle-card > div { display: grid; gap: 2px; min-width: 0; }
.lead-vehicle-card strong { font-size: .9rem; line-height: 1.3; }
.lead-vehicle-links { display: flex; gap: 10px; flex-wrap: wrap; font-size: .8rem; font-weight: 650; margin-top: 2px; }
.lead-vehicle-links a { text-decoration: underline; text-underline-offset: 3px; }
.lead-message h3 { margin: 0 0 6px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.lead-message p { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg); color: var(--ink-2); line-height: 1.55; overflow-wrap: anywhere; }
.lead-consent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .84rem; }
.lead-consent li { display: flex; align-items: center; gap: 6px; }
.lead-consent svg { width: 15px; height: 15px; color: var(--green); flex: none; }
.lead-card-foot { display: flex; gap: 8px; justify-content: flex-end; padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 1100px) {
  .leads-split { grid-template-columns: 1fr; }
  .leads-split.has-detail .leads-list, .leads-split:not(.has-detail) .lead-detail { display: none; }
  .lead-detail { position: static; }
  .lead-card { max-height: none; }
  .lead-back { display: inline-flex; }
  .lead-search { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .lead-sub { flex-wrap: wrap; }
  .lead-car { max-width: 100%; }
  .lead-car + .lead-snip::before { content: none; }
  .lead-snip { flex-basis: 100%; }
}

/* Vehicle edit */
.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.edit-side { align-self: stretch; } /* full height, so the sticky panel inside can follow the scroll */
.edit-side .sticky { position: sticky; top: 92px; display: grid; gap: 14px; }
.edit-main textarea { margin-bottom: 16px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.photo-grid figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.photo-grid figure.primary { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.photo-grid img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.photo-grid figcaption { display: flex; justify-content: space-between; align-items: center; padding: 8px; gap: 6px; }
.photo-grid .tag { margin: 0; }
.dropzone { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 30px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); cursor: pointer; font-weight: 500; color: var(--ink-2); transition: border-color .15s, background .15s; }
.dropzone > .i { width: 28px; height: 28px; color: var(--muted); margin-bottom: 6px; }
.dropzone:hover, .dropzone.drag { border-color: var(--ink); background: #fafafb; }
.dropzone input { display: none; }
.dropzone small { color: var(--muted); font-weight: 400; }
.file-preview { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.file-preview img { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; }

@media (max-width: 1280px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s cubic-bezier(.2, .7, .2, 1); }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { height: 64px; padding: 0 16px; }
  .content { padding: 20px 16px 48px; }
  .two-col, .edit-layout { grid-template-columns: minmax(0, 1fr); }
  .edit-side .sticky { position: static; }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-bar input[type=search] { min-width: 0; max-width: none; width: 100%; }
  .vehicles-table th:nth-child(4), .vehicles-table td:nth-child(4),
  .vehicles-table th:nth-child(6), .vehicles-table td:nth-child(6),
  .vehicles-table th:nth-child(7), .vehicles-table td:nth-child(7) { display: none; }
}

/* ==========================================================================
   Social posts
   ========================================================================== */
.toolbar-actions { display: flex; gap: 8px; }
.small { font-size: .8rem; }
.link-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0; font: inherit; font-size: .8rem; font-weight: 650; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn .i { width: 14px; height: 14px; }

.social-search { padding: 18px 20px; }
.social-search-form { display: flex; gap: 10px; }
.search-field { position: relative; flex: 1; margin: 0; }
.search-field .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--subtle); }
.search-field input { margin: 0; height: 46px; padding-left: 42px; font-size: .95rem; }
.social-search-form .btn { height: 46px; }
.pick-head { display: flex; justify-content: space-between; align-items: baseline; margin: 20px 0 10px; }
.pick-head h2 { margin: 0; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pick-head a { font-size: .82rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); transition: border-color .15s, background .15s; }
.pick:hover { border-color: var(--ink); }
.pick.is-current { border-color: var(--ink); background: #fafafb; box-shadow: inset 3px 0 0 var(--accent-2); }
.pick img { width: 72px; height: 50px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.pick-body { flex: 1; min-width: 0; display: grid; }
.pick-body strong { font-size: .9rem; }
.pick-body span { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-body .pick-meta { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pick .tag { font-style: normal; }
.pick > .i { color: var(--subtle); }
.pick-empty { margin: 16px 0 0; }

.vehicle-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; }
.vehicle-bar img { width: 84px; height: 56px; object-fit: cover; border-radius: 6px; }
.vehicle-bar > div:first-of-type { flex: 1; min-width: 0; display: grid; }
.vehicle-bar strong { font-size: 1.05rem; font-stretch: 108%; }
.vehicle-bar-actions { display: flex; gap: 6px; }

.status-pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.status-pill.status-draft { color: var(--muted); background: var(--bg); border-color: var(--line-2); }
.status-pill.status-scheduled { color: #2a4fb0; background: #eef2fd; border-color: #c9d5f5; }
.status-pill.status-published { color: var(--green); background: #eefaf2; border-color: #c4e8d1; }
.status-pill.status-failed, .status-pill.status-sold { color: var(--red); background: #fdf0ef; border-color: #f3c6c2; }
.status-pill.status-reserved { color: var(--amber); background: #fff7e6; border-color: #f1d79c; }

.composer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 20px; align-items: start; margin-bottom: 20px; }
.composer-edit { margin: 0; }
.ptabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.ptab { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: 54px; border: 0; background: none; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ptab:hover { color: var(--ink); }
.ptab.on { color: var(--ink); border-color: var(--ink); }
.ptab .i { width: 18px; height: 18px; }
.ptab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); }
.ptab-dot.off { background: var(--line-2); }
.ptab-dot.bad { background: var(--red); }
.ppanel { padding: 18px 22px 6px; }
.ppanel-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ppanel-saved { font-size: .78rem; color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: .88rem; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch span { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--line-2); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.field-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 8px; }
.field-label { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.field-label small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.style-seg { display: inline-grid; grid-auto-flow: column; gap: 3px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.style-seg button { border: 0; background: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.style-seg button:hover { color: var(--ink); }
.style-seg button.on { background: var(--ink); color: #fff; }
.ppanel textarea { margin: 0; font-size: .9rem; line-height: 1.55; min-height: 140px; }
.meter { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.meter-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: var(--ink); transition: width .15s; }
.meter.warn .meter-bar span { background: var(--amber); }
.meter.over .meter-bar span { background: var(--red); }
.meter-text { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter.over .meter-text { color: var(--red); font-weight: 650; }
.hints { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.hints li { font-size: .8rem; padding: 6px 10px; border-radius: 4px; }
.hint-error { background: #fdf0ef; color: #8a1d16; }
.hint-warn { background: #fff7e6; color: #6b4a00; }
.hint-info { background: var(--bg); color: var(--ink-2); }
.photo-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.ph { position: relative; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: var(--bg); cursor: pointer; aspect-ratio: 3 / 2; }
.ph img { width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: opacity .15s; }
.ph:hover img { opacity: .85; }
.ph.on { border-color: var(--ink); }
.ph.on img { opacity: 1; }
.ph b { position: absolute; top: 4px; left: 4px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--ink); font-size: .72rem; font-weight: 800; }
.ph:disabled { cursor: not-allowed; }
.ph:disabled img { opacity: .25; }
.seg-2 { margin-bottom: 4px; }
.composer-save { display: grid; gap: 12px; margin-top: 20px; padding: 18px 22px 20px; border-top: 1px solid var(--line); background: #fafafb; border-radius: 0 0 var(--radius) var(--radius); }
.schedule input { max-width: 260px; }
.composer-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.composer-buttons .btn:disabled { opacity: .45; cursor: not-allowed; }

.composer-preview { position: sticky; top: 92px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.previews { display: grid; gap: 18px; }
.pv-wrap[hidden] { display: none; }
.pv-label { display: none; align-items: center; gap: 6px; font-size: .78rem; font-weight: 650; color: var(--muted); margin-bottom: 6px; }
.pv-label .i { width: 15px; height: 15px; }
.previews.all .pv-label { display: flex; }
.pv-wrap.is-off .pv { opacity: .4; }
.pv-wrap.is-off .pv-label::after { content: "Not included"; margin-left: auto; font-weight: 600; color: var(--red); }

/* Shared preview chrome (deliberately neutral system fonts, like the apps) */
.pv { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #0f1419; font-size: 14px; line-height: 1.4; box-shadow: 0 18px 40px -28px rgba(12, 15, 20, .45); }
.pv .i { width: 22px; height: 22px; stroke-width: 1.6; }
.pv-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); flex-shrink: 0; overflow: hidden; }
.pv-avatar .logo-mark { width: 26px; height: 26px; color: var(--ink); }
.pv-dots { margin-left: auto; color: #536471; }
.pv-dots .i { width: 18px; height: 18px; }
.pv-link { color: #00376b; }
.pv-more { border: 0; background: none; padding: 0 0 0 2px; font: inherit; color: #737373; cursor: pointer; }
.pv-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--subtle); font-size: .85rem; background: var(--bg); }

/* Instagram */
.ig-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.ig-head .pv-avatar { width: 32px; height: 32px; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #d62976; }
.ig-head b { font-size: 13.5px; }
.ig-sub { display: none; }
.ig-media { position: relative; overflow: hidden; background: #000; }
.ig-media.r11 { aspect-ratio: 1 / 1; }
.ig-media.r45 { aspect-ratio: 4 / 5; }
.ig-track { display: flex; height: 100%; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.ig-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; }
.ig-count { position: absolute; top: 12px; right: 12px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 12px; }
.ig-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); color: #262626; font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.ig-arrow.prev { left: 10px; }
.ig-arrow.next { right: 10px; }
.ig-actions { position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 12px 4px; }
.ig-actions > .i:last-child { margin-left: auto; }
.ig-dots { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
.ig-dots i { width: 6px; height: 6px; border-radius: 50%; background: #c7c7c7; }
.ig-dots i.on { background: #0095f6; }
.ig-body { padding: 4px 12px 14px; font-size: 13.5px; }
.ig-likes { font-weight: 600; margin-bottom: 4px; }
.ig-cap b { font-weight: 600; }
.ig-cap .pv-link { color: #00376b; }
.ig-time { margin-top: 6px; font-size: 10.5px; letter-spacing: .03em; text-transform: uppercase; color: #737373; }

/* X */
.pv-x { padding: 12px 14px 6px; }
.x-post { display: flex; gap: 10px; }
.x-post .pv-avatar { width: 40px; height: 40px; }
.x-main { flex: 1; min-width: 0; }
.x-head { display: flex; align-items: center; gap: 4px; font-size: 15px; white-space: nowrap; }
.x-head span:not(.pv-dots) { color: #536471; overflow: hidden; text-overflow: ellipsis; }
.x-text { font-size: 15px; line-height: 1.35; margin-top: 2px; overflow-wrap: anywhere; }
.pv-x .pv-link { color: #1d9bf0; }
.x-media, .fb-media { display: grid; gap: 2px; margin-top: 12px; overflow: hidden; }
.x-media { border-radius: 16px; border: 1px solid #cfd9de; aspect-ratio: 16 / 9; }
.x-media span, .fb-media span { position: relative; overflow: hidden; min-height: 0; }
.x-media img, .fb-media img { width: 100%; height: 100%; object-fit: cover; }
.x-media.n2, .x-media.n4 { grid-template-columns: 1fr 1fr; }
.x-media.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.x-media.n3 span:first-child { grid-row: 1 / 3; }
.x-media.n4 { grid-template-rows: 1fr 1fr; }
.x-card { margin-top: 12px; border: 1px solid #cfd9de; border-radius: 16px; overflow: hidden; }
.x-card img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; }
.x-card div { display: grid; padding: 8px 12px 10px; font-size: 13px; color: #536471; }
.x-card b { color: #0f1419; font-weight: 400; font-size: 15px; }
.x-actions { display: flex; justify-content: space-between; margin: 10px 0 4px; color: #536471; }
.x-actions span { display: flex; gap: 12px; }
.x-actions .i { width: 18px; height: 18px; }

/* Facebook */
.fb-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.fb-head .pv-avatar { width: 40px; height: 40px; }
.fb-head b { display: block; font-size: 15px; }
.fb-head span:not(.pv-dots) { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #65676b; }
.fb-head span .i { width: 12px; height: 12px; }
.fb-text { padding: 0 14px 12px; font-size: 15px; line-height: 1.34; overflow-wrap: anywhere; }
.pv-facebook .pv-link { color: #385898; }
.pv-facebook .pv-more { color: #65676b; font-weight: 600; }
.fb-media { margin-top: 0; aspect-ratio: 1 / 1; }
.fb-media.n1 { aspect-ratio: 4 / 3; }
.fb-media.n2 { grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1; }
.fb-media.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 2fr 1fr; }
.fb-media.n3 span:first-child { grid-column: 1 / 3; }
.fb-media.n4 { grid-template-columns: repeat(3, 1fr); grid-template-rows: 2fr 1fr; }
.fb-media.n4 span:first-child { grid-column: 1 / 4; }
.fb-media.n5 { grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr; }
.fb-media.n5 span:nth-child(-n+2) { grid-column: span 3; }
.fb-media.n5 span:nth-child(n+3) { grid-column: span 2; }
.fb-media em { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; font-style: normal; font-size: 26px; font-weight: 600; }
.fb-card { background: #f0f2f5; }
.fb-card img { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; }
.fb-card div { display: grid; padding: 10px 14px; }
.fb-card span { font-size: 12px; text-transform: uppercase; color: #65676b; }
.fb-card b { font-size: 16px; }
.fb-stats { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 13px; color: #65676b; }
.fb-react i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #1877f2; color: #fff; }
.fb-react .i { width: 11px; height: 11px; stroke-width: 2.2; }
.fb-actions { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 12px; border-top: 1px solid #ced0d4; padding: 4px 0; }
.fb-actions span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px; font-size: 14px; font-weight: 600; color: #65676b; }
.fb-actions .i { width: 18px; height: 18px; }

/* Queue */
.plat { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.plat .i { width: 16px; height: 16px; }
.queue-caption { max-width: 420px; }
.queue-caption small { display: block; }
.queue-error { display: block; color: var(--red); font-size: .74rem; margin-top: 4px; }

@media (max-width: 1200px) {
  .composer-grid { grid-template-columns: minmax(0, 1fr); }
  .composer-preview { position: static; max-width: 460px; }
}
@media (max-width: 600px) {
  .social-search-form { flex-direction: column; }
  .vehicle-bar { flex-wrap: wrap; }
  .vehicle-bar-actions { width: 100%; }
  .ppanel { padding: 16px 16px 4px; }
  .composer-save { padding: 16px; }
  .style-seg { grid-auto-flow: row; width: 100%; }
  .ptab span { display: none; }
}

/* ==========================================================================
   AutoTrader
   ========================================================================== */
.tag-at { background: #eef2fd; color: #2a4fb0; }
.danger { color: var(--red); }
.warn-text { color: var(--amber); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.at-hero { padding: 22px 24px 0; }
.at-hero-main { display: flex; align-items: flex-start; gap: 16px; }
.at-hero-main h2 { margin: 2px 0 4px; font-size: 1.15rem; font-stretch: 110%; text-transform: none; letter-spacing: -.01em; color: var(--ink); }
.at-hero-main p { max-width: 70ch; margin: 0; font-size: .88rem; }
.at-hero-main .status-pill { margin-left: auto; }
.at-logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--ink); color: var(--accent); flex-shrink: 0; }
.at-logo .i { width: 22px; height: 22px; }
.at-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: center; margin: 20px -24px 0; border-top: 1px solid var(--line); }
.at-stats > div { padding: 16px 24px; border-right: 1px solid var(--line); }
.at-stats span { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.at-stats strong { font-size: 1.5rem; font-stretch: 112%; font-weight: 800; font-variant-numeric: tabular-nums; }
.at-stats .at-when { font-size: 1.05rem; }
.at-sync { padding: 0 24px; }
.at-sync .btn { height: 44px; }
.at-cols .box { margin-bottom: 0; }
.at-cols { margin-bottom: 20px; }
.at-advanced summary { cursor: pointer; font-size: .82rem; font-weight: 650; color: var(--muted); }
.at-advanced[open] summary { margin-bottom: 8px; }
.at-disconnect { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.form .small .i { width: 14px; height: 14px; vertical-align: -2px; }
.at-steps { margin: 0 0 8px; padding-left: 18px; display: grid; gap: 8px; font-size: .88rem; color: var(--ink-2); }
.at-sub { margin-top: 22px !important; }
.at-code { margin: 8px 0 0; padding: 12px 14px; background: var(--ink); color: #d5d9de; border-radius: var(--radius-sm); font-size: .78rem; white-space: pre-wrap; word-break: break-all; }
.at-meta { margin: 0; display: grid; }
.at-meta div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.at-meta dt { color: var(--muted); }
.at-meta dd { margin: 0; text-align: right; }
.at-map input { margin: 0; height: 36px; font-size: .84rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; min-width: 220px; }
.at-map input::placeholder { color: var(--subtle); }
.at-map tr.is-missing td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.at-sample { font-size: .84rem; max-width: 320px; overflow-wrap: anywhere; }
.at-sample code, .at-explorer code { font-size: .8rem; }
.at-map-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line); }
.at-map-foot p { margin: 0; }
.at-explorer { max-height: 420px; overflow-y: auto; }
.at-raw { padding: 0 20px 18px; }
.at-raw summary { cursor: pointer; font-weight: 650; font-size: .86rem; padding: 14px 0 8px; }
.at-raw pre { max-height: 420px; overflow: auto; margin: 0; padding: 14px; background: var(--ink); color: #d5d9de; border-radius: var(--radius-sm); font-size: .78rem; }
.at-log small { display: block; }
.at-note { font-size: .8rem; color: var(--muted); max-width: 360px; }
.alert-warn { background: #fff7e6; border-color: #f1d79c; color: #6b4a00; }
button.is-busy { opacity: .7; cursor: progress; }
@media (max-width: 1100px) {
  .at-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .at-stats > div { border-bottom: 1px solid var(--line); }
  .at-sync { grid-column: 1 / -1; padding: 16px 24px; }
}
@media (max-width: 600px) {
  .at-hero-main { flex-wrap: wrap; }
  .at-hero-main .status-pill { margin-left: 0; }
  .at-map-foot { flex-direction: column; align-items: stretch; }
}

/* AutoTrader sync progress */
.at-progress { display: grid; gap: 8px; margin: 0 -24px; border-radius: 0 0 var(--radius) var(--radius); padding: 16px 24px 20px; border-top: 1px solid var(--line); background: var(--bg, #f6f7f8); }
.at-progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.at-progress-head span { font-variant-numeric: tabular-nums; color: var(--muted); }
.at-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.at-bar i { display: block; height: 100%; background: var(--ink); border-radius: inherit; transition: width .4s ease; }
.pick-pages { margin-top: 16px; flex-wrap: wrap; align-items: center; }
.pick-pages .i { width: 16px; height: 16px; }
.pick-pages .gap { color: var(--muted); padding: 0 2px; }

/* Website settings ------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ok-text { color: var(--green); font-weight: 600; }
.error-list { margin: 6px 0 0; padding-left: 18px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.settings-main { display: grid; gap: 20px; min-width: 0; }
/* The aside stretches to the full height of the form so its inner panel can stay pinned while scrolling. */
.settings-side { align-self: stretch; }
.settings-side-inner { position: sticky; top: 96px; display: grid; gap: 14px; max-height: calc(100vh - 116px); overflow-y: auto; scrollbar-width: none; }

.set-section { margin: 0; scroll-margin-top: 96px; }
.set-head { display: flex; gap: 14px; align-items: flex-start; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.set-head h2 { margin: 0; font-size: 1.02rem; font-weight: 750; font-stretch: 105%; }
.set-head p { margin: 3px 0 0; font-size: .85rem; color: var(--muted); max-width: 62ch; }
.set-icon { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: var(--ink); color: var(--accent); }
.set-icon .i { width: 19px; height: 19px; }
.set-body { display: grid; gap: 16px; padding: 22px 24px 24px; }
.set-hint { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); font-size: .82rem; color: var(--ink-2); }
.set-hint .i { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: var(--muted); }
.set-hint a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-grid label small, .set-body label small { font-weight: 500; }
.pair-inline { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.set-body .alert { margin: 0; }

/* Side panel */
.settings-side .box { margin: 0; }
.side-save { display: grid; gap: 10px; padding: 16px; }
.save-state { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.save-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px #e3f5ea; }
.save-state.is-dirty { color: var(--amber); }
.save-state.is-dirty .dot { background: var(--amber); box-shadow: 0 0 0 3px #fff2d6; }
.side-nav { display: grid; padding: 8px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: .86rem; font-weight: 550; color: var(--ink-2); }
.side-nav a .i { width: 16px; height: 16px; color: var(--muted); }
.side-nav a:hover { background: var(--bg); }
.side-nav a.on { background: var(--bg); color: var(--ink); font-weight: 650; box-shadow: inset 2px 0 0 var(--ink); }
.side-nav a.on .i { color: var(--ink); }
.side-mail { display: grid; gap: 10px; padding: 16px; }
.side-mail h2 { margin: 0; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.side-mail p { margin: 0; }
.mail-status { padding: 8px 10px; border-radius: var(--radius-sm); }
.mail-status .i { width: 14px; height: 14px; vertical-align: -2px; }
.mail-status.is-ok { background: #eefaf2; color: var(--green); }
.mail-status.is-bad { background: #fdf0ef; color: #8a1d16; }

/* Logos */
.logo-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.logo-field { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.logo-meta { display: grid; gap: 6px; align-content: start; padding: 14px 16px 16px; }
.logo-meta strong { font-size: .88rem; }
.logo-meta p { margin: 0; }
.logo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.file-btn { position: relative; display: inline-flex; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; height: 100%; }
.file-btn:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.logo-preview { display: flex; align-items: center; justify-content: center; gap: 10px; height: 110px; padding: 16px 20px; background: var(--bg) repeating-conic-gradient(#eceef1 0% 25%, transparent 0% 50%) 0 0 / 16px 16px; color: var(--ink); font-stretch: 125%; }
.logo-preview.is-dark { background: var(--ink); color: #fff; }
.logo-preview .logo-mark { width: 34px; height: 34px; flex-shrink: 0; }
.logo-preview.is-dark .logo-mark rect { fill: #1d222a; }
.logo-preview .logo-word { font-weight: 850; font-size: 1.15rem; }
.logo-preview .logo-word b { font-weight: 350; }
.logo-preview .logo-sub { font-size: .6rem; font-weight: 650; letter-spacing: .24em; text-transform: uppercase; opacity: .6; font-stretch: 100%; }
.logo-preview .logo-img { max-height: 56px; max-width: 100%; width: auto; object-fit: contain; }
.logo-preview .logo-img-tile { background: #fff; padding: 6px 10px; border-radius: 6px; box-sizing: content-box; }

/* Colours & theme */
.colours-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 28px; align-items: start; }
.colour-controls { display: grid; gap: 12px; align-content: start; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; background: var(--sw); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(12, 15, 20, .12); transition: transform .15s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.swatch:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.custom-colour { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.colour-well { position: relative; width: 42px; height: 42px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); overflow: hidden; cursor: pointer;
  background: conic-gradient(from 90deg, #ff4d4d, #ffd23f, #c8f031, #22c55e, #14b8c4, #2f6bff, #8b5cf6, #ff4d8d, #ff4d4d); }
.colour-well input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.hex-field input { width: 120px; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: lowercase; }
.colour-note { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg); color: var(--ink-2); }
.colour-note.is-warn { background: #fff7e6; color: #6b4a00; }
.theme-label { margin-top: 8px; }
.theme-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-card { position: relative; display: grid; gap: 4px; align-content: start; padding: 10px 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; font-weight: 500; transition: border-color .15s, box-shadow .15s; }
.theme-card input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.theme-card strong { font-size: .88rem; color: var(--ink); }
.theme-card small { font-size: .74rem; line-height: 1.4; }
.theme-card:hover { border-color: var(--ink-2); }
.theme-card:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.theme-card:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.theme-thumb { display: grid; grid-template-rows: 8px 1fr 10px; gap: 4px; height: 64px; padding: 6px; margin-bottom: 6px; border-radius: 6px; background: #fff; border: 1px solid var(--line); }
.theme-thumb i { display: block; border-radius: 2px; background: #e4e6e9; }
.theme-thumb i:nth-child(2) { background: #0c0f14; }
.theme-thumb i:nth-child(3) { width: 60%; background: var(--accent); }
.theme-thumb-dark { background: #0e1116; border-color: #0e1116; }
.theme-thumb-dark i:first-child { background: #252b34; }
.theme-thumb-dark i:nth-child(2) { background: #1b2028; }
.theme-thumb-auto { background: linear-gradient(135deg, #fff 50%, #0e1116 50%); }
.theme-thumb-auto i:first-child { background: linear-gradient(90deg, #e4e6e9 50%, #252b34 50%); }

/* Mini website preview */
.site-preview { --pv-bg: #fff; --pv-surface: #fff; --pv-text: #0c0f14; --pv-muted: #c9cdd3; --pv-line: #e4e6e9; --pv-night: #0c0f14;
  margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--pv-bg); color: var(--pv-text); font-size: 11px; box-shadow: 0 18px 40px -28px rgba(12, 15, 20, .45); }
.site-preview[data-theme="dark"] { --pv-bg: #0e1116; --pv-surface: #13171d; --pv-text: #eef1f4; --pv-muted: #343c48; --pv-line: #252b34; --pv-night: #07090c; }
.site-preview > * { transition: background .25s, color .25s; }
.pv-top { display: flex; justify-content: space-between; padding: 5px 10px; background: var(--pv-night); }
.pv-top span { width: 30%; height: 4px; border-radius: 2px; background: #3a404a; }
.pv-top span:last-child { width: 18%; }
.pv-header { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--pv-line); }
.pv-logo { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pv-logo i { width: 16px; height: 16px; border-radius: 4px; background: var(--pv-night); box-shadow: inset 0 0 0 4px var(--pv-night), inset 0 0 0 6px var(--pv-accent-dark); }
.pv-logo b { font-weight: 800; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.pv-nav { display: flex; gap: 6px; flex: 1; }
.pv-nav i { width: 22px; height: 4px; border-radius: 2px; background: var(--pv-muted); }
.pv-call { padding: 4px 8px; border-radius: 4px; background: var(--pv-text); color: var(--pv-bg); font-weight: 700; font-size: 9px; }
.pv-hero { display: grid; gap: 6px; justify-items: start; padding: 18px 12px; background: var(--pv-night) linear-gradient(120deg, rgba(255, 255, 255, .06), transparent 60%); color: #fff; }
.pv-hero small { font-size: 8px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--pv-accent-dark); }
.pv-hero strong { font-size: 16px; font-weight: 850; font-stretch: 115%; line-height: 1.1; }
.pv-btn { margin-top: 4px; padding: 6px 10px; border-radius: 4px; background: var(--pv-accent); color: var(--pv-on-accent); font-weight: 750; font-size: 9px; }
.pv-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 10px; }
.pv-card { display: grid; gap: 4px; padding-bottom: 6px; border: 1px solid var(--pv-line); border-radius: 5px; overflow: hidden; background: var(--pv-surface); }
.pv-card i { height: 4px; margin: 0 6px; border-radius: 2px; background: var(--pv-muted); }
.pv-card i.short { width: 50%; }
.pv-card b { margin: 0 6px; font-size: 9px; font-weight: 800; }
.pv-photo { position: relative; aspect-ratio: 3 / 2; background: linear-gradient(160deg, #9aa3ad, #59616c); }
.pv-photo em { position: absolute; top: 4px; left: 4px; padding: 1px 4px; border-radius: 2px; background: var(--pv-accent); color: var(--pv-on-accent); font-style: normal; font-size: 7px; font-weight: 800; text-transform: uppercase; }
.site-preview figcaption { padding: 8px 10px; border-top: 1px solid var(--pv-line); background: var(--surface, #fff); color: var(--muted); }

/* Working hours */
.hours-table { display: grid; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.hours-row { display: grid; grid-template-columns: 120px 120px minmax(0, 140px) auto minmax(0, 140px); align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); transition: background .15s; }
.hours-row:last-child { border-bottom: 0; }
.hours-row.is-closed { background: var(--bg); }
.hours-row input[type=time] { margin: 0; height: 38px; }
.hours-day { font-weight: 650; }
.hours-row .switch em { font-style: normal; font-weight: 550; color: var(--muted); min-width: 48px; }
.hours-row.is-closed input[type=time], .hours-row.is-closed > .muted { visibility: hidden; }
.set-body > .link-btn { justify-self: start; }

@media (max-width: 1200px) {
  .colours-layout { grid-template-columns: minmax(0, 1fr); }
  .site-preview { position: static; max-width: 420px; }
}
@media (max-width: 1100px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-side { order: -1; }
  .settings-side-inner { position: static; max-height: none; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .side-nav { display: none; }
}
@media (max-width: 900px) {
  .settings-grid, .logo-fields, .theme-cards { grid-template-columns: minmax(0, 1fr); }
  .hours-row { grid-template-columns: 1fr auto; row-gap: 6px; }
  .hours-row > .muted { display: none; }
  .set-head, .set-body { padding-left: 16px; padding-right: 16px; }
}

/* Legal pages editor */
.legal-editor { height: auto; min-height: 420px; padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; line-height: 1.65; resize: vertical; }
.legal-editor-foot { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.side-help h2 { margin: 0 0 12px; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.format-help { display: grid; gap: 6px; margin: 0 0 14px; }
.format-help div { display: flex; justify-content: space-between; gap: 10px; font-size: .82rem; }
.format-help dd { margin: 0; color: var(--muted); }
.side-help code, .format-help code { font-size: .78rem; padding: 1px 5px; border-radius: 4px; background: var(--bg); }
.side-help .placeholders { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 12px; }
.side-help { padding: 16px; }

/* Site text editor */
.text-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.text-fields > label { display: grid; gap: 6px; align-content: start; }
.text-fields > label.is-wide { grid-column: 1 / -1; }
.text-fields input, .text-fields textarea { margin: 0; }
.text-fields textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.text-label { font-weight: 600; font-size: .86rem; }
.text-label small { font-weight: 400; }
.tag-edited { background: #fff6dc; color: #8a5a00; font-style: normal; margin-left: 4px; }
.text-fields .link-btn { justify-self: start; font-size: .8rem; }
@media (max-width: 900px) { .text-fields { grid-template-columns: 1fr; } }
.set-head p a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Import from Excel */
.eyebrow-admin { margin: 0 0 6px; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.import-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.import-upload { display: grid; gap: 18px; }
.box.import-upload > h2, .import-check h2, .box.import-progress > h2, .import-result h2 { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: normal; text-transform: none; color: var(--ink); }
.import-upload > p { margin: -10px 0 0; }
.import-drop { padding: 40px 24px; }
.import-drop.has-file { border-style: solid; border-color: var(--ink); background: #fafafb; }
.import-existing { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.import-existing legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: .9rem; }
.check-line { display: flex; align-items: center; gap: 10px; font-size: .9rem; cursor: pointer; }
.check-line input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--ink); }
.import-upload > .btn { justify-self: start; }
.import-side { display: grid; gap: 16px; }
.import-side h3 { margin: 0 0 6px; font-size: .95rem; }
.import-side p { margin: 0 0 12px; }
.import-help ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .84rem; color: var(--ink-2); }
.import-check { display: grid; gap: 18px; margin-bottom: 16px; }
.import-check-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.import-check-head p { margin: 4px 0 0; }
.import-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.import-stats div { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); display: grid; gap: 2px; }
.import-stats strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.import-stats span { font-size: .8rem; color: var(--muted); }
.import-stats .is-bad { border-color: #f3c6c2; background: #fdf0ef; }
.import-stats .is-bad strong { color: #b42318; }
.import-columns summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.import-columns p { margin: 10px 0 0; }
.chip { display: inline-block; margin: 0 6px 6px 0; padding: 3px 9px; border-radius: 999px; background: var(--bg); font-size: .78rem; font-weight: 600; }
.is-warn { color: #8a5a00; }
.import-table-box { padding: 0; overflow: hidden; margin-bottom: 16px; }
.import-table td { vertical-align: top; font-size: .88rem; }
.import-table tr.is-error td { background: #fffafa; }
.import-table tr.is-skip td { color: var(--muted); }
.tag-new-car { background: #eefaf2; color: var(--green); margin-left: 0; }
.tag-update { background: #eef2fd; color: #2a4fb0; margin-left: 0; }
.tag-problem { background: #fdf0ef; color: #b42318; margin-left: 0; }
.import-table .tag { margin-left: 0; }
.import-notes { min-width: 260px; }
.import-notes div { line-height: 1.45; }
.import-notes div + div { margin-top: 4px; }
.note-error { color: #b42318; }
.note-warn { color: #8a5a00; }
.import-confirm { display: grid; gap: 14px; }
.import-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.import-progress { display: grid; gap: 16px; overflow: hidden; }
.import-progress .at-progress { margin: 0 -24px -24px; }
.import-result { display: grid; gap: 18px; }
.import-result-head { display: flex; gap: 14px; align-items: center; }
.import-result-head p { margin: 2px 0 0; }
.import-result h3 { margin: 0; font-size: .95rem; }
.import-problems { margin: -8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: .88rem; color: var(--ink-2); }
@media (max-width: 1000px) { .import-layout { grid-template-columns: 1fr; } }
.import-table tr.is-same td { color: var(--muted); }
.note-change { color: var(--ink-2); }

/* Admin users: edit panel */
.user-edit-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.user-edit-head h2 { margin: 0; font-size: 1.05rem; }
.user-locked { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.table tr.is-editing td { background: #f4f5f6; }

/* AutoTrader preview */
.atp-form-box { margin-bottom: 20px; }
.atp-form { display: flex; gap: 16px; align-items: center; }
.atp-form .search-field input { height: 46px; padding-left: 46px; margin: 0; }
.atp-form .btn { height: 46px; }
.atp-form-box p { margin: 10px 0 0; }
.atp-dealer { display: flex; align-items: center; gap: 18px; padding: 18px 22px; margin-bottom: 20px; }
.atp-logo { display: grid; place-items: center; width: 120px; height: 60px; border-radius: var(--radius-sm); overflow: hidden; flex: none; border: 1px solid var(--line); }
.atp-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.atp-dealer-info { flex: 1; min-width: 0; }
.atp-dealer-info h2 { margin: 0 0 4px; font-size: 1.2rem; }
.atp-dealer-info p { margin: 0; font-size: .88rem; }
.atp-rating { display: inline-flex; align-items: center; gap: 3px; color: var(--ink); font-weight: 650; }
.atp-rating svg { width: 14px; height: 14px; color: #e3a008; fill: currentColor; }
.atp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
@media (min-width: 1300px) { .atp-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.atp-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; transition: box-shadow .18s, transform .18s; }
.atp-card:hover { box-shadow: 0 10px 30px rgba(12, 15, 20, .1); transform: translateY(-2px); }
.atp-card.is-social { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.atp-card-link { display: flex; flex-direction: column; flex: 1; color: inherit; }
.atp-card-actions { padding: 0 16px 16px; }
.atp-photo { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--bg); overflow: hidden; }
.atp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.atp-badge { position: absolute; top: 10px; left: 10px; padding: 3px 8px; border-radius: 4px; background: rgba(12, 15, 20, .82); color: #fff; font-style: normal; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.atp-count { position: absolute; bottom: 10px; right: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 4px; background: rgba(12, 15, 20, .7); color: #fff; font-size: .72rem; font-weight: 600; }
.atp-count svg { width: 12px; height: 12px; }
.atp-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.atp-title { font-weight: 750; font-size: .98rem; line-height: 1.3; }
.atp-variant { color: var(--muted); font-size: .82rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.atp-specs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: .78rem; color: var(--ink-2); }
.atp-specs span { display: inline-flex; align-items: center; gap: 4px; }
.atp-specs svg { width: 13px; height: 13px; color: var(--muted); }
.atp-price { margin-top: auto; padding-top: 10px; font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.atp-foot { margin: 16px 0 0; }
.atp-foot a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 700px) {
  .atp-form { flex-direction: column; }
  .atp-dealer { flex-wrap: wrap; }
}

/* AutoTrader preview: social posts panel */
.atp-social { margin-top: 20px; padding: 22px; scroll-margin-top: 20px; }
.atp-social[hidden] { display: none; }
.atp-social-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.atp-social-head > div:first-child { flex: 1; min-width: 0; }
.box .atp-social-head h2 { margin: 2px 0 4px; font-size: 1.2rem; font-weight: 700; letter-spacing: normal; text-transform: none; color: var(--ink); }
.atp-social-head p.small { margin: 0; }
.atp-styles { width: auto; min-width: 360px; }
.atp-previews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.atp-pv-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .8rem; font-weight: 650; color: var(--muted); }
.atp-pv-label > span { display: inline-flex; align-items: center; gap: 6px; }
.atp-pv-label .i { width: 15px; height: 15px; }
.atp-avatar { border: 1px solid var(--line); }
.atp-avatar img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 1200px) { .atp-previews { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px) {
  .atp-previews { grid-template-columns: 1fr; }
  .atp-social-head { flex-wrap: wrap; }
  .atp-styles { min-width: 0; width: 100%; order: 3; }
}
