/* Same system as dscr-calculator and rental-cashflow (type, spacing, fields, cards); coral accent and a warm paper
   from the Canva art. #E0603C is decoration only: white on it is 3.5:1, so text, links and buttons use #B4462B (5.0:1+). */
:root {
  color-scheme: light;
  --paper: #FBF4EC;
  --panel: #FFFFFF;
  --ink: #1E2A2D;
  --muted: #566467;
  --line: #E8DDD2;
  --field: #B9AEA4;
  --accent: #B4462B;
  --accent-dark: #8F3A20;
  --coral: #E0603C;
  --soft: #FCE9E1;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 7vw, 2.75rem); font-weight: 760; margin: 0 0 8px; }
h2 { font-size: 1.5rem; font-weight: 700; margin: 40px 0 12px; }
h3 { font-size: 1.15rem; font-weight: 680; margin: 28px 0 8px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.top { border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; font-weight: 680; color: var(--ink); text-decoration: none; }
.brand img { border-radius: 6px; }

.intro { padding: 28px 0 20px; max-width: 64ch; }
.lede { font-size: 1.125rem; color: var(--muted); margin: 0; }
.note { background: var(--soft); padding: 10px 14px; border-radius: 8px; }

/* Tool: paste | result side by side from 900px. */
.tool { display: grid; gap: 16px; }
/* Phones: paste, result, options. From 900px: paste and options on the left, result on the right. */
@media (min-width: 900px) {
  .tool { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "in out" "opts out"; gap: 24px; align-items: start; }
  .tool .in { grid-area: in; }
  .tool .result { grid-area: out; }
  .tool .opts { grid-area: opts; }
}
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.result { border-top: 6px solid var(--coral); }
.card h2 { font-size: 1.1rem; margin: 0 0 10px; }
.head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.head label, .head h2 { font-weight: 700; font-size: 1.1rem; margin: 0; }

.private { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 600; color: var(--accent-dark); }
.private svg { flex: none; }

textarea {
  display: block; width: 100%; min-height: 240px; max-height: 70vh; resize: vertical; margin-top: 8px;
  padding: 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--panel);
  font: inherit; font-size: 1rem; color: var(--ink);
}
textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
@media (min-width: 900px) { textarea { min-height: 420px; } }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.check-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
.hint { margin: 0 0 4px 32px; font-size: 0.9rem; color: var(--muted); }
select {
  min-height: 40px; padding: 0 34px 0 10px; border: 1px solid var(--field); border-radius: 8px;
  -webkit-appearance: none; appearance: none; background-color: var(--panel); font: inherit; font-size: 0.95rem; color: var(--ink);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}

/* Destination chips: a native radio group, styled. */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--field); background: var(--panel); font-weight: 600; font-size: 0.95rem; white-space: nowrap;
}
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.dest-opts { margin-top: 6px; }

.out {
  margin-top: 12px; min-height: 200px; max-height: 70vh; overflow: auto; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #FFFDFB; overflow-wrap: anywhere;
}
@media (min-width: 900px) { .out { min-height: 300px; max-height: 520px; } }
.out pre { margin: 0; font: inherit; white-space: pre-wrap; }
.out p { margin: 0 0 10px; }
.out h1, .out h2, .out h3 { margin: 14px 0 8px; }
.out h1:first-child, .out h2:first-child, .out h3:first-child, .out p:first-child { margin-top: 0; }
.out ul, .out ol { margin: 0 0 10px; padding-left: 1.4em; }
.out table { margin: 0 0 10px; font-size: 0.95rem; }
.empty { color: var(--muted); }

.meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 8px 0 0; font-size: 0.9rem; color: var(--muted); }
.meta .over { color: #B23A2E; font-weight: 650; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.btn {
  min-height: 48px; padding: 0 18px; border: 1px solid var(--accent); border-radius: 8px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-weight: 650;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.alt { background: var(--panel); color: var(--accent); }
.btn.alt:hover { background: var(--soft); }
.btn.plain { background: none; border-color: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; padding: 0 8px; }
#status { color: var(--muted); font-size: 0.9rem; min-height: 1.4em; margin: 8px 0 0; }

/* Reserved for ads later, so adding them shifts nothing. Empty until then. */
.ad-slot { min-height: 250px; margin: 16px 0; }

/* Article */
.guide, .faq, .prose { max-width: 68ch; }
.guide { margin-top: 24px; }
.guide ul { padding-left: 1.2em; }
.guide li { margin-bottom: 10px; }
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.guide table { border-collapse: collapse; min-width: 460px; width: 100%; font-size: 0.95rem; }
.guide th, .guide td { padding: 10px 12px 10px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.guide thead th { border-bottom: 2px solid var(--ink); }
.guide code, .ba pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.92em; }
.ba { display: grid; gap: 10px; margin: 14px 0 6px; }
@media (min-width: 640px) { .ba { grid-template-columns: 1fr 1fr; } }
.ba > div { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 10px 12px; }
.ba p.label { margin: 0 0 6px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.ba pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ba .after p { margin: 0 0 6px; }
.ba .after ul { margin: 0; padding-left: 1.2em; }
.ba .demo-h { font-weight: 700; font-size: 1.15rem; }
.ba table { border-collapse: collapse; min-width: 0; }
.ba td, .ba th { border: 1px solid #c8c8c8; padding: 4px 8px; }
.prompt { margin: 16px 0; padding: 12px 16px; background: var(--panel); border-left: 4px solid var(--coral); border-radius: 0 10px 10px 0; }
.faq h2 { margin-top: 8px; }
.faq { margin-bottom: 48px; }

.prose { padding-top: 28px; padding-bottom: 48px; }
.prose h1 { font-size: clamp(1.9rem, 6vw, 2.4rem); }
.prose ul { padding-left: 1.2em; }

.foot { border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 0.95rem; padding: 18px 0 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot nav a { display: inline-flex; align-items: center; min-height: 44px; }
.foot p { margin: 8px 0 0; }
.foot .tools { margin-top: 4px; align-items: center; }
.foot .tools span { color: var(--muted); }
