  :root {
    --bg: #050a06;
    --panel: #071009;
    --green: #39ff8f;
    --green-bright: #7dffb8;
    --green-mid: #2ce88f;
    --green-dim: #1c6b45;
    --green-faint: #0e3d28;

    /* red phosphor — risks only */
    --red: hsl(0, 100%, 61%);
    --red-bright: hsl(1, 100%, 74%);
    --red-mid: hsl(6, 80%, 54%);
    --red-dim: hsl(5, 58%, 27%);
    --red-faint: hsl(7, 63%, 15%);

    /* amber phosphor — difficulty */
    --amber: hsl(35, 100%, 61%);
    --amber-bright: hsl(36, 100%, 74%);
    --amber-mid: hsl(41, 80%, 54%);
    --amber-dim: hsl(40, 58%, 27%);
    --amber-faint: hsl(42, 63%, 15%);

    /* cyan phosphor — info/stats */
    --cyan: hsl(190, 100%, 61%);
    --cyan-bright: hsl(191, 100%, 74%);
    --cyan-mid: hsl(196, 80%, 54%);
    --cyan-dim: hsl(195, 58%, 27%);
    --cyan-faint: hsl(197, 63%, 15%);

    /* blue reserved — not in use yet */

    --text: #b9f5d3;
    --text-dim: #5d9c7d;
  }

  * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }

  html,
  body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Space Mono', monospace;
  }

  body {
    min-height: 100vh;
    padding-bottom: 74px;
    position: relative;

    background-image: url("background.png");
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: 100% auto;
    background-position: top center;
    background-color: #020703;
  }

  @media (min-width:760px) {
    body {
      padding-bottom: 0;
    }
  }

  /* scanlines + vignette overlay */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
    background:
      repeating-linear-gradient(0deg, rgba(57, 255, 143, 0.035) 0px, rgba(57, 255, 143, 0.035) 1px, transparent 1px, transparent 3px),
      radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
  }

  body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 998;
    background: linear-gradient(rgba(57, 255, 143, 0.05), transparent 3%);
    animation: scan 6s linear infinite;
  }

  @keyframes scan {
    0% {
      transform: translateY(-100%);
    }

    100% {
      transform: translateY(100vh);
    }
  }

  .mono-num {
    font-family: 'VT323', monospace;
  }

  header {
    position: relative;
    z-index: 1;
    padding: 20px 16px 14px;
    border-bottom: 1px solid var(--green-dim);
  }

  .top-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
  }

  .logo {
    max-width: clamp(90px, 22vw, 140px);
    filter: saturate(160%) brightness(160%)
  }

  /* nav — bottom tabs on phone, top strip on desktop */
  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    /* background:var(--panel); border-top:1px solid var(--green-dim); */
    background: #0f0f0f;
  }

  .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px 10px;
    text-decoration: none;
    color: var(--text-dim);
    font-family: 'VT323', monospace;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-top: 2px solid transparent;
  }

  .nav-item .nav-icon {
    font-size: 19px;
    line-height: 1;
    filter: grayscale(1) brightness(1.3);
  }

  .nav-item.active {
    color: var(--green-bright);
    border-top-color: var(--green);
    text-shadow: 0 0 6px rgba(57, 255, 143, 0.5);
  }

  .nav-item.active .nav-icon {
    filter: none;
  }

  .nav-item:active {
    background: var(--green-faint);
  }

  @media (min-width:760px) {
    .nav {
      position: static;
      border-top: none;
      border-bottom: 1px solid var(--green-dim);
      justify-content: center;
      gap: 26px;
    }

    .nav-item {
      flex: 0 0 auto;
      flex-direction: row;
      padding: 10px 6px;
      font-size: 15px;
      border-top: none;
      border-bottom: 2px solid transparent;
    }

    .nav-item.active {
      border-bottom-color: var(--green);
    }

    .nav-item .nav-icon {
      font-size: 15px;
    }
  }

  .titlebar {
    display: flex;
    justify-content: center;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    text-align: center;
    font-size: 13px;
    letter-spacing: 1px;
  }

  .titlebar .brackets {
    color: var(--green-mid);
  }

  .titlebar .file-stamp {
    color: var(--text-dim);
    font-size: 12px;
  }

  h1 {
    font-family: 'VT323', monospace;
    font-size: 34px;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin: 8px 0 2px;
    color: var(--green-bright);
    text-shadow: 0 0 8px rgba(57, 255, 143, 0.6), 0 0 2px rgba(57, 255, 143, 0.8);
  }

  .meta-row {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    margin-top: 6px;
  }

  .meta-row span b {
    color: var(--green);
    font-weight: 400;
  }

  .filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-top: 14px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: 0 0 auto;
    font-family: 'VT323', monospace;
    font-size: 16px;
    letter-spacing: 1px;
    padding: 4px 12px;
    border: 1px solid var(--green-dim);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    white-space: nowrap;
  }

  .chip.active {
    background: var(--green-faint);
    border-color: var(--green);
    color: var(--green-bright);
  }

  main {
    position: relative;
    z-index: 1;
    padding: 16px 12px 0;
    max-width: 640px;
    margin: 0 auto;
  }

  .count {
    font-size: 12px;
    color: var(--text-dim);
    margin: 2px 4px 14px;
    letter-spacing: 0.5px;
  }

  .panel {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--green-faint);
    margin-bottom: 14px;
    background-image:
      repeating-linear-gradient(0deg, rgba(57, 255, 143, 0.025) 0px, rgba(57, 255, 143, 0.025) 1px, transparent 1px, transparent 22px),
      repeating-linear-gradient(90deg, rgba(57, 255, 143, 0.025) 0px, rgba(57, 255, 143, 0.025) 1px, transparent 1px, transparent 22px);
  }

  .panel.flagged {
    border-color: var(--green-mid);
  }

  .corner {
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: var(--green-mid);
  }

  .corner.tl {
    top: -1px;
    left: -1px;
    border-top: 2px solid;
    border-left: 2px solid;
  }

  .corner.tr {
    top: -1px;
    right: -1px;
    border-top: 2px solid;
    border-right: 2px solid;
  }

  .corner.bl {
    bottom: -1px;
    left: -1px;
    border-bottom: 2px solid;
    border-left: 2px solid;
  }

  .corner.br {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid;
    border-right: 2px solid;
  }

  .card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
  }

  .card-title-wrap {
    flex: 1;
    min-width: 0;
  }

  .file-id {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: var(--green-mid);
    letter-spacing: 1px;
    display: block;
  }

  .card-title {
    font-family: 'VT323', monospace;
    font-size: 21px;
    letter-spacing: 1px;
    color: var(--green-bright);
    text-transform: uppercase;
    line-height: 1.2;
    text-shadow: 0 0 5px rgba(57, 255, 143, 0.35);
  }

  .card-region {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 3px;
    letter-spacing: 0.5px;
  }

  .chevron {
    color: var(--text-dim);
    font-family: 'VT323', monospace;
    font-size: 18px;
    transition: transform .2s ease;
  }

  .panel.open .chevron {
    transform: rotate(180deg);
    color: var(--green);
  }

  .badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
  }

  .badge {
    font-family: 'VT323', monospace;
    font-size: 14px;
    letter-spacing: 0.5px;
    padding: 1px 7px;
    border: 1px solid var(--green-dim);
    color: var(--text-dim);
  }

  .badge.on {
    border-color: var(--green);
    color: var(--green-bright);
  }

  .badge-risk.on {
    border-color: var(--red);
    color: var(--red-bright);
    text-shadow: 0 0 5px rgba(255, 77, 77, 0.35);
  }

  .diff-meter {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
  }

  .diff-label {
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 1px;
  }

  .diff-meter.diff-easy .diff-label { color: var(--green-mid); }
  .diff-meter.diff-medium .diff-label { color: var(--amber-mid); }
  .diff-meter.diff-hard .diff-label { color: var(--red-mid); }

  .diff-bars {
    display: flex;
    gap: 3px;
  }

  .diff-bars i {
    width: 8px;
    height: 12px;
    background: var(--green-faint);
    display: inline-block;
  }

  .diff-meter.diff-easy .diff-bars i.lit {
    background: var(--green);
    box-shadow: 0 0 4px rgba(57, 255, 143, 0.7);
  }

  .diff-meter.diff-medium .diff-bars i.lit {
    background: var(--amber);
    box-shadow: 0 0 4px hsla(35, 100%, 61%, 0.7);
  }

  .diff-meter.diff-hard .diff-bars i.lit {
    background: var(--red);
    box-shadow: 0 0 4px hsla(0, 100%, 61%, 0.7);
  }

  .card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }

  .panel.open .card-body {
    max-height: 700px;
  }

  .card-body-inner {
    padding: 0 14px 16px;
    border-top: 1px dashed var(--green-faint);
    margin-top: 4px;
    padding-top: 12px;
  }

  .desc {
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
    margin: 0 0 14px;
  }

  .section {
    margin-bottom: 14px;
  }

  .section-label {
    font-family: 'VT323', monospace;
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--green-mid);
    margin-bottom: 6px;
  }

  .section-label::before {
    content: "[ ";
    color: var(--green-dim);
  }

  .section-label::after {
    content: " ]";
    color: var(--green-dim);
  }

  .section-risks .section-label {
    color: var(--red-mid);
  }

  .section-risks .section-label::before,
  .section-risks .section-label::after {
    color: var(--red-dim);
  }

  .section-info .section-label {
    color: var(--cyan);
    text-shadow: 0 0 5px rgba(77, 219, 255, 0.35);
  }

  .section-info .section-label::before,
  .section-info .section-label::after {
    color: var(--cyan-mid);
  }

  .chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .risk-chip,
  .access-chip {
    font-family: 'VT323', monospace;
    font-size: 14px;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border: 1px solid var(--green-dim);
    color: var(--text);
  }

  .risk-chip {
    border-color: var(--red-mid);
    color: var(--red-bright);
    text-shadow: 0 0 5px rgba(255, 77, 77, 0.3);
  }

  .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
  }

  .info-item {
    font-size: 11.5px;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dotted var(--green-faint);
    padding-bottom: 4px;
  }

  .info-item span.val {
    color: var(--cyan);
    font-weight: 700;
    text-shadow: 0 0 4px rgba(77, 219, 255, 0.3);
  }

  .notes-box {
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.6;
    background: rgba(57, 255, 143, 0.03);
    border: 1px solid var(--green-faint);
    padding: 8px 10px;
  }

  .empty {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: var(--text-dim);
    letter-spacing: 1px;
  }

  .btn-row {
    margin-top: 14px;
  }

  .map-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 1px solid var(--green);
    color: var(--green-bright);
    text-decoration: none;
    font-family: 'VT323', monospace;
    font-size: 16px;
    letter-spacing: 1px;
    padding: 7px 14px;
  }

  .map-btn:active {
    background: var(--green-faint);
  }

  footer {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--text-dim);
    font-family: 'VT323', monospace;
    font-size: 14px;
    letter-spacing: 2px;
    margin-top: 22px;
    padding: 0 20px;
    text-transform: uppercase;
  }