/* Byte Development Panel – gleicher Look wie die Website */

/* ---------- Schriften ---------- */
@font-face { font-family: "Big Shoulders Display"; src: url("/fonts/big-shoulders-display-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* ---------- Farben ---------- */
:root {
  --bg: #08070b;
  --bg-2: #0f0d13;
  --bg-3: #16131b;
  --surface: rgba(15, 13, 19, 0.78);
  --surface-2: rgba(22, 19, 27, 0.85);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eceaf0;
  --muted: #8d8a96;
  --sun-1: #ffc23d;
  --sun-2: #ff6a3d;
  --sun-3: #ff2e7e;
  --sun: linear-gradient(180deg, var(--sun-1), var(--sun-2) 50%, var(--sun-3));
  --ok: #4ade80;
  --danger: #ff5a6e;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Archivo", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --pad: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --overlay: radial-gradient(ellipse at 50% 30%, rgba(8, 7, 11, 0.55), rgba(8, 7, 11, 0.9) 75%), linear-gradient(180deg, rgba(8, 7, 11, 0.8), rgba(8, 7, 11, 0.92));
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f1ec;
  --bg-2: #ffffff;
  --bg-3: #ebe6df;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-2: rgba(255, 255, 255, 0.92);
  --line: rgba(22, 18, 28, 0.1);
  --line-strong: rgba(22, 18, 28, 0.2);
  --text: #16121c;
  --muted: #5e5867;
  --ok: #16a34a;
  --danger: #dc2645;
  --overlay: radial-gradient(ellipse at 50% 30%, rgba(244, 241, 236, 0.7), rgba(244, 241, 236, 0.93) 75%), linear-gradient(180deg, rgba(244, 241, 236, 0.85), rgba(244, 241, 236, 0.95));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--sun-2); color: #000; }

.grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 100; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
[data-theme="light"] .grain { opacity: 0.03; }
@keyframes grain { 0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } 100% { transform: translate(0, 0); } }
.bg { position: fixed; inset: 0; z-index: -1; background: url("/img/artwork.jpg") center / cover no-repeat; }
.bg::after { content: ""; position: absolute; inset: 0; background: var(--overlay); }

/* ---------- Bausteine ---------- */
.eyebrow { margin: 0 0 14px; font: 600 11px/1 var(--body); font-stretch: 125%; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; display: inline-block; width: 18px; height: 2px; margin: 0 10px 3px 0; background: var(--sun-2); vertical-align: middle; }
.h1 { margin: 0; font: 900 clamp(48px, 7vw, 96px)/1.02 var(--display); text-transform: uppercase; }
.h2 { margin: 0; font: 900 clamp(40px, 5vw, 72px)/1.02 var(--display); text-transform: uppercase; }
.lead { margin: 14px 0 0; max-width: 40em; color: var(--muted); font-size: 16px; }

.btn {
  --h: 44px;
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 20px; border: 0; border-radius: 4px; cursor: pointer;
  font: 700 13px/1 var(--body); font-stretch: 115%; letter-spacing: 0.08em; text-transform: uppercase;
  color: #120a08; background: var(--sun-2);
  transition: box-shadow 0.25s var(--ease), opacity 0.2s;
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--sun-1); transform: translateX(-101%); transition: transform 0.4s var(--ease); }
.btn:hover::before { transform: none; }
.btn:hover { box-shadow: 0 10px 34px -10px rgba(255, 106, 61, 0.6); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn:disabled::before { display: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.is-spinning svg { animation: spin 0.8s linear infinite reverse; }
.btn--ghost { color: var(--text); background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--ghost::before { background: rgba(255, 255, 255, 0.06); }
[data-theme="light"] .btn--ghost::before { background: rgba(22, 18, 28, 0.06); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--text); }
.btn--small { --h: 34px; padding: 0 14px; font-size: 11px; }
.btn--big { --h: 56px; padding: 0 30px; font-size: 15px; }
.btn--danger { color: var(--danger); background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.btn--danger::before { background: rgba(255, 90, 110, 0.12); }

.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; transition: background 0.2s, color 0.2s; }
.icon-btn:hover { background: var(--line); color: var(--text); }
.icon-btn:disabled { opacity: 0.3; cursor: default; background: transparent; }
.icon-btn--danger:hover { color: var(--danger); }
.icon-btn svg { width: 16px; height: 16px; }

.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 99px; font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.badge--live { color: var(--sun-1); border-color: rgba(255, 194, 61, 0.4); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

svg.i { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg.i--fill { fill: currentColor; stroke: none; }
.btn--big svg { width: 20px; height: 20px; }

/* ---------- Kopfzeile ---------- */
.top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 24px; padding: 14px var(--pad); background: rgba(8, 7, 11, 0.72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
[data-theme="light"] .top { background: rgba(244, 241, 236, 0.82); }
.top__brand { display: flex; align-items: center; gap: 12px; font: 900 22px/1 var(--display); flex: none; }
.top__brand img { border-radius: 50%; }
.top__brand em { margin-left: 8px; font: 600 10px/1 var(--body); font-style: normal; font-stretch: 125%; letter-spacing: 0.3em; color: var(--sun-2); }
.top__crumbs { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; font: 500 12px/1 var(--mono); color: var(--muted); overflow: hidden; }
.top__crumbs a { white-space: nowrap; transition: color 0.2s; }
.top__crumbs a:hover { color: var(--text); }
.top__crumbs span { opacity: 0.4; }
.top__crumbs b { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__right { display: flex; align-items: center; gap: 14px; flex: none; }
.user { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 13px; }
.user img, .user .avatar { width: 28px; height: 28px; border-radius: 50%; }
.user .avatar { display: grid; place-items: center; background: var(--sun); color: #120a08; font: 800 13px/1 var(--body); }
.user .icon-btn { width: 28px; height: 28px; border-radius: 50%; }

.theme-toggle { position: relative; display: inline-flex; align-items: center; justify-content: space-between; width: 62px; height: 32px; padding: 0 8px; flex: none; border: 1px solid var(--line-strong); border-radius: 99px; background: transparent; cursor: pointer; }
.theme-toggle__knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--sun); box-shadow: 0 2px 10px rgba(255, 106, 61, 0.45); transition: transform 0.45s var(--ease); }
.theme-toggle__icon { position: relative; width: 13px; height: 13px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle__icon--moon { stroke: #120a08; fill: #120a08; }
[data-theme="light"] .theme-toggle__knob { transform: translateX(30px); }
[data-theme="light"] .theme-toggle__icon--moon { stroke: var(--muted); fill: none; }
[data-theme="light"] .theme-toggle__icon--sun { stroke: #120a08; }

/* ---------- Seitenaufbau ---------- */
.app { min-height: calc(100vh - 61px); }
.page { max-width: 1240px; margin: 0 auto; padding: clamp(40px, 6vw, 80px) var(--pad) 120px; animation: pageIn 0.6s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } }
.stagger > * { animation: pageIn 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }

/* Login */
.login { min-height: calc(100vh - 61px); display: grid; place-content: center; justify-items: center; text-align: center; padding: 60px var(--pad); animation: pageIn 0.7s var(--ease) both; }
.login .h1 { font-size: clamp(56px, 9vw, 120px); }
.login .lead { margin: 18px auto 34px; }
.login__error { margin: -14px 0 24px; color: var(--danger); font-size: 14px; }
.login__note { margin-top: 26px; font: 400 12px/1.5 var(--mono); color: var(--muted); max-width: 34em; }

/* Script-Übersicht */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; margin-bottom: 44px; }
/* Dezente Trennlinie zwischen Kopf (mit Aktualisieren-Knopf) und den Script-Karten */
.head--line { padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 240px; padding: 26px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); backdrop-filter: blur(10px);
  overflow: hidden; transition: border-color 0.3s, transform 0.4s var(--ease);
}
a.card:hover { border-color: rgba(255, 106, 61, 0.55); transform: translateY(-3px); }
.card::before { content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 0.3s; background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 106, 61, 0.13), transparent 60%); }
a.card:hover::before { opacity: 1; }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: rgba(255, 106, 61, 0.12); color: var(--sun-2); }
.card__icon svg { width: 22px; height: 22px; }
.card h3 { margin: 0; font: 900 34px/1.02 var(--display); text-transform: uppercase; }
.card p { margin: 0; color: var(--muted); }
.card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); font: 500 11px/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.card__foot .go { color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
.card__foot .go svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
a.card:hover .card__foot .go svg { transform: translateX(4px); }
.card--locked h3, .card--locked p { opacity: 0.75; }
.card--locked .card__foot .btn { letter-spacing: 0.08em; }
.card--locked .card__icon { background: var(--line); color: var(--muted); }

.empty { padding: 34px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--muted); }
.empty strong { display: block; margin-bottom: 6px; color: var(--text); font: 800 24px/1.1 var(--display); text-transform: uppercase; }

/* Script-Ansicht mit Seitenleiste */
.layout { display: grid; grid-template-columns: 270px 1fr; gap: 0; max-width: 1400px; margin: 0 auto; min-height: calc(100vh - 61px); }
.side { position: sticky; top: 61px; align-self: start; height: calc(100vh - 61px); overflow-y: auto; padding: 32px 16px 32px var(--pad); border-right: 1px solid var(--line); }
.side__title { display: block; margin: 0 0 4px 10px; font: 900 30px/1.02 var(--display); text-transform: uppercase; }
.side__sub { margin: 0 0 24px 10px; font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; color: var(--muted); font-size: 14px; transition: background 0.2s, color 0.2s; }
.side nav a svg { width: 17px; height: 17px; flex: none; }
.side nav a:hover { background: var(--line); color: var(--text); }
.side nav a.is-active { background: rgba(255, 106, 61, 0.12); color: var(--text); box-shadow: inset 2px 0 0 var(--sun-2); }
.side nav a.is-active svg { color: var(--sun-2); }
.side nav a .count { margin-left: auto; font: 500 10px/1 var(--mono); opacity: 0.7; }
.side__label { margin: 24px 0 8px 12px; font: 600 10px/1 var(--body); font-stretch: 125%; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.main { min-width: 0; padding: clamp(32px, 5vw, 60px) var(--pad) 140px; animation: pageIn 0.5s var(--ease) both; }

/* Fenster (Update-Anleitung) */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(8, 7, 11, 0.7); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.3s; }
[data-theme="light"] .modal { background: rgba(244, 241, 236, 0.7); }
.modal.is-show { opacity: 1; }
.modal__box { position: relative; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 32px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.7); transform: translateY(16px) scale(0.98); transition: transform 0.4s var(--ease); }
.modal.is-show .modal__box { transform: none; }
.modal__close { position: absolute; top: 14px; right: 14px; font-size: 22px; }
.modal__box--small { width: min(440px, 100%); padding: 28px; }
.modal__title { margin: 0 0 14px; padding-right: 30px; font: 900 clamp(36px, 5vw, 52px)/1.02 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.modal__title--small { font-size: clamp(28px, 4vw, 36px); margin-bottom: 12px; }
.modal__text { margin: 0; color: var(--muted); font-size: 15px; }
.btn--danger-solid { background: var(--danger); color: #fff; }
.btn--danger-solid::before { background: #ff7d8d; }
.modal__title { font-size: clamp(36px, 5vw, 52px); margin-bottom: 14px; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.guide__safe { margin: 0 0 20px; padding: 12px 14px; border-radius: 6px; background: rgba(74, 222, 128, 0.1); color: var(--ok); font-size: 14px; }
.guide { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.guide__step { display: grid; grid-template-columns: 32px 1fr; gap: 14px; animation: pageIn 0.5s var(--ease) both; }
.guide__step:nth-child(2) { animation-delay: 0.08s; }
.guide__step:nth-child(3) { animation-delay: 0.16s; }
.guide__step:nth-child(4) { animation-delay: 0.24s; }
.guide__n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sun); color: #120a08; font: 800 14px/1 var(--body); }
.guide__step strong { display: block; margin-top: 5px; font-size: 15px; }
.guide__step p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }

/* Versionen */
.version { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; font: 500 11px/1.4 var(--mono); color: var(--muted); }
.version__text { display: inline-flex; align-items: center; gap: 8px; }
.version__muted { opacity: 0.8; }
.version--ok .version__text { color: var(--ok); }
.version--outdated .version__text { color: var(--sun-1); }
.version .btn { --h: 28px; padding: 0 12px; font-size: 10px; }
.side__version { margin: -10px 0 22px 10px; }
.side__version .version { flex-direction: column; align-items: flex-start; }

.overview-boxes { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 14px; margin-bottom: 28px; align-items: stretch; }
.overview-boxes > .section-box { margin: 0; }
.version-box { display: flex; flex-direction: column; gap: 18px; }
.version-box__rows { display: grid; gap: 10px; }
.version-box__row { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.version-box__row strong { font: 500 13px/1.4 var(--mono); color: var(--text); }
.version-box__row strong.is-ok { color: var(--ok); }
.version-box__row strong.is-warn { color: var(--sun-1); }
.version-box__actions { margin-top: auto; display: grid; gap: 8px; }
.version-box__actions small { color: var(--muted); font-size: 12px; }
@media (max-width: 960px) { .overview-boxes { grid-template-columns: 1fr; } }

.license { display: grid; gap: 14px; }
.license .section-box__title { margin: 0 0 6px; }
.license__title { display: inline-flex; align-items: center; gap: 10px; }
.license__title svg { width: 20px; height: 20px; color: var(--sun-2); }
.license__text p { margin: 0; color: var(--muted); max-width: 60em; }
.license__text code { font: 500 12px/1 var(--mono); color: var(--text); padding: 2px 6px; border-radius: 3px; background: var(--line); }
.license__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.license__key { flex: 1 1 320px; min-width: 0; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface-2); font: 500 13px/1.2 var(--mono); overflow-wrap: anywhere; }
.license__info { font: 400 12px/1.4 var(--mono); color: var(--muted); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cat-grid .card { min-height: 190px; padding: 22px; }
.cat-grid .card h3 { font-size: 26px; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 28px; max-width: 980px; }
.section-box { padding: 26px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); backdrop-filter: blur(10px); }
.section-box__title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; font: 800 22px/1.1 var(--display); text-transform: uppercase; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px 22px; }
.field { display: grid; gap: 7px; align-content: start; }
/* Überschrift immer zwei Zeilen hoch und unten bündig: Eingabefelder einer Reihe stehen auf gleicher Höhe */
.field > span { display: flex; align-items: flex-end; min-height: 2.6em; font: 600 11px/1.3 var(--body); font-stretch: 112%; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.field--toggle { padding-top: calc(2.6 * 11px + 7px); }
.field small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.input, .select {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 5px;
  background: var(--surface-2); font: 400 14px/1 var(--mono); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus, .select:focus { border-color: var(--sun-2); box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.18); }
.select { appearance: none; padding-right: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238d8a96' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.select option { background: var(--bg-2); color: var(--text); }
.color { display: flex; align-items: center; gap: 10px; }
.color input[type="color"] { width: 42px; height: 42px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface-2); cursor: pointer; }
.color .input { flex: 1; }

.switch { display: flex; align-items: center; gap: 12px; min-height: 42px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { position: relative; width: 40px; height: 22px; flex: none; border-radius: 99px; background: var(--line-strong); transition: background 0.25s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform 0.3s var(--ease); }
.switch input:checked + .switch__track { background: var(--sun-2); }
.switch input:checked + .switch__track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px rgba(255, 106, 61, 0.3); }
.switch__text { font-size: 14px; }

/* Listen (Fahrzeuge, Wachen, ...) */
.list { display: grid; gap: 8px; }
.item { border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); transition: border-color 0.2s; animation: pageIn 0.35s var(--ease) both; }
.item.is-open { border-color: var(--line-strong); }
.item__head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; cursor: pointer; }
.item__swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.item__title { flex: 1; min-width: 0; font: 500 14px/1.3 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__meta { font: 400 12px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.item__chev { transition: transform 0.3s var(--ease); }
.item.is-open .item__chev { transform: rotate(180deg); }
.item__actions { display: flex; gap: 2px; }
.item__body { display: none; padding: 6px 14px 18px; border-top: 1px solid var(--line); }
.item.is-open .item__body { display: block; animation: pageIn 0.3s var(--ease) both; }
.item__body .fields { margin-top: 12px; }
.list-add { margin-top: 12px; }
.list-empty { padding: 20px; border: 1px dashed var(--line-strong); border-radius: 6px; color: var(--muted); text-align: center; font-size: 14px; }

.secret-set { display: flex; align-items: center; gap: 10px; }
.secret-set .badge { color: var(--ok); border-color: currentColor; }

/* Speichern-Leiste */
.savebar {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 20px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-2); backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, 140%); transition: transform 0.45s var(--ease);
}
.savebar.is-show { transform: translate(-50%, 0); }
.savebar__text { display: flex; align-items: center; gap: 10px; font-size: 14px; white-space: nowrap; }
.savebar__text .dot { color: var(--sun-1); }

.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 60; max-width: 360px;
  padding: 12px 16px; border-radius: 6px; background: #14301f; color: #86efac; font: 500 13px/1.4 var(--mono);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.3s, transform 0.4s var(--ease);
}
.toast.is-show { opacity: 1; transform: none; }
.toast.is-error { background: #3a1219; color: #ffb3bf; }
[data-theme="light"] .toast { background: #dcfce7; color: #166534; }
[data-theme="light"] .toast.is-error { background: #ffe4e8; color: #9f1239; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font: 400 12px/1.4 var(--mono); }

.loading { display: grid; place-items: center; min-height: 50vh; color: var(--muted); font: 500 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.loading::before { content: ""; width: 28px; height: 28px; margin-bottom: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--sun-2); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Team-Zugänge auf der Übersicht ---------- */
.team-section { margin-top: 64px; }
.overview-boxes--single { grid-template-columns: 1fr; }

/* ---------- Nur-Ansicht ---------- */
.notice { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid rgba(255, 194, 61, 0.35); border-radius: 6px; background: rgba(255, 194, 61, 0.08); color: var(--sun-1); font-size: 14px; }
.notice svg { width: 16px; height: 16px; flex: none; }
fieldset.readonly { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 28px; opacity: 0.75; }
fieldset.readonly .item__actions, fieldset.readonly .list-add { display: none; }

/* ---------- Verlauf ---------- */
.history { display: grid; gap: 28px; max-width: 980px; }
.history__date { margin: 0 0 10px; }
.history__day { display: grid; gap: 8px; }
.history__item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); backdrop-filter: blur(10px); }
.history__avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); color: #120a08; font: 800 14px/1 var(--body); }
.history__body { min-width: 0; }
.history__line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: 14px; }
.history__line time { margin-left: auto; font: 400 12px/1 var(--mono); color: var(--muted); }
.history__cat { color: var(--sun-1); }
.history__changes { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font: 400 12px/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.history__changes b { color: var(--text); font-weight: 500; }
.chg { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 3px; background: var(--line); color: var(--text); }
.chg--add { background: rgba(74, 222, 128, 0.14); color: var(--ok); }
.chg--del { background: rgba(255, 90, 110, 0.14); color: var(--danger); text-decoration: line-through; }

/* ---------- Team ---------- */
.team { display: grid; gap: 22px; max-width: 980px; }
.team__add { display: flex; gap: 10px; }
.team__add .input { flex: 1; min-width: 0; }
.team__hint { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; }
.team__list { display: grid; gap: 8px; }
.team__row { display: grid; grid-template-columns: 36px minmax(0, 1.2fr) minmax(0, 1.6fr) auto; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.team__row--owner { border-color: rgba(255, 106, 61, 0.35); }
.team__avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--sun); color: #120a08; font: 800 14px/1 var(--body); }
.team__who { min-width: 0; display: grid; gap: 2px; }
.team__who strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team__who small { color: var(--muted); font: 400 11px/1.3 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team__perms { min-width: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.team__actions { display: flex; gap: 2px; justify-content: flex-end; min-width: 68px; }

.perms { display: grid; gap: 10px; }
.perms .side__label { margin: 8px 0 0; }
.perm-modes { display: grid; gap: 8px; }
.perm-mode { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.perm-mode:has(input:checked) { border-color: var(--sun-2); background: rgba(255, 106, 61, 0.08); }
.perm-mode input { margin-top: 3px; accent-color: var(--sun-2); }
.perm-mode strong { display: block; font-size: 14px; }
.perm-mode small, .switch__text small { display: block; color: var(--muted); font-size: 12px; }
.perm-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; padding: 4px 0 0 4px; }
.check { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 5px; background: var(--surface-2); cursor: pointer; font-size: 13px; }
.check input { accent-color: var(--sun-2); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 20px var(--pad) 0; border-right: 0; }
  .side nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 12px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .side nav a { white-space: nowrap; }
  .side nav a .count { display: none; }
  .side__label { display: none; }
  .top__crumbs { display: none; }
}
@media (max-width: 620px) {
  .user span { display: none; }
  .top__brand em { display: none; }
  .savebar { left: 12px; right: 12px; transform: translateY(140%); }
  .savebar.is-show { transform: none; }
  .savebar__text span:last-child { display: none; }
  .item__meta { display: none; }
  .team__row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .team__perms { grid-column: 2 / -1; grid-row: 2; }
  .team__add { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .grain { display: none; }
}
