/* Guard against sub-pixel and 3px horizontal overflow on narrow screens */
html { overflow-x: hidden; }
body { overflow-x: clip; max-width: 100%; }
img, svg, video, table { max-width: 100%; }

/* Hero: calculator and results share one top, nothing overhangs the strip below */
.hero { height: auto; min-height: 0; margin-bottom: 48px; }
.hero .tool { align-items: start; }
.hero .tool__panel, .hero .tool__result { margin-top: 0; transform: none; align-self: start; }
.hero .tool__result { position: sticky; top: 16px; margin-bottom: 0; }
.hero .trust-row { position: relative; clear: both; }

/* Header: same side padding as the page, brand shrinks, button stays whole */
header, .site-header, .header { box-sizing: border-box; }
.site-header, .header, header > div { min-width: 0; }
.site-header .brand, .header .brand, header .brand, header [class*="brand"] {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
header button, .site-header button, .nav-toggle, .menu-toggle, header [class*="toggle"], header [class*="menu-btn"] {
  flex-shrink: 0;
}
@media (max-width: 640px) {
  header, .site-header, .header { padding-left: 20px; padding-right: 20px; }
}

/* State table: scrolls inside its box with an edge fade, caption wraps */
lg-table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--bg, #fff) 30%, rgba(255,255,255,0)) left center / 24px 100% no-repeat local,
    linear-gradient(to left, var(--bg, #fff) 30%, rgba(255,255,255,0)) right center / 24px 100% no-repeat local,
    linear-gradient(to right, rgba(0,0,0,.18), rgba(0,0,0,0)) left center / 10px 100% no-repeat scroll,
    linear-gradient(to left, rgba(0,0,0,.18), rgba(0,0,0,0)) right center / 10px 100% no-repeat scroll;
}
lg-table table { width: 100%; }
lg-table caption { white-space: normal; text-align: left; }
@media (max-width: 640px) {
  lg-table table { font-size: .85rem; }
  lg-table th, lg-table td { padding: .5rem .5rem; }
}

/* Signature: the result panel as an itemised wedding receipt */
.receipt {
  position: relative;
  border: 1px solid var(--border);
  border-top: 4px solid var(--brand);
}
.receipt .tool__result-head {
  border-bottom: 2px dashed var(--border);
  padding-bottom: .75rem;
}
.receipt .result-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .35rem 0;
  border-bottom: 1px dotted var(--border);
  font-size: .95rem;
}
.receipt .result-list li .num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}
.receipt .receipt__reserve {
  font-weight: 600;
  border-bottom: 2px dashed var(--border);
}
.receipt .receipt__flex {
  font-weight: 600;
  border-top: 2px dashed var(--border);
  border-bottom: none;
  margin-top: .25rem;
}
.receipt .receipt__flex .num { color: var(--brand); }
.receipt .receipt__memo {
  color: var(--muted);
  font-size: .85rem;
  border-bottom: none;
}
.receipt .receipt__memo .num { color: var(--muted); }
.wb-skip {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .4rem 1rem;
  min-width: 0;
}
.wb-skip legend { padding: 0 .35rem; font-weight: 600; }
.wb-skip .field__hint { grid-column: 1 / -1; }
.tool__panel input, .tool__panel select { min-width: 0; max-width: 100%; }
@media (max-width: 420px) {
  .wb-skip { grid-template-columns: 1fr; }
}
@media print {
  .tool__panel, .trust-row, #lg-print, .hero .lede, .hero .eyebrow { display: none; }
  .tool { display: block; }
  .receipt { border: 1px solid var(--border); }
}