    :root {
      --bg: #f5f5f7;
      --bg-soft: #fbfbfd;
      --surface: #ffffff;
      --surface-2: #f7f7f9;
      --surface-3: #ededf1;
      --text: #1d1d1f;
      --text-soft: #5c5c63;
      --text-muted: #6b6b73;
      --text-inverse: #ffffff;
      --accent: #ffcc00;
      --accent-dark: #174a6f;
      --accent-soft: #fff4bf;
      --accent-ink: #2b2300;
      --accent-soft-ink: #2b2300;
      --good: #0a7f4f;
      --good-soft: #e7f7ee;
      --good-ink: #075c39;
      --watch: #d99400;
      --watch-soft: #fff5d6;
      --watch-ink: #8a5e00;
      --bad: #b42318;
      --bad-soft: #fdecea;
      --bad-ink: #8f1c14;
      --hero-tint: #fffbe9;
      --weekend-stripe: #f0f0f3;
      --bar-track: rgba(29,29,31,.08);
      --bg-glow: rgba(255,255,255,.9);
      --line: rgba(29,29,31,.10);
      --line-strong: rgba(29,29,31,.16);
      --shadow: 0 12px 34px rgba(0,0,0,.08);
      --shadow-soft: 0 1px 2px rgba(0,0,0,.04), 0 10px 26px rgba(0,0,0,.05);
      --radius: 20px;
      --radius-sm: 13px;
      --s1:.25rem; --s2:.5rem; --s3:.75rem; --s4:1rem; --s5:1.25rem; --s6:1.5rem; --s8:2rem;
      --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
      --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
      --ease: cubic-bezier(.22,1,.36,1);
    }
    * { box-sizing: border-box; }
    html { color-scheme: light; scroll-behavior: smooth; }
    body {
      margin: 0; min-height: 100vh; font-family: var(--font); color: var(--text);
      background: radial-gradient(1200px 400px at 15% -5%, var(--bg-glow), transparent 60%),
                  linear-gradient(180deg, var(--bg-soft), var(--bg) 40rem);
      -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    }
    button, input, select, textarea { font: inherit; color: inherit; }
    button { cursor: pointer; }
    h1,h2,h3,h4,p { margin: 0; }
    :focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px; border-radius: 6px; }

    .wrap { width: 100%; max-width: 2200px; margin-inline: auto; padding: clamp(.75rem, 2.2vw, 1.6rem) clamp(.75rem, 2.6vw, 2.4rem) 4rem; }

    /* ---------- App bar ---------- */
    .appbar { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; padding-block: var(--s2) var(--s4); }
    .brand { display: flex; align-items: center; gap: .7rem; }
    .brand-mark { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 12px; background: linear-gradient(145deg, #fff2b0, var(--accent)); color: var(--accent-ink); font-weight: 900; box-shadow: 0 8px 20px rgba(255,204,0,.3); }
    .brand-txt small { display: block; font-family: var(--mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); font-weight: 800; }
    .brand-txt strong { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; }
    .appbar-spacer { flex: 1 1 auto; }
    .today-chip { text-align: right; line-height: 1.25; }
    .today-chip span { display: block; font-size: .72rem; color: var(--text-muted); font-weight: 700; }
    .today-chip strong { font-size: .95rem; }

    /* ---------- Main tab nav ---------- */
    .mainnav { display: flex; gap: .3rem; flex-wrap: wrap; padding: .3rem; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); box-shadow: inset 0 1px 2px rgba(0,0,0,.04); margin-bottom: var(--s4); }
    .mainnav button { flex: 1 1 auto; min-width: 8rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.9rem; padding: 0 1rem; border: 0; border-radius: 999px; background: transparent; color: var(--text-soft); font-weight: 800; transition: all .18s var(--ease); }
    .mainnav button svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .mainnav button:hover { color: var(--text); }
    .mainnav button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 4px 14px rgba(0,0,0,.1); }

    /* ---------- Date navigator ---------- */
    .datenav { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
    .seg { display: inline-flex; align-items: center; gap: .2rem; padding: .25rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
    .seg button { min-width: 2.4rem; min-height: 2.4rem; border: 0; border-radius: 999px; background: transparent; color: var(--text); font-weight: 900; display: grid; place-items: center; }
    .seg button:hover { background: var(--surface-2); }
    .seg .seg-label { padding: 0 .9rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .pill-btn { min-height: 2.6rem; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 800; box-shadow: var(--shadow-soft); transition: all .16s var(--ease); }
    .pill-btn:hover { background: var(--surface-2); transform: translateY(-1px); }
    .pill-btn.is-active { background: var(--accent-soft); border-color: rgba(255,204,0,.6); color: var(--accent-soft-ink); }

    .weekstrip { display: flex; gap: .25rem; flex-wrap: wrap; padding: .25rem; border-radius: 16px; background: var(--surface-3); border: 1px solid var(--line); }
    .weekstrip button { flex: 1 1 3rem; min-width: 3rem; min-height: 3rem; display: grid; place-items: center; gap: 1px; border: 0; border-radius: 12px; background: transparent; color: var(--text-soft); font-weight: 800; line-height: 1; transition: all .16s var(--ease); }
    .weekstrip button small { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
    .weekstrip button b { font-size: 1.02rem; font-variant-numeric: tabular-nums; }
    .weekstrip button:hover { background: var(--surface); color: var(--text); }
    .weekstrip button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
    .weekstrip button[aria-selected="true"] small { color: var(--accent-ink); }
    .weekstrip button.is-weekend { color: var(--text-muted); }
    .weekstrip button.is-today { box-shadow: inset 0 0 0 2px var(--accent-dark); }

    /* ---------- Calendar ---------- */
    .calendar-wrap { overflow: hidden; transition: grid-template-rows .28s var(--ease); display: grid; grid-template-rows: 0fr; }
    .calendar-wrap.open { grid-template-rows: 1fr; }
    .calendar-inner { min-height: 0; overflow: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .24s var(--ease), transform .28s var(--ease); }
    .calendar-wrap.open .calendar-inner { opacity: 1; transform: none; }
    .calendar { margin-top: var(--s3); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
    .cal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
    .cal-title { font-weight: 800; font-size: 1.05rem; }
    .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
    .cal-dow { text-align: center; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding-bottom: .2rem; }
    .cal-day { position: relative; aspect-ratio: 1 / .82; min-height: 2.4rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); transition: transform .12s var(--ease), box-shadow .12s var(--ease); }
    .cal-day:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
    .cal-day.other { opacity: .32; }
    .cal-day.weekend { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 6px, var(--weekend-stripe) 6px, var(--weekend-stripe) 12px); color: var(--text-muted); }
    .cal-day[data-status="good"] { background: var(--good-soft); border-color: rgba(10,127,79,.35); color: var(--good-ink); }
    .cal-day[data-status="watch"] { background: var(--watch-soft); border-color: rgba(217,148,0,.4); color: var(--watch-ink); }
    .cal-day[data-status="bad"] { background: var(--bad-soft); border-color: rgba(180,35,24,.32); color: var(--bad-ink); }
    .cal-day[data-status="review"] { background: #eef1f6; border-color: var(--line); color: var(--text-soft); }
    .cal-day[data-status="absent"] { background: repeating-linear-gradient(45deg, var(--accent-soft), var(--accent-soft) 6px, var(--surface-2) 6px, var(--surface-2) 12px); color: var(--text-muted); }
    .cal-day.selected { outline: 3px solid var(--accent); outline-offset: 1px; }
    .cal-day.today::after { content: ""; position: absolute; bottom: .28rem; width: .32rem; height: .32rem; border-radius: 50%; background: var(--accent-dark); }
    .cal-legend { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: var(--s3); font-size: .74rem; color: var(--text-soft); }
    .cal-legend span { display: inline-flex; align-items: center; gap: .35rem; }
    .cal-legend i { width: .8rem; height: .8rem; border-radius: 4px; display: inline-block; }

    /* ---------- Panels & layout ---------- */
    .grid { display: grid; gap: var(--s4); }
    .cols { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); align-items: start; }
    .dash-layout { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
    @media (max-width: 1080px) { .dash-layout { grid-template-columns: 1fr; } }
    .stack { display: grid; gap: var(--s4); align-content: start; min-width: 0; }

    .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); overflow: hidden; }
    .panel-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s5) var(--s5) var(--s3); }
    .panel-h h3 { font-size: 1.08rem; font-weight: 800; }
    .panel-h p { margin-top: .2rem; color: var(--text-soft); font-size: .85rem; line-height: 1.4; }
    .panel-b { padding: 0 var(--s5) var(--s5); }
    .chip { display: inline-flex; align-items: center; min-height: 1.9rem; padding: .25rem .65rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-family: var(--mono); font-size: .7rem; font-weight: 800; white-space: nowrap; }

    /* Hero */
    .hero { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, var(--hero-tint), var(--surface) 55%); box-shadow: var(--shadow-soft); padding: var(--s5); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: var(--s4); align-items: center; }
    @media (max-width: 620px){ .hero { grid-template-columns: 1fr; } }
    .hero .kick { font-family: var(--mono); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-dark); }
    .hero h2 { font-size: clamp(1.3rem, 2.2vw, 1.9rem); font-weight: 800; line-height: 1.1; margin-top: .3rem; }
    .hero p.brief { margin-top: .5rem; color: var(--text-soft); font-size: .92rem; line-height: 1.5; max-width: 58ch; }
    .ring { position: relative; width: 8.6rem; height: 8.6rem; display: grid; place-items: center; }
    .ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
    .ring-track { fill: none; stroke: var(--surface-3); stroke-width: 10; }
    .ring-arc { fill: none; stroke: url(#ringGrad); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 326.726; stroke-dashoffset: 326.726; transition: stroke-dashoffset .9s var(--ease); filter: drop-shadow(0 3px 9px rgba(245,179,1,.38)); }
    .ring.complete .ring-arc { stroke: url(#ringGradDone); filter: drop-shadow(0 3px 12px rgba(10,127,79,.42)); }
    .ring-center { position: relative; display: grid; justify-items: center; gap: .22rem; }
    .ring-center b { font-size: 1.95rem; font-weight: 900; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
    .ring-pill { display: inline-flex; align-items: center; padding: .12rem .55rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .72rem; font-weight: 800; color: var(--text-soft); font-variant-numeric: tabular-nums; }
    .ring-cap { font-size: .58rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
    .ring.complete .ring-cap { color: var(--good); font-size: .52rem; letter-spacing: .015em; }
    .ring.complete .ring-pill { background: var(--good-soft); border-color: rgba(10,127,79,.3); color: var(--good-ink); }
    .ring.complete .ring-center b { animation: ringPop .5s var(--ease); }
    @keyframes ringPop { 0%{ transform: scale(.9); } 55%{ transform: scale(1.06); } 100%{ transform: scale(1); } }

    /* Checklist */
    .checkline { display: grid; grid-template-columns: 1.4rem 1fr; gap: .7rem; padding: .6rem .5rem; border-radius: 12px; cursor: pointer; transition: background .14s, opacity .4s var(--ease), transform .42s var(--ease), max-height .42s var(--ease), padding .42s var(--ease), margin .42s var(--ease); }
    .checkline:hover { background: var(--surface-2); }
    .checkline.fading { opacity: 0; transform: translateX(18px); overflow: hidden; }
    .link-btn { border: 0; background: transparent; padding: 0; min-height: auto; color: var(--accent-dark); font-weight: 800; font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
    .link-btn:hover { color: var(--text); }
    .checkline + .checkline { margin-top: 2px; }
    .checkline input { width: 1.25rem; height: 1.25rem; margin-top: .1rem; accent-color: var(--accent); }
    .checkline .t { font-weight: 700; line-height: 1.3; }
    .checkline .hint { display: block; margin-top: .15rem; color: var(--text-soft); font-size: .84rem; line-height: 1.4; }
    .checkline.done .t { text-decoration: line-through; color: var(--text-muted); }
    .checkline.done .hint { color: var(--text-muted); }

    /* Schedule */
    .slot { position: relative; display: grid; grid-template-columns: 5.6rem 1fr; gap: .7rem; padding: .55rem .5rem; border-radius: 12px; transition: background .18s, opacity .35s var(--ease), transform .42s var(--ease), max-height .42s var(--ease), padding .42s var(--ease), margin .42s var(--ease); }
    .slot:hover { background: var(--surface-2); }
    .slot-check { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%) scale(.4); width: 1.35rem; height: 1.35rem; display: grid; place-items: center; border-radius: 50%; background: var(--good-soft); color: var(--good); font-size: .8rem; font-weight: 900; line-height: 1; opacity: 0; transition: opacity .3s var(--ease), transform .3s var(--ease); pointer-events: none; }
    .slot.past { opacity: .55; padding-right: 2.1rem; }
    .slot.past .st, .slot.past .sn, .slot.past .tm { color: var(--text-muted); }
    .slot.past .slot-check { opacity: 1; transform: translateY(-50%) scale(1); }
    .slot.fading { opacity: 0; transform: translateX(18px); overflow: hidden; }
    .slot .tm { color: var(--accent-dark); font-family: var(--mono); font-size: .72rem; font-weight: 900; }
    .slot .st { font-weight: 700; line-height: 1.3; }
    .slot .sn { display: block; margin-top: .1rem; color: var(--text-soft); font-size: .82rem; line-height: 1.4; }
    @media (max-width: 520px){ .slot { grid-template-columns: 1fr; gap: .1rem; } }

    /* Metrics entry */
    .metric-group + .metric-group { margin-top: var(--s4); }
    .metric-group-h { font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 .55rem .15rem; }
    .metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.4rem, 1fr)); gap: .55rem; }
    .metric { display: grid; gap: .2rem; padding: .6rem .5rem .45rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); text-align: center; transition: border-color .15s, background .15s, box-shadow .15s; }
    .metric:focus-within { border-color: color-mix(in srgb, var(--accent-dark) 45%, transparent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-dark) 8%, transparent); }
    .metric .m-lab { font-size: .7rem; font-weight: 700; color: var(--text-soft); }
    .stepper { display: grid; grid-template-columns: 1.9rem 1fr 1.9rem; align-items: center; gap: .15rem; }
    .stepper button { width: 1.9rem; height: 1.9rem; border: 0; border-radius: 50%; background: var(--surface-3); font-size: 1.1rem; font-weight: 800; color: var(--accent-dark); display: grid; place-items: center; transition: background .15s, transform .08s; }
    .stepper button:hover { background: var(--line-strong); color: var(--text); }
    .stepper button:active { transform: scale(.85); }
    .stepper input { border: 0; text-align: center; font-weight: 800; font-size: 1.55rem; line-height: 1; font-variant-numeric: tabular-nums; width: 100%; min-height: auto; background: transparent; color: var(--text); -moz-appearance: textfield; }
    .stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .metric.bump .stepper input { animation: numPop .34s var(--ease); }
    @keyframes numPop { 0%{ transform: scale(1); } 42%{ transform: scale(1.22); } 100%{ transform: scale(1); } }

    /* Derived KPI cards */
    .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 12.5rem)); gap: .55rem; justify-content: start; }
    .kpi { position: relative; display: grid; gap: .1rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
    .kpi::after { content: ""; position: absolute; top: .8rem; right: .8rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--text-muted); }
    .kpi[data-status="good"] { background: var(--good-soft); border-color: rgba(10,127,79,.28); }
    .kpi[data-status="good"]::after { background: var(--good); }
    .kpi[data-status="watch"] { background: var(--watch-soft); border-color: rgba(217,148,0,.4); }
    .kpi[data-status="watch"]::after { background: var(--watch); }
    .kpi[data-status="bad"] { background: var(--bad-soft); border-color: rgba(180,35,24,.28); }
    .kpi[data-status="bad"]::after { background: var(--bad); }
    .kpi .lab { font-size: .78rem; font-weight: 800; color: var(--text-soft); }
    .kpi .val { font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; }
    .kpi .tgt { font-family: var(--mono); font-size: .64rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }

    /* Revenue */
    .rev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .6rem; align-items: start; }
    .rev { display: grid; gap: .5rem; padding: .85rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
    .rev-lab { font-weight: 800; font-size: .92rem; }
    .rev-lab small { display: block; color: var(--text-muted); font-size: .68rem; font-weight: 700; margin-top: .1rem; }
    .rev-inline { position: relative; }
    .rev-inline input { width: 100%; min-height: 2.9rem; padding: .6rem 3.2rem .6rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 900; font-size: 1.15rem; font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s; }
    .rev-inline input:focus { outline: none; border-color: color-mix(in srgb, var(--accent-dark) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-dark) 8%, transparent); }
    .rev-unit { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); padding: .15rem .5rem; border-radius: 999px; background: var(--surface-3); color: var(--text-soft); font-family: var(--mono); font-size: .64rem; font-weight: 900; pointer-events: none; }
    .rev-target { font-family: var(--mono); font-size: .64rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; }
    .rev-bar { height: .42rem; border-radius: 999px; background: var(--bar-track); overflow: hidden; }
    .rev-bar i { display: block; height: 100%; border-radius: inherit; background: var(--text-muted); transform-origin: left; transition: width .5s var(--ease), background .2s; }
    .rev[data-status="good"] .rev-bar i { background: var(--good); }
    .rev[data-status="watch"] .rev-bar i { background: var(--watch); }
    .rev[data-status="bad"] .rev-bar i { background: var(--bad); }
    .rev-meta { display: flex; justify-content: space-between; gap: .5rem; font-size: .76rem; font-weight: 800; color: var(--text-soft); }
    .rev-meta b { color: var(--text); font-variant-numeric: tabular-nums; }
    .rev-calc-toggle { justify-self: start; display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .72rem; font-weight: 800; color: var(--accent-dark); cursor: pointer; transition: background .15s; }
    .rev-calc-toggle:hover { background: var(--surface-3); }
    .rev-calc-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease); }
    .rev-calc-wrap.open { grid-template-rows: 1fr; }
    .rev-calc-inner { min-height: 0; overflow: hidden; }
    .rev-calc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; padding-top: .55rem; }
    .rev-calc label { display: grid; gap: .2rem; min-width: 0; font-size: .58rem; font-weight: 900; text-transform: uppercase; color: var(--text-muted); letter-spacing: .02em; }
    .rev-calc input { width: 100%; min-width: 0; min-height: 2.4rem; padding: .4rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
    .rev-formula { font-size: .66rem; color: var(--text-muted); padding-top: .3rem; }

    /* Evaluation */
    .eval-controls { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
    .eval-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem,1fr)); gap: var(--s3); }
    .stat { padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-soft); }
    .stat span { display: block; color: var(--text-muted); font-size: .74rem; font-weight: 800; }
    .stat strong { display: block; margin-top: .2rem; font-size: 1.5rem; font-weight: 900; font-variant-numeric: tabular-nums; }
    .stat small { color: var(--text-soft); font-size: .72rem; font-weight: 700; }

    .chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
    .chart-svg .grid-line { stroke: var(--line); stroke-width: 1; }
    .chart-svg .axis-txt { fill: var(--text-muted); font-size: 11px; font-family: var(--mono); font-weight: 700; }
    .chart-svg .lbl-txt { fill: var(--text-soft); font-size: 11px; font-weight: 700; }

    .funnel { display: grid; gap: .5rem; }
    .funnel-row { display: grid; grid-template-columns: 11rem 1fr; gap: .8rem; align-items: center; }
    @media (max-width: 560px){ .funnel-row { grid-template-columns: 1fr; gap: .1rem; } }
    .funnel-bar-track { position: relative; height: 2.3rem; background: var(--surface-2); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
    .funnel-bar { height: 100%; display: flex; align-items: center; padding: 0 .7rem; border-radius: 10px; background: linear-gradient(90deg, var(--accent), #ffde5c); color: var(--accent-ink); font-weight: 900; font-variant-numeric: tabular-nums; transition: width .5s var(--ease); white-space: nowrap; }
    .funnel-lab { font-weight: 800; }
    .funnel-lab small { display: block; color: var(--text-muted); font-size: .72rem; font-weight: 700; }
    .conv-chip { display: inline-block; margin-left: .5rem; font-size: .74rem; font-weight: 800; color: var(--text-soft); font-variant-numeric: tabular-nums; }

    .pace-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem,1fr)); gap: var(--s3); }
    .pace { padding: .95rem 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); border-left: 4px solid var(--text-muted); }
    .pace[data-status="good"] { border-left-color: var(--good); background: var(--good-soft); }
    .pace[data-status="watch"] { border-left-color: var(--watch); background: var(--watch-soft); }
    .pace[data-status="bad"] { border-left-color: var(--bad); background: var(--bad-soft); }
    .pace .pl { font-weight: 800; }
    .pace .pv { margin-top: .3rem; font-size: 1.05rem; font-weight: 900; font-variant-numeric: tabular-nums; }
    .pace .pn { margin-top: .25rem; font-size: .8rem; color: var(--text-soft); line-height: 1.35; }

    .streak-box { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
    .streak-num { font-size: 2.6rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; color: var(--accent-dark); }
    .streak-dots { display: flex; gap: .3rem; flex-wrap: wrap; }
    .streak-dots i { width: 1.1rem; height: 1.1rem; border-radius: 5px; background: var(--surface-3); }
    .streak-dots i[data-on="1"] { background: var(--accent); }

    /* Settings / goals */
    .field { display: grid; gap: .35rem; margin-bottom: var(--s4); }
    .field label { font-weight: 800; font-size: .86rem; }
    .field .fh { color: var(--text-soft); font-size: .78rem; font-weight: 600; }
    .field input[type="text"], .field input[type="number"], .field input[type="date"] { min-height: 2.8rem; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 800; }
    .goal-row { display: grid; grid-template-columns: 1fr 10rem; gap: .8rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
    .goal-row:last-child { border-bottom: 0; }
    .goal-row .gl { font-weight: 800; }
    .goal-row .gl small { display: block; color: var(--text-muted); font-size: .72rem; font-weight: 700; }
    .goal-row input { min-height: 2.7rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); font-weight: 900; text-align: right; }
.goal-row .gv { text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; font-size: 1.02rem; }

    .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.8rem; padding: 0 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 800; transition: all .16s var(--ease); }
    .btn:hover { background: var(--surface-2); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
    .btn-primary { border-color: transparent; background: var(--accent); color: var(--accent-ink); }
    .btn-danger { color: var(--bad); border-color: rgba(180,35,24,.3); }
    .btn-row { display: flex; gap: .6rem; flex-wrap: wrap; }

    .notes-area { width: 100%; min-height: 8rem; resize: vertical; padding: .8rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); line-height: 1.5; }

    .tabpage { display: none; animation: fade .25s var(--ease); }
    .tabpage.active { display: block; }
    @keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

    .empty-note { padding: 1.4rem; text-align: center; color: var(--text-muted); font-size: .9rem; }

    /* Info-„i" auf Abhak-Zeilen */
    .checkline { grid-template-columns: 1.4rem 1fr auto; }
    .info-i { align-self: center; width: 1.55rem; height: 1.55rem; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--accent-dark); font: italic 900 .84rem/1 Georgia, "Times New Roman", serif; display: grid; place-items: center; opacity: .5; transition: all .16s var(--ease); flex: 0 0 auto; }
    .info-i:hover { opacity: 1; background: var(--accent-soft); border-color: rgba(255,204,0,.6); transform: scale(1.14); box-shadow: 0 4px 12px rgba(255,204,0,.3); }

    /* Info-Modal (fancy) */
    dialog.info { width: min(680px, calc(100% - 1.5rem)); max-height: min(88vh, 880px); padding: 0; border: 0; border-radius: 24px; background: transparent; overflow: visible; }
    dialog.info::backdrop { background: rgba(18,20,26,.42); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); opacity: 0; animation: infoBd .3s var(--ease) forwards; }
    @keyframes infoBd { to { opacity: 1; } }
    .info-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 30px 80px rgba(0,0,0,.3); max-height: inherit; display: flex; flex-direction: column; }
    .info-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); z-index: 6; }
    .info-card.opening { animation: infoPop .44s var(--ease); }
    @keyframes infoPop { from { transform: translateY(16px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
    .info-head { position: relative; padding: 1.4rem 1.5rem 1.1rem; background: var(--surface); border-bottom: 1px solid var(--line); overflow: hidden; flex: 0 0 auto; }
    .info-eyebrow { position: relative; font: 800 .64rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-dark); }
    .info-title { position: relative; margin-top: .35rem; font-size: 1.3rem; font-weight: 800; line-height: 1.2; color: var(--text); padding-right: 2.6rem; }
    .info-x { position: absolute; z-index: 5; right: 1rem; top: 1rem; width: 2.4rem; height: 2.4rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-soft); font-size: 1.35rem; display: grid; place-items: center; transition: background .15s, transform .15s, color .15s; }
    .info-x:active { transform: scale(.92); }
    .info-x:hover { background: var(--surface-3); color: var(--text); }
    .info-body { padding: 1.2rem 1.5rem 1.6rem; overflow: auto; }
    .info-sec { opacity: 0; transform: translateY(12px); animation: infoSec .5s var(--ease) forwards; margin-bottom: 1.15rem; }
    @keyframes infoSec { to { opacity: 1; transform: none; } }
    .info-sec:last-child { margin-bottom: 0; }
    .info-sec-h { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: .95rem; margin-bottom: .5rem; }
    .info-sec-ic { width: 1.7rem; height: 1.7rem; border-radius: 9px; display: grid; place-items: center; font-size: .95rem; flex: 0 0 auto; }
    .info-why .info-sec-ic { background: #e8f0fb; } .info-how .info-sec-ic { background: #eafaf1; }
    .info-pitch .info-sec-ic { background: var(--accent-soft); } .info-cross .info-sec-ic { background: #f3ecfd; }
    .info-obj .info-sec-ic { background: #fdeee9; } .info-err .info-sec-ic { background: #f1f2f5; }
    .info-sec p { color: var(--text-soft); line-height: 1.5; font-size: .92rem; }
    .info-sec ol, .info-sec ul { margin: 0; padding-left: 1.2rem; color: var(--text-soft); line-height: 1.55; font-size: .92rem; }
    .info-sec li + li { margin-top: .35rem; }
    .info-quote { padding: .75rem .95rem; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--surface-2); color: var(--text); font-weight: 600; font-style: italic; line-height: 1.5; }
    .info-obj-row { padding: .6rem .85rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); margin-bottom: .5rem; }
    .info-obj-row:last-child { margin-bottom: 0; }
    .info-obj-q { font-weight: 800; font-size: .88rem; }
    .info-obj-a { margin-top: .25rem; color: var(--text-soft); font-size: .9rem; line-height: 1.5; }

    /* KDB-Cockpit */
    .kdb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem,1fr)); gap: var(--s4); }
    .kdb-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); overflow: hidden; }
    .kdb-card-h { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 1rem 1.1rem .5rem; }
    .kdb-name { font-weight: 800; font-size: 1.08rem; }
    .kdb-tag { font-family: var(--mono); font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: .18rem .5rem; border-radius: 999px; }
    .kdb-card[data-status="good"] .kdb-tag { background: var(--good-soft); color: var(--good-ink); }
    .kdb-card[data-status="watch"] .kdb-tag { background: var(--watch-soft); color: var(--watch-ink); }
    .kdb-card[data-status="bad"] .kdb-tag { background: var(--bad-soft); color: var(--bad-ink); }
    .kdb-card-b { padding: 0 1.1rem 1.1rem; }
    .kdb-stat { display: flex; align-items: baseline; gap: .45rem; }
    .kdb-big { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
    .kdb-goal { color: var(--text-muted); font-weight: 800; }
    .kdb-bar { height: .5rem; border-radius: 999px; background: var(--bar-track); overflow: hidden; margin: .65rem 0 .2rem; }
    .kdb-bar i { display: block; height: 100%; border-radius: inherit; background: var(--text-muted); transition: width .5s var(--ease); }
    .kdb-card[data-status="good"] .kdb-bar i { background: var(--good); }
    .kdb-card[data-status="watch"] .kdb-bar i { background: var(--watch); }
    .kdb-card[data-status="bad"] .kdb-bar i { background: var(--bad); }
    .kdb-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .8rem; }
    .kdb-inputs label { display: grid; gap: .25rem; font-size: .74rem; font-weight: 800; color: var(--text-soft); }
    .kdb-inputs .stepper { grid-template-columns: 2.1rem 1fr 2.1rem; }
    .kdb-pitch { margin-top: .9rem; padding: .85rem .95rem; border-radius: 13px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface-2); animation: infoSec .5s var(--ease) both; }
    .kdb-pitch-h { display: flex; align-items: center; gap: .4rem; font-weight: 800; font-size: .8rem; color: var(--text); margin-bottom: .35rem; }
    .kdb-pitch p { color: var(--text-soft); font-size: .89rem; line-height: 1.5; font-style: italic; }
    .kdb-pitch .info-i { margin-left: auto; font-style: italic; }

    /* Scripts dialog */
    dialog.scripts { width: min(760px, calc(100% - 1.5rem)); max-height: min(80vh, 780px); padding: 0; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
    dialog.scripts::backdrop { background: rgba(20,23,28,.35); backdrop-filter: blur(6px); }
    .sc-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.4rem .9rem; }
    .sc-tabs { display: flex; gap: .4rem; flex-wrap: wrap; padding: 0 1.4rem 1rem; border-bottom: 1px solid var(--line); }
    .sc-tabs button { flex: 1 1 8rem; min-height: 2.6rem; border: 1px solid transparent; border-radius: 999px; background: var(--surface-2); font-weight: 800; color: var(--text-soft); }
    .sc-tabs button[aria-selected="true"] { background: var(--text); color: var(--text-inverse); }
    .sc-body { padding: 1.2rem 1.4rem 1.5rem; overflow: auto; }
    .sc-body ol { margin: 0; padding-left: 1.3rem; line-height: 1.6; color: var(--text-soft); }
    .sc-body li + li { margin-top: .5rem; }
    .icon-x { width: 2.6rem; height: 2.6rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 1.3rem; display: grid; place-items: center; }

    .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

    @media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
  

/* ===================== Passwortloser Login (Magic-Link) ===================== */
.authgate {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
  background:
    radial-gradient(1000px 500px at 15% -10%, #fff9df, transparent 55%),
    radial-gradient(900px 500px at 110% 10%, #eaf1f8, transparent 55%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
  animation: authFade .4s var(--ease);
}
@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }
.auth-card {
  width: min(420px, 100%); padding: clamp(1.4rem, 4vw, 2.1rem);
  border: 1px solid var(--line); border-radius: 26px; background: var(--surface);
  box-shadow: 0 30px 80px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.05);
  animation: authPop .5s var(--ease);
}
@keyframes authPop { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.4rem; }
.auth-title { font-size: clamp(1.5rem, 3.5vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; margin-top: .2rem; }
.auth-sub { margin-top: .5rem; color: var(--text-soft); font-size: .95rem; line-height: 1.5; }
.auth-form { display: grid; gap: .7rem; margin-top: 1.3rem; }
.auth-input {
  width: 100%; min-height: 3.1rem; padding: .7rem 1rem; border: 1px solid var(--line-strong);
  border-radius: 14px; background: var(--surface-2); font-weight: 700; font-size: 1.02rem;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s;
}
.auth-input:focus { outline: none; background: var(--surface); border-color: color-mix(in srgb, var(--accent-dark) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-dark) 10%, transparent); }
.auth-btn { width: 100%; min-height: 3.1rem; font-size: 1.02rem; box-shadow: 0 10px 24px rgba(255,204,0,.3); }
.auth-btn:disabled { opacity: .6; cursor: default; box-shadow: none; }
.auth-msg { min-height: 1.1rem; margin-top: .7rem; font-size: .86rem; font-weight: 700; }
.auth-msg.warn { color: var(--bad); }
.auth-fine { margin-top: 1.1rem; color: var(--text-muted); font-size: .76rem; line-height: 1.5; }
.auth-loading { display: flex; align-items: center; gap: .7rem; padding: 1.2rem .2rem; color: var(--text-muted); font-weight: 700; }
.auth-spinner { width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 2.5px solid var(--surface-3); border-top-color: var(--accent-dark); animation: authSpin .8s linear infinite; }
@keyframes authSpin { to { transform: rotate(360deg); } }
.auth-sent { text-align: center; animation: authPop .45s var(--ease); }
.auth-mailicon {
  width: 3.6rem; height: 3.6rem; margin: .3rem auto 1rem; display: grid; place-items: center;
  border-radius: 18px; font-size: 1.7rem; background: linear-gradient(145deg, #fff2b0, var(--accent));
  color: var(--accent-ink); box-shadow: 0 12px 28px rgba(255,204,0,.35); animation: ringPop .6s var(--ease);
}
.auth-sent .auth-title { margin-top: 0; }
.auth-sent .link-btn { margin-top: 1.2rem; }

/* hidden-Attribut muss immer gewinnen (sonst überschreibt display:flex/grid das Verstecken) */
[hidden] { display: none !important; }

/* ===================== Dezente Edit-Links (Apple-Style, hellgrau) ===================== */
.edit-link { border: 0; background: transparent; padding: .15rem .1rem; min-height: auto; color: var(--text-muted); font-weight: 600; font-size: .82rem; cursor: pointer; text-decoration: none; transition: color .15s var(--ease); white-space: nowrap; align-self: center; }
.edit-link:hover { color: var(--text-soft); }
.hero-edit-btn { display: inline-block; margin-top: .8rem; }

/* ===================== Hero-Editor (Kachel umbenennen) ===================== */
.hero-edit-form { margin-top: .8rem; display: grid; gap: .6rem; max-width: 40rem; }
.hero-ef { display: grid; gap: .25rem; }
.hero-ef-cap { font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); padding-left: .15rem; }
.hero-ef-in { width: 100%; min-height: 2.6rem; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); font: inherit; font-weight: 600; }
textarea.hero-ef-in { min-height: 4.6rem; resize: vertical; line-height: 1.45; }
.hero-ef-in:focus { outline: none; border-color: color-mix(in srgb, var(--accent-dark) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-dark) 8%, transparent); }

/* ===================== Listen-Editor (Zeitfenster & Abhakliste) ===================== */
.list-editor { display: flex; flex-direction: column; gap: .6rem; }
.le-row { display: flex; gap: .7rem; align-items: stretch; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-soft); transition: border-color .15s var(--ease); }
.le-row:hover { border-color: var(--line-strong); }
.le-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .5rem; }
.le-field { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.le-cap { font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); padding-left: .15rem; }
.le-in { width: 100%; min-width: 0; min-height: 2.6rem; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); font-weight: 600; font-size: .95rem; transition: border-color .15s, box-shadow .15s, background .15s; }
.le-in:focus { outline: none; background: var(--surface); border-color: color-mix(in srgb, var(--accent-dark) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-dark) 8%, transparent); }
.le-in.le-time { max-width: 9rem; font-variant-numeric: tabular-nums; font-weight: 800; }
.le-ctrl { display: flex; flex-direction: column; justify-content: center; gap: .3rem; flex: 0 0 auto; }
.le-btn { width: 2.1rem; height: 1.9rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text-soft); font-size: .78rem; cursor: pointer; transition: background .15s, transform .08s, color .15s; }
.le-btn:hover { background: var(--surface-3); color: var(--text); }
.le-btn:active { transform: scale(.9); }
.le-del { color: var(--bad); border-color: rgba(180,35,24,.25); }
.le-del:hover { background: var(--bad-soft); color: var(--bad); }
.le-bar { margin-top: .8rem; gap: .5rem; flex-wrap: wrap; }

/* ===================== Storno-Kacheln (je Sparte, Anzahl + Betrag) ===================== */
.storno-card { gap: .55rem; }
.storno-card.has-storno { border-color: rgba(180,35,24,.32); background: var(--bad-soft); }
.storno-field { display: grid; gap: .25rem; }
.storno-cap { font-size: .64rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); }
.storno-step { grid-template-columns: 2rem 1fr 2rem; }
.rev.storno-card .rev-inline input { min-height: 2.6rem; font-size: 1.05rem; }

/* ===================== Ziel-Cockpit (Donut-Ringe) ===================== */
.goal-rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 1rem; }
.goal-ring { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.1rem .7rem; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-2); text-align: center; transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.goal-ring:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.goal-ring[data-status="good"]  { background: var(--good-soft);  border-color: rgba(10,127,79,.25); }
.goal-ring[data-status="watch"] { background: var(--watch-soft); border-color: rgba(217,148,0,.32); }
.goal-ring[data-status="bad"]   { background: var(--bad-soft);   border-color: rgba(180,35,24,.22); }
.gr-donut { position: relative; width: 7rem; height: 7rem; }
.gr-svg { width: 100%; height: 100%; display: block; }
.gr-track { stroke: var(--bar-track); }
.gr-arc { transition: stroke-dashoffset 1.1s var(--ease); filter: drop-shadow(0 2px 6px rgba(0,0,0,.12)); }
.gr-center { position: absolute; inset: 0; display: grid; place-content: center; gap: .05rem; }
.gr-center b { font-size: 1.5rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.02em; }
.gr-sub { font-size: .66rem; font-weight: 800; color: var(--text-muted); }
.gr-label { font-weight: 800; font-size: .9rem; line-height: 1.2; }
.gr-label small { display: block; margin-top: .15rem; font-size: .68rem; font-weight: 700; color: var(--text-muted); }
.streak-tile { justify-content: flex-start; }
.streak-emoji { font-size: 1.9rem; line-height: 1; animation: ringPop .5s var(--ease); }
.streak-big { font-size: 2.6rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; color: var(--accent-dark); }
.gr-dots { margin-top: .3rem; justify-content: center; }

/* ===================== Gleitender Tab-Indikator (Apple-Style) ===================== */
.mainnav { position: relative; }
.mainnav button { position: relative; z-index: 1; }
.mainnav button[aria-selected="true"] { background: transparent; box-shadow: none; color: var(--text); }
.mainnav-ind {
  position: absolute; z-index: 0; left: 0; top: .3rem; width: 0; height: 2.9rem;
  border-radius: 999px; background: var(--surface); box-shadow: 0 4px 14px rgba(0,0,0,.1);
  opacity: 0; pointer-events: none;
  transition: left .42s var(--ease), top .42s var(--ease), width .42s var(--ease), height .42s var(--ease), opacity .2s var(--ease);
}

/* ===================== Select (Dropdown) im Feld-Stil ===================== */
.field select {
  width: 100%; min-height: 2.8rem; padding: .55rem 2.4rem .55rem .8rem;
  border: 1px solid var(--line); border-radius: 12px; background-color: var(--surface);
  font: inherit; font-weight: 800; color: var(--text); cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%238a8a91' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat; background-position: right .85rem center;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field select:focus { outline: none; border-color: color-mix(in srgb, var(--accent-dark) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-dark) 8%, transparent); }

/* ===================== Sparten-Dropdown (Umsatz-Verlauf) ===================== */
.rev-trend-sel {
  min-height: 2.5rem; padding: .4rem 2.2rem .4rem .8rem; border: 1px solid var(--line);
  border-radius: 999px; background-color: var(--surface); font: inherit; font-weight: 800;
  font-size: .82rem; color: var(--text); cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%238a8a91' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat; background-position: right .8rem center;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.rev-trend-sel:hover { border-color: var(--line-strong); }
.rev-trend-sel:focus { outline: none; border-color: color-mix(in srgb, var(--accent-dark) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-dark) 8%, transparent); }

/* ===================== Überweisungs-/Bonus-Kacheln im Ziel-Cockpit ===================== */
.bonus-amount { font-size: 1.55rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -.02em; color: var(--accent-dark); }
.goal-ring[data-status="good"] .bonus-amount { color: var(--good-ink); }
.goal-ring[data-status="watch"] .bonus-amount { color: var(--watch-ink); }
.payout-tile, .bonus-tile { justify-content: flex-start; }

/* ===================== Bücher (Tippbuch & Antragsbuch) ===================== */
.book-toolbar { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: var(--s3); align-items: center; }
.book-toolbar input, .book-toolbar select {
  min-height: 2.6rem; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); font: inherit; font-weight: 700; font-size: .86rem; color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.book-toolbar input:focus, .book-toolbar select:focus { outline: none; border-color: color-mix(in srgb, var(--accent-dark) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-dark) 8%, transparent); }
.book-toolbar input[type="search"] { flex: 1 1 12rem; min-width: 10rem; }
.book-summary { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: var(--s4); }
.book-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.book-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.book-table th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left;
  font-size: .64rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  font-weight: 800; padding: .55rem .65rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.book-table td { padding: .5rem .65rem; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.book-table tbody tr { cursor: pointer; transition: background .12s var(--ease); }
.book-table tbody tr:hover { background: var(--surface-2); }
.book-table tbody tr:last-child td { border-bottom: 0; }
.book-table tbody tr.muted td { opacity: .5; }
.book-table td.num, .book-table th.num { text-align: right; }
.book-table td.ok { color: var(--good); font-weight: 800; }
.book-empty { padding: 2.2rem 1rem; text-align: center; color: var(--text-muted); font-weight: 700; }
.status-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .16rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 800; background: var(--surface-3); color: var(--text-soft); }
.status-chip::before { content: ""; width: .48rem; height: .48rem; border-radius: 50%; background: var(--text-muted); flex: none; }
.status-chip[data-status="good"] { background: var(--good-soft); color: var(--good-ink); }
.status-chip[data-status="good"]::before { background: var(--good); }
.status-chip[data-status="watch"] { background: var(--watch-soft); color: var(--watch-ink); }
.status-chip[data-status="watch"]::before { background: var(--watch); }
.status-chip[data-status="bad"] { background: var(--bad-soft); color: var(--bad-ink); }
.status-chip[data-status="bad"]::before { background: var(--bad); }
.sparte-badge { display: inline-block; padding: .14rem .5rem; border-radius: 8px; background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 800; font-size: .72rem; }

/* Eintrags-Formular im Dialog */
.book-dialog .info-card { width: 100%; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: .7rem .8rem; }
.bk-field { display: flex; flex-direction: column; gap: .3rem; }
.bk-cap { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.bk-field input, .bk-field select, .bk-field textarea {
  min-height: 2.6rem; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 11px;
  font: inherit; font-weight: 700; background: var(--surface); color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.bk-field input:focus, .bk-field select:focus, .bk-field textarea:focus { outline: none; border-color: color-mix(in srgb, var(--accent-dark) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-dark) 8%, transparent); }
.bk-field textarea { min-height: 4.2rem; resize: vertical; }
.bk-field.wide { grid-column: 1 / -1; }
.bk-check { flex-direction: row; align-items: center; gap: .55rem; padding-top: 1.1rem; font-weight: 800; font-size: .86rem; }
.bk-check input { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--accent-dark); }
.bk-preview { margin-top: .9rem; padding: .7rem .9rem; border-radius: 11px; background: var(--surface-2); border: 1px dashed var(--line-strong); font-weight: 800; font-size: .9rem; display: flex; gap: 1.2rem; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.bk-preview small { display: block; font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }

/* KDB-Cockpit: Hinweis auf automatisch gezählte Tippbuch-Tipps */
.kdb-auto-note { font-size: .74rem; color: var(--text-muted); font-weight: 700; margin-top: .1rem; }

/* Monats-Summenleiste im Antragsbuch (zählt nur policierte Verträge) */
.book-monthbar {
  position: sticky; bottom: max(.8rem, env(safe-area-inset-bottom)); z-index: 30;
  margin-top: var(--s4); display: flex; align-items: center; gap: .9rem;
  padding: .75rem 1.1rem; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow);
}
.book-monthbar[data-status="good"] { border-color: rgba(10,127,79,.35); background: linear-gradient(135deg, var(--good-soft), var(--surface) 62%); }
.bm-ic { width: 2.4rem; height: 2.4rem; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.15rem; flex: 0 0 auto; }
.book-monthbar[data-status="good"] .bm-ic { background: var(--good-soft); }
.bm-txt { display: grid; gap: .3rem; justify-items: start; min-width: 0; }
.bm-txt small { font-family: var(--mono); font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.bm-amount { margin-left: auto; font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.book-monthbar[data-status="good"] .bm-amount { color: var(--good-ink); }
@media (max-width: 520px){
  .book-monthbar { gap: .6rem; padding: .6rem .8rem; flex-wrap: wrap; }
  .bm-ic { width: 2rem; height: 2rem; font-size: 1rem; }
  .bm-txt small { white-space: normal; letter-spacing: .04em; }
  .bm-amount { font-size: 1.15rem; }
}

/* Bücher-Panel in der Auswertung */
.book-eval-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: var(--s5); }
.book-eval-col h4 { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .6rem; }
.book-eval-col .eval-summary { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
.book-status-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }

/* ===================== Mobile (kleine iPhones) ===================== */
button, input, select, label { touch-action: manipulation; }

/* Burger-Button (nur mobil sichtbar) */
.menu-btn { display: none; width: 2.75rem; min-height: 2.75rem; padding: 0; place-items: center; flex: 0 0 auto; }
.menu-btn svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Bottom-Tab-Bar (nur mobil sichtbar) */
.tabbar { display: none; }

/* Bottom-Sheets (Mehr-Menü & Burger-Menü) */
dialog.sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; margin: 0; padding: 0; border: 0; background: transparent; }
dialog.sheet::backdrop { background: rgba(18,20,26,.45); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.sheet-card { border-radius: 22px 22px 0 0; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -18px 50px rgba(0,0,0,.25); padding: .4rem .8rem calc(.9rem + env(safe-area-inset-bottom)); animation: sheetUp .28s var(--ease); }
@keyframes sheetUp { from { transform: translateY(46px); opacity: .3; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 2.4rem; height: .3rem; border-radius: 999px; background: var(--surface-3); margin: .4rem auto .55rem; }
.sheet-item { display: flex; align-items: center; gap: .85rem; width: 100%; min-height: 3.1rem; padding: .4rem .65rem; border: 0; border-radius: 14px; background: transparent; font-weight: 800; font-size: 1rem; color: var(--text); text-align: left; }
.sheet-item svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--accent-dark); flex: 0 0 auto; }
.sheet-item:active { background: var(--surface-2); }
.sheet-item[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-soft-ink); }
.sheet-item.danger { color: var(--bad); }
.sheet-item.danger svg { color: var(--bad); }
.sheet-info { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .3rem .65rem .75rem; border-bottom: 1px solid var(--line); margin-bottom: .45rem; font-size: .8rem; color: var(--text-soft); font-weight: 700; min-width: 0; }
.sheet-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bücher als Karten (mobil) */
.book-cards { display: grid; gap: .55rem; }
.bcard { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-soft); padding: .75rem .85rem; display: grid; gap: .45rem; cursor: pointer; }
.bcard:active { transform: scale(.985); }
.bcard.muted { opacity: .55; }
.bcard-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.bcard-top b { font-size: .95rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard-date { font-family: var(--mono); font-size: .7rem; font-weight: 800; color: var(--text-muted); flex: 0 0 auto; }
.bcard-mid { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .5rem; }
.bcard-sub { font-size: .76rem; font-weight: 700; color: var(--text-soft); min-width: 0; }
.bcard-sub.mono { font-family: var(--mono); font-size: .7rem; }
.bcard-bot { display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.bcard-flags { display: flex; gap: .35rem; flex-wrap: wrap; }
.bcard-nums { display: flex; gap: .9rem; text-align: right; font-variant-numeric: tabular-nums; }
.bcard-nums span { display: grid; gap: .05rem; font-size: .82rem; font-weight: 800; }
.bcard-nums small { font-family: var(--mono); font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.bcard-nums b { color: var(--good-ink); }

@media (max-width: 700px) {
  :root { --radius: 16px; --s5: 1rem; }
  .wrap { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }

  /* Kopfzeile: Brand + Datum + Burger in einer Zeile */
  .appbar { flex-wrap: nowrap; gap: .55rem; }
  #openScripts, #soundToggle, #syncChip, #accountLabel, #logoutBtn { display: none; }
  .menu-btn { display: grid; }
  .brand-mark { width: 2.2rem; height: 2.2rem; }
  .brand-txt strong { font-size: .95rem; }
  .today-chip span { font-size: .6rem; }
  .today-chip strong { font-size: .76rem; white-space: nowrap; }

  /* Obere Tab-Leiste weg, feste Bottom-Bar an */
  .mainnav { display: none; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: grid; grid-template-columns: repeat(5, 1fr); gap: .15rem; background: color-mix(in srgb, var(--surface) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line-strong); padding: .3rem .4rem calc(.3rem + env(safe-area-inset-bottom)); }
  .tabbar button { display: grid; justify-items: center; align-content: center; gap: .2rem; min-height: 3.3rem; padding: .3rem .05rem; border: 0; border-radius: 13px; background: transparent; color: var(--text-muted); font-weight: 800; transition: background .15s var(--ease), color .15s var(--ease), transform .1s; }
  .tabbar button svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar #navMoreBtn svg circle { fill: currentColor; stroke: none; }
  .tabbar button span { font-size: .58rem; white-space: nowrap; }
  .tabbar button[aria-selected="true"] { color: var(--accent-soft-ink); background: var(--accent-soft); }
  .tabbar button:active { transform: scale(.93); }

  /* Datums-Navigator kompakt, Wochenstreifen als 7er-Grid */
  .datenav { gap: .45rem; }
  .datenav .seg { flex: 1 1 auto; justify-content: space-between; }
  #todayBtn, #calToggle { padding: 0 .65rem; font-size: .8rem; min-height: 2.6rem; }
  .weekstrip { flex-basis: 100%; display: grid; grid-template-columns: repeat(7, 1fr); gap: .2rem; }
  .weekstrip button { min-width: 0; min-height: 2.95rem; }
  .weekstrip button b { font-size: .95rem; }

  /* Hero & Panels */
  .hero { padding: 1rem; }
  .hero h2 { font-size: 1.3rem; }
  .hero p.brief { font-size: .87rem; }
  .ring { width: 7.2rem; height: 7.2rem; justify-self: center; }
  .panel-h { flex-wrap: wrap; padding: .95rem .95rem .5rem; gap: .55rem; }
  .panel-b { padding: 0 .95rem .95rem; }
  .panel-h h3 { font-size: 1rem; }
  .panel-h p { font-size: .8rem; }

  /* Grids: Platz sinnvoll nutzen */
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stepper { grid-template-columns: 2.4rem 1fr 2.4rem; }
  .stepper button { width: 2.4rem; height: 2.4rem; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rev-grid { grid-template-columns: 1fr; }
  .eval-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .stat { padding: .7rem .8rem; }
  .stat strong { font-size: 1.25rem; }
  .goal-rings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .pace-grid { grid-template-columns: 1fr; }
  .goal-row { grid-template-columns: 1fr; gap: .35rem; }
  .eval-controls { gap: .45rem; }
  .eval-controls .pill-btn { padding: 0 .75rem; min-height: 2.6rem; font-size: .82rem; }
  .cal-day { min-height: 2.7rem; }

  /* Bücher: Karten statt Tabelle, Filter kompakt */
  .book-table-wrap { border: 0; border-radius: 0; background: transparent; overflow: visible; }
  .book-toolbar select { flex: 1 1 30%; min-width: 0; }
  .book-monthbar { bottom: calc(4.5rem + env(safe-area-inset-bottom)); }

  /* Dialoge werden Bottom-Sheets */
  dialog.info { width: 100%; max-width: 100%; margin: 0; position: fixed; top: auto; bottom: 0; max-height: 94dvh; border-radius: 22px 22px 0 0; }
  .info-card { border-radius: 22px 22px 0 0; max-height: 94dvh; }
  .info-head { padding: 1.05rem 1rem .85rem; }
  .info-body { padding: 1rem 1rem calc(1.2rem + env(safe-area-inset-bottom)); }
  .bk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem .6rem; }
  dialog.scripts { width: 100%; max-width: 100%; margin: 0; position: fixed; top: auto; bottom: 0; max-height: 92dvh; border-radius: 22px 22px 0 0; }

  /* iOS-Auto-Zoom verhindern: Eingaben mind. 16px */
  .book-toolbar input, .book-toolbar select,
  .bk-field input, .bk-field select, .bk-field textarea,
  .field input, .field select, .goal-row input, .rev-calc input,
  .auth-input, .notes-area, .hero-ef-in, .le-in { font-size: 16px; }
}

/* ===================== Desktop-Struktur: Sidebar + 2-Spalten-Raster ===================== */
/* .cols-2: mobil 1 Spalte, ab 1024 px exakt 2 gleich breite Spalten */
.cols-2 { display: grid; gap: var(--s4); grid-template-columns: 1fr; align-items: start; }

.sidebar { display: none; }

@media (min-width: 1024px) {
  .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .wrap { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: clamp(1rem, 1.8vw, 1.8rem); max-width: 1800px; align-items: start; }
  .content { min-width: 0; }

  .sidebar {
    display: flex; flex-direction: column; gap: var(--s3);
    position: sticky; top: clamp(.75rem, 2.2vw, 1.6rem);
    height: calc(100dvh - clamp(1.5rem, 4.4vw, 3.2rem));
    padding: 1.1rem .85rem .9rem; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow-soft); overflow-y: auto;
  }
  .sb-brand { padding: 0 .4rem .4rem; }
  .sb-nav { display: grid; gap: .25rem; }
  .sb-item {
    display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 2.75rem;
    padding: .5rem .8rem; border: 0; border-radius: 12px; background: transparent;
    color: var(--text-soft); font-weight: 800; font-size: .92rem; text-align: left;
    transition: background .15s var(--ease), color .15s var(--ease);
  }
  .sb-item svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
  .sb-item:hover { background: var(--surface-2); color: var(--text); }
  .sb-item[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px rgba(255,204,0,.32); }
  .sb-foot { margin-top: auto; display: grid; gap: .2rem; border-top: 1px solid var(--line); padding-top: .75rem; }
  .sb-account { display: grid; gap: .35rem; justify-items: start; padding: 0 .4rem .55rem; font-size: .76rem; font-weight: 700; color: var(--text-soft); min-width: 0; }
  .sb-account b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sb-danger { color: var(--bad); }
  .sb-danger:hover { background: var(--bad-soft); color: var(--bad); }

  /* Kopfzeile schlank: Brand & Aktionen stecken jetzt in der Sidebar */
  .appbar .brand, #openScripts, #soundToggle, #syncChip, #accountLabel, #logoutBtn { display: none; }
  .appbar { padding-block: .1rem var(--s3); }
  .mainnav { display: none; }
}

/* ===================== Logo & Icon-Politur ===================== */
.brand-logo { width: 2.5rem; height: 2.5rem; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow-soft); object-fit: cover; background: #fff; flex: 0 0 auto; }
.auth-brand .brand-logo { width: 3rem; height: 3rem; border-radius: 14px; }
.pill-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.pill-btn svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.rev-calc-toggle svg, .kdb-pitch-h svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.info-sec-ic svg { width: 1rem; height: 1rem; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.streak-emoji { display: grid; place-items: center; color: var(--accent-dark); }
.streak-emoji svg { width: 1.8rem; height: 1.8rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.streak-tile[data-status="good"] .streak-emoji { color: var(--watch); }
.bm-ic { color: var(--accent-soft-ink); }
.bm-ic svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Sichtbarer Tastatur-Fokus */
:where(button, [role="tab"], select, a):focus-visible { outline: 3px solid color-mix(in srgb, var(--accent-dark) 60%, transparent); outline-offset: 2px; }

/* Kachel-Feinschliff: einheitliche Beschriftungs-Sprache */
.stat span { font-family: var(--mono); font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
#dashStats .stat strong { font-size: 1.3rem; }

/* Klickbare Warn-Kachel (offene Anträge) */
.stat-link { cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.stat-link:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.stat[data-tone="watch"] { background: var(--watch-soft); border-color: rgba(217,148,0,.45); }
.stat[data-tone="watch"] span { color: var(--watch-ink); }
.stat[data-tone="watch"] small { color: var(--watch-ink); }
.stat span svg { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -2px; margin-right: .25rem; }

/* Toast (Speicher-Feedback & Rückgängig) */
.vp-toast { position: fixed; left: 50%; bottom: max(1.1rem, env(safe-area-inset-bottom)); transform: translate(-50%, 16px); z-index: 200; display: flex; align-items: center; gap: .9rem; padding: .7rem 1.15rem; border-radius: 999px; background: var(--text); color: var(--text-inverse); font-weight: 800; font-size: .88rem; box-shadow: 0 14px 40px rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease); max-width: min(92vw, 34rem); }
.vp-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.vp-toast-btn { border: 0; background: transparent; color: var(--accent); font-weight: 900; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; cursor: pointer; }
@media (max-width: 700px){ .vp-toast { bottom: calc(4.8rem + env(safe-area-inset-bottom)); } }

/* Bestätigungs-Dialog */
.vp-confirm .info-card { max-width: 26rem; margin-inline: auto; }
.vpc-body h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: .45rem; }
.vpc-body p { color: var(--text-soft); line-height: 1.5; font-size: .92rem; }

/* Sortierbare Tabellenköpfe */
.book-table th[data-sort] { cursor: pointer; user-select: none; }
.book-table th[data-sort]:hover { color: var(--text); }

/* Kalte Tipps (ohne Termin, älter als 3 Tage) */
.book-table tr.cold td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.bcard.cold { box-shadow: inset 3px 0 0 var(--bad), var(--shadow-soft); }
/* Fällige Wiedervorlagen — bewusst geparkt, jetzt wieder dran */
.book-table tr.due td:first-child { box-shadow: inset 3px 0 0 var(--watch); }
.bcard.due { box-shadow: inset 3px 0 0 var(--watch), var(--shadow-soft); }
.bk-tries { font-family: var(--mono); font-size: .68rem; font-weight: 800; color: var(--text-muted); }
.bk-hint { grid-column: 1 / -1; margin: -.15rem 0 .1rem; font-size: .76rem; line-height: 1.4; color: var(--text-muted); font-weight: 600; }

/* Dashboard-Hinweise & Monats-Kacheln */
#dashAlerts .dash-alert { display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; border: 1px solid rgba(217,148,0,.4); border-left: 4px solid var(--watch); border-radius: var(--radius-sm); background: var(--watch-soft); color: var(--watch-ink); font-weight: 700; font-size: .88rem; }
#dashAlerts .dash-alert + .dash-alert { margin-top: .5rem; }
#dashAlerts .dash-alert svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
#dashAlerts .dash-alert .link-btn { margin-left: auto; color: inherit; }

/* ===================== Dunkelmodus ===================== */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101014;
  --bg-soft: #15151a;
  --surface: #1b1b21;
  --surface-2: #22222a;
  --surface-3: #2b2b34;
  --text: #f2f2f5;
  --text-soft: #c0c0c9;
  --text-muted: #9a9aa5;
  --text-inverse: #17171c;
  --accent-dark: #7db6dc;
  --accent-soft: #3a3106;
  --accent-soft-ink: #ffd75c;
  --good: #35c07f;
  --good-soft: #12301f;
  --good-ink: #7fe0ae;
  --watch: #e6a817;
  --watch-soft: #332a10;
  --watch-ink: #f2c96b;
  --bad: #e05a4e;
  --bad-soft: #3a1713;
  --bad-ink: #ff9f96;
  --line: rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.17);
  --shadow: 0 12px 34px rgba(0,0,0,.5);
  --shadow-soft: 0 1px 2px rgba(0,0,0,.4), 0 10px 26px rgba(0,0,0,.35);
  --hero-tint: #262214;
  --weekend-stripe: #23232b;
  --bar-track: rgba(255,255,255,.12);
  --bg-glow: rgba(255,204,0,.05); /* dezenter warmer Schein statt weißem Fleck */
}
:root[data-theme="dark"] .info-why .info-sec-ic { background: #1c2836; }
:root[data-theme="dark"] .info-how .info-sec-ic { background: #17301f; }
:root[data-theme="dark"] .info-cross .info-sec-ic { background: #2a2338; }
:root[data-theme="dark"] .info-obj .info-sec-ic { background: #33201b; }
:root[data-theme="dark"] .info-err .info-sec-ic { background: #2a2a31; }
:root[data-theme="dark"] .kpi[data-status="good"] { border-color: rgba(53,192,127,.35); }
:root[data-theme="dark"] .kpi[data-status="watch"] { border-color: rgba(230,168,23,.4); }
:root[data-theme="dark"] .kpi[data-status="bad"] { border-color: rgba(224,90,78,.35); }
:root[data-theme="dark"] .cal-day[data-status="good"] { border-color: rgba(53,192,127,.4); }
:root[data-theme="dark"] .cal-day[data-status="watch"] { border-color: rgba(230,168,23,.45); }
:root[data-theme="dark"] .cal-day[data-status="bad"] { border-color: rgba(224,90,78,.4); }
:root[data-theme="dark"] .cal-day[data-status="review"] { background: #23232b; color: var(--text-soft); }
:root[data-theme="dark"] .brand-mark { box-shadow: 0 8px 20px rgba(255,204,0,.15); }

/* ===================== Akzentfarben ===================== */
:root[data-accent="blau"]    { --accent:#2e90fa; --accent-soft:#dcebfe; --accent-ink:#082647; --accent-soft-ink:#0a3766; }
:root[data-accent="blau"][data-theme="dark"]    { --accent-soft:#14304f; --accent-soft-ink:#8ec5ff; }
:root[data-accent="gruen"]   { --accent:#12b76a; --accent-soft:#d7f5e7; --accent-ink:#053622; --accent-soft-ink:#0a4d31; }
:root[data-accent="gruen"][data-theme="dark"]   { --accent-soft:#123626; --accent-soft-ink:#7fe0ae; }
:root[data-accent="violett"] { --accent:#8b5cf6; --accent-soft:#ece6fd; --accent-ink:#26124d; --accent-soft-ink:#3b1d78; }
:root[data-accent="violett"][data-theme="dark"] { --accent-soft:#2c2150; --accent-soft-ink:#c9b8ff; }
:root[data-accent="orange"]  { --accent:#f97316; --accent-soft:#ffe8d4; --accent-ink:#3d1503; --accent-soft-ink:#66290a; }
:root[data-accent="orange"][data-theme="dark"]  { --accent-soft:#3d2210; --accent-soft-ink:#ffb37a; }
/* Tagesring folgt der Akzentfarbe */
#ringGrad stop:first-child { stop-color: color-mix(in srgb, var(--accent) 45%, #ffffff); }
#ringGrad stop:last-child  { stop-color: var(--accent); }
.accent-row { display: flex; gap: .55rem; flex-wrap: wrap; }
.accent-dot { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 2px solid var(--line-strong); cursor: pointer; display: grid; place-items: center; padding: 0; background: var(--surface); transition: transform .15s var(--ease), border-color .15s var(--ease); }
.accent-dot i { width: 1.65rem; height: 1.65rem; border-radius: 50%; display: block; }
.accent-dot:hover { transform: scale(1.1); }
.accent-dot[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 15%, transparent); }

/* ===================== Kompakt-Modus ===================== */
:root[data-density="compact"] .panel-h { padding: .75rem .85rem .35rem; }
:root[data-density="compact"] .panel-b { padding: 0 .85rem .75rem; }
:root[data-density="compact"] .panel-h p { display: none; }
:root[data-density="compact"] .grid, :root[data-density="compact"] .cols, :root[data-density="compact"] .cols-2, :root[data-density="compact"] .dash-layout, :root[data-density="compact"] .stack { gap: .6rem; }
:root[data-density="compact"] .stat { padding: .55rem .7rem; }
:root[data-density="compact"] .stat strong { font-size: 1.15rem; }
:root[data-density="compact"] .hero { padding: .85rem 1rem; }
:root[data-density="compact"] .checkline { padding: .35rem .4rem; }
:root[data-density="compact"] .kpi { padding: .5rem .6rem; }
:root[data-density="compact"] .rev { padding: .6rem; gap: .35rem; }
:root[data-density="compact"] .goal-ring { padding: .7rem .5rem; gap: .4rem; }

/* ===================== Chef-Modus (Beträge verbergen) ===================== */
[data-privacy="1"] :is(.money, .bm-amount, .bonus-amount, .bcard-nums,
  #revGrid .rev-inline input, #revGrid .rev-meta, #revGrid .rev-target,
  #stornoGrid .rev-inline input, #revEval, #paceGrid, #goalEditor input,
  #antragSummary, #antragTable td.num, #dashStats .stat:first-child strong) { filter: blur(7px); }

/* ===================== Level & XP ===================== */
.sb-level { display: grid; gap: .3rem; padding: .1rem .4rem .65rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.sb-level-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .72rem; font-weight: 800; color: var(--text-soft); }
.sb-level-top b { font-size: .78rem; color: var(--text); }
.sb-level-bar { height: .4rem; border-radius: 999px; background: var(--bar-track); overflow: hidden; }
.sb-level-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .6s var(--ease); }
.sb-level small { font-size: .6rem; color: var(--text-muted); font-weight: 700; }

/* ===================== Erfolge & Rekorde ===================== */
.gami-level { display: flex; align-items: center; gap: 1rem; padding: .95rem 1rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.gami-level-num { width: 3.1rem; height: 3.1rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; font-size: 1.25rem; flex: none; }
.gami-level-info { flex: 1; min-width: 0; display: grid; gap: .35rem; }
.gami-level-info .sb-level-bar { height: .5rem; }
.gami-h { font-family: var(--mono); font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-top: 1.1rem; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .55rem; margin-top: .55rem; }
.badge { border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); padding: .7rem .6rem .6rem; text-align: center; display: grid; gap: .25rem; justify-items: center; }
.badge svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: var(--accent-dark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.badge b { font-size: .78rem; line-height: 1.25; }
.badge small { font-size: .63rem; color: var(--text-muted); font-weight: 700; line-height: 1.3; }
.badge .badge-date { font-family: var(--mono); font-size: .58rem; color: var(--good-ink); font-weight: 800; }
.badge.locked { opacity: .4; filter: grayscale(1); }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .55rem; margin-top: .55rem; }

/* ===================== Konfetti ===================== */
.confetti-holder { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.confetti-holder i { position: absolute; top: -5vh; width: .55rem; height: .85rem; border-radius: 2px; opacity: .95; animation: confFall linear forwards; }
@keyframes confFall { to { transform: translateY(112vh) rotate(720deg); } }

/* ===================== Monats-Rückblick (Wrapped) ===================== */
.wr-body { padding: 2.2rem 1.6rem 1rem; display: grid; gap: .9rem; justify-items: center; text-align: center; min-height: 17rem; align-content: center; }
.wr-kick { font-family: var(--mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-dark); font-weight: 800; }
.wr-big { font-size: 2.7rem; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.wr-sub { color: var(--text-soft); font-weight: 700; max-width: 26rem; line-height: 1.45; }
.wr-step { animation: infoSec .45s var(--ease) both; display: grid; gap: .9rem; justify-items: center; }
.wr-foot { display: flex; flex-direction: column; align-items: center; gap: .9rem; padding: 0 1.5rem 1.6rem; }
.wr-dots { display: flex; gap: .35rem; justify-content: center; }
.wr-dots i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--surface-3); }
.wr-dots i.on { background: var(--accent); }

/* ===================== Spiele-Hub ===================== */
#gameHub .info-card { max-width: 720px; }
.game-hub-sub { color: var(--text-soft); font-weight: 700; font-size: .9rem; margin-bottom: .95rem; }
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
@media (max-width: 560px){ .game-grid { grid-template-columns: 1fr; } }
.game-card { position: relative; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface-2); cursor: pointer; padding: 0; text-align: left; display: grid; transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
.game-card:hover { transform: translateY(-3px) scale(1.01); box-shadow: var(--shadow); border-color: var(--line-strong); }
.game-card:active { transform: scale(.99); }
.game-cover { height: 6.4rem; display: grid; place-items: center; position: relative; overflow: hidden; }
.game-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 85% -20%, rgba(255,255,255,.35), transparent 55%); pointer-events: none; }
.game-cover svg { width: 2.7rem; height: 2.7rem; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 4px 10px rgba(0,0,0,.28)); position: relative; z-index: 1; }
.game-card[data-game="snake"]   .game-cover { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #5c4400)); }
.game-card[data-game="g2048"]   .game-cover { background: linear-gradient(135deg, #f59563, #edc22e); }
.game-card[data-game="dino"]    .game-cover { background: linear-gradient(135deg, #64748b, #111827); }
.game-card[data-game="hextris"] .game-cover { background: linear-gradient(135deg, #22d3ee, #6366f1); }
.game-card[data-game="dino"] .game-cover svg { fill: #fff; stroke: none; }
.game-meta { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .75rem .9rem .85rem; }
.game-meta b { font-size: .98rem; display: block; line-height: 1.2; }
.game-meta small { display: block; color: var(--text-muted); font-size: .72rem; font-weight: 700; margin-top: .15rem; }
.game-play { flex: none; padding: .38rem .85rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .74rem; font-weight: 900; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.game-hs { position: absolute; top: .6rem; left: .6rem; z-index: 2; padding: .2rem .6rem; border-radius: 999px; background: rgba(0,0,0,.35); color: #fff; font-family: var(--mono); font-size: .62rem; font-weight: 800; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.mini2048 { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, 1.55rem); gap: .3rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,.22)); }
.mini2048 i { width: 1.55rem; height: 1.55rem; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: .72rem; background: rgba(255,255,255,.94); color: #776e65; }
.mini2048 i:last-child { background: #edc22e; color: #fff; }
.game-license { margin-top: 1rem; color: var(--text-muted); font-size: .66rem; font-weight: 600; line-height: 1.55; }

/* ===================== Tipp-Jagd (Pausenspiel) ===================== */
.game-wrap { display: grid; gap: .8rem; justify-items: center; padding: 1.2rem 1.2rem 1.5rem; }
#snakeCanvas { border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface-2); touch-action: none; max-width: 100%; height: auto; }
.game-score { display: flex; gap: .6rem; }
