:root {
  color-scheme: dark;
  --bg: #16110e;
  --bg-2: #1e1713;
  --card: #211915;
  --card-2: #2a201b;
  --line: #3a2e27;
  --text: #f6ede6;
  --text-2: #cdbdb1;
  --muted: #9a887b;
  --wood: #d95926;
  --wood-hi: #ff8a3d;
  --el: #3987e5;
  --ember: #ffb23e;
  --good: #3fbf7f;
  --bad: #e66767;
  --glow: rgba(255, 110, 30, .22);
  --heat-0: #2a201b; --heat-1: #4a2a17; --heat-2: #7a3a14; --heat-3: #b14a17; --heat-4: #e8661f;
  --radius: 20px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #fbf6f1; --bg-2: #f4ebe3; --card: #ffffff; --card-2: #f8f1ea; --line: #eadcd0;
    --text: #23170f; --text-2: #5b4a3e; --muted: #85725f;
    --wood: #eb6834; --wood-hi: #d9531f; --el: #2a78d6; --ember: #c97a00;
    --good: #12895a; --bad: #c43c3c; --glow: rgba(235, 104, 52, .14);
    --heat-0: #f1e7de; --heat-1: #fbd9bf; --heat-2: #f8b184; --heat-3: #f08349; --heat-4: #d9531f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font);
  min-height: 100vh; overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.embers {
  position: fixed; inset: auto 0 0 0; height: 70vh; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 50% at 50% 100%, var(--glow), transparent 70%);
}
a { color: var(--wood-hi); }
.top, main, .foot { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 0 16px; }

.top { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 6px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.brand b { color: var(--wood-hi); }
.brand img { border-radius: 10px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 14px 0;
}
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
h1, h2 { margin: 0; letter-spacing: -.02em; }
h2 { font-size: 19px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.nowrap { white-space: nowrap; }

/* hero */
.hero {
  position: relative; overflow: hidden; padding: 22px 18px 18px;
  background: linear-gradient(160deg, var(--card-2), var(--card));
}
.hero::after {
  content: ""; position: absolute; inset: auto -20% -60% -20%; height: 120%; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(57, 135, 229, .14), transparent 70%);
  transition: background .6s;
}
.hero.is-wood::after { background: radial-gradient(50% 50% at 50% 50%, rgba(255, 110, 30, .38), transparent 70%); }
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hero-title { margin: 0; font-size: clamp(28px, 8vw, 40px); line-height: 1.08; font-weight: 750; letter-spacing: -.02em; position: relative; z-index: 1; }
.hero.is-wood .hero-title { color: var(--wood-hi); }
.flame { display: inline-block; animation: flick 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flick { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.12) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .flame { animation: none; } }
.hero-sub { color: var(--text-2); margin: 10px 0 16px; position: relative; z-index: 1; }
.hero-edit { position: relative; z-index: 1; display: inline-block; margin-top: 14px; font-weight: 600; font-size: 14px; text-decoration: none; }
.hero-edit.subtle { color: var(--muted); font-weight: 500; margin-left: 4px; }
.hero-edit:not(.subtle) { background: var(--wood); color: #fff; padding: 8px 14px; border-radius: 999px; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: relative; z-index: 1; }
.tile { background: color-mix(in srgb, var(--bg) 55%, transparent); border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; min-width: 0; }
.tile-k { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tile-wood .tile-k::before, .tile-el .tile-k::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--wood); }
.tile-el .tile-k::before { background: var(--el); }
.tile-v { font-size: clamp(20px, 6vw, 28px); font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-u { font-size: 11.5px; color: var(--muted); line-height: 1.3; }

/* scenario */
.scenario { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px; position: sticky; top: 8px; z-index: 5; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.seg { appearance: none; border: 0; background: transparent; color: var(--text-2); font: 600 14px var(--font); padding: 10px 8px; border-radius: 999px; cursor: pointer; }
.seg[aria-checked="true"] { background: var(--wood); color: #fff; }
.seg span { font-weight: 500; opacity: .85; font-size: 12px; }

/* chart */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin: 8px 0 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.sw-wood { background: var(--wood); } .sw-el { background: var(--el); }
.sw-line { height: 0; width: 16px; border-top: 2px dashed var(--ember); border-radius: 0; }
.chart-wrap { position: relative; margin: 0 -6px; }
.chart { width: 100%; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .baseline { stroke: var(--muted); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar-wood { fill: var(--wood); }
.chart .bar-el { fill: var(--el); }
.chart .bar-past { opacity: .45; }
.chart .bar-now { stroke: var(--text); stroke-width: 1.5; }
.chart .wood-line { stroke: var(--ember); stroke-width: 2; stroke-dasharray: 6 4; }
.chart .wood-label { fill: var(--ember); font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--card); stroke-width: 4px; }
.chart .daysep { stroke: var(--muted); stroke-dasharray: 2 3; opacity: .6; }
.chart .now-line { stroke: var(--text); stroke-width: 1; opacity: .5; }
.chart .now-label { fill: var(--text); font-size: 11px; font-weight: 700; }
.chart .best-band { fill: var(--wood); opacity: .1; }
.chart .best-label { fill: var(--wood-hi); font-size: 11px; font-weight: 700; }
.chart .hover-col { fill: var(--text); opacity: .07; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.tooltip {
  position: absolute; top: 8px; z-index: 3; min-width: 190px; pointer-events: none;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 13px;
}
.tt-h { font-weight: 700; margin-bottom: 4px; }
.tt-row { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); }
.tt-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.tt-verdict { margin-top: 6px; font-weight: 700; }
.table-view summary { cursor: pointer; color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.table-scroll { overflow-x: auto; max-height: 360px; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 5px 6px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { position: sticky; top: 0; background: var(--card); color: var(--muted); font-weight: 600; }
.row-wood td { color: var(--wood-hi); }

.link { background: none; border: 0; color: var(--wood-hi); font: 600 14px var(--font); cursor: pointer; padding: 0; }
.chip { appearance: none; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font: 600 13px var(--font); padding: 7px 12px; border-radius: 999px; cursor: pointer; }

/* compare */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.cmp { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 2px; background: var(--card-2); transition: border-color .2s; min-width: 0; }
.cmp.is-active { border-color: var(--wood); }
.cmp-k { font-size: 12px; color: var(--muted); font-weight: 600; }
.cmp-time { font-weight: 650; }
.cmp-v { font-size: clamp(26px, 8vw, 34px); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cmp.is-gain .cmp-v { color: var(--good); }
.cmp.is-loss .cmp-v { color: var(--bad); }
.cmp-d { font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.insight { color: var(--text-2); font-size: 14.5px; margin: 14px 0 0; }
.insight b { color: var(--text); }

/* support */
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.badge-on { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.sup-meter { margin: 18px 0 8px; }
.sup-track { position: relative; height: 10px; background: var(--card-2); border-radius: 999px; border: 1px solid var(--line); }
.sup-fill { height: 100%; border-radius: 999px; background: var(--el); transition: width .5s; }
.sup-fill.over { background: var(--good); }
.sup-mark { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--text); }
.sup-mark span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.kv div { background: var(--card-2); border-radius: 12px; padding: 10px; }
.kv dt { font-size: 12px; color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* calendar */
.calendar { margin-top: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head div { font-size: 11px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-day {
  appearance: none; border: 0; border-radius: 10px; aspect-ratio: 1; padding: 4px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  font: 600 12px var(--font); color: var(--text); background: var(--heat-0);
}
.cal-day[data-lvl="1"] { background: var(--heat-1); }
.cal-day[data-lvl="2"] { background: var(--heat-2); }
.cal-day[data-lvl="3"] { background: var(--heat-3); color: #fff; }
.cal-day[data-lvl="4"] { background: var(--heat-4); color: #fff; }
.cal-day.is-empty { background: transparent; border: 1px dashed var(--line); color: var(--muted); cursor: default; }
.cal-day.is-today { outline: 2px solid var(--text); outline-offset: -2px; }
.cal-day.is-selected { outline: 2px solid var(--el); outline-offset: 1px; }
.cal-v { font-size: 11px; font-weight: 500; opacity: .85; align-self: flex-end; }
.cal-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: 11px; color: var(--muted); margin-top: 8px; }
.cal-legend i { width: 14px; height: 14px; border-radius: 4px; background: var(--heat-0); }
.cal-legend i[data-lvl="1"] { background: var(--heat-1); } .cal-legend i[data-lvl="2"] { background: var(--heat-2); }
.cal-legend i[data-lvl="3"] { background: var(--heat-3); } .cal-legend i[data-lvl="4"] { background: var(--heat-4); }

/* settings */
.settings details { border-top: 1px solid var(--line); }
.settings details:first-child { margin-top: 10px; }
.settings summary, .about summary { list-style: none; cursor: pointer; padding: 14px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 650; }
.settings summary::-webkit-details-marker, .about summary::-webkit-details-marker { display: none; }
.settings summary em { font-style: normal; font-weight: 500; font-size: 13px; color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings summary::after, .about summary::after { content: "›"; transform: rotate(90deg); color: var(--muted); font-size: 20px; transition: transform .2s; }
details[open] > summary::after { transform: rotate(-90deg); }
.fields { display: grid; gap: 12px; padding-bottom: 16px; }
.field { display: grid; gap: 4px; position: relative; }
.field > span { font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.field i { position: absolute; right: 12px; bottom: 11px; font-style: normal; font-size: 13px; color: var(--muted); pointer-events: none; }
.field.inline { margin-top: 4px; }
input[type="number"], select {
  width: 100%; font: 500 16px var(--font); color: var(--text); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 44px;
}
input[type="number"] { padding-right: 90px; }
input:focus, select:focus { outline: 2px solid var(--wood); outline-offset: 1px; }
input[type="range"] { width: 100%; accent-color: var(--wood); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-2); }
.check input { width: 20px; height: 20px; accent-color: var(--wood); margin-top: 1px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -4px; }
.seg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg-row label { position: relative; }
.seg-row input { position: absolute; opacity: 0; }
.seg-row span { display: block; text-align: center; padding: 8px 4px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg-row input:checked + span { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.seg-row input:focus-visible + span { outline: 2px solid var(--wood); }
[hidden] { display: none !important; }

.prose p { color: var(--text-2); font-size: 14.5px; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--text-2); padding-top: 8px; padding-bottom: 32px; }

@media (min-width: 640px) {
  .card { padding: 22px; }
  .hero { padding: 28px 24px 22px; }
}
@media (max-width: 380px) {
  .tiles { gap: 6px; } .tile { padding: 8px; }
  .compare { grid-template-columns: 1fr; }
}

.hint { background: var(--card-2); border: 1px solid var(--line); border-left: 3px solid var(--ember); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; color: var(--text-2); }
.hint p { margin: 0 0 6px; } .hint p:last-child { margin-bottom: 0; }
.hint b { color: var(--text); }
.hint .chip { margin-top: 6px; }

/* SEO-rubrik + FAQ */
.page-title { margin: 4px 2px 14px; font-size: 15px; font-weight: 650; line-height: 1.35; color: var(--text-2); letter-spacing: 0; }
.page-title span { display: block; font-weight: 500; font-size: 13.5px; color: var(--muted); }
.faq-title { font-size: 18px; margin: 4px 0 4px; }
.about .faq { border-top: 1px solid var(--line); }
.about .faq summary h3 { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.35; }
.about .faq .prose { padding-bottom: 10px; }
