/* =========================================================
   結（ゆい）リフォーム  |  見積もりシミュレーター  style.css
   App-shell tool — NOT a scroll LP.
   Visual identity: clean, functional, neutral slate gray
   + one fresh green accent (住まい系の生命感). 既存5LPの暖色・和テイストと差別化。
   ---------------------------------------------------------
   Contrast notes (WCAG AA — against intended backgrounds):
   - Ink #1f2937 on #ffffff ≈ 13.6:1 / on panel #f8fafc ≈ 12.9:1 (AAA).
   - Muted #475569 on #ffffff ≈ 7.5:1 / on #f1f5f9 ≈ 6.9:1 (AAA/AA).
   - Faint #64748b on #ffffff ≈ 4.8:1 — passes AA for normal text.
   - Accent-ink #15803d (green) as TEXT on white ≈ 4.6:1 — passes AA.
   - Primary button: white on #15803d ≈ 4.6:1 — passes AA; hover #166534 deeper.
   - On dark estimate header #0f172a: white ≈ 17.4:1; #86efac total ≈ 12:1.
   - Error #b91c1c on white ≈ 6.3:1.
   ========================================================= */

:root {
  /* surfaces */
  --bg: #eef2f6;            /* app canvas (cool light gray) */
  --surface: #ffffff;       /* cards / panels */
  --surface-2: #f8fafc;     /* inset surfaces */
  --surface-3: #f1f5f9;     /* hover / selected wash */
  --dark: #0f172a;          /* estimate header / footer (slate-900) */

  /* ink */
  --ink: #1f2937;           /* primary text */
  --ink-soft: #475569;      /* secondary text (AA) */
  --ink-faint: #64748b;     /* tertiary / hints (AA) */
  --on-dark: #f8fafc;
  --on-dark-soft: #cbd5e1;

  /* lines */
  --line: #dbe3ec;
  --line-strong: #c3cedb;
  --control-border: #7e8ba0; /* フォーム部品の枠（チェック丸/チェックボックス）専用。白地で約3.45:1＝WCAG 1.4.11(3:1)を満たす */

  /* accent — fresh green */
  --accent: #16a34a;        /* fill (white text边界用は ink を使用) */
  --accent-strong: #15803d; /* button bg / text-on-white (AA) */
  --accent-deep: #166534;   /* hover */
  --accent-wash: #ecfdf5;   /* selected card wash */
  --accent-soft: #d1fae5;   /* chips / borders */
  --accent-glow: rgba(22, 163, 74, 0.16);

  --danger: #b91c1c;

  /* type */
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --num: "Zen Kaku Gothic New", ui-monospace, "SFMono-Regular", "Consolas", monospace;

  /* misc */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 2px 8px -4px rgba(15, 23, 42, 0.12);
  --shadow-md: 0 8px 28px -14px rgba(15, 23, 42, 0.28);
  --shadow-lg: 0 24px 60px -30px rgba(15, 23, 42, 0.4);

  --header-h: 60px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.01em;
  /* defensive only; layout is contained per-section */
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

/* tabular figures for all monetary output */
.estimate__amount, .estimate__total, .estimate__line-amount,
.mobile-bar__total, #mobileTotal, .price-table__num, .slider-readout__value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------- a11y helpers ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 300;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =========================================================
   no-js / js progressive enhancement
   .no-js: アプリ非表示・フォールバック表示
   .js   : フォールバック非表示・アプリ表示
   ========================================================= */
.no-js .app,
.no-js .mobile-bar,
.no-js .mobile-sheet { display: none !important; }

.js .nojs-fallback { display: none !important; }

/* hidden 属性は常に尊重 */
[hidden] { display: none !important; }

/* =========================================================
   HEADER
   ========================================================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.app-header__inner {
  width: min(1280px, 100% - 2rem);
  margin-inline: auto;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.app-header__home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}
.app-header__home::before { content: "←"; color: var(--accent-strong); }
.app-header__home:hover { color: var(--accent-strong); }
.app-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.app-header__mark {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent-wash);
  color: var(--accent-strong);
  flex-shrink: 0;
}
.app-header__brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.app-header__brand-name { font-weight: 900; font-size: 1rem; letter-spacing: 0.02em; }
.app-header__brand-sub {
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent-strong);
}
@media (max-width: 420px) {
  .app-header__brand-text { display: none; }
}

/* =========================================================
   no-JS fallback
   ========================================================= */
.nojs-fallback {
  width: min(840px, 100% - 2rem);
  margin: clamp(1.5rem, 5vw, 3rem) auto;
}
.nojs-fallback__inner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  box-shadow: var(--shadow-sm);
}
.nojs-fallback__title {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  margin-bottom: 0.9rem;
}
.nojs-fallback__note {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.85;
  margin-bottom: 1.6rem;
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  background: var(--accent-wash);
  padding-block: 0.9rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* JS無効時の早見表：狭い画面でははみ出さず横スクロールで読めるようにする */
.price-table-scroll { overflow-x: auto; }
.price-table-scroll:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}
.price-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.price-table__caption {
  caption-side: top;
  text-align: left;
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}
.price-table th,
.price-table td {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.price-table thead th {
  background: var(--surface-3);
  font-weight: 700;
  color: var(--ink);
  font-size: 0.82rem;
}
.price-table tbody th { font-weight: 700; color: var(--ink); white-space: nowrap; }
.price-table tbody td { color: var(--ink-soft); }
.price-table__num { text-align: right; white-space: nowrap; }
.price-table thead .price-table__num { text-align: right; }
.price-table__unit { display: block; font-size: 0.72rem; font-weight: 400; color: var(--ink-faint); }
.price-table__foot {
  margin-top: 1rem;
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--ink-faint);
}

/* =========================================================
   APP SHELL
   ========================================================= */
.app {
  width: min(1280px, 100% - 2rem);
  margin: clamp(1.2rem, 3vw, 2rem) auto clamp(2rem, 5vw, 3rem);
}
.app__intro {
  margin-bottom: clamp(1.2rem, 3vw, 1.8rem);
}
.app__title {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.25;
}
.app__lead {
  margin-top: 0.7rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.8;
  max-width: 64ch;
}

.app__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 1.6rem);
  align-items: start;
}
@media (max-width: 900px) {
  .app__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   CONFIGURATOR (left)
   ========================================================= */
.configurator {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.1rem, 3vw, 1.8rem);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.configurator__head { margin-bottom: 1.1rem; }
.configurator__head--detail {
  margin-top: 2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.configurator__title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.configurator__hint {
  margin-top: 0.4rem;
  font-size: 0.84rem;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* ---------- room toggle cards ---------- */
.room-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.7rem;
}
.room-toggle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  text-align: left;
  padding: 0.9rem 0.95rem;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.12s var(--ease);
  min-height: 92px;
}
.room-toggle:hover { border-color: var(--line-strong); background: var(--surface-3); }
.room-toggle:active { transform: scale(0.98); }
.room-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-wash);
}
.room-toggle__icon {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.room-toggle[aria-pressed="true"] .room-toggle__icon {
  color: var(--accent-strong);
  border-color: var(--accent-soft);
}
.room-toggle__name { font-weight: 700; font-size: 0.92rem; line-height: 1.3; }
.room-toggle__base { font-size: 0.74rem; color: var(--ink-faint); }
/* checkmark */
.room-toggle__check {
  position: absolute;
  top: 0.55rem; right: 0.55rem;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--control-border);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: #fff;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.room-toggle__check svg { opacity: 0; transition: opacity 0.15s var(--ease); width: 12px; height: 12px; }
.room-toggle[aria-pressed="true"] .room-toggle__check {
  background: var(--accent);
  border-color: var(--accent);
}
.room-toggle[aria-pressed="true"] .room-toggle__check svg { opacity: 1; }

/* =========================================================
   ROOM DETAILS
   ========================================================= */
.room-details { display: flex; flex-direction: column; gap: 1rem; }
.room-details__empty {
  color: var(--ink-faint);
  font-size: 0.88rem;
  padding: 1.4rem;
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.detail-card__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.detail-card__icon {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent-wash);
  color: var(--accent-strong);
  flex-shrink: 0;
}
.detail-card__name { font-weight: 700; font-size: 0.96rem; }
.detail-card__body { padding: 1rem; display: flex; flex-direction: column; gap: 1.1rem; }

.detail-group__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

/* ---------- grade radios (segmented) ---------- */
.grade-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}
.grade-option {
  position: relative;
  display: block;
}
.grade-option__input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.grade-option__face {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0.5rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: center;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
  cursor: pointer;
}
.grade-option__name { font-weight: 700; font-size: 0.84rem; }
.grade-option__mult { font-size: 0.7rem; color: var(--ink-faint); }
.grade-option__input:checked + .grade-option__face {
  border-color: var(--accent);
  background: var(--accent-wash);
  /* 色のみに依存しない選択表示：内側リング＋チェックマーク（WCAG 1.4.1） */
  box-shadow: inset 0 0 0 1px var(--accent);
}
.grade-option__input:checked + .grade-option__face .grade-option__name { color: var(--accent-deep); }
.grade-option__input:checked + .grade-option__face::after {
  content: "✓";
  position: absolute;
  top: 3px; right: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent-strong);
}
.grade-option__input:checked + .grade-option__face .grade-option__mult { color: var(--accent-strong); }
.grade-option__face:hover { border-color: var(--line-strong); }
.grade-option__input:focus-visible + .grade-option__face {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}

/* ---------- option toggles ---------- */
.opt-list { display: flex; flex-direction: column; gap: 0.45rem; }
.opt-toggle {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.opt-toggle:hover { border-color: var(--line-strong); }
.opt-toggle__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt-toggle__box {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--control-border);
  background: var(--surface);
  display: grid;
  place-items: center;
  color: #fff;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.opt-toggle__box svg { opacity: 0; transition: opacity 0.15s var(--ease); width: 13px; height: 13px; }
.opt-toggle__input:checked + .opt-toggle__box { background: var(--accent); border-color: var(--accent); }
.opt-toggle__input:checked + .opt-toggle__box svg { opacity: 1; }
.opt-toggle__input:checked ~ .opt-toggle__text { color: var(--ink); }
.opt-toggle__input:focus-visible + .opt-toggle__box {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
}
.opt-toggle__text {
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}
.opt-toggle__name { font-size: 0.88rem; font-weight: 500; }
.opt-toggle__price { font-size: 0.8rem; color: var(--ink-faint); white-space: nowrap; }

/* ---------- slider ---------- */
.slider-readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.slider-readout__value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-strong);
}
.slider-readout__unit { font-size: 0.78rem; color: var(--ink-faint); font-weight: 400; margin-left: 0.15rem; }
.slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  outline-offset: 4px;
  cursor: pointer;
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-strong);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.3);
  cursor: pointer;
}
.slider-input::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-strong);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.3);
  cursor: pointer;
}
.slider-input::-moz-range-track {
  height: 8px; border-radius: 999px; background: var(--surface-3);
}
.slider-input::-moz-range-progress {
  /* Firefox は input への background-image を ::-moz-range-track が上書きするため、
     進捗塗り（現在値の割合）を専用擬似要素で描画する */
  height: 8px; border-radius: 999px; background: var(--accent);
}
.slider-input:focus-visible {
  outline: 3px solid var(--accent-strong);
}
.slider-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

/* モバイル明細シート内のコピー導線 */
.mobile-sheet__actions { margin-top: 1.1rem; }
.mobile-sheet__actions .btn { width: 100%; justify-content: center; }

/* =========================================================
   ESTIMATE PANEL (right)
   ========================================================= */
.estimate { min-width: 0; }
@media (min-width: 901px) {
  /* 親グリッドが align-items:start のため、右カラムを行いっぱいに伸ばさないと
     .estimate__sticky の可動域がゼロになり、スクロールに追従しない */
  .estimate { align-self: stretch; }
}
.estimate__sticky {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.estimate__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 1rem 1.2rem;
  background: var(--dark);
  color: var(--on-dark);
}
.estimate__title { font-size: 1.02rem; font-weight: 700; letter-spacing: 0.02em; }
.estimate__badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(134, 239, 172, 0.4);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.estimate__lines {
  padding: 1rem 1.2rem;
  max-height: 42vh;
  overflow-y: auto;
}
.estimate__empty {
  color: var(--ink-faint);
  font-size: 0.88rem;
  text-align: center;
  padding: 1.4rem 0.5rem;
}

.estimate__group { margin-bottom: 0.9rem; }
.estimate__group:last-child { margin-bottom: 0; }
.estimate__group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.4rem;
}
.estimate__group-name { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.estimate__group-grade {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.estimate__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.84rem;
  padding: 0.18rem 0;
  color: var(--ink-soft);
}
.estimate__line-name { min-width: 0; }
.estimate__line-name--sub { padding-left: 0.8rem; position: relative; }
.estimate__line-name--sub::before {
  content: "+";
  position: absolute; left: 0;
  color: var(--accent-strong);
  font-weight: 700;
}
.estimate__line-amount { white-space: nowrap; color: var(--ink); font-weight: 500; }

/* summary */
.estimate__summary {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.estimate__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  padding: 0.18rem 0;
}
.estimate__amount { color: var(--ink); font-weight: 500; }
.estimate__row--total {
  margin-top: 0.5rem;
  padding-top: 0.7rem;
  border-top: 2px solid var(--line-strong);
  align-items: baseline;
}
.estimate__row--total dt { font-size: 1rem; font-weight: 700; color: var(--ink); }
.estimate__total {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent-strong);
  letter-spacing: 0.01em;
}

/* actions */
.estimate__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 1rem 1.2rem 0.4rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 46px;
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.1s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { flex-shrink: 0; }
.btn--primary {
  grid-column: 1 / -1;
  background: var(--accent-strong);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-deep); }
.btn--primary.is-copied { background: var(--dark); }
.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--ghost:hover { border-color: var(--ink-faint); background: var(--surface-2); }
.btn--reset {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--line-strong);
}
.btn--reset:hover { border-color: var(--danger); background: #fef2f2; }

.estimate__copy-status {
  padding: 0 1.2rem;
  min-height: 1.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-strong);
}
.estimate__copy-status:empty { min-height: 0; }
.estimate__copy-status--err { color: var(--danger); }

.estimate__disclaimer {
  padding: 0.4rem 1.2rem 1.2rem;
  font-size: 0.76rem;
  line-height: 1.7;
  color: var(--ink-faint);
}

/* =========================================================
   MOBILE STICKY BAR + SHEET (≤ 700px)
   ========================================================= */
.mobile-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 120;
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, 0.4);
  padding: 0.6rem max(0.8rem, env(safe-area-inset-left)) calc(0.6rem + env(safe-area-inset-bottom)) max(0.8rem, env(safe-area-inset-right));
}
.mobile-bar__expand {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius-sm);
}
.mobile-bar__expand-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.mobile-bar__total-label { font-size: 0.7rem; color: var(--ink-faint); font-weight: 700; }
.mobile-bar__total { font-size: 1.3rem; font-weight: 900; color: var(--accent-strong); }
.mobile-bar__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent-strong);
  padding: 0.55rem 1rem;
  border-radius: 999px;
}
.mobile-bar__chevron {
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-135deg);
  transition: transform 0.25s var(--ease);
}
.mobile-bar__expand[aria-expanded="true"] .mobile-bar__chevron { transform: rotate(45deg); }

/* sheet */
.mobile-sheet {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: flex-end;
}
.mobile-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  animation: sheetFade 0.25s var(--ease);
}
.mobile-sheet__panel {
  position: relative;
  width: 100%;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  animation: sheetUp 0.3s var(--ease);
}
@keyframes sheetFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.mobile-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.mobile-sheet__title { font-size: 1.05rem; font-weight: 700; }
.mobile-sheet__close {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  color: var(--ink-soft);
  background: var(--surface-2);
}
.mobile-sheet__close:hover { background: var(--surface-3); color: var(--ink); }
.mobile-sheet__body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* re-use estimate styles inside the sheet body */
.mobile-sheet__body .estimate__lines { max-height: none; }
.mobile-sheet__body .estimate__summary { border-top: none; }
.mobile-sheet__panel .estimate__copy-status { margin: 0; padding-bottom: 0.8rem; }

/* default: hide mobile UI on desktop; JS toggles [hidden] but width gates display */
@media (min-width: 701px) {
  .mobile-bar, .mobile-sheet { display: none !important; }
}

/* =========================================================
   FOOTER
   ========================================================= */
.app-footer {
  background: var(--dark);
  color: var(--on-dark-soft);
  margin-top: clamp(2rem, 5vw, 3rem);
}
.app-footer__inner {
  width: min(1280px, 100% - 2rem);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: clamp(1.6rem, 4vw, 2.4rem) 1.4rem;
  border-bottom: 1px solid rgba(203, 213, 225, 0.14);
}
.app-footer__tagline { font-weight: 700; color: var(--on-dark); font-size: 0.95rem; }
.app-footer__links { display: flex; flex-wrap: wrap; gap: 1rem; }
.app-footer__links a { font-size: 0.85rem; color: var(--on-dark-soft); }
.app-footer__links a:hover { color: #86efac; }
.app-footer__bottom {
  width: min(1280px, 100% - 2rem);
  margin-inline: auto;
  padding-block: 1.3rem clamp(1.6rem, 4vw, 2.4rem);
  font-size: 0.76rem;
  line-height: 1.7;
  color: rgba(203, 213, 225, 0.62);
}
.app-footer__bottom p + p { margin-top: 0.4rem; }
/* keep footer clear of the mobile bar */
@media (max-width: 700px) {
  .app-footer__bottom { padding-bottom: 6rem; }
}

/* =========================================================
   PRINT
   ========================================================= */
@media print {
  .app-header, .app__intro, .configurator, .mobile-bar, .mobile-sheet,
  .app-footer__links, .estimate__actions, .estimate__badge,
  .estimate__copy-status, .skip-link { display: none !important; }
  body { background: #fff; }
  .app, .app__grid { display: block; width: 100%; margin: 0; }
  .estimate__sticky { position: static; box-shadow: none; border: 1px solid #000; }
  .estimate__head { background: #fff; color: #000; border-bottom: 1px solid #000; }
  .estimate__total, .estimate__group-grade { color: #000; }
  .estimate__lines { max-height: none; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
