 :root {
      --bg: #0b0c10;
      --card: #111218;
      --text: #e6e7ea;
      --muted: #aeb3bd;
      --accent: #3ba1ff;
      --accent-2: #6cf0a6;
      --ring: #2b7fff44;
      --shadow: 0 10px 30px rgba(0,0,0,.35);
    }
    :root.light {
      --bg: #f7f8fb;
      --card: #ffffff;
      --text: #1b1d23;
      --muted: #5e6673;
      --accent: #0b57d0;
      --accent-2: #06a77d;
      --ring: #0b57d022;
      --shadow: 0 8px 24px rgba(0,0,0,.08);
    }
   :root.racing {
  --bg: #06090f;
  --card: #0a0f16;
  --text: #e9f7ff;
  --muted: #9db2c3;
  --accent: #00d2ff;   /* tweak to your exact racing color if you want */
  --accent-2: #00ffa3;
  --ring: #00d2ff33;
  --shadow: 0 10px 30px rgba(0,210,255,.12);
}
:root.kokscity {
  --bg: #0a57a6;
  --card: #228b22;
  --text: #f7f7fb;
  --muted: #fff;
  --accent: #ff7a00;    /* <- tweak this to your exact KoksCity color */
  --accent-2: #ffd166;
  --ring: #ff7a0033;
  --shadow: 0 10px 30px rgba(255,122,0,.15);
}


.theme-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* highlight the active button */
.theme[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 6px var(--ring);
}

/* “pressed” look for active theme buttons */
.theme[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 6px var(--ring);
}
    html, body { height: 100%; }
    body {
      margin: 0;
      font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
      background: var(--bg);
      color: var(--text);
      transition: background .2s ease, color .2s ease;
    }
    .wrap { max-width: 1050px; margin: 0 auto; padding: 28px 18px 60px; }
    header { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
    .title { display:flex; align-items: baseline; gap: 10px; }
    h1 { margin: 0; font-size: clamp(1.4rem, 2.4vw, 2rem); letter-spacing: .2px; }
    .updated { color: var(--muted); font-size: .95rem; }

    .controls { display: grid; grid-template-columns: 1fr auto; gap: 12px; margin-top: 18px; align-items: center; }
    .search { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); border: 1px solid transparent; }
    .search:focus-within { border-color: var(--ring); box-shadow: 0 0 0 6px var(--ring); }
    .search input { flex: 1; background: transparent; border: 0; color: var(--text); font-size: 1rem; outline: none; }
    .search svg { width: 20px; height: 20px; opacity: .7; }

    .filter { display:flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
    .chip { border: 1px solid #ffffff1a; background: var(--card); color: var(--text); padding: 8px 12px; border-radius: 999px; font-size: .95rem; cursor: pointer; box-shadow: var(--shadow); }
    .chip[aria-pressed="true"] { border-color: var(--accent); background: linear-gradient(0deg, #ffffff08, #ffffff00); }

    .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 20px; }
    .card { display:block; text-decoration: none; color: inherit; background: var(--card); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); border: 1px solid #ffffff12; transition: transform .12s ease, border-color .12s ease; }
    .card:hover { transform: translateY(-2px); border-color: var(--accent); }
    .card h3 { margin: 0 0 6px; font-size: 1.05rem; }
    .card .url { color: var(--muted); font-size: .9rem; word-break: break-all; }
    .badge { display:inline-block; font-size: .75rem; padding: 3px 8px; border-radius: 999px; border: 1px solid #ffffff1a; background: #ffffff08; margin-bottom: 10px; }

    section { margin-top: 28px; }
    section h2 { font-size: 1.15rem; font-weight: 700; margin: 4px 0 12px; color: var(--muted); }

    .row { display:flex; gap: 14px; align-items:center; justify-content: space-between; margin-top: 24px; }
    .theme { border-radius: 12px; background: var(--card); border: 1px solid #ffffff1a; padding: 8px 12px; cursor: pointer; }
    .kicker { color: var(--muted); font-size: .95rem; }
    footer { margin-top: 40px; color: var(--muted); font-size: .9rem; text-align: center; }

    @media (max-width: 640px) {
      .controls { grid-template-columns: 1fr; }
      .filter { justify-content: flex-start; }
    }
  
    /* --- Extras: featured row, icons, status, link checker --- */
    .featured { margin-top: 24px; }
    .featured-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 4px; }
    .featured-grid .card { min-width: 260px; border-color: #ffffff22; }
    .card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
    .icon { width: 28px; height: 28px; border-radius: 8px; border: 1px solid #ffffff22; object-fit: cover; background: #ffffff08; flex: 0 0 28px; }
    .icon-fallback { width: 28px; height: 28px; border-radius: 8px; border: 1px solid #ffffff22; background: #ffffff10; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
    .meta { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
    .status-dot { width: 10px; height: 10px; border-radius: 999px; border: 1px solid #00000055; display: inline-block; }
    .status-online { background: #1db954; }
    .status-slow { background: #f0ad4e; }
    .status-down { background: #dc3545; }
    .status-unknown { background: #6c757d; }
    .latency { color: var(--muted); font-size: .85rem; }

    .tools { display:flex; gap: 10px; flex-wrap: wrap; }
    .btn { border: 1px solid #ffffff1a; background: var(--card); color: var(--text); padding: 8px 12px; border-radius: 10px; cursor: pointer; box-shadow: var(--shadow); font-size: .95rem; }
    .btn:disabled { opacity: .6; cursor: not-allowed; }

    .check-output { margin-top: 10px; background: var(--card); border: 1px solid #ffffff1a; border-radius: 12px; padding: 10px; max-height: 280px; overflow: auto; }
    .check-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
    .check-table th, .check-table td { padding: 6px 8px; border-bottom: 1px solid #ffffff12; text-align: left; }
    .check-table tr:last-child td { border-bottom: 0; }

    details.seo { margin-top: 20px; background: var(--card); border: 1px solid #ffffff1a; border-radius: 12px; padding: 12px 14px; }
    details.seo summary { cursor: pointer; font-weight: 700; }
    .codebox { width: 100%; min-height: 140px; border-radius: 8px; border: 1px solid #ffffff22; background: #0f1117; color: #c9d1d9; padding: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
    .seo-actions { display:flex; gap: 8px; margin: 6px 0 12px; }
    .note { color: var(--muted); font-size: .9rem; }

    /* Collapsible update cards */
.update-card { padding: 0; }                 /* override .card padding */
.update-card summary {
  display: flex; align-items: center; gap: 10px;
  list-style: none; cursor: pointer; padding: 16px;
}
.update-card summary::-webkit-details-marker { display: none; }
.update-card summary:focus { outline: none; }
.update-card[open] { border-color: var(--accent); }

.update-card .summary-title { font-size: 1.05rem; margin: 0; }
.update-card .summary-meta { margin-left: auto; color: var(--muted); font-size: .9rem; }

/* tiny chevron */
.update-card summary::after {
  content: ""; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); margin-left: 8px; transition: transform .15s ease;
  opacity: .7;
}
.update-card[open] summary::after { transform: rotate(45deg); }

.update-card .update-body {
  padding: 0 16px 16px;
  border-top: 1px solid #ffffff12; margin-top: 6px; color: var(--muted);
}

#updatesLatestGrid,
#updatesAllGrid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: visible;        /* no sideways scroll */
  grid-auto-flow: initial;  /* neutralize inherited grid settings */
  grid-auto-columns: initial;
}

/* Undo the min-width from .featured-grid .card */
#updatesLatestGrid .card,
#updatesAllGrid .card {
  min-width: 0;
}

/* updates with media */
.update-card { padding: 0; }
.update-card .update-body { padding: 0 16px 16px; border-top: 1px solid #ffffff12; margin-top: 6px; }
.update-media { margin: 10px 0; }
.update-media img { max-width: 100%; height: auto; display: block; border-radius: 10px; }
.update-media figcaption { text-align: center; font-size: .85rem; color: var(--muted); margin-top: 6px; }

/* Force readable button text in all themes (incl. Safari) */
.theme,
.btn {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text); /* Safari */
  background: var(--card);
  border: 1px solid #ffffff1a;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 600;
  line-height: 1.1;
}

/* Keep pressed highlight but don't change text color */
.theme[aria-pressed="true"],
.btn[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 6px var(--ring);
}

/* Optional: clearer hover in light mode */
:root.light .theme:hover,
:root.light .btn:hover {
  border-color: var(--accent);
}

/* If an OS focus ring obscures text, use our own */
.theme:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--ring);
}

.cycle-list { margin: 0; padding: 0; display: grid; gap: 10px; }
.cycle-item { 
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  background: var(--card); border: 1px solid #ffffff1a; border-radius: 12px; padding: 12px;
}
.cycle-item dt { margin: 0; }
.cycle-item dd { margin: 0; color: var(--muted); }

/* clickable subject “links” that match your buttons */
.cycle-link {
  background: transparent; border: none; padding: 0; cursor: pointer;
  color: var(--text); font: inherit; font-weight: 700;
}
.cycle-link:hover, .cycle-link:focus-visible { text-decoration: underline; outline: none; }
