/**
 * Material Design 3 — handgeschriebene Umsetzung der M3-Spec (Farbrollen,
 * Type-Scale, Shape-Scale, Elevation, State-Layer) ohne externe Bibliothek.
 * Die Tonal-Palette ist eine manuelle oklch()-Näherung an Googles HCT-
 * Farbalgorithmus (kein Build-Tooling verfügbar) — Seed-Hue 265° (Indigo).
 * Kategorie-Farben (Technik-Karten/Graph-Knoten) sind bewusst KEINE Theme-
 * Tokens, siehe js/constants.js.
 */

/* ==================== 1. Farbrollen ==================== */

:root {
  color-scheme: dark;

  /* Primary (Hue 265, Seed-Indigo) */
  --md-sys-color-primary: oklch(82% 0.09 265);
  --md-sys-color-on-primary: oklch(22% 0.09 265);
  --md-sys-color-primary-container: oklch(32% 0.11 265);
  --md-sys-color-on-primary-container: oklch(90% 0.05 265);

  /* Secondary (Hue 265, niedrige Chroma) */
  --md-sys-color-secondary: oklch(82% 0.02 265);
  --md-sys-color-on-secondary: oklch(22% 0.02 265);
  --md-sys-color-secondary-container: oklch(32% 0.025 265);
  --md-sys-color-on-secondary-container: oklch(90% 0.015 265);

  /* Tertiary (Hue 325 = Primary + 60°) */
  --md-sys-color-tertiary: oklch(82% 0.07 325);
  --md-sys-color-on-tertiary: oklch(22% 0.06 325);
  --md-sys-color-tertiary-container: oklch(32% 0.07 325);
  --md-sys-color-on-tertiary-container: oklch(90% 0.04 325);

  /* Error (Hue 25, fix — nicht von der Seed-Farbe abgeleitet) */
  --md-sys-color-error: oklch(82% 0.13 25);
  --md-sys-color-on-error: oklch(22% 0.09 25);
  --md-sys-color-error-container: oklch(32% 0.12 25);
  --md-sys-color-on-error-container: oklch(90% 0.05 25);

  /* Erweiterte Rollen für Drill-Bewertung (Hard=Warning, Easy=Success) */
  --md-sys-color-success: oklch(80% 0.11 145);
  --md-sys-color-on-success: oklch(22% 0.07 145);
  --md-sys-color-success-container: oklch(32% 0.09 145);
  --md-sys-color-on-success-container: oklch(90% 0.05 145);
  --md-sys-color-warning: oklch(82% 0.12 70);
  --md-sys-color-on-warning: oklch(25% 0.08 70);
  --md-sys-color-warning-container: oklch(35% 0.1 70);
  --md-sys-color-on-warning-container: oklch(90% 0.05 70);

  /* Neutral / Surfaces (Hue 265, sehr geringe Chroma) */
  --md-sys-color-surface-dim: oklch(6% 0.006 265);
  --md-sys-color-surface: oklch(8% 0.006 265);
  --md-sys-color-surface-bright: oklch(24% 0.008 265);
  --md-sys-color-surface-container-lowest: oklch(4% 0.005 265);
  --md-sys-color-surface-container-low: oklch(10% 0.006 265);
  --md-sys-color-surface-container: oklch(12% 0.007 265);
  --md-sys-color-surface-container-high: oklch(17% 0.008 265);
  --md-sys-color-surface-container-highest: oklch(22% 0.009 265);
  --md-sys-color-on-surface: oklch(90% 0.006 265);
  --md-sys-color-on-surface-variant: oklch(80% 0.012 265);
  --md-sys-color-outline: oklch(60% 0.014 265);
  --md-sys-color-outline-variant: oklch(30% 0.01 265);
  --md-sys-color-inverse-surface: oklch(90% 0.006 265);
  --md-sys-color-inverse-on-surface: oklch(20% 0.006 265);
  --md-sys-color-inverse-primary: oklch(45% 0.14 265);
  --md-sys-color-scrim: oklch(0% 0 0);
  --md-sys-color-shadow: oklch(0% 0 0);
}

:root[data-theme="light"] {
  color-scheme: light;

  --md-sys-color-primary: oklch(45% 0.16 265);
  --md-sys-color-on-primary: oklch(100% 0 265);
  --md-sys-color-primary-container: oklch(90% 0.06 265);
  --md-sys-color-on-primary-container: oklch(20% 0.08 265);

  --md-sys-color-secondary: oklch(45% 0.035 265);
  --md-sys-color-on-secondary: oklch(100% 0 265);
  --md-sys-color-secondary-container: oklch(90% 0.02 265);
  --md-sys-color-on-secondary-container: oklch(20% 0.03 265);

  --md-sys-color-tertiary: oklch(45% 0.1 325);
  --md-sys-color-on-tertiary: oklch(100% 0 325);
  --md-sys-color-tertiary-container: oklch(90% 0.05 325);
  --md-sys-color-on-tertiary-container: oklch(20% 0.06 325);

  --md-sys-color-error: oklch(45% 0.19 25);
  --md-sys-color-on-error: oklch(100% 0 25);
  --md-sys-color-error-container: oklch(90% 0.06 25);
  --md-sys-color-on-error-container: oklch(20% 0.08 25);

  --md-sys-color-success: oklch(45% 0.13 145);
  --md-sys-color-on-success: oklch(100% 0 145);
  --md-sys-color-success-container: oklch(90% 0.05 145);
  --md-sys-color-on-success-container: oklch(20% 0.06 145);
  --md-sys-color-warning: oklch(50% 0.16 70);
  --md-sys-color-on-warning: oklch(100% 0 70);
  --md-sys-color-warning-container: oklch(90% 0.07 70);
  --md-sys-color-on-warning-container: oklch(20% 0.08 70);

  --md-sys-color-surface-dim: oklch(87% 0.006 265);
  --md-sys-color-surface: oklch(98% 0.003 265);
  --md-sys-color-surface-bright: oklch(98% 0.003 265);
  --md-sys-color-surface-container-lowest: oklch(100% 0 265);
  --md-sys-color-surface-container-low: oklch(96% 0.004 265);
  --md-sys-color-surface-container: oklch(94% 0.005 265);
  --md-sys-color-surface-container-high: oklch(92% 0.006 265);
  --md-sys-color-surface-container-highest: oklch(90% 0.007 265);
  --md-sys-color-on-surface: oklch(15% 0.006 265);
  --md-sys-color-on-surface-variant: oklch(35% 0.012 265);
  --md-sys-color-outline: oklch(50% 0.014 265);
  --md-sys-color-outline-variant: oklch(82% 0.01 265);
  --md-sys-color-inverse-surface: oklch(22% 0.006 265);
  --md-sys-color-inverse-on-surface: oklch(96% 0.004 265);
  --md-sys-color-inverse-primary: oklch(82% 0.09 265);
  --md-sys-color-scrim: oklch(0% 0 0);
  --md-sys-color-shadow: oklch(0% 0 0);
}

/* ==================== 2. Shape & Elevation ==================== */

:root {
  --md-shape-extra-small: 4px;
  --md-shape-small: 8px;
  --md-shape-medium: 12px;
  --md-shape-large: 16px;
  --md-shape-extra-large: 28px;
  --md-shape-full: 999px;

  --md-elevation-1: 0 1px 2px color-mix(in srgb, var(--md-sys-color-shadow) 30%, transparent),
    0 1px 3px 1px color-mix(in srgb, var(--md-sys-color-shadow) 15%, transparent);
  --md-elevation-2: 0 1px 2px color-mix(in srgb, var(--md-sys-color-shadow) 30%, transparent),
    0 2px 6px 2px color-mix(in srgb, var(--md-sys-color-shadow) 15%, transparent);
  --md-elevation-3: 0 1px 3px color-mix(in srgb, var(--md-sys-color-shadow) 30%, transparent),
    0 4px 8px 3px color-mix(in srgb, var(--md-sys-color-shadow) 15%, transparent);

  --md-top-app-bar-height: 64px;
  --md-nav-bar-height: 80px;
  --md-nav-rail-width: 80px;
}

/* ==================== 3. Typografie ==================== */

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
}

* { box-sizing: border-box; }

.md-typescale-title-large { font-size: 22px; line-height: 28px; font-weight: 400; margin: 0; }
.md-typescale-title-medium { font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: 0.15px; margin: 0; }
.md-typescale-title-small { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; margin: 0; }
.md-typescale-body-large { font-size: 16px; line-height: 24px; font-weight: 400; letter-spacing: 0.5px; margin: 0; }
.md-typescale-body-medium { font-size: 14px; line-height: 20px; font-weight: 400; letter-spacing: 0.25px; margin: 0; }
.md-typescale-body-small { font-size: 12px; line-height: 16px; font-weight: 400; letter-spacing: 0.4px; margin: 0; }
.md-typescale-label-large { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; }
.md-typescale-label-medium { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.5px; }
.md-typescale-label-small { font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: 0.5px; }

h2 { font-size: 22px; line-height: 28px; font-weight: 400; margin: 0; }
h3 { font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: 0.15px; margin: 0 0 4px; }

.muted { color: var(--md-sys-color-on-surface-variant); font-size: 14px; }
.muted.small { font-size: 12px; }

/* ==================== 4. State-Layer (gemeinsame Interaktions-Regel) ==================== */

.md-state-layer {
  position: relative;
  transition: box-shadow 0.1s ease;
}
.md-state-layer:hover {
  box-shadow: inset 0 0 0 999px color-mix(in srgb, currentColor 8%, transparent);
}
.md-state-layer:focus-visible {
  box-shadow: inset 0 0 0 999px color-mix(in srgb, currentColor 12%, transparent);
}
.md-state-layer:active {
  box-shadow: inset 0 0 0 999px color-mix(in srgb, currentColor 12%, transparent);
}
:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}

/* ==================== 5. Layout-Shell ==================== */

.md-top-app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--md-top-app-bar-height);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 16px;
  background: var(--md-sys-color-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.md-top-app-bar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  line-height: 28px;
  flex: 1;
}
.md-top-app-bar-actions { display: flex; gap: 4px; align-items: center; }

.md-nav-rail {
  display: none;
  position: fixed;
  top: var(--md-top-app-bar-height);
  left: 0;
  bottom: 0;
  width: var(--md-nav-rail-width);
  z-index: 15;
  background: var(--md-sys-color-surface);
  border-right: 1px solid var(--md-sys-color-outline-variant);
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  overflow-y: auto;
}
.md-nav-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  height: var(--md-nav-bar-height);
  display: flex;
  background: var(--md-sys-color-surface-container);
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

.md-nav-item {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--md-sys-color-on-surface-variant);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
}
.md-nav-bar .md-nav-item {
  flex: 1;
  height: 100%;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-align: center;
  overflow-wrap: anywhere;
  padding: 0 2px;
}
.md-nav-rail .md-nav-item { width: 64px; height: 56px; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.5px; }

.md-nav-item .md-nav-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 32px;
  border-radius: var(--md-shape-full);
  transition: background-color 0.15s ease;
}
.md-nav-item.active .md-nav-indicator { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.md-nav-item:hover .md-nav-indicator { background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); }
.md-nav-item.active:hover .md-nav-indicator { background: color-mix(in srgb, var(--md-sys-color-secondary-container) 92%, var(--md-sys-color-on-secondary-container) 8%); }

.md-badge {
  position: absolute;
  top: -2px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--md-shape-full);
  background: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
  font-size: 11px;
  line-height: 16px;
  font-weight: 500;
  text-align: center;
}
.md-badge:empty, .md-badge[hidden] { display: none; }

.content { max-width: 900px; margin: 0 auto; padding: 24px 20px calc(24px + var(--md-nav-bar-height)); }

@media (min-width: 600px) {
  .md-nav-rail { display: flex; }
  .md-nav-bar { display: none; }
  .content { margin-left: var(--md-nav-rail-width); padding-bottom: 24px; max-width: calc(900px + 40px); }
}

.view { display: none; }
.view.active { display: block; }

.view-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

/* ==================== 6. Buttons ==================== */

.btn {
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: 0.1px;
  border-radius: var(--md-shape-full);
  padding: 10px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}
.btn.primary { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.btn.tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.btn.outlined { background: transparent; border-color: var(--md-sys-color-outline); color: var(--md-sys-color-primary); }
.btn.text { background: transparent; color: var(--md-sys-color-primary); padding-left: 12px; padding-right: 12px; }
.btn.small { padding: 6px 14px; font-size: 12px; }
.btn.icon-only { padding: 10px; border-radius: var(--md-shape-full); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn.rate-again { border-color: var(--md-sys-color-error); color: var(--md-sys-color-error); }
.btn.rate-hard { border-color: var(--md-sys-color-warning); color: var(--md-sys-color-warning); }
.btn.rate-good { border-color: var(--md-sys-color-primary); color: var(--md-sys-color-primary); }
.btn.rate-easy { border-color: var(--md-sys-color-success); color: var(--md-sys-color-success); }

.md-icon-button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--md-sys-color-on-surface-variant);
  border-radius: var(--md-shape-full);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.md-icon-button svg { width: 22px; height: 22px; }

/* ==================== 7. FAB ==================== */

.md-fab-extended {
  position: fixed;
  right: 16px;
  bottom: calc(16px + var(--md-nav-bar-height));
  z-index: 10;
  height: 56px;
  padding: 0 20px 0 16px;
  border-radius: var(--md-shape-large);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  box-shadow: var(--md-elevation-3);
}
.md-fab-extended svg { width: 24px; height: 24px; }

@media (min-width: 600px) {
  .md-fab-extended { bottom: 24px; }
}

/* ==================== 8. Chips ==================== */

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  background: transparent;
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface-variant);
  padding: 6px 14px;
  border-radius: var(--md-shape-small);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip svg { width: 16px; height: 16px; }
.chip-dot { width: 8px; height: 8px; border-radius: var(--md-shape-full); background: var(--chip-color, currentColor); }
.chip-active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
}

/* ==================== 9. Karten ==================== */

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-shape-medium);
  padding: 18px;
  text-align: center;
}
.stat-card.stat-highlight { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.stat-value { font-size: 28px; line-height: 36px; font-weight: 400; }
.stat-label { color: var(--md-sys-color-on-surface-variant); font-size: 12px; margin-top: 4px; }
.stat-highlight .stat-label { color: inherit; opacity: 0.85; }

.actions-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.technique-list { display: flex; flex-direction: column; gap: 10px; }
.technique-card {
  display: flex;
  align-items: stretch;
  background: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-shape-medium);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.card-color { width: 6px; flex-shrink: 0; }
.card-body { padding: 12px 14px; flex: 1; }
.card-title-row { display: flex; align-items: center; gap: 8px; }
.card-meta { color: var(--md-sys-color-on-surface-variant); font-size: 12px; margin-top: 2px; }
.card-notes { margin-top: 6px; font-size: 14px; color: var(--md-sys-color-on-surface-variant); }
.card-delete {
  background: none; border: none; color: var(--md-sys-color-on-surface-variant); cursor: pointer;
  padding: 0 14px; display: flex; align-items: center;
}
.card-delete svg { width: 20px; height: 20px; }
.card-delete:hover { color: var(--md-sys-color-error); }

.badge-due {
  font-size: 11px; font-weight: 500; padding: 2px 10px; border-radius: var(--md-shape-full);
  background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container);
}

/* ==================== 10. Dialog ==================== */

.modal-backdrop {
  position: fixed; inset: 0; background: color-mix(in srgb, var(--md-sys-color-scrim) 40%, transparent);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal {
  background: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-shape-extra-large);
  box-shadow: var(--md-elevation-3);
  padding: 24px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  color: var(--md-sys-color-on-surface);
}
.modal form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.modal input, .modal select, .modal textarea {
  background: var(--md-sys-color-surface-container-highest);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-shape-extra-small) var(--md-shape-extra-small) 0 0;
  color: var(--md-sys-color-on-surface);
  padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.modal input:focus, .modal select:focus, .modal textarea:focus {
  outline: none;
  border: 2px solid var(--md-sys-color-primary);
  padding: 9px 11px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.link-editor { border-top: 1px solid var(--md-sys-color-outline-variant); padding-top: 12px; margin-top: 4px; }
.link-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 14px; }
.remove-link-btn { background: none; border: none; color: var(--md-sys-color-on-surface-variant); cursor: pointer; display: flex; }
.remove-link-btn svg { width: 16px; height: 16px; }
.remove-link-btn:hover { color: var(--md-sys-color-error); }
.link-add-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.link-add-row select { flex: 1; min-width: 100px; }

/* ==================== 11. Graph ==================== */

.graph-container { background: var(--md-sys-color-surface-container-high); border-radius: var(--md-shape-medium); overflow: hidden; }
#graph-svg { width: 100%; height: 520px; display: block; }
.graph-edge { stroke: var(--md-sys-color-outline-variant); stroke-width: 1.5; }
.graph-edge-label { fill: var(--md-sys-color-on-surface-variant); font-size: 9px; text-anchor: middle; }
.graph-arrow-fill { fill: var(--md-sys-color-outline-variant); }
.graph-node circle { stroke: var(--md-sys-color-surface-container-high); stroke-width: 2; }
.graph-node:hover circle { stroke: var(--md-sys-color-on-surface); }
.graph-node-label { fill: var(--md-sys-color-on-surface); font-size: 11px; text-anchor: middle; }

/* ==================== 12. Drill ==================== */

.drill-card {
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-shape-large);
  box-shadow: var(--md-elevation-1);
  padding: 28px; text-align: center; max-width: 480px; margin: 0 auto;
}
.card-color-lg { height: 6px; border-radius: 3px; margin-bottom: 16px; }
.card-highlight { font-size: 16px; line-height: 24px; text-align: center; }
.rating-row { display: flex; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* ==================== 12b. Snackbar ==================== */

.md-snackbar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + var(--md-nav-bar-height));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: var(--md-shape-extra-small);
  background: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  box-shadow: var(--md-elevation-3);
  font-size: 14px;
  line-height: 20px;
}
.md-snackbar-text { flex: 1; }
.md-snackbar-action {
  background: none;
  border: none;
  color: var(--md-sys-color-inverse-primary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--md-shape-full);
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .md-snackbar { bottom: 24px; left: calc(16px + var(--md-nav-rail-width)); }
}

/* ==================== 12c. UX-Komponenten (Audit-Fixes) ==================== */

.btn.danger { background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); }

.modal-confirm p { margin: 8px 0 4px; color: var(--md-sys-color-on-surface-variant); }

/* Rating-Buttons mit Intervall-Vorschau */
.rating-row .btn { flex-direction: column; gap: 0; padding: 8px 18px; }
.rate-sub { display: block; font-size: 11px; line-height: 14px; font-weight: 400; opacity: 0.75; letter-spacing: 0.3px; }
.drill-secondary { margin-top: 14px; }

/* Graph-Legende */
.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: var(--md-shape-full); }

/* Suchfeld */
.md-search {
  width: 100%;
  max-width: 420px;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-shape-full);
  padding: 10px 18px;
  color: var(--md-sys-color-on-surface);
  font: inherit;
  font-size: 14px;
  margin-bottom: 12px;
}
.md-search:focus { outline: none; border: 2px solid var(--md-sys-color-primary); padding: 9px 17px; }
.md-search::placeholder { color: var(--md-sys-color-on-surface-variant); }

/* Chip-Auswahl im Formular (Session-Techniken) */
.md-field-label { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.form-chip-row { display: flex; flex-wrap: wrap; gap: 8px; max-height: 200px; overflow-y: auto; }

/* Link-Editor mit Labels */
.link-add-row { align-items: flex-end; }
.link-add-field { flex: 1; min-width: 120px; }

/* ==================== 13. Trainingslog ==================== */

.session-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.session-card { background: var(--md-sys-color-surface-container-high); border-radius: var(--md-shape-medium); padding: 14px; }
.session-date { font-weight: 500; }
.session-techniques { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { background: var(--md-sys-color-surface-container-highest); border-radius: var(--md-shape-full); padding: 2px 10px; font-size: 12px; }
