:root{
    --bg: #071025;
    --panel: #071832;
    --panel-2: #042037;
    --text: #dfffe6; /* softer greenish text */
    --muted: #9fe6c9; /* muted green */
    --accent: #00d775; /* terminal green accent */
    --accent-2: #39ff9b;
    --border: rgba(0,215,117,0.08);
}

/* Global terminal look */
body {
    font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Alternate readable font mode: larger, more legible sans-serif and slightly increased line-height */
body.alt-font {
    font-family: Arial, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}
body.alt-font .content { font-size: 18px; line-height: 1.85; }
/* keep headings clear but slightly larger when readability mode is on */
body.alt-font .content h1, body.alt-font .content h2, body.alt-font .content h3 { letter-spacing: 0.01em; }

/* Also apply readable font to sidebar when alt-font is enabled (override monospace) */
body.alt-font .sidebar,
body.alt-font .sidebar nav ul li a,
body.alt-font .sidebar h1,
body.alt-font .sidebar .brand,
body.alt-font .sidebar .brand .logo {
    font-family: Arial, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif !important;
    font-size: 14px;
    color: var(--muted);
}
body.alt-font .sidebar nav ul li a { white-space: normal; }

/* Reserve space for fixed MDT topbar so it doesn't overlap content */
body { padding-top: 48px; }

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar as a terminal menu */
.sidebar {
    width: 200px;
    background: linear-gradient(180deg,var(--panel),var(--panel-2));
    color: var(--muted);
    /* add top padding so background continues under fixed topbar */
    padding: calc(12px + 48px) 12px 100px 12px; /* reduced spacing to make side panel more compact */
    position: fixed;
    top: 0; /* let sidebar background extend beneath topbar */
    height: 100%;
    overflow-y: auto;
    box-shadow: 6px 0 18px rgba(0,0,0,0.6);
    border-right: 1px solid var(--border);
}

.sidebar h1 {
    margin-top: 0;
    font-size: 1.25em;
    color: var(--accent);
    letter-spacing: 0.06em;
}

/* Use monospace in the sidebar for terminal feel */
.sidebar, .sidebar nav ul li a, .sidebar h1, .sidebar .brand {
    font-family: "Courier New", Courier, monospace;
    color: var(--muted);
}
.sidebar .brand .logo { border-radius:4px; }

.sidebar li.section-label { color: var(--accent); font-weight:700; text-transform:uppercase; font-size:12px; }

/* Brand/logo in sidebar */
.sidebar .brand {
    display: flex;
    justify-content: center; /* center the logo */
    align-items: center;
    margin: -16px 0 8px 0; /* position logo with more breathing room from topbar */
    padding-left: 0;
}
.sidebar .brand .logo {
        width: 120px; /* slightly smaller for compact sidebar */
    height: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
    display: block;
}

/* Footer credit inside sidebar */
.sidebar-footer {
    position: absolute;
    bottom: 12px;
    left: 18px;
    right: 18px;
    text-align: center;
    font-size: 0.85em;
    color: var(--muted);
    border-top: 1px dashed rgba(95,182,255,0.04);
    padding-top: 10px;
    z-index: 20;
}

/* Global bottom-right credit box visible on all pages */
.global-credit {
    position: fixed;
    right: 18px;
    bottom: 18px;
    background: linear-gradient(180deg, rgba(8,25,40,0.9), rgba(6,18,30,0.88));
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(95,182,255,0.06);
    box-shadow: 0 6px 18px rgba(0,0,0,0.6);
    font-size: 0.85em;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

/* MDT top bar and small status box */
.mdt-topbar {
    background: linear-gradient(90deg,#031018 0%, #06121a 100%);
    color: var(--accent);
    padding: 8px 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    font-family: "Courier New", Courier, monospace;
    font-size:13px;
    border-bottom:1px solid rgba(0,0,0,0.6);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 48px;
    box-sizing: border-box;
    z-index: 10000 !important;
}

/* Lock topbar child heights to prevent vertical stretching when dynamic content appears */
.mdt-topbar .badge, .mdt-topbar input, .mdt-topbar button {
    display: inline-flex;
    align-items: center;
    height: 28px;
    line-height: 1;
    padding: 4px 8px;
    box-sizing: border-box;
}
.mdt-topbar #mdt-clock { height: 28px; min-width: 160px; text-align: center; display:inline-flex; align-items:center; justify-content:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:12px; }
.mdt-topbar .right { gap: 8px; }

/* Ensure dropdown sits above topbar and other fixed elements */
.search-dropdown { z-index: 20000; }
/* Snowing effect animation: animate background-position so flakes move downward */
@keyframes snowfall {
    0% { background-position: 0 -40px; opacity: 1; }
    85% { opacity: 1; }
    100% { background-position: 0 80px; opacity: 0; }
}

@keyframes snowDrift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

/* MDT top bar with snow effect */
.mdt-topbar {
    background: linear-gradient(90deg,#031018 0%, #06121a 100%);
    color: var(--accent);
    padding: 8px 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    font-family: "Courier New", Courier, monospace;
    font-size:13px;
    border-bottom:1px solid rgba(0,0,0,0.6);
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 48px;
    box-sizing: border-box;
    z-index: 10000 !important;
    overflow: hidden;
}

/* Hacker / MDT topbar visuals ------------------------------------------------
   - ::before: subtle scanlines / grid that slowly drifts for a technical look
   - ::after : scrolling MDT status ticker (editable content) that moves
   These are pure-CSS so they work without changing HTML. */
.mdt-topbar::before {
    content: '';
    position: absolute;
    inset: 0;
    /* thin grid/scanlines to give a 'monitor' feel */
    background-image: linear-gradient(90deg, rgba(0,255,150,0.02) 1px, transparent 1px),
                      linear-gradient(180deg, rgba(0,255,150,0.02) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(0,255,150,0.02) 0.5px, rgba(0,255,150,0.01) 2px);
    background-repeat: repeat, repeat, repeat-x;
    background-size: 40px 40px, 40px 40px, 120% 6px;
    opacity: 0.16;
    pointer-events: none;
    z-index: 1;
    will-change: background-position, opacity;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { background-position: 0 0, 0 0, 0 0; }
    50% { background-position: 20px 20px, 20px 20px, 0 6px; }
    100% { background-position: 40px 40px, 40px 40px, 0 0; }
}

/* Boxed, constrained ticker placed to the left of the date/time. */
.ticker-box {
    overflow: hidden;
    max-width: 420px; /* constrain width so it sits neatly beside the clock */
    min-width: 160px;
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(0,215,117,0.06);
    padding: 6px 8px;
    border-radius: 4px;
    margin-right: 8px;
    display: flex;
    align-items: center;
}

.mdt-ticker { display: block; width: 100%; }
.mdt-ticker span {
    display: inline-block;
    white-space: nowrap;
    color: rgba(57,255,130,0.95);
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    letter-spacing: 0.02em;
    padding-left: 100%; /* start off-screen to the right */
    animation: mdtTicker 14s linear infinite;
}

@keyframes mdtTicker {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-100%); }
}

/* Small officer count box to the left of the ticker */
/* officer display removed */

/* Ensure content sits above the snow effect */
.mdt-topbar .left, .mdt-topbar .right {
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
    z-index: 2;
}
.mdt-topbar .badge {
    padding: 4px 8px;
    background: rgba(0,0,0,0.35);
    border-radius: 4px;
    color: var(--accent);
    border: 1px solid rgba(0,215,117,0.06);
}

.mdt-statusbar {
    position: fixed;
    left: 12px;
    bottom: 12px;
    right: auto;
    background: rgba(3,10,12,0.85);
    color: #92fbb3;
    font-family: "Courier New", Courier, monospace;
    padding:6px 10px;
    border-radius:6px;
    font-size:12px;
    border:1px solid rgba(0,215,117,0.12);
}

/* Theme toggle button in the topbar (small icon to the right of the unit badge) */
.theme-toggle{
    margin-left:10px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.04);
    color: var(--accent-2);
    padding: 6px 8px;
    border-radius:6px;
    cursor: pointer;
    font-size:14px;
    line-height:1;
}
.theme-toggle:hover{ background: rgba(255,255,255,0.02); }

.theme-toggle .theme-label{ font-size:0.85em; color: var(--muted); margin-right:4px; }
.theme-toggle #theme-name{ font-weight:700; color: var(--accent-2); }

/* When the toggle also has the `.badge` class (we set this in the template),
   make it visually identical to the unit badge: same padding, background,
   border and font sizing so the two look like a pair. */
.theme-toggle.badge{
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(0,215,117,0.06);
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1;
    font-family: inherit; /* inherit monospace from topbar */
}
.theme-toggle.badge:hover{ background: rgba(0,0,0,0.45); }
.theme-toggle.badge .theme-label{ color: var(--muted); }
.theme-toggle.badge #theme-name{ color: var(--accent); }

/* Search input styling */
.search-input {
    padding: 4px 8px !important;
    background: rgba(0,0,0,0.35) !important;
    border: 1px solid rgba(0,215,117,0.06) !important;
    border-radius: 4px !important;
    color: var(--text) !important;
    font-family: inherit !important;
    font-size: 13px !important;
    min-width: 180px;
    outline: none;
}
.search-input::placeholder {
    color: rgba(255,255,255,0.4);
}
.search-input:focus {
    background: rgba(0,0,0,0.5) !important;
    border-color: rgba(0,215,117,0.15) !important;
    box-shadow: 0 0 8px rgba(0,215,117,0.1);
}

/* tiny blinking cursor helper for headings */
.mdt-cursor::after{content:"_";margin-left:6px;animation:blink 1s steps(2,end) infinite;color:var(--accent)}

@media (max-width: 800px){
    .global-credit { right: 12px; left: 12px; bottom: 12px; text-align:center; }
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
}

.sidebar nav ul li a {
    display: block;
    padding: 8px 6px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dashed rgba(95,182,255,0.04);
    transition: background .12s ease, color .12s ease, transform .12s ease;
    transform: translateX(0);
    white-space: nowrap; /* prevent wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px; /* slightly smaller text */
}
.sidebar nav ul li a:hover {
    background: linear-gradient(90deg, rgba(47,137,255,0.06), rgba(47,137,255,0.02));
    color: var(--accent-2);
    transform: translateX(6px);
}

/* Active link state */
.sidebar nav ul li a.active {
    background: linear-gradient(90deg, rgba(47,137,255,0.08), rgba(47,137,255,0.03));
    color: var(--accent-2);
    transform: translateX(6px);
}
.sidebar nav ul li ul.submenu li a {
    display: block;
    padding: 8px 6px 8px 20px; /* reduced indent and padding */
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dashed rgba(95,182,255,0.04);
    font-size: 12.5px;
    transition: background .12s ease, color .12s ease, transform .12s ease;
    transform: translateX(0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar nav ul li ul.submenu li a:hover {
    background: linear-gradient(90deg, rgba(47,137,255,0.04), rgba(47,137,255,0.01));
    color: var(--accent-2);
    transform: translateX(6px);
}
.sidebar nav ul li ul.submenu li a.active {
    background: linear-gradient(90deg, rgba(47,137,255,0.08), rgba(47,137,255,0.03));
    color: var(--accent-2);
    transform: translateX(6px);
}

/* Main content area */
.content {
    margin-left: 220px;
    padding: 20px;
    width: calc(100% - 220px);
    position: relative;
    z-index: 1;
}

/* Main content typography and layout improvements */
.content {
    font-family: Inter, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, system-ui, -apple-system;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    /* shift page content slightly to the right */
    padding-left: 32px;
}

.content .page-inner {
    max-width: 880px;
    margin: 0 auto;
    position: relative; /* create stacking context for the centered background */
    z-index: 1;
    background: transparent !important;
}

/* Legislation dropdown details */
.leg-list { list-style: none; padding-left: 0; }
.leg-list li { margin: 10px 0; }
.leg-item { display: flex; align-items: center; gap: 12px; }
/* When inside the interview form, stack question, guidance and answer vertically */
#interview-form .leg-item {
    display: block;
}
#interview-form .leg-item > div, #interview-form .leg-item .q-details {
    display: block;
}
#interview-form .leg-item .q-toggle {
    margin-top: 8px;
}
.leg-toggle {
    margin-left: auto;
    background: transparent;
    border: 1px solid rgba(95,182,255,0.06);
    color: var(--accent-2);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
}
.leg-toggle:hover { background: rgba(255,255,255,0.02); }
.leg-details {
    display: none;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(95,182,255,0.03);
    padding: 10px 12px;
    margin-top: 6px;
    border-radius: 6px;
    color: var(--muted);
}
.leg-details p { margin: 0; }
.leg-details.open { display: block; }

/* Decorative background handled via DOM image `.content-bg` (inserted in index.php)
   Remove the old ::before approach (it was inconsistent and contained a malformed
   nested rule that broke stylesheet parsing). The DOM image is constrained so
   it never dominates the layout and will be behind text. */

.content h1, .content h2, .content h3, .content h4 {
    margin-top: 1.1em;
    margin-bottom: 0.45em;
    line-height: 1.15;
    color: var(--accent-2);
    font-weight: 700;
}
.content h1 { font-size: 1.9rem; }
.content h2 { font-size: 1.45rem; }
.content h3 { font-size: 1.15rem; }

.content p { margin: 0 0 1.05em 0; color: var(--muted); }
.content p.lead { font-size:1.125rem; color: var(--text); margin-bottom:1.25em; }

.content ul, .content ol {
    margin: 0 0 1em 1.25em;
    color: var(--muted);
}
.content li { margin: .45em 0; }

.content blockquote {
    position: relative;
    border-left: 6px solid rgba(80,200,150,0.3);
    padding: 18px 16px 18px 20px;
    margin: 0 0 1.2em 0;
    color: var(--text);
    background: linear-gradient(90deg, rgba(80,200,150,0.08), rgba(0,0,0,0));
    font-style: italic;
    border-radius: 6px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.01);
}
.content blockquote::before {
    content: '"';
    position: absolute;
    left: 8px;
    top: 6px;
    font-size: 42px;
    line-height: 1;
    color: rgba(80,200,150,0.25);
    font-family: serif;
}

.content pre, .content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', 'Courier New', monospace;
}
.content pre {
    background: linear-gradient(180deg, rgba(3,18,20,0.9), rgba(4,28,30,0.9));
    padding: 14px;
    border-radius: 8px;
    overflow: auto;
    color: #dfffe6;
    margin: 0 0 1em 0;
    border-left: 6px solid rgba(0,215,117,0.14);
    box-shadow: 0 6px 18px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.02);
}
.content code { background: rgba(255,255,255,0.03); padding: 3px 7px; border-radius:5px; border:1px solid rgba(95,182,255,0.04); }

/* Larger monospace block header for pre (optional small label) */
.content pre[data-lang]::before {
    content: attr(data-lang);
    display: inline-block;
    margin-bottom: 8px;
    color: rgba(159,191,220,0.9);
    font-size: 0.85em;
}

.content table { width:100%; border-collapse:collapse; margin: 0 0 1em 0; }
.content th, .content td { padding:10px 12px; border-bottom:1px solid rgba(95,182,255,0.04); color:var(--muted); }
.content th { color:var(--accent-2); text-align:left; }

.content img { max-width:100%; height:auto; display:block; margin: 0 0 1em 0; border-radius:6px; }

/* Callout boxes */
.content .callout { padding:12px; border-radius:6px; margin: 1em 0; }
.content .callout.note { background: rgba(47,137,255,0.03); border:1px solid rgba(47,137,255,0.04); color:var(--text); }
.content .callout.warn { background: rgba(255,120,80,0.03); border:1px solid rgba(255,120,80,0.06); color:#ffd6c6; }
.content .callout.success { background: rgba(80,220,120,0.03); border:1px solid rgba(80,220,120,0.06); color:#c7ffd6; }

/* Links inside content */
.content a { color: var(--accent-2); text-decoration: underline; }
.content a.button, .content a.btn { text-decoration: none; }

/* Utility: small muted meta text */
.content .meta { color: var(--muted); font-size: 0.92em; margin-bottom: 0.75em; }

@media (max-width: 800px){
    .content { padding:16px; }
    .content .page-inner { padding: 0 6px; }
}

.content .page-inner {
    max-width: 880px;
    margin: 0 auto;
    position: relative; /* stacking context so page-inner sits above the bg image */
    z-index: 3; /* ensure text is stacked above the background image */
    background: transparent !important;
}
    .content .page-inner {
        max-width: 880px;
        margin: 0 auto;
        position: relative; /* stacking context so page-inner sits above the bg image */
        z-index: 2; /* ensure text is stacked above the background image */
        background: transparent !important;
    }

/* Fallback removed: we now use an actual <img class="content-bg"> inside .content
   so it reliably appears above the panel background but behind page text. */

/* Content background image element (DOM img) placed in index.php */
.content .content-bg{
    position: absolute;
    top: 24px; /* slight vertical offset so heading remains visible */
    left: 50%;
    transform: translateX(-50%);
    /* Significantly larger decorative image but still constrained on huge screens */
    /* Minimum 420px, prefer 85% of the text zone, cap at 1400px */
    width: clamp(420px, 85%, 1400px);
    height: auto;
    /* allow it to fill most of the viewport height but keep space for header/footer */
    max-height: calc(100vh - 80px);
    object-fit: contain;
    opacity: 0.22; /* tuned so it doesn't overpower content */
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 0; /* behind the .page-inner content but above the base panel */
}
a { color: var(--accent-2); }
a:visited { color: #5aaedb; }

button, input[type="submit"], .button, .btn {
    background: linear-gradient(180deg, rgba(80,160,255,0.06), rgba(40,110,200,0.02));
    color: var(--text);
    border: 1px solid rgba(95,182,255,0.12);
    padding: 8px 12px;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}

button:hover, input[type="submit"]:hover, .button:hover, .btn:hover{
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(20,90,140,0.12);
    color: var(--accent-2);
}

input, textarea, select {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(95,182,255,0.06);
    color: var(--text);
    padding: 8px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .12s ease, box-shadow .12s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: rgba(95,182,255,0.18);
    box-shadow: 0 4px 18px rgba(30,100,160,0.06);
}

label { color: var(--muted); }

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00));
}

th, td {
    border-bottom: 1px solid rgba(95,182,255,0.03);
    padding: 10px 12px;
    text-align: left;
}

th { color: var(--accent-2); }

tbody tr:hover { background: rgba(47,137,255,0.03); }
tbody tr:nth-child(odd) { background: rgba(255,255,255,0.01); }

.copyable { cursor: pointer; display: inline-flex; gap:8px; align-items:center; }
.copyable .copy-btn { font-size:0.9em; padding:4px 6px; border-radius:4px; }

.table-filter { margin-bottom:10px; width:100%; max-width:420px; }

/* Utility: boxed panels like terminal windows */
.panel {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    padding: 12px;
    margin: 12px 0;
}

/* Responsive tweaks */
@media (max-width: 800px){
    .sidebar{ position: relative; width:100%; height:auto; }
    .content{ margin-left: 0; width:100%; padding:16px; }
}

/* Mobile / phone specific responsive changes */
@media (max-width: 800px){
    /* Off-canvas sidebar: hidden by default, slides in when body has .sidebar-open */
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
        transition: transform .28s ease;
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 20001;
        box-shadow: 8px 0 30px rgba(0,0,0,0.6);
        padding-top: 64px; /* leave room for topbar */
    }
    body.sidebar-open .sidebar { transform: translateX(0); }

    /* Dimmed overlay when sidebar open */
    .mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 20000; display: none; }
    body.sidebar-open .mobile-overlay { display: block; }

    /* Make main content full-width and scroll under the overlay while sidebar is open */
    .content { margin-left: 0; padding: 16px; z-index: 1; }

    /* Reduce font sizes slightly on phones for better fit */
    .content { font-size: 15px; }

    /* Show the mobile menu toggle and reduce topbar spacing */
    .mdt-topbar .mobile-menu { display: inline-flex; }
    .mdt-topbar { padding: 6px 10px; height: 48px; }

    /* Search dropdown should be full-width below topbar on phone */
    .search-dropdown { left: 8px !important; right: 8px !important; top: auto !important; bottom: auto; width: calc(100% - 16px) !important; max-height: 60vh; }
}

/* Hide mobile-menu toggle on desktop */
.mdt-topbar .mobile-menu { display: none; }
/* Make sure the mobile toggle is above other topbar elements and clickable */
.mdt-topbar .mobile-menu {
    z-index: 10002;
    position: relative;
    pointer-events: auto;
}

/* Accessibility: focus states */
a:focus, button:focus, input:focus, select:focus, textarea:focus{
    outline: 2px dashed rgba(57,255,20,0.25);
    outline-offset: 2px;
}

/* Button utilities */
.button, button, .btn {
    display: inline-block;
    padding: 6px 10px;
    background: rgba(57,255,20,0.04);
    border: 1px solid rgba(57,255,20,0.08);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    border-radius: 3px;
}

.button:hover, button:hover, .btn:hover {
    background: rgba(57,255,20,0.08);
    color: var(--accent);
}

.danger {
    background: rgba(255,0,0,0.06);
    border-color: rgba(255,0,0,0.12);
    color: #ff8b8b;
}

.danger:hover {
    background: rgba(255,0,0,0.12);
    color: #ff4d4d;
}

/* Alternate dark theme overrides: apply by adding `dark-theme` to the <body> */
.dark-theme {
    --bg: #00060a;
    --panel: #041018;
    --panel-2: #021017;
    --text: #dfe8eb; /* cooler off-white */
    --muted: #8fb7b0;
    --accent: #7fd0ff; /* less green, more cyan */
    --accent-2: #b3f0ff;
    --border: rgba(127,208,255,0.06);
}

/* Search dropdown and highlight styles */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 360px;
    overflow: auto;
    background: rgba(2,12,18,0.98);
    border: 1px solid rgba(95,182,255,0.06);
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    border-radius: 8px;
    z-index: 10001;
    padding: 8px;
    display: none;
}
.search-dropdown .search-empty{ color: var(--muted); padding: 10px; }
.search-results-list { list-style: none; margin: 0; padding: 0; }
.search-result { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius:6px; cursor: pointer; }
.search-result:hover { background: rgba(47,137,255,0.03); }
.search-result .sr-tag { font-family: monospace; font-size: 11px; color: var(--accent-2); border: 1px solid rgba(95,182,255,0.03); padding: 4px 6px; border-radius:4px; }
.search-result .sr-snippet { color: var(--muted); font-size: 13px; overflow: hidden; }
.search-highlight { background: rgba(255,235,120,0.16); padding: 0 2px; border-radius: 2px; color: var(--text); }
.search-active { outline: 2px solid rgba(0,215,117,0.12); background: rgba(0,215,117,0.02); border-radius:6px; padding:6px; }

/* Positioning helper: attach dropdown to the topbar right area */
.mdt-topbar .search-dropdown { right: 12px; }
