/* Winter Rock: the shared stylesheet. Every page links this file; a page may add ONE small
   stylesheet of its own beside it. Plain CSS, system fonts, nothing from another host.

   Class names for every page
   --------------------------
   Layout        .wrap (centred column, 16px gutters)   .sr (read aloud, not shown)   .icon (inline SVG glyph)
   Masthead      header.masthead > .wrap > a.brand (+ svg.brand-mark) and nav.masthead-nav
                 each nav link carries a line colour and an i.dot; the "All tools" link has .all
   Footer        footer.site-foot > .wrap > .brand, p.foot-legal, p.foot-small
   Line colours  .line-people  .line-property  .line-building  .line-study  .line-learning  .line-neutral
                 Put one on any box. It sets --c (the colour), --c-ink (text in that colour) and
                 --tint (a pale background) for everything inside it.
   Panel         section.panel > .panel-in > .panel-copy + .panel-pic   (.panel.flip puts the picture first)
                 inside the copy: p.eyebrow (with span.badge), h2, p.panel-sub, div.go (a row of buttons)
   Card          .card (a white box with a soft shadow)   .chip (a small rounded label)   .badge (icon square)
   Tool card     .tool > .tool-head (.chip, h2, p.tool-one, .example-tag), .fields, .split (.cal + .answer),
                 .alt, details.how, .tool-foot (with a.more)
                 .answer holds .ans-label, .ans-big, .ans-sum, .ans-range and carries aria-live="polite"
                 .cal > .cal-title + .cal-grid (.wd weekday letters, .d days, .d.on, .d.start)
                 .sum > .line (and .line.total): rows of a worked sum, as calc.js and the other scripts write them
   Tab strip     div.tabs[role=tablist] > button.tab[role=tab][aria-selected]; panels are [role=tabpanel]
                 add .tabs-wrap to let the tabs wrap onto two lines instead of scrolling inside the strip
   Buttons       .btn (filled, in the line colour)   .btn.btn-ghost (outlined)   work on <a> and <button>
   Form controls .fields (two-column grid) > label.field > span text + .input > input|select|textarea
                 .input .pre (a "$" before the box)   .hint (a quiet line under a field)
                 label.check (a checkbox and its words on one line)
   Disclosure    details.how > summary ("How this works") + the detail
   Notes         p.site-note (the short "Useful tools, not legal advice." line near the top)

   Colour tokens: --bg --surface --ink --ink-2 --line --field --focus --paper --paper-ink --paper-rule
   --shadow --shadow-lg --bad, and per line --people --prop --build --study --learn --plain, each with -ink and -tint.
   Dark mode follows the system, and :root[data-theme="dark"|"light"] forces one.
*/

:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6a6a6f;
  --line: #e2e2e7;
  --field: #f4f4f7;
  --focus: #0a66e0;
  --paper: #fffefa;
  --paper-ink: #2a2a2a;
  --paper-rule: #d9d6cc;
  --on-c: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px rgba(20, 20, 40, .08);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .05), 0 24px 60px rgba(20, 20, 40, .12);

  --people: #e5533d; --people-ink: #b2361f; --people-tint: #fff1ec;
  --prop:   #1f9d62; --prop-ink:   #11704a; --prop-tint:   #eaf7f0;
  --build:  #e39a00; --build-ink:  #8a5600; --build-tint:  #fff5de;
  --study:  #5856d6; --study-ink:  #3d3bb3; --study-tint:  #efeffd;
  --learn:  #d6408a; --learn-ink:  #a62466; --learn-tint:  #fdeef5;
  --plain:  #8e8e93; --plain-ink:  #48484d; --plain-tint:  #f1f1f4;
  --bad: #d63a2f;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 28px;

  --c: var(--plain); --c-ink: var(--plain-ink); --tint: var(--plain-tint);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0d; --surface: #1c1c1f; --ink: #f5f5f7; --ink-2: #a1a1a8; --line: #303036;
    --field: #2a2a2f; --focus: #64a8ff; --on-c: #111111;
    --paper: #e8e5dc; --paper-ink: #222222; --paper-rule: #bdb9ad;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .45);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 60px rgba(0, 0, 0, .55);
    --people: #ff7a63; --people-ink: #ff9d8b; --people-tint: #2a1613;
    --prop:   #3ccf8a; --prop-ink:   #74e0ab; --prop-tint:   #0f2219;
    --build:  #ffb938; --build-ink:  #ffcb6b; --build-tint:  #2a200d;
    --study:  #8e8cff; --study-ink:  #b0afff; --study-tint:  #1b1a36;
    --learn:  #ff6fae; --learn-ink:  #ff9cc8; --learn-tint:  #2a1420;
    --plain:  #8e8e93; --plain-ink:  #d1d1d6; --plain-tint:  #1f1f23;
    --bad: #ff6f62;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0d; --surface: #1c1c1f; --ink: #f5f5f7; --ink-2: #a1a1a8; --line: #303036;
  --field: #2a2a2f; --focus: #64a8ff; --on-c: #111111;
  --paper: #e8e5dc; --paper-ink: #222222; --paper-rule: #bdb9ad;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 60px rgba(0, 0, 0, .55);
  --people: #ff7a63; --people-ink: #ff9d8b; --people-tint: #2a1613;
  --prop:   #3ccf8a; --prop-ink:   #74e0ab; --prop-tint:   #0f2219;
  --build:  #ffb938; --build-ink:  #ffcb6b; --build-tint:  #2a200d;
  --study:  #8e8cff; --study-ink:  #b0afff; --study-tint:  #1b1a36;
  --learn:  #ff6fae; --learn-ink:  #ff9cc8; --learn-tint:  #2a1420;
  --plain:  #8e8e93; --plain-ink:  #d1d1d6; --plain-tint:  #1f1f23;
  --bad: #ff6f62;
  color-scheme: dark;
}

/* ---------- the five lines of work, and a neutral one ---------- */
.line-people   { --c: var(--people); --c-ink: var(--people-ink); --tint: var(--people-tint); }
.line-property { --c: var(--prop);   --c-ink: var(--prop-ink);   --tint: var(--prop-tint); }
.line-building { --c: var(--build);  --c-ink: var(--build-ink);  --tint: var(--build-tint); }
.line-study    { --c: var(--study);  --c-ink: var(--study-ink);  --tint: var(--study-tint); }
.line-learning { --c: var(--learn);  --c-ink: var(--learn-ink);  --tint: var(--learn-tint); }
.line-neutral  { --c: var(--plain);  --c-ink: var(--plain-ink);  --tint: var(--plain-tint); }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.47;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.08; letter-spacing: -0.022em; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- masthead ---------- */
.masthead { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.masthead .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; font-size: 17px; text-decoration: none; letter-spacing: -0.01em; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-mark .peak { fill: var(--bg); }
.masthead-nav { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.masthead-nav a { text-decoration: none; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.masthead-nav a:hover, .masthead-nav a[aria-current] { color: var(--ink); }
.masthead-nav .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.masthead-nav .all { font-weight: 600; color: var(--ink); }
@media (max-width: 860px) { .masthead-nav a:not(.all) { display: none; } }

/* ---------- footer ---------- */
.site-foot { margin-top: 56px; border-top: 1px solid var(--line); }
.site-foot .wrap { padding-top: 28px; padding-bottom: 40px; display: grid; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.site-foot .brand { font-size: 15px; }
.site-foot .brand-mark { width: 22px; height: 22px; }
.foot-legal { max-width: 78ch; line-height: 1.5; }
.foot-legal b { color: var(--ink); font-weight: 650; }

/* ---------- small shared pieces ---------- */
.site-note { font-size: 14px; color: var(--ink-2); }
.site-note b { color: var(--ink); font-weight: 650; }
.card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; letter-spacing: .01em;
  padding: 5px 10px 5px 8px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  color: var(--c-ink); background: var(--tint); }
.chip .icon { font-size: 15px; }
.badge { width: 34px; height: 34px; border-radius: 10px; background: var(--c); color: var(--on-c); display: grid; place-items: center; font-size: 19px; flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 11px 18px; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 600;
  text-decoration: none; background: var(--c-ink); color: var(--on-c); border: 0; cursor: pointer; transition: filter .2s; }
.btn:hover { filter: brightness(1.08); }
.btn.btn-ghost { background: transparent; color: var(--c-ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent); }

/* ---------- panels: one idea per screen ---------- */
.panel { margin: 24px auto 0; max-width: 1200px; padding: 0 16px; }
.panel-in { background: var(--tint); border-radius: var(--radius); padding: clamp(28px, 5vw, 64px);
  min-height: min(86vh, 760px); display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 4vw, 56px); align-items: center;
  overflow: hidden; position: relative; }
.panel.flip .panel-in { grid-template-columns: 1.1fr .9fr; }
.panel.flip .panel-copy { order: 2; }
.panel-pic { position: relative; min-width: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 650; color: var(--c-ink); }
.panel h2 { font-size: clamp(32px, 4.4vw, 56px); margin-top: 18px; }
.panel-sub { margin-top: 16px; font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); max-width: 32ch; }
.go { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

/* ---------- tool card ---------- */
.tool { position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 26px 28px 22px; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.tool-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tool h2 { font-size: 26px; margin-top: 12px; }
.tool-one { color: var(--ink-2); margin-top: 4px; font-size: 15.5px; }
.example-tag { font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: stretch; }
.answer { display: flex; flex-direction: column; justify-content: center; border-radius: 16px; padding: 16px 18px; background: var(--tint); }
.ans-label { font-size: 13px; font-weight: 600; color: var(--c-ink); }
.ans-big { font-family: var(--display); font-size: clamp(34px, 3.6vw, 46px); font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.05; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ans-sum { margin-top: 10px; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink); }
.ans-range { margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.alt { margin-top: 14px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.alt b { color: var(--ink); font-weight: 600; }
.tool-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.more { color: var(--c-ink); font-weight: 600; text-decoration: none; font-size: 14px; }
.more:hover { text-decoration: underline; }

.cal { background: var(--field); border-radius: 16px; padding: 12px 12px 10px; }
.cal-title { font-size: 13px; font-weight: 650; display: flex; justify-content: space-between; color: var(--ink); }
.cal-title span:last-child { color: var(--ink-2); font-weight: 500; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 8px; font-size: 12px;
  font-variant-numeric: tabular-nums; text-align: center; }
.cal-grid .wd { color: var(--ink-2); font-size: 10.5px; font-weight: 600; padding-bottom: 2px; }
.cal-grid .d { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); cursor: pointer;
  transition: background .2s, color .2s; user-select: none; }
.cal-grid .d:hover { background: color-mix(in srgb, var(--c) 14%, transparent); }
.cal-grid .d.on { background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c-ink); font-weight: 600; }
.cal-grid .d.start { background: var(--c-ink); color: var(--on-c); font-weight: 700; }

/* rows of a worked sum, as the tool scripts write them */
.sum { display: grid; gap: 2px; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.sum .line { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sum .line span:first-child { flex: 1 1 12rem; color: var(--ink-2); }
.sum .line span:last-child { margin-left: auto; font-weight: 600; }
.sum .line.total { border-bottom: 0; font-size: 17px; }
.sum .line.total span:first-child { color: var(--ink); font-weight: 600; }

/* ---------- tab strip ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--field); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tabs.tabs-wrap { flex-wrap: wrap; border-radius: 18px; }
.tab { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink-2); padding: 8px 14px; border-radius: 999px; white-space: nowrap; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.tab .icon { font-size: 16px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--c-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- form controls ---------- */
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 18px; }
.field { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); align-content: start; }
/* where no field in the grid has a hint under its box, a label that wraps onto two lines does not push its box
   below the box beside it: each label sits on its own box */
.fields:not(:has(> .field .hint)) > .field:has(> .input) { align-content: end; }
.input { display: flex; align-items: center; background: var(--field); border-radius: 12px; border: 1.5px solid transparent;
  transition: border-color .15s, background .15s; }
.input:focus-within { border-color: var(--focus); background: var(--surface); }
.input input, .input select, .input textarea { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: var(--ink); font: inherit;
  font-size: 17px; font-weight: 500; padding: 11px 12px; width: 100%; min-width: 0; outline: none; font-variant-numeric: tabular-nums; }
.input select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input textarea { resize: vertical; min-height: 5em; }
.input .pre { padding-left: 12px; color: var(--ink-2); font-size: 17px; }
.input .pre + input { padding-left: 4px; }
.hint { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--c-ink); margin: 0; }

/* ---------- disclosure ---------- */
.how { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.how > summary { cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.how > summary::-webkit-details-marker { display: none; }
.how > summary::before { content: "\203A"; display: inline-block; font-size: 18px; line-height: 1; color: var(--c-ink); transition: transform .2s; }
.how[open] > summary::before { transform: rotate(90deg); }
.how > :not(summary) { margin-top: 10px; }

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

/* ---------- smaller screens ---------- */
@media (max-width: 980px) {
  .panel-in, .panel.flip .panel-in { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .panel.flip .panel-copy { order: 0; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .tool { padding: 20px 16px 16px; border-radius: 22px; }
  .tool h2 { font-size: 22px; }
  /* the heading and the Example tag share the top line; the one-line explanation runs the full width under them */
  .tool-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; }
  .tool-head > div { display: contents; }
  .tool-head > div > * { grid-column: 1 / -1; }
  .tool-head > div > :is(h1, h2, .chip) { grid-column: 1; justify-self: start; }
  .tool-head > .example-tag { grid-column: 2; grid-row: 1; align-self: start; }
  .fields { gap: 8px; }
  .input input, .input select, .input textarea { font-size: 16px; padding: 10px 8px; }
  .input .pre { padding-left: 8px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .split .cal { order: 2; }
  .panel-in { padding: 26px 18px; border-radius: 22px; }
}

@media print {
  .masthead, .tabs { display: none; }
  body { background: #fff; color: #000; }
  .panel-in, .tool, .card { box-shadow: none; }
}

/* The contact line stays out of sight until a real address replaces the placeholder. Remove this rule then. */
[data-wording="shared.contact"] { display: none; }
