/* ============================================================================
   portal-v2.css — the returning-customer dashboard (2026-10-15)
   Layered on portal.css + block-b.css. Tokens only — no literal colors.
   One glance on a phone: status sentence → missing documents → the garage
   (hero card: year/model, the lease-end line, the ONE brass button, payment).
   ========================================================================== */

/* ---- site-matched header (same bar as theautopal.com) --------------------- */
.dash-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bone) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.dash-header .logo { width: 104px; }
.dash-header .site-links { display: none; gap: 6px; margin-left: 8px; flex: 1; }
.dash-header .site-links a {
  font-size: 14px; font-weight: 500; color: var(--text-mute);
  padding: 8px 12px; border-radius: var(--radius-chip); text-decoration: none;
}
.dash-header .site-links a:hover { color: var(--text); background: color-mix(in srgb, var(--brass) 10%, transparent); }
@media (min-width: 880px) { .dash-header .site-links { display: flex; } }

/* ---- welcome + the one sentence ------------------------------------------- */
.welcome { display: flex; flex-direction: column; gap: 6px; }
.status-line {
  margin: 0; font-size: 15px; line-height: 1.45; color: var(--text-body);
}
.status-line.kind-needs { color: var(--warn); font-weight: 500; }
.status-line.kind-progress { color: var(--brass-deep); font-weight: 500; }
.status-line.kind-lease { color: var(--text-body); }
.status-line:empty { display: none; }

/* ---- needs (missing documents) ------------------------------------------- */
#module-needs h2 { color: var(--warn); }
.needs-note { margin: 0 0 10px; font-size: 13px; color: var(--text-mute); }
.needs-fine { margin: 10px 0 0; font-size: 11.5px; color: var(--text-ghost); }

.need-slot {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-row); padding: 12px; margin-bottom: 10px;
}
.need-slot.is-done { border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.need-slot.is-error { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.need-head { display: flex; align-items: center; gap: 11px; }
.need-tick {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--line-strong); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--bone);
}
.need-tick.is-done { background: var(--green); border-color: var(--green); }
.need-meta .t { font-weight: 600; font-size: 14px; color: var(--text); }
.need-meta .d { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.need-thumb { margin-top: 10px; max-height: 140px; width: auto; border-radius: 8px; border: 1px solid var(--line); }
.need-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.need-action {
  min-height: var(--tap-min); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-btn);
  background: var(--surface-alt); font-weight: 600; font-size: 14px; color: var(--text-body);
}
.need-action:hover { border-color: var(--brass); color: var(--brass-deep); }
.need-action.quiet { grid-column: 1 / -1; background: transparent; border-style: dashed; font-weight: 500; color: var(--text-mute); }
.need-action .ico { width: 18px; height: 18px; flex: none; }
.need-input { display: none; }
.need-progress { margin-top: 10px; font-size: 12px; color: var(--text-mute); }
.need-bar { height: 6px; border-radius: 4px; background: var(--skeleton-hi); overflow: hidden; margin-bottom: 6px; }
.need-bar i { display: block; height: 100%; background: var(--brass); border-radius: 4px; transition: width .15s linear; }
.need-progress .undo-btn { color: var(--brass-deep); font-weight: 600; text-decoration: underline; min-height: 0; padding: 2px 4px; }
.need-error { margin: 8px 0 0; font-size: 12.5px; color: var(--warn); }

/* ---- the garage ----------------------------------------------------------- */
.garage { display: flex; flex-direction: column; gap: 14px; }

.garage-card { overflow: hidden; }
.garage-card.is-hero { border-color: color-mix(in srgb, var(--brass) 55%, var(--line)); box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 8%, transparent); }
.garage-card.state-past { opacity: .82; }

.garage-media {
  height: 92px; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(70% 90% at 20% 0%, color-mix(in srgb, var(--brass) 14%, transparent), transparent 60%),
    linear-gradient(135deg, var(--surface-alt), var(--skeleton-hi));
  border-bottom: 1px solid var(--line);
}
.garage-media.has-photo { height: 160px; }
.garage-media img { width: 100%; height: 100%; object-fit: cover; }
.garage-media .mark {
  font-family: var(--font-display); font-weight: 500; font-size: 30px; letter-spacing: .06em;
  color: color-mix(in srgb, var(--brass) 70%, var(--text-ghost));
}
.garage-card.is-hero .garage-media { height: 120px; }

.garage-body { padding: 14px 15px 16px; }
.garage-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.garage-top .name { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.15; color: var(--text); }
.garage-card.is-hero .garage-top .name { font-size: 26px; }
.garage-top .spec { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--text-faint); margin-top: 3px; text-transform: uppercase; }
.chip-progress {
  color: var(--brass-deep);
  background: color-mix(in srgb, var(--brass) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--brass) 45%, transparent);
}

.garage-lead { margin: 12px 0 0; font-size: 15.5px; line-height: 1.4; color: var(--text-body); font-weight: 500; }
.garage-lead.soon { color: var(--brass-deep); }
.garage-lead.approved { color: var(--green); }
.garage-lead.quiet { color: var(--text-mute); font-weight: 400; }
.garage-card.is-hero .garage-lead { font-size: 17px; }

.garage-cta { width: 100%; margin-top: 12px; font-size: 15px; }
.garage-next { margin: 8px 0 0; font-size: 13px; color: var(--text-mute); }

.garage-payment { margin-top: 14px; }
.garage-payment .tax-split { margin-bottom: 0; }
.garage-payment .fee-row { border-top: none; padding-top: 10px; padding-bottom: 0; }

.garage-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 12.5px; color: var(--text-body); }
.garage-facts .k { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-right: 6px; }
.garage-facts a { color: var(--brass-deep); text-decoration: none; }
.garage-facts a:hover { text-decoration: underline; }
.garage-bankline { margin: 10px 0 0; font-size: 12px; color: var(--text-faint); }
.garage-bankline a { color: var(--brass-deep); text-decoration: none; font-weight: 600; }

/* records, inside the card */
.records { margin-top: 14px; border-top: 1px solid var(--line); }
.records > summary { list-style: none; cursor: pointer; padding: 11px 0 4px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.records > summary::-webkit-details-marker { display: none; }
.records > summary:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.records-head .count { font-size: 12px; color: var(--text-mute); }
.records-list { padding-top: 4px; }
.records-none { margin: 4px 0 2px; font-size: 12.5px; color: var(--text-mute); }
.record-row { display: flex; align-items: center; gap: 6px; padding: 8px 0; }
.record-row + .record-row { border-top: 1px solid var(--skeleton-hi); }
.record-main { flex: 1; min-width: 0; text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; padding: 2px 0; border-radius: 6px; }
.record-main:hover .fname { color: var(--brass-deep); }
.record-main .fname { font-size: 13px; color: var(--text-body); overflow-wrap: anywhere; }
.record-main .meta { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .06em; color: var(--text-faint); text-transform: uppercase; }
.garage-loose { padding: 14px 15px; }
.garage-empty { padding: 22px 16px; text-align: center; }
.garage-empty .name { font-family: var(--font-display); font-size: 20px; color: var(--text); }
.garage-empty p { font-size: 13px; color: var(--text-mute); margin: 8px 0 14px; }

/* ---- pay -------------------------------------------------------------------- */
.pay-card { padding: 15px; }
.pay-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.pay-total .k { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--text-faint); }
.pay-total .v { font-family: var(--font-mono); font-size: 28px; font-weight: 600; color: var(--text); }
.pay-card .fee-row .due { color: var(--text-faint); font-size: 11px; }
.pay-actions { margin-top: 12px; }
.pay-actions .btn { width: 100%; }
.pay-fine { margin: 10px 0 0; font-size: 11.5px; color: var(--text-ghost); }

/* ---- talk ------------------------------------------------------------------- */
.talk-line { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--text-mute); line-height: 1.7; }
.talk-line a { color: var(--brass-deep); text-decoration: none; font-weight: 600; }
.talk-line a:hover { text-decoration: underline; }
.talk-cb { color: var(--brass-deep); font-weight: 600; min-height: 0; padding: 2px 2px; }
.talk-cb:hover { text-decoration: underline; }
.talk-cb:disabled { opacity: .6; cursor: default; }

/* ---- "I need a new car" (modal screens) ------------------------------------ */
.modal.nc { max-width: 480px; }
.nc-head h3 { margin: 4px 0 0; font-family: var(--font-display); font-weight: 500; font-size: 21px; color: var(--text); }
.nc-head p { margin: 4px 0 0; font-size: 13px; color: var(--text-mute); }
.nc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.nc-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.nc-sub { margin-top: 14px; }
.nc-chip {
  min-height: var(--tap-min); padding: 9px 12px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-btn);
  background: var(--surface-alt); text-align: left;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.nc-row .nc-chip { min-height: 38px; padding: 7px 12px; border-radius: var(--radius-chip); }
.nc-chip .t { font-weight: 600; font-size: 14px; color: var(--text-body); }
.nc-chip .s { font-size: 11px; color: var(--text-faint); }
.nc-chip:hover { border-color: var(--brass); }
.nc-chip.is-selected { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 12%, transparent); }
.nc-chip.is-selected .t { color: var(--brass-deep); }
.nc-toggle { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 13px; color: var(--text-body); }
.nc-toggle input { margin-top: 3px; accent-color: var(--brass); }
.nc-input {
  width: 100%; margin-top: 14px; min-height: var(--tap-min);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-field);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; padding: 0 12px;
}
.nc-nav { display: flex; justify-content: space-between; align-items: stretch; gap: 10px; margin-top: 18px; }
/* Back and Next: one height, one width (Adam 10/15 — the ghost ran taller and narrower than the primary). */
.nc-nav .btn { flex: 1 1 0; min-width: 120px; height: var(--tap-min); min-height: var(--tap-min); padding: 0 18px; line-height: 1; }
.nc-error { margin: 10px 0 0; font-size: 12.5px; color: var(--warn); }
.nc-done { text-align: center; padding: 6px 0 4px; }
.nc-done .mark { display: inline-flex; width: 44px; height: 44px; border-radius: 50%; background: var(--green); color: var(--bone); align-items: center; justify-content: center; font-weight: 700; font-size: 20px; }
.nc-done h3 { margin: 10px 0 0; font-family: var(--font-display); font-weight: 500; font-size: 24px; color: var(--text); }
.nc-done p { margin: 6px 0 0; font-size: 14px; color: var(--text-mute); }
.nc-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.nc-actions .btn { width: 100%; text-decoration: none; }
.nc-fine { margin: 12px 0 0; font-size: 11.5px; color: var(--text-ghost); text-align: center; }

/* ---- toast ------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--surface-dark); color: var(--on-dark);
  padding: 11px 16px; border-radius: 10px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-card); z-index: 60; max-width: calc(100vw - 32px);
}

/* ---- the real Google mark on the login button ------------------------------- */
.btn-alt .g-logo { width: 16px; height: 16px; flex: none; }

/* ---- desktop ------------------------------------------------------------------- */
@media (min-width: 880px) {
  .dash-wrap { max-width: 760px; }
  .garage-card.is-hero .garage-media { height: 150px; }
  .garage-card.is-hero .garage-top .name { font-size: 30px; }
  .garage-cta { width: auto; min-width: 240px; }
  .need-actions { max-width: 420px; }
}

/* ---- login: full-bleed loop, one floating card, unboxed logo (Adam 10/15) -- */
.login-view { position: relative; background: var(--ink); overflow: hidden; }
.login-brand { display: none !important; }
.login-bg { position: absolute; inset: 0; z-index: 0; }
.login-video { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--petrol-deep) url('../assets/login-poster.jpg') center / cover no-repeat; }
.login-wash {
  position: absolute; inset: 0;
  background:
    /* Adam 10/15: the loop was ~75% dark and vanished; the card carries its own contrast,
       so the wash is now ~25–30% — a light vignette, the footage stays visible. */
    radial-gradient(70% 60% at 50% 40%, color-mix(in srgb, var(--ink) 4%, transparent), color-mix(in srgb, var(--ink) 28%, transparent) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--ink) 14%, transparent), color-mix(in srgb, var(--ink) 26%, transparent));
}
@media (prefers-reduced-motion: reduce) {
  .login-video { display: none; }
  .login-bg { background: var(--petrol-deep) url('../assets/login-poster.jpg') center / cover no-repeat; }
}
.login-main { position: relative; z-index: 1; padding: 36px 16px 44px; }
.login-main > .logo { display: block !important; width: 220px; height: auto; filter: drop-shadow(0 4px 18px color-mix(in srgb, var(--ink) 60%, transparent)); }
.auth-card {
  background: color-mix(in srgb, var(--surface-dark) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 30px 70px color-mix(in srgb, var(--ink) 60%, transparent);
  border-color: color-mix(in srgb, var(--bone) 14%, transparent);
}
.auth-explain { margin: 0; font-size: 13px; line-height: 1.5; color: color-mix(in srgb, var(--bone) 70%, transparent); }
.auth-explain strong { color: var(--bone); font-weight: 600; }
.auth-tab { font-size: 12px; }
.login-back a { color: color-mix(in srgb, var(--bone) 80%, transparent); }
@media (min-width: 880px) {
  .login-main { padding: 48px 24px 56px; }
  .login-main > .logo { width: 260px; }
  .auth-card { max-width: 400px; }
}

/* ---- link your account ---------------------------------------------------- */
.link-card { padding: 18px 16px 16px; }
.link-head h2 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 22px; color: var(--text); }
.link-head p { margin: 6px 0 0; font-size: 14px; color: var(--text-mute); line-height: 1.5; }
.link-paths { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.link-path {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-btn); background: var(--surface-alt);
}
.link-path:hover { border-color: var(--brass); }
.link-path .t { font-weight: 600; font-size: 14.5px; color: var(--text-body); }
.link-path .s { font-size: 12px; color: var(--text-faint); }
.link-label { display: block; margin-top: 12px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.link-label + .nc-input { margin-top: 6px; }
.link-sub { margin: 10px 0 0; font-size: 13px; color: var(--text-mute); }
.link-code { font-family: var(--font-mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
.link-msg { margin: 12px 0 0; font-size: 13px; color: var(--green); }
.link-msg.is-error { color: var(--warn); }
.link-card .talk-line { margin-top: 16px; }
.link-wa { width: 100%; text-decoration: none; }
.nc-input.mono { font-family: var(--font-mono); }
.nc-error.is-ok { color: var(--green); }
.modal .btn-dark, .modal .btn-primary { width: 100%; margin-top: 10px; }
.modal .modal-actions .btn { margin-top: 0; width: auto; }

/* ---- "Choose from what's available" (2026-10-15) ----------------------------
   Step 3's second way in, and the board picker it opens INSIDE the modal: a
   wider dialog on a desktop, a full-height sheet on a phone. Same tokens, same
   chips; the cards are the board's cards in the portal's skin. */
.nc-board-open {
  width: 100%; margin-top: 14px; padding: 13px 14px; text-align: left;
  display: flex; flex-direction: column; gap: 3px;
  border: 1.5px solid var(--brass); border-radius: var(--radius-btn);
  background: color-mix(in srgb, var(--brass) 10%, transparent);
}
.nc-board-open:hover { background: color-mix(in srgb, var(--brass) 16%, transparent); }
.nc-board-open .t { font-weight: 700; font-size: 15px; color: var(--brass-deep); }
.nc-board-open .s { font-size: 12px; color: var(--text-mute); }

.nc-pick {
  display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 10px 12px;
  border: 1.5px solid var(--brass); border-radius: var(--radius-btn); background: var(--surface);
}
.nc-pick-img { width: 72px; height: 54px; object-fit: contain; flex: none; border-radius: 4px; } /* 4:3, the courtyard photographs */
.nc-pick-main { flex: 1; min-width: 0; }
.nc-pick-name { font-weight: 600; font-size: 14.5px; color: var(--text); line-height: 1.3; }
.nc-pick-pay { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--brass-deep); margin-top: 2px; }
.nc-pick .btn-link { padding: 2px 0; min-height: 0; font-size: 12.5px; color: var(--text-mute); text-decoration: underline; }
.nc-pick-remove {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  border: 1px solid var(--line-dim); background: var(--surface-alt); color: var(--text-mute); font-size: 14px;
}
.nc-pick-remove:hover { border-color: var(--warn); color: var(--warn); }

.nc-anchor { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--brass-deep); }
.nc-anchor.quiet { font-weight: 500; color: var(--text-mute); }

/* the picker */
.modal.nc-wide { max-width: 920px; }
.nc-pk-head p { margin-top: 2px; }
.nc-pk-filters { margin-top: 10px; }
.nc-pk-search { margin-top: 0; }
.nc-pk-row { margin-top: 8px; }
.nc-pk-row .nc-chip { min-height: 34px; padding: 5px 11px; }
.nc-pk-row .nc-chip .t { font-size: 13px; }
.nc-pk-count { margin: 12px 0 6px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.nc-pk-results { display: grid; grid-template-columns: 1fr; gap: 8px; }
.nc-pk-none { margin: 10px 0; font-size: 13.5px; color: var(--text-mute); }
.nc-car-wrap { grid-column: 1 / -1; border: 1.5px solid var(--brass); border-radius: var(--radius-card); background: var(--surface); overflow: hidden; }
.nc-car {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface);
}
.nc-car:hover { border-color: var(--brass); }
.nc-car.is-open { border: 0; border-radius: 0; }
.nc-car-img { width: 80px; height: 60px; flex: none; display: flex; align-items: center; justify-content: center; }
.nc-car-img img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.nc-car-body { flex: 1; min-width: 0; }
.nc-car-brand { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.nc-car-model { font-family: var(--font-display); font-weight: 500; font-size: 19px; color: var(--text); line-height: 1.15; margin-top: 1px; }
.nc-car-meta { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.nc-car-pay { font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; color: var(--brass-deep); }
.nc-car-trims { font-size: 12px; color: var(--text-mute); }
.nc-trims { display: flex; flex-direction: column; border-top: 1px solid var(--line); background: var(--surface-alt); padding: 6px; gap: 4px; }
.nc-trim {
  display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: baseline; text-align: left;
  padding: 10px 10px; border-radius: var(--radius-row); background: var(--surface); border: 1px solid var(--line);
}
.nc-trim:hover { border-color: var(--brass); }
.nc-trim-name { font-weight: 600; font-size: 14px; color: var(--text-body); }
.nc-trim-pay { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--brass-deep); }
.nc-trim-terms { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-faint); }
.nc-pk-nav { position: sticky; bottom: -18px; margin: 14px -18px -18px; padding: 10px 18px 14px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); align-items: center; }
.nc-pk-nav .btn { flex: 0 0 auto; }
.nc-pk-hint { font-size: 12.5px; color: var(--text-faint); text-align: right; }

/* a phone: the picker is a full-height sheet */
@media (max-width: 879px) {
  .modal.nc-wide { position: fixed; inset: 0; width: auto; max-width: none; max-height: none; height: 100%; border-radius: 0; border: 0; }
  .modal.nc-wide .nc-pk-nav { bottom: -18px; }
}
@media (min-width: 880px) {
  .nc-pk-results { grid-template-columns: 1fr 1fr; }
  .modal.nc-wide { max-height: 88vh; }
}
@media (min-width: 1100px) {
  .nc-pk-results { grid-template-columns: 1fr 1fr 1fr; }
}
/* ============================================================================
   Round three (2026-10-15) — appended at the END on purpose: round two also
   edits this file, and additions here rebase cleanly.
   The maker's mark, the one payment, the lease bar.
   ========================================================================== */

/* ---- the maker's own mark: real colours, an <img>, badge-sized ----------
   Never tinted (Adam via Michael, 10/15). A mark that would vanish on the
   strip (Genesis publishes white wings) sits on a small ink chip instead. */
.brand-badge { display: block; object-fit: contain; }
.brand-badge.is-strip { width: 140px; height: 44px; }                  /* a badge, not a billboard */
.garage-card.is-hero .brand-badge.is-strip { width: 160px; height: 50px; }
.brand-badge.is-row { width: 44px; height: 24px; margin-top: 3px; }    /* beside the name when a photo took the strip */
.brand-chip { display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.brand-chip.chip-ink { background: var(--ink); }
.brand-chip.is-strip { padding: 10px 16px; }
.brand-chip.is-strip .brand-badge { width: 128px; height: 30px; }
.garage-card.is-hero .brand-chip.is-strip .brand-badge { width: 150px; height: 34px; }
.brand-chip.is-row { padding: 4px 7px; border-radius: 6px; margin-top: 3px; }
.brand-chip.is-row .brand-badge { width: 40px; height: 12px; margin-top: 0; }
.garage-title { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.garage-media .mark { font-size: 24px; }                               /* the word, only when no mark ships */

/* ---- one payment, one bar --------------------------------------------------- */
.garage-payment.one { margin-top: 14px; padding: 12px 13px 10px; border: 1px solid var(--line); border-radius: var(--radius-row); background: var(--surface-alt); }
.pay-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pay-figure { display: flex; align-items: baseline; gap: 5px; }
.pay-figure .v { font-family: var(--font-mono); font-weight: 600; font-size: 26px; line-height: 1; color: var(--text); letter-spacing: -.01em; }
.garage-card.is-hero .pay-figure .v { font-size: 30px; }
.pay-figure .per { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-mute); }
.pay-left { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--brass-deep); white-space: nowrap; }
.pay-fine-line { margin-top: 7px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.garage-payment.one .fee-row { border-top: 1px solid var(--line); margin-top: 9px; padding: 9px 0 0; }

/* the lease bar: one slice per month, faint ticks between, filled = paid */
.lease-bar { display: flex; gap: 2px; height: 10px; margin-top: 10px; }
.lease-bar i { flex: 1 1 0; min-width: 0; display: block; border-radius: 2px; background: var(--skeleton); }
.lease-bar i.is-paid { background: var(--brass); }
.lease-bar i.is-paid + i:not(.is-paid) { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--brass) 45%, transparent); }
@media (min-width: 880px) { .lease-bar { height: 12px; gap: 3px; } }

/* ============================================================================
   Round four (2026-10-15) — appended at the END, as round three did.
   Three tabs (Dashboard · Garage · Documents), the new-car action outside the
   card, folders, the Dashboard lists. Phone first: the tab bar sits along the
   bottom within thumb reach; from 880px it is a row under the header.
   ========================================================================== */

/* ---- the tab bar ------------------------------------------------------------ */
.portal-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: color-mix(in srgb, var(--bone) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
}
.portal-tab {
  position: relative; min-height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-mute); text-decoration: none; border-radius: var(--radius-btn);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
}
.portal-tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portal-tab:hover { color: var(--text); }
.portal-tab.is-active { color: var(--brass-deep); }
.portal-tab.is-active::before {
  content: ''; position: absolute; top: -5px; left: 30%; right: 30%; height: 2px; border-radius: 2px; background: var(--brass);
}
.portal-tab:focus-visible { outline: 2px solid var(--brass); outline-offset: -2px; }
.tab-count {
  position: absolute; top: 5px; left: calc(50% + 7px);
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--warn); color: var(--bone);
  font: 700 10px/17px var(--font-ui); text-align: center;
}
/* room for the bar under the last line on a phone */
#view-dashboard .dash-wrap { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
#view-dashboard .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

@media (min-width: 880px) {
  .portal-tabs {
    position: sticky; top: 69px; bottom: auto; z-index: 19;
    display: flex; justify-content: flex-start; gap: 4px;
    border-top: 0; border-bottom: 1px solid var(--line);
    /* the tabs start where the content column starts (760px wide, 26px inner padding) */
    padding: 0 max(16px, calc((100% - 760px) / 2 + 26px - 14px));
  }
  .portal-tab { flex-direction: row; min-height: 48px; padding: 0 14px; gap: 8px; font-size: 14px; border-radius: 0; }
  .portal-tab svg { width: 18px; height: 18px; }
  .portal-tab.is-active::before { top: auto; bottom: -1px; left: 10px; right: 10px; }
  .tab-count { position: static; margin-left: 2px; }
  #view-dashboard .dash-wrap { padding-bottom: 40px; }
  #view-dashboard .toast { bottom: 22px; }
}

/* a heading with its tab's action beside it; the action drops under on a phone */
.tab-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 11px; }
section.module .tab-head h2 { margin: 0; }
.tab-head > div:empty { display: none; }
@media (max-width: 559px) {
  .tab-head > div { flex: 1 1 100%; }
  .tab-head > div .btn { width: 100%; }
}

/* ---- Garage: the new-car action, its own, outside every card --------------- */
.garage-newcar { min-height: var(--tap-min); padding: 0 22px; font-size: 15px; }

/* ---- Dashboard lists -------------------------------------------------------- */
.dash-list { padding: 4px 14px; }
.dash-row { display: flex; gap: 11px; padding: 11px 0; align-items: flex-start; }
.dash-row + .dash-row { border-top: 1px solid var(--skeleton-hi); }
.dash-ico {
  flex: none; width: 26px; height: 26px; border-radius: 50%; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-alt); border: 1px solid var(--line); color: var(--brass-deep); font-weight: 700; font-size: 13px;
}
.dash-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-t { font-size: 14px; color: var(--text-body); overflow-wrap: anywhere; }
.dash-from { color: var(--text-faint); }
.dash-note { font-size: 12.5px; color: var(--text-mute); font-style: italic; }
.dash-d { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.dash-quiet .records-none { margin: 0; }
.tab-head .btn-link { font-size: 12.5px; }

/* ---- Documents: folders like the CRM's ------------------------------------- */
.docs-upload { min-height: var(--tap-min); padding: 0 18px; gap: 8px; display: inline-flex; align-items: center; justify-content: center; }
.docs-group { margin: 4px 0 8px; }
.docs-grid .folder-grid + .docs-group { margin-top: 18px; }
.folder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.folder-grid.is-deals { grid-template-columns: 1fr; }
@media (min-width: 560px) { .folder-grid.is-deals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 880px) { .folder-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .folder-grid.is-deals { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.folder-tile {
  display: flex; flex-direction: column; gap: 3px; padding: 10px 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  text-decoration: none; color: inherit; min-width: 0;
  transition: border-color .15s ease, transform .15s ease;
}
.folder-tile:hover { border-color: var(--brass); }
.folder-tile:active { transform: scale(.985); }
.folder-tile:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.folder-shape { display: block; margin-bottom: 6px; }
.folder-tab { display: block; width: 44%; height: 8px; border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 5px 5px 0 0; background: var(--surface-dim); }
.folder-body {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 66px; border: 1px solid var(--line-strong); border-radius: 0 7px 7px 7px;
  background: linear-gradient(180deg, var(--surface-alt), var(--surface-dim));
}
.folder-tile.kind-deal .folder-body { height: 74px; background: linear-gradient(180deg, var(--surface), var(--surface-alt)); border-color: color-mix(in srgb, var(--brass) 45%, var(--line-strong)); }
.folder-tile.kind-deal .folder-tab { border-color: color-mix(in srgb, var(--brass) 45%, var(--line-strong)); background: color-mix(in srgb, var(--brass) 18%, var(--surface)); }
.folder-badge { width: 92px; height: 32px; object-fit: contain; }
.folder-badge.is-row { width: 44px; height: 24px; margin-top: 3px; }
.folder-count {
  position: absolute; right: 8px; bottom: 7px;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line-strong);
  font: 600 11px/20px var(--font-mono); color: var(--text-mute); text-align: center;
}
.folder-tile[data-count="0"] .folder-count { color: var(--text-ghost); }
.folder-name { font-weight: 600; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.folder-sub { font-size: 11.5px; color: var(--text-faint); line-height: 1.35; }

.folder-open { padding: 14px 15px 16px; }
.folder-open-head { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.folder-back { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--brass-deep); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.folder-back:hover { text-decoration: underline; }
.folder-open-title { display: flex; align-items: flex-start; gap: 10px; }
.folder-open-title .name { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 20px; color: var(--text); }
.folder-open-title .spec { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-top: 2px; }
.folder-add { margin-top: 12px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.folder-doc { flex-wrap: wrap; row-gap: 2px; }
.folder-doc .chip-missing { font-size: 9.5px; }
@media (max-width: 559px) {
  /* the name gets the full width; its actions sit on the line under it */
  .folder-doc .record-main { flex: 1 1 100%; }
}
.docs-fine { margin: 14px 0 0; font-size: 11.5px; color: var(--text-ghost); }

/* ---- the upload sheet ------------------------------------------------------- */
.upload-folders { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.upload-folder { min-height: 38px; padding: 7px 12px; border-radius: var(--radius-chip); }
.upload-actions { margin-top: 16px; }
.upload-status { margin: 12px 0 0; font-size: 13px; color: var(--text-body); min-height: 1em; }
.upload-status:empty { display: none; }
.upload-status.is-error { color: var(--warn); }

/* each tab's sections keep the page's rhythm (dash-wrap's 18px gap) */
.tab-panel { display: flex; flex-direction: column; gap: 18px; }
.tab-panel[hidden] { display: none; }
#dashboard-body { display: flex; flex-direction: column; gap: 18px; }
#dashboard-body:empty { display: none; }

/* ==========================================================================
   Round five (2026-10-15) — appended at the END, as rounds three and four did.
   ========================================================================== */

/* ---- the maker's mark sits free on the card (Adam, Leetal's call) ----------
   The photo rule above (.garage-media img: 100% × 100%, object-fit: cover)
   out-ranked .brand-badge's `contain` and cover-cropped the mark: the Genesis
   wordmark is 5:1 and its box was ~3:1, so the wings were cut off at both
   ends. The mark now sizes by HEIGHT and takes its own width from the
   artwork's aspect ratio — never cropped, never stretched, a little larger,
   capped so a wide mark still fits a phone. The artwork (the white fill
   inside the Genesis shield) is untouched. */
.garage-media:not(.has-photo) { height: auto; min-height: 96px; padding: 18px 16px; overflow: visible; }
/* (selectors carry .garage-card so they out-rank round three's fixed boxes).
   width AND height auto with two max caps: for an image CSS keeps the
   artwork's own ratio under both caps (CSS 2.1 §10.4), whichever binds. */
.garage-card .garage-media img.brand-badge,
.garage-card .garage-media img.brand-badge.is-strip,
.garage-card.is-hero .garage-media img.brand-badge.is-strip { object-fit: contain; width: auto; height: auto; max-width: 82%; max-height: 54px; }
.garage-card.is-hero .garage-media img.brand-badge.is-strip { max-height: 64px; }
.garage-card.is-hero .garage-media:not(.has-photo) { min-height: 124px; }
.garage-card .garage-media .brand-chip.is-strip { max-width: 86%; }
.garage-card .garage-media .brand-chip.is-strip img.brand-badge,
.garage-card.is-hero .garage-media .brand-chip.is-strip img.brand-badge { max-width: 100%; max-height: 34px; }
.garage-card img.brand-badge.is-row, .garage-card .brand-chip.is-row img.brand-badge { width: auto; height: auto; max-width: 64px; max-height: 24px; object-fit: contain; }
@media (min-width: 880px) {
  .garage-card.is-hero .garage-media:not(.has-photo) { min-height: 150px; }
  .garage-card.is-hero .garage-media img.brand-badge.is-strip { max-height: 76px; max-width: 60%; }
}

/* ---- the Dashboard as a dashboard (Adam, Leetal's call: "official, not a list") ----
   Widgets: a white card, a brass icon tile and a display-face title in the
   head. Phone first: one column; the quick actions 2 × 2; on a desktop the
   two lists and the lease cards sit side by side. Tokens only. */
#panel-dashboard { display: flex; flex-direction: column; gap: 14px; }
#panel-dashboard > div:empty { display: none; }
#dashboard-body { display: flex; flex-direction: column; gap: 14px; }
.widget {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 14px 15px 15px; box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 4%, transparent);
}
.widget-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-width: 0; }
section.module .widget-head h2 {
  margin: 0; flex: 1; min-width: 0;
  font-family: var(--font-display); font-weight: 500; font-size: 17px; letter-spacing: 0; text-transform: none; color: var(--text);
}
.widget-head .btn-link { font-size: 12.5px; white-space: nowrap; }
.widget-tag { white-space: nowrap; }
.widget-ico {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brass-deep); background: color-mix(in srgb, var(--brass) 13%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brass) 30%, transparent);
}
.widget .dash-list { padding: 0; }
.widget .dash-ico { width: 30px; height: 30px; color: var(--brass-deep); }
.widget .dash-ico svg { width: 16px; height: 16px; }

/* the lease at a glance: the one widget with weight */
.glance {
  padding: 16px 16px 14px;
  border-color: color-mix(in srgb, var(--brass) 50%, var(--line));
  background:
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--brass) 11%, transparent), transparent 65%),
    var(--surface);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 8%, transparent);
}
.glance-car { display: flex; align-items: center; gap: 12px; min-width: 0; }
.glance-badge { flex: none; width: auto; height: auto; max-height: 22px; max-width: 84px; object-fit: contain; align-self: flex-start; margin-top: 4px; }
.glance-name { min-width: 0; }
.glance-name .name { margin: 2px 0 0; font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.15; color: var(--text); }
.glance-name .spec { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--text-faint); margin-top: 2px; text-transform: uppercase; }
.glance-grid { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.glance-ring { position: relative; flex: none; width: 112px; height: 112px; }
.ring-svg { width: 100%; height: 100%; display: block; }
.ring-track { fill: none; stroke: var(--skeleton-hi); stroke-width: 9; }
.ring-done { fill: none; stroke: var(--brass); stroke-width: 9; stroke-linecap: round; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-n { font-family: var(--font-display); font-size: 32px; line-height: 1; color: var(--text); }
.ring-u { font-size: 11px; color: var(--text-mute); margin-top: 3px; }
.ring-of { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .06em; color: var(--text-faint); margin-top: 1px; text-transform: uppercase; }
.glance-facts { margin: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.glance-fact { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.fact-ico { flex: none; color: var(--brass-deep); margin-top: 1px; }
.fact-ico svg { width: 17px; height: 17px; display: block; }
.glance-fact dt { margin: 0; }
.glance-fact dd { margin: 1px 0 0; font-size: 14px; font-weight: 600; color: var(--text-body); overflow-wrap: anywhere; }
.fact-note { font-weight: 400; font-size: 12px; color: var(--text-mute); }
.glance-more { display: inline-block; margin-top: 13px; font-size: 13px; }
.glance-progress { margin-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.glance-sentence { margin: 0; font-size: 14px; color: var(--text-body); }

/* quick actions: four tiles, thumb-sized */
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.quick-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 92px; padding: 11px 12px 12px;
  background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-row);
  color: inherit; text-decoration: none; text-align: left; font: inherit; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.quick-tile:hover { border-color: color-mix(in srgb, var(--brass) 55%, var(--line)); background: color-mix(in srgb, var(--brass) 6%, var(--surface)); }
.quick-tile:focus-visible { outline: none; box-shadow: var(--focus-halo); }
.quick-tile[disabled] { cursor: default; opacity: .8; }
.quick-ico {
  width: 32px; height: 32px; border-radius: 50%; margin-bottom: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--on-brass); background: var(--brass);
}
.quick-ico svg { width: 17px; height: 17px; }
.quick-t { font-size: 13.5px; font-weight: 650; color: var(--text); line-height: 1.25; }
.quick-s { font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }

.dash-pair { display: grid; grid-template-columns: 1fr; gap: 14px; }

/* understand your lease */
.learn-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.learn-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); }
.learn-card summary {
  list-style: none; display: flex; align-items: center; gap: 11px; padding: 12px 13px; cursor: pointer; min-height: var(--tap-min);
}
.learn-card summary::-webkit-details-marker { display: none; }
.learn-card summary:focus-visible { outline: none; box-shadow: var(--focus-halo); border-radius: var(--radius-row); }
.learn-ico { flex: none; color: var(--brass-deep); display: inline-flex; }
.learn-t { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.learn-chev { flex: none; width: 8px; height: 8px; border-right: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint); transform: rotate(45deg); margin: -3px 4px 0 0; transition: transform .15s ease; }
.learn-card[open] .learn-chev { transform: rotate(225deg); margin-top: 3px; }
.learn-card p { margin: 0; padding: 0 14px 14px 44px; font-size: 13.5px; line-height: 1.55; color: var(--text-body); }
.learn-fine { margin: 10px 2px 0; font-size: 11.5px; line-height: 1.5; color: var(--text-faint); }

@media (min-width: 560px) {
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 880px) {
  .dash-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .learn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .glance-ring { width: 128px; height: 128px; }
  .ring-n { font-size: 36px; }
  .glance-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
  .glance-name .name { font-size: 26px; }
}
.dash-pair .widget-head h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.install-hint { margin: 0; font-size: 13px; color: var(--text-mute); }

/* ==========================================================================
   Round six (2026-10-15) — appended at the END, as rounds three to five did.
   ========================================================================== */

/* ---- folders: the CRM's DocumentFolderTile, phone-sized --------------------
   A tab, a body, and the first three files peeking out of it as real
   previews; they rise out of the folder when you point at it (staggered, so
   it reads as a stack of sheets). The name and a count badge sit under it,
   as in the CRM; the hint line stays (customers are not staff). */
.folder-body {
  align-items: flex-end; justify-content: flex-start; gap: 5px;
  height: 92px; padding: 8px 9px 0; overflow: hidden;
}
.folder-tile.kind-deal .folder-body { height: 100px; }
.folder-peek {
  position: relative; display: block; flex: 0 1 48px; min-width: 0;
  aspect-ratio: 48 / 66; margin-bottom: -8px;
  border: 1px solid var(--line); border-radius: 4px 4px 0 0; overflow: hidden;
  background: var(--surface); box-shadow: 0 1px 2px rgba(18, 19, 22, .08);
  transition: transform .2s ease;
}
.folder-tile:hover .folder-peek, .folder-tile:focus-visible .folder-peek { transform: translateY(-5px); }
@media (prefers-reduced-motion: reduce) { .folder-peek { transition: none; } .folder-tile:hover .folder-peek { transform: none; } }
.folder-empty { align-self: center; margin: 0 auto 28px; font: 500 10.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-ghost); }
.folder-label { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 2px; }
.folder-label .folder-name { flex: 1 1 auto; min-width: 0; }
.folder-label .folder-badge { width: 54px; height: 20px; flex: none; object-fit: contain; object-position: left center; }
.folder-count {
  position: static; flex: none; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--skeleton-hi); border: 0; font: 600 10.5px/20px var(--font-mono);
}
.folder-tile[data-count="0"] .folder-count { color: var(--text-ghost); }

/* ---- a preview: the CRM's LazyThumb (thumbs.js) ---------------------------- */
.thumb { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; background: var(--surface-alt); }
.thumb-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb-img.kind-pdf { object-fit: cover; object-position: top center; background: #fff; }
.thumb-glyph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.thumb-sheet { width: 34%; aspect-ratio: 3 / 4; border: 1.5px solid currentColor; border-radius: 2px 7px 2px 2px; opacity: .55; }
.thumb-badge { font: 600 9px/1 var(--font-mono); letter-spacing: .06em; border: 1px solid currentColor; border-radius: 3px; padding: 2px 4px; }
.thumb-glyph.kind-pdf { color: #A1452E; }
.thumb-glyph.kind-image { color: #1F5866; }
.thumb-glyph.kind-file { color: var(--text-faint); }
.folder-peek .thumb-badge { display: none; }
.folder-peek .thumb-sheet { width: 46%; }
.thumb[data-thumb-state="waiting"] .thumb-sheet { animation: thumb-wait 1.4s ease-in-out infinite; }
@keyframes thumb-wait { 50% { opacity: .2; } }

/* ---- inside a folder: a grid of preview tiles ------------------------------ */
.doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 12px; }
@media (min-width: 560px) { .doc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 880px) { .doc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .doc-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.doc-tile { position: relative; min-width: 0; }
.doc-tile-open {
  display: flex; flex-direction: column; width: 100%; padding: 7px 7px 9px; gap: 2px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); color: inherit; font: inherit; cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.doc-tile-open:hover { border-color: var(--brass); }
.doc-tile-open:active { transform: scale(.985); }
.doc-tile-open:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.doc-tile.is-current .doc-tile-open { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
.doc-tile-thumb { display: block; width: 100%; aspect-ratio: 4 / 5; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.doc-tile-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--text); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-tile-meta { font: 500 10px/1.3 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); }
.doc-tile .chip { position: absolute; top: 12px; left: 12px; font-size: 9.5px; }
.doc-tile .doc-tile-flag { top: auto; bottom: 62px; }
.chip-current { background: var(--green); color: #fff; border-color: var(--green); }
.doc-tile-more {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); color: var(--text-mute); cursor: pointer;
}
.doc-tile-more:hover { color: var(--text); border-color: var(--line-strong); }
.doc-tile-more:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.doc-actions { display: flex; flex-direction: column; gap: 8px; }
.doc-actions .btn { width: 100%; min-height: var(--tap-min); }
.btn.danger { color: var(--warn); }

/* ---- the viewer ------------------------------------------------------------- */
.modal.is-viewer { max-width: 960px; max-height: 92vh; }
.modal.is-viewer .modal-body { display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.viewer-meta { font: 500 10.5px/1.3 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.viewer-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 160px; padding: 10px; background: var(--surface-dim); border-radius: 8px; }
.viewer-page { display: block; width: 100%; max-width: 900px; height: auto; background: #fff; box-shadow: 0 1px 3px rgba(18, 19, 22, .15); }
.viewer-img { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; }
.viewer-note { margin: auto; font-size: 13px; color: var(--text-mute); text-align: center; }
.viewer-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- My Info ------------------------------------------------------------------ */
.avatar { cursor: pointer; padding: 0; font-family: inherit; }
button.avatar:hover { border-color: var(--brass); color: var(--text); }
button.avatar:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.account-me { display: flex; align-items: center; justify-content: center; min-height: var(--tap-min); text-decoration: none; margin: 4px 0 10px; }
#panel-me .tab-head { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
#panel-me .tab-title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 26px; color: var(--text); }
#me-body { display: flex; flex-direction: column; gap: 16px; }
.me-intro { margin: 0; font-size: 14px; color: var(--text-mute); }
.me-card { display: flex; flex-direction: column; }
.me-row { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--skeleton-hi); }
.me-card .widget-head + .me-row { border-top: 0; }
.me-label { grid-column: 1 / -1; }
.me-value { font-size: 15px; color: var(--text); overflow-wrap: anywhere; display: flex; flex-direction: column; }
.me-row[data-me="ssn"] .me-value { font-family: var(--font-mono); letter-spacing: .08em; }
.me-line { display: block; }
.me-none { color: var(--text-ghost); font-size: 13.5px; }
.me-edit { align-self: center; }
.me-tell { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding-top: 10px; border-top: 1px solid var(--skeleton-hi); font-size: 12.5px; color: var(--text-faint); }
.me-hint { margin: 0; font-size: 12.5px; color: var(--text-faint); }
.me-pending { margin: 8px 0 0; padding: 9px 11px; border-radius: 8px; background: color-mix(in srgb, var(--brass) 12%, var(--surface)); font-size: 13px; color: var(--text-body); }
.me-sub { margin-top: 14px; }
.me-email { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 9px 0; border-bottom: 1px solid var(--skeleton-hi); }
.me-email-addr { flex: 1 1 60%; min-width: 0; font-size: 14.5px; color: var(--text); overflow-wrap: anywhere; }
.me-email-label { font-size: 9.5px; }
.me-email-actions { display: flex; gap: 2px; margin-left: auto; }
.me-add { margin-top: 12px; align-self: flex-start; }
.me-form { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-top: 1px solid var(--skeleton-hi); }
.me-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.me-field-label { font-size: 12.5px; font-weight: 600; color: var(--text-body); }
.me-input {
  width: 100%; min-height: var(--tap-min); padding: 8px 11px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
}
textarea.me-input { min-height: 84px; resize: vertical; }
.me-input:focus { outline: 2px solid var(--brass); outline-offset: 0; border-color: var(--brass); }
.me-input[aria-invalid="true"] { border-color: var(--warn); }
.me-err { font-size: 12.5px; color: var(--warn); }
.me-err:empty { display: none; }
.me-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.me-form-actions { display: flex; gap: 8px; }
.me-form-actions .btn { min-height: var(--tap-min); padding: 0 18px; }
.me-checks { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.me-check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; }
.me-check input { width: 20px; height: 20px; accent-color: var(--brass); }

/* ---- Dashboard: info on file --------------------------------------------------- */
.info-facts { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 4px 0 0; }
@media (min-width: 560px) { .info-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 880px) { .info-facts { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.info-fact { min-width: 0; }
.info-fact dd { margin: 2px 0 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.info-fact:last-child dd { font-family: var(--font-mono); letter-spacing: .06em; }
