/* ============================================================================
   SmashPad — Design-System
   Dark, modern, frische Akzente. Fonts: Roboto / Roboto Condensed / Roboto Mono.
   ========================================================================== */

:root {
    /* --- Flächen (dunkel, leicht bläulich) --- */
    --bg:          #0c0d11;   /* App-Hintergrund hinter der schwebenden Sidebar */
    --surface:     #14161d;   /* Karten, Sidebar */
    --surface-2:   #1b1e27;   /* Inputs, erhöhte Flächen */
    --surface-3:   #232734;   /* Hover */
    --border:      #272b36;
    --border-2:    #353b49;

    /* --- Text --- */
    --text:        #e8eaf0;
    --muted:       #9aa1b1;
    --faint:       #646b7d;

    /* --- Akzente --- */
    --accent:      #7c6cff;   /* Primär: Indigo/Violett */
    --accent-2:    #28e0c8;   /* Sekundär: Teal/Mint */
    --accent-ink:  #0b0a1a;   /* Text auf Akzentflächen */
    --accent-soft: rgba(124, 108, 255, 0.14);
    --accent-glow: rgba(124, 108, 255, 0.45);

    /* --- Status --- */
    --success:     #34d399;
    --warning:     #fbbf24;
    --danger:      #fb7185;
    --info:        #60a5fa;

    /* --- Radien --- */
    --r-xs: 7px;
    --r-sm: 10px;
    --r:    14px;
    --r-lg: 20px;
    --r-xl: 26px;

    /* --- Maße --- */
    --side-w: 320px;
    --gap:    18px;

    /* --- Schatten --- */
    --shadow:    0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, 0.7);

    /* --- Fonts --- */
    --font:  'Roboto', system-ui, sans-serif;
    --font-cond: 'Roboto Condensed', 'Roboto', sans-serif;
    --font-mono: 'Roboto Mono', ui-monospace, monospace;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
/* hidden-Attribut muss display-Regeln von Komponenten (.cat-form etc.) schlagen */
[hidden] { display: none !important; }
body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 100% -10%, rgba(124, 108, 255, 0.10), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(40, 224, 200, 0.07), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; }

/* Headline-/Label-Typo: Roboto Condensed, all-caps, 1px Spacing */
.h-cond, .page-title, .nav__label, .card__title, .sg-section__title, .stat__label, .table th {
    font-family: var(--font-cond);
    text-transform: uppercase;
    letter-spacing: 1px;
}
code, kbd, .mono { font-family: var(--font-mono); }

/* ============================================================================
   Layout
   ========================================================================== */
.topbar { display: none; }

.sidebar {
    position: fixed;
    top: var(--gap);
    left: var(--gap);
    bottom: var(--gap);
    width: var(--side-w);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 14px;
    background: linear-gradient(180deg, var(--surface), #11131a);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 8px 16px;
}
.brand__mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), #5b8cff);
    color: #fff;
    font-size: 18px;
    box-shadow: 0 6px 18px -6px var(--accent-glow);
}
.brand__name {
    font-family: var(--font);
    font-size: 21px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.brand__light { font-weight: 300; }
.brand__bold  { font-weight: 700; }

/* Schließen-Button: nur im Mobile-Vollbild-Drawer sichtbar.
   .sidebar-Präfix für höhere Spezifität als .icon-btn (sonst auf Desktop sichtbar). */
.sidebar .sidebar__close { display: none; position: absolute; top: 16px; right: 16px; z-index: 1; }

.nav { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; flex: 1; }
.nav__group { display: flex; flex-direction: column; gap: 3px; }
.nav__label {
    margin: 4px 10px 6px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--faint);
}
.nav__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    color: var(--muted);
    font-weight: 500;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.nav__icon { width: 20px; text-align: center; font-size: 16px; }
.nav__item:hover { background: var(--surface-3); color: var(--text); }
.nav__item.is-active {
    background: var(--accent-soft);
    color: #fff;
}
.nav__item.is-active::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    border-radius: 0 4px 4px 0;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}
.nav__item.is-active .nav__icon {
    color: var(--accent);
    /* Duotone: beide Ebenen Indigo, Sekundär nur per Opacity reduziert */
    --fa-primary-color: var(--accent);
    --fa-secondary-color: var(--accent);
    --fa-primary-opacity: 1;
    --fa-secondary-opacity: 0.3;
}

.sidebar__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 10px 4px;
    border-top: 1px solid var(--border);
    margin-top: 6px;
    color: var(--faint);
    font-size: 12px;
}
.sidebar__foot-link { margin-left: auto; color: var(--faint); font-size: 15px; transition: color .15s var(--ease); }
.sidebar__foot-link:hover { color: var(--accent); }
.status-dot { width: 9px; height: 9px; border-radius: 99px; background: var(--faint); box-shadow: 0 0 0 3px rgba(255,255,255,.03); }
.status-dot.is-on  { background: var(--success); box-shadow: 0 0 10px var(--success); }
.status-dot.is-off { background: var(--danger); }

.main {
    margin-left: calc(var(--side-w) + var(--gap) * 2);
    padding: calc(var(--gap) + 6px) calc(var(--gap) + 10px) 64px;
    min-height: 100vh;
}
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-title { display: flex; align-items: center; gap: 13px; font-size: 22px; font-weight: 700; }
.page-title i { color: var(--accent); font-size: 20px; }
.page-body { display: flex; flex-direction: column; gap: 20px; }

.scrim {
    position: fixed; inset: 0;
    background: rgba(4, 5, 8, 0.6);
    backdrop-filter: blur(2px);
    z-index: 35;
    opacity: 0; transition: opacity .2s var(--ease);
}
.scrim.is-shown { opacity: 1; }

/* ============================================================================
   Karten / Grid
   ========================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 22px;
    box-shadow: var(--shadow);
}
.card--pad-lg { padding: 28px; }
.card__title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card__sub { color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.cluster { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ============================================================================
   Buttons
   ========================================================================== */
.btn {
    --btn-bg: var(--surface-2);
    --btn-fg: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 18px;
    border: 1px solid var(--border-2);
    border-radius: 8px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), filter .15s var(--ease);
    white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.btn i { font-size: 15px; }

.btn--primary {
    --btn-bg: linear-gradient(135deg, var(--accent), #6a7bff);
    --btn-fg: #fff;
    border-color: transparent;
    box-shadow: 0 8px 22px -10px var(--accent-glow);
}
/* Hover: leichtes dunkles Overlay statt Aufhellung, Verlauf bleibt erhalten. */
.btn--primary:hover { background: linear-gradient(135deg, var(--accent), #6a7bff); filter: brightness(0.84); }

.btn--accent2 {
    --btn-bg: linear-gradient(135deg, var(--accent-2), #19b9c9);
    --btn-fg: var(--accent-ink);
    border-color: transparent;
}
.btn--accent2:hover { background: linear-gradient(135deg, var(--accent-2), #19b9c9); filter: brightness(0.84); }

/* Ghost: sehr subtile Outline, die beim Hover verschwindet. */
.btn--ghost { --btn-bg: transparent; border-color: color-mix(in srgb, var(--border) 55%, transparent); }
.btn--ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn--danger { --btn-bg: transparent; --btn-fg: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.btn--sm { padding: 8px 13px; font-size: 13px; }
.btn--block { width: 100%; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px; height: 42px;
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    transition: background .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); }

/* Icon-only Action-Button: quadratisch, Höhe wie .btn--sm (für Tabellen-Aktionen) */
.icon-btn--sm { width: 38px; height: 38px; font-size: 14px; border-radius: 8px; }

/* ============================================================================
   Formularelemente
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label {
    font-family: var(--font-cond);
    text-transform: uppercase;
    letter-spacing: .7px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
}
.field__hint { font-size: 12px; color: var(--faint); }

.input, .textarea {
    width: 100%;
    padding: 13px 15px;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--surface);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input--mono { font-family: var(--font-mono); }

.input-group { display: flex; align-items: stretch; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .input-group__addon {
    display: grid; place-items: center;
    padding: 0 14px;
    border: 1px solid var(--border-2);
    border-left: 0;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 14px;
}

/* --- Custom Select (inline Dropdown, ersetzt native <select>) --- */
.select { position: relative; width: 100%; }
.select__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 15px;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.select__trigger:hover { border-color: var(--faint); }
.select.is-open .select__trigger,
.select__trigger:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.select__value { display: flex; align-items: center; gap: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select__value.is-placeholder { color: var(--faint); }
.select__caret { color: var(--muted); font-size: 13px; transition: transform .2s var(--ease); }
.select.is-open .select__caret { transform: rotate(180deg); }

.select__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    z-index: 30;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    margin: 0;
    list-style: none;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .15s var(--ease), transform .15s var(--ease);
}
.select.is-open .select__menu { opacity: 1; transform: none; pointer-events: auto; }
.select__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--r-xs);
    cursor: pointer;
    font-size: 14px;
    color: var(--muted);
}
.select__option:hover, .select__option.is-active { background: var(--surface-3); color: var(--text); }
.select__option.is-selected { color: #fff; }
.select__option.is-selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 7 Pro';
    font-weight: 300;
    margin-left: auto;
    color: var(--accent);
    font-size: 12px;
}

/* --- Toggle / Switch --- */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
    position: relative;
    width: 46px; height: 26px;
    border-radius: 99px;
    background: var(--surface-3);
    border: 1px solid var(--border-2);
    transition: background .2s var(--ease), border-color .2s var(--ease);
    flex: none;
}
.switch__track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    border-radius: 99px;
    background: #fff;
    transition: transform .2s var(--ease);
    box-shadow: 0 2px 5px rgba(0,0,0,.4);
}
.switch input:checked + .switch__track {
    background: linear-gradient(135deg, var(--accent), #6a7bff);
    border-color: transparent;
}
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch__label { font-size: 14px; }

/* --- Checkbox --- */
.check { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
    display: grid; place-items: center;
    width: 22px; height: 22px;
    border-radius: 7px;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: transparent;
    font-size: 12px;
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
    flex: none;
}
.check input:checked + .check__box {
    background: linear-gradient(135deg, var(--accent), #6a7bff);
    border-color: transparent;
    color: #fff;
}
.check input:focus-visible + .check__box { box-shadow: 0 0 0 3px var(--accent-soft); }

/* --- Radio (als Option-Pills) --- */
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented__opt {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    border-radius: var(--r-xs);
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.segmented input:checked + .segmented__opt { background: var(--accent-soft); color: #fff; }
.segmented input:focus-visible + .segmented__opt { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ============================================================================
   Badges, Pills, Kbd, Tabelle
   ========================================================================== */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
    background: var(--surface-3);
    color: var(--muted);
    border: 1px solid var(--border);
}
.badge--accent { background: var(--accent-soft); color: #cfc8ff; border-color: transparent; }
.badge--success { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); border-color: transparent; }
.badge--warning { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); border-color: transparent; }
.badge--danger  { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); border-color: transparent; }
.badge--info    { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); border-color: transparent; }

kbd {
    display: inline-block;
    padding: 3px 8px;
    background: var(--surface-3);
    border: 1px solid var(--border-2);
    border-bottom-width: 2px;
    border-radius: 7px;
    font-size: 12.5px;
    color: var(--text);
}

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.table th { font-size: 11px; font-weight: 600; color: var(--muted); }
.table tbody tr { transition: background .12s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table--mono td { font-family: var(--font-mono); font-size: 13px; }

/* ============================================================================
   Styleguide-spezifisch
   ========================================================================== */
.sg-section { scroll-margin-top: 20px; }
.sg-section__title { font-size: 13px; color: var(--muted); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.sg-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.sg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.sg-note { color: var(--faint); font-size: 12.5px; margin-top: 10px; }

.swatch { border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); }
.swatch__chip { height: 64px; }
.swatch__meta { padding: 9px 11px; background: var(--surface-2); font-size: 12px; }
.swatch__name { font-weight: 500; }
.swatch__hex { color: var(--faint); font-family: var(--font-mono); font-size: 11px; }

.type-spec { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.type-spec small { color: var(--faint); font-size: 11px; font-family: var(--font-mono); }

/* Stat-Kachel (Dashboard) */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat__label { font-size: 11px; color: var(--muted); }
.stat__value { font-size: 30px; font-weight: 700; font-family: var(--font-cond); }
.stat__value--success { color: var(--success); }
.stat__value--warning { color: var(--warning); }
.stat__value--danger  { color: var(--danger); }
.stat__sub { font-size: 12px; color: var(--faint); font-family: var(--font-mono); margin-top: 2px; }

/* Abschnitts-Überschrift auf dem Dashboard */
.dash-heading {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-cond); text-transform: uppercase; letter-spacing: 1px;
    font-size: 13px; color: var(--muted); margin: 6px 2px -4px;
}
.dash-heading i { color: var(--accent); font-size: 15px; }
.stat__icon { position: absolute; right: 18px; top: 18px; font-size: 22px; color: var(--accent); opacity: .5; }
.card--stat { position: relative; transition: border-color .18s var(--ease); }
/* Hover: Border nimmt dezent die Akzentfarbe an (reduzierte Opacity). */
.card--stat:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

.placeholder {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 56px 24px; text-align: center; color: var(--muted);
}
.placeholder i { font-size: 34px; color: var(--accent); opacity: .7; }
.placeholder h3 { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: 1px; color: var(--text); }

/* ============================================================================
   Sounds-Seite: Upload / Dropzone / Drop-Overlay / Toasts
   ========================================================================== */
.btn--action-top { padding: 15px 18px; font-size: 15px; }

/* Formular-Cards: gleicher vertikaler Rhythmus wie das Grid (18px). */
.upload-form, .cat-form, .wh-form { display: flex; flex-direction: column; gap: 18px; }

/* Settings-Zeile: Beschreibung links, Control rechts */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.setting-row__title { font-weight: 500; }
.setting-row__desc { font-size: 13px; color: var(--muted); margin-top: 3px; max-width: 64ch; line-height: 1.5; }

/* Range-Slider (Lautstärke o. Ä.). Akzent-Füllung links vom Daumen über
   --fill (in %), per JS gesetzt. Cross-Browser: WebKit + Firefox. */
.slider { display: flex; align-items: center; gap: 16px; }
.slider__range {
    --fill: 50%;
    -webkit-appearance: none; appearance: none;
    flex: 1; height: 8px; border-radius: 99px; cursor: pointer;
    background: linear-gradient(to right,
        var(--accent) 0 var(--fill), var(--surface-3) var(--fill) 100%);
    outline: none;
}
.slider__range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px; border-radius: 50%;
    background: #fff; border: 0; cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.45);
    transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.slider__range::-webkit-slider-thumb:hover { transform: scale(1.12); }
.slider__range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }
.slider__range::-moz-range-thumb {
    width: 20px; height: 20px; border-radius: 50%;
    background: #fff; border: 0; cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.slider__range::-moz-range-track { height: 8px; border-radius: 99px; background: transparent; }
.slider__value {
    min-width: 3.5ch; text-align: right;
    font-family: var(--font-cond); font-size: 22px; font-weight: 700;
    color: var(--text); font-variant-numeric: tabular-nums;
}
.slider.is-muted .slider__range { filter: grayscale(1) opacity(.5); }
.slider.is-muted .slider__value { color: var(--faint); }

/* Schlichte Status-Zeile (Label links, Wert rechts) für Geräte-Infos. */
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: 0; }
.info-row__label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.info-row__value { font-weight: 500; }
.info-row__value--mono { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

/* --- System-Buttons (Settings) -------------------------------------------- */
.sysbtn-head, .sysbtn {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center; gap: 14px;
}
.sysbtn-head {
    margin-bottom: 6px; padding: 0 2px;
    font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.sysbtn-head span:first-child { grid-column: 2; }   /* über der Funktions-Spalte beginnen */
.sysbtn { padding: 10px 0; border-top: 1px solid var(--border); }
.sysbtn__no {
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid var(--border);
    font-family: var(--font-cond); font-weight: 700; color: var(--muted);
}
.sysbtn .select { width: 100%; }

/* --- Hardware-View -------------------------------------------------------- */
.hw-block {
    border: 1px solid var(--border); border-radius: var(--r-sm);
    background: var(--surface-2); padding: 16px 18px;
}
.hw-block__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.hw-block__title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 9px; }
.hw-block__title i { color: var(--accent); }
.hw-hint { font-size: 12px; color: var(--faint); line-height: 1.5; margin: 10px 0 0; }
.hw-hint a { color: var(--accent); }
.hw-pin {
    font-family: var(--font-mono); font-size: 11px; color: var(--faint);
    border: 1px solid var(--border-2); border-radius: 999px; padding: 1px 7px; margin-left: 6px;
}

/* Pin-Rollen-Farben (für Punkte, Legende und Pin-Zellen) */
.pin--i2c  { --pin-c: var(--accent-2); }
.pin--int  { --pin-c: var(--accent); }
.pin--led  { --pin-c: #ff8fcf; }
.pin--i2s  { --pin-c: var(--info); }
.pin--5v   { --pin-c: var(--danger); }
.pin--3v3  { --pin-c: var(--warning); }
.pin--gnd  { --pin-c: var(--faint); }
.pin--gpio { --pin-c: var(--border-2); }

.pin-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 18px; }
.pin-legend__item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.pin-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--pin-c); flex: none; }

/* Header-Nachbau: zwei Spalten, Pin-Nummern in der Mitte. */
.pinout { display: flex; flex-direction: column; gap: 5px; max-width: 720px; }
.pinout__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pin {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 12px; border-radius: var(--r-xs);
    background: var(--surface-2); border: 1px solid var(--border);
    border-left: 3px solid var(--pin-c); font-size: 13px; min-width: 0;
}
.pin--right { border-left: 1px solid var(--border); border-right: 3px solid var(--pin-c); flex-direction: row; }
.pin--left { justify-content: flex-end; text-align: right; }
.pin__lbl { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin--gpio .pin__lbl, .pin--gnd .pin__lbl { color: var(--muted); font-weight: 400; }
.pin__no {
    font-family: var(--font-mono); font-size: 12px; font-weight: 700;
    color: var(--bg); background: var(--pin-c); border-radius: 5px;
    width: 24px; text-align: center; padding: 2px 0; flex: none;
}
.pin--gpio .pin__no, .pin--gnd .pin__no { color: var(--text); }

@media (max-width: 560px) {
    .pin__lbl { font-size: 12px; }
    .pin { padding: 6px 9px; gap: 6px; }
}

/* Log-Toolbar */
.log-toolbar { gap: 14px; }
.log-toolbar .select { width: 190px; }

.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 34px 20px; text-align: center; cursor: pointer;
    border: 2px dashed var(--border-2); border-radius: var(--r);
    background: var(--surface-2); color: var(--muted);
    transition: border-color .15s var(--ease), background .15s var(--ease);
}
.dropzone:hover { border-color: var(--accent); background: var(--surface-3); }
.dropzone i { font-size: 26px; color: var(--accent); }
.dropzone__title { font-weight: 500; color: var(--text); }
.dropzone__hint { font-size: 12.5px; color: var(--faint); }

.selected-files { display: flex; flex-direction: column; gap: 6px; }
.selected-file {
    display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text);
    padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xs);
}
.selected-file > i { color: var(--accent); }
.selected-file__remove {
    margin-left: auto; display: grid; place-items: center;
    width: 26px; height: 26px; border: none; border-radius: 6px;
    background: transparent; color: var(--faint); cursor: pointer; font-size: 13px;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.selected-file__remove:hover { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }

/* Globale Drop-View */
.drop-overlay {
    position: fixed; inset: 0; z-index: 60; display: none;
    align-items: center; justify-content: center; padding: 24px;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(6px);
}
.drop-overlay.is-shown { display: flex; animation: fade-in .12s var(--ease); }
.drop-overlay__box {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    width: min(560px, 90vw); padding: 56px 32px; text-align: center;
    border: 2.5px dashed var(--accent); border-radius: var(--r-lg);
    background: var(--accent-soft); pointer-events: none;
}
.drop-overlay__box i { font-size: 46px; color: var(--accent); }
.drop-overlay__title { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: 1px; font-size: 20px; font-weight: 700; }
.drop-overlay__hint { color: var(--muted); font-size: 13px; }
@keyframes fade-in { from { opacity: 0; } }

/* Sound-Tabelle */
.sound-actions { display: flex; gap: 6px; justify-content: flex-end; }
.sound-name { cursor: text; border-bottom: 1px dashed transparent; }
.sound-name:hover { border-bottom-color: var(--border-2); }
.sound-cat { max-width: 230px; }
#soundTableWrap tbody tr { cursor: pointer; }

/* Detail-Block im Sound-Drawer */
.sound-meta { display: flex; flex-direction: column; gap: 0; }
.sound-meta__row { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sound-meta__row span:first-child { color: var(--muted); }
.play-btn.is-playing { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.table-empty {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 44px 20px; text-align: center; color: var(--muted);
}

/* Toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: flex; flex-direction: column; gap: 10px; }
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--r-sm);
    background: var(--surface-2); border: 1px solid var(--border-2);
    box-shadow: var(--shadow-lg); font-size: 13.5px; color: var(--text);
    transition: opacity .25s var(--ease); animation: toast-in .2s var(--ease);
}
.toast--success i { color: var(--success); }
.toast--error i { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ============================================================================
   Kategorien: Farb-Palette · Kategorie-Tag · Sub-Card
   ========================================================================== */
/* Kuratierte Farb-Palette (klickbare Swatches, eine Auswahl) */
.swatch-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.color-swatch {
    position: relative; width: 34px; height: 34px; border-radius: 9px;
    background: var(--c); border: none; cursor: pointer; padding: 0;
    transition: transform .1s var(--ease), box-shadow .15s var(--ease);
}
.color-swatch:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.color-swatch.is-selected { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.color-swatch.is-selected::after {
    content: '\f00c'; font-family: 'Font Awesome 7 Pro'; font-weight: 900;
    position: absolute; inset: 0; display: grid; place-items: center;
    color: #fff; font-size: 12px; text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

/* Kategorie-Tag: farbiger Punkt + Name */
.cat-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.cat-tag__dot {
    width: 9px; height: 9px; border-radius: 99px; background: var(--c); flex: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent);
}
.cat-tag--none { color: var(--faint); }
.cat-tag--none .cat-tag__dot { background: var(--faint); box-shadow: none; }

/* Sub-Card: einzelne Einträge innerhalb einer Container-Card (z. B. Webhooks) */
.subcards { display: flex; flex-direction: column; gap: 12px; }
.subcard {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 18px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: var(--r-sm);
    transition: border-color .15s var(--ease);
}
.subcard:hover { border-color: var(--border-2); }
.subcard__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.subcard__title { display: flex; align-items: center; gap: 10px; }
.subcard__meta { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subcard__actions { display: flex; gap: 6px; flex: none; }

/* ============================================================================
   Board (Taster-Raster) + Editor-Drawer
   ========================================================================== */
.board-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.board-legend__item { display: inline-flex; align-items: center; gap: 7px; }
.board-legend__sw { width: 16px; height: 4px; border-radius: 2px; background: var(--border-2); }
.board-legend__sw--sound { background: var(--accent-2); }
.board-legend__sw--webhook { background: var(--info); }
.board-legend__sw--empty { background: var(--border-2); }

.board { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; }
.pad {
    position: relative; aspect-ratio: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
    padding: 15px 6px 10px; text-align: center; overflow: hidden; cursor: pointer; color: var(--text);
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm);
    transition: background .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease);
}
.pad:hover { background: var(--surface-3); border-color: var(--border-2); }
.pad:active { transform: scale(.97); }
/* 2px-Bar oben mit Abstand zu den Rändern (Aktions-Indikator) */
.pad__bar { position: absolute; top: 7px; left: 10px; right: 10px; height: 2px; border-radius: 2px; background: var(--border-2); }
.pad__idx { position: absolute; bottom: 6px; left: 8px; font-family: var(--font-mono); font-size: 10px; color: var(--faint); }
.pad__main { font-size: 11.5px; font-weight: 500; line-height: 1.2; max-height: 2.4em; overflow: hidden; word-break: break-word; }
.pad__main--empty { color: var(--faint); font-size: 16px; }
/* LED klein, horizontal zentriert, etwas oberhalb des unteren Rands */
.pad__led { position: absolute; bottom: 27px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 99px; background: var(--led, #444); box-shadow: 0 0 6px var(--led); }
.pad--sound .pad__bar { background: var(--accent-2); }
.pad--webhook .pad__bar { background: var(--info); }
.pad.is-disabled { opacity: .45; }

.board-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(4, 5, 8, .55); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s var(--ease); }
.board-scrim.is-shown { opacity: 1; }
.board-editor {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
    width: min(600px, 94vw); display: flex; flex-direction: column;
    background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
    transform: translateX(100%); transition: transform .25s var(--ease);
}
.board-editor.is-open { transform: none; }
.board-editor__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.board-editor__title { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; font-size: 16px; }
.board-editor__body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.board-editor__foot { display: flex; gap: 10px; justify-content: space-between; padding: 18px 22px; border-top: 1px solid var(--border); }

/* Edit-Modus + Trigger-Feedback */
.btn.is-active { background: var(--accent-soft); border-color: transparent; color: #fff; }
.board.is-editing .pad { cursor: cell; }
.board.is-editing .pad:hover { border-color: var(--accent); }
.pad.is-triggered { animation: pad-pulse .4s var(--ease); }
@keyframes pad-pulse { 0% { transform: scale(1); } 35% { transform: scale(.92); box-shadow: 0 0 0 2px var(--accent-soft); } 100% { transform: scale(1); } }

/* Quelle-Chip im Log (Web/Taster) */
.src-chip { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; font-size: 11px; color: var(--faint); }
.src-chip i { font-size: 11px; }

/* ============================================================================
   Responsive
   ========================================================================== */
@media (max-width: 940px) {
    .topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 30;
        padding: 12px 14px;
        background: color-mix(in srgb, var(--bg) 88%, transparent);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border);
    }
    .topbar__brand { display: flex; align-items: center; gap: 10px; }
    .topbar .brand__mark { width: 32px; height: 32px; font-size: 15px; border-radius: 9px; }
    .topbar .brand__name { font-size: 18px; }

    /* Vollbild-Drawer auf Mobile */
    .sidebar {
        top: 0; left: 0; bottom: 0;
        width: 100%;
        border: none;
        border-radius: 0;
        padding: 16px 18px calc(18px + env(safe-area-inset-bottom));
        transform: translateX(-100%);
        transition: transform .25s var(--ease);
    }
    .sidebar.is-open { transform: none; }
    .sidebar .sidebar__close { display: grid; }

    /* großzügigere Nav-Items */
    .brand { padding: 8px 8px 20px; }
    .nav { gap: 20px; }
    .nav__label { font-size: 12px; margin: 6px 12px 8px; }
    .nav__item { padding: 16px 14px; font-size: 17px; gap: 16px; border-radius: var(--r-sm); }
    .nav__icon { width: 24px; font-size: 20px; }
    .nav__item.is-active::before { left: -18px; height: 28px; }

    .main { margin-left: 0; padding: 18px 16px 64px; }
    .scrim[hidden] { display: none; }
    .scrim { display: block; }
}

@media (min-width: 941px) {
    .scrim { display: none !important; }
}

@media (max-width: 560px) {
    .grid--2, .grid--3 { grid-template-columns: 1fr; }
    .page-title { font-size: 19px; }
}

/* ============================================================================
   UI-Kit-Zusatz: generischer Right-Side-Drawer (.drawer / .drawer-scrim)
   (Die App nutzt intern .board-editor/.board-scrim — identisches Muster.)
   ========================================================================== */
.drawer-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(4, 5, 8, .55); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s var(--ease); }
.drawer-scrim.is-shown { opacity: 1; }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
    width: min(560px, 94vw); display: flex; flex-direction: column;
    background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
    transform: translateX(100%); transition: transform .25s var(--ease);
}
.drawer.is-open { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.drawer__title { font-family: var(--font-cond); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; font-size: 16px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.drawer__foot { display: flex; gap: 10px; justify-content: space-between; padding: 18px 22px; border-top: 1px solid var(--border); }
