/* CONFIG PLACEHOLDER — brand palette + skin tokens. A client build
   drops its brand colors into these variables (the config seam owns
   them); the tile/bg values below are a neutral default theme, not any
   client's brand. The skin tokens (--radius, --radius-sm, --shadow,
   --font) after them carry matching stock values as the pre-boot
   fallback — app.js re-applies every one from client-config.js at boot.
   The --tier-* colors further down are functional signals, not brand. */
:root {
  --tile: #437D8D;
  --tile-2: #57808B;
  --tile-dark: #2E5561;
  --bg: #1C2B30;
  --text: #FFFFFF;
  --accent: #F5A623; /* amber: qualified-plan markers, blocked/needs-attention */
  --radius: 14px;    /* skin token: main-surface corner radius */
  --radius-sm: 10px; /* skin token: inner-control corner radius */
  --shadow: none;    /* skin token: card shading depth — flat by default */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; /* skin token */
  --flag: #4EA72E;   /* green: items highlighted on the price sheet — never amber */
  --tier-12: #4EA72E;   /* green: price still holds the 12% tier */
  --tier-10: #F5D033;   /* yellow: price holds the 10% tier */
  --tier-5:  #E5484D;   /* red: price is down to the 5% tier */
  --tier-flat: #000000; /* black: below 5% — flat $250 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Screens, panels and the modal are display:flex/grid, which beats the UA's
   [hidden] rule — without this, hiding them by attribute does nothing. */
[hidden] { display: none !important; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 10px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.label-sub {
  text-transform: none;
  font-weight: 400;
  opacity: 0.8;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
  opacity: 0.9;
}

/* ---- Screens ---- */
/* Each screen reproduces main's column layout so the pricing sections keep
   the exact spacing they had before they were wrapped. */
.screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.screen-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.screen-tabs button {
  min-height: 56px;
  border: none;
  border-radius: var(--radius);
  background: var(--tile-dark);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.screen-tabs button.active {
  background: var(--tile);
  outline: 2px solid var(--accent);
}

/* ---- Price inputs ---- */
.input-section {
  background: var(--tile-dark);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.input-section input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 34px;
  font-weight: 800;
  text-align: center;
  min-height: 56px;
}

.input-section input::placeholder { color: rgba(255,255,255,0.4); }

/* $ prefix on List Price / Proposed / Target Pmt — the input keeps text-align:
   center for its own value; the prefix just sits fixed-width to its left. */
.money-input {
  display: flex;
  align-items: center;
  gap: 2px;
}

.money-input .dollar-prefix {
  flex: none;
  font-size: 28px;
  font-weight: 800;
  opacity: 0.7;
}

.money-input input { flex: 1 1 auto; min-width: 0; }

/* Proposed price sits beside the payment-to-price solver; two 34px inputs will
   not fit an iPhone side by side, so this row runs a size down. */
.price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.price-row .input-section input { font-size: 26px; min-height: 48px; }
.price-row .money-input .dollar-prefix { font-size: 22px; }

.solved-price {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding-bottom: 4px;
  color: var(--accent);
}

/* ---- Cards ---- */
.headline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card {
  background: var(--tile);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.big {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.small {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}

/* ---- Drop table ---- */
.drop-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--tile-dark);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 15px;
}

.drop-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 6px;
  background: rgba(0,0,0,0.25);
  text-align: right;
}

.drop-table th:first-child { text-align: left; }

.drop-table td {
  padding: 10px 6px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.drop-table td:first-child {
  text-align: left;
  font-weight: 700;
  /* Always reserve the stripe so tier color never shifts the layout. */
  border-left: 4px solid transparent;
}

/* Which commission tier this row's price falls in. */
.drop-table tr.tier-t12 td:first-child { border-left-color: var(--tier-12); }
.drop-table tr.tier-t10 td:first-child { border-left-color: var(--tier-10); }
.drop-table tr.tier-t5 td:first-child { border-left-color: var(--tier-5); }
.drop-table tr.tier-flat td:first-child { border-left-color: var(--tier-flat); }

/* ---- Lender toggle + plan select ---- */
.plan-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lender-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lender-toggle button {
  min-height: 56px;
  border: none;
  border-radius: var(--radius);
  background: var(--tile-dark);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.lender-toggle button.active {
  background: var(--tile);
  outline: 2px solid var(--accent);
}

/* iOS Safari ignores CSS on <option>, so mark a qualified selection on the
   select itself: amber text whenever the chosen plan qualifies. */
#plan-select.qualified { color: var(--accent); }

#plan-select {
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: var(--radius);
  background: var(--tile-2);
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  padding: 0 14px;
  appearance: none;
  -webkit-appearance: none;
}

/* ---- Effect cards ---- */
.effect-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}

.effect-card {
  align-items: flex-start;
  text-align: left;
}

.effect-lines {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.effect-lines .hl { color: var(--accent); }

/* ---- Tiles / steppers ---- */
.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tile {
  background: var(--tile);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 84px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.tile .label { font-size: 12px; }

.tile.stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  grid-template-rows: auto 1fr;
  align-items: center;
}

.tile.stepper .label {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.tile.stepper output {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile.stepper output input {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: none;
  border-radius: 8px;
  outline: 2px solid var(--accent);
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  min-height: 48px;
}

.tile.stepper .minus,
.tile.stepper .plus {
  min-height: 56px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--tile-dark);
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
}

.tile.stepper .minus:active,
.tile.stepper .plus:active { background: var(--tile-2); }

/* ---- Quick grid ---- */
.quick-grid .tile { background: var(--tile-2); outline: 2px solid transparent; }

/* Which commission tier this tile's price holds. */
.quick-grid .tile.tier-t12 { outline-color: var(--tier-12); }
.quick-grid .tile.tier-t10 { outline-color: var(--tier-10); }
.quick-grid .tile.tier-t5 { outline-color: var(--tier-5); }
.quick-grid .tile.tier-flat { outline-color: var(--tier-flat); }

.quick-grid .tile .small {
  font-size: 12px;
  opacity: 0.9;
}

/* ---- Reset ---- */
.reset-btn {
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: var(--radius);
  background: var(--tile-dark);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.reset-btn:disabled { opacity: 0.4; }

/* ==================== Quote screen ==================== */

/* ---- Collapsible headers (groups + saved jobs) ---- */
.panel-toggle,
.group-header {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--tile-dark);
  color: var(--text);
  text-align: left;
}

.panel-toggle .section-title,
.group-header .group-name { margin-bottom: 0; }

.group-header .group-name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.group-count {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.group-chev {
  display: inline-block;
  margin-left: auto;
  font-size: 22px;
  font-weight: 800;
  opacity: 0.7;
  transition: transform 0.12s ease-out;
}

.group-header .group-chev { margin-left: 0; }

[aria-expanded="true"] > .group-chev { transform: rotate(90deg); }

/* ---- Sections > subsections > items ---- */
.quote-section { margin-bottom: 10px; }

/* The section band outranks its subsections visually so the two accordion
   levels never read as one flat list. */
.section-header {
  background: var(--tile);
  min-height: 60px;
}

.section-header .group-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.section-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 0 10px;      /* indent marks the nesting */
  border-left: 2px solid rgba(255,255,255,0.12);
  margin-left: 6px;
}

.quote-group { margin-bottom: 0; }

.group-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

.quote-item {
  background: var(--tile);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 8px;
  /* Always reserve the stripe so flagging an item never shifts the layout. */
  border-left: 5px solid transparent;
}

/* Green-highlighted on the price sheet. Amber is taken — it means blocked. */
.quote-item.flagged { border-left-color: var(--flag); }

.qi-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.qi-price {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.75;
  white-space: nowrap;
}

.qi-note {
  grid-column: 1;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--accent);
}

.qi-details {
  grid-column: 1 / -1;
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.8;
}

.qi-stepper {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: grid;
  grid-template-columns: 48px 46px 48px;
  align-items: center;
}

.qi-stepper button {
  min-height: 56px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--tile-dark);
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
}

.qi-stepper button:active { background: var(--tile-2); }

.qi-stepper output {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.qi-stepper output input {
  width: 100%;
  min-height: 48px;
  background: rgba(0,0,0,0.25);
  border: none;
  border-radius: 8px;
  outline: 2px solid var(--accent);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.quote-item.selected { outline: 2px solid var(--accent); }

.quote-item.blocked { opacity: 0.5; }
.quote-item.blocked .qi-stepper { pointer-events: none; }

/* ---- Bundle inclusion checklist ---- */
.qi-inclusions {
  grid-column: 1 / -1;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.qi-inclusions label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.qi-inclusions input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

/* ---- Cascade-removal notice ---- */
.quote-notice {
  background: var(--tile-dark);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent);
}

/* ---- Total bar ---- */
/* Trailing room so an opened subsection can always scroll flush to the top,
   even when it's short and near the end of the list. */
#quote-groups { padding-bottom: 75vh; }

.quote-total-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: var(--tile-dark);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -6px 16px rgba(0,0,0,0.35);
}

.qt-figure { text-align: left; }
.qt-figure .big { font-size: 26px; }

/* ---- Saved jobs ---- */
.jobs-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

#job-name {
  width: 100%;
  min-height: 56px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--tile-2);
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}

#job-name::placeholder { color: rgba(255,255,255,0.5); }

.jobs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-row {
  background: var(--tile);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.job-meta { min-width: 0; }

.job-name {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-date { font-size: 12px; font-weight: 600; opacity: 0.75; }

.job-row button {
  min-height: 56px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--tile-dark);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.jobs-empty { font-size: 13px; font-weight: 600; opacity: 0.7; }

/* Destructive actions read differently from the teal buttons around them, but
   stay inside the collapsed panel so colour is the second line of defence. */
.reset-btn.danger {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.reset-btn.danger:disabled { opacity: 0.35; }

/* ---- Export & backup ---- */
.restore-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 4px;
}

#restore-input {
  width: 100%;
  min-height: 56px;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--tile-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

/* The file button is the tap target, so it gets the 56px, not the input box. */
#restore-input::-webkit-file-upload-button {
  min-height: 44px;
  margin-right: 12px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--tile-dark);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.export-status {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--tile);
}

.export-status.error { color: var(--accent); }

/* ---- Scope modal ---- */
.scope-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  /* Fully opaque on purpose: at 95% the pricing screen's dollar figures read
     straight through the sheet the customer is being shown. */
  background: var(--bg);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 10px;
}

.scope-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--tile-dark);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scope-sheet h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scope-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scope-item {
  background: var(--tile);
  border-radius: var(--radius);
  padding: 10px 12px;
  border-left: 5px solid transparent;
}

.scope-item.flagged { border-left-color: var(--flag); }

.scope-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.scope-qty { font-weight: 800; opacity: 0.85; }

.scope-bullets {
  margin: 6px 0 0;
  padding-left: 20px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0.9;
}

/* ---- Calculator ---- */
/* Fixed to the right edge, ~1/3 down the viewport. Sits below the (opaque,
   full-screen) scope modal so it's never visible over the customer view. */
.calc-toggle {
  position: fixed;
  right: 0;
  top: 33vh;
  z-index: 5;
  min-width: 32px;
  min-height: 56px;
  border: none;
  border-radius: 10px 0 0 10px;
  background: var(--tile);
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  box-shadow: -2px 2px 8px rgba(0,0,0,0.35);
}

/* Sits BELOW the toggle, never over it — the toggle must stay reachable to
   close the panel again (it was getting covered before, with no way back). */
.calc-panel {
  position: fixed;
  right: 0;
  top: calc(33vh + 60px);
  z-index: 5;
  width: 240px;
  max-width: calc(100vw - 40px);
  background: var(--tile-dark);
  border-radius: 14px 0 0 14px;
  padding: 10px;
  box-shadow: -2px 2px 12px rgba(0,0,0,0.45);
}

/* Full width on phones (this app's own phone breakpoint — main content caps
   at 480px too); iPad and larger keep the narrow floating panel. */
@media (max-width: 480px) {
  .calc-panel {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    border-radius: var(--radius);
  }
}

.calc-topline {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-bottom: 8px;
}

.calc-display {
  flex: 1 1 auto;
  min-width: 0;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: right;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-x: auto;
  white-space: nowrap;
}

.calc-close {
  flex: none;
  min-width: 40px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--tile);
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.calc-key {
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--tile);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.calc-key.op { background: var(--accent); color: var(--bg); }
.calc-key.wide { grid-column: span 2; }
.calc-key:active { filter: brightness(1.15); }

/* ---- Gating (Step 4): account bar, call links, manager screen -----------
   Same components and skin variables as the rest of the shell — the
   gating adds structure, never a second visual language. */

.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-label { font-size: 13px; font-weight: 600; opacity: 0.85; }

.call-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.call-link { text-align: center; text-decoration: none; }

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-form input {
  min-height: 48px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--tile);
  color: var(--text);
  font-size: 15px;
}

.stack-form input::placeholder { color: rgba(255,255,255,0.5); }

.manager-jobs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.manager-job {
  background: var(--tile);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.manager-line { font-size: 13px; font-weight: 600; }

.manager-line.dim { opacity: 0.75; }

.manager-job ul {
  list-style: none;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sync-note { font-size: 12px; font-weight: 600; color: var(--accent); }

/* ---- Layout variants (Step 7) ------------------------------------------
   The variant is a body class (layout-classic / layout-rail /
   layout-dock) that app.js applies at boot from the client config's
   library choice (layout.js). ARRANGEMENT ONLY: the rules below move,
   restyle and respacing the SAME elements — no variant adds, removes
   or renames a component, and the gating screens (login, locked,
   manager, rates) are deliberately untouched: they inherit the body
   class but no rule here reaches them. Section ORDER is not CSS's
   job — app.js sets it from the plan (inline `order`), so a variant's
   signature here is its nav, its headline arrangement and its density.

   Classic is the shell as it shipped; its single rule restates the
   base value so all three signatures live in one place and a porter
   can diff a variant against it. */

body.layout-classic .headline-grid { grid-template-columns: 1fr 1fr; }

/* Rail — a slim segmented control instead of the big tab buttons, and
   the rollout card leading full-width with the remaining headline
   cards on a rail beneath it. */
body.layout-rail .screen-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--tile-dark);
  border-radius: 999px;
}

body.layout-rail .screen-tabs button {
  flex: 1 1 0;
  min-height: 44px;
  border-radius: 999px;
  background: transparent;
  font-size: 15px;
}

body.layout-rail .screen-tabs button.active {
  background: var(--tile);
  outline: none;
}

body.layout-rail .headline-grid {
  display: flex;
  flex-wrap: wrap;
}

body.layout-rail .headline-grid .card { flex: 1 1 0; }

body.layout-rail .headline-grid .card:first-child {
  flex-basis: 100%;
  min-height: 96px;
}

body.layout-rail .headline-grid .card:first-child .big { font-size: 34px; }

/* Dock — the tab bar fixed to the bottom of the screen (below the
   modals' z-index, so sign-in and the scope sheet still cover it),
   headline cards stacked as full-width rows, and compact density:
   tighter gaps, shorter cards and tiles, a smaller table. */
body.layout-dock main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

body.layout-dock .screen-tabs {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 5;
  width: min(480px, 100%);
  display: flex;
  gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--tile-dark);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.35);
}

body.layout-dock .screen-tabs button {
  flex: 1 1 0;
  min-height: 48px;
  font-size: 15px;
}

/* The quote screen's sticky total bar parks ABOVE the dock instead of
   sliding under it. */
body.layout-dock .quote-total-bar { bottom: calc(72px + env(safe-area-inset-bottom)); }

body.layout-dock .headline-grid {
  display: flex;
  flex-direction: column;
}

body.layout-dock .headline-grid .card { min-height: 60px; }

body.layout-dock main,
body.layout-dock .screen { gap: 8px; }

body.layout-dock .card { min-height: 64px; padding: 8px 10px; }

body.layout-dock .tile { min-height: 64px; }

body.layout-dock .big { font-size: 24px; }

body.layout-dock .input-section input { min-height: 48px; font-size: 30px; }

body.layout-dock .drop-table { font-size: 14px; }

body.layout-dock .drop-table td { padding: 7px 6px; }
