:root {
    --bg: #000000; 
    --card-bg: #1c1c1e; 
    --primary: #bf5af2; 
    --secondary: #64d2ff; 
    --text: #ffffff;
    --text-muted: #8e8e93; 
    --danger: #ff453a; 
    --success: #30d158; 
    --border: #2c2c2e; 
}

/* --- THEME VARIANTEN --- */
body.theme-girl {
    --bg: #ffeef4;         /* Sanfter, hellrosa Hintergrund */
    --card-bg: #ffffff;    /* Schneeweiße Karten für edlen Kontrast */
    --primary: #ff66a4;    /* Kräftiges Schleifchen-Pink */
    --secondary: #ff1493;  /* Leuchtendes Neon-Pink */
    --text: #4a0026;       /* Dunkelbeere für perfekte Lesbarkeit */
    --text-muted: #a66584; 
    --danger: #d90452;     /* Intensives Beerenrot für Warnungen */
    --success: #ff3385;    /* Knalliges Pink für Bestätigungen */
    --border: #ffccd9; 
}

/* 🌊 HIER IST JETZT DEIN SAUBERES MINT/OCEAN MEERES-THEME 🌊 */
body.theme-mint {
    --bg: #031424;         /* Tiefsee-Abyss-Blau */
    --card-bg: #0a2540;    /* Dunkles Marineblau für Karten */
    --primary: #00f0ff;    /* Leuchtendes Aquamarin / Cyan */
    --secondary: #64ffda;  /* Helles Karibik-Mint */
    --text: #e6f1ff;       /* Klares Eisweiß für perfekte Lesbarkeit */
    --text-muted: #8892b0; /* Sanftes Nebelblau */
    --danger: #ff4a74;     /* Kräftiges Korallenrot */
    --success: #00e676;    /* Biolumineszentes Seegrün */
    --border: #103a61;     /* Riff-Blau für Ränder */
}

/* 🦈 BADMAN SHARK EDITION - Schwarz, Grau, Rot 🦈 */
body.theme-badman {
    --bg: #1a1a1a;         /* Tiefschwarz */
    --card-bg: #2a2a2a;    /* Dunkles Anthrazit */
    --primary: #e63946;    /* Kräftiges Rot */
    --secondary: #8a8a8a;  /* Mittelgrau */
    --text: #f1f1f1;       /* Helles Weiß für Lesbarkeit */
    --text-muted: #6a6a6a; /* Gedämpftes Grau */
    --danger: #e63946;     /* Rot für Warnungen */
    --success: #4a4a4a;    /* Dunkles Grau für Bestätigungen */
    --border: #4a4a4a;     /* Graue Ränder */
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(26, 26, 26, 0.76), rgba(26, 26, 26, 0.9)),
        url("badman.svg");
    background-repeat: no-repeat;
    background-position: center 56%;
    background-size: min(78vw, 620px) auto;
    background-attachment: fixed;
    isolation: isolate;
}

* { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body {
    margin: 0;
    padding: 0;
    background:
        radial-gradient(circle at 15% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 34%),
        radial-gradient(circle at 95% 8%, color-mix(in srgb, var(--secondary) 12%, transparent), transparent 32%),
        var(--bg);
    color: var(--text);
    padding-bottom: 30px;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.5s ease;
}

header {
    background: color-mix(in srgb, var(--card-bg) 72%, transparent);
    padding: 16px 20px;
    box-shadow: 0 1px 0 color-mix(in srgb, var(--border) 78%, transparent);
    position: sticky;
    top: 0;
    z-index: 99;
    backdrop-filter: blur(22px) saturate(1.2);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
}
.header-main { display: flex; justify-content: space-between; align-items: center; }
header h1 { margin: 0; font-size: 1.4rem; font-weight: 700; color: #fff; letter-spacing: -0.5px; }
.subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.warehouse-switcher {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px 42px 42px;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}

.warehouse-control-card {
    margin-bottom: 14px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--primary) 13%, transparent), color-mix(in srgb, var(--secondary) 7%, transparent)),
        color-mix(in srgb, var(--card-bg) 90%, transparent);
    box-shadow: 0 16px 44px rgba(0,0,0,0.22);
}

.warehouse-control-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.warehouse-control-head span {
    display: block;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.warehouse-control-head strong {
    display: block;
    margin-top: 3px;
    font-size: 1.08rem;
}

.warehouse-switcher select {
    margin-bottom: 0;
    min-width: 0;
}

.warehouse-switcher optgroup {
    color: var(--text-muted);
    font-weight: 800;
}

.warehouse-switcher option {
    color: var(--text);
}

.warehouse-switcher button {
    height: 42px;
    padding: 0;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border-radius: 10px;
    font-size: 1rem;
}

.warehouse-meta {
    margin-top: 7px;
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.35;
}

header.warehouse-tools-hidden .header-warehouse-switcher,
header.warehouse-tools-hidden .header-warehouse-meta,
header.warehouse-tools-hidden .header-warehouse-access-badge {
    display: none;
}

.warehouse-access-badge {
    width: fit-content;
    max-width: min(92vw, 420px);
    margin-top: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.045);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.warehouse-access-badge[data-access="owner"] {
    color: var(--success);
    border-color: rgba(48, 209, 88, 0.36);
    background: rgba(48, 209, 88, 0.08);
}

.warehouse-access-badge[data-access="write"] {
    color: var(--secondary);
    border-color: rgba(100, 210, 255, 0.34);
    background: rgba(100, 210, 255, 0.08);
}

.warehouse-access-badge[data-access="read"] {
    color: var(--danger);
    border-color: rgba(255, 69, 58, 0.34);
    background: rgba(255, 69, 58, 0.08);
}

.header-title-container { display: flex; align-items: center; gap: 8px; }
.version-badge { font-size: 0.7rem; background: rgba(191, 90, 242, 0.15); color: var(--primary); padding: 2px 6px; border-radius: 6px; border: 1px solid rgba(191, 90, 242, 0.3); font-weight: 600; transition: all 0.3s ease; }

.legacy-domain-banner {
    width: min(1200px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    margin: 14px auto 8px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--primary) 48%, var(--border));
    border-radius: 18px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--primary) 22%, transparent), color-mix(in srgb, var(--secondary) 12%, transparent)),
        color-mix(in srgb, var(--card-bg) 94%, transparent);
    box-shadow: 0 18px 42px rgba(0,0,0,0.24);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 100;
}

.legacy-domain-banner[hidden] {
    display: none !important;
}

.legacy-domain-banner-copy strong,
.legacy-domain-banner-copy span {
    display: block;
}

.legacy-domain-banner-copy strong {
    font-size: 1rem;
    color: #fff;
}

.legacy-domain-banner-copy span {
    margin-top: 4px;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.45;
}

.legacy-domain-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.legacy-domain-banner-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 36%, transparent);
}

.legacy-domain-banner-link:hover {
    filter: brightness(1.06);
}

.update-banner {
    width: min(1200px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    margin: 12px auto 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 214, 10, 0.42);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 214, 10, 0.16), rgba(100, 210, 255, 0.09));
    box-shadow: 0 12px 30px rgba(0,0,0,0.24);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 98;
}

.update-banner[hidden] {
    display: none !important;
}

.update-banner strong,
.update-banner span {
    display: block;
}

.update-banner strong {
    color: #ffd60a;
    font-size: 0.95rem;
}

.update-banner span {
    color: var(--text);
    font-size: 0.82rem;
    margin-top: 2px;
}

.update-banner button {
    width: auto;
    min-width: 118px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 214, 10, 0.5);
    background: rgba(255, 214, 10, 0.18);
    color: #fff;
    font-weight: 900;
}

.menu-toggle { background: none; border: none; cursor: pointer; padding: 4px; display: flex; flex-direction: column; gap: 5px; z-index: 101; }
.menu-toggle .bar { width: 24px; height: 2.5px; background-color: var(--primary); border-radius: 2px; transition: 0.3s; }

.nav-menu { position: fixed; top: 0; right: -280px; width: 280px; height: 100vh; background: rgba(28, 28, 30, 0.94); z-index: 1000; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: -5px 0 25px rgba(0,0,0,0.5); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-left: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; }
.nav-menu.open { transform: translateX(-280px); }
.nav-menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-weight: 600; font-size: 1.1rem; color: var(--text-muted); border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.close-menu { background: none; border: none; color: var(--primary); font-size: 1.3rem; cursor: pointer; }

.nav-links { display: flex; flex-direction: column; gap: 8px; }
.nav-links button { width: 100%; text-align: left; padding: 14px 16px; border: none; background: rgba(255,255,255,0.03); color: #fff; font-size: 1rem; font-weight: 500; border-radius: 10px; cursor: pointer; transition: all 0.2s; }
.nav-links button.active { color: #000; background: var(--primary); font-weight: 600; }

.menu-backdrop { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.4); z-index: 999; backdrop-filter: blur(2px); }
.menu-backdrop.open { display: block; }

.tab-content {
    display: none;
    width: min(1140px, 100%);
    margin: 0 auto;
    padding: 18px 16px 30px;
}

.tab-content.active {
    display: grid;
    gap: 14px;
    animation: iosSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-content.active > .card,
.tab-content.active > details,
.tab-content.active > .tools-shell,
.tab-content.active > .warehouse-control-card {
    margin-bottom: 0;
}

#app {
    width: min(1220px, 100%);
    margin: 0 auto;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 20px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(191,90,242,0.18), rgba(100,210,255,0.08));
}
.dashboard-hero small,
.dashboard-tile span,
.dashboard-tile small,
.dashboard-next small {
    color: var(--text-muted);
}
.dashboard-hero h2 {
    margin: 4px 0;
    font-size: 1.7rem;
}
.dashboard-hero p {
    margin: 0;
    color: var(--text-muted);
}
.dashboard-refresh {
    width: auto;
    min-width: 128px;
    background: var(--primary);
    color: #000;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.dashboard-tile {
    text-align: left;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    border-radius: 14px;
    padding: 14px;
}
.dashboard-tile strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 1.5rem;
}
.dashboard-tile.warn {
    border-color: rgba(255,69,58,0.38);
    background: rgba(255,69,58,0.08);
}
.dashboard-tile.ok {
    border-color: rgba(48,209,88,0.28);
}
.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.dashboard-onboarding {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid rgba(100,210,255,0.28);
    border-radius: 14px;
    background: rgba(100,210,255,0.07);
}
.dashboard-onboarding p {
    margin: 4px 0 0;
    color: var(--text-muted);
}
.dashboard-onboarding > div:last-child {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.dashboard-onboarding button {
    width: auto;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid var(--border);
}
.dashboard-actions button,
.dashboard-next button {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid var(--border);
}
.dashboard-panels {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 10px;
}
.dashboard-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
}
.dashboard-panel h3 {
    margin-top: 0;
}
.dashboard-list-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.035);
    color: var(--text);
    text-align: left;
}
.dashboard-list-row span,
.dashboard-next {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dashboard-list-row small {
    color: var(--text-muted);
}
.dashboard-list-row em {
    color: var(--danger);
    font-style: normal;
    font-weight: 800;
}
.mobile-bottom-nav {
    display: none;
}
.lager-filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 12px;
    scrollbar-width: none;
}
.lager-filter-chips::-webkit-scrollbar { display: none; }
.lager-filter-chips button {
    width: auto;
    white-space: nowrap;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    padding: 8px 12px;
}
.lager-filter-chips button.active {
    color: #000;
    background: var(--primary);
    border-color: var(--primary);
}
.product-history {
    margin-top: 10px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}
.product-history summary {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
}
.product-history div {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.product-history ul {
    margin: 4px 0 0 18px;
    padding: 0;
}
.mini-help {
    width: 24px;
    height: 24px;
    min-width: 24px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.08);
    color: var(--secondary);
    font-weight: 900;
    line-height: 1;
}

.cr-maintenance-warning {
    margin: 12px 0 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 214, 10, 0.44);
    border-radius: 12px;
    background: rgba(255, 214, 10, 0.1);
    color: #ffd60a;
    font-weight: 800;
    line-height: 1.35;
}

.cr-pdf-card input:disabled,
.cr-pdf-card textarea:disabled,
.cr-pdf-card button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    filter: grayscale(0.45);
}

.menu-order-list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.menu-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
}

.menu-order-row span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-order-row small {
    color: var(--text-muted);
    font-size: 0.74rem;
}

.menu-order-row div {
    display: flex;
    gap: 6px;
}

.menu-order-row button {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid var(--border);
}

.menu-order-row button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@keyframes iosSlideIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.swipe-indicator {
    position: fixed;
    left: 50%;
    bottom: 86px;
    transform: translate(-50%, 18px) scale(0.96);
    z-index: 1200;
    display: none;
    align-items: center;
    gap: 8px;
    max-width: calc(100vw - 32px);
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(28, 28, 30, 0.92);
    color: var(--text);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
}

.swipe-indicator.show {
    display: flex;
    animation: swipeIndicatorPop 0.7s ease forwards;
}

.swipe-indicator-arrow {
    color: var(--primary);
    font-size: 1.15rem;
    line-height: 1;
}

@keyframes swipeIndicatorPop {
    0% { opacity: 0; transform: translate(-50%, 18px) scale(0.96); }
    18% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    72% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -8px) scale(0.98); }
}

@media (min-width: 768px) {
    .menu-toggle, .close-menu, .nav-menu-header, .menu-backdrop { display: none !important; }
    .nav-menu { position: static; width: 100%; height: auto; background: #1c1c1e; border-left: none; border-bottom: 1px solid var(--border); padding: 0; box-shadow: none; transform: none !important; backdrop-filter: none; }
    .nav-links { flex-direction: row; gap: 0; max-width: 1200px; margin: 0 auto; width: 100%; }
    .nav-links button { flex: 1; text-align: center; border-radius: 0; background: none; padding: 16px; color: var(--text-muted); }
    .nav-links button.active { color: var(--primary); background: rgba(191, 90, 242, 0.1); border-bottom: 3px solid var(--primary); }
}

.category-title { color: var(--text); font-size: 0.85rem; font-weight: 600; margin: 28px 0 12px 2px; text-transform: uppercase; letter-spacing: 1px; transition: color 0.5s ease; opacity: 0.6; }
.card {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.038), rgba(255,255,255,0.012)),
        color-mix(in srgb, var(--card-bg) 97%, transparent);
    padding: 18px;
    margin-bottom: 12px;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--border) 82%, rgba(255,255,255,0.08));
    box-shadow: 0 10px 28px rgba(0,0,0,0.14);
    transition: box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.35s ease;
}

.card:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--primary) 18%, var(--border));
    box-shadow: 0 14px 32px rgba(0,0,0,0.18);
}

.card h2,
.card h3 {
    margin: 0 0 8px;
    line-height: 1.2;
}
/*.card h4 { margin: 0 0 12px 0; font-size: 1.05rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }*/
.card h4 { margin: 0 0 12px 0; font-size: 1.05rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
/*.stock { color: var(--secondary); font-weight: 600; background: rgba(100, 210, 255, 0.1); padding: 3px 8px; border-radius: 6px; font-size: 0.95rem; white-space: nowrap; flex-shrink: 0; transition: color 0.5s ease; }.stock { color: var(--secondary); font-weight: 600; background: rgba(100, 210, 255, 0.1); padding: 3px 8px; border-radius: 6px; font-size: 0.95rem; transition: color 0.5s ease; }
*/
.stock { color: var(--text); font-weight: 600; background: rgba(255,255,255,0.06); padding: 4px 10px; border-radius: 8px; font-size: 0.9rem; white-space: nowrap; flex-shrink: 0; transition: color 0.5s ease; }

body.theme-girl .stock { background: rgba(255, 102, 164, 0.15); }
body.theme-mint .stock { background: rgba(100, 255, 250, 0.15); } /* Angepasst für Meeres-Badge */

.cross-hint { font-size: 0.75rem; color: #ffd60a; margin-top: 4px; display: block; font-weight: 500; }
.hint { font-size: 0.84rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.45; }

.trace-grid { display: grid; grid-template-columns: 1fr 100px 50px; gap: 5px; align-items: center; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.trace-grid label { font-size: 0.95rem; }
.trace-grid input { margin-bottom: 0 !important; text-align: right; }
.unit-label { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }

.log-item { background: #2c2c2e; padding: 12px; border-radius: 10px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.log-item.in { border-left: 4px solid var(--success); }
.log-item.out { border-left: 4px solid var(--danger); }
.log-details { font-size: 0.85rem; }
.log-date { font-size: 0.75rem; color: var(--text-muted); }

.stat-block { background: #2c2c2e; padding: 14px; border-radius: 10px; margin-bottom: 12px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; text-align: center; margin-top: 8px; font-size: 0.8rem; color: var(--text-muted); }
.stat-grid div strong { display: block; font-size: 0.95rem; color: #fff; margin-bottom: 2px; }
.prognose-badge { font-size: 0.8rem; color: #ffd60a; background: rgba(255, 214, 10, 0.1); padding: 4px 8px; border-radius: 6px; display: inline-block; margin-top: 8px; font-weight: 500; }

.cr-experimental-warning {
    background: rgba(255, 214, 10, 0.1);
    border: 1px solid rgba(255, 214, 10, 0.35);
    border-left: 3px solid #ffd60a;
    color: #ffd60a;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.84rem;
    line-height: 1.35;
    margin: 0 0 12px;
    font-weight: 600;
}

.cr-adjustment-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-left: 3px solid var(--success);
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
}

.cr-adjustment-card.has-missing {
    border-left-color: var(--danger);
}

.cr-adjustment-wrap {
    margin-top: 12px;
}

.cr-adjustment-wrap .cr-adjustment-card {
    margin-top: 0;
}

.cr-adjustment-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--text);
    font-weight: 700;
    list-style: none;
}

.cr-adjustment-title::-webkit-details-marker {
    display: none;
}

.cr-adjustment-title span:last-child {
    color: var(--success);
    font-size: 0.82rem;
    white-space: nowrap;
}

.cr-adjustment-status {
    color: var(--success);
    background: rgba(48,209,88,0.1);
    border: 1px solid rgba(48,209,88,0.28);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.78rem;
    line-height: 1;
}

.cr-adjustment-status.missing {
    color: var(--danger);
    background: rgba(255,69,58,0.1);
    border-color: rgba(255,69,58,0.28);
}

.cr-adjustment-card.has-missing .cr-adjustment-title span:last-child {
    color: var(--danger);
}

.cr-adjustment-meta {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: 8px 0 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cr-adjustment-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.cr-water-info {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.cr-water-info span {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
}

.cr-element-values {
    margin: 8px 0 0;
    border: 1px solid var(--border);
    border-left: 3px solid var(--secondary);
    border-radius: 10px;
    padding: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.025);
}

.cr-element-values summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--secondary);
    font-weight: 700;
    font-size: 0.84rem;
    list-style: none;
}

.cr-element-values summary::-webkit-details-marker {
    display: none;
}

.cr-element-values summary small {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.cr-element-values[open] summary {
    margin-bottom: 8px;
}

.cr-element-grid {
    display: grid;
    grid-template-columns: 72px repeat(10, minmax(64px, 1fr));
    gap: 6px;
    align-items: center;
    min-width: 760px;
    padding: 5px 0;
    color: var(--text);
    font-size: 0.76rem;
}

.cr-element-grid span,
.cr-element-grid strong {
    white-space: nowrap;
}

.cr-element-header {
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-weight: 700;
}

.cr-element-table {
    display: none;
    overflow-x: auto;
}

.cr-element-mobile-table {
    display: block;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.cr-element-mobile-row {
    display: grid;
    grid-template-columns: 64px 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    color: var(--text);
    font-size: 0.78rem;
}

.cr-element-mobile-row:first-child {
    border-top: none;
}

.cr-element-mobile-row strong {
    color: var(--secondary);
    font-weight: 700;
}

.cr-element-mobile-row span {
    white-space: nowrap;
}

.cr-element-mobile-head {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-weight: 700;
}

.cr-element-mobile-head span {
    color: var(--text-muted);
}

@media (min-width: 641px) {
    .cr-element-table {
        display: block;
    }

    .cr-element-mobile-table {
        display: none;
    }
}

@media (max-width: 380px) {
    .cr-element-mobile-row {
        grid-template-columns: 52px 1fr 1fr;
        gap: 6px;
        padding: 8px;
        font-size: 0.72rem;
    }
}

.cr-adjustment-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.cr-adjustment-row:first-child {
    border-top: none;
}

.cr-adjustment-row small {
    display: block;
    color: var(--text-muted);
    font-size: 0.74rem;
    margin-top: 2px;
}

.cr-adjustment-row.missing strong,
.cr-adjustment-row.missing small {
    color: var(--danger);
}

.cr-adjustment-row.empty {
    opacity: 0.48;
}

.cr-adjustment-amount {
    text-align: right;
}

.cr-unit-preference-group {
    margin-bottom: 12px;
}

.cr-unit-preference-group select {
    width: 100%;
}

.cr-primary-unit {
    color: #fff;
    font-weight: 800;
    font-size: 0.98rem;
}

.cr-secondary-unit {
    color: var(--secondary);
    font-size: 0.76rem;
    margin-left: 6px;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .cr-adjustment-row {
        grid-template-columns: 1fr;
    }
    .cr-adjustment-amount {
        text-align: left;
    }
}

@media (max-width: 767px) {
    #cr-export {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }

    #cr-export.active {
        display: flex;
    }

    #cr-export:not(.active) {
        display: none;
    }

    #cr-export .card {
        margin-bottom: 0;
        padding: 14px;
        border-radius: 12px;
    }

    #cr-export .cr-pdf-card {
        order: 1;
    }

    #cr-export .cr-paste-card {
        order: 2;
    }

    #cr-export h3 {
        font-size: 1rem;
        margin-top: 0;
        margin-bottom: 6px;
    }

    #cr-export .hint {
        font-size: 0.78rem;
        line-height: 1.35;
        margin-bottom: 10px;
    }

    #cr-export textarea {
        height: 92px;
        font-size: 0.88rem;
        margin-bottom: 10px;
    }

    #cr-export input[type="file"] {
        font-size: 0.88rem;
        margin-bottom: 10px;
    }

    #cr-export .btn-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    #cr-export .btn-group button,
    #cr-export .btn-primary,
    #cr-export .btn-secondary,
    .cr-adjustment-card button {
        min-height: 44px;
        padding: 10px;
        font-size: 0.86rem;
    }

    #cr-pdf-status {
        background: rgba(255,255,255,0.04);
        border: 1px solid var(--border);
        border-radius: 10px;
        padding: 8px 10px;
        margin-bottom: 8px;
    }

    .cr-adjustment-wrap {
        margin-top: 10px;
    }

    .cr-adjustment-card {
        padding: 12px;
        border-radius: 12px;
    }

    .cr-adjustment-title {
        align-items: flex-start;
    }

    .cr-adjustment-name {
        font-size: 0.98rem;
        line-height: 1.2;
    }

    .cr-adjustment-status {
        flex-shrink: 0;
        margin-top: 1px;
    }

    .cr-adjustment-meta {
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .cr-adjustment-meta span,
    .cr-water-info span {
        background: rgba(255,255,255,0.05);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 6px 8px;
    }

    .cr-water-info {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cr-adjustment-list {
        gap: 0;
        margin-bottom: 10px;
    }

    .cr-adjustment-row {
        grid-template-columns: 1fr auto;
        gap: 8px;
        padding: 9px 0;
    }

    .cr-adjustment-row strong {
        font-size: 0.86rem;
    }

    .cr-adjustment-row small {
        font-size: 0.7rem;
    }

    .cr-adjustment-amount strong {
        font-size: 0.86rem;
    }

    .cr-element-values {
        margin-top: 8px;
        padding: 10px;
    }

    .cr-element-values summary {
        min-height: 34px;
        font-size: 0.84rem;
    }

    .cr-element-values summary small {
        font-size: 0.72rem;
        max-width: 42%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.btn-group { display: flex; gap: 10px; }
button {
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}
.btn-animated:active { transform: scale(0.96); opacity: 0.8; }

.btn-in { background: rgba(48, 209, 88, 0.12); color: var(--success); border-color: rgba(48, 209, 88, 0.22); flex: 1; }
.btn-out { background: rgba(255, 69, 58, 0.12); color: var(--danger); border-color: rgba(255, 69, 58, 0.22); flex: 1; }

.btn-primary { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, var(--secondary))); color: #fff; width: 100%; transition: background-color 0.5s ease; box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 24%, transparent); }
.btn-secondary { background: rgba(255,255,255,0.065); color: var(--secondary); border-color: var(--border); width: 100%; }
.btn-danger { background: var(--danger); color: white; width: 100%; }
.btn-cancel { background: rgba(255,255,255,0.06); color: #fff; border-color: var(--border); width: 100%; margin-top: 12px; }

textarea {
    width: 100%;
    height: 120px;
    background: rgba(255,255,255,0.055);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    font-size: 0.95rem;
    resize: none;
    margin-bottom: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
input[type="number"], input[type="text"], input[type="password"], input[type="search"], input[type="file"], input[type="date"], input[type="time"], input[type="datetime-local"], select {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.055);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
textarea:focus,
input[type="number"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
select:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--primary) 58%, var(--border));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent);
    background: rgba(255,255,255,0.08);
}

input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    appearance: none;
    -webkit-appearance: none;
    min-height: 48px;
    letter-spacing: 0;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    opacity: 0.78;
    cursor: pointer;
    filter: invert(0.92) sepia(0.2) saturate(2) hue-rotate(168deg);
}
.input-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; }

.disabled-field {
    opacity: 0.45;
    filter: grayscale(1);
}

.disabled-field input {
    cursor: not-allowed;
}

.bug-report-textarea {
    min-height: 110px;
    height: 110px;
}

.bug-report-textarea-small {
    min-height: 86px;
    height: 86px;
}

.bug-report-note {
    margin: 10px 0 0;
    font-size: 0.78rem;
}

.settings-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    border-radius: 12px;
    padding: 2px 2px 2px 0;
    transition: background-color 0.2s ease;
}

.settings-accordion-summary:hover {
    background: rgba(255, 255, 255, 0.035);
}

.settings-group-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 18px 2px 8px;
}

.settings-group-label span {
    border-left: 3px solid var(--primary);
    padding-left: 8px;
}

.settings-summary-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.settings-summary-copy small {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 500;
    line-height: 1.35;
}

.settings-accordion-summary::-webkit-details-marker {
    display: none;
}

.settings-accordion-summary h2,
.settings-accordion-summary h3 {
    margin: 0 !important;
}

.settings-accordion-hint {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.settings-accordion-hint::before {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-1px, -1px);
    transition: transform 0.2s ease;
}

.aquarium-workspace-panel {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--secondary) 28%, var(--border));
    background: linear-gradient(135deg, color-mix(in srgb, var(--secondary) 10%, transparent), color-mix(in srgb, var(--primary) 7%, transparent));
}

.aquarium-workspace-panel-logbook {
    margin-top: 0;
}

.aquarium-workspace-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.aquarium-workspace-head span {
    display: block;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.aquarium-workspace-head strong {
    display: block;
    margin-top: 3px;
    font-size: 1.02rem;
}

.aquarium-workspace-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.aquarium-workspace-actions button {
    width: auto;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.8rem;
}

.aquarium-workspace-select small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.nav-links button.nav-tab-disabled,
.mobile-bottom-nav button.nav-tab-disabled {
    opacity: 0.42;
    cursor: not-allowed;
    box-shadow: none;
}

.nav-links button.nav-tab-disabled:hover,
.mobile-bottom-nav button.nav-tab-disabled:hover {
    transform: none;
}

details[open] > summary .settings-accordion-hint {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

details[open] > summary .settings-accordion-hint::before {
    transform: rotate(-135deg) translate(-1px, -1px);
}

.settings-accordion-body {
    margin-top: 12px;
}

#einstellungen > .card > details > summary {
    min-height: 34px;
}

#einstellungen > .card {
    margin-bottom: 8px;
    border-radius: 13px !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

#einstellungen > .card:hover {
    transform: none !important;
    box-shadow: none !important;
}

#einstellungen > .card h2,
#einstellungen > .card h3 {
    color: var(--text) !important;
}

#einstellungen > .card .hint,
#einstellungen > .card .subtitle,
#einstellungen > .card small {
    color: var(--text-muted) !important;
}

#einstellungen .switch-container,
#einstellungen .preset-row,
#einstellungen .custom-product-row,
#einstellungen .visibility-product-row,
#einstellungen .container-preset-row {
    background: rgba(255, 255, 255, 0.035) !important;
    border-color: var(--border) !important;
}

#einstellungen input[type="number"],
#einstellungen input[type="text"],
#einstellungen input[type="password"],
#einstellungen input[type="file"],
#einstellungen select,
#einstellungen textarea {
    background: rgba(255, 255, 255, 0.055) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    box-shadow: none !important;
}

#einstellungen code {
    background: rgba(255, 255, 255, 0.07) !important;
    color: var(--text) !important;
}

body.theme-girl #einstellungen > .card {
    background: rgba(255, 255, 255, 0.82) !important;
    border-color: #ffd4e2 !important;
}

body.theme-girl .settings-group-label span {
    border-left-color: #ff66a4;
}

body.theme-mint #einstellungen > .card {
    background: rgba(10, 37, 64, 0.78) !important;
    border-color: #174a76 !important;
}

body.theme-mint .settings-group-label span {
    border-left-color: #00f0ff;
}

body.theme-badman #einstellungen > .card {
    background: rgba(42, 42, 42, 0.84) !important;
    border-color: rgba(230, 57, 70, 0.34) !important;
}

body.theme-badman .settings-group-label span {
    border-left-color: #e63946;
}

body.theme-light #einstellungen > .card {
    background: #ffffff !important;
    border-color: #e5e5ea !important;
}

body.theme-light .settings-group-label span {
    border-left-color: #007aff;
}

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.modal-content { background: rgba(28, 28, 30, 0.94); border: 1px solid var(--border); padding: 24px; width: 92%; max-width: 360px; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }

.switch-container { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: rgba(255, 255, 255, 0.03); border-radius: 12px; margin-bottom: 15px; border: 1px dashed rgba(255, 255, 255, 0.1); }
.switch { position: relative; display: inline-block; width: 51px; height: 31px; }
.switch input { opacity: 0; width: 0; height: 0; margin-bottom: 0 !important; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #3a3a3c; transition: .3s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 27px; width: 27px; left: 2px; bottom: 2px; background-color: white; transition: .3s; border-radius: 50%; box-shadow: 0 3px 8px rgba(0,0,0,0.3); }
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(20px); }

/* --- FUTURISTIC LED RGB ANIMATIONEN --- */
body.party-mode { 
    animation: smoothGradient 10s ease infinite; 
    background: linear-gradient(45deg, #0a001a, #001a1a, #1a000d, #00001a);
    background-size: 400% 400%;
}
body.party-mode .card { 
    background: #111;
    border: 1px solid rgba(255,255,255,0.1);
    animation: rgbPulse 6s infinite alternate ease-in-out; 
}
body.party-mode header h1, body.party-mode .stock { 
    animation: rgbText 5s linear infinite; 
}
body.party-mode button.btn-animated { 
    animation: rgbBorder 4s infinite alternate; 
}

@keyframes smoothGradient { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes rgbPulse { 
    0% { box-shadow: 0 0 15px rgba(0,255,255,0.3), inset 0 0 10px rgba(0,255,255,0.1); border-color: rgba(0,255,255,0.5); } 
    50% { box-shadow: 0 0 15px rgba(255,0,255,0.3), inset 0 0 10px rgba(255,0,255,0.1); border-color: rgba(255,0,255,0.5); } 
    100% { box-shadow: 0 0 15px rgba(0,255,0,0.3), inset 0 0 10px rgba(0,255,0,0.1); border-color: rgba(0,255,0,0.5); } 
}
@keyframes rgbText { 
    0% { color: #0ff; text-shadow: 0 0 8px rgba(0,255,255,0.6); } 
    33% { color: #f0f; text-shadow: 0 0 8px rgba(255,0,255,0.6); } 
    66% { color: #0f0; text-shadow: 0 0 8px rgba(0,255,0,0.6); } 
    100% { color: #0ff; text-shadow: 0 0 8px rgba(0,255,255,0.6); } 
}
@keyframes rgbBorder { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }


/* ==========================================================================
   🎀 SUPER CUTE PINK GIRL EDITION OVERRIDES 🎀
   ========================================================================== */
body.theme-girl textarea,
body.theme-girl input[type="number"],
body.theme-girl input[type="text"],
body.theme-girl input[type="password"],
body.theme-girl input[type="file"],
body.theme-girl select,
body.theme-girl .log-item,
body.theme-girl .stat-block,
body.theme-girl #cr-preview-container,
body.theme-girl #containerSection {
    background: #fff5f8 !important;
    color: #4a0026 !important;
    border: 1px solid #ffccd9 !important;
}

body.theme-girl select option { background: #ffffff !important; color: #4a0026 !important; }
body.theme-girl .modal-content { background: #ffffff !important; border: 2px solid #ff66a4 !important; color: #4a0026 !important; }

body.theme-girl h1, body.theme-girl h2, body.theme-girl h3, body.theme-girl h4, 
body.theme-girl label, body.theme-girl span, body.theme-girl strong, 
body.theme-girl .stat-grid div strong, body.theme-girl .trace-grid label {
    color: #4a0026 !important;
}

body.theme-girl .btn-in { background: #ffe3ee !important; color: #ff1493 !important; border: 1px solid #ffb3d1 !important; }
body.theme-girl .btn-out { background: #fff0f5 !important; color: #d90452 !important; border: 1px solid #ffccd9 !important; }
body.theme-girl .btn-primary { background: #ff66a4 !important; color: #ffffff !important; }
body.theme-girl .btn-secondary { background: #ffccd9 !important; color: #4a0026 !important; }
body.theme-girl .btn-danger { background: #d90452 !important; color: #ffffff !important; }
body.theme-girl .btn-cancel { background: #ffccd9 !important; color: #4a0026 !important; }

body.theme-girl .stock { background: #ffccd9 !important; color: #d90452 !important; }
body.theme-girl .version-badge { background: #ffccd9 !important; color: #ff1493 !important; border: 1px solid #ff66a4 !important; }
body.theme-girl .prognose-badge { background: #ffe3ee !important; color: #ff1493 !important; }
body.theme-girl header { background: rgba(255, 238, 244, 0.85) !important; box-shadow: 0 1px 0 #ffccd9 !important; }
body.theme-girl .nav-menu { background: rgba(255, 255, 255, 0.96) !important; border-left: 1px solid #ffccd9 !important; }
body.theme-girl .nav-links button { background: #fff5f8 !important; color: #4a0026 !important; }
body.theme-girl .nav-links button.active { background: #ff66a4 !important; color: #ffffff !important; }
body.theme-girl .cross-hint { color: #d90452 !important; }

@media (min-width: 768px) {
    body.theme-girl .nav-menu { background: #ffffff !important; border-bottom: 1px solid #ffccd9 !important; }
    body.theme-girl .nav-links button.active { background: rgba(255, 102, 164, 0.1) !important; color: #ff1493 !important; border-bottom: 3px solid #ff1493 !important; }
}

body.theme-girl header h1::before { content: "💖 "; }
body.theme-girl header h1::after { content: " 🎀"; }
body.theme-girl .category-title::before { content: "💕 "; }
body.theme-girl .category-title::after { content: " 💕"; }
body.theme-girl .card h4 span::before { content: "🌸 "; }
body.theme-girl .btn-in::before { content: "🎀 "; }
body.theme-girl .btn-out::before { content: "💗 "; }

body.theme-girl.party-mode { 
    animation: pinkDiscoGradient 8s ease infinite !important; 
    background: linear-gradient(45deg, #ffb6c1, #ff69b4, #da70d6, #ffc0cb) !important;
    background-size: 400% 400% !important;
}
body.theme-girl.party-mode .card {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid #ff66a4 !important;
    animation: pinkRgbPulse 4s infinite alternate ease-in-out !important;
}
@keyframes pinkDiscoGradient { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes pinkRgbPulse {
    0% { box-shadow: 0 0 15px rgba(255,20,147,0.2); border-color: #ff66a4; }
    100% { box-shadow: 0 0 15px rgba(218,112,214,0.4); border-color: #ff1493; }
}


/* ==========================================================================
   🌊 NEW CLEAN MINT OCEAN EDITION OVERRIDES (100% ANPASSUNG) 🌊
   ========================================================================== */

/* Eingabefelder, Listen, Protokolle & Blöcke im Meeres-Stil */
body.theme-mint textarea,
body.theme-mint input[type="number"],
body.theme-mint input[type="text"],
body.theme-mint input[type="password"],
body.theme-mint input[type="file"],
body.theme-mint select,
body.theme-mint .log-item,
body.theme-mint .stat-block,
body.theme-mint #cr-preview-container,
body.theme-mint #containerSection {
    background: #051b30 !important;
    color: #e6f1ff !important;
    border: 1px solid #103a61 !important;
}

body.theme-mint select option { background: #0a2540 !important; color: #e6f1ff !important; }
body.theme-mint .modal-content { background: #0a2540 !important; border: 2px solid #00f0ff !important; color: #e6f1ff !important; }

/* Alle Texte im Mint/Ocean Mode auf klares Meeres-Weiß umschalten */
body.theme-mint h1, body.theme-mint h2, body.theme-mint h3, body.theme-mint h4, 
body.theme-mint label, body.theme-mint span, body.theme-mint strong, 
body.theme-mint .stat-grid div strong, body.theme-mint .trace-grid label {
    color: #e6f1ff !important;
}
body.theme-mint .subtitle, body.theme-mint .hint, body.theme-mint .unit-label, body.theme-mint .log-date {
    color: #8892b0 !important;
}

/* Ein- und Auslagerungsbuttons sowie Menüs in Meeres-Schattierungen */
body.theme-mint .btn-in { background: rgba(0, 240, 255, 0.1) !important; color: #00f0ff !important; border: 1px solid rgba(0, 240, 255, 0.3) !important; }
body.theme-mint .btn-out { background: rgba(255, 74, 116, 0.1) !important; color: #ff4a74 !important; border: 1px solid rgba(255, 74, 116, 0.3) !important; }
body.theme-mint .btn-primary { background: linear-gradient(135deg, #00f0ff, #0072ff) !important; color: #ffffff !important; }
body.theme-mint .btn-secondary { background: #103a61 !important; color: #64ffda !important; }
body.theme-mint .btn-danger { background: #ff4a74 !important; color: #ffffff !important; }
body.theme-mint .btn-cancel { background: #051b30 !important; color: #8892b0 !important; }

/* Highlights, Badges und Navigationsleisten */
body.theme-mint .stock { background: rgba(100, 255, 250, 0.15) !important; color: #64ffda !important; }
body.theme-mint .version-badge { background: rgba(0, 240, 255, 0.15) !important; color: #00f0ff !important; border: 1px solid #00f0ff !important; }
body.theme-mint .prognose-badge { background: rgba(0, 240, 255, 0.1) !important; color: #64ffda !important; }
body.theme-mint header { background: rgba(3, 20, 36, 0.85) !important; box-shadow: 0 1px 0 #103a61 !important; }
body.theme-mint .nav-menu { background: rgba(10, 37, 64, 0.96) !important; border-left: 1px solid #103a61 !important; }
body.theme-mint .nav-links button { background: #0a2540 !important; color: #8892b0 !important; }
body.theme-mint .nav-links button.active { background: #00f0ff !important; color: #031424 !important; }
body.theme-mint .cross-hint { color: #ff4a74 !important; }

/* Desktop Navigation Anpassung für Mint/Ocean Edition */
@media (min-width: 768px) {
    body.theme-mint .nav-menu { background: #0a2540 !important; border-bottom: 1px solid #103a61 !important; }
    body.theme-mint .nav-links button.active { background: rgba(0, 240, 255, 0.1) !important; color: #00f0ff !important; border-bottom: 3px solid #00f0ff !important; }
}

/* 🌊 AUTOMATISCHE OZEAN & SUBMARIN AKZENTE (Motto Emojis) 🐬 */
body.theme-mint header h1::before { content: "🌊 "; }
body.theme-mint header h1::after { content: " 🐬"; }
body.theme-mint .category-title::before { content: "🐠 "; }
body.theme-mint .category-title::after { content: " 🐙"; }
/*body.theme-mint .card h4 span::before { content: "🐚 "; }*/
body.theme-mint .stock span::before { content: "🐚 "; }
body.theme-mint .btn-in::before { content: "⚓ "; }
body.theme-mint .btn-out::before { content: "🌊 "; }

/* 🧬 SPEZIAL: BIOLUMINESZENTER TIEFSEE-RAVE IM PARTY MODUS */
body.theme-mint.party-mode { 
    animation: oceanDiscoGradient 8s ease infinite !important; 
    background: linear-gradient(45deg, #020b14, #004e92, #000428, #00c6ff) !important;
    background-size: 400% 400% !important;
}
body.theme-mint.party-mode .card {
    background: rgba(5, 27, 48, 0.85) !important;
    border: 1px solid #00f0ff !important;
    animation: oceanRgbPulse 4s infinite alternate ease-in-out !important;
}
@keyframes oceanDiscoGradient { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes oceanRgbPulse {
    0% { box-shadow: 0 0 15px rgba(0,240,255,0.2); border-color: #00f0ff; }
    100% { box-shadow: 0 0 20px rgba(100,255,218,0.4); border-color: #64ffda; }
}

/* --- NEUE FEATURES: SUCHE, WARNUNGEN & STATISTIK --- */

/* --- LAGER TOOLBAR (Premium Design) --- */
.lager-toolbar {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 6px;
    overflow: hidden;
}

.toolbar-field {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    padding: 0 4px;
    height: 44px;
    border-radius: 12px;
    transition: background 0.2s ease;
}
.toolbar-field:focus-within {
    background: rgba(255,255,255,0.04);
}
.toolbar-field-compact {
    flex: 0 0 auto;
}

.toolbar-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
    opacity: 0.5;
    padding-left: 6px;
}

.toolbar-divider {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
    margin: 0 2px;
}

.search-input {
    flex: 1;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.9rem;
    margin: 0 !important;
    outline: none;
    min-width: 0;
    height: 36px;
    line-height: 36px;
    box-sizing: border-box;
}
.search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.filter-select,
.forecast-select {
    flex: 1;
    padding: 0 28px 0 6px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 0;
    padding-left: 6px !important;
    outline: none;
    cursor: pointer;
    min-width: 0;
    height: 36px;
    line-height: 36px;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23666' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}
.forecast-select {
    width: 110px;
    flex: none;
    text-align: center;
    padding: 0 20px 0 0;
    background-position: right 4px center;
}

@media (max-width: 767px) {
    .lager-toolbar {
        flex-direction: column;
        gap: 0;
        padding: 6px 0;
    }
    .toolbar-field {
        width: 100%;
        padding: 0 10px;
    }
    .toolbar-divider {
        width: calc(100% - 20px);
        height: 1px;
        margin: 4px 10px;
    }
    .toolbar-field-compact {
        flex: 1;
    }
    .forecast-select {
        width: 100%;
        flex: 1;
    }
}

.alert-summary {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--danger);
    color: var(--text);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.alert-summary.success {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--success);
    color: var(--success);
    font-weight: 500;
}

.alert-title {
    color: var(--danger);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    list-style: none;
}

.alert-title::-webkit-details-marker {
    display: none;
}

.alert-summary[open] .alert-title {
    margin-bottom: 8px;
}

.alert-summary-hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.alert-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.88rem;
}

@media (min-width: 680px) {
    .alert-row {
        grid-template-columns: 1fr auto auto;
    }
}

.alert-row small {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-top: 2px;
}

.alert-reason {
    color: var(--danger);
    font-weight: 700;
}

.alert-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.alert-actions button,
.disabled-alert-row button,
.custom-product-row button {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 9px;
    font-size: 0.78rem;
}

.item-hint {
    display: block;
    color: var(--text-muted);
    font-size: 0.76rem;
    margin-top: 4px;
}

.danger-text {
    color: var(--danger);
}

.notification-status {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.88rem;
    line-height: 1.4;
}

.notification-status[data-type="ok"] {
    color: var(--success);
    border-color: rgba(48, 209, 88, 0.35);
    background: rgba(48, 209, 88, 0.08);
}

.notification-status[data-type="warn"] {
    color: var(--danger);
    border-color: rgba(255, 69, 58, 0.35);
    background: rgba(255, 69, 58, 0.08);
}

.sync-auth-state {
    margin-top: 8px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.035);
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.sync-auth-state[data-state="in"] {
    color: var(--success);
    border-color: rgba(48, 209, 88, 0.34);
    background: rgba(48, 209, 88, 0.08);
}

.sync-auth-state[data-state="out"] {
    color: var(--danger);
    border-color: rgba(255, 69, 58, 0.34);
    background: rgba(255, 69, 58, 0.08);
}

.password-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.password-field input {
    margin-bottom: 15px;
}

.password-field button {
    width: auto;
    margin-bottom: 15px;
    padding: 12px 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-size: 0.82rem;
}

.sync-privacy-note,
.sync-password-recovery,
.sync-activation-note,
.share-active-warehouse-box {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.86rem;
    line-height: 1.4;
}

.sync-activation-note {
    color: var(--secondary);
    border-color: rgba(100, 210, 255, 0.34);
    background: rgba(100, 210, 255, 0.08);
    font-weight: 700;
}

.sync-maintenance-banner {
    display: grid;
    gap: 6px;
    margin: 12px 0;
    padding: 12px;
    border: 1px solid rgba(255, 69, 58, 0.28);
    border-radius: 12px;
    background: rgba(255, 69, 58, 0.1);
    color: #ffd2cc;
    font-size: 0.86rem;
    line-height: 1.45;
}

.sync-maintenance-banner strong {
    color: #fff3f0;
}

.sync-disabled-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.sync-disabled-card .sync-disabled-fieldset {
    opacity: 0.56;
    filter: saturate(0.82);
}

.storage-safety-card {
    border: 1px solid rgba(100, 210, 255, 0.24) !important;
    background:
        linear-gradient(135deg, rgba(100, 210, 255, 0.06), rgba(191, 90, 242, 0.04)),
        rgba(255,255,255,0.018) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

.storage-safety-title {
    color: var(--secondary);
    margin-bottom: 6px;
}

.storage-safety-actions {
    margin-top: 14px;
    flex-wrap: wrap;
}

.storage-safety-note {
    margin-top: 14px;
}

.storage-safety-status-shell {
    display: grid;
    gap: 12px;
}

.storage-safety-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.storage-safety-hero strong,
.storage-safety-hero small {
    display: block;
}

.storage-safety-hero strong {
    color: var(--text);
    font-size: 1rem;
}

.storage-safety-hero small {
    margin-top: 4px;
    color: var(--text-muted);
    line-height: 1.4;
}

.storage-safety-hero.is-ready {
    border-color: rgba(48, 209, 88, 0.24);
    background: linear-gradient(135deg, rgba(48, 209, 88, 0.1), rgba(100, 210, 255, 0.05));
}

.storage-safety-hero.is-warning {
    border-color: rgba(255, 214, 10, 0.3);
    background: linear-gradient(135deg, rgba(255, 214, 10, 0.14), rgba(255,255,255,0.03));
}

.storage-safety-pill {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(100, 210, 255, 0.26);
    background: rgba(100, 210, 255, 0.1);
    color: var(--secondary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.storage-safety-pill.is-ready {
    border-color: rgba(48, 209, 88, 0.28);
    background: rgba(48, 209, 88, 0.12);
    color: var(--success);
}

.storage-safety-pill.is-warning {
    border-color: rgba(255, 214, 10, 0.3);
    background: rgba(255, 214, 10, 0.12);
    color: #ffd60a;
}

.storage-safety-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.storage-safety-status-card {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.028);
}

.storage-safety-status-card small,
.storage-safety-status-card strong,
.storage-safety-status-card span {
    display: block;
}

.storage-safety-status-card small {
    color: var(--text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.storage-safety-status-card strong {
    margin-top: 6px;
    color: var(--text);
    font-size: 0.98rem;
}

.storage-safety-status-card span {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.backup-project-card {
    border: 1px solid rgba(255,255,255,0.08);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)),
        rgba(255,255,255,0.015);
}

.backup-project-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.backup-project-import {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 10px;
}

.backup-project-import input[type="file"] {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.google-drive-sync-card {
    border: 1px solid rgba(48, 209, 88, 0.18);
    background:
        linear-gradient(135deg, rgba(48, 209, 88, 0.05), rgba(10, 132, 255, 0.035)),
        rgba(255,255,255,0.018);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
}

.google-drive-sync-title {
    color: var(--success);
    margin-bottom: 6px;
}

.google-drive-sync-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.google-drive-status-shell {
    display: grid;
    gap: 12px;
}

.google-drive-status-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.google-drive-status-hero strong,
.google-drive-status-hero small {
    display: block;
}

.google-drive-status-hero strong {
    font-size: 1rem;
    color: var(--text);
}

.google-drive-status-hero small {
    margin-top: 4px;
    color: var(--text-muted);
    line-height: 1.4;
}

.google-drive-status-hero.is-connected {
    border-color: rgba(48, 209, 88, 0.28);
    background: linear-gradient(135deg, rgba(48, 209, 88, 0.12), rgba(10, 132, 255, 0.06));
}

.google-drive-status-pill {
    flex-shrink: 0;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(48, 209, 88, 0.28);
    background: rgba(48, 209, 88, 0.12);
    color: var(--success);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.google-drive-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.google-drive-status-card {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.028);
}

.google-drive-status-card small,
.google-drive-status-card strong,
.google-drive-status-card span {
    display: block;
}

.google-drive-status-card small {
    color: var(--text-muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.google-drive-status-card strong {
    margin-top: 6px;
    color: var(--text);
    font-size: 0.98rem;
}

.google-drive-status-card span {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.google-drive-status-note {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(100, 210, 255, 0.14);
    background: rgba(100, 210, 255, 0.06);
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.45;
}

.is-disabled-soft {
    opacity: 0.48;
    cursor: not-allowed;
    pointer-events: none;
}

.google-drive-diagnostics {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding-top: 12px;
}

.google-drive-diagnostics summary {
    cursor: pointer;
    color: var(--secondary);
    font-weight: 700;
    list-style: none;
}

.google-drive-diagnostics summary::-webkit-details-marker {
    display: none;
}

.google-drive-diagnostics-body {
    margin-top: 12px;
    display: grid;
    gap: 10px;
}

.google-drive-diagnostics-actions {
    display: flex;
    justify-content: flex-start;
}

.tool-card-lock-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.google-drive-sync-toggle {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.google-drive-sync-toggle span {
    display: grid;
    gap: 2px;
}

.google-drive-sync-toggle strong {
    font-size: 0.95rem;
}

.google-drive-sync-toggle small {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.google-drive-sync-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--success);
}

@media (max-width: 767px) {
    .storage-safety-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .storage-safety-grid {
        grid-template-columns: 1fr;
    }

    .google-drive-status-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .tool-card-lock-header {
        flex-direction: column;
        align-items: stretch;
    }

    .google-drive-status-grid {
        grid-template-columns: 1fr;
    }
}

.share-active-warehouse-box {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.share-active-warehouse-box strong {
    overflow-wrap: anywhere;
}

.share-active-warehouse-box span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.share-active-warehouse-box[data-access="owner"] {
    border-color: rgba(48, 209, 88, 0.34);
}

.share-active-warehouse-box[data-access="read"] {
    border-color: rgba(255, 69, 58, 0.34);
}

.share-active-warehouse-box[data-access="write"] {
    border-color: rgba(100, 210, 255, 0.34);
}

.sync-privacy-note strong {
    display: block;
    margin-bottom: 4px;
}

.sync-privacy-note span {
    color: var(--text-muted);
}

.sync-password-recovery label {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.sync-auto-row.sync-auto-active {
    border-color: rgba(48, 209, 88, 0.35) !important;
    background: rgba(48, 209, 88, 0.08) !important;
}

.sync-auto-row.sync-auto-active > span {
    color: var(--success);
}

.sync-friend-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    font-size: 0.88rem;
}

.sync-friend-row small {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 2px;
}

.sync-friend-row button {
    width: auto;
    padding: 8px 10px;
    font-size: 0.78rem;
}

.sync-friend-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.sync-friend-actions select {
    width: auto;
    min-width: 155px;
    margin-bottom: 0;
    padding: 8px 10px;
    font-size: 0.78rem;
}

.sync-friend-actions button {
    margin-bottom: 0;
}

.sync-subpanel {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
}

.sync-subpanel h4 {
    margin: 0 0 8px;
    color: var(--secondary);
}

.overview-group {
    margin-top: 10px;
}

.overview-group > strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
}

.overview-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.86rem;
}

.overview-row small {
    color: var(--text-muted);
    text-align: right;
}

.favorite-btn.active {
    color: #ffd60a;
}

.logbook-hero {
    border-color: rgba(100, 210, 255, 0.36) !important;
    background: linear-gradient(135deg, rgba(100,210,255,0.10), rgba(48,209,88,0.06)) !important;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    margin-bottom: 14px;
}

.logbook-hero h3 {
    margin-bottom: 4px;
}

.logbook-hero .hint {
    margin: 0;
}

.logbook-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(74px, 1fr));
    gap: 8px;
}

.logbook-metrics div {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    text-align: center;
}

.logbook-metrics strong {
    display: block;
    color: var(--secondary);
    font-size: 1.05rem;
    line-height: 1;
}

.logbook-metrics span {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.logbook-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 14px;
    align-items: start;
}

.logbook-card {
    padding: 16px;
    margin-bottom: 0;
}

.logbook-document-card {
    grid-row: span 2;
}

.logbook-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.logbook-section-title h3 {
    margin: 0;
}

.logbook-section-title span {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--secondary);
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.72rem;
    font-weight: 900;
}

.logbook-card .tool-grid {
    gap: 10px;
}

.logbook-card .input-group {
    margin-bottom: 10px;
}

.logbook-card textarea {
    min-height: 82px;
    resize: vertical;
}

.logbook-primary-action {
    margin-top: 2px;
    margin-bottom: 12px;
}

.logbook-card-details[open] {
    padding-bottom: 2px;
}

.logbook-card-details > .logbook-summary {
    margin: 0;
}

.logbook-card-body {
    margin-top: 12px;
}

.logbook-entry,
.todo-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    margin-top: 8px;
}

.logbook-entry strong,
.todo-row strong {
    display: block;
    color: var(--text);
    font-size: 0.94rem;
    line-height: 1.22;
}

.logbook-entry small,
.todo-row small,
.logbook-entry p {
    display: block;
    color: var(--text-muted);
    font-size: 0.76rem;
    margin: 4px 0 0;
    line-height: 1.35;
}

.todo-row.due {
    border-color: rgba(255, 69, 58, 0.55);
    background: rgba(255, 69, 58, 0.08);
}

.todo-row.done {
    opacity: 0.58;
}

.logbook-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.logbook-actions button {
    width: auto;
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 0.74rem;
}

.logbook-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    list-style: none;
    font-weight: 900;
    color: var(--secondary);
    margin: 6px 0 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    transition: color 0.2s ease, background 0.2s ease;
}

.logbook-summary:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.03);
}

.logbook-summary::-webkit-details-marker {
    display: none;
}

.measurement-panel {
    display: grid;
    gap: 12px;
}

.measurement-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.measurement-stats div,
.measurement-detail-card,
.measurement-chart-card,
.measurement-list-row,
.measurement-empty,
.dosing-container-row {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.measurement-stats div {
    padding: 12px;
}

.measurement-stats strong {
    display: block;
    font-size: 0.98rem;
    color: var(--secondary);
}

.measurement-stats span {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.35;
}

.measurement-chart-card,
.measurement-detail-card,
.measurement-empty {
    padding: 14px;
}

.measurement-chart-head,
.measurement-chart-meta,
.measurement-detail-actions,
.measurement-type-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.measurement-chart-head strong,
.measurement-detail-card strong,
.measurement-empty strong {
    display: block;
    font-size: 0.98rem;
}

.measurement-chart-head small,
.measurement-chart-meta span,
.measurement-detail-card small,
.measurement-empty p,
.measurement-list-button small {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.measurement-chart {
    width: 100%;
    height: 240px;
    margin: 10px 0 8px;
    overflow: visible;
}

.measurement-chart.compact {
    margin-inline: auto;
}

.measurement-axis {
    stroke: rgba(255,255,255,0.14);
    stroke-width: 1;
}

.measurement-grid-line {
    stroke: rgba(255,255,255,0.08);
    stroke-width: 1;
    stroke-dasharray: 4 6;
}

.measurement-area {
    fill: url(#measurementFill);
}

.measurement-focus-line {
    stroke: color-mix(in srgb, var(--primary) 65%, white);
    stroke-width: 1.5;
    stroke-dasharray: 5 7;
    opacity: 0.7;
}

.measurement-line {
    fill: none;
    stroke: url(#measurementLineGlow);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 6px 14px rgba(10, 132, 255, 0.18));
}

.measurement-point-hit {
    fill: transparent;
    cursor: pointer;
}

.measurement-point-halo {
    fill: rgba(191, 90, 242, 0.08);
    opacity: 0;
    transform-origin: center;
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.measurement-point-ring {
    fill: rgba(255, 255, 255, 0.9);
    opacity: 0.9;
    transition: transform 0.24s ease, opacity 0.24s ease, fill 0.24s ease;
    transform-origin: center;
}

.measurement-point {
    fill: var(--secondary);
    stroke: color-mix(in srgb, var(--card-bg) 70%, white);
    stroke-width: 2;
    transition: transform 0.24s ease, fill 0.24s ease, stroke 0.24s ease;
    transform-origin: center;
}

.measurement-point-group {
    cursor: pointer;
}

.measurement-point-group.active .measurement-point-halo,
.measurement-point-group:hover .measurement-point-halo {
    opacity: 1;
    transform: scale(1.02);
}

.measurement-point-group.active .measurement-point-ring,
.measurement-point-group:hover .measurement-point-ring {
    fill: color-mix(in srgb, var(--primary) 24%, white);
    transform: scale(1.05);
}

.measurement-point-group.active .measurement-point,
.measurement-point-group:hover .measurement-point {
    fill: var(--primary);
    stroke: color-mix(in srgb, var(--primary) 38%, white);
    transform: scale(1.1);
}

.measurement-label {
    fill: var(--text-muted);
    font-size: 12px;
}

.measurement-y-label {
    fill: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.measurement-detail-value {
    margin: 6px 0 8px;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text);
}

.measurement-detail-card p {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.measurement-list {
    display: grid;
    gap: 8px;
}

.measurement-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
}

.measurement-list-row.active {
    border-color: color-mix(in srgb, var(--primary) 46%, var(--border));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}

.community-map-card-shell {
    display: grid;
    gap: 14px;
}

.community-map-privacy,
.community-map-login-hint,
.community-map-request-card,
.community-member-row,
.community-map-location-box,
.community-map-visual {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
}

.community-map-privacy,
.community-map-login-hint,
.community-map-request-card,
.community-map-location-box,
.community-map-visual {
    padding: 14px;
}

.community-map-layout,
.community-map-request-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 14px;
}

.community-map-form {
    display: grid;
    gap: 12px;
}

.community-map-surface {
    stroke: rgba(255,255,255,0.1);
    stroke-width: 1;
}

.community-map-svg {
    width: 100%;
    min-height: 320px;
}

.community-map-grid {
    stroke: rgba(255,255,255,0.08);
    stroke-width: 1;
}

.community-map-region,
.community-map-caption {
    fill: rgba(255,255,255,0.28);
    font-size: 14px;
    font-weight: 600;
    text-anchor: middle;
}

.community-map-caption {
    text-anchor: start;
    font-size: 13px;
}

.community-map-pin {
    cursor: pointer;
}

.community-map-pin-glow {
    fill: url(#communityPinGlow);
    opacity: 0;
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.community-map-pin-ring {
    fill: rgba(255,255,255,0.1);
    stroke: rgba(255,255,255,0.42);
    stroke-width: 1.3;
    transition: transform 0.24s ease, stroke 0.24s ease, fill 0.24s ease;
}

.community-map-pin-core {
    fill: var(--primary);
    stroke: rgba(255,255,255,0.82);
    stroke-width: 2;
    transition: transform 0.24s ease, fill 0.24s ease;
}

.community-map-pin-label {
    fill: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-anchor: middle;
    opacity: 0.78;
    transition: opacity 0.24s ease;
}

.community-map-pin.active .community-map-pin-glow,
.community-map-pin:hover .community-map-pin-glow {
    opacity: 1;
}

.community-map-pin.active .community-map-pin-ring,
.community-map-pin:hover .community-map-pin-ring,
.community-map-pin.active .community-map-pin-core,
.community-map-pin:hover .community-map-pin-core {
    transform: scale(1.06);
}

.community-map-pin.active .community-map-pin-label,
.community-map-pin:hover .community-map-pin-label {
    opacity: 1;
}

.community-map-pin.own .community-map-pin-core {
    fill: var(--secondary);
}

.community-member-list,
.community-request-list {
    display: grid;
    gap: 10px;
}

.community-member-row,
.community-request-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
}

.community-member-row.active {
    border-color: color-mix(in srgb, var(--primary) 52%, var(--border));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 16%, transparent);
}

.community-member-main {
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    color: var(--text);
}

.community-member-main strong,
.community-request-row strong {
    display: block;
}

.community-member-main small,
.community-request-row small,
.community-member-meta span {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.community-member-meta {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.community-own-badge {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(10, 132, 255, 0.14);
    color: var(--secondary);
    font-weight: 700;
}

.community-request-row p {
    margin: 6px 0 0;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.45;
}

.community-request-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.community-map-manual {
    margin-top: 10px;
}

.community-map-manual summary,
.community-map-outbox summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text);
}

.community-map-outbox {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 6px;
}

.measurement-list-button {
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--text);
    text-align: left;
}

.measurement-list-button strong {
    display: block;
}

.measurement-empty p {
    margin: 8px 0 0;
}

.dosing-container-list {
    display: grid;
    gap: 10px;
}

.dosing-container-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
}

.dosing-container-row.warning {
    border-color: rgba(255, 69, 58, 0.55);
    background: rgba(255, 69, 58, 0.08);
}

.dosing-container-row strong {
    display: block;
    margin-bottom: 4px;
}

.dosing-container-row small {
    display: block;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.4;
}

.mini-progress {
    width: 100%;
    height: 8px;
    margin: 10px 0 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}

.mini-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
}

.interval-picker {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 8px;
}

.interval-picker button {
    min-height: 40px;
    padding: 8px 6px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-weight: 800;
    font-size: 0.8rem;
    line-height: 1.15;
    white-space: normal;
    word-break: break-word;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.interval-picker button:hover {
    transform: translateY(-1px);
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.1);
}

.interval-picker button.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.28), rgba(48, 209, 88, 0.2));
    color: #fff;
    box-shadow: 0 8px 22px rgba(10, 132, 255, 0.18);
}

#naclSolutionResult .tool-row > span:last-child {
    text-align: right;
    font-weight: 900;
}

@media (max-width: 820px) {
    .tool-grid,
    .resource-link-grid,
    .tool-card-grid {
        grid-template-columns: 1fr;
    }

    .tool-card-grid {
        padding: 10px;
    }

    .tool-section-summary {
        padding: 13px 14px;
    }

    .tool-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .tool-row > span:last-child {
        text-align: left;
    }

    .logbook-hero,
    .logbook-layout {
        grid-template-columns: 1fr;
    }

    .logbook-hero {
        padding: 14px;
    }

    .logbook-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .logbook-metrics div {
        padding: 9px 6px;
    }

    .logbook-card {
        padding: 14px;
    }

    .community-map-layout,
    .community-map-request-grid {
        grid-template-columns: 1fr;
    }

    .community-map-svg {
        min-height: 260px;
    }

    .community-member-row,
    .community-request-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .community-member-meta,
    .community-request-actions {
        justify-items: start;
        justify-content: flex-start;
    }

    .logbook-entry,
    .todo-row,
    .measurement-list-row,
    .dosing-container-row {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .logbook-actions {
        justify-content: stretch;
    }

    .logbook-actions button,
    .measurement-type-actions button,
    .measurement-detail-actions button {
        flex: 1;
    }

    .interval-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .interval-picker button {
        min-height: 46px;
        font-size: 0.76rem;
        padding: 8px 5px;
    }

    .measurement-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .measurement-chart {
        height: 290px;
        margin: 12px -6px 10px;
        width: calc(100% + 12px);
    }

    .measurement-chart-head,
    .measurement-chart-meta,
    .measurement-detail-actions,
    .measurement-type-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #naclSolutionResult .tool-row > span:last-child {
        text-align: left;
    }
}

@media (max-width: 600px) {
    .measurement-chart-card,
    .measurement-detail-card,
    .measurement-empty {
        padding: 12px;
    }

    .measurement-stats {
        grid-template-columns: 1fr;
    }

    .measurement-chart {
        height: 300px;
        margin: 12px -8px 10px;
        width: calc(100% + 16px);
    }

    .measurement-chart-head strong,
    .measurement-detail-card strong,
    .measurement-empty strong {
        font-size: 0.94rem;
    }

    .measurement-chart-head small,
    .measurement-chart-meta span,
    .measurement-detail-card small,
    .measurement-empty p,
    .measurement-list-button small {
        font-size: 0.74rem;
    }

    .measurement-detail-value {
        font-size: 1.25rem;
    }

    .sync-friend-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .sync-friend-actions {
        justify-content: stretch;
    }

    .sync-friend-actions select,
    .sync-friend-actions button {
        flex: 1;
    }
}

.disabled-alert-products,
.custom-products-list {
    margin-top: 12px;
}

.disabled-alert-title {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.disabled-alert-row,
.custom-product-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-top: 1px solid var(--border);
    font-size: 0.86rem;
}
@media (max-width: 600px) {
    .disabled-alert-row,
    .custom-product-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.custom-product-row small {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 2px;
}

.visibility-group {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 12px;
}

.visibility-group strong {
    display: block;
    margin-bottom: 8px;
    color: var(--secondary);
}

.visibility-row {
    display: grid;
    grid-template-columns: 26px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 7px 0;
    color: var(--text);
    font-size: 0.86rem;
}

.visibility-row input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.visibility-row small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.tool-result {
    background: linear-gradient(135deg, rgba(255,255,255,0.065), rgba(255,255,255,0.025));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px;
    margin: 12px 0 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.tools-shell {
    display: grid;
    gap: 14px;
}

.tools-command-bar {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,0.025);
}

.tools-search-wrap {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.045);
    padding: 0 12px;
}

.tools-search-wrap span {
    color: var(--secondary);
    font-size: 1.15rem;
    line-height: 1;
}

.tools-search-wrap input {
    border: 0;
    background: transparent;
    margin: 0;
    padding: 12px 0;
    min-height: 44px;
}

.tools-search-wrap input:focus {
    outline: none;
    box-shadow: none;
}

.tool-favorites-panel {
    display: grid;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    padding: 12px;
}

.tool-favorites-head {
    display: grid;
    gap: 3px;
}

.tool-favorites-head strong {
    color: var(--text);
    font-size: 0.98rem;
}

.tool-favorites-head small,
.tools-favorites-empty {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.tool-favorites-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 34px;
    align-items: center;
}

.tool-experimental-banner {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 140, 70, 0.35);
    border-radius: 12px;
    background: rgba(255, 140, 70, 0.08);
}

.tool-experimental-banner strong {
    color: #ffb26b;
    font-size: 0.92rem;
}

.tool-experimental-banner span {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.custom-cr-protected-content[hidden],
#customCrLockState[hidden] {
    display: none !important;
}

.custom-cr-result-shell {
    display: grid;
    gap: 14px;
}

.custom-cr-overview-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(191, 90, 242, 0.05));
}

.custom-cr-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.custom-cr-metric {
    display: grid;
    gap: 3px;
    padding: 12px 13px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.035);
}

.custom-cr-metric small {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.custom-cr-metric strong {
    color: var(--secondary);
    font-size: 1rem;
    line-height: 1.2;
}

.custom-cr-metric span {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.custom-cr-section {
    display: grid;
    gap: 10px;
}

.custom-cr-section-head {
    display: grid;
    gap: 2px;
}

.custom-cr-section-head strong {
    font-size: 0.96rem;
}

.custom-cr-section-head small {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.custom-cr-topline {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(191, 90, 242, 0.12), rgba(10, 132, 255, 0.08));
}

.custom-cr-topline strong {
    font-size: 0.98rem;
}

.custom-cr-topline span {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.custom-cr-matrix-headline {
    display: grid;
    gap: 2px;
    margin: 10px 0 8px;
}

.custom-cr-matrix-headline strong {
    font-size: 0.96rem;
}

.custom-cr-matrix-headline small {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.custom-cr-limits-shell {
    display: grid;
    gap: 10px;
    margin: 8px 0 14px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    overflow: hidden;
}

.custom-cr-collapsible-head {
    list-style: none;
    cursor: pointer;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.custom-cr-collapsible-head::-webkit-details-marker {
    display: none;
}

.custom-cr-collapsible-head::after {
    content: '+';
    color: var(--secondary);
    font-weight: 800;
    font-size: 1rem;
}

.custom-cr-limits-shell[open] .custom-cr-collapsible-head::after {
    content: '−';
}

.custom-cr-limits-grid {
    display: grid;
    grid-template-columns: minmax(78px, 0.9fr) repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: center;
    padding: 0 14px 14px;
}

.custom-cr-limits-header {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.custom-cr-limits-label {
    display: grid;
    gap: 2px;
}

.custom-cr-limits-label strong {
    font-size: 0.9rem;
}

.custom-cr-limits-label small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.custom-cr-limits-grid input {
    width: 100%;
}

.custom-cr-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.custom-cr-product-chip {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
}

.custom-cr-product-chip.missing {
    border-color: rgba(255, 69, 58, 0.42);
    background: rgba(255, 69, 58, 0.08);
}

.custom-cr-product-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.custom-cr-product-head strong {
    font-size: 0.95rem;
}

.custom-cr-product-head span {
    color: var(--secondary);
    font-weight: 800;
    font-size: 0.88rem;
    text-align: right;
}

.custom-cr-product-chip small {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.custom-cr-product-list {
    display: grid;
    gap: 8px;
}

.custom-cr-product-line {
    display: grid;
    grid-template-columns: minmax(70px, auto) minmax(0, auto);
    gap: 8px 10px;
    align-items: start;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
}

.custom-cr-product-line.missing {
    border-color: rgba(255, 69, 58, 0.42);
    background: rgba(255, 69, 58, 0.08);
}

.custom-cr-product-line strong {
    font-size: 0.9rem;
}

.custom-cr-product-line span {
    color: var(--secondary);
    font-weight: 800;
    font-size: 0.84rem;
    text-align: right;
}

.custom-cr-product-line small {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: left;
    grid-column: 1 / -1;
}

.custom-cr-delta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
    gap: 9px;
}

.custom-cr-delta-pill {
    display: grid;
    gap: 3px;
    padding: 10px 11px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.025);
}

.custom-cr-delta-pill strong {
    font-size: 0.9rem;
}

.custom-cr-delta-pill span {
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1.35;
}

.custom-cr-delta-pill small {
    color: var(--secondary);
    font-size: 0.74rem;
    font-weight: 700;
}

.custom-cr-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.custom-cr-plan-step-card {
    display: grid;
    gap: 8px;
}

.custom-cr-plan-chip {
    display: grid;
    gap: 3px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.028);
}

.custom-cr-plan-chip strong {
    font-size: 0.9rem;
}

.custom-cr-plan-chip span,
.custom-cr-plan-chip small {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.custom-cr-step-values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    gap: 7px;
}

.custom-cr-step-value-pill {
    display: grid;
    gap: 2px;
    padding: 8px 9px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.022);
}

.custom-cr-step-value-pill strong {
    font-size: 0.76rem;
}

.custom-cr-step-value-pill span {
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.3;
}

.custom-cr-remaining-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.custom-cr-remaining-chip {
    display: grid;
    gap: 2px;
    padding: 10px 11px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.025);
}

.custom-cr-remaining-chip strong {
    font-size: 0.88rem;
}

.custom-cr-remaining-chip span {
    color: var(--secondary);
    font-size: 0.77rem;
    font-weight: 700;
}

.custom-cr-saved-plans {
    display: grid;
    gap: 12px;
}

.custom-cr-saved-plan {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    background: rgba(255,255,255,0.025);
    overflow: hidden;
}

.custom-cr-saved-plan summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    padding: 14px 16px;
}

.custom-cr-saved-plan summary::-webkit-details-marker {
    display: none;
}

.custom-cr-saved-plan summary span {
    display: grid;
    gap: 3px;
}

.custom-cr-saved-plan summary strong {
    font-size: 0.95rem;
}

.custom-cr-saved-plan summary small,
.custom-cr-plan-target {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.custom-cr-saved-plan-body {
    display: grid;
    gap: 12px;
    padding: 0 16px 16px;
}

.custom-cr-step-list {
    display: grid;
    gap: 10px;
}

.custom-cr-step-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
}

.custom-cr-step-card.done {
    border-color: rgba(52, 199, 89, 0.34);
    background: rgba(52, 199, 89, 0.08);
}

.custom-cr-step-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.custom-cr-step-head strong {
    font-size: 0.92rem;
}

.custom-cr-step-head small {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.4;
}

.custom-cr-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text);
}

.custom-cr-check input {
    width: 18px;
    height: 18px;
}

.custom-cr-step-products {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.custom-cr-step-products span {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    font-size: 0.74rem;
}

.custom-cr-step-actions {
    display: flex;
    justify-content: flex-start;
}

.custom-cr-matrix {
    display: grid;
    grid-template-columns: minmax(76px, 0.9fr) repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: center;
    margin: 14px 0 16px;
}

.custom-cr-matrix-header {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.custom-cr-matrix-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.custom-cr-matrix-label strong {
    font-size: 0.98rem;
}

.custom-cr-matrix-label small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.custom-cr-matrix input {
    width: 100%;
    min-width: 0;
}

.tool-favorite-item {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,0.055);
}

.tool-favorite-open,
.tool-favorite-remove {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    width: auto;
    min-height: 34px;
    cursor: pointer;
}

.tool-favorite-open {
    padding: 7px 10px;
    font-size: 0.82rem;
    font-weight: 900;
}

.tool-favorite-remove {
    padding: 0 10px;
    border-left: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 900;
}

.tool-favorite-item:hover {
    border-color: var(--secondary);
}

.tool-favorite-open:hover,
.tool-favorite-remove:hover {
    color: var(--secondary);
}

.tool-favorites-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.tool-favorites-add select {
    margin: 0;
}

.tool-favorites-add button {
    width: auto;
    min-height: 44px;
    padding: 0 14px;
}

.tool-inline-fav {
    margin-left: auto;
    position: relative;
    z-index: 3;
    width: auto;
    min-height: 30px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    padding: 0 10px;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
}

.tool-inline-fav.active {
    color: #ffd166;
    border-color: rgba(255, 209, 102, 0.58);
    background: rgba(255, 209, 102, 0.13);
}

.tool-inline-fav:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

.tool-card-hidden,
.tool-section-hidden {
    display: none !important;
}

.tool-experimental-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 209, 102, 0.34);
    color: #ffd166;
    background: rgba(255, 209, 102, 0.1);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.74rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.tool-section {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    overflow: hidden;
}

.tool-section-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    background: rgba(255, 255, 255, 0.035);
}

.tool-section-summary::-webkit-details-marker {
    display: none;
}

.tool-section-summary strong,
.tool-section-summary small {
    display: block;
}

.tool-section-summary strong {
    color: var(--text);
    font-size: 1rem;
}

.tool-section-summary small {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 3px;
    line-height: 1.35;
}

.tools-hub-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.05), rgba(191, 90, 242, 0.05)),
        rgba(255,255,255,0.025);
}

.tools-hub-head h3 {
    margin-bottom: 6px;
}

.tools-section-jump-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.tools-section-jump {
    width: 100%;
    min-height: 72px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    text-align: left;
    display: grid;
    gap: 4px;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.tools-section-jump strong {
    font-size: 0.92rem;
}

.tools-section-jump span {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.tools-section-jump:hover {
    transform: translateY(-1px);
    border-color: rgba(100, 210, 255, 0.34);
    background: rgba(255,255,255,0.055);
}

.tool-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
}

.tool-compact-card {
    margin: 0;
    padding: 14px;
}

.tool-compact-card h3 {
    margin-bottom: 6px;
}

.tool-tile-card {
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.tool-tile-card > h3 {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.tool-tile-card > h3::after {
    content: "";
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    color: var(--secondary);
    background: rgba(255,255,255,0.04);
    font-size: 1rem;
    flex: 0 0 auto;
    margin-left: 0;
    transition: transform 0.18s ease;
    background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(50% - 4px) 52%, calc(50% + 4px) 52%;
    background-size: 8px 8px, 8px 8px;
    background-repeat: no-repeat;
}

.tool-tile-card:not(.tool-tile-collapsed) > h3::after {
    transform: rotate(180deg);
}

.tool-tile-card.tool-tile-collapsed {
    padding: 14px;
    min-height: 74px;
    display: flex;
    align-items: center;
}

.tool-tile-card.tool-tile-collapsed:hover {
    transform: translateY(-1px);
    border-color: rgba(100, 210, 255, 0.34);
    background: rgba(255,255,255,0.045);
}

.tool-tile-card.tool-tile-collapsed > *:not(h3) {
    display: none !important;
}

.tool-tile-card.tool-tile-collapsed > h3 {
    width: 100%;
    font-size: 1rem;
    line-height: 1.2;
}

.tool-compact-card .hint {
    margin-bottom: 12px;
}

.tool-compact-card textarea {
    min-height: 76px;
    resize: vertical;
}

@media (min-width: 821px) {
    #tools {
        max-width: 1220px;
        margin: 0 auto;
    }

    #tools .tools-shell {
        gap: 18px;
    }

    #tools .tools-hub-card {
        padding: 18px;
    }

    #tools .tool-section {
        border-radius: 16px;
        background:
            linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)),
            var(--card-bg);
        box-shadow: 0 14px 38px rgba(0,0,0,0.16);
    }

    #tools .tool-section[open] {
        border-color: color-mix(in srgb, var(--secondary) 34%, var(--border));
    }

    #tools .tool-section-summary {
        padding: 17px 20px;
        min-height: 76px;
    }

    #tools .tool-section-summary strong {
        font-size: 1.08rem;
    }

    #tools .tool-section-summary small {
        font-size: 0.84rem;
    }

    #tools .tool-card-grid {
        grid-template-columns: repeat(3, minmax(230px, 1fr));
        align-items: start;
        gap: 14px;
        padding: 16px;
    }

    #tools .tool-tile-card {
        border-radius: 13px;
        min-width: 0;
    }

    #tools .tool-tile-card.tool-tile-collapsed {
        min-height: 68px;
        padding: 15px 16px;
        cursor: pointer;
    }

    #tools .tool-tile-card.tool-tile-collapsed h3 {
        font-size: 0.98rem;
        letter-spacing: 0;
    }

    #tools .tool-tile-card:not(.tool-tile-collapsed) {
        grid-column: 1 / -1;
        padding: 20px;
        border-color: color-mix(in srgb, var(--secondary) 38%, var(--border));
        background: rgba(255,255,255,0.045);
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    }

    #tools .tool-tile-card:not(.tool-tile-collapsed) > h3 {
        padding-bottom: 12px;
        margin-bottom: 14px;
        border-bottom: 1px solid var(--border);
        font-size: 1.18rem;
    }

    #tools .tool-tile-card:not(.tool-tile-collapsed) > .hint {
        max-width: 780px;
    }

    #tools .tool-grid {
        grid-template-columns: repeat(4, minmax(160px, 1fr));
        gap: 12px;
    }

    #tools .salinity-control {
        max-width: 760px;
    }

    #tools .tool-result {
        max-width: 900px;
    }
}

.reef-manager-import-compact {
    margin-top: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,0.025);
    padding: 0;
}

.reef-manager-import-compact summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    list-style: none;
    padding: 11px 12px;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.reef-manager-import-compact summary::-webkit-details-marker {
    display: none;
}

.reef-manager-import-compact[open] {
    padding-bottom: 12px;
}

.reef-manager-import-compact .btn-group,
.reef-manager-import-compact .hint,
.reef-manager-import-compact .tool-result {
    margin-left: 12px;
    margin-right: 12px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.resource-link-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.resource-link-card {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.resource-link-card:hover {
    transform: translateY(-1px);
    border-color: rgba(100, 210, 255, 0.42);
    background: rgba(100, 210, 255, 0.08);
}

.resource-link-card span {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.sync-diagnostics-result {
    margin-top: 12px;
}

.sync-diagnostics-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,0.035);
    margin-bottom: 6px;
    font-size: 0.82rem;
}

.sync-diagnostics-row span {
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.sync-diagnostics-row.ok {
    border-color: rgba(48, 209, 88, 0.32);
}

.sync-diagnostics-row.warn {
    border-color: rgba(255, 69, 58, 0.42);
}

.sync-diagnostics-row.warn strong {
    color: var(--danger);
}

.tool-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.tool-row > span:last-child {
    font-weight: 900;
    color: var(--secondary);
    text-align: right;
}

.tool-row > button {
    width: auto;
    padding: 7px 10px;
    font-size: 0.75rem;
}

.tool-row:first-child {
    border-top: none;
    padding-top: 2px;
}

.tool-row:first-child strong {
    font-size: 1.02rem;
}

.tool-row small {
    display: block;
    color: var(--text-muted);
    font-size: 0.74rem;
    margin-top: 2px;
}

.tool-row.missing {
    color: var(--danger);
}

.tool-result.missing {
    border-color: rgba(255, 69, 58, 0.45);
    background: rgba(255, 69, 58, 0.08);
}

.dose-plan {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.dose-plan-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,0.035);
}

.dose-plan-row input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.dose-plan-row:has(input:checked) {
    opacity: 0.62;
}

.dose-plan-row:has(input:checked) span {
    text-decoration: line-through;
}

.tool-action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tool-action-row button {
    flex: 1;
    min-width: 160px;
}

.salinity-control {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.salinity-control-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.salinity-control-head label {
    margin: 0;
    font-weight: 700;
}

.salinity-control-head input[type="number"] {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
}

.salinity-control input[type="range"] {
    width: 100%;
    height: 34px;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}

.salinity-control input[type="range"]::-webkit-slider-runnable-track {
    height: 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.22);
}

.salinity-control input[type="range"]::-webkit-slider-thumb {
    width: 30px;
    height: 30px;
    margin-top: -10px;
    border-radius: 50%;
    border: 3px solid var(--card-bg);
    background: var(--primary);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    appearance: none;
    -webkit-appearance: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.salinity-control input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

.salinity-control input[type="range"]::-moz-range-track {
    height: 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.22);
}

.salinity-control input[type="range"]::-moz-range-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid var(--card-bg);
    background: var(--primary);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

.salinity-value {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 10px;
}

@media (max-width: 640px) {
    .salinity-control-head {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .salinity-control-head input[type="number"] {
        text-align: left;
    }

    #specificGravityResult .tool-row,
    #simpleSalinityResult .tool-row,
    #salinityResult .tool-row {
        grid-template-columns: 1fr;
    }
}

/* Warn-Karten (Wenn Bestand unter Schwelle) */
.card-warning {
    border-left: 3px solid var(--danger) !important;
    box-shadow: none !important;
}

/* Visuelle Auswertung: Balken in der Statistik */
.visual-bar-bg {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    height: 8px;
    margin-top: 8px;
    overflow: hidden;
    width: 100%;
}
.visual-bar-fill {
    background: var(--primary);
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease-out;
}

/* Button für die Warnschwellen (Glocken-Icon) */
.threshold-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    transition: transform 0.2s;
}
.threshold-btn:hover {
    transform: scale(1.2);
    color: var(--danger);
}

/* --- APP FOOTER (IMPRESSUM) --- */
.app-footer {
    text-align: center;
    padding: 20px 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 40px;
    background: rgba(0, 0, 0, 0.2);
}

.app-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* Automatische Farbanpassung für das helle Girl-Theme */
body.theme-girl .app-footer {
    background: rgba(255, 102, 164, 0.05);
}

/* ==========================================================================
   🦈 BADMAN SHARK EDITION OVERRIDES - Schwarz, Grau, Rot 🦈
   ========================================================================== */

/* Eingabefelder, Listen, Protokolle & Blöcke im Badman-Stil */
body.theme-badman .card {
    background: rgba(42, 42, 42, 0.9);
}

body.theme-badman textarea,
body.theme-badman input[type="number"],
body.theme-badman input[type="text"],
body.theme-badman input[type="password"],
body.theme-badman input[type="file"],
body.theme-badman select,
body.theme-badman .log-item,
body.theme-badman .stat-block,
body.theme-badman #cr-preview-container,
body.theme-badman #containerSection {
    background: #2a2a2a !important;
    color: #f1f1f1 !important;
    border: 1px solid #4a4a4a !important;
}

body.theme-badman select option { background: #2a2a2a !important; color: #f1f1f1 !important; }
body.theme-badman .modal-content { background: #2a2a2a !important; border: 2px solid #e63946 !important; color: #f1f1f1 !important; }

/* Alle Texte im Badman Mode */
body.theme-badman h1, body.theme-badman h2, body.theme-badman h3, body.theme-badman h4, 
body.theme-badman label, body.theme-badman span, body.theme-badman strong, 
body.theme-badman .stat-grid div strong, body.theme-badman .trace-grid label {
    color: #f1f1f1 !important;
}
body.theme-badman .subtitle, body.theme-badman .hint, body.theme-badman .unit-label, body.theme-badman .log-date {
    color: #6a6a6a !important;
}

/* Buttons im Badman-Stil */
body.theme-badman .btn-in { background: rgba(74, 74, 74, 0.3) !important; color: #8a8a8a !important; border: 1px solid #4a4a4a !important; }
body.theme-badman .btn-out { background: rgba(230, 57, 70, 0.15) !important; color: #e63946 !important; border: 1px solid rgba(230, 57, 70, 0.4) !important; }
body.theme-badman .btn-primary { background: #e63946 !important; color: #ffffff !important; }
body.theme-badman .btn-secondary { background: #4a4a4a !important; color: #f1f1f1 !important; }
body.theme-badman .btn-danger { background: #e63946 !important; color: #ffffff !important; }
body.theme-badman .btn-cancel { background: #2a2a2a !important; color: #8a8a8a !important; }

/* Highlights, Badges und Navigation */
body.theme-badman .stock { background: rgba(230, 57, 70, 0.15) !important; color: #e63946 !important; }
body.theme-badman .version-badge { background: rgba(230, 57, 70, 0.15) !important; color: #e63946 !important; border: 1px solid #e63946 !important; }
body.theme-badman .prognose-badge { background: rgba(230, 57, 70, 0.1) !important; color: #e63946 !important; }
body.theme-badman header { background: rgba(26, 26, 26, 0.95) !important; box-shadow: 0 1px 0 #4a4a4a !important; }
body.theme-badman .nav-menu { background: rgba(42, 42, 42, 0.96) !important; border-left: 1px solid #4a4a4a !important; }
body.theme-badman .nav-links button { background: #2a2a2a !important; color: #8a8a8a !important; }
body.theme-badman .nav-links button.active { background: #e63946 !important; color: #ffffff !important; }
body.theme-badman .cross-hint { color: #e63946 !important; }

/* Desktop Navigation Anpassung für Badman */
@media (min-width: 768px) {
    body.theme-badman .nav-menu { background: #2a2a2a !important; border-bottom: 1px solid #4a4a4a !important; }
    body.theme-badman .nav-links button.active { background: rgba(230, 57, 70, 0.15) !important; color: #e63946 !important; border-bottom: 3px solid #e63946 !important; }
}

@media (max-width: 767px) {
    body.theme-badman {
        background-image: none;
        background-attachment: initial;
    }

    body.theme-badman::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: -1;
        pointer-events: none;
        background-color: var(--bg);
        background-image:
            linear-gradient(rgba(26, 26, 26, 0.52), rgba(26, 26, 26, 0.82)),
            url("badman.svg");
        background-repeat: no-repeat;
        background-position: center 92px;
        background-size: min(128vw, 520px) auto;
    }

    body.theme-badman header {
        background: rgba(26, 26, 26, 0.74) !important;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    body.theme-badman .card {
        background: rgba(42, 42, 42, 0.84);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

    body.theme-badman textarea,
    body.theme-badman input[type="number"],
    body.theme-badman input[type="text"],
    body.theme-badman input[type="password"],
    body.theme-badman input[type="file"],
    body.theme-badman select,
    body.theme-badman .log-item,
    body.theme-badman .stat-block,
    body.theme-badman #cr-preview-container,
    body.theme-badman #containerSection {
        background: rgba(42, 42, 42, 0.82) !important;
    }

    body.theme-badman .nav-menu {
        background: rgba(42, 42, 42, 0.88) !important;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .legacy-domain-banner {
        width: min(100vw - 18px, 1200px);
        margin: 10px auto 6px;
        padding: 14px;
        border-radius: 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .legacy-domain-banner-actions {
        width: 100%;
    }

    .legacy-domain-banner-link {
        width: 100%;
    }
}

/* Footer Anpassung */
body.theme-badman .app-footer {
    background: rgba(230, 57, 70, 0.05);
}

/* Party Modus für Badman */
body.theme-badman.party-mode { 
    animation: badmanDiscoGradient 8s ease infinite !important; 
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a, #3a0a0a, #1a1a1a) !important;
    background-size: 400% 400% !important;
}
body.theme-badman.party-mode .card {
    background: rgba(42, 42, 42, 0.9) !important;
    border: 1px solid #e63946 !important;
    animation: badmanRgbPulse 4s infinite alternate ease-in-out !important;
}
@keyframes badmanDiscoGradient { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
@keyframes badmanRgbPulse {
    0% { box-shadow: 0 0 15px rgba(230, 57, 70, 0.3); border-color: #e63946; }
    100% { box-shadow: 0 0 20px rgba(138, 138, 138, 0.4); border-color: #8a8a8a; }
}

/* ==========================================================================
   ✨ GLOBAL ANIMATIONS & TRANSITIONS ✨
   ========================================================================== */

/* Smooth card hover lift effect */
.card {
    transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.5s ease, background-color 0.5s ease;
}
.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Button hover glow */
button, .btn-primary, .btn-secondary, .btn-danger, .btn-in, .btn-out, .btn-cancel {
    transition: all 0.2s ease;
}
button:hover:not(:active) {
    filter: brightness(1.1);
    transform: translateY(0);
}

/* Smooth modal fade-in */
.modal {
    transition: opacity 0.3s ease;
}
.modal[style*="flex"] {
    animation: modalFadeIn 0.3s ease forwards;
}
.modal-content {
    animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Smooth details/summary expand */
details {
    overflow: hidden;
}
details[open] > *:not(summary) {
    animation: detailsSlideDown 0.3s ease forwards;
}
@keyframes detailsSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
details summary {
    transition: color 0.2s ease;
}
details summary:hover {
    color: var(--primary);
}

/* Input focus glow effect */
textarea:focus,
input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(191, 90, 242, 0.3);
    border-color: var(--primary) !important;
}

/* Stock badge subtle pulse for low stock */
@keyframes lowStockPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Log items slide in */
.log-item {
    animation: logSlideIn 0.3s ease forwards;
}
@keyframes logSlideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Stat block counter animation feel */
.stat-block {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-block:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Nav menu smooth slide */
.nav-menu {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

/* Menu backdrop fade */
.menu-backdrop.open {
    animation: backdropFadeIn 0.3s ease forwards;
}
@keyframes backdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Header subtle entrance */
header {
    animation: headerSlideDown 0.4s ease forwards;
}
@keyframes headerSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Switch toggle smooth */
.switch .slider {
    transition: background-color 0.3s ease;
}
.switch .slider:before {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

/* Alert summary expand */
.alert-summary {
    transition: all 0.3s ease;
}
.alert-summary:hover {
    border-color: var(--danger);
    box-shadow: 0 2px 10px rgba(255, 69, 58, 0.15);
}

/* Search input focus expand */
.lager-toolbar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(191, 90, 242, 0.1);
}

/* Version badge subtle glow */
.version-badge {
    transition: all 0.3s ease;
}
.version-badge:hover {
    filter: brightness(1.2);
}

/* Footer link hover effect */
.app-footer a {
    transition: color 0.2s ease, text-shadow 0.2s ease;
}
.app-footer a:hover {
    text-shadow: 0 0 8px rgba(191, 90, 242, 0.4);
}

/* ==========================================================================
   LEGAL PAGES
   ========================================================================== */
.legal-page {
    min-height: 100vh;
}

.legal-shell {
    width: min(920px, calc(100vw - 28px));
    margin: 24px auto 56px;
}

.legal-card {
    padding: 22px 22px 28px;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.legal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.legal-eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.legal-head h1 {
    margin: 0 0 6px;
    font-size: clamp(1.65rem, 3.6vw, 2.2rem);
}

.legal-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.legal-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    text-decoration: none;
}

.legal-copy {
    color: var(--text);
    line-height: 1.62;
}

.legal-copy h2 {
    margin: 24px 0 10px;
    font-size: 1.08rem;
}

.legal-copy p,
.legal-copy li {
    color: color-mix(in srgb, var(--text) 92%, var(--text-muted));
}

.legal-copy ul {
    margin: 0 0 0 18px;
    padding: 0;
}

.legal-copy a {
    color: var(--secondary);
}

.legal-note {
    margin-top: 24px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    color: var(--text);
}

@media (max-width: 767px) {
    .legal-shell {
        width: min(100vw - 18px, 920px);
        margin: 14px auto 30px;
    }

    .legal-card {
        padding: 18px 16px 22px;
        border-radius: 18px;
    }

    .legal-head {
        flex-direction: column;
        align-items: stretch;
    }

    .legal-links a {
        flex: 1 1 0;
    }
}

/* Size selection button styles for Nachbestellen */
.size-select-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}
.size-select-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary);
    color: var(--text);
}
.size-select-btn.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(191, 90, 242, 0.3);
}

/* ==========================================================================
   🍞 TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 90%;
    width: 400px;
}
.toast {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: auto;
    backdrop-filter: blur(10px);
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--secondary); }
.toast.warning { border-left: 4px solid #ffd60a; }
.toast-icon { font-size: 1.4rem; flex-shrink: 0; }
.toast-message { flex: 1; font-size: 0.9rem; color: var(--text); }
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}
.toast.removing {
    animation: toastSlideOut 0.3s ease forwards;
}
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastSlideOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-10px) scale(0.9); }
}

@media (pointer: fine) and (hover: hover) {
    body.custom-cursor-enabled,
    body.custom-cursor-enabled * {
        cursor: none !important;
    }

    .custom-cursor,
    .custom-cursor-dot {
        position: fixed;
        top: 0;
        left: 0;
        pointer-events: none;
        z-index: 2147483647;
        opacity: 0;
        transform: translate3d(-50%, -50%, 0);
        transition: opacity 0.16s ease, width 0.16s ease, height 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
        will-change: transform;
    }

    .custom-cursor {
        width: 18px;
        height: 18px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.58);
        background: rgba(255, 255, 255, 0.075);
        box-shadow: 0 8px 22px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(255,255,255,0.05);
        backdrop-filter: blur(10px) saturate(1.25);
        -webkit-backdrop-filter: blur(10px) saturate(1.25);
    }

    .custom-cursor-dot {
        width: 3px;
        height: 3px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.88);
        box-shadow: 0 1px 6px rgba(0,0,0,0.22);
    }

    body.cursor-visible .custom-cursor,
    body.cursor-visible .custom-cursor-dot {
        opacity: 1;
    }

    body.cursor-hover .custom-cursor {
        width: 28px;
        height: 28px;
        border-color: rgba(255, 255, 255, 0.72);
        background: rgba(255, 255, 255, 0.12);
        box-shadow: 0 10px 28px rgba(0,0,0,0.24), inset 0 0 0 1px rgba(255,255,255,0.07);
    }

    body.cursor-down .custom-cursor {
        width: 14px;
        height: 14px;
        background: rgba(255,255,255,0.16);
    }
}

@media (max-width: 600px) {
    .update-banner {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        margin: 10px 12px 12px;
        align-items: stretch;
        flex-direction: column;
        padding: 11px 12px;
    }

    .update-banner button {
        width: 100%;
    }
}

/* ==========================================================================
   📭 EMPTY STATES
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
    animation: emptyStateFloat 3s ease-in-out infinite;
}
@keyframes emptyStateFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.empty-state-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.empty-state-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 300px;
    margin: 0 auto;
}

/* ==========================================================================
   💀 SKELETON LOADING
   ========================================================================== */
.skeleton {
    background: linear-gradient(90deg, var(--card-bg) 25%, rgba(255,255,255,0.08) 50%, var(--card-bg) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 8px;
}
.skeleton-card {
    height: 120px;
    margin-bottom: 12px;
}
.skeleton-line {
    height: 16px;
    margin-bottom: 8px;
}
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
@keyframes skeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ==========================================================================
   🔍 LIVE SEARCH HIGHLIGHTING
   ========================================================================== */
.search-highlight {
    background: rgba(255, 214, 10, 0.3);
    color: #ffd60a;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}
.search-no-results {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-style: italic;
}

/* ==========================================================================
   📊 STATISTIC CHARTS
   ========================================================================== */
.chart-container {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
}
.chart-bar-group {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding: 0 8px;
}
.chart-bar {
    flex: 1;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}
.chart-bar:hover {
    filter: brightness(1.2);
    transform: scaleY(1.05);
    transform-origin: bottom;
}
.chart-bar-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.chart-bar-value {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text);
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
}
.chart-bar:hover .chart-bar-value {
    opacity: 1;
}
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   ↩️ UNDO TOAST
   ========================================================================== */
.undo-toast {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.undo-toast button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.undo-toast .undo-countdown {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ==========================================================================
   ☀️ LIGHT MODE TOGGLE
   ========================================================================== */
body.theme-light {
    --bg: #f5f5f7;
    --card-bg: #ffffff;
    --primary: #007aff;
    --secondary: #5856d6;
    --text: #1c1c1e;
    --text-muted: #6e6e73;
    --danger: #ff3b30;
    --success: #34c759;
    --border: #e5e5ea;
}
body.theme-light textarea,
body.theme-light input[type="number"],
body.theme-light input[type="text"],
body.theme-light input[type="password"],
body.theme-light input[type="file"],
body.theme-light select,
body.theme-light .log-item,
body.theme-light .stat-block,
body.theme-light #cr-preview-container,
body.theme-light #containerSection {
    background: #f9f9f9 !important;
    color: #1c1c1e !important;
    border: 1px solid #e5e5ea !important;
}
body.theme-light select option { background: #ffffff !important; color: #1c1c1e !important; }
body.theme-light .modal-content { background: #ffffff !important; border: 2px solid #007aff !important; color: #1c1c1e !important; }
body.theme-light h1, body.theme-light h2, body.theme-light h3, body.theme-light h4,
body.theme-light label, body.theme-light span, body.theme-light strong,
body.theme-light .stat-grid div strong, body.theme-light .trace-grid label {
    color: #1c1c1e !important;
}
body.theme-light .subtitle, body.theme-light .hint, body.theme-light .unit-label, body.theme-light .log-date {
    color: #6e6e73 !important;
}
body.theme-light .btn-in { background: rgba(52, 199, 89, 0.1) !important; color: #34c759 !important; border: 1px solid rgba(52, 199, 89, 0.3) !important; }
body.theme-light .btn-out { background: rgba(255, 59, 48, 0.1) !important; color: #ff3b30 !important; border: 1px solid rgba(255, 59, 48, 0.3) !important; }
body.theme-light .btn-primary { background: #007aff !important; color: #ffffff !important; }
body.theme-light .btn-secondary { background: #e5e5ea !important; color: #1c1c1e !important; }
body.theme-light .btn-danger { background: #ff3b30 !important; color: #ffffff !important; }
body.theme-light .btn-cancel { background: #e5e5ea !important; color: #6e6e73 !important; }
body.theme-light .stock { background: rgba(0, 122, 255, 0.1) !important; color: #007aff !important; }
body.theme-light .version-badge { background: rgba(0, 122, 255, 0.1) !important; color: #007aff !important; border: 1px solid #007aff !important; }
body.theme-light .prognose-badge { background: rgba(88, 86, 214, 0.1) !important; color: #5856d6 !important; }
body.theme-light header { background: rgba(245, 245, 247, 0.95) !important; box-shadow: 0 1px 0 #e5e5ea !important; }
body.theme-light .nav-menu { background: rgba(255, 255, 255, 0.98) !important; border-left: 1px solid #e5e5ea !important; }
body.theme-light .nav-links button { background: #ffffff !important; color: #6e6e73 !important; }
body.theme-light .nav-links button.active { background: #007aff !important; color: #ffffff !important; }
body.theme-light .cross-hint { color: #ff3b30 !important; }
body.theme-light .app-footer { background: rgba(0, 122, 255, 0.05); }
@media (min-width: 768px) {
    body.theme-light .nav-menu { background: #ffffff !important; border-bottom: 1px solid #e5e5ea !important; }
    body.theme-light .nav-links button.active { background: rgba(0, 122, 255, 0.1) !important; color: #007aff !important; border-bottom: 3px solid #007aff !important; }
}

/* ==========================================================================
   ⌨️ KEYBOARD SHORTCUTS HINT
   ========================================================================== */
.keyboard-shortcuts-hint {
    position: fixed;
    bottom: 24px;
    left: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
    transition: opacity 0.2s;
    z-index: 100;
}
.keyboard-shortcuts-hint:hover {
    opacity: 1;
}
.keyboard-shortcuts-hint kbd {
    background: rgba(255,255,255,0.1);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.7rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Ripple Effect - Apple-style subtle press */
.ripple {
    position: relative;
    overflow: hidden;
}
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    transform: scale(0);
    animation: rippleAnimation 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    pointer-events: none;
}
@keyframes rippleAnimation {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
}
.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
    animation: confettiFall 3s ease-out forwards;
}
@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-100px) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Pull to Refresh */
.pull-to-refresh-indicator {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%) translateY(-84px) scale(0.86);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--card-bg);
    background: color-mix(in srgb, var(--card-bg) 84%, transparent);
    border: 1px solid var(--primary);
    border-color: color-mix(in srgb, var(--primary) 72%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: var(--primary);
    font-size: 1.55rem;
    font-weight: 800;
    transition: transform 0.22s ease, opacity 0.22s ease, border-color 0.22s ease;
    box-shadow: 0 14px 34px rgba(0,0,0,0.34);
}
.pull-to-refresh-indicator.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}
.pull-to-refresh-indicator.refreshing {
    animation: spinRefresh 1s linear infinite;
    border-color: var(--success);
    color: var(--success);
}
@keyframes spinRefresh {
    to { transform: translateX(-50%) translateY(0) scale(1) rotate(360deg); }
}

@media (max-width: 767px) {
    body { padding-bottom: 110px; }
    .keyboard-shortcuts-hint { display: none; }
    .tab-content {
        padding: 14px 12px 24px;
        gap: 12px;
    }
    .warehouse-control-card {
        padding: 14px;
        border-radius: 16px;
    }
    .warehouse-control-head {
        display: grid;
        gap: 10px;
    }
    .warehouse-switcher {
        grid-template-columns: minmax(0, 1fr) 40px 40px 40px;
        gap: 7px;
    }
    .warehouse-switcher button {
        height: 40px;
    }
    .dashboard-hero {
        align-items: stretch;
        flex-direction: column;
        padding: 16px;
    }
    .dashboard-hero h2 {
        font-size: 1.45rem;
    }
    .dashboard-refresh {
        width: 100%;
    }
    .dashboard-grid,
    .dashboard-actions,
    .dashboard-panels,
    .dashboard-onboarding {
        grid-template-columns: 1fr;
    }
    .dashboard-onboarding {
        display: grid;
        align-items: stretch;
    }
    .dashboard-onboarding > div:last-child {
        justify-content: stretch;
    }
    .dashboard-onboarding button {
        flex: 1;
        min-width: 120px;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 840;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 2px;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: rgba(18,18,20,0.9);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
    .mobile-bottom-nav button {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        min-height: 48px;
        padding: 6px 2px;
        border: none;
        border-radius: 12px;
        background: transparent;
        color: var(--text-muted);
        font-size: 0.68rem;
        font-weight: 800;
    }
    .mobile-bottom-nav button span {
        font-size: 1.05rem;
        line-height: 1;
    }
    .mobile-bottom-nav button.active {
        color: var(--primary);
        background: rgba(191,90,242,0.12);
    }
    .nav-links button {
        min-height: 48px;
    }
}

/* Quick Preview Modal */
.quick-preview {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.quick-preview.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}
.quick-preview-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.quick-preview-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}
.quick-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.quick-preview-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Animated Counter */
.counter-animate {
    display: inline-block;
    transition: all 0.3s ease;
}

/* Haptic feedback visual indicator */
.haptic-flash {
    animation: hapticPulse 0.15s ease;
}
@keyframes hapticPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Final mobile layout hardening */
@media (max-width: 820px) {
    #tools .tool-card-grid,
    #tools .tool-grid,
    #tools .resource-link-grid,
    #tools .tools-section-jump-grid {
        grid-template-columns: 1fr !important;
    }

    #tools .tool-card-grid {
        padding: 10px !important;
        gap: 12px !important;
    }

    #tools .tool-section-summary {
        align-items: flex-start;
        padding: 14px !important;
    }

    #tools .tool-section-summary strong {
        font-size: 1rem;
        line-height: 1.2;
    }

    #tools .tool-section-summary small {
        font-size: 0.86rem;
        line-height: 1.35;
    }

    #tools .tools-hub-card {
        padding: 14px !important;
        gap: 12px;
    }

    #tools .tools-section-jump {
        min-height: 66px;
        padding: 12px;
    }

    #tools .tool-compact-card {
        width: 100%;
        min-width: 0;
        padding: 16px !important;
        border-radius: 14px;
    }

    #tools .tool-compact-card h3 {
        font-size: 1.18rem;
        line-height: 1.22;
        margin-bottom: 10px;
    }

    #tools .tool-tile-card.tool-tile-collapsed {
        min-height: 62px;
        padding: 14px !important;
    }

    #tools .tool-tile-card.tool-tile-collapsed h3 {
        font-size: 1rem;
        margin-bottom: 0;
    }

    #tools .tool-compact-card .hint {
        font-size: 0.92rem;
        line-height: 1.35;
    }

    #tools .input-group,
    #tools .input-group label,
    #tools .input-group input,
    #tools .input-group select,
    #tools .input-group textarea {
        min-width: 0;
        width: 100%;
    }

    #tools .tool-row {
        grid-template-columns: 1fr !important;
        gap: 8px;
        align-items: start;
    }

    #tools .tool-row > span:last-child {
        text-align: left !important;
        justify-self: start;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    #tools .tool-favorites-add {
        grid-template-columns: 1fr;
    }

    #tools .tool-favorites-add button {
        width: 100%;
    }

    .custom-cr-matrix {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .custom-cr-matrix-header {
        display: none;
    }

    .custom-cr-matrix-label {
        margin-top: 8px;
    }

    .custom-cr-summary-grid,
    .custom-cr-product-grid,
    .custom-cr-delta-grid,
    .custom-cr-plan-grid,
    .custom-cr-remaining-grid {
        grid-template-columns: 1fr;
    }

    .custom-cr-limits-grid {
        grid-template-columns: minmax(64px, 0.8fr) repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .custom-cr-product-line {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .custom-cr-product-line span,
    .custom-cr-product-line small {
        text-align: left;
    }

    .custom-cr-saved-plan summary,
    .custom-cr-step-head {
        display: grid;
        grid-template-columns: 1fr;
    }
}
