/* === THEME === */
/* ____________ */
/* Two visual themes, switched via data-theme on <html> (sidebar selector).
   Base values below = "modern". The [data-theme="default"] block overrides
   them to the plain dark-grey look. Home-page styles consume these var()s. */

html {
    --surface-grad: linear-gradient(155deg, rgba(15, 14, 20, 0.94) 0%, rgba(6, 5, 10, 0.96) 100%);
    --surface-border: rgba(140, 110, 230, 0.10);
    --surface-border-hover: rgba(140, 110, 230, 0.45);
    --surface-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(200, 195, 225, 0.05);
    --surface-shadow-hover: 0 8px 22px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(200, 195, 225, 0.07);
    --accent: #8a6bff;
    --accent-soft: #a07fff;
    --accent-text: #cdbfff;
    --icon-grad: linear-gradient(135deg, rgba(140, 110, 230, 0.22), rgba(140, 110, 230, 0.05));
    --icon-border: rgba(140, 110, 230, 0.3);
    /* `-apple-system` / `BlinkMacSystemFont` use the device's system font on
       iOS and macOS (San Francisco); Windows falls through to Century Gothic. */
    --app-font: -apple-system, BlinkMacSystemFont, 'Century Gothic', 'Segoe UI', sans-serif;
    /* Background on <html> so iOS overscroll, the notch area and the Safari
       toolbar (combined with the theme-color meta) all stay dark. */
    background-color: #0a0a0a;
}

html[data-theme="default"] {
    --surface-grad: linear-gradient(145deg, rgba(26, 26, 26, 0.9), rgba(17, 17, 17, 0.9));
    --surface-border: rgba(255, 255, 255, 0.1);
    --surface-border-hover: rgba(255, 255, 255, 0.22);
    --surface-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --surface-shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --accent: #4a90e2;
    --accent-soft: #6aa9ee;
    --accent-text: #b8d4f5;
    --icon-grad: linear-gradient(135deg, rgba(74, 144, 226, 0.22), rgba(74, 144, 226, 0.05));
    --icon-border: rgba(74, 144, 226, 0.25);
}

/* Kill the default iOS gray tap-highlight box — our :active styles cover feedback. */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: var(--app-font);
    background: radial-gradient(circle at center, #0a0a0a 0%, rgba(0, 0, 0, 0.6) 550%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: white;
}

.app-container {
    position: relative;
    display: flex;
    flex-direction: row;
    height: 90vh;
    width: 96vw;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(160deg, #0b0b0b, #000000);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9), 0 0 120px rgba(0, 0, 0, 0.6), inset 0 0 80px rgba(255, 255, 255, 0.02);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.app-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 90px rgba(0, 0, 0, 1), 0 0 160px rgba(0, 0, 0, 0.8), inset 0 0 100px rgba(255, 255, 255, 0.03);
}





/* === SIDEBAR === */
/* _______________ */

.sidebar {
    width: 260px;
    flex: 0 0 260px;
    color: #000;
    background: linear-gradient(to bottom, #0d0d0d 0%, #111 60%, #000 100%);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

    .sidebar.closed {
        transform: translateX(-100%);
        opacity: 0;
    }

    .sidebar.open {
        transform: translateX(0);
        opacity: 1;
    }

.sidebar-toggle {
    position: absolute;
    top: 7px;
    left: 7px;
    background: rgba(13, 13, 13, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1); 
    color: #fff;
    font-size: 1.2rem; 
    cursor: pointer;
    z-index: 30;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); 
}

.sidebar-toggle:hover {
    background: rgba(17, 17, 17, 1);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7); 
}

.sidebar-toggle i {
    transition: transform 0.3s ease;
}

/* Dim layer behind the open mobile sidebar — tap to close. Hidden on desktop. */
.sidebar-backdrop {
    display: none;
}

/* === Desktop === */
@media (min-width: 768px) {
    .sidebar-toggle {
        display: none;
    }

    .sidebar {
        transform: none !important;
        opacity: 1 !important;
        position: static;
    }
}

/* === Mobile === */
@media (max-width: 767px) {

    /* Anchor with explicit top/height so scrolling the page never drags the
       drawer with it. `100dvh` (with `100vh` fallback) sizes to the visible
       viewport even as iOS Safari's address bar shows/hides. */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        z-index: 20;
        /* Push the logo below the iPhone notch / status bar. */
        padding-top: max(24px, env(safe-area-inset-top));
    }
    .content {
        width: 100%;
        position: relative;
    }

    /* Bigger tap target + bigger arrow so the menu chevron is actually readable. */
    .sidebar-toggle {
        width: 44px;
        height: 44px;
    }

    /* iOS Safari zooms in when a focused input/textarea is below 16px. */
    .tool-input,
    .tool-input-small {
        font-size: 16px;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 15;
    }
    .sidebar-backdrop.visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* On phones each group is a full-width card, stacked vertically. */
    .group-grid {
        grid-template-columns: 1fr;
    }
}

    .sidebar img.logo {
        width: 64px;
        height: 64px;
    }

/* Logo + theme selector row */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.theme-switch {
    display: flex;
    gap: 3px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
}

.theme-opt {
    padding: 5px 9px;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #888;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

    .theme-opt:hover {
        color: #ccc;
    }

    .theme-opt.active {
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    .sidebar h2 {
        font-size: 1.25rem;
        font-weight: 700;
        margin-bottom: 24px;
    }

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: #ccc;
    text-decoration: none;
    margin-bottom: 8px;
    transition: background 0.2s ease;
}

    .nav-item:hover,
    .nav-item.active {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .nav-item i {
        margin-right: 10px;
    }





/* === MAIN PANEL === */
/* __________________ */

.content {
    flex: 1;
    padding: 36px;
    background: #111;
    position: relative;
    overflow-y: auto;
    overflow-x: clip;
    scrollbar-width: thin;
    scrollbar-color: #333 #222;
    display: flex; 
    flex-direction: column; 
    align-items: center;
}

    .content h1 {
        font-family: var(--app-font);
        font-size: 2.25rem;
        font-weight: bold;
        margin-bottom: 2rem;
    }

    .content h2 {
        font-size: 1.5rem;
        font-family: var(--app-font);
        font-weight: bold;
        margin-bottom: 2rem;
    }

    .content h3 {
        font-size: 1.3rem;
        font-family: var(--app-font);
        font-weight: bold;
        margin-bottom: 2rem;
     }

    .content p {
        color: #aaa;
        font-family: var(--app-font);
        font-size: 1.1rem;
    }

/* === Button === */
.button-main {
    background-color: #151313;
    color: #aaa;
    border: 1px solid #333;
    padding: 12px 26px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: inline-block;
    z-index: 5;
    align-self: center;
}

    .button-main:hover {
        background-color: #333; 
        color: #ccc; 
    }

    .button-main:active {
        background-color: #111; 
        color: #999; 
    }

/* === Textfield === */
.textfield-main {
    background-color: rgba(255, 255, 255, 0.03);
    color: #aaa;
    border: 1px solid #333;
    padding: 12px;
    font-size: 1.1rem;
    font-family: inherit;
    border-radius: 4px;
    resize: vertical; 
    width: auto;
    min-height: 120px; 
    min-width: 70%;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    margin: 8px 0;
    margin-bottom: 15px;
}

    .textfield-main:focus {
        outline: none;
        border-color: #555;
        box-shadow: 0 0 0 2px rgba(85, 85, 85, 0.2);
    }

/* === Textfield Num === */
.textfield-num {
    background-color: rgba(255, 255, 255, 0.03);
    color: #aaa;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    background-clip: padding-box;
    border: 1px solid #333;
    border-radius: 4px;
    transition: border-color 0.2s ease;
    margin-bottom: 5px;
    width: auto;
    min-width: 60px;
}

    .textfield-num::-webkit-inner-spin-button,
    .textfield-num::-webkit-outer-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

/* === HOME PAGE === */
/* ________________ */

/* Wrapper sized to the home content height — lets the absolute-positioned bg
   stretch across whatever the page actually needs (works after scroll on phones) */
.home-page {
    position: relative;
    width: 100%;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0 4px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Pulsing glow behind the logo. The blur is static (rasterized once);
   only opacity animates, which is composite-only — far cheaper than
   animating a drop-shadow filter every frame. */
.home-hero::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    width: 52%;
    height: 62%;
    background: radial-gradient(ellipse, rgba(140, 110, 230, 0.5), transparent 70%);
    filter: blur(42px);
    opacity: 0.3;
    animation: home-hero-glow 5s ease-in-out infinite;
    pointer-events: none;
}

.home-hero-img {
    width: 70%;
    max-width: 720px;
    opacity: 0.96;
    position: relative;
    z-index: 1;
}

/* === Animated background === */
/* Negative inset extends bg into .content's 36px padding so the dark + waves
   cover the full visible content panel, not just the inner column. */
.home-bg {
    position: absolute;
    inset: -36px;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

/* Very dark base, barely-there purple hint */
.home-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 65% 55% at 50% 45%, rgba(38, 26, 78, 0.14), transparent 75%),
        linear-gradient(180deg, #050409 0%, #020104 100%);
    pointer-events: none;
}

/* Static SVG waves — drawn once with a single feGaussianBlur, no per-frame cost.
   preserveAspectRatio="none" so they stay anchored to left/right edges on any aspect ratio */
.home-waves {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.55;
    transform: translateZ(0);
}

/* Shooting stars — head + trailing gradient. Composite-only: transform + opacity */
.home-shoot {
    position: absolute;
    top: 0;
    left: 0;
    width: 90px;
    height: 1.5px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(180, 170, 255, 0.4) 60%,
        rgba(255, 255, 255, 0.95) 95%,
        #ffffff 100%);
    border-radius: 999px;
    opacity: 0;
    will-change: transform, opacity;
}

.home-shoot-l1 { animation: home-shoot-l 11s linear infinite; animation-delay: 0.6s; }
.home-shoot-l2 { animation: home-shoot-l 14s linear infinite; animation-delay: 6.4s; width: 70px; }
.home-shoot-r1 { animation: home-shoot-r 11s linear infinite; animation-delay: 3.1s; }
.home-shoot-r2 { animation: home-shoot-r 14s linear infinite; animation-delay: 9.2s; width: 70px; }

@keyframes home-shoot-l {
    0%   { transform: translate(-120px, -60px) rotate(32deg); opacity: 0; }
    3%   { opacity: 0.95; }
    14%  { transform: translate(70vw, 60vh) rotate(32deg); opacity: 0; }
    100% { transform: translate(70vw, 60vh) rotate(32deg); opacity: 0; }
}

@keyframes home-shoot-r {
    0%   { transform: translate(calc(100vw + 60px), -60px) rotate(148deg); opacity: 0; }
    3%   { opacity: 0.95; }
    14%  { transform: translate(30vw, 60vh) rotate(148deg); opacity: 0; }
    100% { transform: translate(30vw, 60vh) rotate(148deg); opacity: 0; }
}

/* Ambient floating particles — slow upward drift with fade in/out */
.home-particle {
    position: absolute;
    width: 1.6px;
    height: 1.6px;
    background: rgba(210, 200, 255, 0.85);
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(170, 150, 255, 0.55);
    opacity: 0;
    animation: home-particle-drift 8s ease-in-out infinite;
    will-change: opacity, transform;
}

@keyframes home-particle-drift {
    0%   { opacity: 0;    transform: translateY(0); }
    20%  { opacity: 0.7; }
    55%  { opacity: 1; }
    85%  { opacity: 0.35; }
    100% { opacity: 0;    transform: translateY(-26px); }
}

@keyframes home-hero-glow {
    0%, 100% { opacity: 0.28; }
    50%      { opacity: 0.6; }
}

@keyframes home-fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.home-feature-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    width: 100%;
    max-width: 1200px;
    margin: 32px auto 0;
    padding: 0 4px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.home-feature-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface-grad);
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    padding: 18px 16px 42px;
    color: #fff;
    text-decoration: none;
    box-shadow: var(--surface-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
    animation: home-fade-up 0.55s ease-out backwards;
}

.home-feature-card:nth-child(1) { animation-delay: 0.05s; }
.home-feature-card:nth-child(2) { animation-delay: 0.12s; }
.home-feature-card:nth-child(3) { animation-delay: 0.19s; }
.home-feature-card:nth-child(4) { animation-delay: 0.26s; }
.home-feature-card:nth-child(5) { animation-delay: 0.33s; }

.home-feature-card:hover {
    transform: translateY(-3px);
    border-color: var(--surface-border-hover);
    box-shadow: var(--surface-shadow-hover);
}

.home-feature-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--icon-grad);
    border: 1px solid var(--icon-border);
    color: var(--accent-text);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.home-feature-icon i {
    font-size: 1.1rem;
}

.home-feature-icon-text {
    font-family: var(--app-font);
}

.home-feature-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.home-feature-desc {
    color: #888;
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 0;
}

.home-feature-arrow {
    position: absolute;
    bottom: 14px;
    right: 16px;
    color: #555;
    font-size: 0.95rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.home-feature-card:hover .home-feature-arrow {
    color: var(--accent-soft);
    transform: translateX(3px);
}

.home-tagline {
    width: 100%;
    max-width: 1200px;
    margin: 36px auto 18px;
    padding: 28px 28px 24px;
    text-align: center;
    background: var(--surface-grad);
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    box-shadow: var(--surface-shadow);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.home-tagline .home-stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    max-width: none;
    margin: 22px 0 0;
    padding: 22px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.home-tagline .home-stat-pill {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 4px 6px;
    transition: color 0.2s ease;
}

.home-tagline .home-stat-pill:hover {
    transform: none;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.home-tagline .home-stat-pill:hover .home-stat-icon {
    color: var(--accent-soft);
}

.home-tagline-title {
    color: #fff;
    font-size: 1.4rem !important;
    font-weight: 600;
    margin: 0 0 10px !important;
}

.home-tagline-text {
    color: #888 !important;
    font-size: 0.95rem !important;
    line-height: 1.5;
    max-width: 720px;
    margin: 0 auto !important;
}

.home-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 18px;
    padding: 0 4px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.home-stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 18px 12px;
    background: var(--surface-grad);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    box-shadow: var(--surface-shadow);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-stat-pill:hover {
    transform: translateY(-2px);
    border-color: var(--surface-border-hover);
    box-shadow: var(--surface-shadow-hover);
}

.home-stat-icon {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 6px;
}

.home-stat-value {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.home-stat-label {
    color: #888;
    font-size: 0.8rem;
}

/* Tablets / mid screens: keep 5 cards in a row but tighten */
@media (max-width: 1100px) {
    .home-feature-grid {
        gap: 10px;
    }
    .home-feature-card {
        padding: 16px 12px 38px;
    }
    .home-feature-title {
        font-size: 0.95rem;
    }
    .home-feature-desc {
        font-size: 0.78rem;
    }
}

/* Phones: stack cards 5 → 1, collapse stats to 2x2, tighten tagline card */
@media (max-width: 760px) {
    .home-feature-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .home-feature-card {
        padding: 16px 16px 40px;
    }
    .home-feature-title {
        font-size: 1rem;
    }
    .home-feature-desc {
        font-size: 0.82rem;
    }

    .home-tagline {
        padding: 22px 16px 18px;
        margin: 28px auto 16px;
    }
    .home-tagline-title {
        font-size: 1.2rem !important;
    }
    .home-tagline-text {
        font-size: 0.85rem !important;
    }
    .home-tagline .home-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px 10px;
        margin-top: 18px;
        padding-top: 18px;
    }
    .home-stat-value {
        font-size: 0.92rem;
    }
    .home-stat-label {
        font-size: 0.74rem;
    }

    .home-hero-img {
        width: 92%;
    }
}

/* Default theme — static look: drop the animated background layer and
   the entrance/idle animations (modern keeps them). */
html[data-theme="default"] .home-bg {
    display: none;
}

html[data-theme="default"] .home-hero-img,
html[data-theme="default"] .home-feature-card {
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    .home-shoot,
    .home-particle,
    .home-hero::before,
    .home-feature-card {
        animation: none !important;
    }
    .home-shoot { opacity: 0; }
    .home-particle { opacity: 0.5; }
}

/* === Sidebar Footer === */
/* Beta version + About link live at the absolute bottom of the sidebar.
   `margin-top: auto` on this row consumes the leftover flex space so it
   anchors to the bottom regardless of how many nav items there are. */
.sidebar-footer {
    margin-top: auto;
    padding: 14px 8px max(12px, env(safe-area-inset-bottom)) 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
}

.sidebar-version {
    color: #777;
    font-size: 0.72rem;
    letter-spacing: 0.4px;
    font-variant-numeric: tabular-nums;
}

/* `!important` on color/decoration so neither Bootstrap's default <a> reset
   nor a stale cached stylesheet can show this as a blue underlined link. */
.sidebar-about,
.sidebar-about:link,
.sidebar-about:visited {
    color: #bbb !important;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none !important;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.sidebar-about:hover {
    color: #fff !important;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}




/* === GROUP SHUFFLER === */
/* ______________________ */
/* `--group-accent` is set per card from the razor and drives the per-group
   colour cues (item left bar, drop-target glow). */

.shuffler-layout {
    width: 100%;
    max-width: 1100px;
    margin: 8px auto 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.shuffler-panel {
    width: min(560px, 95vw);
    gap: 14px;
}

.shuffler-error {
    color: #ff8c8c;
    background: rgba(255, 90, 90, 0.08);
    border: 1px solid rgba(255, 90, 90, 0.35);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.88rem;
}

.shuffler-result {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shuffler-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #cccccc;
    font-size: 0.92rem;
}

.shuffler-summary strong {
    color: var(--accent-text);
}

.shuffler-summary-actions {
    display: flex;
    gap: 8px;
}

.shuffler-action {
    background: rgba(255, 255, 255, 0.04);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 5px 12px;
    min-width: 92px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.shuffler-action:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    border-color: var(--accent);
}

.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.group-card {
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.9), rgba(17, 17, 17, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 18px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    animation: group-card-enter 0.42s cubic-bezier(0.2, 0.7, 0.3, 1.2) backwards;
    animation-delay: calc(var(--i, 0) * 70ms);
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.group-card-droptarget {
    border-color: var(--group-accent);
    box-shadow: 0 0 0 2px var(--group-accent), 0 4px 12px rgba(0, 0, 0, 0.45);
}

@keyframes group-card-enter {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.group-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.group-title-input {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 4px;
}

.group-title-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
}

.group-size {
    color: #888;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.group-copy-btn {
    background: none;
    border: 1px solid transparent;
    color: #aaa;
    padding: 3px 10px;
    min-width: 62px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.group-copy-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.group-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.group-item {
    color: #e0e0e0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--group-accent, #4a90e2);
    transition: background 0.2s ease, transform 0.15s ease;
    word-wrap: break-word;
    cursor: grab;
}

.group-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.group-item:active {
    cursor: grabbing;
}

.group-item-empty {
    color: #555;
    font-style: italic;
    padding: 8px 12px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}




/* === SHIFT PLANNER === */
/* ______________________ */

.timeline-container {
    max-width: 90%;
    min-height: 118px;
    margin-bottom: 20px;
    align-self: center;
    scrollbar-width: thin;
    text-align: center;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.15); 
    border-radius: 8px;  

}

.timeline-bar {
    display: flex;
    flex-direction: row;
    gap: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    border-radius: 8px;
    padding: 1px;
    min-width: fit-content;
    height: 100%;
    max-height: 100%;
}

.hour-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px; 
    min-width: 60px;
    padding: 8px 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);  
    background: rgba(0, 0, 0, 0.2);  
    transition: background 0.2s ease;
}

.hour-slot:last-child {
    border-right: none;  
}

.hour-slot:hover {
    background: rgba(26, 26, 26, 0.9); 
}

.hour-label {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 4px;
    text-align: center;
    font-weight: 500;
}

.required-input, .priority-select {
    width: 80%;
    max-width: 60px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    color: #fff;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 4px;
}

.priority-select {
    background: rgba(255, 255, 255, 0.05); 
    cursor: pointer;
}

.required-input:focus, .priority-select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.priority-select:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
    border-color: #111 !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.03) !important;
}

.priority-select option {
    background: rgb(10, 10, 11, 0.90) !important; 
    color: #fff !important;
}

    .priority-select option:hover {
        background: rgba(51, 51, 51, 0.8) !important; 
        color: #fff !important; 
    }


.required-input::-webkit-inner-spin-button,
.required-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.info-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #2b2b2b;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.info-icon:hover {
    background-color: #444;
}

.info-popup {
    display: none;
    position: absolute;
    left: 30px;
    top: 0;
    background: #1e1e1e;
    color: #f5f5f5;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    width: 220px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
    border: 1px solid #555;
    z-index: 100;
}

.info-popup strong {
    color: #ffd54f;
}

.info-icon:hover .info-popup {
    display: block;
}

/* === EMPLOYEE === */

.employee-add-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: #1e1e1e;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    margin-bottom: 12px;
}

.employee-input {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #f0f0f0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
    min-width: 160px;
}

    .employee-input.small {
        max-width: 155px;
    }

.employee-add-btn {
    background: #2b6cb0;
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}

    .employee-add-btn:hover {
        background: #357ae8;
    }

.time-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nextday-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

    .nextday-checkbox input {
        display: none;
    }

    .nextday-checkbox i {
        font-size: 1.2rem;
        color: var(--bs-light);
        opacity: 0.6;
        transition: opacity 0.2s, transform 0.2s;
    }

    .nextday-checkbox input:checked + i {
        opacity: 1;
        transform: scale(1.1);
    }

.small-icon {
    font-size: 0.85rem;
    color: #ccc;
    margin-left: 2px;
}


.employee-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.employee-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #1f1f1f;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    min-width: 0;
}

.emp-left {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.emp-name {
    display: block;
}

.emp-right {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 7px;
}

.emp-hours {
    color: #90caf9;
}

.emp-time {
    font-size: 15px;
    color: #ccc;
}

.emp-time-muted {
    color: #777;
    font-style: italic;
}

.edit-btn {
    background: none;
    border: none;
    color: #237fd5;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.delete-btn {
    background: none;
    border: none;
    color: #f55;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
}

    .delete-btn:hover {
        color: #ff7777;
        transform: scale(1.1);
    }


/* Actions */
.employee-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.btn-outline-light {
    color: #e0e0e0 !important;
    border-color: #555 !important;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .btn-outline-light:hover {
        color: #fff !important;
        background-color: #3a3a3a !important;
        border-color: #777 !important;
        transform: translateY(-1px);
    }

    .btn-outline-light i {
        font-size: 1rem;
    }



/* ===== GENERATED TIMELINE ===== */

.schedule-grid {
    background: #1c1c1c;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 10px;
    margin-top: 14px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    overflow-x: auto;
    scrollbar-color: #555 #222;
    scrollbar-width: thin;
}

.schedule-row {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 6px;
    min-width: 1000px;
}

.emp-name {
    width: 120px;
    color: #eee;
    font-weight: 500;
    text-align: right;
    margin-right: 10px;
    white-space: nowrap;
}

.emp-bar {
    height: 20px;
    background: linear-gradient(90deg, #3cb371, #2e8b57);
    border-radius: 6px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
    position: relative;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.emp-bar:hover {
    transform: scaleY(1.1);
    opacity: 0.9;
}


.emp-bar::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.emp-bar:hover::after {
    opacity: 1;
}

/* Totals section */
.totals {
    margin-top: 14px;
    padding: 8px 10px;
    background: #181818;
    border-radius: 8px;
    border: 1px solid #333;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.totals-line {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 6px;
}

.total-cell {
    width: 52px;
    text-align: center;
    font-size: 0.8rem;
    color: #ccc;
    background: #222;
    padding: 4px 0;
    border-radius: 4px;
    border: 1px solid #333;
}

.total-cell:hover {
    background: #2f2f2f;
}




.results-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.info-message {
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: #5dade2;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.unfilled-warning {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffc107;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* Gantt Chart */
.gantt-chart {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 24px;
}

.gantt-header {
    display: flex;
    gap: 0;
}

.gantt-names-column {
    flex-shrink: 0;
    width: 180px;
    border-right: 2px solid rgba(255, 255, 255, 0.15);
}

.gantt-header-label {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    font-size: 0.95rem;
}

.gantt-name {
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 0 12px;
    color: #e0e0e0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 500;
    gap: 2px;
}

.shift-hours {
    color: #999;
    font-size: 0.75rem;
    font-weight: 400;
}


.gantt-timeline-column {
    flex: 1;
    min-width: fit-content;
}

.gantt-hours-header {
    display: flex;
    height: 50px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.gantt-hour-marker {
    width: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #999;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.gantt-row {
    display: flex;
    height: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gantt-cell {
    width: 40px;
    min-width: 40px;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

    .gantt-cell.working {
        background: rgba(74, 144, 226, 0.2);
    }

.gantt-bar {
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    height: 24px;
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border-radius: 2px;
}

.gantt-cell.start .gantt-bar {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    left: 4px;
}

.gantt-cell.end .gantt-bar {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    right: 4px;
}

/* Stats */
.coverage-stats {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
}

    .coverage-stats h4 {
        margin-top: 0;
        margin-bottom: 16px;
        color: #fff;
        font-size: 1.1rem;
    }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.stat-label {
    color: #999;
    font-size: 0.9rem;
}

.stat-value {
    color: #4a90e2;
    font-weight: 600;
    font-size: 1.1rem;
}

/* phone */
@media (max-width: 768px) {
    .gantt-names-column {
        width: 140px;
    }

    .gantt-name {
        font-size: 0.85rem;
    }

    .shift-hours {
        font-size: 0.7rem;
    }
}













/* === STRING RANDOMIZER GRID === */
/* ______________________________ */

.page-title {
    font-size: 2.1rem !important;
    font-weight: 700 !important;
    letter-spacing: 4px !important;
    text-transform: uppercase;
    color: #fff;
    margin: 14px 0 38px !important;
    padding: 6px 28px 16px !important;
    position: relative;
    text-align: center;
    display: inline-block;
    align-self: center;
}

.page-title::before,
.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #4a90e2 50%, transparent 100%);
    border-radius: 2px;
}

.page-title::after {
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
}

.page-title::before {
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    bottom: -6px;
    opacity: 0.5;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    margin: 8px auto 40px;
    padding: 0 4px;
    box-sizing: border-box;
}

.tool-card {
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.9), rgba(17, 17, 17, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.tool-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
    border-color: rgba(74, 144, 226, 0.25);
}

.tool-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    margin-bottom: 0 !important;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.tool-card-title i {
    color: #4a90e2;
    font-size: 1.1rem;
}

.tool-card-hint {
    color: #888 !important;
    font-size: 0.82rem !important;
    margin: 0 !important;
    margin-top: 2px !important;
    line-height: 1.4;
    min-height: 2.3em;
}

.tool-card-hint code {
    color: #d6a;
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.78rem;
}

.tool-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    justify-content: flex-start;
}

.tool-input,
.tool-input-small {
    background-color: rgba(255, 255, 255, 0.03);
    color: #ddd;
    border: 1px solid #333;
    padding: 8px 10px;
    font-size: 0.95rem;
    font-family: inherit;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.tool-input {
    width: 100%;
    resize: vertical;
}

.tool-textarea {
    min-height: 120px;
}

.tool-input-small {
    width: auto;
    min-width: 70px;
    padding: 4px 8px;
}

.tool-input:focus,
.tool-input-small:focus {
    outline: none;
    border-color: #555;
    box-shadow: 0 0 0 2px rgba(85, 85, 85, 0.2);
}

.tool-input-small::-webkit-inner-spin-button,
.tool-input-small::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

select.tool-input-small option {
    background: #1a1a1a;
    color: #ddd;
}

.option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.option-row-wrap label {
    flex: 0 0 auto;
}

.option-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #bbb;
    font-size: 0.88rem;
    cursor: pointer;
    user-select: none;
}

/* Fixed-width label so every input lines up regardless of label length */
.opt-key {
    flex: 0 0 auto;
    min-width: 56px;
}

.option-row input[type="checkbox"] {
    accent-color: #4a90e2;
    cursor: pointer;
}

.tool-btn {
    background-color: #151313;
    color: #ddd;
    border: 1px solid #333;
    padding: 8px 18px;
    margin-top: 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
    width: 100%;
}

.tool-btn:hover:not(:disabled) {
    background-color: #2a2a2a;
    color: #fff;
}

.tool-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tool-result {
    background: rgba(74, 144, 226, 0.08);
    border: 1px solid rgba(74, 144, 226, 0.25);
    border-radius: 6px;
    padding: 10px 12px;
    color: #cde2ff;
    word-break: break-all;
    overflow: hidden;
    font-size: 0.95rem;
    min-height: 22px;
    margin-top: auto;
}

.tool-result-mono {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.92rem;
}

.tool-result-empty {
    color: #555;
    font-style: italic;
}

/* Coin */
.coin-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 130px;
    perspective: 600px;
}

.coin {
    position: relative;
    width: 90px;
    height: 90px;
    transform-style: preserve-3d;
    transition: transform 1.1s cubic-bezier(0.3, 0.6, 0.3, 1);
}

.coin-face {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: bold;
    color: #1a1a1a;
    box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.3),
                inset 0 4px 8px rgba(255, 255, 255, 0.25),
                0 4px 14px rgba(0, 0, 0, 0.5);
    font-family: var(--app-font);
}

.coin-face.heads {
    background: linear-gradient(145deg, #ffd54f 0%, #c4942b 100%);
}

.coin-face.tails {
    background: linear-gradient(145deg, #d6d6d6 0%, #888 100%);
    transform: rotateY(180deg);
}

/* Emoji */
.emoji-display {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    font-size: 4rem;
    line-height: 1;
}

.emoji-placeholder {
    color: #333;
    font-size: 3rem;
}

/* Responsive */
@media (max-width: 600px) {
    .tool-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tool-card {
        padding: 16px;
    }

    .tool-card-title {
        font-size: 1rem;
    }
}


/* === NUMBER RANDOMIZER === */
/* ________________________ */
/* Reuses the .tool-* card/grid styles; only the dice + lottery visuals
   and their animations are page-specific. */

/* Dice */
.dice-tray {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    min-height: 76px;
    padding: 6px 0;
}

.die {
    width: 56px;
    height: 56px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 7px;
    box-sizing: border-box;
    border-radius: 12px;
    background: linear-gradient(150deg, #f4f4f6 0%, #c9c9d0 100%);
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.25),
                inset 0 3px 6px rgba(255, 255, 255, 0.55),
                0 4px 10px rgba(0, 0, 0, 0.45);
}

.pip-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pip {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #1b1b1f;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.55);
}

.die-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    font-weight: 700;
    font-family: var(--app-font);
    color: #888;
    background: linear-gradient(150deg, #2a2a30 0%, #1a1a1f 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.die.rolling {
    animation: dice-tumble 0.42s ease-in-out infinite;
}

@keyframes dice-tumble {
    0%   { transform: rotate(0deg) translateY(0) scale(1); }
    25%  { transform: rotate(-20deg) translateY(-9px) scale(1.08); }
    50%  { transform: rotate(15deg) translateY(3px) scale(0.95); }
    75%  { transform: rotate(-9deg) translateY(-5px) scale(1.05); }
    100% { transform: rotate(0deg) translateY(0) scale(1); }
}

/* Lottery balls */
.lotto-balls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-height: 76px;
    padding: 6px 0;
}

.lotto-ball {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    background: radial-gradient(circle at 34% 30%, var(--accent-soft), var(--accent) 75%);
    box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.45);
    animation: lotto-pop 0.45s cubic-bezier(0.2, 0.7, 0.3, 1.3) backwards;
}

@keyframes lotto-pop {
    0%   { transform: scale(0) rotate(-35deg); opacity: 0; }
    60%  { transform: scale(1.18) rotate(8deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Number chips (multiple numbers) */
.num-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.num-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ddd;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Date inputs — render the native picker in dark */
.tool-card input[type="date"] {
    color-scheme: dark;
}


/* === SPINNING WHEEL === */
/* _____________________ */
/* The wheel itself is canvas-drawn (wheel.js); these styles cover the page
   layout, the editor panel (reuses .tool-card) and the result banner. */

.wheel-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    width: 100%;
    max-width: 880px;
    margin: 8px auto 48px;
}

.wheel-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.wheel-canvas {
    display: block;
    width: min(420px, 78vw);
    height: min(420px, 78vw);
}

.wheel-spin-btn {
    width: auto;
    min-width: 190px;
    margin-top: 0;
}

.wheel-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 200px;
    padding: 12px 30px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--accent);
    box-shadow: 0 0 26px -8px var(--accent);
    animation: wheel-result-pop 0.42s cubic-bezier(0.2, 0.7, 0.3, 1.45) backwards;
}

.wheel-result-label {
    font-size: 0.68rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--accent-text);
}

.wheel-result-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    word-break: break-word;
}

@keyframes wheel-result-pop {
    from { opacity: 0; transform: scale(0.7) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.wheel-panel {
    width: min(360px, 92vw);
    gap: 14px;
}

.wheel-labels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.wheel-label-input {
    min-width: 0;
}

.wheel-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
}

.wheel-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #888;
}

.wheel-clear-btn {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.76rem;
    color: #888;
    cursor: pointer;
    transition: color 0.15s ease;
}

.wheel-clear-btn:hover {
    color: var(--accent-text);
}

.wheel-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wheel-history-chip {
    max-width: 100%;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 0.82rem;
    color: #bbb;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wheel-history-chip:first-child {
    color: #fff;
    border-color: var(--accent);
}


/* === MODERN THEME — OTHER PAGES === */
/* _________________________________ */
/* The home page carries the full modern look (animated background) above.
   This block extends the dark + purple palette to every other page when
   modern is active. The default theme is left completely untouched. */

/* Dark content panel (the home page covers its own bg with .home-bg) */
html[data-theme="modern"] .content {
    background: linear-gradient(180deg, #08070f 0%, #040308 100%);
}

/* Cards adopt the home-card surface */
html[data-theme="modern"] .tool-card,
html[data-theme="modern"] .group-card {
    background: var(--surface-grad);
    border-color: var(--surface-border);
}

html[data-theme="modern"] .tool-card:hover {
    border-color: var(--surface-border-hover);
}

/* Panels / containers go dark */
html[data-theme="modern"] .schedule-grid,
html[data-theme="modern"] .totals,
html[data-theme="modern"] .gantt-chart,
html[data-theme="modern"] .coverage-stats,
html[data-theme="modern"] .timeline-container,
html[data-theme="modern"] .employee-add-container,
html[data-theme="modern"] .employee-card,
html[data-theme="modern"] .info-popup {
    background: rgba(20, 19, 24, 0.9);
    border-color: var(--surface-border);
}

/* Accent recolor: blue -> purple */
html[data-theme="modern"] .tool-card-title i,
html[data-theme="modern"] .stat-value {
    color: var(--accent);
}

html[data-theme="modern"] .gantt-cell.working {
    background: rgba(140, 110, 230, 0.12);
}

html[data-theme="modern"] .tool-result {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(140, 110, 230, 0.28);
    color: #ddd3ff;
}

/* Focus rings */
html[data-theme="modern"] .required-input:focus,
html[data-theme="modern"] .tool-input:focus,
html[data-theme="modern"] .tool-input-small:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(140, 110, 230, 0.2);
}

html[data-theme="modern"] .option-row input[type="checkbox"] {
    accent-color: var(--accent);
}

/* Page-title underline -> purple */
html[data-theme="modern"] .page-title::before,
html[data-theme="modern"] .page-title::after {
    background-image: linear-gradient(90deg, transparent 0%, #8a6bff 50%, transparent 100%);
}

/* All buttons share the outline style of the .txt save/load buttons */
html[data-theme="modern"] .button-main,
html[data-theme="modern"] .tool-btn,
html[data-theme="modern"] .employee-add-btn {
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(140, 110, 230, 0.28);
    color: #e0e0e0;
}

html[data-theme="modern"] .btn-outline-light {
    background-color: rgba(0, 0, 0, 0.25);
    border-color: rgba(140, 110, 230, 0.28) !important;
}

html[data-theme="modern"] .button-main:hover,
html[data-theme="modern"] .tool-btn:hover:not(:disabled),
html[data-theme="modern"] .employee-add-btn:hover {
    background-color: rgba(140, 110, 230, 0.16);
    border-color: rgba(140, 110, 230, 0.5);
    color: #fff;
}

html[data-theme="modern"] .total-cell:hover {
    background: #2a2348;
}

html[data-theme="modern"] .btn-outline-light:hover {
    background-color: rgba(140, 110, 230, 0.16) !important;
    border-color: rgba(140, 110, 230, 0.5) !important;
}

html[data-theme="modern"] .hour-slot:hover {
    background: #231f30;
}

html[data-theme="modern"] .group-item:hover {
    background: rgba(140, 110, 230, 0.13);
}

html[data-theme="modern"] .info-icon {
    background-color: #222127;
}

html[data-theme="modern"] .info-icon:hover {
    background-color: #302e38;
}

html[data-theme="modern"] .employee-input {
    background: #1a191e;
    border-color: #34323c;
}


/* === BLAZOR === */
/* ______________ */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}


/* === SHIFT PLANNER (REDESIGN) === */
/* ______________________________ */
/* Builds on top of the original .timeline-bar / .gantt-* internals — this
   section adds the card-based layout, color-coded employees (per-row
   --emp-color CSS var), today/next-day visual split, presets, edit-in-place,
   and mobile horizontal-scrolling for the wide timeline & Gantt. */

.planner-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 1100px;
    margin: 8px auto 48px;
}

.planner-card {
    gap: 14px;
}

.planner-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 18px;
}

.planner-section-title {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.planner-section-hint {
    margin: 0 0 0 auto;
    color: #888;
    font-size: 0.82rem;
    line-height: 1.4;
}

.planner-card-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.planner-chip {
    background: rgba(255, 255, 255, 0.04);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 5px 12px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.planner-chip:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    border-color: var(--accent);
}

.planner-chip-quiet {
    color: #888;
    border-color: rgba(255, 255, 255, 0.07);
}

.planner-file-input {
    display: none;
}

.demand-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Horizontal scroller used to wrap the long .timeline-bar and the .gantt-chart
   so they never blow out the .tool-card border. */
.planner-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.planner-scroll::-webkit-scrollbar {
    height: 8px;
}
.planner-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}

/* Visible-range setter — small inputs in the card head. */
.planner-visible-range {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.planner-visible-range .tool-input-small {
    min-width: 54px;
    width: 54px;
    padding: 3px 6px;
    text-align: center;
}

.planner-visible-sep {
    color: #555;
}

/* Custom-range row — sits under the presets. */
.demand-custom-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.demand-custom-label {
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 0.7rem;
}

.demand-custom-row .tool-input-small {
    min-width: 70px;
    width: 80px;
    text-align: center;
}

.demand-custom-sep {
    color: #555;
}

/* Visually mark hours that belong to the next day (24..30). The first one
   gets a thicker accent divider so the seam is unmistakable. */
.hour-slot.next-day .hour-label,
.gantt-hour-marker.next-day {
    color: var(--accent-text);
    opacity: 0.85;
}

.hour-slot.next-day-start {
    border-left: 2px solid var(--accent);
    padding-left: 6px;
    margin-left: 2px;
}

.gantt-hour-marker.next-day-start,
.gantt-cell.next-day-start {
    border-left: 2px solid var(--accent);
}

.planner-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #cccccc;
    font-size: 0.88rem;
}

.planner-summary strong {
    color: var(--accent-text);
}

.planner-summary-status {
    margin-left: auto;
    font-size: 0.78rem;
    color: #8fd17b;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.planner-summary.short {
    border-color: rgba(255, 180, 80, 0.4);
    background: rgba(255, 180, 80, 0.06);
}

.planner-summary.short .planner-summary-status {
    color: #ffb455;
}

.planner-error {
    color: #ff8c8c;
    background: rgba(255, 90, 90, 0.08);
    border: 1px solid rgba(255, 90, 90, 0.35);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.88rem;
}

.planner-info {
    color: #cccccc;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.88rem;
}

.planner-info strong {
    color: var(--accent-text);
}

.planner-warning {
    color: #ffb455;
    background: rgba(255, 180, 80, 0.08);
    border: 1px solid rgba(255, 180, 80, 0.35);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.88rem;
}

.planner-warning strong {
    color: #ffd089;
}

/* --- Employee form (compact card) --- */

.planner-form-card {
    padding: 14px 18px;
    gap: 10px;
}

.planner-card-head-tight {
    margin-bottom: 0;
}

.employee-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* One-line row: Max hours · Start · End · Add. Wraps on narrow screens. */
.employee-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.employee-form-input {
    min-width: 90px;
    width: 110px;
}

.planner-form-btn {
    width: auto;
    min-width: 90px;
    padding: 8px 18px;
    margin-top: 0;
    margin-left: auto;
}

/* --- Employee list --- */

.employee-color-chip {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--emp-color, var(--accent));
    flex-shrink: 0;
    box-shadow: 0 0 8px -2px var(--emp-color, var(--accent));
}

/* Override the base .employee-card to add proper spacing between the flat
   children (chip · name · max-hours · time · actions). Without an explicit
   gap, justify-content:space-between leaves the leading items flush. */
.employee-card {
    gap: 12px;
    padding: 10px 14px;
    flex-wrap: wrap;
}

.employee-card .employee-name {
    font-weight: 600;
    color: #f0f0f0;
}

.employee-card .emp-hours {
    color: var(--accent-text);
    font-size: 0.85rem;
    white-space: nowrap;
}

.employee-card .emp-time,
.employee-card .emp-time-muted {
    color: #bbb;
    font-size: 0.88rem;
    white-space: nowrap;
}

.employee-card.editing {
    border: 1px solid var(--emp-color, var(--accent));
    box-shadow: 0 0 0 1px var(--emp-color, var(--accent));
}

.employee-card-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: auto;
}

.employee-icon-btn {
    background: none;
    border: 1px solid transparent;
    color: #aaa;
    padding: 5px 9px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.employee-icon-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.employee-icon-btn-danger:hover {
    color: #ff8c8c;
    border-color: rgba(255, 90, 90, 0.4);
}

/* --- Randomize + results --- */

.planner-randomize {
    width: auto !important;
    min-width: 240px;
    align-self: center;
    margin-top: 0 !important;
}

.planner-results {
    animation: planner-results-pop 0.42s cubic-bezier(0.2, 0.7, 0.3, 1.2) backwards;
}

@keyframes planner-results-pop {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Color-coded Gantt — bar pulls from per-row --emp-color. The .gantt-chart
   prefix beats the modern-theme override on .gantt-bar without !important. */
.gantt-chart .gantt-row .gantt-bar {
    background: linear-gradient(135deg, var(--emp-color, var(--accent)) 0%, color-mix(in srgb, var(--emp-color, var(--accent)) 65%, #000) 100%);
}

/* Restructured name row: small colour chip on the left, name + shift-hours
   stacked on the right. Overrides the original column flex direction so the
   layout aligns row-for-row with the Gantt bars. */
.planner-results .gantt-name {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
}

.gantt-name-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 1px;
    line-height: 1.15;
}

.gantt-name-text {
    color: #f0f0f0;
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.planner-results .shift-hours {
    color: #999;
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Inside the planner card, the .gantt-chart shouldn't render its own card
   chrome — the wrapping .tool-card already provides it. */
.planner-results .gantt-chart {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 0;
    overflow: visible;
}

.gantt-cell.next-day {
    background: rgba(255, 255, 255, 0.015);
}

/* === Mobile === */
@media (max-width: 767px) {

    .planner-card-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .planner-section-hint {
        margin-left: 0;
    }
    .planner-card-actions {
        margin-left: 0;
    }

    .employee-form-row {
        flex-direction: column;
        align-items: stretch;
    }
    .employee-form-field {
        width: 100%;
    }
    .employee-form-field .tool-input-small {
        width: 100%;
    }

    .planner-form-btn {
        width: 100%;
        min-width: 0;
    }

    .employee-card {
        flex-wrap: wrap;
    }
    .employee-card-actions {
        margin-left: auto;
    }

    .planner-randomize {
        width: 100% !important;
    }

    /* Sticky employee-name column when horizontally scrolling the Gantt. */
    .planner-scroll .gantt-names-column {
        position: sticky;
        left: 0;
        z-index: 2;
        background: linear-gradient(145deg, rgba(26, 26, 26, 0.98), rgba(17, 17, 17, 0.98));
        box-shadow: 4px 0 12px -4px rgba(0, 0, 0, 0.5);
    }

    /* Tighten the visible-range setter so it doesn't crowd the section title. */
    .planner-visible-range {
        margin-left: 0;
        flex-wrap: wrap;
    }
}


/* === MOBILE / TOUCH POLISH === */
/* ___________________________ */
/* Cross-cutting refinements for touch devices. Kept in one block so the
   whole "feels right on a phone" surface is easy to find. */

/* Tap-anywhere-on-the-wheel to spin. The Spin button still works the same. */
.wheel-canvas {
    cursor: pointer;
}

/* Long-press on UI chrome should not pop the iOS text-selection bubble. Inputs,
   results and other text content stay selectable. */
.sidebar,
.sidebar-toggle,
.sidebar-backdrop,
.sidebar-footer,
.theme-switch,
.tool-card-title,
.tool-card-hint,
.page-title,
.tool-btn,
.shuffler-action,
.shuffler-summary,
.group-card-head,
.group-copy-btn,
.wheel-clear-btn,
.wheel-result-label {
    -webkit-user-select: none;
    user-select: none;
}

/* On pure-touch devices, :hover sticks after a tap until you tap elsewhere —
   which makes cards look stuck in the "lifted" state. Disable the transforms
   there; press feedback already comes from the :active scale on buttons. */
@media (hover: none) {
    .tool-card:hover,
    .group-card:hover {
        transform: none;
    }
}


/* === HOME LIVE STATS CARD === */
/* ____________________________ */
/* Big card that sits between the feature grid and the tagline. Pulls live
   counters from /api/stats. */

.home-livestats {
    width: min(100%, 1100px);
    margin: 2.5rem auto 0;
    padding: 1.75rem 1.75rem 2rem;
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.85), rgba(17, 17, 17, 0.85));
    border: 1px solid rgba(138, 107, 255, 0.22);
    border-radius: 18px;
    box-shadow: 0 18px 48px -22px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    position: relative;
    z-index: 1;
}

.home-livestats-head {
    text-align: center;
    margin-bottom: 1.5rem;
}

.home-livestats-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(120deg, #8a6bff 0%, #d6c8ff 50%, #8a6bff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.home-livestats-sub {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: rgba(220, 215, 240, 0.6);
}

.home-livestats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
}

.home-livestat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.15rem 0.75rem;
    background: rgba(138, 107, 255, 0.06);
    border: 1px solid rgba(138, 107, 255, 0.15);
    border-radius: 14px;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    animation: livestat-in 420ms ease-out forwards;
    animation-delay: calc(var(--i, 0) * 80ms);
    will-change: transform, opacity;
}

@keyframes livestat-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.home-livestat-icon {
    font-size: 1.6rem;
    color: #b39bff;
}

.home-livestat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: #f4f1ff;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.home-livestat-label {
    font-size: 0.8rem;
    color: rgba(220, 215, 240, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* The joke "days without an accident" tile gets a warning-tape accent so
   it reads as deliberately silly. */
.home-livestat-joke {
    background: rgba(255, 196, 76, 0.06);
    border-color: rgba(255, 196, 76, 0.25);
}

    .home-livestat-joke .home-livestat-icon {
        color: #ffc44c;
    }

@media (max-width: 720px) {
    .home-livestats {
        margin-top: 1.75rem;
        padding: 1.25rem 1rem 1.5rem;
    }

    .home-livestats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-livestat-value {
        font-size: 1.55rem;
    }
}


/* === SIDEBAR NAV DIVIDER === */
/* _____________________________ */
/* Visual break between the randomizer links and the Contact link at the
   bottom of the sidebar nav. */

.nav-divider {
    height: 1px;
    margin: 0.6rem 0.9rem;
    background: linear-gradient(90deg,
        rgba(138, 107, 255, 0) 0%,
        rgba(138, 107, 255, 0.35) 50%,
        rgba(138, 107, 255, 0) 100%);
}


/* === CONTACT PAGE === */
/* ____________________ */

.contact-layout {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 0.25rem;
}

.contact-card {
    padding: 1.75rem;
}

.contact-intro {
    margin: 0 0 1.25rem;
    color: rgba(220, 215, 240, 0.75);
    line-height: 1.5;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-type-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.contact-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.85rem 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(138, 107, 255, 0.18);
    border-radius: 12px;
    color: rgba(220, 215, 240, 0.85);
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 120ms ease, background-color 160ms ease, border-color 160ms ease;
    will-change: transform;
}

    .contact-type:hover:not(:disabled) {
        transform: translateY(-1px);
        background: rgba(138, 107, 255, 0.08);
    }

    .contact-type:active:not(:disabled) {
        transform: translateY(0);
    }

    .contact-type.active {
        background: rgba(138, 107, 255, 0.18);
        border-color: rgba(138, 107, 255, 0.6);
        color: #f4f1ff;
    }

    .contact-type i {
        font-size: 1.3rem;
        color: #b39bff;
    }

    .contact-type:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.contact-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.contact-field-label {
    font-size: 0.85rem;
    color: rgba(220, 215, 240, 0.75);
    letter-spacing: 0.01em;
}

.contact-field-hint {
    color: rgba(220, 215, 240, 0.45);
    font-weight: 400;
}

.contact-message {
    min-height: 140px;
    resize: vertical;
}

/* Honeypot — kept in the DOM for bots, hidden from humans and screen readers. */
.contact-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.contact-turnstile {
    /* Reserve roughly the widget's footprint to avoid a layout jump when it
       mounts after the async script finishes loading. */
    min-height: 65px;
    display: flex;
    justify-content: flex-start;
}

.contact-submit {
    align-self: flex-start;
    min-width: 160px;
}

.contact-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(-4px);
    animation: contact-status-in 240ms ease-out forwards;
    will-change: transform, opacity;
}

@keyframes contact-status-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-status.ok {
    background: rgba(99, 201, 141, 0.12);
    border: 1px solid rgba(99, 201, 141, 0.35);
    color: #b5e9c9;
}

.contact-status.err {
    background: rgba(239, 111, 108, 0.12);
    border: 1px solid rgba(239, 111, 108, 0.35);
    color: #f4b9b7;
}

.contact-status i {
    font-size: 1.1rem;
}

@media (max-width: 540px) {
    .contact-card {
        padding: 1.25rem;
    }

    .contact-type {
        font-size: 0.78rem;
        padding: 0.7rem 0.4rem;
    }

        .contact-type i {
            font-size: 1.15rem;
        }

    .contact-submit {
        align-self: stretch;
    }
}
