:root {
    --bg: #0b132b;
    --card: #1c2541;
    --muted: #3a506b;
    --accent: #5bc0be;
    --accent-2: #ffd166;
    --text: #eaf6ff;
    --danger: #ff6b6b;
}
* {
    box-sizing: border-box;
}
html {
    font-size: 16px;
}
body {
    margin: 0;
    font-family:
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Arial,
        sans-serif;
    background: var(--bg);
    color: var(--text);
}
a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
.header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(12, 20, 43, 0.9);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.brand {
    font-weight: 700;
    letter-spacing: 0.3px;
}
.nav a {
    margin-left: 1rem;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}
.card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    margin-bottom: 1rem;
}
h1,
h2,
h3 {
    margin: 0.25rem 0 1rem;
}
.muted {
    color: #c7d7ea;
    opacity: 0.8;
}
.btn {
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    color: var(--text);
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
}
.btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
}
.btn.primary {
    background: linear-gradient(180deg, var(--accent), #3aa9a7);
    color: #052024;
    border-color: transparent;
}
.btn.warning {
    background: var(--accent-2);
    color: #3b2a00;
    border-color: transparent;
}
.btn.danger {
    background: var(--danger);
    color: white;
    border-color: transparent;
}
input[type="text"],
input[type="password"],
input[type="datetime-local"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}
label {
    display: block;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}
.row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th,
td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
tr:hover {
    background: rgba(255, 255, 255, 0.03);
}
.alert {
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    background: rgba(255, 209, 102, 0.15);
    border: 1px solid rgba(255, 209, 102, 0.45);
    color: #ffe6a1;
}
.tag {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.tag.lead {
    background: rgba(91, 192, 190, 0.15);
    border-color: rgba(91, 192, 190, 0.45);
}
.tag.support {
    background: rgba(255, 255, 255, 0.06);
}
.footer {
    padding: 2rem 1rem;
    text-align: center;
    color: #c7d7ea;
    opacity: 0.6;
} /* Two-column layout for case page */
.two-col {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); /* main | sidebar */
    gap: 1rem;
    align-items: start;
}
.main > .card,
.sidebar > .card {
    margin-bottom: 1rem;
}
@media (max-width: 1024px) {
    .row {
        grid-template-columns: 1fr;
    }
    .two-col {
        grid-template-columns: 1fr;
    }
}


/* ===== NAV: desktop + mobile overlay (stable on iOS Safari) ===== */

/* General */
.menu-toggle { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* Desktop (≥1025px): show desktop nav, hide burger & mobile wrap */
@media (min-width: 1025px) {
  .nav-desktop { display: flex !important; align-items: center; gap: 1rem; }
  .menu-toggle { display: none !important; }
  .nav-mobile-wrap { display: none !important; }
}

/* Mobile (≤1024px): burger + overlay menu */
@media (max-width: 1024px) {
  .nav-desktop { display: none !important; }

  .menu-toggle {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.15);
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
    color: inherit;
    padding: .5rem; border-radius: 10px; cursor: pointer; z-index: 10002;
  }

  /* Mobile overlay wrapper: off by default, on when body.nav-open */
  .nav-mobile-wrap {
    position: fixed; inset: 0; z-index: 10000; pointer-events: none;
  }
  .nav-mobile-wrap .nav-mobile {
    position: absolute; top: 56px; /* just below sticky header */
    left: 0; right: 0;
    display: none;
    background: rgba(12,20,43,.98);
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding: .5rem 1rem 1rem;
    flex-direction: column; gap: .25rem;
    pointer-events: auto;
  }
  .nav-mobile-wrap .nav-scrim {
    position: fixed; inset: 0; background: rgba(0,0,0,.3);
    display: none; border: 0; padding: 0; margin: 0;
    pointer-events: auto;
  }

  /* When open, show panel + scrim */
  body.nav-open .nav-mobile-wrap .nav-mobile { display: flex !important; }
  body.nav-open .nav-mobile-wrap .nav-scrim { display: block !important; }
}

/* Keep header as the top bar */
.header {
  position: sticky; top: 0; z-index: 10001; /* above page, below burger/scrim */
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}

/* ===== Fancy Mobile Menu Panel ===== */
@media (max-width: 1024px) {
  :root { --header-h: 56px; }

  /* Overlay root & scrim */
  .nav-mobile-wrap { position: fixed; inset: 0; z-index: 10000; pointer-events: none; }
  .nav-scrim {
    position: fixed; inset: 0; background: rgba(0,0,0,0);
    display: block; border: 0; margin: 0; padding: 0;
    pointer-events: none; transition: background .2s ease;
  }

  /* Panel (card) */
  .nav-mobile-panel {
    position: absolute; top: calc(var(--header-h) + env(safe-area-inset-top));
    left: 8px; right: 8px;
    background: var(--card);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.35);
    overflow: hidden;
    max-height: calc(100vh - var(--header-h) - 16px - env(safe-area-inset-bottom));
    transform: translateY(-8px);
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
    pointer-events: auto; /* keep panel interactive even when wrap is pointer-blocked */
  }

  /* Panel header */
  .nav-mobile-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .75rem 1rem; 
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  }
  .nav-mobile-header .mobile-title { font-weight: 600; letter-spacing: .3px; }
  .nav-close {
    background: transparent; color: var(--text);
    border: 1px solid rgba(255,255,255,.2); border-radius: 10px;
    padding: .35rem .6rem; cursor: pointer;
  }

  /* Links list */
  .nav-mobile {
    display: flex; flex-direction: column; gap: .25rem;
    padding: .5rem; overflow: auto; -webkit-overflow-scrolling: touch;
    max-height: inherit;
  }
  .nav-mobile a {
    display: block; padding: .9rem 1rem; border-radius: 12px;
    text-decoration: none; color: var(--text);
  }
  .nav-mobile a:hover { background: rgba(255,255,255,.06); }
  .nav-mobile a:active { background: rgba(255,255,255,.10); }

  /* Open state (body.nav-open set by JS) */
  body.nav-open .nav-mobile-panel {
    opacity: 1; transform: translateY(0); visibility: visible;
    transition: opacity .2s ease, transform .2s ease, visibility 0s;
  }
  body.nav-open .nav-scrim {
    background: rgba(0,0,0,.35); pointer-events: auto;
  }

  /* Burger ergonomics */
  .menu-toggle { -webkit-tap-highlight-color: transparent; touch-action: manipulation; z-index: 10002; }
}

/* Keep header above page, below burger/scrim */
.header { position: sticky; top: 0; z-index: 10001; }

/* --- Un-hide nav links inside the new mobile panel --- */
@media (max-width:1024px){
  /* The older ".js .nav {display:none}" is too broad. Force the panel's nav visible. */
  .js .nav-mobile { display: flex !important; }         /* show the list */
  .js .nav-mobile a { display: block; padding: .9rem 1rem; }
}