    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    :root {
      --bg: #111318; --surface: #17191f; --card: #1e2028; --card2: #252933;
      --border: #2c3040; --accent: #e63946; --accent-dim: rgba(230,57,70,.12);
      --text: #eceef4; --muted: #7e8694; --dim: #404558;
      --green: #3dca72; --blue: #5b9cf6; --yellow: #f4a261; --purple: #a78bfa; --red: #e63946;
      --sidebar-w: 240px;
    }
    body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; font-size: 14px; line-height: 1.5; }

    /* ── Sidebar ── */
    .sidebar { width: var(--sidebar-w); min-height: 100vh; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; overflow-y: auto; }
    .sidebar-logo { padding: 24px 20px 18px; }
    .sidebar-logo h1 { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
    .sidebar-logo .school { font-size: 11px; color: var(--muted); margin-top: 2px; }
    .sidebar-logo .logo-dot { display: inline-block; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; margin-right: 7px; }
    .sidebar-nav { flex: 1; padding: 4px 12px 12px; }
    .nav-group { margin-bottom: 6px; }
    .nav-group-label { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--dim); padding: 10px 8px 4px; font-weight: 600; }
    .nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; color: var(--muted); cursor: pointer; transition: all .13s; font-size: 13px; font-weight: 500; border-radius: 7px; margin-bottom: 1px; }
    .nav-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
    .nav-item.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
    .nav-item .icon { font-size: 14px; width: 20px; text-align: center; opacity: .85; }
    .sidebar-divider { height: 1px; background: var(--border); margin: 6px 0; }
    .sidebar-footer { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 11px; color: var(--dim); }
    .sidebar-footer .sf { display: flex; justify-content: space-between; margin-bottom: 3px; }
    .sidebar-footer span { color: var(--muted); font-weight: 500; }

    /* Members (org:member) sehen nur Marketing-Planer, Ideen-Wand, die
       Terminübersicht, die Aufgabenliste und ihre eigenen Arbeitszeiten —
       Auswahl gespiegelt aus MEMBER_VIEWS in js/config.js */
    body.role-member .sidebar-nav .nav-item { display: none; }
    body.role-member .sidebar-nav .nav-item[data-view="mkt-planner"],
    body.role-member .sidebar-nav .nav-item[data-view="mkt-ideas"],
    body.role-member .sidebar-nav .nav-item[data-view="timelog"],
    body.role-member .sidebar-nav .nav-item[data-view="team-agenda"],
    body.role-member .sidebar-nav .nav-item[data-view="todos"] { display: flex; }
    body.role-member .sidebar-nav .nav-group-label { display: none; }
    body.role-member .sidebar-divider { display: none; }
    body.role-member .sidebar-footer .sf { display: none; }

    /* ── Main ── */
    .main { margin-left: var(--sidebar-w); flex: 1; padding: 32px 32px 60px; min-height: 100vh; max-width: calc(100vw - var(--sidebar-w)); }
    .page-header { margin-bottom: 24px; }
    .page-header h2 { font-size: 22px; font-weight: 700; letter-spacing: -.5px; color: var(--text); }
    .page-header p { color: var(--muted); margin-top: 4px; font-size: 13px; }

    /* ── Mobile top bar + drawer (hidden on desktop) ── */
    .mobile-topbar { display: none; }
    .sidebar-backdrop { display: none; }

    @media (max-width: 768px) {
      .mobile-topbar {
        display: flex; align-items: center; gap: 10px;
        position: fixed; top: 0; left: 0; right: 0; height: 52px;
        background: var(--surface); border-bottom: 1px solid var(--border);
        z-index: 200; padding: 0 14px;
      }
      .mobile-topbar .hamburger { font-size: 22px; color: var(--text); background: none; border: none; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 7px; }
      .mobile-topbar .hamburger:active { background: rgba(255,255,255,.06); }
      .mobile-topbar .mt-title { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }

      /* Sidebar becomes an off-canvas drawer. Uses transform (not display)
         so the auth flow's display toggling keeps working. */
      .sidebar { width: 82vw; max-width: 300px; transform: translateX(-100%); transition: transform .22s ease; z-index: 210; box-shadow: 2px 0 18px rgba(0,0,0,.45); }
      body.sidebar-open .sidebar { transform: translateX(0); }

      .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 205; opacity: 0; pointer-events: none; transition: opacity .22s; }
      body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

      .main { margin-left: 0; max-width: 100vw; padding: 68px 16px 48px; }
      .busy-chip { bottom: 58px; right: 14px; left: 14px; }
    }

    /* ── Cards ── */
    .card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; min-width: 0; }
    .card-title { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 700; margin-bottom: 16px; }

    /* ── Stat cards ── */
    .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 14px; margin-bottom: 20px; }
    .stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
    .stat-card .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; font-weight: 600; }
    .stat-card .value { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1; }
    .stat-card .sub { font-size: 11px; color: var(--dim); margin-top: 5px; }
    /* Event-Planer: Beträge mit Tausenderpunkt und Vorzeichen brauchen mehr Platz */
    .stats-grid.ev-stats { grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); }
    .stats-grid.ev-stats .value { font-size: 22px; white-space: nowrap; }

    /* Event-Notizen: Rich-Text-Editor (contenteditable + Toolbar) */
    .ev-note-bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 7px 8px; background: var(--surface); border: 1px solid var(--border); border-bottom: none; border-radius: 9px 9px 0 0; }
    .ev-nb { background: transparent; border: 1px solid transparent; color: var(--text); font-size: 12px; font-family: inherit; padding: 4px 8px; border-radius: 6px; cursor: pointer; line-height: 1.2; min-width: 28px; }
    .ev-nb:hover { background: var(--card); border-color: var(--border); }
    .ev-nb:active { background: var(--border); }
    .ev-nsep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; }
    .ev-note-editor { min-height: 340px; max-height: 65vh; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: 0 0 9px 9px; padding: 16px 18px; font-size: 13.5px; line-height: 1.65; outline: none; }
    .ev-note-editor:focus { border-color: var(--accent); }
    .ev-note-editor:empty::before { content: attr(data-placeholder); color: var(--dim); }
    .ev-note-editor h2 { font-size: 18px; margin: 18px 0 8px; font-weight: 700; }
    .ev-note-editor h3 { font-size: 15px; margin: 15px 0 6px; font-weight: 700; }
    .ev-note-editor h2:first-child, .ev-note-editor h3:first-child { margin-top: 0; }
    .ev-note-editor p { margin: 0 0 9px; }
    .ev-note-editor ul, .ev-note-editor ol { margin: 0 0 10px; padding-left: 22px; }
    .ev-note-editor li { margin-bottom: 4px; }
    .ev-note-editor a { color: var(--blue); text-decoration: underline; cursor: pointer; }
    .ev-note-editor blockquote { margin: 0 0 10px; padding: 4px 0 4px 13px; border-left: 3px solid var(--border); color: var(--muted); }
    .ev-note-editor code { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
    .ev-note-editor pre { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 10px 12px; overflow-x: auto; }
    .ev-note-editor hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
    .ev-note-editor img { max-width: 100%; height: auto; border-radius: 7px; }
    .ev-note-editor table { border-collapse: collapse; margin-bottom: 10px; }
    .ev-note-editor td, .ev-note-editor th { border: 1px solid var(--border); padding: 5px 9px; font-size: 12.5px; }

    /* ── Controls ── */
    .controls { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
    /* min-width:0 — sonst kann ein <select> als Flex-Kind nicht unter die Breite
       seiner längsten Option schrumpfen und sprengt schmale Zeilen */
    select, input[type="text"] { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; outline: none; min-width: 0; transition: border-color .13s; }
    select:focus, input[type="text"]:focus { border-color: var(--accent); }
    .btn { padding: 8px 16px; border-radius: 8px; border: none; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .13s; }
    .btn-primary { background: var(--accent); color: #fff; }
    .btn-primary:hover { background: #c9222f; }
    .btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
    .btn-ghost:hover { border-color: var(--muted); color: var(--text); background: rgba(255,255,255,.04); }
    .btn-ghost.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
    .btn-danger { background: transparent; border: 1px solid rgba(230,57,70,.3); color: #e87878; }
    .btn-danger:hover { background: rgba(230,57,70,.12); }

    /* ── Chart ── */
    .chart-wrap { position: relative; height: 280px; }

    /* ── Table ── */
    .table-wrap { overflow-x: auto; }
    table { width: 100%; border-collapse: collapse; }
    th { text-align: left; padding: 10px 14px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap; }
    td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
    tr:last-child td { border-bottom: none; }
    tbody tr { transition: background .1s; }
    tbody tr:hover { background: var(--card2); }
    tbody tr.clickable { cursor: pointer; }
    tbody tr.hl td { background: var(--accent-dim); }

    /* ── Badge ── */
    .badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
    .b-red { background: var(--accent-dim); color: var(--accent); }
    .b-green { background: rgba(61,202,114,.12); color: var(--green); }
    .b-blue { background: rgba(91,156,246,.12); color: var(--blue); }
    .b-yellow { background: rgba(244,162,97,.12); color: var(--yellow); }
    .b-purple { background: rgba(167,139,250,.12); color: var(--purple); }
    .b-gray { background: rgba(136,136,136,.1); color: var(--muted); }

    /* ── Upload ── */
    .upload-zone { border: 2px dashed var(--border); border-radius: 14px; padding: 56px 32px; text-align: center; cursor: pointer; transition: all .15s; }
    .upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: var(--accent-dim); }
    .upload-zone .icon { font-size: 48px; margin-bottom: 14px; }
    .upload-zone h3 { font-size: 16px; margin-bottom: 6px; }
    .upload-zone p { color: var(--muted); font-size: 13px; }

    /* ── Back btn ── */
    .back-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; font-size: 13px; margin-bottom: 18px; padding: 6px 10px; border-radius: 7px; transition: all .13s; }
    .back-btn:hover { color: var(--text); background: rgba(255,255,255,.05); }

    /* ── Layout ── */
    .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
    .mb { margin-bottom: 16px; }
    /* Feste Spaltenzahl für .stats-grid — als Klasse statt inline, damit die
       Mobil-Media-Query sie überschreiben kann (inline style gewinnt sonst). */
    .stats-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stats-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

    /* ── Progress ── */
    .prog-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 6px; }
    .prog-fill { height: 100%; border-radius: 2px; }

    /* ── Link ── */
    .link { color: var(--accent); cursor: pointer; }
    .link:hover { text-decoration: underline; }

    /* ── Empty ── */
    .empty { text-align: center; padding: 72px 32px; color: var(--muted); }
    .empty .icon { font-size: 56px; margin-bottom: 16px; opacity: .6; }
    .empty h3 { font-size: 17px; color: var(--text); margin-bottom: 8px; }

    /* ── Spinner Animation ── */
    @keyframes spin { to { transform: rotate(360deg); } }
    @keyframes busy-pulse { 50% { opacity: .35; } }

    /* ── Toast ── */
    .toast { position: fixed; bottom: 24px; right: 24px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 18px; font-size: 13px; z-index: 9999; animation: fadeUp .18s ease; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
    .toast.success { border-color: var(--green); color: var(--green); }
    .toast.error { border-color: var(--accent); color: var(--accent); }
    @keyframes fadeUp { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

    /* ── Spinner ── */
    .spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }

    /* ── Busy Chip (unten rechts während Operationen) ── */
    .busy-chip { position: fixed; bottom: 78px; right: 24px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; font-size: 13px; z-index: 9998; box-shadow: 0 8px 24px rgba(0,0,0,.4); display: flex; align-items: center; gap: 10px; pointer-events: none; animation: fadeUp .18s ease; }
    .busy-chip .spinner { width: 14px; height: 14px; border-width: 1.5px; }
    .busy-chip .busy-label { color: var(--text); }
    .busy-chip .busy-count { color: var(--muted); font-size: 12px; }

    /* ── View Loading Overlay ── */
    .view-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(0,0,0,.5); border-radius: 12px; z-index: 9997; }
    .view-loading .spinner { width: 36px; height: 36px; border-width: 3px; }
    .view-loading .loading-text { color: var(--muted); font-size: 13px; }

    @media (prefers-reduced-motion: reduce) {
      .spinner { animation: busy-pulse 1.4s ease-in-out infinite; }
      .busy-chip { animation: none; }
    }

    /* ── Tabs ── */
    .tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
    .tab { padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; transition: all .13s; }
    .tab:hover { color: var(--text); background: rgba(255,255,255,.03); }
    .tab.active { color: var(--accent); border-bottom-color: var(--accent); }

    /* ── Day pill ── */
    .day-pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }

    /* ── Scrollable box ── */
    /* overflow-x, damit breite Tabellen darin nicht die Seite aufziehen */
    .scroll-box { max-height: 280px; overflow-y: auto; overflow-x: auto; }

    input[type="file"] { display: none; }
    input[type="number"] { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 7px; font-size: 13px; outline: none; transition: border-color .13s; }
    input[type="number"]:focus { border-color: var(--accent); }
    input[type="text"].inline-edit, input[type="url"].inline-edit, textarea.inline-edit { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 7px; font-size: 13px; outline: none; transition: border-color .13s; }
    input[type="text"].inline-edit:focus, input[type="url"].inline-edit:focus, textarea.inline-edit:focus { border-color: var(--accent); }
    textarea.inline-edit { font-family: inherit; line-height: 1.55; min-height: 76px; resize: vertical; display: block; }
    .pay-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
    .pay-row:last-child { border-bottom: none; }
    .btn-paid { background: rgba(61,202,114,.1); border: 1px solid rgba(61,202,114,.25); color: var(--green); }
    .btn-paid:hover { background: rgba(61,202,114,.18); }
    .btn-unpaid { background: var(--accent-dim); border: 1px solid rgba(230,57,70,.25); color: var(--accent); }
    .btn-unpaid:hover { background: rgba(230,57,70,.2); }
    .wage-custom { color: var(--accent); font-size: 10px; vertical-align: super; margin-left: 2px; cursor: help; }
    .open-amount { color: var(--accent); font-weight: 700; }
    .paid-amount { color: var(--green); }
    input[type="date"], input[type="month"], input[type="time"] { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 7px 10px; border-radius: 7px; font-size: 13px; outline: none; cursor: pointer; color-scheme: dark; transition: border-color .13s; }
    input[type="date"]:focus, input[type="month"]:focus, input[type="time"]:focus { border-color: var(--accent); }
    .series-row { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; margin-bottom: 8px; flex-wrap: wrap; }
    .series-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

    /* ── Unterrichtsinhalte einer Session (Klassenansicht) ── */
    .lc-group + .lc-group { margin-top: 15px; }
    .lc-group-label { display: flex; align-items: center; gap: 9px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin-bottom: 8px; }
    .lc-group-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
    .lc-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; }
    .lc-item + .lc-item { margin-top: 6px; }
    .lc-item-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 7px; }
    .lc-item-body { flex: 1 1 220px; min-width: 0; }
    .lc-item-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; overflow-wrap: anywhere; }
    .lc-item-desc { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 3px; overflow-wrap: anywhere; white-space: pre-wrap; }
    .lc-video { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 7px; border: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: all .13s; }
    .lc-video:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
    .lc-empty { font-size: 12px; color: var(--muted); padding: 12px; text-align: center; border: 1px dashed var(--border); border-radius: 9px; }
    .lc-act { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--dim); font-size: 11px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all .13s; }
    .lc-item:hover .lc-act { color: var(--muted); border-color: var(--border); }
    .lc-act:hover { border-color: var(--accent) !important; color: var(--accent) !important; background: var(--accent-dim); }
    .lc-item-editing { border-color: var(--accent); background: var(--card2); }
    .lc-edit { flex: 1 1 100%; display: flex; flex-direction: column; gap: 4px; }
    .lc-edit-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-top: 4px; }
    .lc-edit .inline-edit { width: 100%; }
    .lc-edit-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
    .date-range-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 14px; background: var(--card); border-radius: 10px; border: 1px solid var(--border); }
    /* Von–Bis-Paar bleibt zusammen, damit es beim Umbruch nicht auseinanderfällt */
    .date-pair { display: inline-flex; align-items: center; gap: 8px; }

    /* ── Calendar ── */
    .cal-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
    .cal-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .cal-nav { display: flex; align-items: center; gap: 6px; }
    .cal-nav-label { font-size: 14px; font-weight: 600; min-width: 165px; text-align: center; }
    .cal-scroll { overflow-x: auto; margin-bottom: 12px; }
    .cal-scroll .cal-grid { min-width: 700px; }
    .cal-legend { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
    .cal-lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
    .cal-sess-loc { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
    .cal-dow { background: var(--surface); text-align: center; padding: 10px 4px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
    .cal-day { background: var(--card); min-height: 90px; padding: 8px 7px; vertical-align: top; min-width: 0; }
    .cal-day.today { background: rgba(230,57,70,.06); }
    .cal-day.other-month { background: var(--surface); }
    .cal-day.other-month .cal-day-num { opacity: .25; }
    .cal-day-num { font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
    .cal-day.today .cal-day-num { color: #fff; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 10px; margin-bottom: 5px; }
    .cal-sess { margin-bottom: 3px; padding: 4px 6px; border-radius: 5px; font-size: 10px; cursor: pointer; border-left: 3px solid; transition: filter .1s; }
    .cal-sess:hover { filter: brightness(1.2); }
    .cal-sess.is-class    { background: rgba(91,156,246,.13); border-left-color: var(--blue); }
    .cal-sess.is-event    { background: rgba(244,162,97,.14); border-left-color: var(--yellow); }
    .cal-sess.is-planned  { background: rgba(91,156,246,.10); border-left-color: var(--blue); border-style: dashed; border-left-style: solid; }
    .cal-sess.is-cancelled { background: rgba(136,136,136,.08); border-left-color: var(--dim); }
    .cal-sess.is-billed { background: rgba(87,204,138,.16); border-left-color: var(--green); }
    .cal-sess-name { font-weight: 600; line-height: 1.25; margin-bottom: 2px; overflow-wrap: anywhere; }
    .cal-sess-meta { display: flex; gap: 5px; flex-wrap: wrap; color: var(--muted); font-size: 9px; line-height: 1.4; }

    /* Kalender: Agenda-Liste (dritter Modus neben dem Monatsraster) */
    .cal-agenda { max-width: 680px; margin-bottom: 14px; }
    .cal-ag-day { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
    .cal-ag-day.today { border-color: var(--accent); }
    .cal-ag-date { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
    .cal-ag-day.today .cal-ag-date { color: var(--accent); }
    .cal-ag-empty { font-size: 11px; color: var(--dim); }
    /* großzügigere Tap-Ziele als im Raster */
    .cal-agenda .cal-sess { font-size: 12px; padding: 9px 11px; margin-bottom: 6px; border-radius: 8px; }
    .cal-agenda .cal-sess:last-child { margin-bottom: 0; }
    .cal-agenda .cal-sess-name { font-size: 13px; margin-bottom: 3px; }
    .cal-agenda .cal-sess-meta { font-size: 11px; gap: 4px 9px; }
    .cal-agenda .cal-sess-loc { max-width: 150px; }

    /* ── Kalender mobil ── */
    @media (max-width: 768px) {
      .cal-header { justify-content: center; }
      .cal-sub { display: none; }
      .cal-controls { width: 100%; justify-content: center; }
      .cal-nav { width: 100%; justify-content: center; }
      .cal-nav-label { font-size: 13px; min-width: 0; flex: 1; }
      /* Kompaktes Raster, das aufs Display passt — Details stehen in der Agenda */
      .cal-scroll { overflow-x: visible; }
      .cal-scroll .cal-grid { min-width: 0; }
      .cal-scroll .cal-dow { padding: 6px 2px; font-size: 9px; letter-spacing: 0; }
      .cal-scroll .cal-day { min-height: 66px; padding: 4px 3px 3px; }
      .cal-scroll .cal-day-num { font-size: 10px; margin-bottom: 3px; }
      .cal-scroll .cal-day.today .cal-day-num { width: 16px; height: 16px; font-size: 9px; margin-bottom: 3px; }
      .cal-scroll .cal-sess { padding: 2px 4px; margin-bottom: 2px; border-radius: 4px; border-left-width: 2px; }
      /* lange Kursnamen auf 2 Zeilen kürzen, sonst wird eine Zelle 8 Zeilen hoch */
      .cal-scroll .cal-sess-name { font-size: 8.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
      /* Zahlen/Lehrer/Ort passen in 7 schmale Spalten nicht mehr — nur der
         Name bleibt; alles Weitere zeigt die Agenda bzw. die Session-Detailseite */
      .cal-scroll .cal-sess-meta { display: none; }
      .cal-legend { gap: 6px 14px; font-size: 10px; }
    }

    /* ── Marketing-Planer ── */
    .mp-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
    .mp-seg span { padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .12s; }
    .mp-seg span + span { border-left: 1px solid var(--border); }
    .mp-seg span:hover { color: var(--text); }
    .mp-seg span.active { background: var(--accent-dim); color: var(--accent); }
    .mp-cal-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px 10px; flex-wrap: wrap; margin-bottom: 12px; }
    .mp-cal-nav { display: flex; align-items: center; gap: 6px; }
    .mp-cal-label { font-size: 14px; font-weight: 600; min-width: 150px; text-align: center; }
    .cal-grid.mp-week .cal-day { min-height: 220px; }
    .cal-grid.mp-week .cal-day.today .cal-day-num { width: auto; padding: 0 8px; border-radius: 10px; }
    .mp-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 16px; align-items: start; }
    @media (max-width: 1100px) { .mp-layout { grid-template-columns: minmax(0,1fr); } }
    .mp-day { position: relative; min-width: 0; min-height: 104px; transition: box-shadow .12s, background .12s; }
    .mp-day.mp-dropping { background: rgba(91,156,246,.12); box-shadow: inset 0 0 0 2px var(--blue); }
    .mp-day-add { position: absolute; top: 5px; right: 6px; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--dim); cursor: pointer; opacity: 0; transition: opacity .12s, background .12s; }
    .mp-day:hover .mp-day-add { opacity: 1; }
    .mp-day-add:hover { background: var(--accent); color: #fff; }
    .mp-chip { display: flex; flex-direction: column; gap: 1px; margin-bottom: 3px; padding: 4px 6px; border-radius: 6px; font-size: 10px; cursor: grab; transition: filter .1s, opacity .1s; }
    .mp-chip:hover { filter: brightness(1.25); }
    .mp-chip:active { cursor: grabbing; }
    .mp-chip-row1 { display: flex; align-items: center; gap: 5px; }
    .mp-chip-ic { flex-shrink: 0; line-height: 1.35; }
    .mp-chip .mp-t { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
    .mp-chip .mp-t2 { font-size: 9px; color: var(--muted); overflow-wrap: anywhere; line-height: 1.25; padding-left: 1px; }
    .mp-chip .mp-cn { font-size: 9px; font-weight: 600; overflow-wrap: anywhere; line-height: 1.25; padding-left: 1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .mp-chip-side { flex-shrink: 0; display: flex; align-items: center; gap: 2px; }
    .mp-chip.done { opacity: .45; }
    .mp-chip.done .mp-t { text-decoration: line-through; }
    .mp-chip.overdue { box-shadow: 0 0 0 1px var(--accent); }
    /* Archivierte Kampagne: Chronik im Kalender, nicht mehr bearbeitbar per Drag */
    .mp-chip.mp-arch { opacity: .42; filter: saturate(.55); cursor: pointer; }
    .mp-chip.mp-arch:hover { opacity: .72; filter: saturate(.75); }
    .mp-chip-done { width: 14px; height: 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; flex-shrink: 0; color: var(--muted); cursor: pointer; }
    .mp-chip-done:hover { background: var(--green); color: #fff; }
    .mp-anchor { margin-bottom: 3px; padding: 4px 6px; border-radius: 5px; font-size: 10px; font-weight: 700; cursor: pointer; border: 1.5px dashed; display: flex; align-items: center; gap: 4px; }
    .mp-anchor .mp-days { margin-left: auto; font-weight: 600; font-size: 9px; opacity: .8; white-space: nowrap; }
    .mp-anchor.mp-arch { opacity: .45; border-style: dotted; filter: saturate(.55); }
    .mp-anchor.mp-arch:hover { opacity: .75; }
    .mp-tray { border: 2px dashed var(--border); border-radius: 12px; padding: 14px; margin-bottom: 16px; transition: border-color .12s, background .12s; }
    .mp-tray.mp-dropping { border-color: var(--blue); background: rgba(91,156,246,.08); }
    .mp-tray-chip { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 7px; font-size: 11px; cursor: grab; margin-bottom: 5px; }
    .mp-tray-chip:hover { filter: brightness(1.2); }
    .mp-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
    .mp-fchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); color: var(--muted); transition: all .12s; }
    .mp-fchip:hover { color: var(--text); }
    .mp-fchip.active { border-color: currentColor; }
    .mp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
    .mp-camp-row { padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
    .mp-camp-row:last-child { border-bottom: none; }
    /* Kampagnen-Notiz: nur im Übersichts-Dialog, nicht in der Liste */
    .mp-camp-note { font-size: 12px; color: var(--text); background: var(--surface); border-left: 2px solid var(--border); border-radius: 0 7px 7px 0; padding: 8px 10px; margin-bottom: 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 20vh; overflow-y: auto; }
    .mp-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 600; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 20px 20px; overflow-y: auto; }
    .mp-modal { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px; width: 100%; max-width: 460px; box-shadow: 0 24px 64px rgba(0,0,0,.5); }
    .mp-modal h3 { font-size: 16px; margin-bottom: 16px; }
    .mp-field { margin-bottom: 12px; }
    .mp-field label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
    .mp-field select, .mp-field input[type="text"], .mp-field input[type="date"], .mp-field input[type="month"], .mp-field input[type="time"], .mp-field input[type="number"], .mp-field textarea { width: 100%; box-sizing: border-box; }
    .mp-field textarea { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 8px; font-size: 13px; outline: none; font-family: inherit; min-height: 90px; resize: vertical; transition: border-color .13s; }
    .mp-field textarea:focus { border-color: var(--accent); }
    .mp-colors { display: flex; gap: 8px; }
    .mp-colors label { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; display: block; transition: transform .1s; }
    .mp-colors label:has(input:checked) { border-color: #fff; transform: scale(1.18); }
    .mp-colors input { display: none; }
    .mp-chan-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
    .mp-chan-row:last-child { border-bottom: none; }
    /* Campaign overview: action list */
    .mp-ov-list { max-height: 48vh; overflow-y: auto; margin: 0 -6px; }
    .mp-ov-row { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-radius: 8px; cursor: pointer; border-bottom: 1px solid var(--border); }
    .mp-ov-row:last-child { border-bottom: none; }
    .mp-ov-row:hover { background: rgba(255,255,255,.04); }
    .mp-ov-row.done { opacity: .5; }
    .mp-ov-check { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; color: var(--muted); cursor: pointer; background: rgba(255,255,255,.05); }
    .mp-ov-check:hover { background: var(--green); color: #fff; }
    .mp-ov-ic { flex-shrink: 0; }
    .mp-ov-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
    .mp-ov-title { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mp-ov-row.done .mp-ov-title { text-decoration: line-through; }
    .mp-ov-sub { font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .mp-ov-date { font-size: 10.5px; color: var(--muted); white-space: nowrap; flex-shrink: 0; font-weight: 600; }
    .mp-ov-date.overdue { color: var(--accent); }
    .mp-ov-date.undated { font-weight: 400; font-style: italic; }
    .mp-ov-dup { width: 20px; height: 20px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .12s, background .12s; }
    .mp-ov-row:hover .mp-ov-dup { opacity: 1; }
    .mp-ov-dup:hover { background: rgba(255,255,255,.09); color: var(--text); }
    @media (hover: none) { .mp-ov-dup { opacity: .75; } }
    .mp-avatar { width: 15px; height: 15px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; color: #fff; flex-shrink: 0; letter-spacing: .3px; }
    .mp-chip .mp-avatar { width: 13px; height: 13px; font-size: 7px; margin-left: -2px; }
    .mp-people-pick { display: flex; gap: 6px; flex-wrap: wrap; }
    .mp-pchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); color: var(--muted); transition: all .12s; user-select: none; }
    .mp-pchip:hover { color: var(--text); }
    .mp-pchip.sel { border-color: var(--accent); color: var(--text); background: rgba(255,255,255,.05); }
    .mp-pchip:not(.sel) .mp-avatar { opacity: .55; }

    /* ── Marketing-Planer: agenda view (third mode next to month/week grids) ── */
    .mp-agenda { max-width: 680px; }
    .mp-ag-day { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
    .mp-ag-day.today { border-color: var(--accent); }
    .mp-ag-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
    .mp-ag-date { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
    .mp-ag-day.today .mp-ag-date { color: var(--accent); }
    .mp-ag-add { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--muted); background: rgba(255,255,255,.06); cursor: pointer; flex-shrink: 0; }
    .mp-ag-add:hover, .mp-ag-add:active { background: var(--accent); color: #fff; }
    .mp-ag-empty { font-size: 11px; color: var(--dim); }
    .mp-ag-hint { font-size: 11px; color: var(--dim); margin: 4px 2px 14px; }
    /* comfortable targets: agenda chips are larger than grid chips */
    .mp-agenda .mp-chip { font-size: 12px; padding: 8px 10px; margin-bottom: 6px; border-radius: 8px; gap: 7px; }
    .mp-agenda .mp-chip .mp-t2, .mp-agenda .mp-chip .mp-cn { font-size: 11px; }
    .mp-agenda .mp-chip-done { width: 24px; height: 24px; font-size: 12px; background: rgba(255,255,255,.06); }
    .mp-agenda .mp-chip .mp-avatar { width: 18px; height: 18px; font-size: 9px; }
    .mp-agenda .mp-anchor { font-size: 12px; padding: 8px 10px; margin-bottom: 6px; border-radius: 8px; }
    .mp-agenda .mp-anchor .mp-days { font-size: 10px; }

    /* ── Marketing-Planer mobile ── */
    @media (max-width: 768px) {
      .mp-dnd-hint { display: none; }   /* drag & drop doesn't exist on touch */
      /* controls: toggle on top, nav centered underneath */
      .mp-cal-controls { justify-content: center; }
      .mp-cal-nav { width: 100%; justify-content: center; }
      .mp-cal-label { font-size: 13px; min-width: 0; }
      /* compact grid that fits the screen — actions become event bars
         like a native calendar app (tap a bar to open, or use Agenda) */
      .mp-cal-wrap .cal-dow { padding: 6px 2px; font-size: 9px; letter-spacing: 0; }
      .mp-cal-wrap .cal-day { min-height: 66px; padding: 4px 3px 3px; }
      .mp-cal-wrap .cal-day-num { font-size: 10px; margin-bottom: 3px; }
      .mp-cal-wrap .cal-day.today .cal-day-num { width: 16px; height: 16px; font-size: 9px; margin-bottom: 3px; }
      .mp-cal-wrap .cal-grid.mp-week .cal-day.today .cal-day-num { width: auto; padding: 0 5px; }
      .mp-cal-wrap .mp-day-add { display: none; }
      /* Show real text on mobile: stack channel / campaign / title vertically so
         the narrow 7-col cells don't crush it. Tap a chip to open the editor. */
      .mp-cal-wrap .mp-chip { flex-direction: column; align-items: stretch; gap: 1px; height: auto; padding: 3px 4px; margin-bottom: 2px; border-radius: 4px; }
      .mp-cal-wrap .mp-chip-ic { display: none; }
      .mp-cal-wrap .mp-chip .mp-t { font-size: 8.5px; }
      .mp-cal-wrap .mp-chip .mp-t2, .mp-cal-wrap .mp-chip .mp-cn { font-size: 7.5px; }
      /* the 7-col grid is too narrow for avatars + the done circle next to the
         text — hide them here so channel/campaign/title stay readable; both are
         fully shown in the Agenda view and the action editor (tap to open) */
      .mp-cal-wrap .mp-chip-side { display: none; }
      .mp-cal-wrap .mp-anchor { height: auto; padding: 2px 4px; margin-bottom: 2px; border-radius: 3px; border-width: 1px; font-size: 8px; }
      .mp-cal-wrap .mp-anchor > span:first-child { display: none; }
      .mp-cal-wrap .mp-anchor .mp-days { display: none; }
      .mp-cal-wrap .cal-grid.mp-week .cal-day { min-height: 120px; }
      /* modal comfort on small screens; 16px inputs stop iOS zoom-on-focus */
      .mp-overlay { padding: 12px; }
      .mp-modal { padding: 18px 16px; }
      .mp-field select, .mp-field input[type="text"], .mp-field input[type="date"], .mp-field input[type="number"], .mp-field textarea { font-size: 16px; }
    }

    /* ── Ideen-Wand ─────────────────────────────
       Post-its liegen auf einem dunklen, gepunkteten Board. Die Notizzettel
       sind absichtlich hell mit dunkler Schrift — das ist der Kontrast, der
       die Wand vom Rest des Dashboards abhebt. */
    .iw-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

    .iw-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
    .iw-seg { display: flex; background: var(--card); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
    .iw-seg button { background: none; border: none; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: 7px; cursor: pointer; transition: all .12s; font-family: inherit; }
    .iw-seg button:hover { color: var(--text); }
    .iw-seg button.on { background: var(--accent-dim); color: var(--accent); }
    .iw-search { flex: 1; min-width: 180px; max-width: 320px; position: relative; }
    .iw-search input { width: 100%; box-sizing: border-box; padding-left: 32px; }
    .iw-mag { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: .5; pointer-events: none; }
    .iw-sort { max-width: 190px; }

    .iw-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
    .iw-fchip { font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 20px; border: 1px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 5px; transition: all .12s; user-select: none; }
    .iw-fchip:hover { border-color: var(--muted); color: var(--text); }
    .iw-fchip.on { background: rgba(255,255,255,.07); border-color: var(--dim); color: var(--text); }
    .iw-fchip .n { font-size: 10px; opacity: .55; font-weight: 700; }
    .iw-fsep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; }
    .iw-tag { font-size: 11px; padding: 4px 9px; border-radius: 20px; background: rgba(91,156,246,.1); border: 1px solid rgba(91,156,246,.22); color: #8db6f8; cursor: pointer; user-select: none; transition: all .12s; }
    .iw-tag:hover { background: rgba(91,156,246,.2); }
    .iw-tag.on { background: rgba(91,156,246,.28); border-color: rgba(91,156,246,.5); color: #cfe0fd; }

    .iw-board {
      border: 1px solid var(--border); border-radius: 14px; padding: 20px; min-height: 300px;
      background-color: #15171d;
      background-image: radial-gradient(rgba(255,255,255,.045) 1px, transparent 1px);
      background-size: 20px 20px;
      columns: 4; column-gap: 16px;
    }
    .iw-board-empty { columns: 1; }      /* sonst rutscht der leere Hinweis in Spalte 2 */
    .iw-hint { font-size: 11px; color: var(--dim); margin-top: 8px; }
    .iw-empty { break-inside: avoid; font-size: 12.5px; color: var(--muted); line-height: 1.6; padding: 20px 2px; }

    .iw-quick { break-inside: avoid; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; border: 2px dashed var(--dim); border-radius: 4px; padding: 10px 12px; transition: border-color .13s; }
    .iw-quick:focus-within { border-color: var(--accent); }
    .iw-quick-ic { font-size: 14px; opacity: .6; }
    .iw-quick input { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 13px; font-family: inherit; padding: 0; }
    .iw-quick input::placeholder { color: var(--dim); }

    .iw-note {
      break-inside: avoid; margin-bottom: 16px; position: relative;
      border-radius: 3px; padding: 13px 13px 10px; color: #1a1b21; font-size: 13px;
      box-shadow: 0 6px 16px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.3);
      cursor: pointer; transition: transform .16s cubic-bezier(.2,.8,.3,1), box-shadow .16s;
    }
    /* Eselsohr unten rechts */
    .iw-note::after { content: ''; position: absolute; right: 0; bottom: 0; width: 20px; height: 20px; background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,.13) 50%); }
    .iw-note:hover { transform: translateY(-4px) rotate(0deg) scale(1.02); box-shadow: 0 14px 30px rgba(0,0,0,.55); z-index: 5; }
    .iw-note.iw-dragging { opacity: .4; }
    .iw-note.iw-drop-before { box-shadow: 0 0 0 2px var(--blue), 0 6px 16px rgba(0,0,0,.45); }
    .iw-note.iw-arch { filter: saturate(.5); opacity: .72; }
    /* Leichte Schieflage — jedes n-te Post-it anders, damit die Wand nicht
       wie eine Tabelle wirkt. :hover oben stellt sie wieder gerade. */
    .iw-board .iw-note:nth-child(4n+1) { transform: rotate(-1.2deg); }
    .iw-board .iw-note:nth-child(4n+2) { transform: rotate(1.1deg); }
    .iw-board .iw-note:nth-child(4n+3) { transform: rotate(-.5deg); }
    .iw-board .iw-note:nth-child(4n)   { transform: rotate(1.6deg); }

    .iw-c1 { background: linear-gradient(160deg,#ffe38a,#f8d264); }
    .iw-c2 { background: linear-gradient(160deg,#a9e9a4,#8fdc8c); }
    .iw-c3 { background: linear-gradient(160deg,#a8cdff,#8fbcfb); }
    .iw-c4 { background: linear-gradient(160deg,#ffb3cc,#f79cbc); }
    .iw-c5 { background: linear-gradient(160deg,#d9bbff,#c6a3f7); }
    .iw-c6 { background: linear-gradient(160deg,#ffc79a,#f8b077); }

    .iw-note-img { height: 90px; border-radius: 3px; overflow: hidden; margin: -3px 0 9px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
    .iw-note-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .iw-note-head { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 6px; }
    .iw-note-type { font-size: 14px; line-height: 1.25; flex-shrink: 0; }
    .iw-note-title { flex: 1; min-width: 0; font-weight: 700; font-size: 13.5px; line-height: 1.3; letter-spacing: -.2px; overflow-wrap: anywhere; }
    .iw-note-fav { flex-shrink: 0; font-size: 12px; opacity: .75; line-height: 1.3; }
    .iw-note-fav:hover { opacity: 1; }
    .iw-note-body { font-size: 12px; line-height: 1.45; color: rgba(26,27,33,.78); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
    .iw-note-foot { display: flex; align-items: center; gap: 5px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed rgba(26,27,33,.18); flex-wrap: wrap; }
    .iw-compact .iw-note-foot { margin-top: 7px; padding-top: 6px; }
    .iw-ntag { font-size: 10px; font-weight: 700; background: rgba(26,27,33,.1); padding: 2px 7px; border-radius: 10px; }
    .iw-ntag:hover { background: rgba(26,27,33,.2); }
    .iw-nspacer { flex: 1; }
    .iw-note-when { font-size: 10px; font-weight: 700; opacity: .6; white-space: nowrap; }
    .iw-note-foot .mp-avatar { width: 19px; height: 19px; font-size: 9px; }
    /* Status auf dem Post-it: neutraler Chip mit Farbpunkt statt farbigem
       Grund — Rot auf Rosa und Grün auf Grün wären sonst kaum lesbar. */
    .iw-nstatus { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 2px 7px; border-radius: 4px; white-space: nowrap; background: rgba(26,27,33,.11); }
    .iw-nstatus::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
    .iw-note .iw-st-idee::before   { background: rgba(26,27,33,.45); }
    .iw-note .iw-st-arbeit::before { background: #c9541a; }
    .iw-note .iw-st-bereit::before { background: #16803f; }
    .iw-note .iw-st-planer::before { background: #1f5fb8; }

    .iw-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
    .iw-col { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; min-height: 280px; transition: border-color .12s, background .12s; }
    .iw-col.iw-dropping { border-color: var(--blue); background: rgba(91,156,246,.07); }
    .iw-col-h { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 12px; padding: 0 2px; }
    .iw-col-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
    .iw-col-cnt { margin-left: auto; background: var(--card2); border-radius: 10px; padding: 1px 7px; font-size: 10px; }
    .iw-col .iw-note { margin-bottom: 10px; transform: none; font-size: 12.5px; }
    .iw-col .iw-note:hover { transform: translateY(-3px); }
    .iw-col-empty { font-size: 11px; color: var(--dim); text-align: center; padding: 22px 6px; border: 1px dashed var(--border); border-radius: 8px; }

    /* Kampagnen-Bahnen: je Kampagne ein Streifen mit ihren Post-its. Der
       Farbbalken links ist die Kampagnenfarbe aus dem Planer. */
    .iw-lanes { display: flex; flex-direction: column; gap: 14px; }
    .iw-lane { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--dim); border-radius: 12px; padding: 14px 16px; transition: border-color .12s, background .12s; }
    .iw-lane.iw-dropping { background: rgba(91,156,246,.07); border-color: var(--blue); }
    .iw-lane-arch { opacity: .55; }
    .iw-lane-none { border-left-style: dashed; }
    .iw-lane-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
    .iw-lane-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
    .iw-lane-name { font-size: 14px; font-weight: 700; letter-spacing: -.2px; }
    .iw-lane-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }
    .iw-lane-btn { font-size: 11px; padding: 4px 10px; }
    .iw-lane-draft { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 2px 7px; border-radius: 4px; background: rgba(244,162,97,.14); border: 1px solid rgba(244,162,97,.3); color: var(--yellow); white-space: nowrap; }
    .iw-lane-note { font-size: 12px; color: var(--muted); line-height: 1.5; white-space: pre-wrap; margin-bottom: 9px; padding-left: 17px; }
    .iw-lane-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
    .iw-lane-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-items: start; }
    .iw-lane-notes .iw-note { margin-bottom: 0; transform: none; }
    .iw-lane-notes .iw-note:hover { transform: translateY(-3px); }
    .iw-lane-add { display: flex; align-items: center; justify-content: center; min-height: 62px; border: 2px dashed var(--border); border-radius: 4px; color: var(--dim); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .13s; }
    .iw-lane-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

    /* Kampagnenmarke auf dem Post-it — in der Kampagnen-Ansicht weggelassen,
       dort sagt die Bahn es schon. */
    .iw-note-camp { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; color: rgba(26,27,33,.62); margin: -2px 0 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .iw-note-camp-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.5); }

    .iw-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 8px; vertical-align: middle; }
    .iw-pill { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .4px; }
    .iw-pill.iw-st-idee   { background: rgba(126,134,148,.15); color: var(--muted); }
    .iw-pill.iw-st-arbeit { background: rgba(244,162,97,.15);  color: var(--yellow); }
    .iw-pill.iw-st-bereit { background: rgba(61,202,114,.15);  color: var(--green); }
    .iw-pill.iw-st-planer { background: rgba(91,156,246,.15);  color: var(--blue); }

    .iw-modal-top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
    .iw-cdots { display: flex; gap: 5px; }
    .iw-cdot { width: 18px; height: 18px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: border-color .12s, transform .12s; }
    .iw-cdot:hover { transform: scale(1.15); }
    .iw-cdot.sel { border-color: var(--text); }
    .iw-frow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .iw-chip-ic { font-size: 12px; line-height: 1; }
    .mp-pchip:not(.sel) .iw-chip-ic { opacity: .55; }
    .iw-sub { font-size: 10px; color: var(--dim); margin-top: 4px; }
    .iw-hintbox { background: rgba(91,156,246,.07); border: 1px solid rgba(91,156,246,.2); border-radius: 9px; padding: 10px 12px; font-size: 11.5px; color: #9dbdf5; line-height: 1.5; }
    .iw-linked { background: rgba(61,202,114,.07); border: 1px solid rgba(61,202,114,.2); border-radius: 9px; padding: 10px 12px; font-size: 11.5px; color: #8fd7ab; line-height: 1.5; }
    .iw-linked .link { margin-left: 4px; }

    /* Die vier Status-Spalten bleiben so lange wie möglich nebeneinander —
       zweispaltig zerreißt den Ablauf Idee → In Arbeit → Bereit → Im Planer. */
    @media (max-width: 1400px) { .iw-board { columns: 3; } }
    @media (max-width: 1080px) { .iw-cols { grid-template-columns: repeat(2, 1fr); } }
    @media (max-width: 900px)  { .iw-board { columns: 2; } }
    @media (max-width: 768px) {
      .iw-board { columns: 1; padding: 14px; }
      .iw-cols { grid-template-columns: 1fr; }
      .iw-col { min-height: 0; }
      .iw-hint { display: none; }          /* Drag & Drop gibt es auf Touch nicht */
      .iw-search { max-width: none; }
      .iw-frow { grid-template-columns: 1fr; gap: 0; }
      .iw-seg button { padding: 6px 10px; font-size: 12px; }
    }

    /* ── Gruppenkurse: eigene Namenssuche (statt <datalist>) ── */
    .gc-ac { position: relative; }
    .gc-ac input { width: 100%; box-sizing: border-box; }
    .gc-ac-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 10;
      max-height: 240px; overflow-y: auto; background: var(--card2); border: 1px solid var(--border);
      border-radius: 9px; box-shadow: 0 12px 28px rgba(0,0,0,.5); }
    .gc-ac-item { padding: 8px 11px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--border); }
    .gc-ac-item:last-child { border-bottom: none; }
    .gc-ac-item:hover { background: var(--accent-dim); color: var(--accent); }
    .gc-ac-more { padding: 7px 11px; font-size: 11px; color: var(--dim); }

    /* ── Kurse verwalten / Standorte: Zeilen ── */
    .mc-row { display: flex; align-items: center; gap: 10px; }
    .mc-name { flex: 1; min-width: 0; }
    .mc-meta { font-size: 11px; color: var(--muted); white-space: nowrap; }

    /* ══════════════════════════════════════════════════════════
       Terminübersicht (js/views/team-agenda.js)
       Zwei Darstellungen für den Stundenplan: .ta-week (7 Spalten,
       Desktop) und .ta-days (Tagesblöcke, Mobil). Immer nur eine ist
       sichtbar — umgeschaltet unten in der Mobil-Media-Query.
       ══════════════════════════════════════════════════════════ */
    .ta-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
    .ta-next-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: border-color .13s; min-width: 0; }
    .ta-next-card:hover { border-color: var(--muted); }
    .ta-next-top { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
    .ta-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
    .ta-next-rel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
    .ta-next-date { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
    .ta-next-title { font-size: 13px; font-weight: 600; margin-top: 3px; overflow-wrap: anywhere; }
    .ta-next-meta { font-size: 11px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
    .ta-next-empty { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 12px; color: var(--muted); margin-bottom: 20px; }

    /* Kopfzeile eines Tabs: Zähler links, Aktion rechts */
    .ta-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
    .ta-bar-info { font-size: 12px; color: var(--muted); }
    .ta-filters { display: flex; gap: 6px; flex-wrap: wrap; }

    /* Wochenraster: feste 7 Spalten, minmax(0,…) verhindert, dass ein langer
       Kurstitel die Spalte und damit die Seite aufzieht. */
    .ta-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
    .ta-col { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px; min-width: 0; }
    .ta-col.today { border-color: var(--accent); background: var(--card2); }
    /* flex-wrap statt Wortumbruch: bei „Heute" darf das Badge in die zweite
       Zeile rutschen, der Wochentag aber nie mitten im Wort brechen. */
    .ta-col-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; flex-wrap: wrap; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
    .ta-col-head .badge { padding: 2px 7px; font-size: 10px; }
    .ta-col.today .ta-col-head { color: var(--text); }
    .ta-days { display: none; }

    .ta-slot { background: var(--card2); border: 1px solid var(--border); border-left: 3px solid var(--ta-slot-color, var(--muted)); border-radius: 8px; padding: 8px 10px; margin-bottom: 7px; cursor: pointer; transition: border-color .13s; min-width: 0; }
    .ta-slot:last-child { margin-bottom: 0; }
    .ta-slot:hover { border-color: var(--muted); border-left-color: var(--ta-slot-color, var(--muted)); }
    .ta-slot.running { border-color: var(--accent); border-left-color: var(--ta-slot-color, var(--accent)); }
    .ta-slot.paused { opacity: .45; }
    .ta-slot-time { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .ta-slot-title { font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
    .ta-slot-meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
    .ta-running { font-size: 10px; font-weight: 700; color: var(--accent); }
    .ta-free { border: 1px dashed var(--dim); border-radius: 8px; padding: 12px 8px; text-align: center; font-size: 11px; color: var(--dim); }

    /* Terminkarten (Meetings, Workshops, Events) */
    .ta-list { display: flex; flex-direction: column; gap: 10px; }
    .ta-card { display: flex; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; min-width: 0; }
    /* Vorläufig muss ohne Lesen erkennbar sein: gestrichelte Kante + gedämpft */
    .ta-card.tentative { border-style: dashed; border-color: var(--yellow); opacity: .82; }
    .ta-card.cancelled { opacity: .5; }
    .ta-card.cancelled .ta-card-title { text-decoration: line-through; }
    .ta-card.done { opacity: .6; }
    .ta-chip { flex: 0 0 54px; text-align: center; background: var(--card2); border-radius: 10px; padding: 8px 4px; align-self: flex-start; }
    .ta-chip.span { flex-basis: 74px; }
    .ta-chip .d { display: block; font-size: 19px; font-weight: 700; line-height: 1.1; letter-spacing: -.5px; }
    .ta-chip .m { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
    .ta-chip .w { display: block; font-size: 10px; color: var(--dim); }
    .ta-card-body { min-width: 0; flex: 1; }
    .ta-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .ta-card-title { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
    .ta-card-meta { font-size: 12px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
    .ta-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
    .ta-note { font-size: 12px; color: var(--muted); margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
    .ta-details { margin-top: 8px; }
    .ta-details summary { cursor: pointer; font-size: 11px; color: var(--muted); }
    .ta-mini { font-size: 11px; padding: 4px 9px; }

    /* Filterchips: die Zahl gehört auf den Chip, sonst muss man klicken, um zu
       merken, dass nichts dahinter liegt. */
    .ta-count { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 3px; border-radius: 7px; background: var(--card2); font-size: 10px; font-weight: 700; }
    .btn-ghost.active .ta-count { background: rgba(255,255,255,.14); }
    .ta-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); cursor: pointer; }
    .ta-toggle input { width: auto; margin: 0; cursor: pointer; }
    .ta-card-head .ta-dot { margin-right: 1px; }
    .ta-card-foot { margin-top: 10px; }

    /* Typwähler hinter „+ Termin" */
    .ta-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-top: 6px; }
    .ta-pick-btn { display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; color: var(--text); font-family: inherit; }
    .ta-pick-btn:hover { border-color: var(--accent); }
    .ta-pick-label { font-size: 13px; font-weight: 700; }
    .ta-pick-hint { font-size: 11px; color: var(--muted); }

    /* ── Terminübersicht: Kalender ──
       Optik bewusst wie der große Kalender (.cal-*), eigene Klassen, weil hier
       Termine und Kurse statt Sessions und Umsätzen in den Zellen stehen. */
    .ta-cal-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
    .ta-cal-label { font-size: 14px; font-weight: 600; min-width: 165px; text-align: center; }
    .ta-cal-head .ta-bar-info { margin-left: auto; }
    .ta-cal-wrap { overflow-x: auto; margin-bottom: 12px; }
    .ta-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-width: 700px; }
    .ta-cal-dow { background: var(--surface); text-align: center; padding: 10px 4px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
    .ta-cal-day { background: var(--card); min-height: 96px; padding: 8px 7px; min-width: 0; }
    .ta-cal-day.today { background: rgba(230,57,70,.06); }
    .ta-cal-day.other-month { background: var(--surface); }
    .ta-cal-day.other-month .ta-cal-num { opacity: .25; }
    .ta-cal-num { font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
    .ta-cal-day.today .ta-cal-num { color: #fff; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 10px; margin-bottom: 5px; }
    .ta-cal-chip { margin-bottom: 3px; padding: 4px 6px; border-radius: 5px; font-size: 10px; line-height: 1.3; cursor: pointer; background: var(--card2); border-left: 3px solid var(--ta-chip-color, var(--muted)); overflow-wrap: anywhere; transition: filter .1s; }
    .ta-cal-chip:hover { filter: brightness(1.25); }
    .ta-cal-chip .t { font-weight: 700; color: var(--muted); }
    .ta-cal-chip.tentative { border-left-style: dashed; opacity: .8; }
    .ta-cal-chip.cancelled { opacity: .45; text-decoration: line-through; }
    .ta-cal-more { font-size: 10px; color: var(--muted); cursor: pointer; padding: 2px 4px; }
    .ta-cal-more:hover { color: var(--text); }
    .ta-cal-mobile { display: none; }

    /* ── Terminübersicht: Agenda-Tagesblöcke ── */
    .ta-agenda { display: flex; flex-direction: column; gap: 10px; }
    .ta-ag-day { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
    .ta-ag-day.today { border-color: var(--accent); }
    .ta-ag-date { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
    .ta-ag-day.today .ta-ag-date { color: var(--accent); }
    .ta-ag-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 7px 0; border-top: 1px solid var(--border); cursor: pointer; min-width: 0; }
    .ta-ag-row:first-of-type { border-top: none; }
    .ta-ag-row:hover .ta-ag-title { color: var(--accent); }
    .ta-ag-row.cancelled { opacity: .5; }
    .ta-ag-row.cancelled .ta-ag-title { text-decoration: line-through; }
    .ta-ag-time { font-size: 11.5px; font-weight: 700; color: var(--muted); flex: 0 0 auto; min-width: 88px; }
    .ta-ag-title { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
    .ta-ag-kurs { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--dim); }
    .ta-ag-meta { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }

    /* ── Aufgaben (To-do-Liste, js/views/todos.js) ── */
    .tdo-quick { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
    .tdo-quick .inline-edit { flex: 1 1 320px; min-width: 0; }

    .tdo-pbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
    .tdo-pbar-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 20px; border: 1px solid var(--border); cursor: pointer; user-select: none; transition: all .12s; }
    .tdo-pbar-chip:hover { border-color: var(--muted); }
    .tdo-pbar-chip.sel { border-color: var(--accent); background: var(--accent-dim); }
    .tdo-pbar-name { font-size: 11.5px; font-weight: 600; color: var(--muted); }
    .tdo-pbar-chip.sel .tdo-pbar-name { color: var(--text); }
    .tdo-pbar-count { font-size: 11px; font-weight: 700; color: var(--text); background: rgba(255,255,255,.07); border-radius: 10px; padding: 1px 7px; }

    .tdo-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
    .tdo-chips { display: flex; gap: 6px; flex-wrap: wrap; }
    .tdo-chips .btn { font-size: 12px; padding: 6px 12px; }
    .tdo-selects { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
    .tdo-selects .inline-edit { flex: 1 1 260px; min-width: 0; }
    .tdo-selects select { flex: 0 1 auto; }

    .tdo-listhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
    .tdo-listhead .link { text-transform: none; letter-spacing: 0; font-weight: 600; }
    .tdo-none { font-size: 12.5px; color: var(--muted); padding: 18px 2px; text-align: center; }
    .tdo-none .link { margin-left: 6px; }

    .tdo-list { display: flex; flex-direction: column; }
    .tdo-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--border); border-radius: 8px; cursor: pointer; min-width: 0; }
    .tdo-row:last-child { border-bottom: none; }
    .tdo-row:hover { background: rgba(255,255,255,.04); }
    .tdo-row.done { opacity: .5; }
    .tdo-check { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; color: var(--muted); background: rgba(255,255,255,.05); }
    .tdo-check:hover { background: var(--green); color: #fff; }
    .tdo-prio { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
    .tdo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
    .tdo-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tdo-row.done .tdo-title { text-decoration: line-through; }
    .tdo-sub { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tdo-people { display: flex; gap: 2px; flex-shrink: 0; }
    .tdo-due { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; flex-shrink: 0; text-align: right; display: flex; flex-direction: column; gap: 1px; }
    .tdo-due.overdue { color: var(--accent); }
    .tdo-due.undated { font-weight: 400; font-style: italic; color: var(--dim); }
    .tdo-rel { font-size: 10px; font-weight: 500; opacity: .8; }

    .tdo-cmts { display: flex; flex-direction: column; gap: 8px; max-height: 34vh; overflow-y: auto; margin-bottom: 10px; }
    .tdo-cmt { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; }
    .tdo-cmt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
    .tdo-cmt-who { font-size: 11px; font-weight: 700; }
    .tdo-cmt-at { font-size: 10px; color: var(--dim); flex: 1; }
    .tdo-cmt-del { font-size: 11px; color: var(--dim); cursor: pointer; }
    .tdo-cmt-del:hover { color: var(--accent); }
    .tdo-cmt-text { font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
    .tdo-cmt-hint { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
    .mp-field textarea.tdo-cmt-input { min-height: 60px; }
    .tdo-meta { font-size: 10px; color: var(--dim); margin-top: 10px; text-align: right; }

    .ta-past { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 12px; }
    .ta-past-toggle { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
    .ta-past-toggle:hover { color: var(--text); }

    /* ══════════════════════════════════════════════════════════
       Mobil — gilt für alle Views. Grundregel: nichts scrollt
       horizontal außer breiten Tabellen (die dafür .table-wrap
       haben) und den Tab-Leisten.
       ══════════════════════════════════════════════════════════ */
    @media (max-width: 768px) {
      /* mehrspaltige Layouts untereinander statt gequetscht */
      .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
      .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
      .stats-grid.cols-2, .stats-grid.cols-3, .stats-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .stats-grid.ev-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .stat-card { padding: 13px 14px; }
      .stat-card .value, .stats-grid.ev-stats .value { font-size: 21px; }
      .stat-card .label { font-size: 10px; letter-spacing: .4px; margin-bottom: 6px; }
      .stat-card .sub { font-size: 10px; }

      .card { padding: 15px 14px; border-radius: 11px; }
      .page-header { margin-bottom: 16px; }
      .page-header h2 { font-size: 19px; }
      .page-header p { font-size: 12px; }

      /* Tab-Leisten: horizontal wischen statt umbrechen */
      .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
      .tabs::-webkit-scrollbar { display: none; }
      .tab { flex: 0 0 auto; white-space: nowrap; padding: 9px 12px; }

      /* Tabellen: kompakter, weiterhin horizontal scrollbar */
      .table-wrap { -webkit-overflow-scrolling: touch; }
      th { padding: 8px 10px; font-size: 10px; }
      td { padding: 8px 10px; font-size: 12.5px; }

      /* 16px verhindert das Auto-Zoom von iOS beim Fokussieren */
      select, input[type="text"], input[type="number"], input[type="date"], input[type="month"], input[type="time"], textarea { font-size: 16px; }
      /* .inline-edit ist spezifischer als das nackte textarea oben und würde sonst gewinnen */
      textarea.inline-edit { font-size: 16px; }
      /* … außer in Tabellen, dort würde 16px die Spalten sprengen */
      td select, td input[type="text"], td input[type="number"], td input[type="date"], td input[type="month"], td input[type="time"] { font-size: 13px; }
      .btn { padding: 9px 14px; }
      .controls { gap: 8px; margin-bottom: 14px; }

      /* Datumsfilter: beide Felder nebeneinander statt eines pro Zeile */
      .date-range-bar { gap: 6px; padding: 10px 12px; }
      .date-range-bar input[type="date"] { flex: 1 1 120px; min-width: 0; padding: 7px 6px; }
      .date-pair { flex: 1 1 100%; gap: 6px; }
      .date-pair input[type="date"] { flex: 1 1 0; min-width: 0; padding: 7px 6px; }

      .chart-wrap { height: 220px; }
      .upload-zone { padding: 34px 18px; }
      .upload-zone .icon { font-size: 38px; }
      .empty { padding: 48px 18px; }
      .empty .icon { font-size: 44px; }
      .toast { left: 12px; right: 12px; bottom: 12px; text-align: center; }
      .scroll-box { max-height: 45vh; }

      /* Kurse verwalten: Name in die erste Zeile, Rest darunter */
      .mc-row { flex-wrap: wrap; }
      .mc-name { flex: 1 1 100%; }
      .mc-meta { white-space: normal; flex: 1 1 auto; }
      .mc-loc { flex: 1 1 100%; max-width: none !important; }
      .mc-panel { flex-wrap: wrap; }

      /* ── Terminübersicht ── */
      /* 7 Spalten wären bei 375px je 40px breit — deshalb wechselt der
         Stundenplan hier komplett auf Tagesblöcke. */
      .ta-week { display: none; }
      .ta-days { display: flex; flex-direction: column; gap: 8px; }
      .ta-day { background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; }
      .ta-day.today { border-color: var(--accent); background: var(--card2); }
      .ta-day-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
      .ta-day-count { color: var(--muted); font-weight: 600; font-size: 11px; }
      .ta-caret { color: var(--dim); }
      .ta-day .ta-slot, .ta-day .ta-free { margin-top: 8px; margin-bottom: 0; }

      .ta-next { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 14px; }
      .ta-next-card { padding: 12px 14px; }
      .ta-next-date { font-size: 15px; }
      .ta-card { padding: 12px 13px; gap: 11px; }
      .ta-chip { flex-basis: 46px; padding: 7px 3px; }
      .ta-chip.span { flex-basis: 62px; }
      .ta-chip .d { font-size: 17px; }
      .ta-bar { gap: 8px; }
      .ta-bar .btn-primary { flex: 1 1 100%; }
      .ta-filters { width: 100%; }
      .ta-filters .btn { flex: 1 1 auto; }
      /* Sieben Spalten mit Titeln sind bei 375px nicht lesbar — der
         Kalender-Tab zeigt hier dieselbe Tagesliste wie die Agenda,
         begrenzt auf den gewählten Monat. */
      .ta-cal-wrap { display: none; }
      .ta-cal-mobile { display: block; }
      .ta-cal-head { justify-content: center; }
      .ta-cal-label { min-width: 0; flex: 1; font-size: 13px; }
      .ta-cal-head .ta-bar-info { margin-left: 0; width: 100%; text-align: center; }
      .ta-ag-time { min-width: 0; }
      .ta-ag-row { gap: 7px; padding: 8px 0; }
      .ta-pick { grid-template-columns: minmax(0, 1fr); }
      .tdo-quick .btn { flex: 1 1 auto; }
      .tdo-chips .btn { flex: 1 1 auto; }
      .tdo-selects { gap: 6px; }
      .tdo-selects .inline-edit, .tdo-selects select { flex: 1 1 100%; }
      /* Auf dem Telefon steht die Fälligkeit unter dem Titel statt rechts
         daneben — sonst bleiben vom Titel drei Zeichen übrig. */
      .tdo-row { flex-wrap: wrap; gap: 8px; padding: 11px 4px; }
      .tdo-main { flex: 1 1 auto; }
      .tdo-due { flex-direction: row; gap: 6px; align-items: baseline; margin-left: 39px; text-align: left; }
      .tdo-people { margin-left: auto; }
      .ta-bar .mp-seg { width: 100%; }
      .ta-bar .mp-seg span { flex: 1; text-align: center; padding: 7px 6px; }
    }
