/* ============================================================
   RookyCMS — Bento-Dashboard
   Stil: Bento + Glas-Optik + Aurora-Hintergrund.

   Performance-Prinzipien dieser Fassung:
   - Der Aurora-Hintergrund ist STATISCH (reine Gradients, keine
     Animation, kein filter:blur) — er wird einmal gerastert und
     kostet danach nichts mehr.
   - KEIN backdrop-filter: Echtzeit-Blur pro Element (Kacheln,
     Topbar, Modal …) war die Hauptursache für GPU-Dauerlast.
     Die Glas-Anmutung entsteht stattdessen aus halbtransparenten
     Farbschichten über dem weichen Hintergrund.
   - Übergänge nur auf compositor-freundlichen Eigenschaften
     (transform, opacity, box-shadow, Farben).
   ============================================================ */

/* -------- Design Tokens -------- */
:root {
    color-scheme: dark light;

    --accent-h: 28;
    --accent-s: 92%;
    --accent-l: 58%;
    --accent:      hsl(var(--accent-h), var(--accent-s), var(--accent-l));
    --accent-soft: hsl(var(--accent-h), var(--accent-s), 70%);
    --accent-deep: hsl(var(--accent-h), 80%, 48%);

    --danger:  hsl(0, 78%, 60%);
    --success: hsl(155, 60%, 50%);

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 22px;

    --gap: 12px;
    --content-w: 1600px;

    --t-fast: 140ms cubic-bezier(.4, 0, .2, 1);
    --t-med:  260ms cubic-bezier(.4, 0, .2, 1);

    /* Systemschriften: keine externen Font-Requests im Intranet */
    --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'JetBrains Mono', monospace;

    /* Kachel-Typo: Originalgröße wie die ursprüngliche Prod-Version */
    --tile-fs: 0.875rem;

    /* Körnung des Aurora-Overlays; je Stil überschrieben (0 = clean) */
    --noise-opacity: 0.05;

    /* Seit 1.3.0 je Stil überschreibbar — die Werte hier sind exakt die
       bisherigen festen Werte, Aurora sieht damit unverändert aus. */
    --accent-fg: #0a0a0f;          /* Schrift auf dem Primärknopf */
    --field-bg:  var(--surface);   /* Eingabefelder, Vorschau, Dropzone */
    --scrim:     rgba(0, 0, 0, 0.72);
}

:root, [data-theme="dark"] {
    color-scheme: dark;   /* Scrollbalken & Auswahllisten folgen der Ansicht, nicht dem System */
    --bg-0: #07070b;
    --bg-1: #0d0d14;
    --bg-2: #14141d;

    --surface:        rgba(255, 255, 255, 0.05);
    --surface-hover:  rgba(255, 255, 255, 0.09);
    --surface-strong: rgba(19, 19, 27, 0.88);
    --panel:          rgba(22, 22, 31, 0.97);

    --border:        rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.17);

    --text-1: rgba(255, 255, 255, 0.96);
    --text-2: rgba(255, 255, 255, 0.78);
    --text-3: rgba(255, 255, 255, 0.5);

    --aurora-1: hsl(218, 90%, 22%);
    --aurora-2: hsl(290, 80%, 16%);
    --aurora-3: hsl(200, 80%, 16%);

    /* Kategorie-Tönung der Kacheln (deckender als früher,
       weil kein Blur mehr für Kontrast sorgt) */
    --tile-tint-bg:   hsl(var(--hue) 42% 20% / 0.82);
    --tile-tint-bg-2: hsl(var(--hue) 38% 12% / 0.88);
    --tile-tint-edge: hsl(var(--hue) 75% 60% / 0.35);
    --tile-tint-glow: hsl(var(--hue) 70% 55% / 0.16);
}

[data-theme="light"] {
    color-scheme: light;
    --bg-0: #f4f1ec;
    --bg-1: #ece7e0;
    --bg-2: #e0d9d0;

    --surface:        rgba(255, 255, 255, 0.65);
    --surface-hover:  rgba(255, 255, 255, 0.85);
    --surface-strong: rgba(255, 255, 255, 0.86);
    --panel:          rgba(252, 251, 249, 0.98);

    --border:        rgba(20, 20, 28, 0.08);
    --border-strong: rgba(20, 20, 28, 0.18);

    --text-1: rgba(20, 20, 28, 0.95);
    --text-2: rgba(20, 20, 28, 0.7);
    --text-3: rgba(20, 20, 28, 0.45);

    --aurora-1: hsl(215, 95%, 72%);
    --aurora-2: hsl(330, 85%, 74%);
    --aurora-3: hsl(190, 80%, 64%);

    --tile-tint-bg:   hsl(var(--hue) 70% 94% / 0.92);
    --tile-tint-bg-2: hsl(var(--hue) 60% 88% / 0.9);
    --tile-tint-edge: hsl(var(--hue) 70% 55% / 0.45);
    --tile-tint-glow: hsl(var(--hue) 80% 60% / 0.2);
}

/* ============================================================
   Weitere Stile (seit 1.3.0): Klar, Minze, Schiefer.
   Zweite Theming-Dimension: data-style auf <html>, jeder Stil mit
   Tag- und Nachtansicht (data-theme). Aurora (oben) bleibt Default
   und unverändert. Die drei neuen sind bewusst LEICHT — flache
   Karten auf ruhigem Grund, feine Kante, weicher Schatten, die
   Kategoriefarbe nur als Akzent (Badge, bei Schiefer als Randstreifen),
   Bilder als Kopfband. Kein Glas, kein Glühen, keine Körnung.

   Aufbau: zuerst die Farb-Tokens je Stil und Tageszeit, danach das
   gemeinsame Kartenbild unter :root:not([data-style="aurora"]).
   Kommt ein Stil dazu, der wieder wie Aurora aussehen soll, muss er
   dort ausgenommen werden.

   Wichtig: Tokens mit var(--hue) werden an der KACHEL deklariert
   (.tile setzt --hue je Kategorie). Auf :root deklariert würden sie
   dort aufgelöst, wo es kein --hue gibt — und wären ungültig.
   ============================================================ */

/* -------- Klar — angelehnt an Apple (macOS/iOS) -------- */
[data-style="klar"] {
    --r-tile: 18px;
    --label-font: var(--font-sans);
    --label-case: none;
    --label-track: 0;
}
[data-style="klar"][data-theme="light"] {
    --accent-h: 211; --accent-s: 100%; --accent-l: 45%;   /* #0071e3 */
    --accent-soft: hsl(211, 100%, 45%);
    --accent-deep: hsl(211, 100%, 38%);
    --accent-fg: #ffffff;

    --bg-0: #f5f5f7;
    --bg-1: #f5f5f7;
    --bg-2: #e8e8ed;

    --surface:        #ffffff;
    --surface-hover:  #ebebf0;
    --surface-strong: #ffffff;
    --panel:          #ffffff;
    --field-bg:       #f5f5f7;
    --scrim:          rgba(0, 0, 0, 0.32);

    --border:        rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.16);

    --text-1: #1d1d1f;
    --text-2: #424245;
    --text-3: #6e6e73;

    --card:              #ffffff;
    --card-border:       rgba(0, 0, 0, 0.05);
    --card-shadow:       0 1px 2px rgba(0, 0, 0, 0.04), 0 3px 12px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.06), 0 14px 34px rgba(0, 0, 0, 0.08);
}
[data-style="klar"][data-theme="dark"] {
    --accent-h: 211; --accent-s: 100%; --accent-l: 52%;   /* #0a84ff */
    --accent-soft: hsl(211, 100%, 66%);
    --accent-deep: hsl(211, 100%, 46%);
    --accent-fg: #ffffff;

    --bg-0: #000000;
    --bg-1: #000000;
    --bg-2: #1c1c1e;

    --surface:        #1c1c1e;
    --surface-hover:  #2c2c2e;
    --surface-strong: #1c1c1e;
    --panel:          #1c1c1e;
    --field-bg:       #2c2c2e;
    --scrim:          rgba(0, 0, 0, 0.6);

    --border:        rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.20);

    --text-1: #f5f5f7;
    --text-2: #c7c7cc;
    --text-3: #98989d;

    --card:              #1c1c1e;
    --card-border:       rgba(255, 255, 255, 0.06);
    --card-shadow:       none;
    --card-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.7);
}

/* -------- Minze — frisch und rund (wie cat-o-fit) -------- */
[data-style="minze"] {
    --r-tile: 20px;
    --label-font: var(--font-sans);
    --label-case: none;
    --label-track: 0;
}
[data-style="minze"][data-theme="light"] {
    --accent-h: 163; --accent-s: 76%; --accent-l: 36%;    /* Minzgrün */
    --accent-soft: hsl(163, 76%, 32%);
    --accent-deep: hsl(163, 76%, 30%);
    --accent-fg: #ffffff;

    --bg-0: #eef1f5;
    --bg-1: #f6f8fb;
    --bg-2: #e7ecf1;

    --surface:        #ffffff;
    --surface-hover:  #f1f4f7;
    --surface-strong: #ffffff;
    --panel:          #ffffff;
    --field-bg:       #f1f4f7;
    --scrim:          rgba(20, 27, 33, 0.42);

    --border:        rgba(20, 27, 33, 0.08);
    --border-strong: rgba(20, 27, 33, 0.16);

    --text-1: #161b21;
    --text-2: #58646f;
    --text-3: #626c78;

    --card:              #ffffff;
    --card-border:       rgba(20, 27, 33, 0.06);
    --card-shadow:       0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.05);
    --card-shadow-hover: 0 4px 16px rgba(16, 24, 40, 0.08), 0 12px 28px rgba(16, 24, 40, 0.06);
}
[data-style="minze"][data-theme="dark"] {
    --accent-h: 163; --accent-s: 72%; --accent-l: 45%;
    --accent-soft: hsl(163, 70%, 60%);
    --accent-deep: hsl(163, 76%, 36%);
    --accent-fg: #06140f;

    --bg-0: #0c0f13;
    --bg-1: #11151b;
    --bg-2: #161b22;

    --surface:        #161b22;
    --surface-hover:  #1d242c;
    --surface-strong: #161b22;
    --panel:          #161b22;
    --field-bg:       #1d242c;
    --scrim:          rgba(0, 0, 0, 0.6);

    --border:        rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);

    --text-1: #eef2f6;
    --text-2: #9aa7b4;
    --text-3: #8a96a1;

    --card:              #161b22;
    --card-border:       rgba(255, 255, 255, 0.06);
    --card-shadow:       0 1px 2px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* -------- Schiefer — sachlich, mit Randstreifen (wie Energietracker) -------- */
[data-style="schiefer"] {
    --r-tile: 14px;
    --label-font: var(--font-mono);
    --label-case: uppercase;
    --label-track: 0.06em;
}
[data-style="schiefer"][data-theme="light"] {
    --accent-h: 221; --accent-s: 83%; --accent-l: 53%;    /* #2563eb */
    --accent-soft: hsl(221, 83%, 45%);
    --accent-deep: hsl(224, 76%, 48%);
    --accent-fg: #ffffff;

    --bg-0: #f6f8fa;
    --bg-1: #ffffff;
    --bg-2: #eef2f7;

    --surface:        #ffffff;
    --surface-hover:  #eef2f7;
    --surface-strong: #ffffff;
    --panel:          #ffffff;
    --field-bg:       #eef2f7;
    --scrim:          rgba(15, 23, 42, 0.45);

    --border:        rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.18);

    --text-1: #0f172a;
    --text-2: #475569;
    --text-3: #566276;

    --card:              #ffffff;
    --card-border:       rgba(15, 23, 42, 0.08);
    --card-shadow:       0 1px 2px rgba(15, 23, 42, 0.06);
    --card-shadow-hover: 0 4px 16px rgba(15, 23, 42, 0.10);
}
[data-style="schiefer"][data-theme="dark"] {
    --accent-h: 212; --accent-s: 72%; --accent-l: 59%;    /* #4a90e2 */
    --accent-soft: hsl(212, 72%, 70%);
    --accent-deep: hsl(212, 65%, 50%);
    --accent-fg: #0a0d12;

    --bg-0: #080c12;
    --bg-1: #111827;
    --bg-2: #1c2636;

    --surface:        #111827;
    --surface-hover:  #1c2636;
    --surface-strong: #111827;
    --panel:          #111827;
    --field-bg:       #1c2636;
    --scrim:          rgba(8, 11, 16, 0.85);

    --border:        rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text-1: #dce8f5;
    --text-2: #8ba0ba;
    --text-3: #8590a6;

    --card:              #111827;
    --card-border:       rgba(255, 255, 255, 0.07);
    --card-shadow:       0 1px 2px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* -------- Gemeinsames Kartenbild der leichten Stile -------- */
:root:not([data-style="aurora"]) .aurora { background: var(--bg-0); }
:root:not([data-style="aurora"]) .aurora::after { content: none; }

:root:not([data-style="aurora"]) .topbar {
    background: color-mix(in oklab, var(--bg-0) 94%, transparent);
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

/* Kategorie-Akzente: an der Kachel deklariert, damit --hue greift */
:root:not([data-style="aurora"]) .tile {
    --badge-fg:   hsl(var(--hue) 65% 32%);
    --badge-bg:   hsl(var(--hue) 75% 50% / 0.10);
    --badge-dot:  hsl(var(--hue) 70% 46%);
    --tile-link:  var(--accent-soft);
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--r-tile);
    box-shadow: var(--card-shadow);
}
:root:not([data-style="aurora"])[data-theme="dark"] .tile {
    --badge-fg:   hsl(var(--hue) 75% 74%);
    --badge-bg:   hsl(var(--hue) 70% 60% / 0.16);
    --badge-dot:  hsl(var(--hue) 75% 62%);
}
:root:not([data-style="aurora"]) .tile::before,
:root:not([data-style="aurora"]) .tile::after { content: none; }
:root:not([data-style="aurora"]) .tile:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--card-shadow-hover);
}
:root:not([data-style="aurora"]) .tile.drag-over { box-shadow: var(--card-shadow), inset 0 0 0 2px var(--accent); }

/* Schiefer: Kategorie als Randstreifen links (wie die Hinweiskarten im Energietracker).
   :root davor, damit die Regel die gemeinsame border-Kurzform oben schlägt. */
:root[data-style="schiefer"] .tile { border-left: 3px solid var(--badge-dot); }

/* Minze: wie cat-o-fit randlose Karten, nur Schatten, kräftige Titel */
:root[data-style="minze"] .tile { border-color: transparent; }
:root[data-style="minze"][data-theme="dark"] .tile { border-color: var(--card-border); }
:root[data-style="minze"] .tile__title { font-weight: 800; letter-spacing: -0.01em; }

/* Bild als Kopfband statt Hintergrund — volle Farbe, kein Schleier */
:root:not([data-style="aurora"]) .tile__cover {
    position: relative;
    inset: auto;
    flex-shrink: 0;
    height: 88px;   /* Vollfarb-Bilder als Kategorie-Band sollen nicht erschlagen */
    margin: -12px -14px 2px;
    opacity: 1;
    filter: none;
    border-bottom: 1px solid var(--card-border);
}
:root:not([data-style="aurora"]) .tile.has-image .tile__cover::after { content: none; }

:root:not([data-style="aurora"]) .tile__badge {
    font-family: var(--label-font);
    text-transform: var(--label-case);
    letter-spacing: var(--label-track);
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--badge-fg);
    background: var(--badge-bg);
    border-color: transparent;
}
:root:not([data-style="aurora"]) .tile__badge .dot { background: var(--badge-dot); }
:root:not([data-style="aurora"]) .tag {
    font-family: var(--label-font);
    background: var(--field-bg);
    border-color: transparent;
    color: var(--text-3);
}
:root:not([data-style="aurora"]) .tile__star { color: var(--accent); }
:root:not([data-style="aurora"]) .tile__body { color: var(--text-2); }
:root:not([data-style="aurora"]) .tile__body a {
    color: var(--tile-link);
    border-bottom-color: color-mix(in srgb, var(--tile-link) 35%, transparent);
}
:root:not([data-style="aurora"]) .tile__body code { background: var(--field-bg); }
:root:not([data-style="aurora"]) .tile__foot { border-top-color: var(--border); }
:root:not([data-style="aurora"]) .tile__link {
    font-family: var(--label-font);
    text-transform: var(--label-case);
    letter-spacing: var(--label-track);
    color: var(--tile-link);
}
:root:not([data-style="aurora"]) .tile__link:hover { color: var(--accent-deep); }
:root:not([data-style="aurora"]) .tile__date { font-family: var(--label-font); }
:root:not([data-style="aurora"]) .iconbtn--ghost:hover { background: var(--field-bg); }

/* Bedienelemente: schlicht, Akzent statt Verlauf */
:root:not([data-style="aurora"]) .btn--primary {
    background: var(--accent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
:root:not([data-style="aurora"]) .btn--primary:hover { background: var(--accent-deep); }
:root:not([data-style="aurora"]) .chip {
    --chip-fg: hsl(var(--hue) 65% 32%);
    --chip-bg: hsl(var(--hue) 75% 50% / 0.12);
}
:root:not([data-style="aurora"])[data-theme="dark"] .chip {
    --chip-fg: hsl(var(--hue) 75% 74%);
    --chip-bg: hsl(var(--hue) 70% 60% / 0.18);
}
/* „Alle" trägt keine Kategorie — dort gilt der Akzent des Stils */
:root:not([data-style="aurora"]) .chip[data-category="all"] {
    --chip-fg: var(--accent-soft);
    --chip-bg: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.12);
}
:root:not([data-style="aurora"]) .chip:hover { border-color: var(--border-strong); }
:root:not([data-style="aurora"]) .chip.is-active {
    background: var(--chip-bg);
    border-color: transparent;
    color: var(--chip-fg);
}
:root:not([data-style="aurora"]) .chip.is-active .chip__count { background: var(--chip-bg); }
:root:not([data-style="aurora"]) .modal__panel { box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.35); }
:root:not([data-style="aurora"]) .empty { background: var(--card); box-shadow: var(--card-shadow); }

/* -------- Base -------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    background: var(--bg-0);
    color: var(--text-1);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
code, kbd, .mono { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* -------- Aurora Background (statisch, eine Ebene) -------- */
.aurora {
    position: fixed; inset: 0; z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(46% 42% at 12% 8%,  var(--aurora-1) 0%, transparent 68%),
        radial-gradient(52% 48% at 88% 92%, var(--aurora-2) 0%, transparent 70%),
        radial-gradient(38% 36% at 72% 28%, var(--aurora-3) 0%, transparent 65%),
        radial-gradient(at 20% 0%, var(--bg-1) 0%, transparent 50%),
        radial-gradient(at 80% 100%, var(--bg-2) 0%, transparent 50%),
        var(--bg-0);
}
[data-style="aurora"][data-theme="light"] .aurora { opacity: 0.75; background-color: var(--bg-0); }
.aurora::after {
    content: "";
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/></svg>");
    opacity: var(--noise-opacity, 0.05);
}

/* -------- Topbar (einzeilig & kompakt) -------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    padding: 6px clamp(12px, 2vw, 24px);
    background: linear-gradient(180deg,
        color-mix(in oklab, var(--bg-0) 96%, transparent) 0%,
        color-mix(in oklab, var(--bg-0) 82%, transparent) 78%,
        transparent 100%);
}
.topbar__inner {
    display: flex; align-items: center; gap: 10px 12px;
    flex-wrap: wrap;
    max-width: var(--content-w); margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand__mark {
    display: grid; place-items: center;
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--surface);
    border: 1px solid var(--border);
}
.brand__text strong { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.topbar__tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

.search {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 11px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    min-width: 130px; max-width: 200px;
    transition: border-color var(--t-fast), background var(--t-fast);
}
.search:focus-within { border-color: var(--accent); background: var(--surface-hover); }
.search input { flex: 1; background: none; border: 0; outline: none; color: var(--text-1); min-width: 0; }
.search input::placeholder { color: var(--text-3); }
.search kbd {
    padding: 0 5px;
    border-radius: 5px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-3);
}

.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 13px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: transform var(--t-fast), background var(--t-fast),
                border-color var(--t-fast), color var(--t-fast),
                box-shadow var(--t-fast);
    border: 1px solid transparent;
    white-space: nowrap;
}
.btn--sm  { padding: 5px 11px; font-size: 0.8rem; }
.btn--primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: var(--accent-fg);
    box-shadow: 0 4px 16px -6px hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.5);
}
.btn--primary:hover { transform: translateY(-1px); }
.btn--ghost {
    background: var(--surface); border-color: var(--border); color: var(--text-1);
}
.btn--ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn--danger {
    background: linear-gradient(135deg, hsl(0 80% 60%), hsl(355 70% 50%));
    color: #fff;
}
.btn--danger:hover { transform: translateY(-1px); }

.iconbtn {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-1);
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
    flex-shrink: 0;
}
.iconbtn:hover { background: var(--surface-hover); border-color: var(--border-strong); }

/* In der Kachel: sehr kompakt */
.iconbtn--ghost {
    width: 22px; height: 22px;
    border-radius: 6px;
    background: transparent; border-color: transparent;
    color: var(--text-3);
}
.iconbtn--ghost svg { width: 12px; height: 12px; }
.iconbtn--ghost:hover { background: hsl(var(--hue) 30% 30% / 0.4); color: var(--text-1); }

.iconbtn .i-sun  { display: none; }
[data-theme="light"] .iconbtn .i-moon { display: none; }
[data-theme="light"] .iconbtn .i-sun  { display: block; }

/* Tag/Nacht-Knopf: Symbol = was gerade gilt, „A" = folgt dem Gerät */
#theme-toggle { position: relative; }
.theme-badge {
    position: absolute; right: -4px; bottom: -4px;
    min-width: 14px; height: 14px; padding: 0 3px;
    border-radius: 99px;
    background: var(--accent);
    color: var(--accent-fg);
    font: 700 0.56rem/14px var(--font-sans);
    text-align: center;
    pointer-events: none;
}
.theme-badge[hidden] { display: none; }

/* -------- Stil-Umschalter (Popover mit Vorschau) -------- */
.style-picker { position: relative; display: inline-flex; flex-shrink: 0; }
.style-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    min-width: 190px;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    box-shadow: 0 18px 44px -14px rgba(0, 0, 0, 0.5), 0 2px 8px -3px rgba(0, 0, 0, 0.4);
    display: flex; flex-direction: column; gap: 2px;
    transform-origin: top right;
    animation: style-menu-in var(--t-fast);
}
@keyframes style-menu-in {
    from { opacity: 0; transform: translateY(-4px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}
.style-menu[hidden] { display: none; }
.style-opt {
    display: flex; align-items: center; gap: 9px;
    width: 100%;
    padding: 7px 9px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 0.8rem;
    text-align: left;
    transition: background var(--t-fast), color var(--t-fast);
}
.style-opt:hover { background: var(--surface-hover); color: var(--text-1); }
.style-opt.is-active { color: var(--text-1); font-weight: 600; }
.style-opt__sw {
    width: 20px; height: 20px;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid var(--border-strong);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.style-opt__name { flex: 1; }
.style-opt__check { width: 14px; height: 14px; opacity: 0; flex-shrink: 0; color: var(--accent); }
.style-opt.is-active .style-opt__check { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .style-menu { animation: none; }
}

/* Chip filter — auf breiten Screens in der Topbar-Zeile (scrollbar bei
   Enge), auf schmalen Screens eine eigene, umbrechende Zeile darunter */
.chips {
    display: flex; gap: 6px;
    align-items: center;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px;
}
.chips::-webkit-scrollbar { display: none; }
@media (max-width: 1119px) {
    .chips {
        order: 3;
        flex: 1 1 100%;
        flex-wrap: wrap;
        overflow-x: visible;
    }
}
/* Phone: Suche/Buttons als eigene, volle Zeile — Suchfeld beginnt
   linksbündig unter dem Logo (nicht rechts eingerückt) */
@media (max-width: 639px) {
    .topbar__tools {
        flex: 1 1 100%;
        margin-left: 0;
        min-width: 0;
    }
    .search {
        flex: 1 1 auto;
        max-width: none;
        min-width: 0; /* darf schrumpfen, damit Stil- + Theme-Icon + „Neu" in die Zeile passen */
    }
    .search kbd { display: none; } /* Tastatur-Hinweis auf Touch weglassen → mehr Platz */
}
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 9px;
    border-radius: 99px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 0.75rem;
    font-weight: 500;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
    --hue: 28;
    white-space: nowrap;
    flex-shrink: 0;
}
.chip:hover {
    background: var(--surface-hover);
    color: var(--text-1);
    border-color: hsl(var(--hue) 70% 60% / 0.5);
}
.chip.is-active {
    background: hsl(var(--hue) 80% 60% / 0.18);
    border-color: hsl(var(--hue) 80% 60% / 0.55);
    color: hsl(var(--hue) 90% 75%);
}
[data-theme="light"] .chip.is-active { color: hsl(var(--hue) 70% 35%); }
.chip__icon { font-size: 0.85em; opacity: 0.9; }
.chip__count {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0 5px;
    border-radius: 99px;
    background: var(--surface-hover);
    color: var(--text-3);
    min-width: 17px;
    text-align: center;
}
.chip.is-active .chip__count { background: hsl(var(--hue) 70% 50% / 0.25); color: inherit; }

/* -------- Page -------- */
.page {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 4px clamp(12px, 2vw, 24px) 8px;
}

/* -------- Fehler-Banner -------- */
.banner {
    display: flex; flex-direction: column; gap: 2px;
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: var(--r-md);
    font-size: 0.875rem;
}
.banner--error {
    background: hsl(0 60% 22% / 0.7);
    border: 1px solid hsl(0 70% 50% / 0.5);
    color: hsl(0 90% 88%);
}
[data-theme="light"] .banner--error {
    background: hsl(0 80% 94%);
    color: hsl(0 70% 30%);
}

/* -------- Bento Grid --------
   Inhaltsgetriebene Höhen: das Grid hat ein feines 2px-Zeilenraster,
   js/app.js misst nach dem Rendern jede Kachel und setzt ihren
   grid-row-span exakt auf die Inhaltshöhe (+ Abstand). Dadurch zeigt
   JEDE Kachel ihren kompletten Inhalt; dense packt weiterhin kompakt.
   Der vertikale Abstand entsteht aus der span-Reserve (ROW_UNIT/GAP
   in app.js müssen zu grid-auto-rows/--gap hier passen). */
.bento {
    display: grid;
    column-gap: var(--gap);
    row-gap: 0;
    grid-auto-rows: 2px;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    grid-auto-flow: dense;
    align-items: start;
}
/* Spaltenraster wie die ursprüngliche Prod-Version. minmax(0, 1fr) statt
   1fr: sonst darf ein langes Wort eine Spalte über den Viewport drücken. */
@media (min-width: 640px)  { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px)  { .bento { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .bento { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 2000px) { .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile.size-wide  { grid-column: span 2; }
.tile.size-large { grid-column: span 2; }
/* Mindesthöhen = Prod-Kachelgrößen (220px-Raster); Inhalt darf die
   Kachel darüber hinaus wachsen lassen (Masonry — nichts wird geschnitten) */
.tile             { min-height: 220px; }
.tile.size-tall   { min-height: 452px; }
.tile.size-large  { min-height: 452px; }
@media (max-width: 639px) {
    .tile.size-wide, .tile.size-large { grid-column: span 1; }
    .tile { min-height: 150px; }
}

/* =========================================================
   Tile — Glas-Optik über Farbschichten (kein backdrop-filter)
   ========================================================= */
.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 12px 14px 10px;
    gap: 8px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, var(--tile-tint-bg), var(--tile-tint-bg-2) 100%);
    border: 1px solid var(--tile-tint-edge);
    overflow: hidden;
    transition: transform var(--t-med), border-color var(--t-med), box-shadow var(--t-med);
    --hue: 28;
    isolation: isolate;
}

/* Einstiegs-Animation nur beim ersten Render (JS setzt bento--animate) */
.bento--animate .tile { animation: tile-in 0.4s ease-out backwards; }
@keyframes tile-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .bento--animate .tile { animation: none; }
}

/* Glass-Edge Highlight oben (reiner Gradient, sehr günstig) */
.tile::before {
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, hsl(var(--hue) 80% 80% / 0.14) 0%, transparent 30%);
    z-index: 1;
}

/* Sanfter Farb-Glow links unten — Gradient statt filter:blur */
.tile::after {
    content: "";
    position: absolute;
    bottom: -45%; left: -15%;
    width: 75%; height: 95%;
    background: radial-gradient(ellipse closest-side, var(--tile-tint-glow), transparent 72%);
    pointer-events: none;
    z-index: 0;
    transition: opacity var(--t-med);
    opacity: 0.8;
}

.tile:hover {
    transform: translateY(-2px);
    border-color: hsl(var(--hue) 75% 65% / 0.55);
    box-shadow:
        0 14px 38px -14px rgba(0,0,0,0.5),
        0 0 0 1px hsl(var(--hue) 70% 60% / 0.15);
}
.tile:hover::after { opacity: 1; }
[data-theme="light"] .tile:hover { box-shadow: 0 14px 38px -16px rgba(20,20,28,0.25); }

.tile.is-dragging { opacity: 0.5; transform: scale(0.96); cursor: grabbing; }
.tile.drag-over   { box-shadow: inset 0 0 0 2px var(--accent); }

/* -------- Bild-Cover -------- */
.tile.has-image::before { opacity: 0.4; }

.tile__cover {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.55;
}
.tile.has-image .tile__cover::after {
    content: "";
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg,
            hsl(var(--hue) 40% 8% / 0.2) 0%,
            hsl(var(--hue) 40% 8% / 0.7) 72%,
            hsl(var(--hue) 40% 5% / 0.88) 100%);
}
[data-theme="light"] .tile.has-image .tile__cover::after {
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.8) 72%, rgba(255,255,255,0.92) 100%);
}

.tile > *:not(.tile__cover) { position: relative; z-index: 2; }

/* -------- Kachel-Kopf: Badge + Tags + Actions in einer Zeile -------- */
.tile__head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-height: 22px;
    overflow: hidden;
    flex-shrink: 0; /* nie vertikal quetschen — Platzausgleich macht der Body */
}

.tile__badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px;
    border-radius: 99px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: hsl(var(--hue) 90% 82%);
    background: hsl(var(--hue) 80% 50% / 0.22);
    border: 1px solid hsl(var(--hue) 70% 55% / 0.4);
    white-space: nowrap;
    flex-shrink: 0;
}
[data-theme="light"] .tile__badge { color: hsl(var(--hue) 60% 28%); }
.tile__badge .dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: hsl(var(--hue) 90% 60%);
}

.tile__head .tile__tags {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow: hidden;
    min-width: 0;
    flex-wrap: nowrap;
}
.tag {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: hsl(var(--hue) 30% 40% / 0.18);
    color: var(--text-3);
    border: 1px solid hsl(var(--hue) 40% 50% / 0.15);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 92px;
    line-height: 1.4;
}
[data-theme="light"] .tag { background: hsl(var(--hue) 50% 85% / 0.5); }

.tile__star {
    color: var(--accent-soft);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.tile__actions {
    display: flex;
    gap: 0;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--t-fast);
}
.tile:hover .tile__actions,
.tile:focus-within .tile__actions { opacity: 1; }
@media (hover: none) { .tile__actions { opacity: 1; } }

.js-grip { cursor: grab; }
.js-grip:active { cursor: grabbing; }

/* -------- Titel & Body -------- */
.tile__title {
    margin: 0;
    font-size: var(--tile-fs);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.005em;
    color: var(--text-1);
    overflow-wrap: anywhere;
    flex-shrink: 0; /* Titel wird nie vertikal beschnitten */
}
.tile.size-wide  .tile__title { font-size: 1rem; }
.tile.size-tall  .tile__title { font-size: 0.95rem; }
.tile.size-large .tile__title { font-size: 1.1rem; }

.tile__body {
    color: var(--text-2);
    font-size: var(--tile-fs);
    line-height: 1.5;
    flex: 1 1 auto;
    min-height: 0;
    /* Kein Clamp, kein Fade: die Kachelhöhe folgt dem Inhalt
       (Masonry-Spans in app.js) — es wird nichts abgeschnitten.
       Lange URLs/Wörter brechen um, statt rechts unter overflow:hidden
       der Kachel zu verschwinden. */
    overflow-wrap: anywhere;
}
.tile__body p { margin: 0 0 4px; }
.tile__body p:last-child { margin-bottom: 0; }
.tile__body a {
    color: hsl(var(--hue) 90% 78%);
    border-bottom: 1px solid hsl(var(--hue) 60% 60% / 0.4);
    transition: border-color var(--t-fast);
}
[data-theme="light"] .tile__body a { color: hsl(var(--hue) 65% 35%); }
.tile__body a:hover { border-bottom-color: currentColor; }
.tile__body code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    padding: 0 4px;
    border-radius: 3px;
    background: hsl(var(--hue) 30% 40% / 0.2);
}
.tile__body h1, .tile__body h2, .tile__body h3,
.tile__body h4, .tile__body h5, .tile__body h6 {
    margin: 3px 0 2px;
    font-size: var(--tile-fs);
    font-weight: 700;
    color: var(--text-1);
}
.tile__body ul, .tile__body .md-list { margin: 3px 0; padding-left: 15px; }

/* -------- Kachel-Fuß -------- */
.tile__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid hsl(var(--hue) 30% 40% / 0.18);
    min-height: 22px;
    flex-shrink: 0;
}
.tile__link {
    display: inline-flex; align-items: center; gap: 5px;
    font-weight: 600;
    font-size: 0.7rem;
    color: hsl(var(--hue) 90% 75%);
    transition: gap var(--t-fast), color var(--t-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
}
[data-theme="light"] .tile__link { color: hsl(var(--hue) 60% 35%); }
.tile__link:hover { gap: 8px; color: hsl(var(--hue) 95% 85%); }
.tile__link svg { width: 10px; height: 10px; }
.tile__date {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-3);
}

/* -------- Empty State -------- */
.empty {
    margin: 60px auto;
    max-width: 480px;
    padding: 40px 28px;
    text-align: center;
    border-radius: var(--r-xl);
    background: var(--surface-strong);
    border: 1px solid var(--border);
}
.empty__art { color: var(--text-3); margin-bottom: 14px; }

/* Fußzeile: Version + Quellcode-Link (AGPL §13) — bewusst leise */
.site-foot {
    max-width: var(--content-w);
    margin: 28px auto 18px;
    padding: 0 clamp(12px, 2vw, 24px);
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-3);
}
.site-foot a { text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.site-foot a:hover { color: var(--text-1); }

/* Suche/Filter ohne Treffer */
.noresults {
    margin: 40px auto;
    text-align: center;
    color: var(--text-3);
    font-size: 0.9rem;
}

/* -------- Öffentliche Demo (GitHub Pages, data-demo) -------- */
.demo-banner {
    max-width: var(--content-w);
    margin: 0 auto 12px;
    padding: 8px 14px;
    border-radius: var(--r-md);
    background: var(--surface-strong);
    border: 1px solid hsl(var(--accent-h) var(--accent-s) var(--accent-l) / 0.45);
    color: var(--text-2);
    font-size: 0.82rem;
}
.demo-banner strong { color: var(--accent-soft); }
[data-theme="light"] .demo-banner strong { color: var(--accent-deep); }
.demo-banner code { padding: 0 4px; border-radius: 4px; background: var(--surface-hover); }
.demo-banner a { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
[data-theme="light"] .demo-banner a { color: var(--accent-deep); }
.empty h2 { margin: 0 0 6px; font-weight: 700; letter-spacing: -0.02em; }
.empty p  { margin: 0 0 20px; color: var(--text-2); }

/* =========================================================
   Modal
   ========================================================= */
.modal {
    position: fixed; inset: 0; z-index: 100;
    display: grid; place-items: center;
    padding: 16px;
    animation: modal-in var(--t-med);
}
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: var(--scrim); }
.modal__panel {
    position: relative;
    width: min(620px, 100%);
    max-height: min(92vh, 860px);
    max-height: min(92dvh, 860px); /* iOS: Höhe ohne die eingeblendete Tastatur/Adressleiste */
    overflow-y: auto; overflow-x: hidden;
    background: var(--panel);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    padding: 28px;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
    animation: panel-in var(--t-med);
}
@keyframes modal-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes panel-in {
    from { transform: translateY(14px) scale(0.98); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .modal, .modal__panel { animation: none; }
}

.modal__close {
    position: absolute; top: 12px; right: 12px;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 8px;
    color: var(--text-2);
    transition: background var(--t-fast), color var(--t-fast);
}
.modal__close:hover { background: var(--surface-hover); color: var(--text-1); }

.modal__head { margin: 0 0 18px; }
.modal__head h2 { margin: 0 0 5px; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.modal__head p  { margin: 0; color: var(--text-2); font-size: 0.875rem; }

.modal__slot { display: none; }
.modal__slot.is-active { display: block; }

.modal__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* -------- Form -------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 560px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 5px; }
.field--span { grid-column: 1 / -1; }
.field > label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-2);
}
.field > label .muted { color: var(--text-3); font-weight: 400; }
.field > label code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--surface-hover);
}
.field input[type="text"],
.field input[type="url"],
.field input[type="password"],
.field input[type="email"],
.field select,
.field textarea {
    width: 100%;
    padding: 10px 13px;
    border-radius: var(--r-md);
    background: var(--field-bg);
    border: 1px solid var(--border);
    color: var(--text-1);
    transition: border-color var(--t-fast), background var(--t-fast);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-hover);
}
.field textarea {
    resize: vertical; min-height: 130px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.55;
}
/* iPad/iPhone zoomen beim Fokus in Felder unter 16px hinein */
@media (pointer: coarse) { .field textarea { font-size: 16px; } }
.field select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'><path d='m6 9 6 6 6-6' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
}

.md-editor { position: relative; display: flex; flex-direction: column; gap: 6px; }
.md-editor__preview {
    padding: 13px;
    border-radius: var(--r-md);
    background: var(--field-bg);
    border: 1px solid var(--border);
    font-size: 0.875rem; line-height: 1.55;
    color: var(--text-1);
    min-height: 70px;
}
.md-editor__preview p:first-child { margin-top: 0; }
.md-editor__preview p:last-child  { margin-bottom: 0; }
#md-toggle { align-self: flex-start; }

.checkbox {
    display: inline-flex !important; align-items: center; gap: 10px;
    font-size: 0.875rem !important; color: var(--text-1) !important;
    cursor: pointer;
}
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }

.filedrop {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px;
    padding: 18px;
    border-radius: var(--r-md);
    border: 2px dashed var(--border-strong);
    background: var(--field-bg);
    transition: border-color var(--t-fast), background var(--t-fast);
    text-align: center; cursor: pointer;
}
.filedrop:hover, .filedrop.is-over { border-color: var(--accent); background: var(--surface-hover); }
.filedrop input[type="file"] {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}
.filedrop__hint { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-2); }
.filedrop__hint u { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 3px; }
.filedrop__preview { max-width: 130px; max-height: 130px; border-radius: var(--r-sm); object-fit: cover; }
.filedrop__remove {
    font-size: 0.8rem;
    color: var(--danger);
    text-decoration: underline;
    text-underline-offset: 3px;
    z-index: 1;
}

/* =========================================================
   Toasts
   ========================================================= */
.toasts {
    position: fixed; bottom: 16px; right: 16px; z-index: 200;
    display: flex; flex-direction: column; gap: 8px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 15px;
    border-radius: var(--r-md);
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 12px 30px -10px rgba(0,0,0,0.5);
    color: var(--text-1);
    font-size: 0.85rem;
    animation: toast-in 0.3s ease-out;
    pointer-events: auto;
    max-width: 340px;
}
.toast--success { border-left: 3px solid var(--success); }
.toast--error   { border-left: 3px solid var(--danger); }
.toast--info    { border-left: 3px solid var(--accent); }
.toast.is-leaving { animation: toast-out 0.3s var(--t-fast) forwards; }
@keyframes toast-in  { from { transform: translateX(100%); opacity: 0; } }
@keyframes toast-out { to   { transform: translateX(120%); opacity: 0; } }

.muted { color: var(--text-3); }

@media print {
    .topbar, .modal, .toasts, .aurora, .tile__actions { display: none !important; }
    .tile { break-inside: avoid; border: 1px solid #ccc; background: white; }
    body { background: white; color: black; }
}
