/* odin-htmx-starter — one stylesheet, driven by variables.
   The whole theme is two token sets (dark default, light override). Components
   read tokens, never raw colours, so re-theming is local to :root. */

/* ---- tokens ----------------------------------------------------------- */

:root {
  --violet: #7c5cff;
  --indigo: #5b8cff;
  --cyan:   #22d3ee;
  --pink:   #f472d0;
  --green:  #34d399;
  --amber:  #fbbf24;
  --red:    #fb7185;
  --on-accent: #fff;   /* text/icon on accent-gradient surfaces; light-accent schemes flip it dark */

  --grad: linear-gradient(135deg, var(--violet), var(--indigo) 55%, var(--cyan));
  --grad-soft: linear-gradient(135deg, color-mix(in oklab, var(--violet) 22%, transparent), color-mix(in oklab, var(--cyan) 22%, transparent));

  --bg:      #0b0d17;
  --bg-2:    #11142100;
  --surface: #151a2c;
  --surface-2: #1b2138;
  --elevated: #20274180;
  --line:    #2a3252;
  --line-2:  #353f66;

  --text:    #eef1fb;
  --muted:   #9aa3c4;
  --faint:   #6b769e;

  --ok:   var(--green);
  --warn: var(--amber);
  --bad:  var(--red);

  --radius:   14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --shadow:   0 18px 40px -22px rgba(4, 6, 18, .8);
  --shadow-lg: 0 30px 70px -30px rgba(3, 5, 16, .9);
  --ring: 0 0 0 3px color-mix(in oklab, var(--violet) 40%, transparent);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --spring: cubic-bezier(.2, .9, .25, 1.2);
  --fast: 130ms;
  --med: 200ms;

  --maxw: 1160px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, monospace;
}

/* ---- styles × schemes ------------------------------------------------
   :root above is the Modern · Midnight default (and the no-JS fallback). Each
   scheme overrides the palette for one [data-style][data-scheme] pair; --grad
   and --ring are derived from the accent trio, so re-tinting is just three vars.
   Phase C adds other styles as [data-style="x"] blocks (palette + structure). */

[data-style="modern"][data-scheme="daylight"] {
  --bg:      #f4f6fd;
  --surface: #ffffff;
  --surface-2: #f7f8fe;
  --elevated: #ffffff;
  --line:    #e3e7f4;
  --line-2:  #d3d9ee;

  --text:    #161a2c;
  --muted:   #5b647f;
  --faint:   #8a93ad;

  --shadow:   0 18px 40px -26px rgba(40, 50, 90, .35);
  --shadow-lg: 0 30px 70px -34px rgba(40, 50, 90, .4);
}


/* ---- base ------------------------------------------------------------- */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 12% -8%, color-mix(in oklab, var(--violet) 24%, transparent), transparent 60%),
    radial-gradient(800px 520px at 100% 0%, color-mix(in oklab, var(--cyan) 16%, transparent), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.icon { width: 1.15em; height: 1.15em; flex: none; }

::selection { background: color-mix(in oklab, var(--violet) 45%, transparent); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: content-box; }

/* ---- topbar ----------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(16px, 4vw, 38px);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.03em; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 11px; color: var(--on-accent); background: var(--grad);
  box-shadow: 0 8px 22px -8px var(--violet);
}
.brand-mark .icon { width: 19px; height: 19px; }
.brand-name b { color: var(--violet); }

.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 10px; color: var(--muted);
  font-weight: 550; font-size: .92rem; white-space: nowrap; /* keep "Data & CRUD" on one line */
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.nav-link .icon { width: 17px; height: 17px; opacity: .85; }
.nav-link:hover { color: var(--text); background: color-mix(in oklab, var(--surface) 70%, transparent); }
.nav-link[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav-link[aria-current="page"] .icon { color: var(--violet); opacity: 1; }
/* Hide nav labels (icon-only) until the labelled row genuinely fits — below
   ~940px brand + labelled nav + search + picker would overflow into a scroll. */
@media (max-width: 940px) { .nav-link span { display: none; } }

/* search box */
.search { position: relative; margin-left: auto; display: flex; align-items: center; }
.search > .icon { position: absolute; left: 12px; color: var(--faint); width: 17px; height: 17px; pointer-events: none; }
.search input {
  width: 230px; max-width: 40vw; padding: 9px 14px 9px 36px;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-size: .9rem;
  transition: width var(--med) var(--ease), border-color var(--fast), box-shadow var(--fast);
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; width: 290px; border-color: var(--violet); box-shadow: var(--ring); }

.search-results { position: absolute; top: calc(100% + 9px); right: 0; width: min(380px, 86vw); }
.search-panel {
  background: var(--elevated); backdrop-filter: blur(20px);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop var(--med) var(--spring);
}
.search-list { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow: auto; }
.search-list a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; transition: background var(--fast); }
.search-list a:hover { background: color-mix(in oklab, var(--violet) 16%, transparent); }
.sr-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sr-text strong { font-size: .9rem; font-weight: 600; }
.sr-text small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-list mark { background: color-mix(in oklab, var(--cyan) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 16px; color: var(--muted); font-size: .9rem; }

/* ---- buttons ---------------------------------------------------------- */

.btn {
  --bg-btn: var(--surface-2);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 17px; border: 1px solid var(--line-2); border-radius: 11px;
  background: var(--bg-btn); color: var(--text); font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), filter var(--fast), background var(--fast), border-color var(--fast);
}
.btn .icon { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { border-color: transparent; color: var(--on-accent); background: var(--grad); background-size: 160% 160%; box-shadow: 0 10px 26px -12px var(--violet); }
.btn-primary:hover { box-shadow: 0 14px 30px -10px var(--violet); background-position: 100% 0; }
.btn-accent { border-color: transparent; color: #04121a; background: linear-gradient(135deg, var(--cyan), var(--green)); box-shadow: 0 10px 26px -12px var(--cyan); }
.btn-danger { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--red), var(--pink)); box-shadow: 0 10px 26px -12px var(--red); }
.btn-outline { background: transparent; border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--violet); color: var(--text); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-loading { pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); cursor: pointer;
  transition: transform var(--fast) var(--ease), color var(--fast), background var(--fast), border-color var(--fast);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.94); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.icon-btn.danger:hover { color: var(--red); border-color: color-mix(in oklab, var(--red) 50%, var(--line)); }

/* ---- theme picker (style × scheme) ------------------------------------ */
.picker { position: relative; flex: none; }
.picker > summary { list-style: none; }
.picker > summary::-webkit-details-marker { display: none; }
.picker > summary::marker { content: ""; }
.picker[open] > summary { color: var(--text); border-color: var(--line-2); }
.picker-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50;
  width: 224px; padding: 14px; display: grid; gap: 9px;
  background: var(--elevated); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: pop var(--fast) var(--spring);
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.picker-head { margin: 0; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }
.picker-styles { display: flex; flex-wrap: wrap; gap: 6px; }
.picker-styles .chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 5px 12px; font-size: .85rem; cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.picker-styles .chip:hover { transform: translateY(-1px); border-color: var(--line-2); }
.picker-styles .chip[aria-pressed="true"] { border-color: transparent; background: var(--grad); color: var(--on-accent); }
.picker-schemes { display: none; flex-wrap: wrap; gap: 9px; }
/* one line per style — reveals that style's swatch row when it's active */
:root[data-style="modern"] .picker-schemes[data-for="modern"] { display: flex; }
.swatch {
  width: 26px; height: 26px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--sw); border: 2px solid var(--line-2);
  transition: transform var(--fast) var(--spring), box-shadow var(--fast) var(--ease);
}
.swatch:hover { transform: scale(1.12); }
.swatch:focus-visible { outline: none; box-shadow: var(--ring); }
.swatch[aria-pressed="true"] { border-color: var(--text); box-shadow: var(--ring); }


/* ---- layout / cards --------------------------------------------------- */

.container { max-width: var(--maxw); margin: 0 auto; padding: clamp(20px, 4vw, 40px); }

.page-head { margin-bottom: 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; font-weight: 700; color: var(--violet); margin-bottom: 8px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.lede { color: var(--muted); margin-top: 8px; max-width: 60ch; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h2 { font-size: 1.15rem; }

.block { margin-bottom: 30px; }
.block-head { margin-bottom: 14px; }
.block-head h2 { font-size: 1.2rem; }
.block-head p { font-size: .9rem; margin-top: 3px; }

/* About page */
.about { max-width: 660px; }
.about-lede { font-size: 1.05rem; line-height: 1.55; }
.about p + p { margin-top: 12px; }
.about p a { color: var(--violet); text-decoration: underline; text-underline-offset: 2px; }
.about p a:hover { color: var(--text); }
.about-stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 20px; }

.demo {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 22px;
}
.demo.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.demo.col { display: flex; flex-direction: column; gap: 16px; }
.demo .row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.demo .row.center { align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

/* ---- stats / dashboard ------------------------------------------------ */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  position: relative; overflow: hidden; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform var(--med) var(--ease), border-color var(--med);
}
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); opacity: .9; }
.stat:hover { transform: translateY(-3px); border-color: var(--line-2); }
.stat-link { text-decoration: none; color: inherit; cursor: pointer; }
.stat-link:focus-visible { outline: none; box-shadow: var(--ring); }
.stat-top { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.stat-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--grad-soft); color: var(--violet); }
.stat-label { font-size: .85rem; font-weight: 550; }
.stat-value { font-size: 2.1rem; font-weight: 750; letter-spacing: -.03em; margin: 8px 0 2px; }
.stat-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--green); font-weight: 600; }
.stat-delta .icon { width: 14px; height: 14px; }
.spark { width: 88px; height: 30px; overflow: visible; }
.spark polyline { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 4px 8px color-mix(in oklab, var(--cyan) 50%, transparent)); }

.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .link-grid { grid-template-columns: 1fr; } }
.tile {
  display: flex; gap: 13px; padding: 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2);
  transition: transform var(--fast) var(--ease), border-color var(--fast), background var(--fast);
}
.tile:hover { transform: translateY(-2px); border-color: var(--violet); background: var(--surface); }
.tile-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--grad-soft); color: var(--violet); }
.tile strong { display: block; font-size: .96rem; }
.tile p { color: var(--muted); font-size: .83rem; margin-top: 2px; }

.ping-slot { min-height: 56px; display: flex; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--line-2); margin: 12px 0 16px; }
.ping-ok { display: flex; align-items: center; gap: 11px; }
.ping-ok .icon { width: 22px; height: 22px; color: var(--green); }
.ping-ok strong { font-family: var(--mono); }
.ping-ok small { display: block; color: var(--muted); }

/* ---- badges / chips / tags / avatars ---------------------------------- */

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; border: 1px solid transparent; }
.badge .dot { width: 7px; height: 7px; border-radius: 99px; background: currentColor; box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 22%, transparent); }
.badge-ok   { color: var(--green); background: color-mix(in oklab, var(--green) 14%, transparent); border-color: color-mix(in oklab, var(--green) 28%, transparent); }
.badge-warn { color: var(--amber); background: color-mix(in oklab, var(--amber) 14%, transparent); border-color: color-mix(in oklab, var(--amber) 28%, transparent); }
.badge-mute { color: var(--faint); background: color-mix(in oklab, var(--faint) 14%, transparent); border-color: color-mix(in oklab, var(--faint) 26%, transparent); }

.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 8px; font-size: .78rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); }
.chip-r0 { color: var(--indigo); border-color: color-mix(in oklab, var(--indigo) 40%, transparent); }
.chip-r1 { color: var(--pink); border-color: color-mix(in oklab, var(--pink) 40%, transparent); }
.chip-r2 { color: var(--cyan); border-color: color-mix(in oklab, var(--cyan) 40%, transparent); }
.chip-r3 { color: var(--amber); border-color: color-mix(in oklab, var(--amber) 40%, transparent); }
.chip-r4 { color: var(--green); border-color: color-mix(in oklab, var(--green) 40%, transparent); }

.tag { font-family: var(--mono); font-size: .74rem; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); }
.tag-new { color: var(--on-accent); background: var(--grad); border-color: transparent; }
.count { position: relative; font-weight: 700; }
.count i { font-style: normal; font-size: .7rem; color: var(--muted); margin-left: 6px; font-weight: 500; }

.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; font-size: .8rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h), 80%, 62%), hsl(calc(var(--h) + 40), 75%, 48%));
  box-shadow: 0 6px 14px -6px hsl(var(--h), 70%, 45%); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -10px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-more { background: var(--surface-2); color: var(--muted); }

/* ---- meters / rings / spinners ---------------------------------------- */

.meter { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.meter.lg { height: 11px; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width var(--med) var(--ease); }
.meter-accent i { background: linear-gradient(90deg, var(--cyan), var(--green)); }

.ring { --p: 0; position: relative; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--violet) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-weight: 700; font-size: .92rem; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in oklab, currentColor 25%, transparent); border-top-color: currentColor; animation: spin .7s linear infinite; }
.spinner-lg { width: 30px; height: 30px; border-width: 3px; color: var(--violet); }
.bar-indeterminate { position: relative; width: 160px; height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-indeterminate i { position: absolute; inset: 0; width: 40%; border-radius: inherit; background: var(--grad); animation: indeterminate 1.2s var(--ease) infinite; }

/* ---- tabs ------------------------------------------------------------- */

.tabs { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.tablist { display: flex; gap: 2px; padding: 6px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tab { flex: 1; padding: 9px 14px; border: none; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: .9rem; border-radius: 9px; cursor: pointer; transition: color var(--fast), background var(--fast); }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); background: var(--surface); box-shadow: 0 4px 12px -8px rgba(0,0,0,.5), inset 0 0 0 1px var(--line); }
.tabpanel { padding: 22px; animation: fade-up var(--med) var(--ease); }
.tabpanel h3 { margin-bottom: 8px; }

/* ---- accordion -------------------------------------------------------- */

.accordion { gap: 10px; }
.acc { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.acc summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 600; list-style: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .icon { transition: transform var(--med) var(--spring); color: var(--violet); }
.acc[open] summary .icon { transform: rotate(45deg); }
.acc-body { padding: 0 16px 15px; color: var(--muted); animation: fade-up var(--med) var(--ease); }

/* ---- forms ------------------------------------------------------------ */

.form { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.span-2 { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span, .field legend { font-size: .85rem; font-weight: 600; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.field.inline { flex-direction: row; align-items: center; gap: 12px; }
.field.inline span:last-child { color: var(--text); font-weight: 500; }

/* :where() keeps this at the specificity of a bare `input`, so input[type="range"]
   below still wins; checkboxes and radios keep their natural size wherever a
   .toggle/.check/.radio wrapper doesn't take them over. */
input:where(:not([type="checkbox"], [type="radio"])), select, textarea {
  width: 100%; padding: 10px 13px; font: inherit; font-size: .92rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: var(--ring); background: var(--surface); }
textarea { resize: vertical; min-height: 76px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%239aa3c4' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }
.out { font-family: var(--mono); color: var(--violet); font-size: .8rem; }

/* range */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 7px; padding: 0; border: none; border-radius: 99px;
  background: linear-gradient(90deg, var(--violet), var(--cyan)) no-repeat, var(--surface-2);
  background-size: var(--fill, 50%) 100%; cursor: pointer;
  transition: none; }  /* fill tracks the thumb instantly — never animate background-size */
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 19px; height: 19px; border-radius: 50%; background: #fff; border: 3px solid var(--violet); box-shadow: 0 3px 10px -2px var(--violet); transition: transform var(--fast); }
input[type="range"]::-webkit-slider-thumb:active { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--violet); }

/* switch / check / radio */
.toggle { position: relative; display: inline-flex; flex: none; width: 44px; height: 25px; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-2); transition: background var(--fast); }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: var(--faint); transition: transform var(--med) var(--spring), background var(--fast); }
.toggle input:checked + i { background: var(--grad); border-color: transparent; }
.toggle input:checked + i::after { transform: translateX(19px); background: #fff; }
.toggle input:focus-visible + i { box-shadow: var(--ring); }

.check, .radio { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; color: var(--text); }
.check input, .radio input { position: absolute; opacity: 0; width: 0; }
.check i, .radio i { display: grid; place-items: center; width: 20px; height: 20px; flex: none; border: 1px solid var(--line-2); background: var(--surface-2); transition: background var(--fast), border-color var(--fast); }
.check i { border-radius: 6px; }
.radio i { border-radius: 50%; }
.check i::after { content: ""; width: 10px; height: 10px; border-radius: 3px; background: #fff; transform: scale(0); transition: transform var(--fast) var(--spring); }
.radio i::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform var(--fast) var(--spring); }
.check input:checked + i, .radio input:checked + i { background: var(--grad); border-color: transparent; }
.check input:checked + i::after, .radio input:checked + i::after { transform: scale(1); }
.radios { display: flex; gap: 18px; flex-wrap: wrap; }
fieldset { border: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }

.field-msg { min-height: 18px; font-size: .8rem; margin: 0; }
/* Where hx-status:422 puts a refused submit's reason; takes no room until then. */
.form-error:empty { display: none; }
.add-form .form-error { grid-column: 1 / -1; }
.page-gap { align-self: center; padding: 0 2px; color: var(--faint); }
.msg { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; animation: fade-up var(--fast) var(--ease); }
.msg-ok { color: var(--green); }
.msg-err { color: var(--red); }

.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.form-result:empty { display: none; }
.result-ok, .result-err { margin-top: 18px; padding: 15px 17px; border-radius: var(--radius-sm); animation: pop var(--med) var(--spring); }
.result-ok { display: flex; gap: 12px; align-items: center; background: color-mix(in oklab, var(--green) 12%, transparent); border: 1px solid color-mix(in oklab, var(--green) 32%, transparent); }
.result-ok .icon { width: 26px; height: 26px; color: var(--green); flex: none; }
.result-ok p { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.result-err { background: color-mix(in oklab, var(--red) 12%, transparent); border: 1px solid color-mix(in oklab, var(--red) 32%, transparent); }
.result-err ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }

/* ---- data table ------------------------------------------------------- */

.toolbar { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .filter { position: relative; flex: 1; min-width: 220px; display: flex; align-items: center; }
.toolbar .filter > .icon { position: absolute; left: 13px; color: var(--faint); width: 17px; height: 17px; pointer-events: none; }
.toolbar .filter input { padding-left: 38px; }

.add { position: relative; }
.add > summary { list-style: none; }
.add > summary::-webkit-details-marker { display: none; }
.add[open] > summary { background: var(--surface); color: var(--text); }
.add-form {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 10px; align-items: center;
  width: min(620px, 92vw); box-shadow: var(--shadow-lg); animation: pop var(--med) var(--spring);
}
@media (max-width: 620px) { .add-form { grid-template-columns: 1fr; right: auto; } }

.table-card { padding: 14px; overflow: visible; }
.table-meta { padding: 4px 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.table-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-filter { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 5px 13px; font-size: .84rem; font-weight: 600; cursor: pointer; transition: color var(--fast) var(--ease), border-color var(--fast), background var(--fast); }
.chip-filter:hover { color: var(--text); border-color: var(--line-2); }
.chip-filter.is-active { color: var(--on-accent); background: var(--grad); border-color: transparent; }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table thead th { text-align: left; padding: 0 6px 10px; border-bottom: 1px solid var(--line); }
.table .th-actions { text-align: right; color: var(--muted); font-size: .8rem; font-weight: 600; padding-right: 14px; }
.sort { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; margin-left: -8px; border: none; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; border-radius: 7px; cursor: pointer; transition: color var(--fast), background var(--fast); }
.sort:hover { color: var(--text); background: var(--surface-2); }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; opacity: 0; transition: opacity var(--fast), transform var(--fast); }
.sort[data-dir="asc"] { color: var(--text); }
.sort[data-dir="asc"] .caret { opacity: 1; border-bottom: 5px solid var(--violet); }
.sort[data-dir="desc"] { color: var(--text); }
.sort[data-dir="desc"] .caret { opacity: 1; border-top: 5px solid var(--violet); }

.table tbody td { padding: 11px 6px; border-bottom: 1px solid color-mix(in oklab, var(--line) 60%, transparent); vertical-align: middle; }
.row { transition: background var(--fast); }
.row:hover { background: color-mix(in oklab, var(--violet) 7%, transparent); }
.c-name { display: flex; align-items: center; gap: 11px; }
.c-name .avatar { width: 32px; height: 32px; font-size: .72rem; }
.c-name-text { display: flex; flex-direction: column; line-height: 1.25; }
.c-name-text small { color: var(--faint); font-size: .74rem; font-family: var(--mono); }
.c-email { color: var(--muted); font-size: .86rem; }
.c-score { width: 150px; }
.c-score .meter { margin-bottom: 4px; }
.c-score small { color: var(--muted); font-size: .76rem; }
.c-actions { text-align: right; white-space: nowrap; }
.c-actions .icon-btn { width: 32px; height: 32px; }
.c-actions .icon-btn .icon { width: 15px; height: 15px; }

.row-empty td { padding: 40px !important; }
.empty { display: grid; place-items: center; gap: 10px; color: var(--muted); }
.empty .icon { width: 30px; height: 30px; opacity: .5; }

.pager { display: flex; gap: 6px; justify-content: flex-end; align-items: center; padding: 14px 8px 4px; }
.page { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 9px; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; transition: color var(--fast), border-color var(--fast), background var(--fast); }
.page:hover:not(:disabled) { color: var(--text); border-color: var(--line-2); }
.page:disabled { opacity: .4; cursor: not-allowed; }
.page.is-current { color: var(--on-accent); background: var(--grad); border-color: transparent; }

/* ---- overlays --------------------------------------------------------- */

#overlay:empty { display: none; }
.backdrop { position: fixed; inset: 0; z-index: 100; display: grid; background: color-mix(in oklab, #05060f 60%, transparent); backdrop-filter: blur(4px); animation: fade var(--med) var(--ease); }
.backdrop.htmx-swapping { animation: fade var(--med) var(--ease) reverse; }

.modal { place-self: center; width: min(440px, 92vw); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: modal-in var(--med) var(--spring); }
.htmx-swapping .modal { animation: modal-out var(--fast) var(--ease) forwards; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head .icon-btn .icon { transform: rotate(45deg); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-body p { color: var(--muted); font-size: .9rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }

.drawer { place-self: stretch end; width: min(380px, 90vw); height: 100%; background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: var(--shadow-lg); padding: 22px; display: flex; flex-direction: column; gap: 18px; animation: drawer-in var(--med) var(--spring); }
.htmx-swapping .drawer { animation: drawer-out var(--med) var(--ease) forwards; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head .icon-btn .icon { transform: rotate(45deg); }
.drawer-nav { display: flex; flex-direction: column; gap: 4px; }
.drawer-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; color: var(--muted); font-weight: 550; transition: background var(--fast), color var(--fast); }
.drawer-link:hover { background: var(--surface-2); color: var(--text); }
.drawer-link .icon { color: var(--violet); }
.drawer-foot { margin-top: auto; font-size: .84rem; }

/* ---- contact detail drawer -------------------------------------------- */
.c-open { display: flex; align-items: center; gap: 11px; width: 100%; padding: 5px 7px; margin: -5px -7px; border: 0; background: none; border-radius: 9px; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background var(--fast) var(--ease); }
.c-open:hover { background: color-mix(in oklab, var(--violet) 12%, transparent); }
.c-open:focus-visible { outline: none; box-shadow: var(--ring); }

.drawer-detail { width: min(444px, 94vw); gap: 16px; }
.detail-head { gap: 12px; }
.detail-head .avatar { width: 46px; height: 46px; font-size: .95rem; flex: none; }
.detail-id { flex: 1; min-width: 0; }
.detail-id h2 { font-size: 1.15rem; }
.detail-id p { overflow: hidden; text-overflow: ellipsis; }
.detail-close { flex: none; }
.detail-body { display: flex; flex-direction: column; gap: 22px; overflow-y: auto; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.detail-score { display: flex; align-items: center; gap: 8px; }
.detail-score .meter { width: 84px; }
.detail-rid { margin-left: auto; color: var(--faint); font-family: var(--mono); font-size: .8rem; }
.detail-section h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: 13px; }
.detail-notes { margin: 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.tl-dot { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--violet); }
.tl-dot .icon { width: 15px; height: 15px; }
.tl-body { display: flex; flex-direction: column; line-height: 1.3; }
.tl-body small { color: var(--faint); font-size: .76rem; }
/* the other contact in an interaction headline — a one-click jump to their drawer */
.tl-who { font: inherit; font-weight: 600; color: var(--violet); background: none; border: 0;
  padding: 0; cursor: pointer; border-radius: 4px; }
.tl-who:hover { text-decoration: underline; }
.detail-empty { padding: 2px 0 4px; font-size: .82rem; }

.related-list { display: flex; flex-direction: column; gap: 6px; }
.related-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color var(--fast), transform var(--fast); }
.related-item:hover { border-color: var(--violet); transform: translateX(2px); }
.related-item .avatar { width: 30px; height: 30px; font-size: .68rem; flex: none; }
.related-name { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.related-name small { color: var(--faint); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }

.btn-sm { padding: 7px 12px; font-size: .84rem; }
.btn-sm .icon { width: 15px; height: 15px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-actions .danger:hover { color: var(--red); border-color: color-mix(in oklab, var(--red) 40%, var(--line-2)); }
.detail-edit { gap: 15px; }
.detail-edit .field span b { color: var(--text); font-family: var(--mono); font-weight: 700; }
.drawer-static { animation: none; }

/* ---- toasts ----------------------------------------------------------- */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast { display: flex; align-items: center; gap: 11px; padding: 13px 15px; border-radius: var(--radius-sm); background: var(--elevated); backdrop-filter: blur(18px); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); animation: toast-in var(--med) var(--spring); }
.toast.leaving { animation: toast-out var(--med) var(--ease) forwards; }
.toast p { font-size: .88rem; font-weight: 550; flex: 1; }
.toast-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; }
.toast-icon .icon { width: 17px; height: 17px; }
.toast-success .toast-icon { color: var(--green); background: color-mix(in oklab, var(--green) 16%, transparent); }
.toast-error .toast-icon { color: var(--red); background: color-mix(in oklab, var(--red) 16%, transparent); }
.toast-info .toast-icon { color: var(--cyan); background: color-mix(in oklab, var(--cyan) 16%, transparent); }
.toast-x { border: none; background: none; color: var(--faint); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 2px; transition: color var(--fast); }
.toast-x:hover { color: var(--text); }

/* ---- tooltip ---------------------------------------------------------- */

[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px); white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: #05060f; color: #fff; font-size: .78rem; font-weight: 500; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity var(--fast), transform var(--fast) var(--ease); }
[data-tip]:hover::after { opacity: 1; transform: translate(-50%, 0); }

/* ---- htmx swap transitions ------------------------------------------- */

.row-new { animation: row-in 420ms var(--spring); }
tr.htmx-swapping { animation: row-out 220ms var(--ease) forwards; }
.htmx-indicator { opacity: 0; transition: opacity var(--fast); }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* ---- keyframes -------------------------------------------------------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(7px); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes drawer-in { from { transform: translateX(100%); } }
@keyframes drawer-out { to { transform: translateX(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px) scale(.95); height: 0; margin: 0; padding-top: 0; padding-bottom: 0; } }
@keyframes row-in { from { opacity: 0; transform: translateY(-8px); background: color-mix(in oklab, var(--green) 22%, transparent); } }
@keyframes row-out { to { opacity: 0; transform: translateX(20px); } }
@keyframes indeterminate { 0% { left: -40%; } 100% { left: 100%; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* =====================================================================
   RESPONSIVE — phone / small-tablet. Last in the file so these layout
   overrides win over the base + per-style rules they touch (the per-style
   blocks only retheme topbar colours, never its layout).
   ===================================================================== */

/* The topbar's single row (brand · nav · search · picker) can't fit a phone,
   forcing a page-wide horizontal scroll. Drop the search onto its own
   full-width row and trim the chrome. (Below 880px the nav is already
   icon-only; the brand mark still links home without its wordmark.) */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .brand-name { display: none; }
  .nav { margin-left: 0; gap: 2px; }
  .nav-link { padding: 8px 10px; }
  .picker { margin-left: auto; }                 /* hold the picker at the right of row 1 */
  .search { order: 10; flex: 1 1 100%; margin-left: 0; }
  .search input,
  .search input:focus { width: 100%; max-width: none; }
  .search-results { left: 0; right: 0; width: 100%; }
}

/* The six-column data table doesn't fit a phone. Keep the essentials — name,
   status, actions — and fold email / role / engagement into the detail drawer
   (one tap on the name). `.table-scroll` still catches anything still too wide. */
@media (max-width: 560px) {
  .table thead th:nth-child(2), .table tbody td:nth-child(2),   /* Email */
  .table thead th:nth-child(3), .table tbody td:nth-child(3),   /* Role */
  .table thead th:nth-child(5), .table tbody td:nth-child(5) {  /* Engagement */
    display: none;
  }
}

/* ---- hl: alexh95.com Gun Game ---------------------------------------------------------------
   Valve's own look around 2005: the Steam client's olive VGUI skin and steampowered.com of the
   Half-Life 2 / CS:Source years. A fixed-width desktop page, Verdana at small sizes, beveled
   panels with title bars, dense striped tables, tabs.

   Palette (60-30-10): a desaturated olive field (hue ~85-95°, the Steam skin's own) carries
   60% of the page; lighter khaki-greys and the warm off-white text carry 30%; two saturated
   accents carry the last 10%, each with one job:
     --accent  Half-Life orange (hue ~33°): identity and the primary action only — the lambda,
               Connect, the top-3 ranks, "on now". Orange against olive is a warm split: it
               pops by saturation, not by clashing hue.
     --hi      Steam's yellow-olive (hue ~53°): "clickable / selected" — links, the active tab.
               It sits between the orange and the olive on the wheel, so it bridges the two.
     --live    a saturated green on the base hue: online state, read as part of the skin.
   Contrast (WCAG 2.x): --text on --panel 7.7:1, on --well 10.7:1; --muted on --panel 4.8:1,
   on --well 6.6:1; --hi on --panel 5.8:1; --accent on --well 6.1:1; Connect's dark label on
   its orange 6.3-8.8:1. Every body-text pairing clears AA (4.5:1).

   Spacing scale: 4 · 8 · 12 · 16 · 24 · 32 px. Radii: 0-2 px, as VGUI had them.

   The starter's theme picker is hidden: this site has one look. The tokens are pinned on
   :root[data-style][data-scheme] too, so a style kept in localStorage from before can't
   repaint it. The starter's accent trio (--violet, --indigo, --cyan) is re-tinted rather than
   renamed, so its own components (focus rings, chips, search) follow without changes. */

:root, :root[data-style][data-scheme] {
  --page:      #23271d;
  --panel:     #3e4637;
  --panel-2:   #4c5844;
  --head-top:  #5f6e54;
  --head-bot:  #4c5844;
  --well:      #2b3024;
  --row-alt:   #323829;
  --row-hover: #444d3b;
  --bevel-hi:  #6b7860;
  --bevel-lo:  #1b1e16;

  --text:   #e1e6d8;
  --muted:  #aeb8a0;
  --faint:  #8a937e;
  --hi:     #d9c95f;
  --accent: #f39a1e;
  --accent-deep: #d9700a;
  --live:   #8bd14b;
  --dead:   #d9765a;

  /* the starter's names, mapped onto the palette */
  --violet: var(--accent);
  --indigo: var(--accent-deep);
  --cyan:   var(--hi);
  --green:  var(--live);
  --on-accent: #1f1300;
  --bg: var(--page);
  --surface: var(--panel);
  --surface-2: var(--well);
  --elevated: var(--panel);
  --line: var(--bevel-lo);
  --line-2: var(--bevel-hi);
  --grad: linear-gradient(180deg, #ffb347, var(--accent) 45%, var(--accent-deep));
  --ring: 0 0 0 1px var(--hi);
  --radius: 2px;
  --radius-sm: 2px;
  --radius-lg: 2px;
  --shadow: none;
  --shadow-lg: 0 8px 18px rgba(0, 0, 0, .45);

  --font: Verdana, Tahoma, "DejaVu Sans", "Segoe UI", sans-serif;
  --font-head: Tahoma, Verdana, "DejaVu Sans", sans-serif;
  --mono: "Lucida Console", "Courier New", ui-monospace, monospace;
  --maxw: 980px;
  --gutter: 16px;

  /* a VGUI bevel: light top-left, dark bottom-right, and its pressed inverse */
  --raised: var(--bevel-hi) var(--bevel-lo) var(--bevel-lo) var(--bevel-hi);
  --sunken: var(--bevel-lo) var(--bevel-hi) var(--bevel-hi) var(--bevel-lo);
}

html { scroll-behavior: auto; }
body {
  font-family: var(--font); font-size: 12px; line-height: 1.5; color: var(--text);
  -webkit-font-smoothing: auto; text-rendering: auto;
  background:
    linear-gradient(180deg, #343c2c 0, var(--page) 340px) no-repeat,
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 4px),
    var(--page);
  background-attachment: scroll;
}
h1, h2, h3 { letter-spacing: 0; }
::selection { background: color-mix(in oklab, var(--hi) 45%, transparent); color: #fff; }
::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 0; border: 2px solid var(--page); background-clip: border-box; }
::-webkit-scrollbar-track { background: var(--page); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 1px dotted var(--hi); outline-offset: 2px; box-shadow: none;
}

code, kbd { font-family: var(--mono); font-size: 1em; background: none; border: 0; padding: 0; overflow-wrap: anywhere; }

/* ---- chrome: the header band and its tabs ------------------------------------------------- */

.picker { display: none; }

.topbar {
  position: relative; gap: 16px; padding: 0 max(var(--gutter), calc((100% - var(--maxw)) / 2 + var(--gutter)));
  min-height: 56px; align-items: stretch;
  background: linear-gradient(180deg, #56634b 0, #455039 48%, #3a4331 52%, #333b2b 100%);
  border-top: 1px solid #7d8a70; border-bottom: 1px solid #12140f;
  box-shadow: 0 1px 0 #4a5440, 0 6px 14px -8px rgba(0,0,0,.6);
  backdrop-filter: none;
}
.brand { gap: 10px; letter-spacing: 0; align-self: center; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 50%; background: #1d2018; box-shadow: none;
  border: 2px solid var(--accent); color: var(--accent);
}
.brand-mark .icon { display: none; }
.brand-mark::before { content: "λ"; font: 700 19px/1 var(--font-head); margin-top: -1px; }
.brand-name { font: 700 14px/1 var(--font-head); text-transform: uppercase; letter-spacing: .08em; color: var(--text); }
.brand-name b { color: var(--accent); font-weight: 700; }

.nav { gap: 0; margin-left: 16px; align-self: stretch; }
.nav-link {
  gap: 0; padding: 0 16px; border-radius: 0; font: 700 11px/1 var(--font-head); text-transform: uppercase; letter-spacing: .1em;
  color: #c9cfbe; border-left: 1px solid rgba(0,0,0,.25); box-shadow: inset 1px 0 0 rgba(255,255,255,.06);
}
.nav-link:last-child { border-right: 1px solid rgba(0,0,0,.25); }
.nav-link .icon { display: none; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-link[aria-current="page"] {
  color: var(--hi); background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.22));
  box-shadow: inset 0 -3px 0 var(--accent);
}
@media (max-width: 940px) { .nav-link span { display: inline; } }

.search { align-self: center; }
.search > .icon { color: var(--faint); left: 8px; width: 14px; height: 14px; }
.search input, .search input:focus {
  width: 210px; padding: 5px 8px 5px 28px; border-radius: 0; font: 11px var(--font); color: var(--text);
  background: var(--well); border: 1px solid; border-color: var(--sunken); box-shadow: inset 1px 1px 0 rgba(0,0,0,.35);
}
.search input:focus { outline: 1px dotted var(--hi); outline-offset: 1px; }
.search-panel {
  background: var(--panel); border: 1px solid; border-color: var(--raised); border-radius: 0;
  box-shadow: var(--shadow-lg); backdrop-filter: none; animation: none;
}
.search-list { padding: 2px; }
.search-list a { border-radius: 0; padding: 6px 8px; }
.search-list a:hover, .search-list a:focus-visible { background: var(--row-hover); }
.sr-text strong { font-size: 12px; font-weight: 700; color: var(--hi); }
.sr-text small { color: var(--muted); font-size: 11px; }
.search-list mark { background: color-mix(in oklab, var(--accent) 40%, transparent); color: #fff; border-radius: 0; }
.search-empty { color: var(--muted); font-size: 11px; padding: 12px; }

.container { max-width: var(--maxw); padding: 24px var(--gutter) 32px; }

/* ---- panels, buttons, tables: the kit every page is made of ---------------------------- */

.hl-panel {
  background: var(--panel); border: 1px solid; border-color: var(--raised);
  outline: 1px solid #15180f; margin-bottom: 16px;
}
.hl-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 26px; padding: 4px 10px;
  background: linear-gradient(180deg, var(--head-top), var(--head-bot));
  border-bottom: 1px solid var(--bevel-lo); box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.hl-panel-head h2 { margin: 0; font: 700 11px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: #f0f2ea; }
.hl-panel-meta { font-size: 10px; color: #d2d8c8; text-transform: uppercase; letter-spacing: .08em; }
.hl-panel-link { font-size: 11px; font-weight: 700; color: #f3e48a; }
.hl-panel-link:hover { color: #fff; text-decoration: underline; }
.hl-panel > p { padding: 12px; }

.hl-btn {
  display: inline-block; padding: 3px 12px; font: 700 11px/1.5 var(--font-head); text-transform: uppercase; letter-spacing: .06em;
  color: var(--text); background: linear-gradient(180deg, #5f6e54, var(--panel-2)); cursor: pointer;
  border: 1px solid; border-color: var(--raised); border-radius: 0; white-space: nowrap;
}
.hl-btn:hover { color: var(--hi); background: linear-gradient(180deg, #6b7b5f, #56644c); }
.hl-btn:active { border-color: var(--sunken); background: var(--panel-2); }

.hl-table { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--well); }
.hl-table thead th {
  padding: 5px 8px; text-align: left; white-space: nowrap;
  font: 700 10px/1.3 var(--font-head); text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  background: var(--row-alt); border-bottom: 1px solid var(--bevel-lo);
}
.hl-table td { padding: 5px 8px; border-bottom: 1px solid #262a20; vertical-align: middle; }
.hl-table tbody tr:nth-child(even) { background: var(--row-alt); }
.hl-table tbody tr:hover { background: var(--row-hover); }
.hl-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hl-table tbody tr:last-child td { border-bottom: 0; }
.hl-dim { color: var(--muted); }
.hl-rank { width: 2.5em; color: var(--muted); }
.hl-ranks tr.is-top .hl-rank { color: var(--accent); font-weight: 700; }
.hl-ranks tr.is-top .hl-player { font-weight: 700; }
.hl-player { color: var(--hi); }
.hl-player:hover { color: #fff; text-decoration: underline; }
.hl-table tbody tr.row-empty:hover { background: none; }
.hl-empty { padding: 24px 12px; text-align: center; color: var(--muted); }
.hl-tag { font: 700 9px/1 var(--font-head); letter-spacing: .08em; padding: 1px 4px; color: var(--muted); border: 1px solid var(--bevel-hi); vertical-align: 1px; }
.table-scroll { overflow-x: auto; }

/* ---- home: the masthead and Connect ------------------------------------------------------ */

.hl-hero {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px;
  margin-bottom: 16px; padding: 24px;
  background:
    radial-gradient(ellipse 340px 200px at 70px 50%, rgba(243,154,30,.13), transparent 70%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #3a4232, #2a3023);
  border: 1px solid; border-color: var(--raised); outline: 1px solid #15180f;
}
.hl-hero-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.hl-emblem {
  display: grid; place-items: center; flex: none; width: 76px; height: 76px; border-radius: 50%;
  font: 700 48px/1 var(--font-head); color: var(--accent);
  background: radial-gradient(circle at 50% 40%, #2a2e22, #15170f 70%);
  border: 4px solid var(--accent);
  box-shadow: 0 0 0 1px #000, 0 0 24px -4px rgba(243,154,30,.55), inset 0 0 12px rgba(0,0,0,.8);
  text-shadow: 0 0 10px rgba(243,154,30,.45);
}
.hl-emblem-sm { width: 52px; height: 52px; font-size: 30px; border-width: 3px; }
.hl-kicker { margin: 0 0 4px; font: 700 10px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .22em; color: var(--hi); }
.hl-title {
  margin: 0; font: 700 32px/1.05 var(--font-head); text-transform: uppercase; letter-spacing: .03em; color: #f0f2ea;
  text-shadow: 0 2px 0 #000;
}
.hl-title span { color: var(--accent); }
.hl-hero-count { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.hl-hero-count b { color: var(--accent); font-weight: 700; }

/* the GameTracker banners under the server list, side by side when they fit */
.hl-gt { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -8px 0 16px; }
.hl-gt-banner { display: block; flex: 0 1 560px; min-width: 0; line-height: 0; outline: 1px solid #15180f; }
.hl-gt-banner img { width: 100%; height: auto; }
.hl-gt-banner:hover, .hl-gt-banner:focus-visible { outline-color: var(--accent); }

.hl-join {
  padding: 12px; background: rgba(21,24,15,.75); border: 1px solid; border-color: var(--sunken);
  min-width: 0;
}
.hl-join-label { font: 700 11px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .1em; color: #f0f2ea; }
.hl-join-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.hl-join-row + .hl-join-row { margin-top: 8px; }
.hl-address {
  display: flex; align-items: center; padding: 0 12px; min-height: 40px; user-select: all;
  font: 15px/1 var(--mono); color: #f0f2ea; background: #15180f; border: 1px solid; border-color: var(--sunken);
}
.hl-btn-connect {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 24px; min-height: 40px;
  font: 700 14px/1 var(--font-head); text-transform: uppercase; letter-spacing: .1em; color: var(--on-accent);
  background: linear-gradient(180deg, #ffbe5c 0, #f7a23a 45%, #e8860f 55%, #e0800f 100%);
  border: 1px solid; border-color: #ffd699 #7a3f02 #7a3f02 #ffd699; outline: 1px solid #000;
  text-shadow: 0 1px 0 rgba(255,255,255,.3); white-space: nowrap;
}
.hl-btn-connect:hover { background: linear-gradient(180deg, #ffcf80 0, #ffb04a 45%, #f39a1e 55%, #ea8d17 100%); }
.hl-btn-connect:active { border-color: #7a3f02 #ffd699 #ffd699 #7a3f02; background: #e0800f; }
.hl-btn-connect:focus-visible { outline: 1px dotted #fff; outline-offset: 2px; }
.hl-btn-connect-icon { font-size: 10px; }
.hl-join-alt { margin: 8px 0 0; font-size: 11px; color: var(--muted); }
.hl-join-alt a { color: var(--hi); text-decoration: underline; }
.hl-join-alt a:hover { color: #fff; }

/* ---- the feedback page and the admin view ------------------------------------------------- */

.hl-form { display: grid; gap: 6px; padding: 12px; }
.hl-form label { font-weight: 700; }
.hl-form textarea, .hl-form input[type="text"] {
  width: 100%; padding: 6px 8px; font: inherit; color: #f0f2ea; background: #1d2018;
  border: 1px solid; border-color: var(--sunken); margin-bottom: 8px;
}
.hl-form .hl-btn { justify-self: start; }
.hl-form-trap { position: absolute; left: -9999px; }
.hl-form-note { margin: 0; padding: 8px 12px; color: var(--live); font-weight: 700; }
.hl-form-note.is-bad { color: #ff8a5c; }
.hl-form-alt { margin: 0; padding: 0 12px 12px; color: var(--muted); }
.hl-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.hl-tile { display: grid; padding: 10px 12px; background: var(--panel-2); border: 1px solid #343b2d; }
.hl-tile span { color: var(--hi); font-weight: 700; }
.hl-tile b { font-size: 30px; line-height: 1.2; color: #f0f2ea; }
.hl-tile small { color: var(--muted); }
.hl-feedback-list { margin: 0; padding: 0; list-style: none; }
.hl-feedback-list li { padding: 8px 12px; border-bottom: 1px solid #343b2d; }
.hl-feedback-list li:last-child { border-bottom: 0; }
.hl-feedback-list p { margin: 0; }
.hl-feedback-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- the gun game page ------------------------------------------------------------------- */

.hl-steps { margin: 0; padding: 10px 12px 10px 30px; }
.hl-steps li { margin: 0 0 6px; }
.hl-steps li:last-child { margin-bottom: 0; }
.hl-arsenal { display: grid; }
.hl-arsenal-row { padding: 8px 12px; border-bottom: 1px solid #343b2d; }
.hl-arsenal-row:last-child { border-bottom: 0; }
.hl-arsenal-row:nth-child(even) { background: rgba(0,0,0,.08); }
.hl-arsenal-row h3 { margin: 0 0 2px; font-size: 12px; color: var(--hi); }
.hl-arsenal-row p { margin: 0; }
.hl-arsenal-more { margin: 0; padding: 8px 12px; border-top: 1px solid #343b2d; }

/* ---- home: the server browser ------------------------------------------------------------ */

.hl-browser td { padding-top: 7px; padding-bottom: 7px; }
.hl-col-state { width: 18px; padding-right: 0 !important; }
.hl-col-join { width: 1%; text-align: right; }
.hl-light {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px;
  background: #5a6150; border: 1px solid #12140f;
}
.is-on .hl-light { background: radial-gradient(circle at 35% 35%, #d6ff9c, var(--live) 55%, #4f8a1e); box-shadow: 0 0 6px rgba(139,209,75,.7); }
.hl-browser tbody tr:nth-child(even) { background: none; } /* a server and its live line read as one */
.hl-browser .hl-live-row td { padding-top: 0; font-size: 11px; color: var(--muted); }
.hl-live-lead { margin-right: 14px; }
.hl-live-lead b { color: var(--hi); }
.hl-live-on a { color: var(--hi); }
.hl-server-name { display: block; font-weight: 700; color: #f0f2ea; }
.is-off .hl-server-name, .is-off .hl-map-cell { color: var(--muted); }
.hl-server-addr { font-size: 11px; color: var(--muted); white-space: nowrap; }
.hl-cmd {
  padding: 0 4px; font: 11px/1.4 var(--mono); color: var(--hi); white-space: nowrap;
  background: #1d2018; border: 1px solid; border-color: var(--sunken);
}
.hl-feature p a { color: var(--hi); text-decoration: underline; }
.hl-feature p a:hover { color: #fff; }

/* ---- maps: one group per server ---------------------------------------------------------- */

.hl-map-group + .hl-map-group { margin-top: 8px; }
.hl-group-head {
  display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 6px 10px;
  font: 700 12px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: #f0f2ea;
  background: linear-gradient(180deg, var(--head-top), var(--head-bot));
  border: 1px solid; border-color: var(--raised); outline: 1px solid #15180f;
}
.lede:empty { display: none; }
.hl-map-cell { font-weight: 700; color: var(--hi); }
.hl-players { color: #f0f2ea; font-size: 13px; }
.hl-players-cell { min-width: 84px; }
.hl-fill { display: block; height: 4px; margin: 3px 0 0 auto; width: 72px; background: #15180f; border: 1px solid; border-color: var(--sunken); }
.hl-fill i { display: block; height: 100%; background: var(--live); }

/* ---- home: two columns ------------------------------------------------------------------- */

.hl-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.hl-cols-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.hl-features { display: grid; }
.hl-feature { display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; border-bottom: 1px solid #343b2d; }
.hl-feature:last-child { border-bottom: 0; }
.hl-feature:nth-child(even) { background: rgba(0,0,0,.08); }
.hl-feature-glyph {
  display: grid; place-items: center; flex: none; width: 38px; height: 30px; margin-top: 2px;
  font: 700 11px/1 var(--font-head); letter-spacing: .02em; color: var(--accent);
  background: #1d2018; border: 1px solid; border-color: var(--sunken);
}
.hl-feature h3 { margin: 0 0 2px; font-size: 12px; font-weight: 700; color: #f0f2ea; }
.hl-feature p { margin: 0; font-size: 11px; line-height: 1.45; color: var(--muted); }
.hl-rules p { padding: 12px; font-size: 14px; font-weight: 700; color: #f0f2ea; }

/* ---- page heads (leaderboard, maps, a player) -------------------------------------------- */

.page-head { margin: 0 0 16px; padding: 0 0 12px; border-bottom: 1px solid #15180f; box-shadow: 0 1px 0 #3c4434; }
.eyebrow { margin: 0 0 4px; font: 700 10px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .22em; color: var(--hi); }
.page-head h1 { font: 700 24px/1.15 var(--font-head); text-transform: uppercase; letter-spacing: .03em; color: #f0f2ea; text-shadow: 0 2px 0 #000; overflow-wrap: anywhere; }
.lede { margin-top: 4px; max-width: none; font-size: 12px; color: var(--muted); }
.lede a { color: var(--hi); text-decoration: underline; }
.lede a:hover { color: #fff; }
.lede code { color: var(--text); }
.hl-profile-head { display: flex; align-items: center; gap: 16px; }
.hl-profile-head > div { min-width: 0; }

/* ---- leaderboard: tabs, toolbar --------------------------------------------------------- */

.hl-board { margin-bottom: 16px; }
.hl-tabs { display: flex; gap: 2px; padding-left: 8px; position: relative; z-index: 1; }
.hl-tab {
  padding: 6px 16px 5px; font: 700 11px/1.3 var(--font-head); text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); background: linear-gradient(180deg, #3a4232, #30372a);
  border: 1px solid; border-color: var(--raised); border-bottom: 0; margin-top: 3px;
}
.hl-tab:hover { color: var(--text); }
.hl-tab.is-active { color: var(--hi); background: var(--panel); margin-top: 0; padding-top: 8px; margin-bottom: -1px; padding-bottom: 6px; box-shadow: inset 0 2px 0 var(--accent); }
.hl-tabbed { margin-bottom: 0; }
.hl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 10px 12px; border-bottom: 1px solid var(--bevel-lo); }
.hl-seg { display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.hl-seg-label { margin-right: 8px; font: 700 10px/1 var(--font-head); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.hl-seg-btn {
  padding: 3px 10px; font: 700 11px/1.5 var(--font-head); color: var(--text);
  background: linear-gradient(180deg, #5f6e54, var(--panel-2)); border: 1px solid; border-color: var(--raised);
}
.hl-seg-btn + .hl-seg-btn { border-left-color: #2b3024; }
.hl-seg-btn:hover { color: var(--hi); }
.hl-seg-btn.is-active { color: var(--hi); background: var(--well); border-color: var(--sunken); }
.hl-mapform { display: flex; align-items: center; gap: 0; }
.hl-mapform select {
  width: auto; min-width: 150px; padding: 3px 26px 3px 6px; font: 11px var(--font); color: var(--text); border-radius: 0;
  background-color: var(--well); background-position: right 6px center; border: 1px solid; border-color: var(--sunken);
}
.hl-mapform select:focus { box-shadow: none; border-color: var(--sunken); background-color: var(--well); }
.hl-note { margin: 0; padding: 6px 12px; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--bevel-lo); }

/* ---- a player ---------------------------------------------------------------------------- */

.hl-readouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.hl-readout {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; min-width: 0;
  background: var(--well); border: 1px solid; border-color: var(--sunken); outline: 1px solid #3c4434;
}
.hl-readout-label { font: 700 10px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.hl-readout-value { font: 700 24px/1.2 var(--font-head); color: #f0f2ea; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hl-readout.is-lead .hl-readout-value { color: var(--accent); }
.hl-readout-foot { font-size: 11px; color: var(--muted); }
.hl-bar-label { display: block; }
.hl-bar { display: block; height: 3px; margin-top: 3px; background: #1d2018; }
.hl-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8c9a5e, var(--hi)); }
.hl-counts td:first-child { width: 70%; }

.hl-feed { list-style: none; margin: 0; padding: 0; background: var(--well); }
.hl-feed li { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; padding: 5px 10px; border-bottom: 1px solid #262a20; }
.hl-feed li:nth-child(even) { background: var(--row-alt); }
.hl-feed li:last-child { border-bottom: 0; }
.hl-feed-mark { width: 10px; font-weight: 700; text-align: center; }
.hl-feed .is-kill .hl-feed-mark { color: var(--live); }
.hl-feed .is-death .hl-feed-mark { color: var(--dead); }
.hl-feed-what { flex: 1; min-width: 0; }
.hl-feed-meta { color: var(--muted); font-size: 11px; }

/* ---- maps: a card is the screenshot at its own 160x120, then the name and the numbers ------ */

.hl-maps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.hl-map {
  display: flex; gap: 12px; padding: 8px; min-width: 0;
  background: var(--panel); border: 1px solid; border-color: var(--raised); outline: 1px solid #15180f;
}
.hl-map.is-live { outline: 1px solid var(--accent); }
.hl-map-shot {
  position: relative; flex: none; width: 160px; height: 120px; overflow: hidden;
  background: #15180f; border: 1px solid; border-color: var(--sunken);
}
.hl-map-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hl-map-noshot {
  display: grid; place-items: center; height: 100%; padding: 8px; text-align: center;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 6px, transparent 6px 12px), linear-gradient(180deg, #2f3528, #1d2018);
}
.hl-map-noshot span { font: 700 12px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); overflow-wrap: anywhere; }
.hl-map-live {
  position: absolute; left: 4px; top: 4px; padding: 2px 6px; font: 700 10px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .12em;
  color: var(--on-accent); background: var(--accent); border: 1px solid; border-color: #ffd699 #7a3f02 #7a3f02 #ffd699;
}
.hl-map-info { position: relative; display: flex; flex-direction: column; flex: 1; min-width: 0; padding-top: 2px; }
.hl-map-num {
  position: absolute; right: 0; top: -4px; font: 700 34px/1 var(--font-head);
  color: transparent; -webkit-text-stroke: 1px #5f6e54;
}
.hl-map-name { margin: 0; padding-right: 48px; font: 700 15px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: #f0f2ea; text-shadow: 0 1px 0 #000; overflow-wrap: anywhere; }
.hl-map.is-live .hl-map-name { color: var(--accent); }
.hl-map-size { margin-top: 4px; font: 700 10px/1 var(--font-head); text-transform: uppercase; letter-spacing: .14em; color: var(--hi); }
.hl-map-credit { margin: 4px 0 0; padding-right: 48px; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.hl-map-credit a { color: var(--hi); }
.hl-map-stats { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 0; margin: auto 0 0; background: var(--well); border: 1px solid; border-color: var(--sunken); }
.hl-map-stats div { padding: 4px 8px; min-width: 0; }
.hl-map-stats div + div { border-left: 1px solid #262a20; }
.hl-map-stats dt { font: 700 9px/1.3 var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.hl-map-stats dd { margin: 0; font-size: 12px; font-weight: 700; color: #f0f2ea; white-space: nowrap; }

/* ---- the error page and the starter's leftovers ------------------------------------------- */

.card { background: var(--panel); border: 1px solid; border-color: var(--raised); border-radius: 0; box-shadow: none; }
.btn { border-radius: 0; }

/* ---- narrow screens: usable, not optimised ----------------------------------------------- */

@media (max-width: 860px) {
  .hl-cols, .hl-cols-even { grid-template-columns: minmax(0, 1fr); }
  .hl-hero { grid-template-columns: minmax(0, 1fr); }
  .hl-maps { grid-template-columns: minmax(0, 1fr); }
  .hl-readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { padding: 8px 12px; min-height: 0; gap: 8px; }
  .brand-name { display: none; }
  .nav { margin-left: 4px; flex: 1 1 0; min-width: 0; flex-wrap: wrap; }
  .nav-link { padding: 8px 10px; }
  .search { order: 10; flex: 1 1 100%; }
  .search input, .search input:focus { width: 100%; }
}
@media (max-width: 620px) {
  .hl-hide-sm { display: none; }
  .container { padding: 16px 12px 24px; }
  .hl-hero { padding: 16px; gap: 16px; }
  .hl-emblem { width: 56px; height: 56px; font-size: 34px; border-width: 3px; }
  .hl-title { font-size: 24px; }
  .hl-join-row { grid-template-columns: minmax(0, 1fr) auto; }
  .hl-join-label { grid-column: 1 / -1; }
  .hl-address { font-size: 12px; padding: 0 8px; overflow-wrap: normal; white-space: nowrap; overflow: hidden; }
  .hl-players-cell { min-width: 0; }
  .hl-fill { display: none; }
  .hl-browser td, .hl-browser th { padding-left: 4px; padding-right: 4px; }
  .hl-btn-connect { padding: 0 14px; }
  .hl-btn-connect { justify-content: center; }
  .hl-map-shot { width: 120px; height: 90px; }
  .hl-map-stats div { padding: 4px 6px; }
  .hl-toolbar { gap: 8px; }
  .hl-tab { padding: 6px 10px 5px; }
}

/* gun game win boards under the leaderboard */
.hl-wins { margin-top: 14px; }

/* ---- the admin links on /report ----------------------------------------------------------- */

.hl-admin-links { margin: -4px 0 12px; font-size: 11px; color: var(--muted); }

/* ---- the weapon browser (/gungame/weapons): list | viewer and write-up | infobox ------------ */

.wpn { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.wpn-nav { position: sticky; top: 12px; margin: 0; display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.wpn-filter { padding: 8px; border-bottom: 1px solid var(--bevel-lo); display: grid; gap: 6px; }
.wpn-filter input[type=search] {
  width: 100%; padding: 4px 6px; font: 11px var(--font); color: var(--text); border-radius: 0;
  background: var(--well); border: 1px solid; border-color: var(--sunken);
}
.wpn-filter input[type=search]:focus { box-shadow: var(--ring); }
.wpn-by .hl-seg-btn { cursor: pointer; }
.wpn-by input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.wpn-by .hl-seg-btn:has(input:checked) { color: var(--hi); background: var(--well); border-color: var(--sunken); }
.wpn-by .hl-seg-btn:has(input:focus-visible) { box-shadow: var(--ring); }
.wpn-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-anchor: none; background: var(--well); }
.wpn-list { padding-bottom: 6px; }
.wpn-group {
  margin: 0; padding: 6px 10px 3px; font: 700 9px/1.3 var(--font-head); text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); background: var(--panel); border-bottom: 1px solid var(--bevel-lo); position: sticky; top: 0;
}
.wpn-list ul { list-style: none; margin: 0; padding: 2px 0; }
.wpn-item {
  display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 8px; font-size: 12px; color: var(--text);
  border-left: 3px solid var(--tier, var(--faint));
}
.wpn-item:hover { background: var(--row-hover); color: #fff; }
.wpn-item.is-active { background: var(--panel-2); color: var(--hi); box-shadow: inset 0 0 0 1px var(--bevel-hi); }
.wpn-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wpn-kills { font: 700 10px/1 var(--font-head); color: var(--tier, var(--muted)); }

/* tiers, as a game wiki colours rarity: grey, green, blue, purple, orange, gold */
.t-weak    { --tier: #a7ad9c; }
.t-medium  { --tier: #7fcf5a; }
.t-good    { --tier: #5fa8e8; }
.t-super   { --tier: #b886f0; }
.t-godlike { --tier: #f39a1e; }
.t-finale  { --tier: #f2d14b; }
.t-dm      { --tier: #8a937e; }

.wpn-detail {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; grid-template-areas: "viewer info" "main info";
  column-gap: 16px; align-items: start; min-width: 0;
}
.wpn-detail > .wpn-viewer { grid-area: viewer; }
.wpn-detail > .wpn-main { grid-area: main; }
.wpn-detail > .wpn-info { grid-area: info; }
.wpn-detail:not(:has(> .wpn-info)) { grid-template-areas: "viewer"; grid-template-columns: minmax(0, 1fr); }
.wpn-main { min-width: 0; }
/* at least a screen tall, so the page scrolls far enough for the sticky list to show its last group */
.wpn-detail { min-height: calc(100vh - 24px); }
.wpn-viewer {
  aspect-ratio: 16 / 9; display: grid; place-items: center; margin-bottom: 12px;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 60%, #2f3527, #15180f 75%);
  border: 1px solid; border-color: var(--sunken); outline: 1px solid #15180f;
}
.wpn-viewer.has-preview { position: relative; overflow: hidden; background: #1b1f17; }
.wpn-video, .wpn-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wpn-still { display: none; }
@media (prefers-reduced-motion: reduce) { .wpn-video { display: none; } .wpn-still { display: block; } }
.wpn-viewer-empty { text-align: center; color: var(--faint); }
.wpn-viewer-empty p { margin: 8px 0 0; font: 700 10px/1.3 var(--font-head); text-transform: uppercase; letter-spacing: .2em; }
.wpn-viewer-empty .hl-emblem { margin: 0 auto; opacity: .7; }
.wpn-viewer-name { font: 700 40px/1 var(--font-head); text-transform: uppercase; letter-spacing: .04em; color: rgba(225,230,216,.13); }
.wpn-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.wpn-head h2 { margin: 0; font: 700 24px/1.1 var(--font-head); text-transform: uppercase; letter-spacing: .03em; color: #f0f2ea; text-shadow: 0 2px 0 #000; }
.wpn-badge {
  padding: 2px 6px; font: 700 10px/1.3 var(--font-head); text-transform: uppercase; letter-spacing: .12em;
  color: var(--tier); border: 1px solid var(--tier); background: rgba(0,0,0,.25);
}
.wpn-origin-badge {
  padding: 2px 6px; font: 700 10px/1.3 var(--font-head); text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); border: 1px solid var(--bevel-hi); background: rgba(0,0,0,.25);
}
.wpn-origin-badge.o-ported   { color: #6fb3e0; border-color: #6fb3e0; }
.wpn-origin-badge.o-inspired { color: var(--hi); border-color: var(--hi); }
.wpn-origin-badge.o-stock    { color: var(--accent); border-color: var(--accent); }
.wpn-origin { margin: -2px 0 10px; font-size: 11px; color: var(--muted); }
.wpn-desc { margin: 0 0 12px; font-size: 13px; line-height: 1.55; }
.wpn-lore {
  margin: 0 0 16px; padding: 8px 12px; font-size: 12px; font-style: italic; line-height: 1.55; color: var(--muted);
  border-left: 3px solid var(--bevel-hi); background: rgba(0,0,0,.15);
}
.wpn-tip p { margin: 0; }
.wpn-section {
  margin: 16px 0 8px; padding-bottom: 4px; font: 700 11px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .14em;
  color: var(--hi); border-bottom: 1px solid var(--bevel-lo);
}
.wpn-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.wpn-mode { background: var(--panel); border: 1px solid; border-color: var(--raised); }
.wpn-mode h4 {
  margin: 0; padding: 4px 10px; font: 700 11px/1.3 var(--font-head); color: #f0f2ea;
  background: linear-gradient(180deg, var(--head-top), var(--head-bot)); border-bottom: 1px solid var(--bevel-lo);
}
.wpn-mode dl, .wpn-info dl { margin: 0; background: var(--well); }
.wpn-mode dl div, .wpn-info dl div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; padding: 3px 10px; border-bottom: 1px solid #262a20; }
.wpn-mode dl div:nth-child(even), .wpn-info dl div:nth-child(even) { background: var(--row-alt); }
.wpn-mode dt, .wpn-info dt { font: 700 9px/1.6 var(--font-head); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.wpn-mode dd, .wpn-info dd { margin: 0; font-size: 12px; color: var(--text); overflow-wrap: anywhere; }
.wpn-info { position: sticky; top: 12px; margin: 0; }
.wpn-info dl div { grid-template-columns: 104px minmax(0, 1fr); }
.wpn-changes { list-style: none; margin: 0; padding: 0; background: var(--well); }
.wpn-changes li { padding: 5px 10px; font-size: 12px; border-bottom: 1px solid #262a20; }
.wpn-changes li:nth-child(even) { background: var(--row-alt); }
.wpn-changes time, .hl-change-day h2 a { font-family: var(--mono); }
.wpn-changes time { margin-right: 6px; color: var(--hi); font-size: 11px; }

/* ---- the changelog ------------------------------------------------------------------------- */

.hl-changelog { padding-bottom: 4px; }
.hl-change-day h2 {
  margin: 0; padding: 6px 12px; font: 700 13px/1.2 var(--font-head); background: var(--panel-2);
  border-top: 1px solid var(--bevel-hi); border-bottom: 1px solid var(--bevel-lo);
}
.hl-change-day h2 a { color: var(--hi); }
.hl-change-day ul { list-style: none; margin: 0; padding: 0; background: var(--well); }
.hl-change-day li { display: flex; gap: 10px; align-items: baseline; padding: 4px 12px; font-size: 12px; line-height: 1.5; border-bottom: 1px solid #262a20; }
.hl-change-day li:nth-child(even) { background: var(--row-alt); }
.hl-scope {
  flex: none; width: 36px; text-align: center; font: 700 9px/1.6 var(--font-head); letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid currentColor;
}
.s-gg   { color: var(--accent); }
.s-dm   { color: #6fb3e0; }
.s-all  { color: var(--live); }
.s-site { color: var(--muted); }
.hl-change-wpn { margin-left: 4px; font-size: 11px; white-space: nowrap; }
.hl-change-wpn::before { content: "\2192\00a0"; color: var(--faint); }

@media (max-width: 1100px) {
  .wpn-detail { grid-template-columns: minmax(0, 1fr); grid-template-areas: "viewer" "info" "main"; }
  .wpn-info { position: static; margin-bottom: 12px; }
}
@media (max-width: 720px) {
  .wpn { grid-template-columns: minmax(0, 1fr); }
  .wpn-nav { position: static; max-height: 320px; }
  .wpn-detail { min-height: 0; }
  .wpn-viewer-name { font-size: 26px; }
}
