/* ==========================================================================
   HSM122 – monochrome, sharp, premium
   ========================================================================== */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #ececee;
  --pill: #ffffff;
  --text: #0a0a0a;
  --text-2: #3f3f46;
  --muted: #71717a;
  --faint: #a1a1aa;
  --line: rgba(10, 10, 10, .07);
  --line-2: rgba(10, 10, 10, .13);
  --pos: #15803d;
  --neg: #b42318;
  --pos-bg: rgba(21, 128, 61, .08);
  --neg-bg: rgba(180, 35, 24, .07);
  --nav: rgba(250, 250, 250, .72);
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, .05);
  --shadow: 0 1px 2px rgba(10, 10, 10, .04), 0 12px 32px -16px rgba(10, 10, 10, .14);
  --shadow-lg: 0 2px 6px rgba(10, 10, 10, .04), 0 32px 64px -32px rgba(10, 10, 10, .28);
  /* chart – validated categorical slots 1–3 (light) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --radius: 20px;
  --font: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --surface: #131316; --surface-2: #1b1b1f; --surface-3: #232328; --pill: #2a2a30;
    --text: #fafafa; --text-2: #d4d4d8; --muted: #a1a1aa; --faint: #71717a;
    --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
    --pos: #4ade80; --neg: #f87171; --pos-bg: rgba(74, 222, 128, .1); --neg-bg: rgba(248, 113, 113, .1);
    --nav: rgba(9, 9, 11, .7);
    --shadow-sm: 0 0 0 1px var(--line); --shadow: 0 0 0 1px var(--line); --shadow-lg: 0 0 0 1px var(--line-2);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --surface: #131316; --surface-2: #1b1b1f; --surface-3: #232328; --pill: #2a2a30;
  --text: #fafafa; --text-2: #d4d4d8; --muted: #a1a1aa; --faint: #71717a;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --pos: #4ade80; --neg: #f87171; --pos-bg: rgba(74, 222, 128, .1); --neg-bg: rgba(248, 113, 113, .1);
  --nav: rgba(9, 9, 11, .7);
  --shadow-sm: 0 0 0 1px var(--line); --shadow: 0 0 0 1px var(--line); --shadow-lg: 0 0 0 1px var(--line-2);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.55; letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}
::selection { background: var(--text); color: var(--bg); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60; background: var(--nav);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: 1120px; margin: 0 auto; height: 60px; padding: 0 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -.02em; }
.brand svg { width: 24px; height: 24px; color: var(--text); transition: transform .6s var(--ease); }
.brand:hover svg { transform: rotate(-8deg) scale(1.06); }
.tabs { position: relative; display: flex; margin-left: auto; padding: 3px; background: var(--surface-2); border-radius: 999px; }
.tab-pill {
  position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px;
  background: var(--pill); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  transition: transform .55s var(--ease), width .55s var(--ease); pointer-events: none;
}
.tab {
  position: relative; z-index: 1; font-size: 13.5px; font-weight: 500; color: var(--muted);
  padding: 6px 14px; border-radius: 999px; transition: color .3s var(--ease);
}
.tab:hover, .tab.active { color: var(--text); }
.icon-btn {
  width: 36px; height: 36px; border: 0; background: transparent; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center; color: var(--muted); transition: color .3s, background .3s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; transition: transform .7s var(--ease); }
.icon-btn:active svg { transform: rotate(90deg) scale(.9); }

main { max-width: 1120px; margin: 0 auto; padding: 0 20px 140px; }

/* ---------- Hero ---------- */
.hero { padding: 112px 0 56px; }
.hero.compact { padding: 88px 0 40px; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 22px; display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.hero h1 {
  font-size: clamp(46px, 8.4vw, 104px); line-height: .96; font-weight: 600; letter-spacing: -.058em; margin: 0;
}
.hero.compact h1 { font-size: clamp(40px, 6.6vw, 80px); }
.hero h1 .dim { color: var(--faint); }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero h1 .w { display: inline-block; will-change: transform; }
.lead { font-size: clamp(17px, 2vw, 20px); line-height: 1.5; color: var(--muted); max-width: 580px; margin: 26px 0 0; letter-spacing: -.016em; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 36px; }
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 22px;
  border-radius: 999px; font-size: 15px; font-weight: 500; letter-spacing: -.01em; cursor: pointer; border: 0;
  background: var(--text); color: var(--bg); overflow: hidden;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; transition: transform .5s var(--ease); }
.btn:hover svg { transform: translateY(2px); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover svg { transform: translateX(3px); }
.btn.small { height: 36px; padding: 0 16px; font-size: 13.5px; }
.btn.busy, .link-arrow.busy { pointer-events: none; opacity: .55; }
.btn.busy svg, .link-arrow.busy svg { animation: pulse 1s var(--ease-io) infinite alternate; }
@keyframes pulse { to { opacity: .25; transform: scale(.85); } }

/* floating "Åpne i Excel" + toast */
.xl-dock { position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 70;
  transform: translate(-50%, 140%); opacity: 0; pointer-events: none;
  transition: transform .7s var(--ease), opacity .5s var(--ease); }
.xl-dock.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.xl-dock .btn { height: 50px; padding: 0 24px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line-2); white-space: nowrap; max-width: calc(100vw - 32px); }
.xl-dock .btn span { overflow: hidden; text-overflow: ellipsis; }
.toast { position: fixed; right: 20px; bottom: 22px; z-index: 90; display: flex; gap: 12px; align-items: flex-start; max-width: min(380px, calc(100vw - 32px));
  background: var(--text); color: var(--bg); border-radius: 16px; padding: 14px 18px 14px 14px; box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(.98); opacity: 0; pointer-events: none; transition: transform .6s var(--ease), opacity .4s var(--ease); }
.toast.on { transform: none; opacity: 1; }
.toast .ic { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(127, 127, 127, .25); font-weight: 700; }
.toast .ic svg { width: 14px; height: 14px; }
.toast b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; word-break: break-word; }
.toast span { font-size: 12.5px; opacity: .7; }
.toast.err .ic { background: var(--neg); color: #fff; }
.stats { display: flex; gap: 40px; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.stat b { display: block; font-size: 32px; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }

/* ---------- Motion primitives ---------- */
.reveal { opacity: 0; transform: translateY(28px); filter: blur(6px);
  transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; filter: none; }
@keyframes wordUp { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.hero h1 .w { animation: wordUp 1.1s var(--ease) both; animation-delay: calc(var(--d, 0) * 1ms); }
.hero .eyebrow, .hero .lead, .hero .cta, .hero .stats { animation: fadeUp 1s var(--ease) both; }
.hero .eyebrow { animation-delay: 0ms; }
.hero .lead { animation-delay: 260ms; }
.hero .cta { animation-delay: 360ms; }
.hero .stats { animation-delay: 460ms; }

/* ---------- Search + chips ---------- */
.toolbar { position: sticky; top: 60px; z-index: 40; padding: 14px 0 12px; margin: 0 -20px; padding-left: 20px; padding-right: 20px;
  background: linear-gradient(var(--bg) 72%, transparent); }
.search { position: relative; max-width: 560px; }
.search input {
  width: 100%; height: 48px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--text); font: inherit; font-size: 15px; padding: 0 52px 0 44px; outline: none;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--text); box-shadow: 0 0 0 4px var(--line); }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 11px/1 var(--mono); color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 7px; background: var(--surface-2); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; padding: 7px 13px;
  border-radius: 999px; color: var(--text-2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  white-space: nowrap; cursor: pointer; transition: background .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease);
}
.chip .n { font-family: var(--mono); font-size: 11px; color: var(--faint); transition: color .35s; }
.chip:hover { box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); box-shadow: none; }
.chip.active .n { color: var(--bg); opacity: .6; }
.legend-line { font-size: 12.5px; color: var(--faint); margin: 8px 0 0; max-width: 820px; }

/* ---------- Cards ---------- */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 24px; }
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--line); padding: 32px 32px 26px;
  transition: box-shadow .6s var(--ease), transform .6s var(--ease), opacity 1s var(--ease), filter 1s var(--ease);
}
.card { scroll-margin-top: 150px; }
.card h2.sm { font-size: 21px; letter-spacing: -.03em; }
.card.dashed { background: transparent; box-shadow: none; border-style: dashed; border-color: var(--line-2); }
.card-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.card-num { font-family: var(--mono); font-size: 12px; color: var(--faint); font-weight: 500; min-width: 22px; }
.card h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.04em; font-weight: 600; margin: 0; }
.card h3 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; margin: 28px 0 6px; color: var(--text); }
.card p { margin: 10px 0; color: var(--text-2); }
.card-foot { margin-top: 18px; display: flex; justify-content: flex-end; gap: 22px; flex-wrap: wrap; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); transition: color .3s;
  background: none; border: 0; padding: 0; cursor: pointer; }
.link-arrow svg { width: 14px; height: 14px; transition: transform .5s var(--ease); }
.link-arrow:hover { color: var(--text); }
.link-arrow:hover svg { transform: translateX(4px); }

/* formula tables */
.ftable { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ftable th { text-align: left; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
  padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ftable td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; transition: background .3s var(--ease); }
.ftable tr:last-child td { border-bottom: 0; }
.ftable tbody tr:hover td { background: var(--surface-2); }
.ftable td:first-child { font-weight: 500; width: 36%; color: var(--text); }
.ftable td:nth-child(2) { color: var(--text-2); }
.ftable.kalkyle td { width: 50%; font-weight: 400; }
.card pre { background: var(--surface-2); border-radius: 12px; padding: 16px 18px; overflow-x: auto; margin: 10px 0;
  font: 13.5px/1.75 var(--mono); color: var(--text); }
.card code { font: .9em var(--mono); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.card pre code { background: none; padding: 0; }
.card blockquote { margin: 16px 0 4px; padding: 12px 16px 12px 18px; border-left: 2px solid var(--text); background: var(--surface-2);
  border-radius: 0 12px 12px 0; font-size: 14px; color: var(--text-2); }
.card blockquote p { margin: 3px 0; color: inherit; }
.card strong { color: var(--text); font-weight: 600; }
mark { background: var(--text); color: var(--bg); border-radius: 3px; padding: 0 2px; }
.empty { text-align: center; color: var(--muted); padding: 72px 0; }

/* ---------- Oppgaver (spreadsheet) ---------- */
.seg-wrap { position: sticky; top: 60px; z-index: 40; margin: 0 -20px; padding: 12px 20px; background: linear-gradient(var(--bg) 75%, transparent); }
.seg { position: relative; display: flex; gap: 2px; padding: 4px; border-radius: 16px; background: var(--surface-2);
  overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-pill { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 12px; background: var(--pill);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); transition: transform .6s var(--ease), width .6s var(--ease); pointer-events: none; }
.seg a { position: relative; z-index: 1; flex: none; display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px;
  font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color .35s var(--ease); }
.seg a .n { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.seg a:hover, .seg a.active { color: var(--text); }
.sheet-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 40px 0 8px; flex-wrap: wrap; }
.sheet-head .k { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.sheet-head h2 { font-size: clamp(30px, 4.4vw, 48px); letter-spacing: -.05em; line-height: 1.02; font-weight: 600; margin: 6px 0 0; }
.engine { display: inline-flex; align-items: center; gap: 8px; font: 500 11.5px/1 var(--mono); color: var(--muted); }
.engine i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); transition: background .4s; }
.engine.on i { background: var(--pos); box-shadow: 0 0 0 4px var(--pos-bg); }
.task { background: var(--text); color: var(--bg); border-radius: var(--radius); padding: 28px 32px; border: 0; }
.task .label { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; opacity: .55; margin-bottom: 14px; }
.task p { margin: 8px 0; color: var(--bg); opacity: .92; font-size: 15.5px; line-height: 1.6; letter-spacing: -.012em; }
.task p:first-of-type { opacity: 1; }
.task b.q { font-family: var(--mono); font-weight: 600; font-size: .88em; opacity: .6; margin-right: 2px; }
.tbl-wrap { overflow-x: auto; margin: 4px -8px; padding: 0 8px; -webkit-overflow-scrolling: touch; }
.tbl-wrap + .tbl-wrap { margin-top: 22px; }
.xtable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.xtable.wide { min-width: 640px; }
.xtable th { text-align: left; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.xtable th.r, .xtable td.r { text-align: right; }
.xtable td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; transition: background .4s var(--ease); }
.xtable tr:last-child td { border-bottom: 0; }
.xtable td.lbl { color: var(--text); font-weight: 450; min-width: 180px; }
.xtable td.lbl.b { font-weight: 600; }
.xtable td.desc { color: var(--muted); font-size: 13px; line-height: 1.45; min-width: 200px; }
.xtable td.val { font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text); letter-spacing: -.02em; }
.xtable tr.result td { background: var(--surface-2); }
.xtable tr.result td:first-child { border-radius: 10px 0 0 10px; }
.xtable tr.result td:last-child { border-radius: 0 10px 10px 0; }
.xtable tr.result td.val { font-weight: 600; font-size: 14.5px; }
.xtable tr.result td.lbl { font-weight: 600; }
.xtable tr.sub td { padding: 22px 12px 8px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted); border-bottom: 1px solid var(--line); }
.m-desc { display: none; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 2px; line-height: 1.4; }
.flash { animation: flash 1.1s var(--ease); }
@keyframes flash { 0% { background: var(--surface-3); } 100% { background: transparent; } }
.field { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 10px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); cursor: text;
  transition: box-shadow .3s var(--ease), background .3s var(--ease); }
.field:hover { box-shadow: inset 0 0 0 1px var(--faint); }
.field:focus-within { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--text), 0 0 0 4px var(--line); }
.field input { width: 96px; border: 0; outline: none; background: transparent; color: var(--text); text-align: right;
  font: 500 13.5px/1 var(--mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; padding: 0; }
.field input.bad { color: var(--neg); }
.field .unit { font: 12px/1 var(--mono); color: var(--faint); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.pos { color: var(--pos); background: var(--pos-bg); }
.pill.neg { color: var(--neg); background: var(--neg-bg); }
.pill.neu { color: var(--muted); background: var(--surface-2); }
.note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; line-height: 1.5; }
.sheet-tools { display: flex; gap: 10px; align-items: center; }

/* chart */
.chart { margin: 26px 0 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 8px; }
.chart-legend i { width: 16px; height: 2px; border-radius: 2px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--faint); font: 11px var(--mono); }
.chart .series path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end-label { fill: var(--text-2); font: 500 12px var(--font); }
.chart .bep-label { fill: var(--text); font: 600 12px var(--font); }
.chart .bep-sub { fill: var(--muted); font: 11px var(--mono); }
.chart .cross { stroke: var(--line-2); stroke-width: 1; }
.chart-tip { position: fixed; z-index: 80; pointer-events: none; background: var(--surface); color: var(--text); border-radius: 12px;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); padding: 10px 12px; font-size: 12.5px; min-width: 190px;
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .3s var(--ease); }
.chart-tip.on { opacity: 1; transform: none; }
.chart-tip .t { font: 500 11px var(--mono); color: var(--muted); margin-bottom: 6px; }
.chart-tip .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 2px 0; }
.chart-tip .row span { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
.chart-tip .row i { width: 8px; height: 8px; border-radius: 50%; }
.chart-tip .row b { font: 500 12px var(--mono); }

/* ---------- Modules ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.mod-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px; min-height: 240px; display: flex; flex-direction: column; gap: 12px;
  transition: transform .7s var(--ease), box-shadow .7s var(--ease), opacity 1s var(--ease), filter 1s var(--ease); }
.mod-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.mod-card .k { font: 500 12px var(--mono); color: var(--muted); }
.mod-card h3 { font-size: 26px; line-height: 1.1; letter-spacing: -.045em; font-weight: 600; margin: 0; }
.mod-card .foot { margin-top: auto; display: flex; align-items: center; gap: 14px; }
.ring { width: 44px; height: 44px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: var(--surface-3); }
.ring .bar { stroke: var(--text); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.mod-card .meta { font-size: 13px; color: var(--muted); }
.mod-card .meta b { display: block; color: var(--text); font: 600 15px var(--mono); }
.mod-card .go { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--line-2); transition: background .5s var(--ease), color .5s var(--ease), transform .5s var(--ease); }
.mod-card .go svg { width: 15px; height: 15px; }
.mod-card:hover .go { background: var(--text); color: var(--bg); transform: translateX(2px); }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--muted); margin-top: 36px; transition: color .3s; }
.back svg { width: 14px; height: 14px; transition: transform .5s var(--ease); }
.back:hover { color: var(--text); }
.back:hover svg { transform: translateX(-3px); }
.progress { height: 3px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 28px; max-width: 420px; }
.progress div { height: 100%; width: 0; background: var(--text); border-radius: 999px; transition: width .9s var(--ease); }
.progress-label { font: 500 12px var(--mono); color: var(--muted); margin-top: 10px; }
.card ul { padding-left: 18px; margin: 8px 0; color: var(--text-2); }
.card li { margin: 5px 0; }
.card ul.tasks { list-style: none; padding: 0; }
.card ul.tasks li { margin: 0; border-bottom: 1px solid var(--line); }
.card ul.tasks li:last-child { border-bottom: 0; }
.card ul.tasks label { display: flex; align-items: center; gap: 14px; padding: 13px 2px; cursor: pointer; color: var(--text); }
.card ul.tasks input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; flex: none; border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px var(--faint); display: grid; place-items: center; cursor: pointer;
  transition: background .35s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease); }
.card ul.tasks input:hover { box-shadow: inset 0 0 0 1.5px var(--text); }
.card ul.tasks input:active { transform: scale(.88); }
.card ul.tasks input:checked { background: var(--text); box-shadow: none; }
.card ul.tasks input::after { content: ""; width: 5px; height: 10px; border: solid var(--bg); border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px) scale(0); transition: transform .35s var(--ease); }
.card ul.tasks input:checked::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); }
.card ul.tasks span { transition: color .35s var(--ease); }
.card ul.tasks input:checked + span { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-2); }

footer { max-width: 1120px; margin: 0 auto; padding: 32px 20px 48px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--faint); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav-inner { padding: 0 16px; gap: 10px; }
  .brand span { display: none; }
  .tab { padding: 6px 11px; font-size: 13px; }
  main { padding: 0 16px 100px; }
  .toolbar, .seg-wrap { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .hero { padding: 64px 0 36px; }
  .hero.compact { padding: 52px 0 28px; }
  .stats { gap: 28px; margin-top: 44px; }
  .card { padding: 22px 18px 18px; border-radius: 18px; }
  .card h2 { font-size: 23px; }
  .task { padding: 22px 20px; }
  .search kbd { display: none; }
  .ftable, .ftable tbody, .ftable tr, .ftable td { display: block; width: 100%; }
  .ftable thead { display: none; }
  .ftable td { padding: 0; border: 0; }
  .ftable td:first-child { width: auto; padding-top: 13px; font-size: 13px; color: var(--muted); }
  .ftable td:nth-child(2) { padding-bottom: 13px; color: var(--text); }
  .ftable tr { border-bottom: 1px solid var(--line); }
  .ftable tr:last-child { border-bottom: 0; }
  .ftable tbody tr:hover td { background: none; }
  .ftable.kalkyle tr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 0; }
  .ftable.kalkyle td { padding: 0 !important; color: var(--text) !important; font-size: 13.5px !important; }
  .xtable.compact td.desc, .xtable.compact th.desc { display: none; }
  .xtable.compact .m-desc { display: block; }
  .xtable td, .xtable th { padding-left: 8px; padding-right: 8px; }
  .xtable.compact td.lbl { min-width: 0; }
  .xtable.wide td.lbl { min-width: 120px; }
  .field { padding: 0 8px; }
  .field input { width: 72px; }
  .chart .end-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
}
