:root {
  color-scheme: dark;
  --r: 4px;
  --bg: #F2F4F3; --card: #FFFFFF; --soft: #E8ECEA; --line: #D5DBD8;
  --text: #111614; --muted: #5E6A64;
  --accent: #16A34A; --accent-soft: #DCF5E5; --on-accent: #FFFFFF;
  --exam: #CA8A04; --exam-soft: #FEF3C7;
  --good: #16A34A; --mid: #B7791F; --low: #DC2626;
  --shadow: 0 1px 2px rgba(14, 26, 47, .06), 0 4px 16px rgba(14, 26, 47, .05);
  --acc-rgb: 22, 163, 74; --acc2-rgb: 20, 184, 166; --exam-rgb: 202, 138, 4;
  --glow: 0 0 14px rgba(var(--acc-rgb), .35);
  --glow-text: none;
}
  :root {
    --bg: #070B09; --card: #111814; --soft: #1D2320; --line: #2A322E;
    --text: #EEF3F0; --muted: #8E9A94;
    --accent: #22C55E; --accent-soft: #163222; --on-accent: #04140A;
    --exam: #FACC15; --exam-soft: #3A3210;
    --good: #4ADE80; --mid: #FACC15; --low: #F87171;
    --shadow: none;
    --acc-rgb: 34, 197, 94; --acc2-rgb: 45, 212, 191; --exam-rgb: 250, 204, 21;
    --glow: 0 0 22px rgba(var(--acc-rgb), .55), 0 0 2px rgba(var(--acc-rgb), .9);
    --glow-text: 0 0 16px rgba(var(--acc-rgb), .75);
  }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, system-ui, sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; text-align: left; }
#app { height: 100%; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(env(safe-area-inset-top) + 20px) 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.scroll::-webkit-scrollbar { display: none; }

h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
h2 { margin: 10px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); font-size: 13px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.icon-btn svg { width: 18px; height: 18px; }
.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--card); border-radius: var(--r); padding: 14px 16px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.tile .big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.tile .lbl { font-size: 13px; color: var(--muted); }
.tile.accent .big { color: var(--accent); }

.list { background: var(--card); border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; width: 100%; }
.item + .item { border-top: 1px solid var(--line); }
.item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.item.done .title { color: var(--muted); text-decoration: line-through; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chev { color: var(--muted); font-size: 18px; }
.tag { font-size: 11px; font-weight: 700; color: var(--exam); background: var(--exam-soft); padding: 2px 7px; border-radius: 3px; }

.check { width: 28px; height: 28px; border-radius: 4px; border: 2px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .18s; position: relative; }
.check::before { content: ''; position: absolute; inset: -9px; }
.check svg { width: 15px; height: 15px; fill: none; stroke: transparent; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .15s; }
.check.on { background: var(--accent); border-color: var(--accent); box-shadow: var(--glow); }
.check.on svg { stroke: var(--on-accent); }
.check:active { transform: scale(.88); }

.exam-card { background: var(--card); border-radius: var(--r); border: 1px solid var(--line); padding: 14px 16px; display: flex; gap: 14px; align-items: center; width: 100%; border-left: 4px solid var(--exam); }
.exam-card .when { min-width: 40px; text-align: center; display: flex; flex-direction: column; }
.exam-card .when b { font-size: 22px; line-height: 1; color: var(--exam); }
.exam-card .when span { font-size: 11px; color: var(--muted); text-transform: uppercase; }

.empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }
.err { color: var(--exam); font-size: 13px; }
.updated { text-align: center; font-size: 12px; color: var(--muted); padding: 6px 0; }

.back { align-self: flex-start; color: var(--accent); font-weight: 600; min-height: 40px; display: flex; align-items: center; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.steps .item { min-height: 52px; }
.notes { font-size: 13px; color: var(--muted); white-space: pre-line; }
.orig { color: var(--accent); font-size: 14px; text-decoration: none; font-weight: 600; }

.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--soft); border-radius: var(--r); padding: 3px; gap: 3px; }
.seg.auto { display: flex; }
.seg button { min-height: 38px; border-radius: var(--r); font-size: 14px; font-weight: 600; color: var(--muted); text-align: center; padding: 0 12px; }
.seg button.on { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }

.ki { background: var(--card); border-radius: var(--r); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ki-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ki-title svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 2; }
.photos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.photo { position: relative; flex-shrink: 0; }
.photo img { width: 64px; height: 84px; object-fit: cover; border-radius: var(--r); display: block; }
.photo button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); color: var(--bg); font-size: 13px; line-height: 22px; text-align: center; }
.add-photo { width: 64px; height: 84px; border-radius: var(--r); border: 2px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; gap: 2px; flex-shrink: 0; cursor: pointer; }
.add-photo b { font-size: 22px; font-weight: 400; color: var(--accent); }
.ask { display: flex; gap: 8px; }
.ask input { flex: 1; min-width: 0; min-height: 44px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); padding: 0 12px; font-size: 16px; }
.btn { min-height: 44px; padding: 0 16px; border-radius: var(--r); background: var(--accent); color: var(--on-accent); font-weight: 600; text-align: center; }
.btn.wide { width: 100%; min-height: 50px; }
.answer { background: var(--soft); border-radius: var(--r); padding: 14px; font-size: 15px; line-height: 1.55; }
.answer p { margin: 0 0 8px; } .answer p:last-child { margin: 0; }
.answer ul, .answer ol { margin: 0 0 8px; padding-left: 20px; }
.reveal { width: 100%; min-height: 96px; border-radius: var(--r); border: 2px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--accent); font-weight: 600; }
.dots::after { content: '…'; animation: dots 1.2s steps(4) infinite; display: inline-block; width: 1.2em; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }

.grade-n { font-size: 20px; font-weight: 700; min-width: 44px; text-align: right; }
.bar { height: 4px; border-radius: 2px; background: var(--soft); overflow: hidden; margin-top: 6px; }
.bar div { height: 4px; border-radius: 2px; }
.avg { background: var(--accent); color: var(--on-accent); border-radius: var(--r); padding: 18px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--glow); }
.avg .big { font-size: 38px; font-weight: 700; letter-spacing: -.02em; }

.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; }
.pin input { width: 180px; text-align: center; font-size: 26px; letter-spacing: 8px; min-height: 56px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }

#tabs { flex-shrink: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px); background: var(--card); border-top: 1px solid var(--line); }
#tabs button { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; }
#tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#tabs button.on { color: var(--accent); }
#tabs .badge { position: relative; }
#tabs .badge i { position: absolute; top: -4px; right: -8px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--exam); color: #fff; font-size: 10px; font-style: normal; line-height: 16px; padding: 0 4px; }
#tabs.hidden { display: none; }

/* Kalender */
.cal { background: var(--card); border-radius: var(--r); border: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted); }
.cal-head button { width: 34px; height: 34px; border-radius: var(--r); background: var(--soft); font-size: 20px; text-align: center; color: var(--text); }
.m-ex { background: var(--exam); } .m-hw { background: var(--accent); } .m-ev { background: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-grid .wd { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-cell { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: var(--soft); border: 1px solid transparent; border-radius: var(--r); text-align: center; }
.cal-cell .dn { font-size: 15px; font-weight: 600; }
.cal-cell .marks { display: flex; gap: 3px; height: 5px; }
.cal-cell .marks i { width: 5px; height: 5px; border-radius: 1px; }
.cal-cell.out { background: transparent; opacity: .35; }
.cal-cell.has-ex { border-color: var(--exam); }
.cal-cell.today { border-color: var(--accent); }
.cal-cell.today .dn { color: var(--accent); }
.cal-cell.sel { background: var(--accent); border-color: var(--accent); }
.cal-cell.sel .dn { color: var(--on-accent); }
.cal-cell.sel .marks i { box-shadow: 0 0 0 1px var(--on-accent); }
.cal-sel { font-size: 13px; font-weight: 700; padding: 0 2px 2px; }
.cal-list { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; }
.cal-item { display: flex; align-items: center; gap: 10px; padding: 7px 2px; font-size: 14px; }
.cal-item i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cal-item span:nth-of-type(1) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Noten-Verlauf */
.chart { background: var(--card); border-radius: var(--r); border: 1px solid var(--line); padding: 12px 12px 10px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .gl { fill: var(--muted); font-size: 10px; }
.chart .cls { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .mine { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--card); stroke: var(--accent); stroke-width: 2.5; }
.legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 0; border-top: 2.5px solid var(--accent); }
.legend i.l-cls { border-top: 1.5px dashed var(--muted); }
.trend { font-size: 16px; color: var(--muted); }
.trend.up { color: var(--good); } .trend.down { color: var(--low); }
b.need { color: var(--accent); font-size: 18px; }

/* Buttons, Felder */
.btn:disabled { opacity: .6; }
.btn.small { min-height: 36px; padding: 0 14px; border-radius: var(--r); font-size: 14px; flex-shrink: 0; }
.btn.bad { background: var(--exam-soft); color: var(--exam); }
.btn.good { background: var(--good); color: #fff; }
.field { width: 100%; min-height: 44px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); padding: 10px 12px; font-size: 16px; resize: vertical; }
textarea.field { line-height: 1.4; }
.link-btn { align-self: center; color: var(--muted); font-size: 14px; padding: 8px; text-decoration: underline; }

/* Voci-Abfrage */
.card-q { width: 100%; min-height: 170px; background: var(--card); border-radius: var(--r); border: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.card-q.flip { border: 1px solid var(--line); }
.big-q { font-size: 26px; font-weight: 700; letter-spacing: -.01em; word-break: break-word; }
.sol { font-size: 18px; color: var(--accent); }
.sol.ok { color: var(--good); } .sol.bad { color: var(--exam); }
.scroll > * { flex-shrink: 0; }

/* Neue Note */
.new-grade { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--accent-soft); border: 1px solid var(--accent); border-left: 4px solid var(--accent); border-radius: var(--r); }
.ng-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); writing-mode: horizontal-tb; }
.ng-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ng-body b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tabs .badge i.new { background: var(--accent); color: var(--on-accent); }
.tag.new { background: var(--accent); color: var(--on-accent); font-size: 10px; padding: 1px 5px; vertical-align: 2px; }

/* v4: Verlauf + Glow */
body { background:
  radial-gradient(90% 45% at 0% 0%, rgba(var(--acc-rgb), .16), transparent 70%),
  radial-gradient(80% 40% at 100% 100%, rgba(var(--acc2-rgb), .12), transparent 70%),
  linear-gradient(180deg, var(--bg), var(--bg)); background-attachment: fixed; }
html { background: var(--bg); }
.tile, .list, .exam-card, .cal, .chart, .ki, .card-q, .week, .icon-btn { background: color-mix(in srgb, var(--card) 78%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-color: color-mix(in srgb, rgb(var(--acc-rgb)) 14%, var(--line)) !important; }
#tabs { background: color-mix(in srgb, var(--card) 80%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
#tabs button.on svg { filter: drop-shadow(0 0 6px rgba(var(--acc-rgb), .8)); }
h1 { background: linear-gradient(90deg, var(--text) 40%, rgb(var(--acc-rgb))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tile.accent { border-color: rgba(var(--acc-rgb), .6) !important; box-shadow: var(--glow); }
.tile.exam .big, .exam-card .when b { text-shadow: 0 0 14px rgba(var(--exam-rgb), .7); }
.exam-card { box-shadow: -6px 0 18px -8px rgba(var(--exam-rgb), .7); }
.btn, .avg, .week-bar div, .cal-cell.sel, .check.on, .new-grade { background-image: linear-gradient(135deg, rgb(var(--acc-rgb)), rgb(var(--acc2-rgb))); }
.new-grade { color: var(--on-accent); border-color: transparent; box-shadow: var(--glow); }
.new-grade .ng-label, .new-grade .muted, .new-grade .grade-n { color: var(--on-accent) !important; }
.avg { box-shadow: var(--glow); }
.tile.accent .big, b.need, .cal-cell.today .dn { text-shadow: var(--glow-text); }
.btn, .cal-cell.sel, .seg button.on.acc { box-shadow: var(--glow); }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles.three .big { font-size: 28px; }
.tile.exam .big { color: var(--exam); }
.exam-card { padding: 12px 14px; gap: 12px; }
.exam-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.exam-body .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-card.done { opacity: .5; border-left-color: var(--line); }
.exam-card.done .title { text-decoration: line-through; }
.week { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.week-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 600; }
.week-top b { color: var(--text); }
.week-bar { height: 6px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.week-bar div { height: 100%; background: var(--accent); box-shadow: var(--glow); border-radius: 2px; transition: width .4s; }
.btn.solve { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; }
.btn.solve svg { width: 18px; height: 18px; fill: currentColor; }
.ki-more { display: flex; gap: 8px; }
.ki-more button { flex: 1; min-height: 38px; border-radius: var(--r); border: 1px solid var(--line); text-align: center; font-weight: 600; font-size: 14px; color: var(--muted); }
.ki-more button.on { color: var(--accent); border-color: var(--accent); }
.ask .btn { width: 44px; padding: 0; font-size: 18px; }
.rechner-out { font-size: 15px; color: var(--muted); }
.rechner-out b.need { font-size: 22px; margin-left: 4px; }
.back { align-self: flex-start; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: 45%; width: 7px; height: 11px; border-radius: 1px; opacity: 0; animation: conf 1.1s ease-out forwards; }
@keyframes conf { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), 260px) rotate(var(--rot)); } }
.btn.bad { background-image: none; }
.rc { gap: 14px; }
.rc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 14px; }
.rc-row .seg { padding: 2px; }
.rc-row .seg button { min-height: 32px; padding: 0 9px; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 34px; height: 34px; border-radius: var(--r); border: 1px solid var(--line); font-size: 18px; text-align: center; }
.stepper b { min-width: 18px; text-align: center; font-size: 17px; }
.chips { display: flex; gap: 3px; }
.chips button { min-width: 30px; height: 30px; padding: 0 4px; border-radius: var(--r); background: var(--soft); font-size: 13px; font-weight: 600; text-align: center; color: var(--muted); }
.chips button.on { background: rgb(var(--acc-rgb)); color: var(--on-accent); box-shadow: var(--glow); }
.rc-res { display: flex; align-items: baseline; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.rc-res b.need { font-size: 30px; }
.rc-lvl { margin-left: auto; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: var(--r); }
.rc-lvl.good { color: var(--good); background: rgba(var(--acc-rgb), .15); }
.rc-lvl.mid { color: var(--mid); background: rgba(250, 204, 21, .15); }
.rc-lvl.bad { color: var(--exam); background: rgba(var(--exam-rgb), .15); }
/* Prüfungen: nur Gelb */
.exam-mode, .exam-card { --accent: var(--exam); --acc-rgb: var(--exam-rgb); --acc2-rgb: var(--exam2-rgb); --on-accent: var(--exam-on); --glow: 0 0 20px rgba(var(--exam-rgb), .5), 0 0 2px rgba(var(--exam-rgb), .9); --glow-text: 0 0 14px rgba(var(--exam-rgb), .7); }
.exam-mode .back, .exam-mode .chip .dot { color: var(--exam); }

/* v5: Kalender neu */
.cal2 { background: color-mix(in srgb, var(--card) 78%, transparent); border: 1px solid rgba(var(--acc-rgb), .22); border-radius: var(--r); padding: 14px 12px 12px; box-shadow: 0 0 24px rgba(var(--acc-rgb), .08); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.cal2-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 12px; }
.cal2-head b { font-size: 20px; font-weight: 800; text-shadow: var(--glow-text); margin-right: 8px; }
.cal2-head span { color: var(--muted); font-weight: 600; }
.cal2-nav { display: flex; gap: 6px; }
.cal2-nav button { min-width: 34px; height: 34px; padding: 0 10px; border-radius: var(--r); border: 1px solid rgba(var(--acc-rgb), .3); color: var(--accent); font-size: 18px; font-weight: 700; text-align: center; }
.cal2-nav button[data-cal-today] { font-size: 13px; }
.cal2-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal2-grid .wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.cal2-grid .wd.we { opacity: .5; }
.cc { position: relative; height: 46px; border-radius: var(--r); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; border: 1px solid transparent; transition: background .15s; }
.cc .dn { font-size: 15px; font-weight: 600; }
.cc.we .dn { color: var(--muted); }
.cc.past { opacity: .4; }
.cc.hw { background: rgba(var(--acc-rgb), .07); }
.cc.ex { background: rgba(var(--exam-rgb), .1); border-color: rgba(var(--exam-rgb), .45); box-shadow: 0 0 12px rgba(var(--exam-rgb), .25); }
.cc.ex .dn { color: var(--exam); text-shadow: 0 0 10px rgba(var(--exam-rgb), .8); }
.cc .bars { display: flex; gap: 2px; }
.cc .bars i, .cal2-legend i { width: 10px; height: 3px; border-radius: 1px; }
.b-ex { background: var(--exam); box-shadow: 0 0 6px rgba(var(--exam-rgb), .9); }
.b-hw { background: var(--accent); box-shadow: 0 0 6px rgba(var(--acc-rgb), .9); }
.b-ev { background: var(--muted); }
.cc.today { border-color: var(--accent); box-shadow: 0 0 12px rgba(var(--acc-rgb), .45), inset 0 0 8px rgba(var(--acc-rgb), .2); }
.cc.today .dn { color: var(--accent); text-shadow: var(--glow-text); }
.cc.sel { background: linear-gradient(135deg, rgb(var(--acc-rgb)), rgb(var(--acc2-rgb))); border-color: transparent; box-shadow: var(--glow); opacity: 1; }
.cc.sel .dn { color: var(--on-accent); text-shadow: none; }
.cc.sel .bars i { background: var(--on-accent); box-shadow: none; }
.cal2-legend { display: flex; justify-content: center; gap: 14px; font-size: 11px; color: var(--muted); padding-top: 10px; }
.cal2-legend span { display: flex; align-items: center; gap: 5px; }
.agenda { display: flex; gap: 10px; align-items: stretch; }
.ag-date { width: 58px; flex-shrink: 0; border-radius: var(--r); background: linear-gradient(160deg, rgba(var(--acc-rgb), .25), rgba(var(--acc2-rgb), .08)); border: 1px solid rgba(var(--acc-rgb), .4); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 0 16px rgba(var(--acc-rgb), .2); padding: 8px 0; }
.ag-date b { font-size: 24px; line-height: 1; text-shadow: var(--glow-text); }
.ag-date span { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.ag-list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ag-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r); background: color-mix(in srgb, var(--card) 78%, transparent); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.ag-item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-item.ex { border-left-color: var(--exam); box-shadow: -4px 0 14px -6px rgba(var(--exam-rgb), .8); }
.ag-empty { flex: 1; display: flex; align-items: center; padding: 0 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); min-height: 52px; }

/* v5: Glow fast überall */
.tile, .list, .exam-card, .chart, .ki, .card-q, .week, .icon-btn { box-shadow: 0 0 22px rgba(var(--acc-rgb), .07); border-color: rgba(var(--acc-rgb), .22) !important; }
.exam-card { border-color: rgba(var(--exam-rgb), .3) !important; box-shadow: 0 0 22px rgba(var(--exam-rgb), .1), -6px 0 18px -8px rgba(var(--exam-rgb), .8); border-left-color: var(--exam) !important; }
h1 { filter: drop-shadow(0 0 12px rgba(var(--acc-rgb), .35)); }
h2 { color: var(--accent); opacity: .85; text-shadow: 0 0 10px rgba(var(--acc-rgb), .5); }
.tile .big, .grade-n, .avg .big, .exam-card .when b { text-shadow: 0 0 14px currentColor; }
.tile.exam { border-color: rgba(var(--exam-rgb), .35) !important; box-shadow: 0 0 18px rgba(var(--exam-rgb), .12); }
.check { border-color: rgba(var(--acc-rgb), .45); box-shadow: 0 0 8px rgba(var(--acc-rgb), .15); }
.exam-card .check { border-color: rgba(var(--exam-rgb), .5); }
#tabs { border-top-color: rgba(var(--acc-rgb), .25); box-shadow: 0 -8px 24px rgba(var(--acc-rgb), .06); }
#tabs svg { filter: drop-shadow(0 0 4px rgba(var(--acc-rgb), .25)); }
#tabs button.on { text-shadow: var(--glow-text); }
.icon-btn { color: var(--accent); }
.field:focus, .ask input:focus, .pin input:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.dot { box-shadow: 0 0 6px currentColor; }
.bar div { box-shadow: 0 0 8px currentColor; }
.chart .mine { filter: drop-shadow(0 0 5px rgba(var(--acc-rgb), .9)); }
.add-photo { border-color: rgba(var(--acc-rgb), .4); }
.answer { border: 1px solid rgba(var(--acc-rgb), .25); box-shadow: inset 0 0 20px rgba(var(--acc-rgb), .06); }
#tabs .badge i.new { background: var(--brand); color: var(--brand-on); }

/* v6: Tag-Fenster */
.pop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; animation: fadeIn .22s ease both; }
.pop.closing { animation: fadeOut .18s ease both; }
.pop-box { background: linear-gradient(170deg, color-mix(in srgb, var(--card) 96%, rgb(var(--acc-rgb))) 0%, var(--card) 60%); border: 1px solid rgba(var(--acc-rgb), .35); box-shadow: 0 0 40px rgba(var(--acc-rgb), .18); padding: 16px; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 560px; }
.pop-head { display: flex; align-items: center; gap: 12px; }
.pop-date { width: 56px; height: 56px; flex-shrink: 0; border-radius: var(--r); background: linear-gradient(135deg, rgb(var(--acc-rgb)), rgb(var(--acc2-rgb))); color: var(--on-accent); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--glow); }
.pop-date b { font-size: 22px; line-height: 1; }
.pop-date span { font-size: 11px; font-weight: 800; text-transform: uppercase; }
.pop-title { flex: 1; display: flex; flex-direction: column; }
.pop-title b { font-size: 19px; }
.pop-title span { color: var(--accent); font-size: 13px; font-weight: 600; text-shadow: var(--glow-text); }
.pop-x { width: 36px; height: 36px; border-radius: var(--r); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pop-x svg, .pi-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pop-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.pi { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r); background: var(--soft); border: 1px solid var(--line); width: 100%; animation: itemIn .3s cubic-bezier(.2, .9, .3, 1.2) both; }
.pi:nth-child(2) { animation-delay: .04s; } .pi:nth-child(3) { animation-delay: .08s; } .pi:nth-child(4) { animation-delay: .12s; } .pi:nth-child(5) { animation-delay: .16s; }
.pi-ic { width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--r); display: flex; align-items: center; justify-content: center; }
.pi.hw .pi-ic { color: var(--accent); background: rgba(var(--acc-rgb), .14); box-shadow: 0 0 12px rgba(var(--acc-rgb), .3); }
.pi.ex { border-color: rgba(var(--exam-rgb), .45); box-shadow: 0 0 16px rgba(var(--exam-rgb), .15); }
.pi.ex .pi-ic { color: var(--exam); background: rgba(var(--exam-rgb), .14); box-shadow: 0 0 12px rgba(var(--exam-rgb), .4); }
.pi.ev .pi-ic { color: var(--muted); background: var(--card); }
.pi-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pi-body .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-empty { padding: 22px 0; text-align: center; color: var(--muted); }
/* A: Sheet von unten */
.pop-sheet { align-items: flex-end; justify-content: center; }
.pop-sheet .pop-box { border-radius: 14px 14px 0 0; border-bottom: none; padding-bottom: calc(env(safe-area-inset-bottom) + 18px); max-height: 75%; animation: sheetUp .34s cubic-bezier(.2, .9, .25, 1.05) both; }
.pop-sheet .pop-box::before { content: ''; align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin-top: -6px; }
.pop-sheet.closing .pop-box { animation: sheetDown .18s ease-in both; }
/* B: Fenster in der Mitte */
.pop-center { align-items: center; justify-content: center; padding: 24px; }
.pop-center .pop-box { border-radius: var(--r); max-height: 80%; animation: zoomIn .28s cubic-bezier(.2, .9, .3, 1.25) both; }
.pop-center.closing .pop-box { animation: zoomOut .18s ease-in both; }
/* C: Seitenleiste mit Zeitstrahl */
.pop-side { justify-content: flex-end; }
.pop-side .pop-box { width: 86%; height: 100%; border-radius: 0; border-right: none; padding-top: calc(env(safe-area-inset-top) + 22px); animation: slideIn .32s cubic-bezier(.2, .9, .25, 1.05) both; }
.pop-side.closing .pop-box { animation: slideOut .18s ease-in both; }
.pop-side .pop-list { position: relative; padding-left: 22px; gap: 12px; }
.pop-side .pop-list::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(rgb(var(--acc-rgb)), rgba(var(--acc-rgb), .1)); box-shadow: 0 0 8px rgba(var(--acc-rgb), .7); }
.pop-side .pi { position: relative; }
.pop-side .pi::before { content: ''; position: absolute; left: -21px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px rgb(var(--acc-rgb)); }
.pop-side .pi.ex::before { background: var(--exam); box-shadow: 0 0 10px rgb(var(--exam-rgb)); }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(100%); } } @keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes zoomIn { from { transform: scale(.85); opacity: 0; } } @keyframes zoomOut { to { transform: scale(.9); opacity: 0; } }
@keyframes slideIn { from { transform: translateX(100%); } } @keyframes slideOut { to { transform: translateX(100%); } }
@keyframes itemIn { from { transform: translateY(10px); opacity: 0; } }

/* v6: schönere Klick-Animationen */
button { transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s, background .2s; }
button:active { transform: scale(.96); }
.tile:active, .pi:active, .exam-card:active, .item:active { transform: scale(.98); }
.cc:active { transform: scale(.88); }
.tap-fx { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(var(--acc-rgb), .45) 0%, rgba(var(--acc-rgb), 0) 70%); transform: scale(0); animation: ripple .55s ease-out forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.check.on.flash { animation: checkPop .38s cubic-bezier(.3, 1.8, .5, 1); }
.check.on.flash svg path { stroke-dasharray: 24; stroke-dashoffset: 0; animation: draw .3s .08s ease-out both; }
@keyframes checkPop { 0% { transform: scale(.7); } 60% { transform: scale(1.18); box-shadow: 0 0 26px rgba(var(--acc-rgb), .9); } 100% { transform: scale(1); } }
@keyframes draw { from { stroke-dashoffset: 24; } }
.item.done .title { transition: opacity .3s; }
.screen-in > * { animation: screenIn .32s cubic-bezier(.2, .9, .3, 1) both; }
.screen-in > *:nth-child(2) { animation-delay: .03s; } .screen-in > *:nth-child(3) { animation-delay: .06s; } .screen-in > *:nth-child(4) { animation-delay: .09s; } .screen-in > *:nth-child(5) { animation-delay: .12s; } .screen-in > *:nth-child(n+6) { animation-delay: .15s; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } }
.pop.still:not(.closing), .pop.still:not(.closing) .pop-box, .pop.still .pi { animation: none; }

/* v6: Audio */
.add-photo.audio b { display: flex; color: var(--accent); }
.add-photo.audio svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(var(--acc-rgb), .7)); }
.audios { display: flex; flex-direction: column; gap: 6px; }
.au { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); background: var(--soft); border: 1px solid rgba(var(--acc-rgb), .25); }
.au-ic { width: 26px; height: 26px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; background: rgba(var(--acc-rgb), .15); color: var(--accent); flex-shrink: 0; }
.au.err { border-color: rgba(var(--exam-rgb), .5); } .au.err .au-ic { color: var(--exam); background: rgba(var(--exam-rgb), .15); }
.au.ok .au-ic { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.au-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-name .muted { font-weight: 400; font-size: 12px; }
.au > button { width: 28px; height: 28px; color: var(--muted); font-size: 18px; text-align: center; }
.mini-spin { width: 14px; height: 14px; border: 2px solid rgba(var(--acc-rgb), .3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.pop-box.ap { max-height: 82%; }
.au-big svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ap-list { max-height: 46vh; }
.ap-item { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: var(--r); background: var(--soft); border: 1px solid var(--line); }
.ap-item.tip { border-color: rgba(var(--acc-rgb), .55); box-shadow: 0 0 14px rgba(var(--acc-rgb), .15); }
.ap-play { width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--r); display: flex; align-items: center; justify-content: center; color: var(--accent); background: rgba(var(--acc-rgb), .12); }
.ap-play svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ap-play.on { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.ap-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ap-name .title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-name .muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn.ghost { background: transparent; background-image: none; color: var(--accent); border: 1px solid rgba(var(--acc-rgb), .5); box-shadow: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* v7: Farbstile */
:root { --brand: #22C55E; --brand-on: #04140A; }
html[data-theme="gruen"] { --accent: #22C55E; --acc-rgb: 34, 197, 94; --acc2-rgb: 45, 212, 191; --on-accent: #04140A; --accent-soft: #163222; --bg: #070B09; --card: #111814; --soft: #1D2320; --line: #2A322E; --brand: #22C55E; --brand-on: #04140A; }
html[data-theme="blau"] { --accent: #3B82F6; --acc-rgb: 59, 130, 246; --acc2-rgb: 34, 211, 238; --on-accent: #FFFFFF; --accent-soft: #14223F; --bg: #060912; --card: #0F1524; --soft: #182036; --line: #24304A; --brand: #3B82F6; --brand-on: #FFFFFF; }
html[data-theme="tuerkis"] { --accent: #14B8A6; --acc-rgb: 20, 184, 166; --acc2-rgb: 59, 130, 246; --on-accent: #03130F; --accent-soft: #0F2B2A; --bg: #050F0F; --card: #0D1A1A; --soft: #152525; --line: #203434; --brand: #14B8A6; --brand-on: #03130F; }
html[data-theme="violett"] { --accent: #A855F7; --acc-rgb: 168, 85, 247; --acc2-rgb: 236, 72, 153; --on-accent: #FFFFFF; --accent-soft: #2A1745; --bg: #0A0711; --card: #150F21; --soft: #1F172E; --line: #2D2240; --brand: #A855F7; --brand-on: #FFFFFF; }
html[data-theme="pink"] { --accent: #EC4899; --acc-rgb: 236, 72, 153; --acc2-rgb: 168, 85, 247; --on-accent: #FFFFFF; --accent-soft: #3A1430; --bg: #0E0710; --card: #1A0F19; --soft: #251724; --line: #362233; --brand: #EC4899; --brand-on: #FFFFFF; }
html[data-theme="rot"] { --accent: #EF4444; --acc-rgb: 239, 68, 68; --acc2-rgb: 236, 72, 153; --on-accent: #FFFFFF; --accent-soft: #3A1515; --bg: #0D0707; --card: #190F10; --soft: #241718; --line: #352223; --brand: #EF4444; --brand-on: #FFFFFF; }
html[data-theme="weiss"] { --accent: #E5E7EB; --acc-rgb: 229, 231, 235; --acc2-rgb: 148, 163, 184; --on-accent: #0A0A0B; --accent-soft: #26272B; --bg: #08080A; --card: #131316; --soft: #1C1C21; --line: #2A2A31; --brand: #E5E7EB; --brand-on: #0A0A0B; }
html[data-theme] body { background-color: var(--bg); }
.set-colors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: var(--r); background: var(--soft); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.swatch i { width: 34px; height: 34px; border-radius: var(--r); box-shadow: 0 0 14px var(--sw-glow); }
.swatch.on { border-color: var(--accent); color: var(--text); box-shadow: var(--glow); }
.set-list .item { font-weight: 600; }
.set-list .item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--accent); }
.head-btns { display: flex; gap: 8px; }

/* v8: Prüfungsfarbe */
:root { --exam2-rgb: 245, 158, 11; --exam-on: #1A1400; }
html[data-exam="gelb"] { --exam: #FACC15; --exam-rgb: 250, 204, 21; --exam2-rgb: 245, 158, 11; --exam-on: #1A1400; --exam-soft: rgba(250, 204, 21, .14); }
html[data-exam="rot"] { --exam: #FF3B5C; --exam-rgb: 255, 59, 92; --exam2-rgb: 255, 110, 140; --exam-on: #FFFFFF; --exam-soft: rgba(255, 59, 92, .14); }
html[data-exam="orange"] { --exam: #FB923C; --exam-rgb: 251, 146, 60; --exam2-rgb: 249, 115, 22; --exam-on: #1A0A00; --exam-soft: rgba(251, 146, 60, .14); }
html[data-exam="pink"] { --exam: #F472B6; --exam-rgb: 244, 114, 182; --exam2-rgb: 236, 72, 153; --exam-on: #1A0010; --exam-soft: rgba(244, 114, 182, .14); }
html[data-exam="blau"] { --exam: #60A5FA; --exam-rgb: 96, 165, 250; --exam2-rgb: 56, 189, 248; --exam-on: #06142A; --exam-soft: rgba(96, 165, 250, .14); }
html[data-exam="violett"] { --exam: #C084FC; --exam-rgb: 192, 132, 252; --exam2-rgb: 168, 85, 247; --exam-on: #14052A; --exam-soft: rgba(192, 132, 252, .14); }
html[data-exam="gruen"] { --exam: #4ADE80; --exam-rgb: 74, 222, 128; --exam2-rgb: 45, 212, 191; --exam-on: #03140A; --exam-soft: rgba(74, 222, 128, .14); }
html[data-exam="weiss"] { --exam: #F1F5F9; --exam-rgb: 241, 245, 249; --exam2-rgb: 148, 163, 184; --exam-on: #0A0A0B; --exam-soft: rgba(241, 245, 249, .14); }

/* Vorschau in den Einstellungen */
.preview { border: 1px solid rgba(var(--acc-rgb), .3); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: radial-gradient(120% 80% at 0% 0%, rgba(var(--acc-rgb), .14), transparent 60%), var(--bg); box-shadow: 0 0 24px rgba(var(--acc-rgb), .12); }
.pv-top { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.pv-tile { border: 1px solid var(--line); border-radius: var(--r); padding: 8px; display: flex; flex-direction: column; background: var(--card); font-size: 11px; color: var(--muted); }
.pv-tile b { font-size: 20px; color: var(--text); }
.pv-tile.a { border-color: rgba(var(--acc-rgb), .6); box-shadow: var(--glow); } .pv-tile.a b { color: var(--accent); text-shadow: var(--glow-text); }
.pv-tile.e { border-color: rgba(var(--exam-rgb), .5); } .pv-tile.e b { color: var(--exam); text-shadow: 0 0 12px rgba(var(--exam-rgb), .8); }
.pv-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.pv-row .check { width: 22px; height: 22px; }
.pv-row.ex { border-color: rgba(var(--exam-rgb), .45); border-left: 3px solid var(--exam); box-shadow: -4px 0 14px -6px rgba(var(--exam-rgb), .9); }
.pv-row.ex b { margin-left: auto; color: var(--exam); text-shadow: 0 0 10px rgba(var(--exam-rgb), .8); }
.pv-row .check.ex { background: rgb(var(--exam-rgb)); border-color: rgb(var(--exam-rgb)); box-shadow: 0 0 12px rgba(var(--exam-rgb), .7); }
.pv-row .check.ex svg { stroke: var(--exam-on); }
.pv-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pv-cal span { height: 26px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: var(--soft); }
.pv-cal .s { background: linear-gradient(135deg, rgb(var(--acc-rgb)), rgb(var(--acc2-rgb))); color: var(--on-accent); box-shadow: var(--glow); }
.pv-cal .x { background: rgba(var(--exam-rgb), .12); border: 1px solid rgba(var(--exam-rgb), .5); color: var(--exam); }
.pv-cal .t { border: 1px solid var(--accent); color: var(--accent); }
.set-colors.small .swatch { padding: 8px 4px; } .set-colors.small .swatch i { width: 24px; height: 24px; }
/* Personen */
.users .item { gap: 10px; }
.u-av { width: 36px; height: 36px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-weight: 800; background: rgba(var(--acc-rgb), .15); color: var(--accent); flex-shrink: 0; }
.u-ki { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: var(--r); border: 1px solid var(--line); color: var(--muted); }
.u-ki.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); box-shadow: var(--glow); }
.u-del { width: 32px; height: 32px; color: var(--muted); font-size: 18px; text-align: center; }
.add-user { display: flex; flex-direction: column; gap: 8px; }
.add-user .row { display: flex; gap: 8px; }
.add-user .row .field { flex: 1; min-width: 0; }
.new-pin { border: 1px solid var(--accent); border-radius: var(--r); padding: 12px; background: rgba(var(--acc-rgb), .1); box-shadow: var(--glow); text-align: center; }
.new-pin b { display: block; font-size: 30px; letter-spacing: 6px; color: var(--accent); text-shadow: var(--glow-text); }
.setup { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; }
/* v9 */
.switch { width: 46px; height: 28px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); position: relative; flex-shrink: 0; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .25s cubic-bezier(.3, 1.5, .5, 1), background .2s; }
.switch.on { background: var(--accent); border-color: var(--accent); box-shadow: var(--glow); }
.switch.on i { transform: translateX(18px); background: var(--on-accent); }
.switch-row:disabled { opacity: .5; }
.u-head { display: flex; align-items: center; gap: 14px; }
.u-av.big { width: 56px; height: 56px; font-size: 24px; box-shadow: var(--glow); }
.tiles.three .tile .big { font-size: 22px; }
.new-pin .btn { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.new-pin .btn svg, .steps-help svg { width: 16px; height: 16px; vertical-align: -3px; }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 84px); transform: translateX(-50%); z-index: 60; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--r); font-weight: 700; box-shadow: var(--glow); animation: itemIn .3s both; }
.steps-help { display: flex; flex-direction: column; gap: 8px; }
.steps-help div { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r); background: var(--soft); font-size: 15px; }
.steps-help div > b:first-child { width: 26px; height: 26px; border-radius: var(--r); background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--glow); }

/* ---------- Voci ---------- */
.lang-tabs { display: flex; gap: 6px; }
.lang-tabs button { min-height: 34px; padding: 0 14px; border-radius: var(--r); font-size: 14px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); }
.lang-tabs button.on { color: var(--text); border-color: rgba(var(--acc-rgb), .6); box-shadow: inset 0 -2px 0 var(--accent), 0 0 14px rgba(var(--acc-rgb), .18); }
.lang-tabs button:disabled { opacity: .55; } .lang-tabs small { font-size: 11px; font-weight: 600; margin-left: 4px; }
.book-line { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); padding: 0 2px; }
.book-line b { color: var(--text); }
.book-set { display: flex; flex-direction: column; gap: 8px; }
.seg.mini { padding: 2px; } .seg.mini button { min-height: 32px; font-size: 13px; padding: 0 12px; }
.ulist .urow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; min-height: 58px; transition: background .2s; }
.ulist .urow + .urow { border-top: 1px solid var(--line); }
.ulist .urow:active { background: rgba(var(--acc-rgb), .08); }
.u-badge { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--r); font-weight: 800; font-size: 15px; color: var(--accent);
  border: 1px solid rgba(var(--acc-rgb), .45); background: rgba(var(--acc-rgb), .08); text-shadow: var(--glow-text); }
.u-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.u-body b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .u-body small { font-size: 12px; color: var(--muted); }
.ulist.dim { opacity: .55; }
.done-toggle { align-self: flex-start; font-size: 13px; color: var(--muted); font-weight: 600; }
.ring { --p: 0; width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--soft) 0); filter: drop-shadow(0 0 5px rgba(var(--acc-rgb), .4)); }
.ring b { width: 29px; height: 29px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.u-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.u-k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.u-head h1 { font-size: 26px; }
.u-donebtn { flex-shrink: 0; min-height: 32px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.u-donebtn.on { color: var(--accent); border-color: rgba(var(--acc-rgb), .6); }
.lz-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px; }
.lz-chips::-webkit-scrollbar { display: none; }
.lz-chips button { flex-shrink: 0; min-height: 34px; padding: 0 13px; border-radius: var(--r); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; transition: all .2s; }
.lz-chips button.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); box-shadow: var(--glow); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 80%, transparent); transition: all .2s; }
.mode b { font-size: 15px; } .mode small { font-size: 12px; color: var(--muted); line-height: 1.3; }
.mode.on { border-color: var(--accent); background: linear-gradient(150deg, rgba(var(--acc-rgb), .2), rgba(var(--acc2-rgb), .06)); box-shadow: 0 0 18px rgba(var(--acc-rgb), .25); }
.mode.on b { color: var(--accent); text-shadow: var(--glow-text); }
.seg.dir button { flex: 1; }
.go-btn { min-height: 50px; font-size: 16px; font-weight: 800; }
.sel-hint { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); min-height: 24px; }
.sel-hint .link-btn { color: var(--accent); font-weight: 700; }
.words .w-row { display: grid; grid-template-columns: 22px 1fr 1fr 30px 8px; gap: 8px; align-items: center; padding: 9px 12px; font-size: 14px; cursor: pointer; transition: background .15s; position: relative; }
.words .w-row + .w-row { border-top: 1px solid var(--line); }
.w-row.sel { background: rgba(var(--acc-rgb), .12); }
.w-row.edge::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); box-shadow: var(--glow); }
.w-no { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.w-fr { font-weight: 600; } .w-de { color: var(--muted); text-align: right; }
.w-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); }
.w-dot.b1 { background: rgba(var(--acc-rgb), .45); } .w-dot.b2 { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.say { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); }
.say svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.say svg path:first-child { fill: currentColor; }
.say.big { width: 46px; height: 46px; border: 1px solid rgba(var(--acc-rgb), .45); box-shadow: 0 0 14px rgba(var(--acc-rgb), .2); }
.say.big svg { width: 22px; height: 22px; }
.say.pulse { animation: sayPulse .6s ease; }
@keyframes sayPulse { 0% { box-shadow: 0 0 0 0 rgba(var(--acc-rgb), .6); } 100% { box-shadow: 0 0 0 14px rgba(var(--acc-rgb), 0); } }
/* Abfrage */
.q-top { display: flex; justify-content: space-between; align-items: center; }
.q-mode { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.qprog { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.qbar { flex: 1; height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.qbar div { height: 100%; background: linear-gradient(90deg, var(--accent), rgb(var(--acc2-rgb))); box-shadow: var(--glow); transition: width .35s ease; }
.card-q { min-height: 210px; position: relative; }
.f-k { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.flip3d { position: relative; height: 300px; flex-shrink: 0; perspective: 1000px; cursor: pointer; }
.flip3d .face { position: absolute; inset: 0; border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .55s cubic-bezier(.3, .9, .3, 1); border: 1px solid rgba(var(--acc-rgb), .3); }
.flip3d .f-front { background: linear-gradient(160deg, color-mix(in srgb, var(--card) 92%, transparent), color-mix(in srgb, var(--card) 70%, transparent)); box-shadow: 0 0 24px rgba(var(--acc-rgb), .1); }
.flip3d .f-back { transform: rotateY(180deg); background: linear-gradient(160deg, rgba(var(--acc-rgb), .22), rgba(var(--acc2-rgb), .08)), var(--card); border-color: rgba(var(--acc-rgb), .7); box-shadow: 0 0 30px rgba(var(--acc-rgb), .28); }
.flip3d.turned .f-front { transform: rotateY(-180deg); } .flip3d.turned .f-back { transform: rotateY(0); }
.flip3d .f-back .big-q { color: var(--accent); text-shadow: var(--glow-text); }
.f-hint { position: absolute; bottom: 14px; font-size: 12px; color: var(--muted); }
.f-small { font-size: 14px; color: var(--muted); }
.kbtns { display: flex; gap: 10px; align-items: center; transition: opacity .25s; }
.kbtns.off { opacity: 0; pointer-events: none; }
.kbtn { flex: 1; min-height: 50px; border-radius: var(--r); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.kbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; } .kbtn svg path:first-child { fill: currentColor; }
.kbtn.again { border: 1px solid var(--line); color: var(--text); background: color-mix(in srgb, var(--card) 80%, transparent); }
.kbtn.ok { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.kbtn.rec { animation: recPulse 1s ease infinite; }
@keyframes recPulse { 50% { box-shadow: 0 0 0 8px rgba(var(--acc-rgb), .15), var(--glow); } }
.speak-card .big-q { font-size: 28px; }
.sol { animation: solIn .3s ease both; }
@keyframes solIn { from { opacity: 0; transform: translateY(6px); } }
.done-card .ring { width: 84px; height: 84px; } .done-card .ring b { width: 70px; height: 70px; font-size: 20px; }
/* Test */
.test-info { font-size: 13px; color: var(--muted); line-height: 1.45; }
.test-list .t-row { display: grid; grid-template-columns: 22px 1fr 1fr; gap: 8px; align-items: center; padding: 8px 12px; min-height: 52px; }
.test-list .t-row + .t-row { border-top: 1px solid var(--line); }
.t-ask { font-weight: 600; font-size: 14px; }
.t-in { width: 100%; min-height: 36px; border-radius: var(--r); border: 1px solid var(--line); background: var(--soft); padding: 0 10px; font-size: 14px; outline: none; }
.t-in:focus { border-color: var(--accent); box-shadow: 0 0 10px rgba(var(--acc-rgb), .3); }
.t-row.chk { grid-template-columns: 22px 1fr auto; transition: background .2s; }
.t-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t-sol { font-size: 14px; color: var(--accent); } .t-your { font-size: 12px; color: var(--muted); }
.t-row.good { background: rgba(var(--acc-rgb), .1); } .t-row.bad { background: rgba(248, 113, 113, .08); }
.t-marks { display: flex; gap: 6px; }
.tm { width: 38px; height: 38px; border-radius: var(--r); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.tm.on:last-child { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: var(--glow); }
.tm.on:first-child { background: var(--low); color: #1a0505; border-color: var(--low); }
.photo-check { display: flex; flex-direction: column; gap: 10px; }
.brand-t { font-size: 34px; letter-spacing: -.03em; background: linear-gradient(90deg, var(--accent), rgb(var(--acc2-rgb))); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px rgba(var(--acc-rgb), .45)); }
.disclaimer { margin-top: 18px; font-size: 11px; color: var(--muted); opacity: .7; text-align: center; max-width: 260px; }
