/* ultimate-tp.com — honest bidet ROI calculator
   Mobile-first. No framework, no build step, no webfonts (nothing leaves the device). */

:root {
  --bg:        #f7f4ee;
  --surface:   #ffffff;
  --surface-2: #f2efe8;
  --ink:       #201d18;
  --ink-2:     #59524a;
  --ink-3:     #8b8378;
  --line:      #e0dad0;
  --line-2:    #cfc7ba;
  --accent:    #1f6f5c;
  --accent-in: #e6f2ee;
  --hedge:     #7a4a1e;
  --hedge-in:  #fbf0e3;
  --warn:      #9a3d2f;
  --good:      #1f6f5c;
  --radius:    14px;
  --shadow:    0 1px 2px rgba(32,29,24,.05), 0 6px 20px -12px rgba(32,29,24,.28);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #14120f;
    --surface:   #1d1a16;
    --surface-2: #24201b;
    --ink:       #f0ece4;
    --ink-2:     #b6ad9f;
    --ink-3:     #857d71;
    --line:      #322d26;
    --line-2:    #443d34;
    --accent:    #5ec5a6;
    --accent-in: #16302a;
    --hedge:     #e0a869;
    --hedge-in:  #2e2317;
    --warn:      #e08b7a;
    --good:      #5ec5a6;
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px -14px rgba(0,0,0,.8);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 640; letter-spacing: -.011em; }

/* ---------- masthead ---------- */

.masthead { padding: 1rem 0 1.5rem; }

.masthead h1 {
  font-size: clamp(1.75rem, 7.2vw, 2.9rem);
  letter-spacing: -.028em;
  text-wrap: balance;
}

.dek {
  font-size: 1.05rem;
  color: var(--ink-2);
  margin: .7rem 0 0;
  text-wrap: pretty;
}
.dek em { color: var(--ink); font-style: italic; }

.nocollect {
  margin: 1.1rem 0 0;
  padding: .7rem .85rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .84rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.nocollect strong { color: var(--ink); }

/* ---------- headline cards ---------- */

.headlines { display: grid; gap: .9rem; }
@media (min-width: 46rem) {
  .headlines { grid-template-columns: 1fr 1fr; align-items: start; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--accent);
}
.card--hedge { border-top-color: var(--hedge); background: linear-gradient(var(--hedge-in), var(--surface) 42%); }
.card--payback { background: linear-gradient(var(--accent-in), var(--surface) 42%); }

.card-kicker {
  margin: 0 0 .55rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.card-big {
  margin: 0;
  font-size: clamp(2.3rem, 10vw, 3.3rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.02;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  text-wrap: balance;
}
.card--hedge .card-big { color: var(--hedge); font-size: clamp(1.55rem, 6.2vw, 2.1rem); line-height: 1.14; }

.card-label {
  margin: .35rem 0 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
}
.card-sub { margin: .5rem 0 0; font-size: .86rem; color: var(--ink-2); text-wrap: pretty; }
.card-note {
  margin: .85rem 0 0;
  padding-top: .8rem;
  border-top: 1px dashed var(--line-2);
  font-size: .81rem;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}
.card-note em { color: var(--ink); }

.card-big.is-never { font-size: clamp(1.4rem, 5.6vw, 1.9rem); color: var(--warn); }

.assumption-strip {
  margin: .9rem 0 0;
  font-size: .8rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  text-wrap: pretty;
}

/* ---------- panels ---------- */

.grid { display: grid; gap: .9rem; }
@media (min-width: 46rem) { .grid { grid-template-columns: 1fr 1fr; align-items: start; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1rem 1.15rem;
  margin-top: .9rem;
}
.panel h2 { font-size: 1.06rem; }
.panel h3 {
  font-size: .92rem;
  margin: 1.3rem 0 .3rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}
.panel h3:first-of-type { margin-top: 1rem; }

.panel-intro {
  margin: .5rem 0 .2rem;
  font-size: .85rem;
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}
.panel-intro strong { color: var(--ink); }

.panel--hero { border-left: 3px solid var(--accent); }
.panel--risk { border-left: 3px solid var(--hedge); }
@media (min-width: 46rem) { .panel--risk, .panel--prefs { grid-column: 1 / -1; } }
.panel--wide { }

.tag {
  display: inline-block;
  vertical-align: 2px;
  margin-left: .4rem;
  padding: .1rem .42rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.tag--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line-2)); }
.tag--good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--line-2)); }
.tag--sm { font-size: .58rem; margin-left: .3rem; }

/* ---------- fields ---------- */

.field { margin-top: .85rem; }
.field label {
  display: block;
  font-size: .86rem;
  font-weight: 560;
  margin-bottom: .3rem;
}

input[type="number"], input[type="text"], select {
  width: 100%;
  padding: .58rem .65rem;
  font: inherit;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  appearance: none;
}
select { background-image: none; }
input:focus-visible, select:focus-visible, button:focus-visible, input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
input.is-bad { border-color: var(--warn); }

.hint { margin: .3rem 0 0; font-size: .76rem; color: var(--ink-3); line-height: 1.45; }
.hint--block { margin: .45rem 0 .2rem; font-size: .8rem; color: var(--ink-2); text-wrap: pretty; }
.hint--block strong, .hint--block em { color: var(--ink); }

/* ---------- the slider ---------- */

.slider-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.1rem;
}
.slider-row label { font-size: .95rem; font-weight: 600; margin: 0; }
.slider-out {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  margin: .7rem 0 .1rem;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line-2);
}
input[type="range"]::-moz-range-track {
  height: 8px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line-2);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px; height: 30px; margin-top: -12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: 0 1px 5px rgba(0,0,0,.3);
  cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--surface);
  box-shadow: 0 1px 5px rgba(0,0,0,.3);
  cursor: grab;
}

.slider-marks {
  display: flex;
  justify-content: space-between;
  font-size: .68rem;
  color: var(--ink-3);
  text-align: center;
  line-height: 1.3;
}
.slider-marks span:first-child { text-align: left; }
.slider-marks span:last-child { text-align: right; }
.slider-marks i { font-style: normal; opacity: .8; }

/* ---------- buttons ---------- */

.btnrow { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.1rem; }
.btn {
  flex: 1 1 auto;
  min-height: 44px;
  padding: .6rem 1rem;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9px;
  cursor: pointer;
}
@media (prefers-color-scheme: dark) { .btn { color: #10201c; } }
.btn--ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }

/* ---------- breakdown table ---------- */

.breakdown {
  width: 100%;
  border-collapse: collapse;
  margin-top: .9rem;
  font-size: .87rem;
}
.breakdown th, .breakdown td {
  padding: .55rem .1rem;
  text-align: left;
  vertical-align: baseline;
  border-bottom: 1px solid var(--line);
}
.breakdown th { font-weight: 500; color: var(--ink); }
.breakdown td:nth-child(2) {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 640;
  width: 1%;
  padding-left: .7rem;
}
.breakdown .note {
  font-size: .72rem;
  color: var(--ink-3);
  text-align: right;
  white-space: nowrap;
  padding-left: .6rem;
  width: 1%;
}
@media (max-width: 34rem) {
  .breakdown .note { display: none; }
}
.row--plus  td:nth-child(2) { color: var(--good); }
.row--minus td:nth-child(2) { color: var(--warn); }
.row--risk th { color: var(--ink-2); }
.row--sub th, .row--total th { font-weight: 660; }
.row--sub td:nth-child(2) { color: var(--ink); }
.row--total { background: var(--surface-2); }
.row--total th, .row--total td { border-bottom-color: var(--line-2); }
.row--grand th { font-size: .98rem; }
.row--grand td:nth-child(2) { font-size: 1.1rem; }

/* ---------- sensitivity ---------- */

.sens { list-style: none; margin: 1rem 0 0; padding: 0; }
.sens li { margin-bottom: .7rem; }
.sens-head {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: .82rem; margin-bottom: .22rem;
}
.sens-head b { font-weight: 560; }
.sens-head span { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sens-bar { height: 9px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.sens-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.sens li:nth-child(1) .sens-bar i { background: var(--accent); }
.sens li:nth-child(n+4) .sens-bar i { background: var(--line-2); }

/* ---------- method ---------- */

.panel--method .method h3 { font-size: .95rem; }
.panel--method .method p {
  margin: .4rem 0 0;
  font-size: .87rem;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}
.panel--method .method em, .panel--method .method strong { color: var(--ink); }

/* ---------- sticky bar ---------- */

.stickybar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  padding: .6rem 1rem;
  padding-bottom: max(.6rem, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line-2);
  font-size: .84rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.stickybar strong { color: var(--ink); font-weight: 680; }
.sb-sep { width: 1px; height: 1.1em; background: var(--line-2); }
@media (min-width: 46rem) { .stickybar { display: none; } }

/* ---------- footer ---------- */

footer {
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--ink-3);
  line-height: 1.6;
  text-wrap: pretty;
}
footer p { margin: 0 0 .6rem; }
footer .src { font-size: .76rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
