/* TAMIIIKKO Kalender — Tokens aus dem Design-Handoff + Kalender-spezifisches. */
:root {
  --font-body: 'IBM Plex Sans', 'Segoe UI', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  --surface: #f5f5f6;
  --surface-raised: #ffffff;
  --surface-sunken: #eaeaec;
  --ink-primary: #18191b;
  --ink-secondary: #5e6063;
  --ink-muted: #8e9195;
  --rule: rgba(24, 25, 27, 0.12);
  --rule-strong: rgba(24, 25, 27, 0.24);
  --shadow-sm: 0 1px 2px rgba(24, 25, 27, 0.05), 0 1px 3px rgba(24, 25, 27, 0.06);
  --shadow-md: 0 2px 8px rgba(24, 25, 27, 0.06), 0 6px 20px rgba(24, 25, 27, 0.06);
  --accent: #a06b1e;         /* Kalender = warm amber */
  --accent-soft: rgba(160, 107, 30, 0.10);
  --pos: #0d7f77;
  --neg: #b2402c;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #141516;
    --surface-raised: #1e1f21;
    --surface-sunken: #0e0f10;
    --ink-primary: #ededee;
    --ink-secondary: #a3a5a8;
    --ink-muted: #7a7d81;
    --rule: rgba(237, 237, 238, 0.14);
    --rule-strong: rgba(237, 237, 238, 0.28);
    --accent: #d4a256;
    --accent-soft: rgba(212, 162, 86, 0.14);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100vh; background: var(--surface); color: var(--ink-primary); font-family: var(--font-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }

#app { max-width: 68rem; margin: 0 auto; padding: 24px 20px 96px; }

/* ── Header + Nav ── */
.k-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.k-brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.k-mark { color: var(--ink-primary); flex: none; }
.k-wm { font-weight: 700; letter-spacing: 0.08em; font-size: 16px; color: var(--ink-primary); }
.k-wm-acc { color: var(--accent); }
.k-divider { display: inline-block; width: 1px; height: 14px; background: var(--rule-strong); }
.k-sub { color: var(--ink-secondary); font-weight: 500; font-size: 14px; }
.k-actions { display: inline-flex; gap: 8px; }
.k-btn { font-family: var(--font-body); font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 999px; background: transparent; border: 1px solid var(--rule); color: var(--ink-secondary); cursor: pointer; transition: color 120ms, background 120ms; }
.k-btn:hover { color: var(--ink-primary); background: var(--surface-sunken); }
.k-refresh { font-size: 15px; padding: 6px 10px; }

.k-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 12px; }
.k-tab { font-family: var(--font-body); font-size: 14px; font-weight: 500; padding: 8px 16px; background: transparent; border: 0; color: var(--ink-secondary); cursor: pointer; border-bottom: 2px solid transparent; }
.k-tab:hover { color: var(--ink-primary); }
.k-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.k-personbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.k-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface-raised); color: var(--ink-secondary); cursor: pointer; }
.k-chip:hover { background: var(--surface-sunken); }
.k-chip.active { background: var(--surface-sunken); color: var(--ink-primary); border-color: var(--rule-strong); }
.k-chip-dot { width: 8px; height: 8px; border-radius: 999px; }
.k-chip-reset { color: var(--ink-muted); font-style: italic; }

.k-alert { background: var(--surface-sunken); border: 1px solid var(--rule); border-left: 3px solid var(--neg); padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; color: var(--ink-secondary); }
.k-alert ul { margin: 4px 0 0 0; padding-left: 20px; }

/* ── Sections & Events ── */
.k-section { margin-bottom: 32px; }
.k-section-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink-primary); margin: 0 0 12px; }
.k-loading { padding: 24px; text-align: center; color: var(--ink-muted); font-size: 14px; }
.k-empty { padding: 20px; text-align: center; color: var(--ink-muted); background: var(--surface-raised); border: 1px dashed var(--rule); border-radius: var(--radius-sm); font-size: 14px; }

.k-events { display: flex; flex-direction: column; gap: 8px; }
.k-event { display: grid; grid-template-columns: 4px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px 10px 0; background: var(--surface-raised); border: 1px solid var(--rule); border-radius: var(--radius-md); overflow: hidden; }
.k-event-side { background: var(--event-color, var(--rule-strong)); width: 4px; align-self: stretch; }
.k-event-body { min-width: 0; }
.k-event-time { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--ink-muted); letter-spacing: 0.02em; }
.k-event-title { font-size: 15px; font-weight: 500; color: var(--ink-primary); margin-top: 2px; }
.k-event-meta { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.k-event-person { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--event-color, var(--ink-secondary)); background: var(--surface-sunken); padding: 3px 7px; border-radius: 4px; }

/* Now-Card */
.k-now { margin-bottom: 20px; background: var(--accent-soft); border: 2px solid var(--accent); border-radius: var(--radius-md); padding: 12px; }
.k-now-label { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.k-now .k-event { background: var(--surface-raised); }

/* Day grouping */
.k-day { margin-bottom: 20px; }
.k-day-header { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 4px; margin-bottom: 6px; border-bottom: 1px solid var(--rule); }
.k-day-name { font-size: 14px; font-weight: 600; color: var(--ink-primary); }
.k-day-date { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); }

.k-day-compact { margin-bottom: 12px; }
.k-events-compact { gap: 4px; }
.k-event-compact { display: grid; grid-template-columns: 52px 8px 1fr auto; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--radius-sm); background: var(--surface-raised); border: 1px solid var(--rule); font-size: 13px; }
.k-event-compact-time { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); }
.k-event-compact-dot { width: 8px; height: 8px; border-radius: 999px; }
.k-event-compact-title { color: var(--ink-primary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-event-compact-person { font-family: var(--font-mono); font-size: 10px; font-weight: 600; color: var(--ink-muted); }

.k-footer { text-align: center; color: var(--ink-muted); font-size: 11px; padding: 24px 0; letter-spacing: 0.02em; }

/* ── KID-MODE ── */
.k-kid { text-align: center; padding: 24px 12px; }
.k-kid-hello { font-size: 32px; font-weight: 600; margin-bottom: 8px; }
.k-kid-heute-title { font-size: 18px; color: var(--ink-secondary); margin-bottom: 32px; }
.k-kid-next { background: var(--accent-soft); border: 3px solid var(--accent); border-radius: var(--radius-lg); padding: 28px 20px; margin-bottom: 32px; }
.k-kid-next-label { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.k-kid-next-title { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink-primary); margin-bottom: 12px; }
.k-kid-next-time { font-family: var(--font-mono); font-size: 24px; font-weight: 500; color: var(--ink-secondary); margin-bottom: 8px; }
.k-kid-next-person { font-size: 18px; font-weight: 600; }
.k-kid-later, .k-kid-tomorrow { text-align: left; max-width: 480px; margin: 0 auto 24px; }
.k-kid-later-label { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-secondary); margin-bottom: 8px; }
.k-kid-later-row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 6px; background: var(--surface-raised); border-radius: var(--radius-md); border-left: 4px solid var(--rule-strong); font-size: 16px; }
.k-kid-later-time { font-family: var(--font-mono); font-size: 14px; color: var(--ink-muted); }
.k-kid-later-title { font-weight: 500; }
.k-kid-later-person { font-size: 13px; font-weight: 600; }

/* ── KIOSK (Wand-Tablet) ── */
.k-kiosk { padding: 20px 24px; background: var(--surface); min-height: 100vh; display: grid; grid-template-rows: auto 1fr 1fr; gap: 20px; }
.k-kiosk-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 12px; border-bottom: 2px solid var(--rule); }
.k-kiosk-day { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.k-kiosk-wm { font-size: 14px; font-weight: 700; letter-spacing: 0.14em; color: var(--ink-muted); margin-top: 4px; }
.k-kiosk-time { font-family: var(--font-mono); font-size: 42px; font-weight: 500; letter-spacing: -0.03em; color: var(--ink-primary); }
.k-kiosk-col { background: var(--surface-raised); border: 1px solid var(--rule); border-radius: var(--radius-md); padding: 20px 24px; box-shadow: var(--shadow-sm); overflow: auto; }
.k-kiosk-h { font-family: var(--font-mono); font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-secondary); margin: 0 0 16px; }
.k-kiosk-event { display: grid; grid-template-columns: 100px 1fr; gap: 20px; padding: 12px 0; border-top: 1px solid var(--rule); }
.k-kiosk-event:first-of-type { border-top: 0; padding-top: 4px; }
.k-kiosk-event-time { font-family: var(--font-mono); font-size: 22px; font-weight: 500; color: var(--event-color); }
.k-kiosk-event-title { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.k-kiosk-event-person { font-size: 14px; font-weight: 500; margin-top: 4px; }
.k-kiosk-empty { font-size: 24px; color: var(--ink-muted); text-align: center; padding: 40px 0; }

/* ── Segmented control (Grid 3/5/7 Tage) ── */
.k-grid-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.k-seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-sunken); border-radius: 999px; }
.k-seg-btn { font-family: var(--font-body); font-size: 12px; font-weight: 500; padding: 5px 12px; background: transparent; border: 0; color: var(--ink-secondary); cursor: pointer; border-radius: 999px; }
.k-seg-btn:hover { color: var(--ink-primary); }
.k-seg-btn.active { background: var(--surface-raised); color: var(--ink-primary); box-shadow: var(--shadow-sm); }

/* ── Kalender-Grid (Zeit-Raster) ── */
.k-grid-section { overflow: hidden; }
.k-grid { display: grid; grid-template-columns: 48px repeat(var(--grid-cols), minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--surface-raised); overflow: hidden; }
.k-grid-hours { grid-column: 1; display: grid; grid-template-rows: 40px repeat(auto-fill, 1fr); border-right: 1px solid var(--rule); background: var(--surface-sunken); position: relative; padding-top: 40px; }
.k-grid-hour { font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted); padding: 2px 4px 0 6px; height: calc((100% - 40px) / var(--grid-hours)); }
.k-grid-hours .k-grid-hour:nth-child(1) { padding-top: 2px; }
.k-grid-col { display: grid; grid-template-rows: auto auto 1fr; border-left: 1px solid var(--rule); min-height: 480px; }
.k-grid-col:first-child { border-left: 0; }
.k-grid-col.is-today .k-grid-col-head { background: var(--accent-soft); border-bottom-color: var(--accent); }
.k-grid-col-head { text-align: center; padding: 6px 4px; background: var(--surface-sunken); border-bottom: 1px solid var(--rule); }
.k-grid-col-name { font-size: 12px; font-weight: 600; color: var(--ink-primary); }
.k-grid-col-date { font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted); }
.k-grid-allday { display: flex; flex-direction: column; gap: 2px; padding: 4px; min-height: 4px; border-bottom: 1px solid var(--rule); background: rgba(0,0,0,0.02); }
.k-grid-allday-pill, .k-grid-task-pill { font-size: 10px; padding: 2px 6px; border-radius: 3px; color: var(--event-color); background: color-mix(in srgb, var(--event-color) 12%, transparent); border-left: 2px solid var(--event-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-grid-task-pill { display: inline-flex; align-items: center; gap: 4px; font-style: italic; }
.k-grid-task-pill.done { opacity: 0.5; text-decoration: line-through; }
.k-grid-task-check { font-family: var(--font-mono); font-weight: 700; }
.k-grid-body { position: relative; min-height: 480px; }
.k-grid-slot { height: calc(100% / var(--grid-hours)); border-top: 1px solid var(--rule); }
.k-grid-slot:first-child { border-top: 0; }
.k-grid-event { position: absolute; padding: 3px 6px; border-radius: 4px; background: color-mix(in srgb, var(--event-color) 18%, var(--surface-raised)); border-left: 3px solid var(--event-color); overflow: hidden; cursor: default; box-shadow: inset -1px 0 0 var(--rule); }
.k-grid-event-shared { padding: 2px 4px; font-size: 10px; }
.k-grid-event-shared .k-grid-event-time { font-size: 8px; }
.k-grid-event-time { font-family: var(--font-mono); font-size: 9px; font-weight: 500; color: var(--event-color); opacity: 0.85; }
.k-grid-event-title { font-size: 11px; font-weight: 500; color: var(--ink-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-grid-now { position: absolute; left: -4px; right: 0; height: 2px; background: var(--accent); z-index: 5; }
.k-grid-now-dot { position: absolute; left: -6px; top: -4px; width: 10px; height: 10px; border-radius: 999px; background: var(--accent); }

/* ── Aufgaben ── */
.k-tab-count { display: inline-block; min-width: 18px; padding: 1px 6px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; margin-left: 4px; }
.k-tasks-add { display: grid; grid-template-columns: minmax(0, 1fr) 130px 140px auto; gap: 8px; padding: 12px; margin-bottom: 20px; background: var(--surface-raised); border: 1px solid var(--rule); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.k-input { font-family: var(--font-body); font-size: 14px; padding: 8px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-primary); min-width: 0; }
.k-input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.k-input-select, .k-input-date { font-family: var(--font-body); }
.k-btn-primary { background: var(--accent); color: white; border-color: var(--accent); font-weight: 600; }
.k-btn-primary:hover { background: color-mix(in srgb, var(--accent) 90%, black); color: white; }
.k-tasks-group { margin-bottom: 18px; }
.k-tasks-group-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; border-bottom: 1px solid var(--rule); margin-bottom: 6px; }
.k-tasks-group-dot { width: 8px; height: 8px; border-radius: 999px; }
.k-tasks-count { margin-left: auto; color: var(--ink-muted); font-weight: 500; letter-spacing: 0; font-family: var(--font-body); text-transform: none; }
.k-task { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-raised); border: 1px solid var(--rule); border-radius: var(--radius-md); margin-bottom: 6px; }
.k-task.done { opacity: 0.5; }
.k-task.done .k-task-title { text-decoration: line-through; color: var(--ink-muted); }
.k-task.overdue { border-left: 3px solid var(--neg); }
.k-task.today { border-left: 3px solid var(--accent); }
.k-task-check { width: 22px; height: 22px; border: 2px solid var(--rule-strong); border-radius: 6px; background: var(--surface); font-family: var(--font-mono); font-weight: 700; color: var(--pos); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; font-size: 14px; }
.k-task-check:hover { border-color: var(--accent); }
.k-task.done .k-task-check { background: var(--pos); color: white; border-color: var(--pos); }
.k-task-title { font-size: 14px; color: var(--ink-primary); }
.k-task-due { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); margin-top: 2px; }
.k-task-due.today { color: var(--accent); font-weight: 600; }
.k-task-due.overdue { color: var(--neg); font-weight: 600; }
.k-task-del { background: transparent; border: 0; color: var(--ink-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.k-task-del:hover { color: var(--neg); }
.k-tasks-done { margin-top: 24px; }
.k-tasks-done summary { cursor: pointer; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); padding: 8px 4px; }
.k-tasks-done summary:hover { color: var(--ink-secondary); }

/* ── Suche ── */
.k-search-row { position: relative; margin-bottom: 12px; }
.k-search { width: 100%; font-family: var(--font-body); font-size: 14px; padding: 8px 36px 8px 14px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface-raised); color: var(--ink-primary); }
.k-search:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.k-search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: transparent; border: 0; font-size: 14px; color: var(--ink-muted); cursor: pointer; padding: 4px 8px; }
.k-search-clear:hover { color: var(--ink-primary); }

/* ── Modal ── */
.k-modal-backdrop { position: fixed; inset: 0; background: rgba(24, 25, 27, 0.55); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: k-fadein 120ms ease-out; }
.k-modal { position: relative; background: var(--surface-raised); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 28px 24px 24px; max-width: 480px; width: 100%; max-height: 90vh; overflow: auto; border-top: 4px solid var(--event-color); animation: k-slideup 180ms ease-out; }
.k-modal-close { position: absolute; top: 12px; right: 12px; background: transparent; border: 0; font-size: 18px; color: var(--ink-muted); cursor: pointer; padding: 6px 10px; border-radius: 6px; }
.k-modal-close:hover { background: var(--surface-sunken); color: var(--ink-primary); }
.k-modal-person { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
.k-modal-person-dot { width: 8px; height: 8px; border-radius: 999px; }
.k-modal-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 6px; color: var(--ink-primary); line-height: 1.25; }
.k-modal-time { font-family: var(--font-mono); font-size: 13px; color: var(--ink-secondary); margin-bottom: 16px; }
.k-modal-row { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-primary); }
.k-modal-row-label { display: block; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 4px; }
.k-modal-desc { color: var(--ink-secondary); line-height: 1.55; margin-top: 4px; }

@keyframes k-fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes k-slideup { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ── Stundenplan ── */
.k-sp { display: grid; grid-template-columns: 80px repeat(5, 1fr); background: var(--surface-raised); border: 1px solid var(--rule); border-radius: var(--radius-md); overflow: hidden; }
.k-sp-corner { background: var(--surface-sunken); }
.k-sp-day-head { text-align: center; padding: 8px 4px; font-size: 12px; font-weight: 700; color: var(--ink-secondary); background: var(--surface-sunken); border-left: 1px solid var(--rule); }
.k-sp-day-head.is-today { color: var(--kid-color, var(--accent)); background: color-mix(in srgb, var(--kid-color, var(--accent)) 12%, var(--surface-sunken)); }
.k-sp-slot-head { padding: 8px 8px; background: var(--surface-sunken); border-top: 1px solid var(--rule); text-align: right; }
.k-sp-slot-num { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-primary); }
.k-sp-slot-time { font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted); margin-top: 1px; }
.k-sp-cell { padding: 10px 8px; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); font-size: 13px; color: var(--ink-primary); text-align: center; background: var(--surface-raised); }
.k-sp-cell.is-today { background: color-mix(in srgb, var(--kid-color, var(--accent)) 6%, var(--surface-raised)); }
.k-sp-cell.is-empty { color: var(--ink-muted); font-style: italic; }
.k-sp-cell.is-now { background: color-mix(in srgb, var(--kid-color, var(--accent)) 25%, var(--surface-raised)); font-weight: 700; border-left: 3px solid var(--kid-color, var(--accent)); }

/* ── Jahresvorausschau ── */
.k-jahr-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.k-jahr-month { background: var(--surface-raised); border: 1px solid var(--rule); border-radius: var(--radius-md); padding: 12px; box-shadow: var(--shadow-sm); }
.k-jahr-month.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.k-jahr-month-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.k-jahr-month-name { font-size: 15px; font-weight: 700; color: var(--ink-primary); }
.k-jahr-month-sum { font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted); }
.k-jahr-week-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.k-jahr-wd { font-family: var(--font-mono); font-size: 9px; color: var(--ink-muted); text-align: center; text-transform: uppercase; letter-spacing: 0.06em; }
.k-jahr-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.k-jahr-day { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; font-family: var(--font-mono); font-size: 10px; color: var(--ink-secondary); border-radius: 3px; background: var(--surface-sunken); cursor: help; }
.k-jahr-day-empty { background: transparent; cursor: default; }
.k-jahr-highlights { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--rule); display: flex; flex-direction: column; gap: 4px; }
.k-jahr-highlight { font-size: 12px; color: var(--ink-primary); }
.k-jahr-highlight-date { font-family: var(--font-mono); font-size: 10px; color: var(--ink-muted); margin-left: 4px; }
.k-jahr-highlight-ferien { color: var(--ink-secondary); font-style: italic; }
.k-jahr-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 0; font-size: 11px; color: var(--ink-secondary); }
.k-jahr-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.k-jahr-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.k-jahr-ferien-strip { display: inline-block; width: 20px; height: 10px; border-radius: 2px; background: repeating-linear-gradient(45deg, var(--surface-sunken), var(--surface-sunken) 2px, var(--surface-raised) 2px, var(--surface-raised) 4px); }

/* ── Back-Buttons in Kiosk und Kid ── */
.k-kiosk-back { position: fixed; top: 12px; right: 16px; z-index: 20; background: var(--surface-raised); color: var(--ink-secondary); border: 1px solid var(--rule); border-radius: 999px; width: 40px; height: 40px; font-size: 16px; cursor: pointer; box-shadow: var(--shadow-sm); }
.k-kiosk-back:hover { color: var(--neg); border-color: var(--neg); }
.k-kid-back { position: sticky; top: 0; background: var(--surface); padding: 12px 20px; margin: -24px -20px 8px; border: 0; text-align: left; font-family: var(--font-body); font-size: 16px; font-weight: 600; color: var(--accent); cursor: pointer; width: calc(100% + 40px); }
.k-kid-back:hover { text-decoration: underline; }

@media (max-width: 640px) {
  #app { padding: 16px 14px 80px; }
  .k-actions .k-btn { padding: 5px 10px; font-size: 12px; }
  .k-event-compact { grid-template-columns: 46px 8px 1fr; }
  .k-event-compact-person { display: none; }
  .k-kid-next-title { font-size: 32px; }
  .k-kid-next-time { font-size: 20px; }
  .k-kiosk { grid-template-rows: auto auto 1fr 1fr; grid-template-columns: 1fr; }
  .k-kiosk-time { font-size: 32px; }
  .k-tasks-add { grid-template-columns: 1fr; }
  .k-grid { grid-template-columns: 36px repeat(var(--grid-cols), minmax(0, 1fr)); }
  .k-grid-col-name { font-size: 11px; }
  .k-grid-col-date { font-size: 9px; }
  .k-grid-event-title { font-size: 10px; }
  .k-sp { grid-template-columns: 60px repeat(5, 1fr); font-size: 11px; }
  .k-sp-slot-num { font-size: 10px; }
  .k-sp-cell { padding: 6px 4px; font-size: 11px; }
  .k-jahr-grid { grid-template-columns: 1fr; }
  .k-modal { padding: 20px 18px; }
  .k-modal-title { font-size: 18px; }
}
