/* Car dealer stock app — one small stylesheet, no framework. */
:root {
  --ground: #F3F4F2;
  --surface: #FFFFFF;
  --ink: #16191D;
  --ink-2: #3E444B;
  --muted: #565D66;
  --line: #DCDFE2;
  --line-soft: #ECEEF0;
  --field: #C5CACF;
  --accent: #0B5F5B;
  --accent-dark: #08403D;
  --accent-soft: #E2EFEE;
  --accent-bright: #7FD1C9;
  --amber-bg: #FCEFD6;
  --amber-ink: #7A4A00;
  --grey-bg: #E7E9EB;
  --private-bg: #F6F2EA;
  --private-line: #E6DCC8;
  --private-ink: #5C4A26;
  --danger: #A12C2C;
  --radius: 10px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.topbar { background: var(--ink); color: #fff; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.nav a { color: #C9CED4; text-decoration: none; padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.nav a.active, .nav a:hover { color: #fff; background: #2A3037; }
.user { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #C9CED4; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-bright); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; text-transform: uppercase; }
.linkbutton { background: none; border: 0; padding: 0; font: inherit; color: #C9CED4; cursor: pointer; text-decoration: underline; }

/* Layout */
.page { max-width: 1280px; margin: 0 auto; padding: 28px 24px 56px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: 32px; font-weight: 800; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.card h2 { font-size: 18px; font-weight: 700; }
.two-col { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.two-col > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.two-col > .side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-danger { color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
form.inline { display: inline; margin: 0; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat span:first-child { font-size: 13px; color: var(--muted); }
.stat span:last-child { font-size: 28px; font-weight: 700; }

/* Forms */
.filters { gap: 14px; padding: 16px 20px; }
.search-row { display: flex; gap: 10px; }
.search-box { position: relative; flex: 1 1 auto; min-width: 0; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input, .search-box input[type=search], .search-box input[type=text] { padding-left: 42px; min-height: 48px; font-size: 16px; }
.search-row .btn { min-height: 48px; }
.filter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.filter-row select { min-height: 40px; padding: 6px 10px; }
.clear-link { align-self: flex-start; font-size: 14px; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.field .help { font-size: 13px; color: var(--muted); }
.field .errors { font-size: 13px; color: var(--danger); margin: 0; padding: 0; list-style: none; }
input[type=text], input[type=search], input[type=number], input[type=date], input[type=password], input[type=email], select, textarea {
  font: inherit; color: var(--ink); width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--surface);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.private { background: var(--private-bg); border: 1px solid var(--private-line); border-radius: 8px; padding: 12px 14px; }
.private .label, .private label { color: var(--private-ink); }

/* Table */
.table-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.car-cell { display: flex; align-items: center; gap: 14px; }
.car-cell a { font-weight: 600; color: var(--ink); text-decoration: none; }
.car-cell a:hover { color: var(--accent); }
.thumb { width: 72px; height: 48px; border-radius: 6px; object-fit: cover; background: #DDE2E5; flex: none; display: flex; align-items: center; justify-content: center; color: #7C858E; }
.price { font-weight: 700; }
.locked { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* Status pills */
.pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill-in_stock { background: var(--accent-soft); color: var(--accent); }
.pill-reserved { background: var(--amber-bg); color: var(--amber-ink); }
.pill-sold { background: var(--grey-bg); color: var(--ink-2); }
.pill-off { background: var(--grey-bg); color: var(--ink-2); }

/* Photos */
.gallery-main { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; background: #DDE2E5; display: block; }
.gallery-empty { width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; background: #DDE2E5; color: #6F7882; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.thumbs button { padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.thumbs button[aria-current=true] img { outline: 2px solid var(--accent); outline-offset: 1px; }
.photo-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.photo-item { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border-radius: 8px; }
.photo-frame { position: relative; }
.photo-edit img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; user-select: none; -webkit-user-select: none; }
.photo-edit .row { display: flex; gap: 6px; }
.photo-edit .row form { margin: 0; }
.photo-edit .row .photo-cover-form { flex: 1; }
.photo-edit .row .btn { width: 100%; padding: 0 8px; }
.photo-left-form, .photo-right-form { flex: 0 0 40px; }
.photo-handle { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; border-radius: 8px; background: rgba(20, 24, 22, .72); color: #fff; font-size: 20px; line-height: 1; cursor: grab; touch-action: none; }
.photo-handle:active { cursor: grabbing; }
.photo-cover-badge { position: absolute; left: 6px; top: 6px; display: none; }
.photo-item:first-child .photo-cover-badge { display: inline-flex; }
.photo-item:first-child .photo-left, .photo-item:last-child .photo-right { visibility: hidden; }
.photo-item:first-child .photo-cover-form { visibility: hidden; }
.photo-remove-form { position: absolute; right: 6px; bottom: 6px; margin: 0; }
.photo-remove { width: 36px; height: 36px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .9); color: var(--danger); font-size: 16px; font-weight: 700; cursor: pointer; }
.photo-remove:hover { background: #fff; }
.photo-item.dragging { opacity: .35; }
.photo-ghost { position: fixed; z-index: 1000; pointer-events: none; width: 150px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); transform: rotate(2deg); opacity: .95; }
.photo-ghost img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; }
.photo-status.error { color: var(--danger); font-weight: 600; }

/* Specs */
.specs { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 24px; }
.specs div { border-bottom: 1px solid var(--line-soft); padding-bottom: 10px; display: flex; flex-direction: column; gap: 3px; }
.specs dt { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.specs dd { margin: 0; font-weight: 500; }

/* Pricing */
.big-price { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.private-price { font-size: 26px; font-weight: 700; }

/* Share links */
.link-row { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }
.link-row:last-of-type { border-bottom: 0; }
.link-url { font-family: var(--mono); font-size: 13px; color: var(--ink-2); word-break: break-all; }

/* Messages */
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { background: var(--accent-soft); color: var(--accent-dark); border-radius: 8px; padding: 12px 16px; font-weight: 500; word-break: break-word; }
.messages li.error { background: #F8E3E3; color: var(--danger); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; }

/* Buyer page */
.public { max-width: 720px; margin: 0 auto; background: var(--surface); min-height: 100vh; }
.public-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.public-body { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.public .gallery-main, .public .gallery-empty { border-radius: 0; }
.public-thumbs { padding: 10px 20px 0; }
.public-price { font-size: 32px; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: #F0F2F3; }
.contact { display: flex; flex-direction: column; gap: 10px; }
.contact .btn { min-height: 52px; font-size: 16px; }
.spec-list { margin: 0; }
.spec-list div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.spec-list dt { color: var(--muted); }
.spec-list dd { margin: 0; font-weight: 600; text-align: right; }
.notice { font-size: 13px; color: var(--muted); background: #F6F7F7; border-radius: 8px; padding: 12px 14px; }
.preview-bar { background: var(--amber-bg); color: var(--amber-ink); padding: 10px 20px; font-size: 14px; font-weight: 600; }
.sold-bar { background: var(--grey-bg); color: var(--ink-2); padding: 10px 20px; font-size: 14px; font-weight: 600; }

@media (max-width: 640px) {
  .page { padding: 20px 16px 40px; }
  .page-head h1 { font-size: 26px; }
  .topbar-inner { padding: 8px 16px; }
}

/* Stat tiles that act as tabs */
.stat-link { text-decoration: none; color: var(--ink); }
.stat-link:hover { border-color: var(--muted); color: var(--ink); }
.stat-link.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.stat-link.attention span:last-child { color: var(--amber-ink); }

/* Pending guest car banner */
.review { background: var(--amber-bg); border: 1px solid #EBD3A3; border-radius: var(--radius); padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.review h2 { font-size: 18px; color: var(--amber-ink); }
.review .form-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* Simple tables on team / platform / guest pages */
.list-table td, .list-table th { white-space: normal; }
.code { font-family: var(--mono); font-weight: 600; font-size: 16px; letter-spacing: .06em; }

/* Branded public pages: the dealer's colour drives buttons and the price */
.public a { color: var(--accent-ink); }
.public .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.public .btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-text); filter: brightness(0.92); }
.public .public-price { color: var(--accent-ink); }
.public-logo { max-height: 40px; max-width: 200px; object-fit: contain; display: block; }
.public .gallery-main, .public .gallery-empty { border-radius: 0; }
.swatch { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); display: inline-block; vertical-align: middle; }

/* Badges and tabs */
.badge { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--amber-bg); color: var(--amber-ink); font-size: 12px; font-weight: 700; text-align: center; }
.nav .badge { background: #F2C94C; color: var(--ink); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.tabs a.active { background: var(--ink); border-color: var(--ink); color: #fff; }
label.check { display: flex; align-items: center; gap: 10px; text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* Leads */
.lead-list { display: flex; flex-direction: column; gap: 14px; }
.lead { gap: 12px; }
.lead-new { border-left: 0; box-shadow: inset 0 0 0 2px #EBD3A3; }
.lead-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: flex-start; }
.lead-top .pill { margin-left: 6px; vertical-align: middle; }
.lead-car { font-weight: 600; text-decoration: none; }
.lead-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lead-form input[type=text] { flex: 1 1 220px; min-height: 36px; }
.lead-form select { min-height: 36px; padding: 4px 10px; }

/* Buyer pages: contact and interest */
.contact-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.interest { background: #F6F7F7; border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.public-back { padding: 10px 20px; font-weight: 600; }
.public-back a { text-decoration: none; }

/* Showroom */
.public:has(.showroom) { max-width: 1180px; }
.showroom { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.showroom-hero { display: flex; flex-direction: column; gap: 6px; }
.showroom-hero h1 { font-size: 30px; font-weight: 800; }
.showroom-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.showroom-filters select { min-height: 40px; padding: 6px 10px; }
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.car-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); background: var(--surface); }
.car-card:hover { border-color: var(--muted); color: var(--ink); }
.car-card img, .car-card-empty { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #DDE2E5; display: flex; align-items: center; justify-content: center; color: #6F7882; }
.car-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.car-card-title { font-weight: 700; font-size: 16px; }
.car-card-price { font-weight: 800; font-size: 20px; color: var(--accent-ink); margin-top: 4px; }

/* Window sheet (A4) */
.sheet-tools { max-width: 210mm; margin: 16px auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 0 16px; }
.sheet { width: 210mm; min-height: 297mm; margin: 0 auto 24px; background: #fff; padding: 16mm; box-sizing: border-box; display: flex; flex-direction: column; gap: 8mm; box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--accent); padding-bottom: 4mm; font-size: 12pt; }
.sheet-logo { max-height: 18mm; max-width: 70mm; object-fit: contain; }
.sheet-name { font-size: 18pt; }
.sheet-title { font-size: 28pt; font-weight: 800; line-height: 1.1; }
.sheet-price { font-size: 44pt; font-weight: 800; color: var(--accent-ink); letter-spacing: -0.02em; margin-top: -4mm; }
.sheet-photos { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 3mm; height: 80mm; }
.sheet-photos img { width: 100%; height: 100%; object-fit: cover; border-radius: 2mm; }
.sheet-photos img:first-child { grid-row: 1 / 3; }
.sheet-photos img:only-child { grid-column: 1 / 3; }
.sheet-main { display: grid; grid-template-columns: 1fr 52mm; gap: 8mm; align-items: start; }
.sheet-specs { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3mm 6mm; font-size: 12pt; }
.sheet-specs div { border-bottom: 1px solid #DDD; padding-bottom: 2mm; }
.sheet-specs dt { font-size: 9pt; text-transform: uppercase; letter-spacing: .04em; color: #555; }
.sheet-specs dd { margin: 0; font-weight: 600; }
.sheet-qr { display: flex; flex-direction: column; align-items: center; gap: 2mm; text-align: center; font-size: 11pt; }
.sheet-qr svg { display: block; width: 48mm; height: 48mm; shape-rendering: crispEdges; }
.sheet-desc { margin: 0; font-size: 12pt; line-height: 1.45; }
.sheet-foot { margin-top: auto; border-top: 1px solid #DDD; padding-top: 3mm; font-size: 11pt; color: #444; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .no-print { display: none !important; }
  .sheet { box-shadow: none; margin: 0; }
}

/* Searchable pickers (make, model, catalog finder) */
.combo { position: relative; width: 100%; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--field); border-radius: 10px; box-shadow: 0 8px 24px rgba(22,25,29,.14); max-height: min(60vh, 380px); overflow-y: auto; }
.combo-option { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; min-height: 44px; justify-content: center; border-radius: 7px; cursor: pointer; }
.combo-option[aria-selected=true], .combo-option:hover { background: var(--accent-soft); }
.combo-label { font-weight: 600; color: var(--ink); }
.combo-hint { font-size: 13px; color: var(--muted); }
.combo-empty { padding: 12px; color: var(--muted); font-size: 14px; }

.finder { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.finder .search-box input { min-height: 52px; font-size: 17px; }
.finder-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.engine-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.engine-option { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; min-height: 56px; border: 1px solid var(--field); border-radius: 10px; background: var(--surface); font: inherit; cursor: pointer; }
.engine-option:hover, .engine-option:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.finder-picked { display: flex; gap: 12px; align-items: flex-start; color: var(--accent-dark); }
.finder-picked svg { flex: none; margin-top: 2px; }
.finder-toggle > summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 4px 0; list-style: none; }
.finder-toggle > summary::-webkit-details-marker { display: none; }
.finder-toggle > summary::before { content: "+ "; }
.finder-toggle[open] > summary::before { content: "− "; }
.finder-toggle[open] > .finder { margin-top: 10px; }
.public .finder { border: 1px solid var(--accent); border-radius: var(--radius); padding: 16px; }

@keyframes filled { from { background: #FFF4C2; border-color: #D9A400; } to { background: var(--surface); } }
.just-filled { animation: filled 2.4s ease-out; }

/* Long forms on phones: keep Save in reach */
@media (max-width: 760px) {
  .form-actions { position: sticky; bottom: 0; z-index: 20; background: var(--ground); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); margin: 0 -16px; padding-left: 16px; padding-right: 16px; border-top: 1px solid var(--line); }
  .form-actions .btn { flex: 1 1 auto; }
  .engine-list { grid-template-columns: 1fr; }
  input, select, textarea { font-size: 16px; } /* stops iPhone zooming into fields */
}

/* Team permissions */
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-list { display: flex; flex-direction: column; }
.perm-row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.perm-row:last-child { border-bottom: 0; }
.perm-row input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--accent); }
.perm-row span { display: flex; flex-direction: column; gap: 2px; }
.perm-row .muted { font-size: 14px; }
.perm-row.locked { cursor: not-allowed; opacity: .7; }
.scope-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.scope { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 6px; margin: 0; }
.scope legend { font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); padding: 0 4px; }
.radio-row { display: flex; gap: 10px; align-items: center; min-height: 40px; cursor: pointer; }
.radio-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.danger-zone summary { color: var(--danger); }
.notice-bar { background: var(--amber-bg); color: var(--amber-ink); border-radius: 8px; padding: 10px 14px; font-weight: 500; }

/* Email / account pages */
.messages li.warning { background: #FBF0D9; color: #7A5300; }
.login-card .help-link { font-size: 14px; font-weight: 600; text-align: center; }
.note { font-size: 14px; color: var(--muted); margin: 0; }
.note-box { background: #FBF0D9; color: #7A5300; border-radius: 8px; padding: 12px 16px; font-size: 14px; }
.add-person { display: flex; flex-direction: column; gap: 14px; }
.add-person + .add-person { border-top: 1px solid var(--line-soft); padding-top: 18px; }
.user a.me { color: inherit; text-decoration: none; font-weight: 600; }
.user a.me:hover { text-decoration: underline; }

/* Stock list column picker */
.table-tools { display: flex; justify-content: flex-end; margin-bottom: -8px; }
.columns-menu { position: relative; }
.columns-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.columns-menu > summary::-webkit-details-marker { display: none; }
.columns-menu[open] > summary { border-color: var(--accent); color: var(--accent); }
.columns-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: min(440px, calc(100vw - 32px)); box-shadow: 0 12px 32px rgba(0, 0, 0, .14); }
.columns-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px 18px; }
.columns-form fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.columns-form legend { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; padding: 0; }
.columns-form label.check { font-size: 14px; font-weight: 500; }
.columns-form label.check input { width: 18px; height: 18px; }
.columns-form .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.negative { color: var(--danger); font-weight: 600; }
