:root {
      color-scheme: dark;
      --bg: #0b0d0e;
      --panel: #141718;
      --panel2: #1f2424;
      --line: #303737;
      --text: #edf4ee;
      --muted: #9eada5;
      --green: #5ee08d;
      --yellow: #f4cc5f;
      --orange: #ef9957;
      --red: #ef6f6c;
      --blue: #7bb7e8;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      background: var(--bg);
      color: var(--text);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
      letter-spacing: 0;
    }
    header {
      padding: 18px 22px;
      border-bottom: 1px solid var(--line);
      background: #101313;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      position: sticky;
      top: 0;
      z-index: 2;
    }
    h1 { margin: 0; font-size: 20px; font-weight: 750; }
    .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
    .header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    main { padding: 18px; max-width: 1560px; margin: 0 auto; }
    .feed-status { margin-bottom: 12px; padding: 10px 13px; border: 1px solid; border-radius: 8px; font-size: 13px; }
    .feed-status.fallback { color: var(--yellow); border-color: rgba(244,204,95,.5); background: rgba(244,204,95,.08); }
    .feed-status.error { color: var(--red); border-color: rgba(239,111,108,.55); background: rgba(239,111,108,.09); }
    .sdr-indicator { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; vertical-align: middle; background: var(--muted); opacity: .4; transition: background-color .4s ease, opacity .4s ease, box-shadow .4s ease; }
    .sdr-indicator.on { background: var(--green); opacity: 1; box-shadow: 0 0 5px rgba(94,224,141,.65); }
    .local-live-dot { color: var(--green); font-size: 8px; margin-right: 4px; vertical-align: middle; }
    .grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
    .card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 14px;
      min-width: 0;
    }
    .metric { color: var(--muted); font-size: 12px; text-transform: uppercase; }
    .value { font-size: 27px; font-weight: 820; margin-top: 4px; }
    .section { margin-top: 16px; }
    .section h2 { font-size: 15px; margin: 0 0 10px; color: #d8eadf; }
    table { width: 100%; border-collapse: collapse; table-layout: fixed; }
    th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
    th { color: var(--muted); font-size: 12px; font-weight: 650; }
    td { font-size: 13px; overflow-wrap: anywhere; }
    .pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 32px;
      padding: 2px 7px;
      border-radius: 999px;
      font-weight: 820;
      font-size: 12px;
    }
    .S { background: rgba(239,111,108,.18); color: var(--red); }
    .G { background: rgba(168,85,247,.20); color: #c084fc; }
    .A { background: rgba(239,153,87,.18); color: var(--orange); }
    .B { background: rgba(244,204,95,.18); color: var(--yellow); }
    .tracking { background: rgba(123,183,232,.16); color: var(--blue); }
    .muted { color: var(--muted); }
    .plane-link {
      color: var(--text);
      font-weight: 700;
      text-decoration: none;
      border-bottom: 1px solid rgba(123,183,232,.55);
    }
    .plane-link:hover { color: var(--blue); border-bottom-color: var(--blue); }
    .reasons { color: #d4ded8; font-size: 12px; line-height: 1.35; }
    .transit-countdown {
      color: var(--yellow);
      font-size: 12px;
      font-weight: 820;
      line-height: 1.35;
      margin: 2px 0 4px;
    }
    .badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; }
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      border: 1px solid var(--line);
      background: rgba(255,255,255,.04);
      color: #dfece5;
      border-radius: 999px;
      padding: 2px 7px;
      font-size: 11px;
      font-weight: 760;
      white-space: nowrap;
    }
    .badge.transit { border-color: rgba(244,204,95,.55); background: rgba(244,204,95,.14); color: var(--yellow); }
    .badge.moon { border-color: rgba(123,183,232,.55); background: rgba(123,183,232,.14); color: var(--blue); }
    .badge.rze { border-color: rgba(79,211,154,.45); background: rgba(79,211,154,.12); color: var(--green); }
    .badge.bad { border-color: rgba(239,111,108,.45); background: rgba(239,111,108,.12); color: var(--red); }
    .badge.good { border-color: rgba(79,211,154,.45); background: rgba(79,211,154,.12); color: var(--green); }
    .badge.special { border-color: rgba(239,153,87,.55); background: rgba(239,153,87,.12); color: var(--orange); }
    .light-score {
      display: inline-flex;
      min-width: 38px;
      justify-content: center;
      border-radius: 999px;
      padding: 1px 7px;
      margin-right: 5px;
      font-size: 11px;
      font-weight: 820;
      border: 1px solid var(--line);
    }
    .light-good { color: var(--green); background: rgba(94,224,141,.13); border-color: rgba(94,224,141,.45); }
    .light-mid { color: var(--yellow); background: rgba(244,204,95,.12); border-color: rgba(244,204,95,.42); }
    .light-bad { color: var(--red); background: rgba(239,111,108,.12); border-color: rgba(239,111,108,.45); }
    .photo-cell { line-height: 1.35; }
    .photo-best { margin-top: 6px; color: #e3eee7; }
    .barline { display: grid; grid-template-columns: 96px 1fr 44px; gap: 8px; align-items: center; font-size: 13px; }
    .bar { height: 8px; background: var(--panel2); border-radius: 999px; overflow: hidden; }
    .fill { height: 100%; background: var(--green); }
    .small { font-size: 12px; color: var(--muted); }
    .stats-section {
      background: transparent;
      border: 0;
      padding: 0;
    }
    .subhead { margin-top: 16px !important; }
    .stats-lab {
      display: grid;
      grid-template-columns: 1.15fr .85fr 1fr;
      gap: 12px;
      align-items: stretch;
    }
    .stats-panel {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 14px;
      min-width: 0;
    }
    .stats-panel-wide { grid-column: 1 / -1; }
    .insight-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 10px;
    }
    .insight-card {
      background: rgba(255,255,255,.025);
      border: 1px solid rgba(255,255,255,.06);
      border-radius: 8px;
      padding: 10px;
      min-width: 0;
    }
    .insight-value {
      font-size: 20px;
      font-weight: 820;
      margin: 2px 0;
      overflow-wrap: anywhere;
    }
    .hour-chart {
      min-height: 176px;
      display: grid;
      grid-template-columns: repeat(24, minmax(7px, 1fr));
      align-items: end;
      gap: 4px;
      margin-top: 10px;
    }
    .hour-column {
      height: 150px;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      align-items: stretch;
      gap: 5px;
      min-width: 0;
    }
    .hour-fill {
      min-height: 5px;
      border-radius: 999px 999px 3px 3px;
      background: linear-gradient(180deg, var(--green), var(--blue));
      border: 1px solid rgba(255,255,255,.08);
    }
    .hour-label {
      color: var(--muted);
      font-size: 10px;
      text-align: center;
    }
    .quality-grid {
      display: grid;
      gap: 12px;
      margin-top: 10px;
    }
    .quality-block .barline { grid-template-columns: 86px 1fr 40px; }
    .record-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-top: 10px;
    }
    .record-card {
      border: 1px solid rgba(255,255,255,.07);
      background: rgba(255,255,255,.025);
      border-radius: 8px;
      padding: 10px;
      min-width: 0;
      line-height: 1.35;
    }
    .record-card.empty { color: var(--muted); }
    .record-title {
      color: var(--muted);
      font-size: 12px;
      text-transform: uppercase;
      margin-bottom: 6px;
    }
    .record-score { margin-bottom: 5px; }
    .toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
    .tabbtn {
      border: 1px solid var(--line);
      background: var(--panel2);
      color: var(--text);
      border-radius: 8px;
      padding: 7px 10px;
      font: inherit;
      font-size: 13px;
      cursor: pointer;
    }
    .tabbtn.active { border-color: var(--green); color: var(--green); }
    .notifybtn { min-height: 34px; }
    .notifybtn.enabled { border-color: var(--green); color: var(--green); }
    .range-toolbar {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
    }
    .range-field {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: var(--muted);
      font-size: 12px;
    }
    .range-field input {
      border: 1px solid var(--line);
      background: #0f1212;
      color: var(--text);
      border-radius: 8px;
      padding: 7px 9px;
      font: inherit;
      font-size: 13px;
      color-scheme: dark;
    }
    .filter {
      margin-left: auto;
      min-width: 220px;
      border: 1px solid var(--line);
      background: #0f1212;
      color: var(--text);
      border-radius: 8px;
      padding: 8px 10px;
      font: inherit;
      font-size: 13px;
    }
    .stats-summary { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
    .stat-name { display: flex; gap: 8px; align-items: center; }
    .rank { color: var(--muted); width: 26px; flex: 0 0 auto; text-align: right; }
    .detail-stat-table th:nth-child(1) { width: 72px; }
    .detail-stat-table th:nth-child(2) { width: 23%; }
    .detail-stat-table th:nth-child(3) { width: 74px; }
    .detail-stat-table th:nth-child(4) { width: 74px; }
    .stat-examples { display: grid; gap: 7px; }
    .stat-example {
      padding-bottom: 7px;
      border-bottom: 1px solid rgba(255,255,255,.06);
      line-height: 1.35;
    }
    .stat-example:last-child {
      padding-bottom: 0;
      border-bottom: 0;
    }
    .sharebar { height: 7px; background: var(--panel2); border-radius: 999px; overflow: hidden; margin-top: 4px; }
    .sharefill { height: 100%; background: var(--blue); }
    .table-head { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 10px; }
    .table-head h2 { margin: 0; }
    .sort-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
    .sort-label { color: var(--muted); font-size: 12px; }
    @media (max-width: 1100px) {
      .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .stats-lab { grid-template-columns: 1fr; }
      .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      header { align-items: flex-start; flex-direction: column; }
      .header-actions { width: 100%; justify-content: space-between; }
      .filter { width: 100%; margin-left: 0; }
      .range-field { width: 100%; }
      .range-field input { flex: 1; min-width: 0; }
    }
    @media (max-width: 680px) {
      main { padding: 10px; }
      .grid { grid-template-columns: 1fr; }
      .insight-grid, .record-grid { grid-template-columns: 1fr; }
      .hour-chart { gap: 2px; }
      .hour-label { font-size: 9px; }
      th:nth-child(6), td:nth-child(6), th:nth-child(7), td:nth-child(7) { display: none; }
    }
