/* GHS Appliances — mobile-first styles. Desktop rules live at the bottom. */

/* Signature font: same one used on generated agreements. */
@font-face {
  font-family: 'Dancing Script';
  src: url('../agreement/fonts/DancingScript.ttf') format('truetype');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface: #f4f6f9;
  --surface-2: #eceff4;
  --text: #0f1419;
  --muted: #5b6573;
  --line: #e2e6ec;
  --brand: #1a5cff;
  --brand-press: #0f47d6;
  --brand-soft: #e8efff;
  --ok: #0f7a52;
  --ok-soft: #e3f5ec;
  --warn: #9a5b00;
  --warn-soft: #fff1d9;
  --danger: #c4312b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 20, 25, 0.06), 0 6px 20px rgba(15, 20, 25, 0.06);
  --gutter: 16px;
  --header-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--text);
  color: #fff;
  font-size: 15px;
}

.header-link {
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
}

.back {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin-left: -8px;
  padding-right: 8px;
  font-size: 15px;
  font-weight: 600;
}

.back svg,
.gallery-nav svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-checkout .logo {
  margin-left: auto;
}
.page-checkout .header-link {
  margin-left: 0;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  font-weight: 650;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:active {
  background: var(--brand-press);
}

.btn-block {
  width: 100%;
}

.btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

/* ---------- form fields ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.input-wrap,
.select-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 16px; /* 16px stops iOS zoom-on-focus */
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-wrap input,
.input-wrap select {
  padding-left: 42px;
}

input[type='date'] {
  display: flex; /* iOS: keeps the empty date input from collapsing */
  align-items: center;
}

input[type='date']::-webkit-date-and-time-value {
  text-align: left;
}

input::placeholder {
  color: #98a1ae;
}

.select-wrap::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

select {
  padding-right: 34px;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.field-error {
  font-size: 13px;
  color: var(--danger);
}

.field-error:empty {
  display: none;
}

.has-error input,
.has-error select {
  border-color: var(--danger);
}

/* ---------- landing: hero + search ---------- */
.hero {
  padding: 28px var(--gutter) 24px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  text-align: center;
}

.hero h1 {
  font-size: clamp(30px, 8.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 750;
}

.hero h1 span {
  color: var(--brand);
}

.hero-sub {
  margin-top: 10px;
  color: var(--muted);
  font-size: 16px;
}

.search-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px auto 0;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

/* ---------- landing: results ---------- */
.results {
  padding: 8px var(--gutter) 32px;
}

.results-head h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.results-head p {
  margin-top: 2px;
  font-size: 15px;
}

.results-head strong {
  color: var(--text);
}

.toolbar {
  margin: 14px calc(-1 * var(--gutter)) 0;
}

.chips {
  display: flex;
  gap: 8px;
  padding: 2px var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  min-height: 40px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
}

.chip[aria-pressed='true'] {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.sort-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  font-size: 14px;
}

.sort {
  position: relative;
}

.sort select {
  min-height: 38px;
  width: auto;
  padding: 0 32px 0 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface);
  border-color: transparent;
}

.sort::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.grid {
  display: grid;
  gap: 16px;
}

.card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: transform 0.15s, box-shadow 0.15s;
}

a.card:active {
  transform: scale(0.99);
}

.card.is-disabled {
  opacity: 0.55;
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface);
}

.card-media > svg,
.card-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.card-body {
  padding: 14px 16px 16px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-top h3 {
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.card-specs {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.card-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.card-price strong {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.tag {
  flex: none;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.tag-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.tag-muted {
  background: var(--surface-2);
  color: var(--muted);
}

.empty {
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
}

/* ---------- landing: how it works ---------- */
.how {
  margin: 0 var(--gutter) 32px;
  padding: 24px 20px;
  border-radius: 18px;
  background: var(--surface);
}

.how h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.steps {
  display: grid;
  gap: 18px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 14px;
}

.steps p {
  color: var(--muted);
  font-size: 15px;
}

.step-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.site-footer {
  padding: 24px var(--gutter) calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

/* ---------- checkout: gallery ---------- */
.gallery {
  position: relative;
  background: var(--surface);
}

.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.slide {
  flex: 0 0 100%;
  aspect-ratio: 4 / 3;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.slide > svg,
.slide > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.gallery-dots button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.gallery-dots button::before {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  margin: auto;
  border-radius: 50%;
  background: rgba(15, 20, 25, 0.25);
  transition: width 0.2s, background 0.2s;
}

.gallery-dots button[aria-current='true']::before {
  width: 20px;
  border-radius: 4px;
  background: var(--text);
}

.gallery-nav {
  display: none; /* swipe on mobile; arrows shown on desktop */
}

/* ---------- checkout: config panel ---------- */
.config-panel {
  padding: 20px var(--gutter) 0;
}

.config-title h1 {
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.config-title p {
  margin-top: 4px;
}

#stock {
  margin-top: 10px;
}

.seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 20px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
}

.seg button {
  position: relative;
  z-index: 1;
  min-height: 44px;
  border: 0;
  background: none;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s;
}

.seg button[aria-checked='true'] {
  color: var(--text);
}

.seg-thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 9px;
  background: var(--bg);
  box-shadow: 0 1px 3px rgba(15, 20, 25, 0.12);
  transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.4, 1);
}

.seg[data-active='buy'] .seg-thumb {
  transform: translateX(100%);
}

.headline-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 4px;
  margin-top: 18px;
  text-align: center;
  justify-content: center;
}

.headline-price strong {
  font-size: 34px;
  letter-spacing: -0.03em;
}

.headline-price span {
  font-size: 17px;
  color: var(--muted);
}

.headline-price small {
  flex-basis: 100%;
  font-size: 14px;
}

.block {
  margin-top: 28px;
}

.block[hidden] {
  display: none;
}

.block > h2 {
  margin-bottom: 12px;
  font-size: 18px;
  letter-spacing: -0.015em;
}

.block > .field + .field,
.block > .field + .field-row,
.block > .field-row + .field,
.block > .field-row + .field-row {
  margin-top: 12px;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.option[aria-checked='true'],
.option-check:has(input:checked) {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

.option-check.is-included {
  cursor: default;
  border-color: var(--line);
  box-shadow: none;
  background: var(--surface);
}

.option-main {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
}

.option-main small {
  flex-basis: 100%;
  font-size: 13px;
  line-height: 1.35;
}

.option-price {
  flex: none;
  font-weight: 700;
  white-space: nowrap;
}

.option-price small {
  font-weight: 500;
  color: var(--muted);
}

.option-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check {
  flex: none;
  width: 22px;
  height: 22px;
  border: 1.5px solid #b7bfca;
  border-radius: 6px;
  transition: background 0.15s, border-color 0.15s;
}

.option-check input:checked + .check {
  border-color: var(--text);
  background: var(--text)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 16px no-repeat;
}

.option-check input:focus-visible + .check {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.is-included .check {
  border-color: var(--muted);
  background-color: var(--muted);
}

.is-included .option-price {
  color: var(--ok);
}

.perks,
.features {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.perks li,
.features li {
  position: relative;
  padding-left: 26px;
}

.perks li::before,
.features li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 5px;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f7a52' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.features {
  grid-template-columns: 1fr 1fr;
  margin-top: 0;
  color: var(--muted);
}

.summary {
  margin: 0;
  padding: 4px 16px;
  border-radius: var(--radius);
  background: var(--surface);
}

.summary .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  font-size: 15px;
}

.summary .row + .row {
  border-top: 1px solid var(--line);
}

.summary dt {
  min-width: 0;
}

.summary dd {
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
}

.summary .sub {
  color: var(--muted);
}

.summary .total {
  font-size: 17px;
  font-weight: 700;
}

.fine {
  margin-top: 10px;
  font-size: 13px;
}

/* Sticky buy bar — sits at the bottom of the viewport while the panel scrolls. */
.buybar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px calc(-1 * var(--gutter)) 0;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}

.buybar-price {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.buybar-price strong {
  font-size: 19px;
  letter-spacing: -0.02em;
}

.buybar-price span {
  font-size: 13px;
}

.buybar .btn {
  flex: 1;
  max-width: 220px;
  margin-left: auto;
}

.not-found {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 64px var(--gutter);
  text-align: center;
}

.not-found h1 {
  font-size: 24px;
}

/* ---------- confirmation sheet ---------- */
.sheet {
  width: 100%;
  max-width: 520px;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--bg);
  color: var(--text);
}

.sheet::backdrop {
  background: rgba(15, 20, 25, 0.45);
}

.sheet[open] {
  animation: sheet-up 0.28s cubic-bezier(0.3, 0.7, 0.4, 1);
}

@keyframes sheet-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

.sheet-body {
  display: grid;
  gap: 14px;
  padding: 24px var(--gutter) calc(20px + env(safe-area-inset-bottom));
}

.sheet-body h2 {
  font-size: 22px;
}

.sheet-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ok-soft);
}

.sheet-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--ok);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- agreement + e-signature ---------- */
.btn-ghost {
  background: transparent;
  color: var(--text);
}

.doc-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-align: left;
  cursor: pointer;
}

.doc-card:active {
  background: var(--surface);
}

.doc-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-soft);
}

.doc-icon svg,
.doc-card .chev,
.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doc-card .chev {
  flex: none;
  margin-left: auto;
  stroke: var(--muted);
}

.doc-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.doc-main small {
  font-size: 13px;
}

.sign-check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.sign-check:has(input:checked) {
  border-color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

.sign-check.has-error {
  border-color: var(--danger);
}

.sign-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sign-check .check {
  margin-top: 1px;
}

.sign-check input:checked + .check {
  border-color: var(--text);
  background: var(--text)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 16px no-repeat;
}

.sign-check input:focus-visible + .check {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.sign-text a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#agree-error {
  margin-top: 6px;
}

.signature {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
  padding: 10px 14px 12px;
  border-bottom: 1.5px solid var(--text);
  background: var(--surface);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.signature[hidden] {
  display: none;
}

.signature-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.signature-name {
  font-family: 'Dancing Script', cursive;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  color: #0b1a59;
}

.checkout-error {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #fdecea;
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

.checkout-error:empty {
  display: none;
}

/* Full-screen agreement viewer (bottom sheet on desktop sizes). */
.sheet-full {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  border-radius: 0;
}

.sheet-full[open] {
  display: flex;
  flex-direction: column;
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  font-size: 17px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 -10px 0 auto;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.icon-btn svg {
  stroke: var(--text);
}

.sheet-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sheet-foot {
  display: grid;
  gap: 4px;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.sheet-foot [hidden] {
  display: none;
}

.doc {
  padding: 20px var(--gutter) 32px;
  font-size: 15px;
  line-height: 1.6;
}

.doc h1 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.doc h2 {
  margin: 24px 0 6px;
  font-size: 16px;
}

.doc p + p {
  margin-top: 10px;
}

.doc ul,
.doc ol {
  padding-left: 20px;
}

.doc table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 14px;
}

.doc th,
.doc td {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc th {
  width: 48%;
  padding-right: 12px;
  font-weight: 500;
  color: var(--muted);
}

.doc-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.doc-placeholder {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 14px;
}

.doc-sign {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1.5px solid var(--text);
}

.doc-indent,
.doc .ind {
  padding-left: 18px;
}

.doc h1 {
  text-align: center;
}

.doc .caps {
  font-weight: 600;
  font-size: 13.5px;
}

.doc .blank {
  display: inline-block;
  min-width: 7em;
  border-bottom: 1px solid currentColor;
  line-height: 1.35;
}

.doc .sig-lessor {
  display: inline-block;
  height: 24px;
  width: auto;
  vertical-align: -6px;
}

.doc .fixed-name {
  padding-left: 6px;
}

.doc .lessee {
  margin-top: 16px;
}

.merge.sig,
.doc .sig-lessee {
  font-family: 'Dancing Script', cursive;
  font-size: 20px;
  font-weight: 500;
  color: #0b1a59;
}

.doc p.doc-indent + p.doc-indent {
  margin-top: 6px;
}

.doc-caps {
  font-size: 13.5px;
}

.doc-signature {
  font-family: 'Brush Script MT', 'Segoe Script', 'Snell Roundhand', cursive;
  font-size: 22px;
  line-height: 1;
}

.field-hint {
  font-size: 13px;
}

.option-price {
  text-align: right;
}

.option-tax {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.call-block p {
  font-size: 15px;
}

.merge {
  padding: 0 3px;
  border-radius: 4px;
  background: var(--brand-soft);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.merge.is-empty {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 500;
  font-style: italic;
}

/* ---------- success page ---------- */
.success {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px var(--gutter);
  text-align: center;
}

.success .sheet-icon {
  margin: 0 auto 16px;
}

.success h1 {
  font-size: 28px;
  letter-spacing: -0.02em;
}

.success p {
  margin-top: 8px;
}

.success .summary {
  margin-top: 24px;
  text-align: left;
}

.success .btn {
  margin-top: 24px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   Larger screens. Kept minimal for now: the mobile layout is the priority.
   ===================================================================== */
@media (min-width: 640px) {
  :root {
    --gutter: 24px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-card {
    max-width: 560px;
  }

  .sheet {
    margin: auto;
    border-radius: 20px;
  }

  .sheet-full {
    max-width: 720px;
    height: min(90vh, 960px);
    margin: auto;
    border-radius: 20px;
  }

  .sheet-head {
    padding-top: 10px;
  }
}

@media (min-width: 1024px) {
  :root {
    --gutter: 40px;
  }

  .hero {
    padding-top: 56px;
    padding-bottom: 40px;
  }

  .search-card {
    flex-direction: row;
    align-items: flex-start;
    max-width: 980px;
  }

  .search-card > .field {
    flex: 1;
  }

  .search-card .field-row {
    flex: 1.4;
  }

  .search-card .btn {
    width: auto;
    margin-top: 25px;
    flex: none;
  }

  .results,
  .how {
    max-width: 1200px;
  }

  .results {
    margin: 0 auto;
  }

  .how {
    margin: 0 auto 48px;
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  a.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
  }

  /* Configurator: gallery left, scrolling options right. */
  .configurator {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    align-items: start;
  }

  .config-media {
    position: sticky;
    top: calc(var(--header-h) + env(safe-area-inset-top));
    height: calc(100vh - var(--header-h));
  }

  .gallery,
  .gallery-track {
    height: 100%;
  }

  .slide {
    aspect-ratio: auto;
    height: 100%;
  }

  .slide > svg,
  .slide > img {
    object-fit: contain;
  }

  .gallery-nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
    transform: translateY(-50%);
    cursor: pointer;
  }

  .gallery-nav:disabled {
    opacity: 0;
    pointer-events: none;
  }

  .gallery-nav.prev {
    left: 20px;
  }

  .gallery-nav.next {
    right: 20px;
  }

  .config-panel {
    padding: 32px 32px 0;
    border-left: 1px solid var(--line);
    min-height: calc(100vh - var(--header-h));
  }

  .buybar {
    margin: 32px -32px 0;
    padding-left: 32px;
    padding-right: 32px;
  }
}
