/* ==========================================================================
   Design tokens — shared with the workshop counter (apps/workshop-web).
   ========================================================================== */
:root {
  color-scheme: light;

  --bg: #e9eeeb;
  --surface: #ffffff;
  --surface-2: #f4f7f5;
  --surface-3: #eaf0ec;
  --ink: #13201a;
  --ink-2: #4a5852;
  --ink-3: #6a7770;
  --line: #e1e7e3;
  --line-strong: #c6d1cb;

  --brand: #0b6b47;
  --brand-strong: #07573a;
  --brand-deep: #053d29;
  --brand-soft: #e2f3e9;
  --brand-ink: #064a31;

  --warn: #8a4b00;
  --warn-soft: #fff1d6;
  --warn-line: #f3cf8c;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --danger-line: #f4b8b1;
  --ok: #0b6b47;
  --ok-soft: #e2f3e9;

  --plate: #111614;
  --plate-ink: #ffffff;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-1: 0 1px 2px rgb(16 32 24 / 6%), 0 1px 3px rgb(16 32 24 / 6%);
  --shadow-2: 0 6px 20px rgb(16 32 24 / 9%);
  --shadow-3: 0 18px 48px rgb(16 32 24 / 18%);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 26px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --tap: 44px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: var(--text-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: var(--text-lg); font-weight: 650; letter-spacing: -0.01em; line-height: 1.3; }
h3 { font-size: var(--text-md); font-weight: 650; line-height: 1.35; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
h2:focus, #estimate-result:focus, #notify-dialog h2:focus { outline: none; }
#quote-choose-title:focus-visible, #quote-review-title:focus-visible,
#quote-result-title:focus-visible, #estimate-result:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; }

.quiet { color: var(--ink-2); font-size: var(--text-sm); }
.hint, .disclaimer, .empty { color: var(--ink-2); font-size: var(--text-sm); line-height: 1.45; }
.empty {
  padding: var(--space-4);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: center;
}
.form-error { color: var(--danger); font-size: var(--text-sm); font-weight: 600; }
.form-error:empty { display: none; }

/* ==========================================================================
   Form controls
   ========================================================================== */
button, input, select, textarea { font: inherit; color: inherit; }

label, .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 var(--space-4);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 600;
}

input, select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input::placeholder { color: var(--ink-3); }
input:hover, select:hover { border-color: var(--ink-3); }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(11 107 71 / 18%); }

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-weight: 650;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease), box-shadow .15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
button:hover:not(:disabled) { background: var(--brand-strong); }
button:active:not(:disabled) { transform: scale(.98); }
button:disabled { opacity: .5; cursor: default; }

button.secondary {
  width: auto;
  background: var(--surface);
  color: var(--brand-ink);
  border-color: var(--line-strong);
}
button.secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-3); }

.text-nav {
  width: auto;
  min-height: var(--tap);
  padding: 0;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--brand-ink);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}
button.text-nav:hover:not(:disabled) { background: none; color: var(--brand); }

.dashed-button {
  width: 100%;
  background: transparent;
  color: var(--brand-ink);
  border: 1.5px dashed var(--line-strong);
}
button.dashed-button:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand); }

.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.form-actions > button:first-child { flex: 1 1 160px; }

/* ==========================================================================
   Pills and plates
   ========================================================================== */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-neutral { background: var(--surface-3); color: var(--ink-2); }

.plate {
  display: inline-block;
  width: fit-content;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--plate);
  color: var(--plate-ink);
  box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 18%);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .08em;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}
.plate-lg { padding: 6px 14px; font-size: 26px; border-radius: 8px; }

/* ==========================================================================
   Environment strip and status banner
   ========================================================================== */
.env-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 12px;
  padding: 4px 16px;
  background: var(--brand-deep);
  color: rgb(255 255 255 / 86%);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}
.milestone, .env-note { margin: 0; }
.env-note { font-weight: 600; color: #fff; }
.stamp { display: none; }

.status {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 10px 16px 10px 14px;
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: var(--text-sm);
  font-weight: 600;
}
.status:empty { display: none; }

/* ==========================================================================
   Sign-in gate
   ========================================================================== */
.gate {
  width: min(440px, calc(100% - 24px));
  margin: var(--space-8) auto var(--space-6);
  padding: var(--space-8) var(--space-6) var(--space-6);
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
  animation: rise .3s var(--ease) both;
}
.gate-head { margin-bottom: var(--space-6); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  margin-bottom: var(--space-4);
  border-radius: 16px;
  background: linear-gradient(140deg, var(--brand), var(--brand-deep));
  color: #fff;
  box-shadow: 0 8px 20px rgb(11 107 71 / 28%);
}
.brand-mark svg { width: 30px; height: 30px; }
.kicker {
  color: var(--brand);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gate h1 { margin: 4px 0 var(--space-2); }
.lede { color: var(--ink-2); }

.gate-steps {
  display: flex;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.gate-steps li, .stepper li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  color: var(--ink-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  counter-increment: step;
}
.gate-steps li::before, .stepper li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12px;
  letter-spacing: 0;
}
.gate-steps li.is-current, .stepper li.is-current { color: var(--brand-ink); }
.gate-steps li.is-current::before, .stepper li.is-current::before { background: var(--brand); color: #fff; }
.gate-steps li.is-done::before, .stepper li.is-done::before { content: "✓"; background: var(--brand-soft); color: var(--brand); }

.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); }
.field-row:has(> .field[hidden]) { grid-template-columns: minmax(0, 1fr); }
.field-compact input { min-height: 44px; font-size: 15px; }

.code-row {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  animation: rise .25s var(--ease) both;
}
.code-row input { font-size: 22px; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.dev-code {
  margin: 0 0 var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: var(--text-sm);
  font-weight: 650;
}
.dev-code:empty { display: none; }

.gate-note {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-5);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: var(--text-sm);
}
.gate-note svg { flex: none; width: 20px; height: 20px; color: var(--brand); }

/* ==========================================================================
   App shell
   ========================================================================== */
body.bay-open {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
body.bay-open .env-strip, body.bay-open #status { flex: none; }

.bay {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: min(480px, 100%);
  min-height: 0;
  margin: var(--space-3) auto var(--space-4);
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 28px;
  box-shadow: var(--shadow-3);
}

.bay-top {
  position: relative;
  z-index: 5;
  flex: none;
  padding: var(--space-4) var(--space-4) var(--space-4);
  padding-top: max(var(--space-4), env(safe-area-inset-top));
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
}
.bay-heading { display: flex; align-items: center; gap: var(--space-2); min-height: var(--tap); }
.bay-titles { flex: 1 1 auto; min-width: 0; }
.bay-kicker {
  overflow: hidden;
  color: rgb(255 255 255 / 78%);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: .06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.bay h1 { color: #fff; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }

.icon-button {
  flex: none;
  width: var(--tap);
  min-height: var(--tap);
  padding: 0;
  margin-left: -6px;
  background: transparent;
  border-radius: 50%;
  color: #fff;
}
.icon-button svg { width: 24px; height: 24px; }
button.icon-button:hover:not(:disabled) { background: rgb(255 255 255 / 14%); }
.bay-top :focus-visible { outline-color: #fff; }
#account-panel :focus-visible { outline-color: var(--brand); }

.account { position: relative; flex: none; }
.account-button {
  width: auto;
  min-height: var(--tap);
  padding: 6px 14px 6px 10px;
  background: rgb(255 255 255 / 14%);
  border-color: rgb(255 255 255 / 22%);
  color: #fff;
  font-size: var(--text-sm);
}
.account-button svg { width: 20px; height: 20px; }
button.account-button:hover:not(:disabled), .account-button[aria-expanded="true"] { background: rgb(255 255 255 / 24%); }

#account-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 10;
  width: min(320px, calc(100vw - 32px));
  max-height: 70dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--space-5);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  animation: fade .16s var(--ease) both;
}
.account-who {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
  font-weight: 650;
  overflow-wrap: anywhere;
}
#account-panel #sign-out { width: 100%; margin-top: var(--space-4); }

.notify-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-3);
  row-gap: 6px;
  align-items: center;
}
.notify-copy { grid-column: 1; grid-row: 1; min-width: 0; }
.notify-title { color: var(--ink); font-weight: 650; }
#notify-support { margin-top: 2px; color: var(--ink-2); font-size: var(--text-sm); line-height: 1.4; overflow-wrap: anywhere; }
.notify-switch {
  grid-column: 2;
  grid-row: 1;
  width: var(--tap);
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
}
button.notify-switch:hover:not(:disabled) { background: transparent; }
.switch-track {
  position: relative;
  display: block;
  width: 44px; height: 26px;
  border-radius: var(--radius-pill);
  background: var(--line-strong);
  transition: background-color .18s var(--ease);
}
.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(16 32 24 / 30%);
  transition: transform .18s var(--ease);
}
.notify-switch[aria-checked="true"] .switch-track { background: var(--brand); }
.notify-switch[aria-checked="true"] .switch-thumb { transform: translateX(18px); }
#notify-status, #notify-guidance, #notify-retry { grid-column: 1 / -1; }
#notify-status { color: var(--ink-2); font-size: var(--text-sm); font-weight: 650; overflow-wrap: anywhere; }
#notify-status[data-state="on"] { color: var(--brand-ink); }
#notify-status[data-state="blocked"], #notify-status[data-state="failed"] { color: var(--danger); }

.bay-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-4) var(--space-4) var(--space-6);
  scroll-padding-top: var(--space-4);
}

.view:not([hidden]) { display: grid; gap: var(--space-4); animation: rise .22s var(--ease) both; }
.view > * { min-width: 0; }

.panel {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.panel > h2 { margin-bottom: var(--space-3); }
.panel > .hint { margin: 0 0 var(--space-3); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.home-section { display: grid; }

/* Bottom bar */
.review-bar {
  position: relative;
  z-index: 3;
  flex: none;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgb(16 32 24 / 6%);
  animation: fade .2s var(--ease) both;
}
.review-bar button { min-height: 50px; white-space: normal; }
.review-bar button:disabled { background: var(--surface-3); color: var(--ink-2); opacity: 1; }

.bay-nav {
  position: relative;
  z-index: 3;
  display: grid;
  flex: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 6px 6px max(6px, env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.bay-nav button {
  flex-direction: column;
  gap: 2px;
  min-height: 58px;
  padding: 4px 2px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-md);
  color: var(--ink-2);
  font-size: var(--text-xs);
  font-weight: 600;
}
.bay-nav svg {
  width: 56px; height: 30px;
  padding: 4px 16px;
  border-radius: var(--radius-pill);
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.bay-nav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.bay-nav-item:hover:not(:disabled), .bay-nav button:hover:not(:disabled) { background: transparent; color: var(--ink); }
.bay-nav button[aria-current="page"] { color: var(--brand-ink); font-weight: 700; }
.bay-nav button[aria-current="page"] svg { background: var(--brand-soft); color: var(--brand); }

/* ==========================================================================
   Home
   ========================================================================== */
.greeting { display: grid; gap: 4px; }
.greeting-kicker { color: var(--ink-2); font-size: var(--text-sm); }
.who { font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; overflow-wrap: anywhere; }
#link-state:not(:empty) {
  width: fit-content;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.home-next .section-head { margin-bottom: var(--space-2); }
#home-next { display: grid; gap: var(--space-3); }
.home-next-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.home-next-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
}
.home-next-card[data-tone="warn"]::before { background: #e3a008; }
.home-next-card[data-tone="danger"]::before { background: var(--danger); }
.home-next-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.home-next-due { font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.home-next-when { color: var(--ink-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.home-next-open { justify-self: start; min-height: 40px; font-size: var(--text-sm); }

.home-quote {
  justify-content: flex-start;
  gap: var(--space-3);
  min-height: 0;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  box-shadow: 0 10px 24px rgb(11 107 71 / 24%);
  text-align: left;
}
.home-quote-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgb(255 255 255 / 16%);
}
.home-quote-icon svg { width: 24px; height: 24px; }
.home-quote-copy { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.home-quote-copy span { font-size: var(--text-lg); font-weight: 700; }
.home-quote-copy strong { color: rgb(255 255 255 / 86%); font-size: var(--text-sm); font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.home-quote .chevron { flex: none; width: 22px; height: 22px; opacity: .8; }
button.home-quote:hover:not(:disabled) { background: linear-gradient(135deg, var(--brand-strong) 0%, var(--brand-deep) 100%); }

.home-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.home-link {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  min-height: 104px;
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  color: var(--ink);
  text-align: left;
}
button.home-link:hover:not(:disabled) { background: var(--surface); border-color: var(--brand); }
.home-link svg {
  width: 34px; height: 34px;
  margin-bottom: 4px;
  padding: 6px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}
.home-link span { color: var(--ink-2); font-size: var(--text-xs); font-weight: 600; line-height: 1.3; }
.home-link strong { font-size: var(--text-sm); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }

.offer {
  display: grid;
  gap: 4px;
  margin-bottom: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.offer:last-child { margin-bottom: 0; }
.offer-tag { color: var(--warn); font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.offer h3 { font-size: var(--text-lg); }
.offer-price {
  width: fit-content;
  margin: 2px 0;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.offer-desc { color: var(--ink); font-size: var(--text-sm); }
.offer-dates, .offer-items { color: var(--ink-2); font-size: var(--text-xs); overflow-wrap: anywhere; }
.offer img { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; }

.contact-card {
  display: grid;
  gap: 6px;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow-wrap: anywhere;
}
.contact-name { font-weight: 700; }
.contact-address { color: var(--ink-2); font-size: var(--text-sm); white-space: pre-line; }
.contact-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  margin-top: var(--space-2);
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--brand-ink);
  font-weight: 650;
  text-decoration: none;
  transition: background-color .15s var(--ease);
}
.contact-call:hover { background: var(--brand-soft); }
.contact-call svg { width: 20px; height: 20px; }

.notify-invite {
  padding: var(--space-4);
  background: var(--brand-soft);
  border: 1px solid #bfe2cd;
  border-radius: var(--radius-lg);
  color: var(--brand-ink);
}
.notify-invite-head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.notify-invite-head svg { flex: none; width: 24px; height: 24px; color: var(--brand); }
.notify-invite h2 { color: var(--brand-ink); font-size: var(--text-md); }
.notify-invite p { margin-top: 6px; color: var(--brand-ink); font-size: var(--text-sm); }
.notify-invite-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.notify-invite-actions button { flex: 1 1 140px; width: auto; }

/* ==========================================================================
   Motorcycles
   ========================================================================== */
#vehicles { display: grid; gap: var(--space-3); }
#vehicles:empty { display: none; }
.motorcycle-card {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: var(--space-4) 44px var(--space-4) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  color: var(--ink);
  text-align: left;
}
button.motorcycle-card:hover:not(:disabled) { background: var(--surface); border-color: var(--brand); box-shadow: var(--shadow-2); }
.motorcycle-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; overflow-wrap: anywhere; }
.motorcycle-identity strong {
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--plate);
  color: var(--plate-ink);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.motorcycle-model { color: var(--ink-2); font-size: var(--text-sm); font-weight: 600; }
.motorcycle-mileage { color: var(--ink-2); font-size: var(--text-sm); font-weight: 400; }
.motorcycle-due {
  justify-self: stretch;
  margin-top: 4px;
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
  font-size: var(--text-md);
  font-weight: 700;
}
.motorcycle-estimate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--ink-2); font-size: var(--text-sm); font-weight: 400; }
.motorcycle-arrow { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); color: var(--ink-3); font-size: 28px; line-height: 1; }

.motorcycle-hero {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, #1d2a24 0%, #0b1310 100%);
  color: rgb(255 255 255 / 88%);
}
.motorcycle-hero .plate { box-shadow: inset 0 0 0 2px rgb(255 255 255 / 70%); }
#motorcycle-facts { display: grid; gap: 4px; }
#motorcycle-facts p { font-size: var(--text-sm); }
#motorcycle-facts p:first-child:not(.hint):not(.empty) { color: #fff; font-size: var(--text-md); font-weight: 650; }
#motorcycle-facts .hint { color: rgb(255 255 255 / 72%); }
#motorcycle-facts .empty { background: transparent; border-color: rgb(255 255 255 / 25%); color: rgb(255 255 255 / 80%); }
#motorcycle-facts details { margin-top: var(--space-2); font-size: var(--text-sm); }
#motorcycle-facts summary { cursor: pointer; padding: 6px 0; color: #fff; font-weight: 600; }

#motorcycle-next { display: grid; gap: 4px; }
.service-target { color: var(--brand-ink); font-size: 30px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

#add-motorcycle { margin-top: calc(var(--space-1) * -1); }

/* ==========================================================================
   Service history and vouchers
   ========================================================================== */
#history, #motorcycle-history { display: grid; gap: var(--space-3); }
#history > p:not(.empty) { color: var(--ink-2); font-size: var(--text-sm); font-weight: 600; }
.visit {
  display: grid;
  gap: 4px;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.visit-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.visit-total { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.visit-meta { color: var(--ink-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.visit-doc { font-weight: 600; color: var(--ink); }
.visit ul { margin: 6px 0 0; padding: var(--space-2) 0 0 18px; border-top: 1px solid var(--line); font-size: var(--text-sm); }
.visit li { margin: 2px 0; overflow-wrap: anywhere; }
#motorcycle-history .visit { padding: var(--space-3) 0; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
#motorcycle-history .visit:first-child { border-top: 0; padding-top: 0; }

.points-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 140% at 100% 0%, rgb(255 255 255 / 14%) 0%, transparent 55%),
    linear-gradient(150deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgb(11 107 71 / 26%);
}
.balance { display: grid; gap: 2px; }
.balance-label { color: rgb(255 255 255 / 80%); font-size: var(--text-sm); font-weight: 600; }
.balance-value { font-size: 40px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.points-progress { height: 8px; margin: var(--space-2) 0 2px; border-radius: var(--radius-pill); background: rgb(255 255 255 / 22%); overflow: hidden; }
.points-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: #fff; transition: width .5s var(--ease); }
#conversion { color: rgb(255 255 255 / 88%); font-size: var(--text-sm); }
#convert { margin-top: var(--space-2); background: #fff; color: var(--brand-ink); }
button#convert:hover:not(:disabled) { background: var(--brand-soft); }
.points-note { color: rgb(255 255 255 / 76%); font-size: var(--text-xs); text-align: center; }
.points-card :focus-visible { outline-color: #fff; }

#vouchers { display: grid; gap: var(--space-2); }
.voucher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
}
.voucher[data-status="redeemed"] { border-left-color: var(--line-strong); }
.voucher[data-status="redeemed"] h3 { color: var(--ink-2); }
.voucher p:not(.pill) { grid-column: 1 / -1; color: var(--ink-2); font-size: var(--text-sm); }

/* ==========================================================================
   Quotations
   ========================================================================== */
.quote-hub-head {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.quote-hub-head > p:first-child { color: var(--ink-2); }
#quote-landing { display: grid; gap: var(--space-4); }
.quote-saved-head { margin: var(--space-2) 0 0; }
#quotes { display: grid; gap: var(--space-2); }

.stepper { display: flex; gap: var(--space-2); margin: 0 0 var(--space-3); padding: 0; list-style: none; counter-reset: step; }
.quote-step-kicker {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}
#quote-choose-title, #quote-review-title { margin: 0 0 var(--space-3); font-size: var(--text-xl); }
#quote-vehicle, #quote-review-vehicle { margin-bottom: var(--space-3); }
#quote-vehicle:empty, #quote-review-vehicle:empty { display: none; }
#quote-vehicle .hint { margin-bottom: var(--space-2); }

.search {
  position: sticky;
  top: 0;
  z-index: 2;
  display: block;
  margin: 0 calc(var(--space-4) * -1) var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--surface-2);
}
.search svg { position: absolute; left: calc(var(--space-4) + 14px); top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 44px; border-radius: var(--radius-pill); }

#quote-items { display: grid; gap: var(--space-2); }
.item-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.item-card:has(.quote-add[aria-pressed="true"]) { border-color: var(--brand); background: #f3faf6; box-shadow: inset 0 0 0 1px var(--brand); }
.thumb, .thumb-img { width: 48px; height: 48px; border-radius: 12px; }
.thumb { display: grid; place-items: center; }
.thumb svg { width: 30px; height: 30px; }
.thumb-img { display: block; object-fit: cover; background: var(--brand-soft); }
.item-copy, .quote-line-copy { min-width: 0; overflow-wrap: anywhere; }
.item-name { display: block; font-weight: 650; line-height: 1.35; }
.item-desc, .item-meta { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--text-sm); line-height: 1.4; }
.promo-chip {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--text-xs);
  font-weight: 700;
}
.item-card .quote-add {
  min-width: 76px;
  min-height: var(--tap);
  padding: 8px 14px;
  font-size: var(--text-sm);
}
.quote-add[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.quote-add[aria-pressed="true"]::before { content: "✓"; font-weight: 800; }
button.quote-add[aria-pressed="true"]:hover:not(:disabled) { background: var(--brand-strong); }

#quote-form { display: grid; }
.selection-list { display: grid; gap: var(--space-2); margin: 0 0 var(--space-2); padding: 0; list-style: none; }
.selection-list .empty { list-style: none; }
.quote-line {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.quote-line-copy { flex: 1 1 auto; }
.quote-line .secondary { flex: none; min-height: 40px; padding: 6px 14px; font-size: var(--text-sm); }
#add-more-items { justify-self: start; margin-bottom: var(--space-3); }
#quote-form .disclaimer {
  margin: 0 0 var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
}
#estimate-result { margin-top: var(--space-3); }

.quote-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "plate total"
    "items items"
    "footer footer";
  align-items: center;
  gap: 6px var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.quote-row:hover { border-color: var(--brand); box-shadow: var(--shadow-2); }
.quote-row.expired { background: var(--surface-2); }
.quote-row.expired .quote-row-total { color: var(--ink-2); }
.quote-row-plate { grid-area: plate; justify-self: start; font-size: 13px; }
.quote-row-total { grid-area: total; justify-self: end; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
.quote-row-summary { grid-area: items; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.quote-row-footer { grid-area: footer; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); min-width: 0; }
.quote-row-meta { flex: 1 1 170px; min-width: 0; color: var(--ink-2); font-size: var(--text-xs); line-height: 1.45; }
.quote-row-meta span { display: block; white-space: nowrap; }
.quote-open { flex: none; min-height: 40px; margin-left: auto; padding: 6px 14px; font-size: var(--text-sm); }
@media (max-width: 360px) {
  .quote-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "plate" "total" "items" "footer"; }
  .quote-row-total { justify-self: start; text-align: left; }
}

.quote-detail {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.quote-detail .total {
  display: grid;
  gap: 2px;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--brand-soft);
}
.quote-detail .total-label { color: var(--brand-ink); font-size: var(--text-sm); font-weight: 650; }
.quote-detail .total-amount { color: var(--brand-ink); font-size: 34px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.quote-detail .plate { justify-self: start; }
.quote-detail-meta { color: var(--ink-2); font-size: var(--text-sm); }
.quote-included-label { margin-bottom: -8px; color: var(--ink-3); font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.quote-included { margin: 0; padding-left: 20px; }
.quote-included li { margin: 2px 0; }
.quote-note { overflow-wrap: anywhere; }
.quote-detail .disclaimer { padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface-3); }
#quote-result-title { font-size: var(--text-xl); }
.quote-result-actions { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.quote-result-actions .secondary { width: 100%; }

/* ==========================================================================
   Dialog
   ========================================================================== */
#notify-dialog {
  width: min(400px, calc(100% - 32px));
  padding: var(--space-6);
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-3);
  text-align: center;
}
#notify-dialog[open] { animation: pop .2s var(--ease) both; }
#notify-dialog::backdrop { background: rgb(10 20 15 / 50%); backdrop-filter: blur(2px); }
.dialog-icon {
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  margin: 0 auto var(--space-4);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
}
.dialog-icon svg { width: 30px; height: 30px; }
#notify-dialog h2 { font-size: var(--text-xl); }
#notify-dialog p { margin-top: var(--space-2); color: var(--ink-2); }
#notify-dialog .form-error { color: var(--danger); }
.dialog-actions { display: grid; gap: var(--space-2); margin-top: var(--space-5); }
.dialog-actions .secondary { width: 100%; }

/* ==========================================================================
   Motion
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 640px) {
  .gate { margin: var(--space-4) auto; padding: var(--space-6) var(--space-5) var(--space-5); border-radius: var(--radius-lg); }
  .bay { width: 100%; margin: 0; border-radius: 0; box-shadow: none; }
  .status { width: 100%; }
}

@media (max-width: 380px) {
  .home-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-links .home-link:last-child { grid-column: 1 / -1; min-height: 0; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .notify-invite-actions { flex-direction: column; }
  .notify-invite-actions button { width: 100%; flex-basis: auto; }
}
