
:root {
  --bg: #f4f7f8;
  --paper: #ffffff;
  --field: #ffffff;
  --ink: #12242b;
  --muted: #55676e;
  --line: #dbe4e7;
  --teal: #005065;
  --teal-dark: #003a4a;
  --gold: #cf9a3c;
  --good: #1b6b42;
  --good-bg: #e6f5ec;
  --tight: #8a5a10;
  --tight-bg: #fbf3df;
  --bad: #8c3834;
  --bad-bg: #fbeceb;
  --shadow: 0 6px 24px rgba(0, 60, 80, 0.07);
  --serif: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.5 var(--sans);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus { left: 1rem; top: 1rem; background: white; padding: 0.4rem 0.6rem; z-index: 6; }

.wrap { max-width: 44rem; margin: 0 auto; padding: 0.75rem 1rem 3rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0 -1rem;
  padding: 0.7rem 1rem 0.55rem;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.brand-tag { color: var(--muted); font-size: 0.82rem; letter-spacing: 0.02em; }
.site-header .nav { grid-column: 1 / -1; margin-top: 0.2rem; }
.brand {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.brand img { height: 50px; width: auto; display: block; }
.brand strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.brand span { display: block; color: var(--muted); font-size: 0.88rem; }

.nav, .footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin-top: 0.85rem;
  font-size: 0.92rem;
}
.nav a, .footer-nav a { color: var(--teal-dark); text-underline-offset: 0.15em; }
.nav a { text-decoration: none; padding: 0.15rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--gold); }
.nav a[aria-current="page"] { font-weight: 700; border-bottom-color: var(--gold); }

h1, h2 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.4rem;
  color: var(--teal-dark);
}
h1 { font-size: 1.7rem; margin-top: 1.1rem; }
h2 { font-size: 1.2rem; }

.lede, .fine, .hint { color: var(--muted); }
.lede { margin-top: 0; }
.fine { font-size: 0.92rem; margin: 0.35rem 0 0; }
.hint { margin: 0.75rem 0; }

.card, .result, .summary {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.15rem;
}
.stack { display: grid; gap: 0.85rem; margin-top: 0.85rem; }
.card + .card, .stack { margin-top: 0.85rem; }

.field { margin: 0 0 0.75rem; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0 0.75rem; align-items: end; }
label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 0.3rem; }
.help { display: block; color: var(--muted); font-weight: 450; font-size: 0.82rem; }

input, select, button { font: inherit; color: inherit; }
input:not([type="checkbox"]):not([type="radio"]), select {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #c3d0d5;
  background: var(--field);
}
input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: none;
  accent-color: var(--teal);
}
input::placeholder { color: #9a9186; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid #8fc3d2;
  outline-offset: 2px;
}

button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  border: 0;
  background: var(--teal);
  color: white;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
button:disabled { opacity: 0.65; cursor: not-allowed; }
button.full { width: 100%; }
button.ghost, .consent .ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
}

.error, .success {
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  margin: 0.75rem 0 0;
}
.error { background: var(--bad-bg); color: var(--bad); }
.success { background: var(--good-bg); color: var(--good); }

.summary { margin-bottom: 0.75rem; }
.summary p { margin: 0.3rem 0; }
.result { border-left: 6px solid var(--line); margin-bottom: 0.75rem; }
.result.comfortable { border-left-color: var(--good); }
.result.tight { border-left-color: var(--tight); }
.result.not-affordable { border-left-color: var(--bad); }
.result-head { display: flex; justify-content: space-between; gap: 0.6rem; align-items: flex-start; }
.result h3 { margin: 0; font-size: 1.1rem; color: var(--teal-dark); }
.where { margin: 0.15rem 0 0.55rem; color: var(--muted); font-size: 0.9rem; }
.rent-line { margin: 0; font-weight: 720; }
.share-line { margin: 0.2rem 0 0; }
.pill {
  font-size: 0.78rem;
  font-weight: 750;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill.comfortable { background: var(--good-bg); color: var(--good); }
.pill.tight { background: var(--tight-bg); color: var(--tight); }
.pill.not-affordable { background: var(--bad-bg); color: var(--bad); }

.budget {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.28rem 0.75rem;
  margin: 0.75rem 0 0.35rem;
}
.budget dt { color: var(--muted); }
.budget dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.budget .total { font-weight: 760; color: var(--ink); }
.left { margin: 0.55rem 0 0; font-weight: 700; }

.prose p, .prose li { color: var(--ink); }
.prose h2 { margin-top: 1.3rem; }
.prose ul { padding-left: 1.1rem; }
.prose a { color: var(--teal-dark); }

footer {
  margin-top: 1.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}
footer strong { color: var(--ink); }

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent {
  max-width: 42rem; margin: 0 auto;
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 5;
  background: #003a4a;
  color: #ffffff;
  border-radius: 16px;
  padding: 0.9rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}
.consent p { margin: 0 0 0.7rem; font-size: 0.92rem; }
.consent-actions { display: flex; gap: 0.5rem; }
.consent-actions button { flex: 1; }
body.has-consent { padding-bottom: 8.5rem; }

#turnstile { min-height: 0; }
#turnstile:empty { display: none; }
.stepper { overflow: hidden; }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 25%; background: var(--gold); transition: width 0.35s ease; }
.step-kicker { margin: 0.7rem 0 0.2rem; color: var(--muted); font-size: 0.85rem; }
.step { display: none; }
.step.active { display: block; animation: rise 0.35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.step-actions { display: flex; gap: 0.6rem; margin-top: 0.4rem; }
.step-actions .full { flex: 1; }
.choices { border: 0; margin: 0 0 0.8rem; padding: 0; }
.choices legend { font-weight: 680; margin-bottom: 0.4rem; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.45rem; }
.check {
  display: flex; gap: 0.55rem; align-items: center;
  margin: 0; padding: 0.5rem 0.7rem;
  font-size: 0.92rem; font-weight: 500;
  border: 1px solid var(--line); border-radius: 8px; background: var(--field);
  cursor: pointer;
}
.check:hover { border-color: #9db8c1; }
.check:has(input:checked) { border-color: var(--teal); background: #eef6f8; }
.check-wide { margin-bottom: 0.45rem; }
.multi-toggle {
  width: 100%; justify-content: space-between;
  background: var(--field); color: var(--ink);
  border: 1px solid #c3d0d5; border-radius: 8px;
  font-weight: 500; padding: 0.5rem 0.7rem;
}
.multi-toggle::after { content: ""; width: 0.5rem; height: 0.5rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); margin-left: 0.6rem; }
.multi-toggle[aria-expanded="true"]::after { transform: rotate(-135deg) translateY(-2px); }
.multi-panel { margin-top: 0.35rem; border: 1px solid #c3d0d5; border-radius: 8px; background: var(--field); padding: 0.5rem; }
.multi-list { max-height: 15rem; overflow: auto; margin-top: 0.4rem; }
.multi-group { margin: 0.5rem 0 0.15rem; padding: 0 0.4rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); }
.opt { display: flex; gap: 0.55rem; align-items: center; margin: 0; padding: 0.38rem 0.4rem; font-size: 0.92rem; font-weight: 450; border-radius: 6px; cursor: pointer; }
.opt:hover { background: #eef6f8; }
.multi-tools { display: flex; gap: 0.4rem; }
.multi-tools button { min-height: 44px; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.chip { min-height: 0; padding: 0.22rem 0.6rem; border-radius: 999px; font-size: 0.82rem; font-weight: 600; background: #eef6f8; color: var(--teal-dark); border: 1px solid #b9d3db; }
.chip span { margin-left: 0.35rem; font-weight: 700; }
.notice { font-size: 0.95rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0; }
.filters select { width: auto; min-width: 9.5rem; min-height: 40px; }
.share-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 0.45rem 0; }
.share-bar span { display: block; height: 100%; width: 0; background: var(--teal); transition: width 0.7s ease; }
.result.comfortable .share-bar span { background: var(--good); }
.result.tight .share-bar span { background: var(--tight); }
.result.not-affordable .share-bar span { background: var(--bad); }
.card-top { width: 100%; text-align: left; background: transparent; color: inherit; border: 0; border-radius: 0; padding: 0; min-height: 0; display: block; }
.details { margin-top: 0.6rem; }
.donut-wrap { display: flex; gap: 0.8rem; align-items: center; margin-top: 0.6rem; }
.donut { width: 92px; height: 92px; transform: rotate(-90deg); }
.goal { font-weight: 700; margin: 0.35rem 0 0; }
.indic { color: var(--tight); }
.invalid, .invalid:focus-visible { border-color: var(--bad) !important; background: var(--bad-bg) !important; }
fieldset.invalid { background: transparent !important; outline: 2px solid var(--bad); outline-offset: 6px; border-radius: 6px; }
.hand-wrap { background: linear-gradient(180deg, #ffffff 0%, #eaf2f4 100%); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 1.15rem 1.15rem 0.4rem; overflow: hidden; }
.hand { position: relative; margin-top: 2rem; }
.pcard {
  position: absolute; bottom: 0; left: 50%;
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0.25rem;
  min-height: 0; padding: 0.55rem 0.6rem 0.6rem; text-align: left;
  background: #fff; color: var(--ink); font-weight: 400;
  border: 1px solid #c9d6da; border-top: 6px solid var(--line); border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 50, 70, 0.18);
  transform-origin: 50% 320%; opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.pcard.comfortable { border-top-color: #2e9e5b; }
.pcard.tight { border-top-color: #e0a526; }
.pcard.not-affordable { border-top-color: #d9453c; }
.pcard.sponsor { border-top-color: var(--gold); background: linear-gradient(180deg, #fffaf0 0%, #ffffff 70%); border-style: dashed; border-top-style: solid; }
.pcard-ad { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #7a5a14; }
.pcard-star { margin-top: auto; font-size: 2.2rem; line-height: 1; color: var(--gold); text-align: center; }
.pcard.sponsor .pcard-cap { text-align: center; }
.pcard.picked { box-shadow: 0 14px 30px rgba(0, 50, 70, 0.32); border-color: var(--teal); }
.pcard-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.7rem; color: var(--muted); }
.pcard-top .pill { font-size: 0.62rem; padding: 0.1rem 0.4rem; }
.pcard-name { font-weight: 700; font-size: 1rem; line-height: 1.15; color: var(--teal-dark); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.1em; }
.pcard-where { font-size: 0.7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-num { margin-top: auto; font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pcard-cap { font-size: 0.68rem; color: var(--muted); }
.pcard .meter-track { height: 6px; margin-top: 0.3rem; }
.pcard .meter-pin { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-width: 2px; }
.hand-hint { margin: 0.2rem 0 0.6rem; text-align: center; font-size: 0.8rem; color: var(--muted); }
#hand-detail { margin-top: 0.85rem; }
.data-strip { margin: 0.2rem 0 0; padding: 0.5rem 0.75rem; border-left: 3px solid var(--gold); background: #fff; border-radius: 0 8px 8px 0; font-size: 0.86rem; color: var(--muted); }
.data-strip strong { color: var(--teal-dark); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0.7rem 0; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 0.55rem 0.7rem; border-top: 4px solid var(--line); background: #fff; }
.tile b { display: block; font-size: 1.6rem; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.tile span { font-size: 0.8rem; color: var(--muted); }
.tile.comfortable { border-top-color: #2e9e5b; }
.tile.tight { border-top-color: #e0a526; }
.tile.not-affordable { border-top-color: #d9453c; }
.chart-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 1.15rem; }
.bar-row { display: grid; grid-template-columns: minmax(6rem, 10rem) 1fr 6.4rem; gap: 0.6rem; align-items: center; padding: 0.22rem 0; font-size: 0.86rem; }
.bar-row:hover { background: #f4f8f9; }
.bar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.bar-track { position: relative; height: 14px; }
.bar-zero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: #9fb1b8; }
.bar-fill { position: absolute; top: 0; height: 100%; min-width: 2px; border-radius: 4px; transition: width 0.6s ease, left 0.6s ease; }
.bar-fill.comfortable { background: #2e9e5b; }
.bar-fill.tight { background: #e0a526; }
.bar-fill.not-affordable { background: #d9453c; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.6rem; font-size: 0.8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.35rem; }
.meter { margin: 0.6rem 0 0.2rem; }
.meter-cap { margin: 0 0 0.45rem; font-size: 0.86rem; color: var(--muted); }
.meter-track { position: relative; height: 10px; border-radius: 999px; background: linear-gradient(90deg, #2e9e5b 0%, #7fbf55 35%, #e9c53b 55%, #ee8f3a 75%, #d9453c 100%); }
.meter-pin { position: absolute; top: 50%; left: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff; border: 3px solid var(--teal-dark); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); transition: left 0.8s ease; }
.meter-scale { display: grid; grid-template-columns: 50% 25% 25%; margin-top: 0.3rem; font-size: 0.72rem; color: var(--muted); }
.meter-scale span + span { border-left: 1px solid var(--line); padding-left: 0.3rem; }
.gap { background: var(--tight-bg); color: var(--tight); border-radius: 12px; padding: 0.8rem; }
.ad-slot { display: none; margin: 2rem 0; min-height: 110px; }
.ad-label { margin: 0 0 0.35rem; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ad-frame { min-height: 90px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--paper) 70%, var(--bg)); }
.ad-space { margin: 0; color: var(--muted); }
.adsbygoogle { display: block; min-height: 90px; }
body.preview .ad-slot:not(.ad-anchor),
body.ads-live .ad-slot:not(.ad-anchor),
body.preview .ad-slot:not(.ad-anchor)[hidden],
body.ads-live .ad-slot:not(.ad-anchor)[hidden] { display: block !important; }
.ad-anchor { position: sticky; bottom: 0; z-index: 3; margin: 0; }
@media (max-width: 720px) {
  body.preview.show-anchor .ad-anchor,
  body.ads-live.show-anchor .ad-anchor,
  body.preview.show-anchor .ad-anchor[hidden],
  body.ads-live.show-anchor .ad-anchor[hidden] { display: block !important; }
}
@media (prefers-reduced-motion: reduce) {
  .step.active, .progress span, .share-bar span, .meter-pin, .bar-fill, .pcard { animation: none; transition: none; }
}

@media (min-width: 720px) {
  .wrap { padding-top: 1.25rem; }
  h1 { font-size: 2.15rem; }
}


.ad-slot { display: block; margin: 2rem 0; min-height: 0; }
.ad-slot .adsbygoogle { min-height: 100px; }
.nav { gap: 0.3rem 0.8rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 0.6rem 0 0.4rem; }
.prose th, .prose td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--teal-dark); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; background: #f7fafb; }
.prose td.n, .prose th.n { text-align: right; white-space: nowrap; }
.prose table.wide { min-width: 34rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -0.25rem; }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.05rem 0.4rem; border-radius: 999px; background: var(--tight-bg); color: var(--tight); white-space: nowrap; }
.tag.pub { background: var(--good-bg); color: var(--good); }
.src { font-size: 0.85rem; color: var(--muted); }
.callout { border-left: 3px solid var(--gold); background: #fffaf0; padding: 0.7rem 0.9rem; border-radius: 0 10px 10px 0; margin: 0.9rem 0; }
.cta { display: inline-block; background: var(--teal); color: #fff !important; text-decoration: none; font-weight: 700; padding: 0.65rem 1rem; border-radius: 10px; margin: 0.4rem 0 0.2rem; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin-top: 0.9rem; }
.crumbs a { color: var(--teal-dark); }
.guide-list { list-style: none; padding: 0 !important; display: grid; gap: 0.6rem; }
.guide-list li a { display: block; padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; background: #fff; }
.guide-list li a strong { display: block; color: var(--teal-dark); }
.guide-list li a span { color: var(--muted); font-size: 0.9rem; }
.faq h3 { font-size: 1rem; margin: 1rem 0 0.25rem; color: var(--ink); }
.updated { font-size: 0.85rem; color: var(--muted); }
footer .footer-nav { margin-top: 0.5rem; }

.tool { display: grid; gap: 0.7rem; background: var(--good-bg, #eef7f2); padding: 1rem; border-radius: 12px; margin: 0.8rem 0 1.2rem; }
.tool label { display: grid; gap: 0.25rem; font-weight: 600; }
.tool input, .tool select { font: inherit; padding: 0.55rem 0.6rem; border: 1px solid #b9c7cc; border-radius: 8px; background: #fff; }
.tool-out p { margin: 0.25rem 0; }
.tag.bad { background: #fde8e6; color: #a1281b; }
.guide-cat { margin: 1.2rem 0 0.3rem; font-size: 1.05rem; }
