/* ===================================================================
   ESTIMATE CALCULATOR — v2 (dark tool-panel on a light page)
   -------------------------------------------------------------------
   Self-contained dark module. Every selector is scoped under
   .calc-shell so it can NEVER restyle the page nav, footer, or base.
   Local dark tokens are declared on .calc-shell only; the page-level
   light tokens from site-v2.css (--signal, --paper, etc.) are NOT
   redefined globally. Accent is var(--signal) #4FCBAA.
   =================================================================== */

.calc-shell {
  /* Local dark palette — scoped to the calculator only */
  --c-ink:        #131518;
  --c-ink-2:      #17191D;
  --c-ink-3:      #1E2126;
  --c-white:      #FFFFFF;
  --c-text:       rgba(255,255,255,0.72);
  --c-muted:      #8A9095;
  --c-muted-2:    #9CA2A7;
  --c-line:       rgba(255,255,255,0.11);
  --c-line-soft:  rgba(255,255,255,0.06);
  --c-signal:     var(--signal);
  --c-signal-dim: var(--signal-dim);
  --c-font:       "Söhne","Helvetica Neue",Arial,sans-serif;
  --c-label:      "Söhne","Helvetica Neue",Arial,sans-serif;

  border: 1px solid var(--c-line); border-radius: 3px; overflow: hidden;
  background: var(--c-ink); color: var(--c-text); font-family: var(--c-font);
}

/* Reset native <button> chrome. Without this, unselected buttons (tier cards,
   chips, tabs, venue, byo heads, qty +/-) fall back to the UA grey #EFEFEF and
   render white text on light grey — unreadable. Selected/hover states set their
   own background and win on specificity. */
.calc-shell button { background: transparent; color: inherit; font-family: inherit; }

/* ---- Buttons inside the dark panel (override the light page .btn) ---- */
.calc-shell .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.04em;
  padding: 15px 28px; border-radius: 3px; transition: all 0.2s; cursor: pointer;
  font-family: var(--c-font);
}
.calc-shell .btn--signal { background: var(--c-signal); color: var(--c-ink); border: 1px solid var(--c-signal); }
.calc-shell .btn--signal:hover { background: #6FE0C2; border-color: #6FE0C2; }

/* ---- Eyebrow inside the panel ---- */
.calc-shell .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--c-label); font-size: 10.5px; font-weight: 600; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--c-muted-2); margin-bottom: 28px;
}
.calc-shell .eyebrow::before { content: ""; width: 20px; height: 1px; background: var(--c-signal); display: inline-block; }
.calc-shell .eyebrow--plain::before { display: none; }

/* ---- Tabs ---- */
.calc-shell .calc-tabs { display: flex; border-bottom: 1px solid var(--c-line); }
.calc-shell .calc-tab {
  flex: 1; padding: 18px 20px; font-family: var(--c-label); font-size: 11px; font-weight: 600; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--c-muted-2); border-bottom: 2px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.calc-shell .calc-tab:hover { color: var(--c-white); background: rgba(255,255,255,0.02); }
.calc-shell .calc-tab.is-active { color: var(--c-signal); border-bottom-color: var(--c-signal); }
.calc-shell .calc-tab + .calc-tab { border-left: 1px solid var(--c-line); }

.calc-shell .calc-grid { display: grid; grid-template-columns: 1.55fr 1fr; }
.calc-shell .calc-form { padding: clamp(24px, 3vw, 40px); border-right: 1px solid var(--c-line); min-width: 0; }

.calc-shell .calc-step { padding: 26px 0; border-top: 1px solid var(--c-line-soft); }
.calc-shell .calc-step:first-child { padding-top: 4px; border-top: none; }
.calc-shell .calc-step-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.calc-shell .calc-num { font-family: var(--c-label); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; color: var(--c-signal); font-variant-numeric: tabular-nums; }
.calc-shell .calc-step .label { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; color: var(--c-white); }
.calc-shell .field-label { display: block; font-family: var(--c-label); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-muted-2); margin-bottom: 10px; }

.calc-shell .tier-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.calc-shell .tier-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 16px;
  border: 1px solid var(--c-line); border-radius: 3px; transition: all 0.18s; min-height: 84px;
}
.calc-shell .tier-card:hover { border-color: rgba(255,255,255,0.32); background: rgba(255,255,255,0.02); }
.calc-shell .tier-card.is-active { border-color: var(--c-signal); background: var(--c-signal-dim); }
.calc-shell .tc-name { font-size: 14px; font-weight: 600; color: var(--c-white); letter-spacing: -0.01em; }
.calc-shell .tc-meta { font-size: 12px; color: var(--c-muted-2); line-height: 1.4; }

.calc-shell .calc-form-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.calc-shell .calc-options { display: flex; flex-wrap: wrap; gap: 8px; }
.calc-shell .calc-chip {
  padding: 10px 16px; border: 1px solid var(--c-line); border-radius: 3px; font-size: 13px;
  font-weight: 500; color: var(--c-text); transition: all 0.16s; white-space: nowrap;
}
.calc-shell .calc-chip:hover { border-color: rgba(255,255,255,0.32); color: var(--c-white); }
.calc-shell .calc-chip.is-active { border-color: var(--c-signal); color: var(--c-signal); background: var(--c-signal-dim); }

.calc-shell .scope-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.calc-shell .scope-tile {
  display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid var(--c-line);
  border-radius: 3px; cursor: pointer; transition: all 0.16s; font-size: 13.5px; color: var(--c-text);
}
.calc-shell .scope-tile:hover { border-color: rgba(255,255,255,0.32); }
.calc-shell .scope-tile.is-active { border-color: var(--c-signal); background: var(--c-signal-dim); color: var(--c-white); }
.calc-shell .scope-tile input { position: absolute; opacity: 0; pointer-events: none; }
.calc-shell .scope-tile::before {
  content: ""; width: 15px; height: 15px; border: 1px solid var(--c-muted); border-radius: 2px;
  flex-shrink: 0; transition: all 0.16s;
}
.calc-shell .scope-tile.is-active::before { background: var(--c-signal); border-color: var(--c-signal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l2.5 2.5L9 1' stroke='%23131518' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; }

.calc-shell .venue-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.calc-shell .venue-card { padding: 11px 20px; border: 1px solid var(--c-line); border-radius: 3px; font-size: 13px; font-weight: 500; color: var(--c-text); transition: all 0.16s; }
.calc-shell .venue-card:hover { border-color: rgba(255,255,255,0.32); color: var(--c-white); }
.calc-shell .venue-card.is-active { border-color: var(--c-signal); color: var(--c-signal); background: var(--c-signal-dim); }

/* Result panel */
.calc-shell .calc-result { background: var(--c-ink-2); min-width: 0; }
.calc-shell .calc-result-inner { position: sticky; top: calc(var(--nav-h) + 16px); padding: clamp(24px, 3vw, 40px); }
.calc-shell .cr-label { font-family: var(--c-label); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-muted-2); }
.calc-shell .cr-total {
  font-family: var(--c-font); font-weight: 600; font-size: clamp(34px, 4.4vw, 54px);
  letter-spacing: -0.03em; line-height: 1.02; margin: 12px 0 22px; color: var(--c-white);
  transition: opacity 0.11s, transform 0.11s;
}
.calc-shell .cr-total .dash { color: var(--c-muted); font-weight: 400; margin: 0 2px; }
.calc-shell .cr-total .per { font-size: 0.42em; color: var(--c-muted-2); font-weight: 400; letter-spacing: 0; margin-left: 4px; }
.calc-shell .cr-total.is-updating { opacity: 0; transform: translateY(6px); }
.calc-shell .cr-total.out-of-scope-state { font-size: clamp(22px, 2.6vw, 30px); color: var(--c-signal); }
.calc-shell .cr-oos { font-size: 14px; color: var(--c-text); line-height: 1.6; margin-bottom: 22px; }
.calc-shell .cr-breakdown { display: grid; gap: 0; margin-bottom: 26px; }
.calc-shell .cr-breakdown .cr { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--c-line-soft); font-size: 13.5px; color: var(--c-muted-2); }
.calc-shell .cr-breakdown .cr:first-child { border-top: none; }
.calc-shell .cr-breakdown .cr .v { color: var(--c-text); text-align: right; }
.calc-shell .calc-empty { font-size: 14px; color: var(--c-muted); }
.calc-shell .cr-cta { width: 100%; margin-bottom: 14px; }
.calc-shell .cr-note { font-size: 12px; color: var(--c-muted); line-height: 1.55; }

/* Build-your-own */
.calc-shell #byo-sections { display: grid; gap: 8px; }
.calc-shell .byo-section { border: 1px solid var(--c-line); border-radius: 3px; overflow: hidden; }
.calc-shell .byo-head { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; transition: background 0.16s; }
.calc-shell .byo-head:hover { background: rgba(255,255,255,0.02); }
.calc-shell .byo-head-l { display: flex; align-items: center; gap: 12px; }
.calc-shell .byo-num { font-family: var(--c-label); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--c-signal); font-variant-numeric: tabular-nums; }
.calc-shell .byo-title { font-size: 15px; font-weight: 600; color: var(--c-white); }
.calc-shell .count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; background: var(--c-signal); color: var(--c-ink); font-size: 11px; font-weight: 600; border-radius: 9px; }
.calc-shell .byo-head-r { display: flex; align-items: center; gap: 14px; }
.calc-shell .running { font-size: 13px; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.calc-shell .running.has-value { color: var(--c-signal); }
.calc-shell .byo-chev { font-size: 18px; color: var(--c-muted-2); width: 16px; text-align: center; }
.calc-shell .byo-body { display: none; border-top: 1px solid var(--c-line-soft); }
.calc-shell .byo-section.is-open .byo-body { display: block; }
.calc-shell .byo-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--c-line-soft); cursor: pointer; transition: background 0.14s; }
.calc-shell .byo-row:first-child { border-top: none; }
.calc-shell .byo-row:hover { background: rgba(255,255,255,0.02); }
.calc-shell .byo-row.is-on { background: var(--c-signal-dim); }
.calc-shell .byo-check { display: inline-flex; cursor: pointer; }
.calc-shell .byo-check input { position: absolute; opacity: 0; pointer-events: none; }
.calc-shell .byo-check .box { width: 16px; height: 16px; border: 1px solid var(--c-muted); border-radius: 2px; transition: all 0.14s; }
.calc-shell .byo-row.is-on .byo-check .box { background: var(--c-signal); border-color: var(--c-signal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l2.5 2.5L9 1' stroke='%23131518' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; }
.calc-shell .byo-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.calc-shell .byo-name { font-size: 14px; color: var(--c-white); font-weight: 500; }
.calc-shell .byo-desc { font-size: 12.5px; color: var(--c-muted-2); }
.calc-shell .byo-price { font-size: 13.5px; color: var(--c-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-shell .byo-price .per { color: var(--c-muted); font-size: 0.82em; }
.calc-shell .qty { display: inline-flex; align-items: center; gap: 2px; grid-column: 3; margin-top: 8px; }
.calc-shell .qty button { width: 26px; height: 26px; border: 1px solid var(--c-line); border-radius: 2px; color: var(--c-white); font-size: 15px; line-height: 1; transition: all 0.14s; }
.calc-shell .qty button:hover { border-color: var(--c-signal); color: var(--c-signal); }
.calc-shell .qty .count { min-width: 26px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .calc-shell .calc-grid { grid-template-columns: 1fr; }
  .calc-shell .calc-form { border-right: none; border-bottom: 1px solid var(--c-line); }
  .calc-shell .calc-result-inner { position: static; }
  .calc-shell .tier-cards { grid-template-columns: 1fr; }
  .calc-shell .calc-form-row { grid-template-columns: 1fr; gap: 20px; }
}

/* ---- LEAD GATE ---- */
.calc-shell .calc-gate { padding: clamp(28px, 4vw, 52px); }
.calc-shell .gate-head { max-width: 44ch; margin-bottom: 30px; }
.calc-shell .gate-title { font-family: var(--c-font); font-weight: 600; font-size: clamp(24px, 3vw, 38px); letter-spacing: -0.02em; line-height: 1.05; margin: 12px 0 12px; color: var(--c-white); }
.calc-shell .gate-sub { font-size: 15.5px; color: var(--c-text); line-height: 1.6; }
.calc-shell .gate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 26px; }
.calc-shell .gate-field { display: grid; gap: 9px; }
.calc-shell .gate-field label { font-family: var(--c-label); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-muted-2); }
.calc-shell .gate-field input[type="text"], .calc-shell .gate-field input[type="email"] {
  background: var(--c-ink-2); border: 1px solid var(--c-line); border-radius: 3px; color: var(--c-white);
  font: inherit; font-family: var(--c-font); font-size: 15px; padding: 14px 16px; width: 100%; transition: border-color 0.2s, background 0.2s;
}
.calc-shell .gate-field input::placeholder { color: var(--c-muted); }
.calc-shell .gate-field input:focus { outline: none; border-color: var(--c-signal); background: var(--c-ink-3); }
.calc-shell .gate-field input:disabled { opacity: 0.5; cursor: not-allowed; }
.calc-shell .gate-field.has-error input { border-color: #FF7A6E; }
/* iOS Safari zooms the page when a focused control is under 16px, which throws the
   layout the moment someone taps a gate field on a phone. Matches the selector above
   so it wins the cascade. Desktop keeps 15px. */
@media (max-width: 820px) {
  .calc-shell .gate-field input[type="text"], .calc-shell .gate-field input[type="email"] { font-size: 16px; }
}
.calc-shell .gate-none { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--c-muted-2); text-transform: none; letter-spacing: 0; font-weight: 400; cursor: pointer; font-family: var(--c-font); }
.calc-shell .gate-none input { width: 15px; height: 15px; accent-color: var(--c-signal); }
.calc-shell .gate-btn { margin-bottom: 14px; }
.calc-shell .gate-fine { font-size: 12px; color: var(--c-muted); }
.calc-shell .calc-content.is-locked { display: none; }
@media (max-width: 600px) { .calc-shell .gate-grid { grid-template-columns: 1fr; } }
