/* LernGrid Web-UI — Design Tokens + Component CSS (Sprint 10) */
/* Extrahiert aus lerngrid_gui_mockup_phase_b.html. Mockup-Nav entfernt. */


    :root {
      --primary:    #1e3a5f;
      --primary-lt: #e8f0f8;
      --accent:     #2563a8;
      --accent2:    #f0a500;
      --dark:       #1a2332;
      --mid:        #4a5568;
      --light:      #f7f9fc;
      --white:      #ffffff;
      --border:     #e2e8f0;

      --g-bg: #e8f0f8;  --g-fg: #1e5fa8;
      --s-bg: #e6f5f2;  --s-fg: #1a7a6e;
      --e-bg: #faf3e0;  --e-fg: #b07d10;

      --status-red-bg:    #fef2f2;  --status-red-fg:    #991b1b;
      --status-amber-bg:  #fef3c7;  --status-amber-fg:  #92400e;
      --status-green-bg:  #ecfdf5;  --status-green-fg:  #065f46;

      --human-bg: #fef3c7;  --human-fg: #92400e;

      --radius: 12px;
      --shadow: 0 2px 12px rgba(0,0,0,0.06);
      --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }
    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
      color: var(--dark);
      background: var(--light);
      line-height: 1.65;
      font-size: 14px;
    }

    

    /* ── APP-HEADER (das eigentliche LernGrid-GUI) ── */
    .app-header {
      background: var(--primary);
      color: white;
      padding: 0 1.5rem;
      height: 56px;
      display: flex; align-items: center; gap: 1.5rem;
      position: sticky; top: 0; z-index: 100;
      box-shadow: 0 1px 0 rgba(0,0,0,0.1);
    }
    .app-logo {
      font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em;
      display: flex; align-items: center; gap: 0.5rem;
    }
    .app-logo-mark {
      display: inline-block; width: 22px; height: 22px;
      background: linear-gradient(135deg, var(--accent2), #f97316);
      border-radius: 5px;
    }
    .app-mode-toggle {
      margin-left: auto;
      display: inline-flex; align-items: center;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.15);
      border-radius: 999px;
      padding: 3px;
      font-size: 0.72rem;
      font-weight: 600;
    }
    .app-mode-segment {
      padding: 0.3rem 0.85rem;
      border-radius: 999px;
      color: rgba(255,255,255,0.65);
      cursor: pointer;
      transition: all 0.15s;
    }
    .app-mode-segment.active {
      background: var(--accent2);
      color: var(--dark);
    }

    /* ── APP-MAIN (Container für den Stream) ── */
    .app-main {
      max-width: 760px;
      margin: 0 auto;
      padding: 2rem 1.5rem 5rem;
    }
    .app-main.wide {
      max-width: 1100px;
    }

    /* ── REISE-VORSCHAU (Leerzustand) ── */
    .reise-vorschau {
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 1.5rem 1.75rem;
      margin-bottom: 1.5rem;
      box-shadow: var(--shadow);
    }
    .reise-vorschau-label {
      font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
      text-transform: uppercase; color: var(--accent);
      margin-bottom: 0.25rem;
    }
    .reise-vorschau-title {
      font-size: 0.95rem; font-weight: 700; color: var(--dark);
      margin-bottom: 1.1rem;
    }
    .reise-stationen {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      gap: 0;
      align-items: start;
      position: relative;
    }
    .reise-station {
      display: flex; flex-direction: column; align-items: center;
      gap: 0.4rem;
      text-align: center;
      position: relative;
    }
    .reise-station::before {
      content: '';
      position: absolute;
      top: 11px; left: 50%; right: -50%;
      height: 2px;
      background: var(--border);
      z-index: 0;
    }
    .reise-station:last-child::before { display: none; }
    .reise-dot {
      width: 24px; height: 24px;
      border-radius: 50%;
      background: var(--primary-lt);
      border: 2px solid white;
      box-shadow: 0 0 0 1px var(--border);
      display: flex; align-items: center; justify-content: center;
      font-size: 0.65rem; font-weight: 700;
      color: var(--primary);
      position: relative;
      z-index: 1;
    }
    .reise-dot.human { background: var(--human-bg); color: var(--human-fg); box-shadow: 0 0 0 1px var(--human-fg); }
    .reise-label {
      font-size: 0.68rem; font-weight: 600; color: var(--mid);
      line-height: 1.3;
      max-width: 90px;
    }

    /* ── STATUSBALKEN (aktiver Stream) ── */
    .statusbalken {
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 0.85rem 1.25rem;
      margin-bottom: 1.5rem;
      display: flex; align-items: center; gap: 1rem;
      box-shadow: var(--shadow);
      position: sticky; top: 72px; z-index: 50;
    }
    .statusbalken-titel {
      font-size: 0.78rem; font-weight: 700; color: var(--dark);
      flex-shrink: 0;
      max-width: 180px;
      line-height: 1.3;
    }
    .statusbalken-titel small {
      display: block; font-weight: 500; color: var(--mid); font-size: 0.7rem;
    }
    .statusbalken-stationen {
      display: grid; grid-template-columns: repeat(6, 1fr);
      flex: 1;
      gap: 0;
      align-items: center;
      position: relative;
    }
    .statusbalken-station {
      display: flex; flex-direction: column; align-items: center;
      gap: 0.25rem;
      position: relative;
    }
    .statusbalken-station::before {
      content: '';
      position: absolute;
      top: 9px; left: 50%; right: -50%;
      height: 2px;
      background: var(--border);
      z-index: 0;
    }
    .statusbalken-station:last-child::before { display: none; }
    .statusbalken-station.done::before { background: var(--primary); }
    .statusbalken-dot {
      width: 18px; height: 18px;
      border-radius: 50%;
      background: var(--border);
      position: relative; z-index: 1;
      border: 2px solid white;
      box-shadow: 0 0 0 1px var(--border);
    }
    .statusbalken-station.done .statusbalken-dot {
      background: var(--primary); box-shadow: 0 0 0 1px var(--primary);
    }
    .statusbalken-station.active .statusbalken-dot {
      background: var(--accent2); box-shadow: 0 0 0 1px var(--accent2);
      animation: pulse 1.6s ease-in-out infinite;
    }
    .statusbalken-station.checkpoint .statusbalken-dot {
      background: var(--human-bg); box-shadow: 0 0 0 2px var(--human-fg);
      animation: pulse-amber 1.6s ease-in-out infinite;
    }
    @keyframes pulse {
      0%,100% { box-shadow: 0 0 0 1px var(--accent2); }
      50% { box-shadow: 0 0 0 5px rgba(240,165,0,0.25); }
    }
    @keyframes pulse-amber {
      0%,100% { box-shadow: 0 0 0 2px var(--human-fg); }
      50% { box-shadow: 0 0 0 6px rgba(146,64,14,0.18); }
    }
    .statusbalken-mini {
      font-size: 0.62rem; font-weight: 600; color: var(--mid);
      line-height: 1.2; text-align: center;
      max-width: 80px;
    }

    /* ── UPLOAD-KARTE ── */
    .upload-card {
      background: white;
      border: 2px dashed var(--border);
      border-radius: var(--radius);
      padding: 3rem 2rem;
      text-align: center;
      transition: border-color 0.2s, background 0.2s;
    }
    .upload-card:hover { border-color: var(--accent); background: #fafbfd; }
    .upload-icon {
      font-size: 2.2rem; margin-bottom: 0.75rem; display: block;
    }
    .upload-title {
      font-size: 1.05rem; font-weight: 700; color: var(--dark); margin-bottom: 0.4rem;
    }
    .upload-sub {
      font-size: 0.85rem; color: var(--mid); margin-bottom: 1.5rem;
    }
    .btn-primary {
      display: inline-flex; align-items: center; gap: 0.45rem;
      background: var(--accent2); color: var(--dark);
      font-weight: 700; font-size: 0.85rem;
      padding: 0.7rem 1.6rem;
      border-radius: 999px;
      text-decoration: none;
      border: none; cursor: pointer;
      box-shadow: 0 2px 12px rgba(240,165,0,0.3);
      transition: transform 0.15s, box-shadow 0.15s;
    }
    .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(240,165,0,0.4); }
    .btn-secondary {
      display: inline-flex; align-items: center; gap: 0.4rem;
      background: white; color: var(--accent);
      font-weight: 600; font-size: 0.82rem;
      padding: 0.65rem 1.2rem;
      border-radius: 999px;
      border: 1px solid var(--border);
      text-decoration: none; cursor: pointer;
      transition: border-color 0.15s;
      margin-left: 0.5rem;
    }
    .btn-secondary:hover { border-color: var(--accent); }
    .btn-disabled {
      display: inline-flex; align-items: center; gap: 0.45rem;
      background: var(--border); color: var(--mid);
      font-weight: 700; font-size: 0.85rem;
      padding: 0.7rem 1.6rem;
      border-radius: 999px;
      border: none; cursor: not-allowed;
    }
    .upload-help {
      font-size: 0.78rem; color: var(--mid);
      margin-top: 1.75rem;
      max-width: 460px; margin-left: auto; margin-right: auto;
      line-height: 1.6;
    }

    /* ── STREAM-STEPS ── */
    .stream {
      display: flex; flex-direction: column;
    }
    .stream-step {
      display: grid;
      grid-template-columns: 32px 1fr;
      gap: 1rem;
      position: relative;
      padding-bottom: 1.5rem;
    }
    .stream-step:not(:last-child)::before {
      content: '';
      position: absolute;
      left: 15px; top: 32px; bottom: 0;
      width: 2px; background: var(--border);
    }
    .stream-step.done:not(:last-child)::before {
      background: var(--primary);
    }
    .stream-dot {
      width: 32px; height: 32px;
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 0.78rem; font-weight: 700;
      flex-shrink: 0;
      position: relative; z-index: 1;
      background: var(--border);
      color: var(--mid);
      border: 2px solid var(--light);
    }
    .stream-step.done .stream-dot { background: var(--primary); color: white; }
    .stream-step.active .stream-dot {
      background: var(--primary-lt); color: var(--primary);
      box-shadow: 0 0 0 3px rgba(30,58,95,0.12);
      animation: pulse-marine 1.8s ease-in-out infinite;
    }
    @keyframes pulse-marine {
      0%,100% { box-shadow: 0 0 0 3px rgba(30,58,95,0.12); }
      50% { box-shadow: 0 0 0 7px rgba(30,58,95,0.06); }
    }
    .stream-step.checkpoint .stream-dot {
      background: var(--human-bg); color: var(--human-fg);
    }
    .stream-step.waiting { opacity: 0.35; }
    .stream-step.ready .stream-dot {
      background: white;
      border: 2px solid var(--primary);
      color: var(--primary);
    }
    .stream-step.ready:not(:last-child)::before { background: var(--border); }

    .stream-card {
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 1.1rem 1.35rem;
      box-shadow: var(--shadow);
      flex: 1;
    }
    .stream-step.active .stream-card { background: var(--primary-lt); border-color: rgba(30,58,95,0.18); }
    .stream-step.checkpoint .stream-card {
      border-left: 4px solid var(--human-fg);
      background: #fffdf6;
    }
    .stream-step.waiting .stream-card { background: var(--light); box-shadow: none; }

    .stream-card-meta {
      font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em;
      text-transform: uppercase; color: var(--accent);
      margin-bottom: 0.15rem;
    }
    .stream-step.checkpoint .stream-card-meta { color: var(--human-fg); }
    .stream-card h2 {
      font-size: 1.02rem; font-weight: 700; color: var(--dark);
      line-height: 1.3; margin-bottom: 0.4rem;
    }
    .stream-card p.lead {
      font-size: 0.86rem; color: var(--mid); line-height: 1.55;
      margin-bottom: 0.75rem;
    }
    .stream-card .summary {
      font-size: 0.82rem; color: var(--mid);
      padding: 0.6rem 0.85rem;
      background: var(--light);
      border-radius: 8px;
      border: 1px solid var(--border);
      display: flex; align-items: center; gap: 0.6rem;
      margin-top: 0.5rem;
    }
    .stream-card .summary-icon { color: var(--accent); flex-shrink: 0; }

    /* ── LESE-HÄPPCHEN ── */
    .haeppchen-grid {
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
      margin-top: 0.6rem;
    }
    .haeppchen {
      background: white;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 0.6rem 0.8rem;
      font-size: 0.78rem;
      animation: fadeIn 0.4s ease both;
    }
    .haeppchen-title { font-weight: 700; color: var(--dark); margin-bottom: 0.15rem; }
    .haeppchen-desc { color: var(--mid); font-size: 0.74rem; line-height: 1.45; }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

    /* ── EINZEILER-INTERFACE (Lehrperson-Fortschritt) ── */
    .einzeiler-wrapper {
      margin-top: 0.85rem;
      padding: 0.6rem 0.95rem;
      background: var(--primary-lt);
      border-radius: 8px;
      border-left: 3px solid var(--accent);
      min-height: 2.4rem;
      display: flex;
      align-items: center;
    }
    .einzeiler-text {
      font-size: 0.82rem;
      color: var(--accent);
      font-weight: 500;
      letter-spacing: 0.01em;
      white-space: pre;
      font-variant-numeric: tabular-nums;
    }

    /* ── KOMPETENZ-KARTE (im Checkpoint 2) ── */
    .kompetenz-list {
      display: flex; flex-direction: column; gap: 0.85rem;
      margin: 0.85rem 0 1.1rem;
    }
    .kompetenz-card {
      background: white;
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
    }
    .kompetenz-header {
      background: #fafbfd;
      padding: 0.65rem 0.95rem;
      display: flex; align-items: center; justify-content: space-between;
      gap: 0.5rem;
      border-bottom: 1px solid var(--border);
    }
    .kompetenz-title {
      font-size: 0.86rem; font-weight: 700; color: var(--dark);
      line-height: 1.35;
    }
    .kompetenz-edit-btn {
      background: none; border: 1px solid var(--border);
      color: var(--mid); font-size: 0.7rem; font-weight: 600;
      padding: 0.2rem 0.55rem; border-radius: 6px; cursor: pointer;
      flex-shrink: 0;
    }
    .kompetenz-edit-btn:hover { border-color: var(--accent); color: var(--accent); }
    .niveau-row {
      display: grid; grid-template-columns: 78px 1fr;
      border-top: 1px solid var(--border);
    }
    .niveau-row:first-of-type { border-top: none; }
    .niveau-badge {
      padding: 0.65rem 0.6rem 0.65rem 0.85rem;
      display: flex; align-items: flex-start;
    }
    .n-pill {
      display: inline-block; font-size: 0.66rem; font-weight: 700;
      padding: 0.15rem 0.55rem; border-radius: 999px;
    }
    .n-pill-g { background: var(--g-bg); color: var(--g-fg); }
    .n-pill-s { background: var(--s-bg); color: var(--s-fg); }
    .n-pill-e { background: var(--e-bg); color: var(--e-fg); }
    .niveau-text {
      padding: 0.6rem 0.9rem 0.6rem 0;
      font-size: 0.78rem; color: var(--dark); line-height: 1.5;
      font-style: italic;
    }

    /* ── CHECKPOINT-AKTIONEN ── */
    .checkpoint-actions {
      display: flex; gap: 0.6rem; align-items: center;
      padding-top: 0.5rem; border-top: 1px dashed var(--border);
      margin-top: 0.5rem;
    }
    .checkpoint-actions .hint {
      font-size: 0.72rem; color: var(--mid); margin-left: auto;
    }

    /* ── METADATEN-FORM (Checkpoint 1, in Screen 2 nicht gezeigt aber hier definiert) ── */
    .meta-form {
      display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem;
      margin: 0.7rem 0 0.85rem;
    }
    .meta-field { display: flex; flex-direction: column; gap: 0.25rem; }
    .meta-label { font-size: 0.7rem; font-weight: 600; color: var(--mid); }
    .meta-input {
      font-family: inherit; font-size: 0.84rem;
      padding: 0.5rem 0.7rem;
      border: 1px solid var(--border); border-radius: 7px;
      background: white;
    }

    /* ── LERNGRID-MATRIX ── */
    .lerngrid-section {
      margin-top: 1rem;
    }
    .lerngrid-header {
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius) var(--radius) 0 0;
      padding: 1.25rem 1.5rem;
      display: flex; align-items: center; justify-content: space-between;
      gap: 1rem;
    }
    .lerngrid-header-info h3 {
      font-size: 1.1rem; font-weight: 700; color: var(--dark);
      margin-bottom: 0.2rem;
    }
    .lerngrid-header-meta {
      font-size: 0.75rem; color: var(--mid);
      display: flex; gap: 1rem; flex-wrap: wrap;
    }
    .lerngrid-header-meta span strong { color: var(--dark); }
    .lerngrid-header-stats {
      display: flex; gap: 0.4rem;
    }
    .stat-pill {
      display: inline-flex; align-items: center; gap: 0.3rem;
      font-size: 0.72rem; font-weight: 700;
      padding: 0.3rem 0.65rem;
      border-radius: 999px;
    }
    .stat-pill.red { background: var(--status-red-bg); color: var(--status-red-fg); }
    .stat-pill.amber { background: var(--status-amber-bg); color: var(--status-amber-fg); }
    .stat-pill.green { background: var(--status-green-bg); color: var(--status-green-fg); }

    .lerngrid-matrix {
      background: white;
      border: 1px solid var(--border);
      border-top: none;
      border-radius: 0 0 var(--radius) var(--radius);
      overflow: hidden;
    }
    .matrix-header {
      display: grid; grid-template-columns: 220px 1fr 1fr 1fr;
      background: #fafbfd;
      border-bottom: 1px solid var(--border);
    }
    .matrix-header-cell {
      padding: 0.7rem 1rem;
      font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
      text-transform: uppercase; color: var(--mid);
    }
    .matrix-header-cell:not(:first-child) {
      border-left: 1px solid var(--border);
      text-align: center;
    }
    .matrix-row {
      display: grid; grid-template-columns: 220px 1fr 1fr 1fr;
      border-top: 1px solid var(--border);
    }
    .matrix-row:first-of-type { border-top: none; }
    .matrix-kompetenz {
      padding: 0.85rem 1rem;
      font-size: 0.82rem; font-weight: 600; color: var(--dark);
      line-height: 1.4;
      background: #fafbfd;
      display: flex; align-items: center; gap: 0.5rem;
    }
    .matrix-kompetenz-edit {
      flex-shrink: 0;
      background: none; border: none; color: var(--mid);
      font-size: 0.85rem; cursor: pointer;
      padding: 0.15rem 0.3rem; border-radius: 4px;
    }
    .matrix-kompetenz-edit:hover { background: var(--border); color: var(--accent); }
    .matrix-cell {
      padding: 0.75rem 0.9rem;
      border-left: 1px solid var(--border);
      cursor: pointer;
      transition: background 0.15s;
      display: flex; flex-direction: column; gap: 0.35rem;
    }
    .matrix-cell:hover { background: #f7f9fc; }
    .matrix-cell-header {
      display: flex; align-items: center; gap: 0.4rem;
    }
    .status-icon {
      width: 12px; height: 12px; border-radius: 50%;
      flex-shrink: 0;
    }
    .status-icon.red { background: #ef4444; }
    .status-icon.amber { background: #f59e0b; }
    .status-icon.green { background: #10b981; }
    .matrix-cell-pill { font-size: 0.62rem; }
    .matrix-cell-title {
      font-size: 0.76rem; color: var(--dark); line-height: 1.4;
      font-weight: 500;
    }
    .matrix-cell.empty .matrix-cell-title {
      color: var(--mid); font-style: italic;
    }

    .lerngrid-footer {
      background: #fafbfd;
      border: 1px solid var(--border);
      border-top: none;
      border-radius: 0 0 var(--radius) var(--radius);
      padding: 1rem 1.5rem;
      display: flex; align-items: center; justify-content: space-between;
      margin-top: -1px;
    }
    .lerngrid-footer-hint {
      font-size: 0.78rem; color: var(--mid);
    }

    /* ── EXPORT-BEREICH (Sprint 13) ── */
    .export-bereich {
      padding: 1.25rem 1.5rem;
      border-top: 1px solid var(--border);
    }
    .export-karten {
      display: flex; flex-wrap: wrap; gap: 1rem;
      margin-top: 0.75rem;
    }
    .export-karte {
      flex: 1 1 100%;
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    .export-karte-inhalt {
      padding: 1.1rem 1.35rem;
    }
    .export-karte-titel {
      font-size: 1rem; font-weight: 700; color: var(--dark);
      margin-bottom: 0.3rem;
    }
    .export-karte-desc {
      font-size: 0.82rem; color: var(--mid); line-height: 1.5;
      margin-bottom: 1rem;
    }
    .export-karte-actions {
      display: flex; align-items: center; gap: 0.75rem;
      margin-bottom: 0.85rem;
    }
    .export-template-pille {
      display: inline-flex; align-items: center;
      font-size: 0.78rem; font-weight: 600;
      padding: 0.4rem 0.85rem;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: white; color: var(--mid);
    }
    .export-template-pille.disabled {
      opacity: 0.5; cursor: not-allowed;
    }
    .export-download-btn {
      text-decoration: none;
    }
    .export-template-menu {
      display: flex; flex-wrap: wrap; gap: 0.4rem;
      padding-top: 0.6rem;
      border-top: 1px solid var(--border);
    }
    .export-menu-item {
      font-family: inherit;
      font-size: 0.74rem; font-weight: 500;
      color: var(--mid);
      background: none; border: 1px solid var(--border);
      border-radius: 6px;
      padding: 0.3rem 0.7rem;
      cursor: pointer;
      transition: border-color 0.15s, color 0.15s;
    }
    .export-menu-item:hover:not(:disabled) {
      border-color: var(--accent); color: var(--accent);
    }
    .export-menu-item.disabled {
      opacity: 0.5; cursor: not-allowed;
    }
    .export-leer {
      font-size: 0.82rem; color: var(--mid); padding: 1rem 0;
    }

    /* ── COMPLETED STREAM-CARD (kompakt eingeklappt für Screen 3) ── */
    .stream-card.compact {
      padding: 0.7rem 1rem;
      background: white;
    }
    .stream-card.compact h2 {
      font-size: 0.85rem; margin-bottom: 0;
      display: flex; align-items: center; gap: 0.5rem;
    }
    .stream-card.compact .badge-done {
      font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em;
      color: var(--status-green-fg);
      background: var(--status-green-bg);
      padding: 0.1rem 0.5rem; border-radius: 999px;
      text-transform: uppercase;
    }

    /* ── SECTION-SEPARATOR (zwischen Mockup-Screens) ── */
    .screen-separator {
      background: var(--dark);
      color: rgba(255,255,255,0.6);
      padding: 1rem 2rem;
      text-align: center;
      font-size: 0.75rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      font-weight: 700;
      border-top: 4px solid var(--accent2);
    }

    /* ── UTILS ── */
    .stream-step.expanded .stream-card { padding-bottom: 1rem; }
    .pulse-text {
      display: inline-block;
      animation: textpulse 1.4s ease-in-out infinite;
      color: var(--mid); font-size: 0.78rem;
    }
    @keyframes textpulse {
      0%,100% { opacity: 0.55; }
      50% { opacity: 1; }
    }
    .running-indicator {
      display: inline-flex; align-items: center; gap: 0.4rem;
      font-size: 0.75rem; font-weight: 600; color: var(--primary);
      margin-top: 0.2rem;
    }
    .spinner {
      width: 12px; height: 12px;
      border: 2px solid var(--primary-lt);
      border-top-color: var(--primary);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ══════════════════════════════════════════════════════════════
       VALIDIERUNGS-CHECKPOINTS (inline in done-Step-Karten)
       ══════════════════════════════════════════════════════════════ */

    /* Bestätigt: kompakte Textzeile */
    .cp-confirmed {
      display: flex; align-items: center; gap: 0.5rem;
      margin-top: 0.5rem;
      padding: 0.55rem 0.85rem;
      background: var(--status-green-bg);
      border-left: 3px solid #10b981;
      border-radius: 0 7px 7px 0;
      font-size: 0.8rem; color: var(--dark);
    }
    .cp-confirmed-icon { color: #10b981; font-weight: 700; }

    /* Noch offen: Formular-Wrapper */
    .cp-form-wrapper {
      margin-top: 0.75rem;
      border: 1.5px solid var(--status-amber-bg);
      border-left: 3px solid #f59e0b;
      border-radius: 0 8px 8px 0;
      background: #fffdf5;
      padding: 0.85rem 1rem;
    }
    .cp-form-header {
      font-size: 0.82rem; color: var(--dark);
      margin-bottom: 0.75rem; line-height: 1.4;
    }
    .cp-stop-icon { margin-right: 0.35rem; }

    /* Meta-Felder */
    .cp-fields {
      display: grid; grid-template-columns: 1fr 1fr;
      gap: 0.5rem 0.75rem;
      margin-bottom: 0.75rem;
    }
    .cp-label {
      display: flex; flex-direction: column; gap: 0.25rem;
      font-size: 0.7rem; font-weight: 600; color: var(--mid);
    }
    .cp-input {
      font-family: inherit; font-size: 0.82rem; color: var(--dark);
      padding: 0.4rem 0.6rem;
      border: 1px solid var(--border); border-radius: 6px;
      background: white;
      transition: border-color 0.15s;
    }
    .cp-input:focus { outline: none; border-color: var(--accent); }
    select.cp-input {
      appearance: none; -webkit-appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 0.6rem center;
      padding-right: 2rem;
      cursor: pointer;
    }

    /* Kompetenzen-ID-Badge (confirmed + edit-header) */
    .cp-komp-id {
      font-size: 0.65rem; font-weight: 700; color: var(--accent);
      text-transform: uppercase; letter-spacing: 0.04em;
      flex-shrink: 0;
    }

    /* ── KOMPETENZ-EDIT-FORMULAR ── */
    .cp-edit-kompetenz {
      background: var(--light);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 0.8rem 0.95rem;
      margin-bottom: 0.7rem;
      display: flex; flex-direction: column; gap: 0.6rem;
    }
    .cp-edit-header {
      display: flex; align-items: flex-start; gap: 0.6rem;
    }
    .cp-edit-header .cp-komp-id {
      margin-top: 0.4rem;
    }
    .cp-edit-inline-label {
      flex: 1; display: flex; flex-direction: column;
      font-size: 0.68rem; font-weight: 600; color: var(--mid);
      text-transform: uppercase; letter-spacing: 0.04em; gap: 0.2rem;
    }
    .cp-edit-textarea {
      font-family: inherit; font-size: 0.8rem; color: var(--dark);
      background: white; border: 1px solid var(--border);
      border-radius: 6px; padding: 0.45rem 0.6rem;
      width: 100%; resize: vertical; line-height: 1.5;
      transition: border-color 0.15s;
    }
    .cp-edit-textarea:focus {
      outline: none; border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(37,99,168,0.12);
    }
    .cp-edit-titel { font-weight: 500; }
    .cp-edit-stufen {
      display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem;
    }
    .cp-edit-stufe-label {
      display: flex; flex-direction: column; gap: 0.2rem;
    }
    .cp-stufe-badge {
      display: inline-flex; align-items: center; justify-content: center;
      width: 20px; height: 20px; border-radius: 5px;
      font-size: 0.68rem; font-weight: 800; letter-spacing: 0;
      align-self: flex-start;
    }
    .cp-stufe-g { background: var(--s-bg); color: var(--s-fg); }
    .cp-stufe-s { background: var(--primary-lt); color: var(--accent); }
    .cp-stufe-e { background: var(--e-bg); color: var(--e-fg); }

    /* Bestätigen-Button */
    .cp-submit { margin-top: 0.25rem; }

    /* ── KOMPETENZ-LESEANSICHT (CP2) ── */
    .cp-kv-list { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 0.75rem; }
    .cp-kv-card {
      background: var(--light); border: 1px solid var(--border);
      border-radius: 8px; padding: 0.5rem 0.75rem;
      display: flex; flex-direction: column; gap: 0.25rem;
    }
    .cp-kv-title-row { display: flex; align-items: center; gap: 0.45rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 0.1rem; }
    .cp-kv-stufe-row { display: flex; align-items: flex-start; gap: 0.45rem; }
    .cp-kv-stufe-row .cp-stufe-badge {
      width: 5.6rem; min-width: 5.6rem; height: auto;
      padding: 0.18rem 0.4rem; border-radius: 4px;
      font-size: 0.65rem; font-weight: 600; justify-content: center;
    }
    .cp-kv-titel { flex: 1; font-size: 0.8rem; font-weight: 600; color: var(--dark); line-height: 1.35; }
    .cp-kv-stufe-text { flex: 1; font-size: 0.73rem; color: var(--dark); line-height: 1.45; padding-top: 0.15rem; }
    .cp-kv-edit {
      background: none; border: none; cursor: pointer;
      color: var(--mid); font-size: 0.8rem; padding: 0.1rem;
      flex-shrink: 0; line-height: 1; opacity: 0.45;
      transition: opacity 0.15s, color 0.15s;
    }
    .cp-kv-edit:hover { opacity: 1; color: var(--accent); background: none; }

    /* ══════════════════════════════════════════════════════════════
       LERNGRID-KOMMANDOZENTRALE (erscheint nach Pipeline-Abschluss)
       ══════════════════════════════════════════════════════════════ */

    .section-label {
      display: block;
      font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em;
      text-transform: uppercase; color: var(--accent);
      margin-bottom: 0.35rem;
    }

    .lerngrid-kommandozentrale {
      margin-top: 2.5rem;
      scroll-margin-top: 80px;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      overflow: hidden;
      box-shadow: var(--shadow);
    }

    /* ── Header: Titel-Meta (vertikal) + Button (rechts) ── */
    .lerngrid-kommandozentrale .lerngrid-header {
      display: flex;
      flex-direction: row; align-items: flex-start; justify-content: space-between;
      gap: 1rem;
      padding: 1.5rem 1.75rem;
      background: white;
      border: none; border-radius: 0; box-shadow: none;
    }
    /* Überschreibt die Basis-Definition (.lerngrid-header-meta = horizontaler flex) */
    .lerngrid-kommandozentrale .lerngrid-header-meta {
      display: flex; flex-direction: column; gap: 0;
    }
    .lerngrid-kommandozentrale .section-label {
      margin-bottom: 0.5rem;
    }
    .lerngrid-titel {
      font-size: 1.25rem; font-weight: 700; color: var(--dark);
      margin: 0 0 0.65rem;
      line-height: 1.3;
    }
    .lerngrid-meta-zeile {
      display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
    }
    .lerngrid-badge {
      display: inline-block;
      font-size: 0.7rem; font-weight: 600;
      padding: 0.18rem 0.65rem; border-radius: 999px;
      background: var(--primary-lt); color: var(--primary);
    }
    .lerngrid-stat {
      font-size: 0.75rem; color: var(--mid);
    }
    .btn-abschliessen {
      font-family: inherit; font-size: 0.82rem; font-weight: 700;
      padding: 0.55rem 1.2rem; border-radius: 8px;
      background: var(--accent2); color: white; border: none; cursor: pointer;
      transition: background 0.15s;
      flex-shrink: 0;
      white-space: nowrap;
    }
    .btn-abschliessen:disabled {
      background: var(--border); color: var(--mid); cursor: not-allowed;
    }

    /* ── Legende ── */
    .lerngrid-legende {
      display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
      font-size: 0.74rem; color: var(--mid);
      padding: 0.65rem 1.75rem;
      background: #fafbfd;
      border-top: 1px solid var(--border);
    }
    .legende-item {
      display: inline-flex; align-items: center; gap: 0.35rem;
    }
    .niveau-pille {
      display: inline-block; font-size: 0.64rem; font-weight: 700;
      padding: 0.12rem 0.55rem; border-radius: 999px;
    }
    .niveau-g { background: var(--g-bg); color: var(--g-fg); }
    .niveau-s { background: var(--s-bg); color: var(--s-fg); }
    .niveau-e { background: var(--e-bg); color: var(--e-fg); }
    .ampel-dot {
      display: inline-block; width: 10px; height: 10px; border-radius: 50%;
      vertical-align: middle;
    }
    .ampel-dot.entwurf { background: #f59e0b; }
    .ampel-dot.freigegeben { background: #10b981; }

    /* ── Matrix-Tabelle ── */
    .lerngrid-matrix-wrapper {
      overflow-x: auto;
      border-top: 1px solid var(--border);
    }
    table.lerngrid-matrix {
      width: 100%; border-collapse: collapse;
      background: white; font-size: 0.8rem;
    }
    /* Alle Zellen haben alle Borders — selektives Entfernen nur an den Aussenkanten.
       Kein padding: 0 hier — individuelle Klassen setzen ihr Padding selbst
       (padding: 0 hätte Spezifität 0,1,2 und würde .td-kompetenz etc. (0,1,0) überschreiben). */
    table.lerngrid-matrix th,
    table.lerngrid-matrix td {
      border: 1px solid var(--border);
    }
    table.lerngrid-matrix thead th          { border-top: none; }
    table.lerngrid-matrix th:first-child,
    table.lerngrid-matrix td:first-child    { border-left: none; }
    table.lerngrid-matrix th:last-child,
    table.lerngrid-matrix td:last-child     { border-right: none; }
    table.lerngrid-matrix tbody tr:last-child td { border-bottom: none; }

    .th-kompetenz {
      width: 220px; min-width: 180px;
      padding: 0.7rem 1rem 0.7rem 1.75rem;
      font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
      text-transform: uppercase; color: var(--mid);
      background: #fafbfd; text-align: left;
    }
    .th-niveau {
      width: calc((100% - 220px) / 3); min-width: 180px;
      padding: 0.7rem 1rem; text-align: center;
      background: #fafbfd;
      font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
      text-transform: uppercase; color: var(--mid);
    }
    .th-niveau .niveau-pille { vertical-align: middle; }
    .kompetenz-row:hover .td-lernpoint { background: #f8f9fb; }
    .td-kompetenz {
      padding: 0.85rem 1rem 0.85rem 1.75rem;
      background: #fafbfd; vertical-align: top;
    }
    .komp-id {
      display: block; font-size: 0.62rem; font-weight: 700;
      color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em;
      margin-bottom: 0.3rem;
    }
    .komp-titel {
      font-size: 0.8rem; font-weight: 600; color: var(--dark); line-height: 1.4;
    }
    .td-lernpoint {
      padding: 0.6rem 0.75rem; vertical-align: top;
      transition: background 0.12s;
    }
    .td-lernpoint.empty {
      background: #fafbfd;
    }
    .lp-card {
      display: flex; flex-direction: column; gap: 0.25rem;
      text-decoration: none;
      padding: 0.6rem 0.7rem; border-radius: 8px;
      background: white;
      border: 1px solid var(--border);
      transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
      cursor: pointer;
      min-height: 3.2rem;
    }
    .lp-card:hover {
      border-color: var(--accent);
      box-shadow: 0 2px 8px rgba(30,58,95,0.08);
      transform: translateY(-1px);
    }
    .lp-card.lp-entwurf { border-left: 3px solid #f59e0b; }
    .lp-card.lp-freigegeben { border-left: 3px solid #10b981; }
    .lp-card.lp-fehler { border-left: 3px solid #ef4444; }
    .lp-text {
      font-size: 0.74rem; color: var(--dark); line-height: 1.45;
    }
    .lp-leer {
      color: var(--border); font-size: 0.85rem;
      display: flex; align-items: center; justify-content: center;
      min-height: 3.2rem;
    }

    /* ── Export-Bereich: integriert, keine Karte-in-Karte ── */
    .lerngrid-kommandozentrale .export-bereich {
      border-top: 1px solid var(--border);
      padding: 1.5rem 1.75rem;
      background: white;
      border-radius: 0 0 var(--radius) var(--radius);
    }
    .lerngrid-kommandozentrale .export-karte {
      border: none; box-shadow: none;
      background: transparent; border-radius: 0;
      overflow: visible;
    }
    .lerngrid-kommandozentrale .export-karte-inhalt {
      padding: 0;
    }

    /* ── Quelldateien Upload (Step 00) ── */
    .qdatei-liste {
      list-style: none; margin: 0 0 0.8rem; padding: 0;
      display: flex; flex-direction: column; gap: 0.3rem;
    }
    .qdatei-item {
      display: flex; align-items: center; gap: 0.5rem;
      padding: 0.45rem 0.7rem;
      background: var(--light); border: 1px solid var(--border);
      border-radius: 6px; font-size: 0.82rem;
    }
    .qdatei-icon { flex-shrink: 0; }
    .qdatei-name { flex: 1; font-weight: 500; color: var(--dark); word-break: break-all; }
    .qdatei-groesse { flex-shrink: 0; color: var(--mid); font-size: 0.75rem; }
    .qdatei-leer { color: var(--mid); font-size: 0.83rem; margin: 0 0 0.8rem; }
    .qdatei-fehler { color: #dc2626; font-size: 0.82rem; padding: 0.4rem 0; }

    .dropzone {
      display: flex; flex-direction: column; align-items: center;
      border: 2px dashed var(--border); border-radius: 8px;
      padding: 1rem; cursor: pointer;
      transition: border-color 0.15s, background 0.15s;
    }
    .dropzone.over,
    .dropzone:hover { border-color: var(--accent); background: #f0f6ff; }
    .dropzone-label {
      display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
      cursor: pointer; color: var(--mid); font-size: 0.83rem; text-align: center;
    }
    .dropzone-label u { color: var(--accent); }
    .dropzone-icon { font-size: 1.4rem; }
    .dropzone-label small { font-size: 0.72rem; color: var(--mid); }
