/* Glass UI: monotone near-black, frosted panels, and a few grainy mesh-gradient surfaces. */
:root {
  color-scheme: dark;
  --bg: #08080a;
  --ink: #f4f4f6;
  --ink-2: rgba(244, 244, 246, .72);
  --muted: rgba(244, 244, 246, .48);
  --faint: rgba(244, 244, 246, .30);
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --glass: rgba(255, 255, 255, .045);
  --glass-2: rgba(255, 255, 255, .075);
  --glass-hi: rgba(255, 255, 255, .11);
  --chip: rgba(255, 255, 255, .07);
  --panel: #141418;                    /* solid stand-in where glass can't be used (svg strokes) */
  --accent: #f4f4f6;
  --good: #8fe3b4; --good-bg: rgba(143, 227, 180, .12);
  --warn: #f3d27a; --warn-bg: rgba(243, 210, 122, .10);
  --bad: #ff9a8f;  --bad-bg: rgba(255, 154, 143, .10);
  --radius: 18px;
  --blur: saturate(150%) blur(16px);
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .075 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");   /* the page grain: same noise, faint */
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; letter-spacing: -.005em;
}

/* Ambient color fields behind the glass, plus film grain over everything. */
/* Background: film grain over a monotone gradient (soft white light falling off into near-black), fixed to the
   screen. The grain sits behind the page, so glass panels frost it and bend it at their edges. */
body { background:
    var(--grain) 0 0 / 180px,
    radial-gradient(70% 60% at 12% -8%, rgba(255, 255, 255, .085), transparent 62%),
    radial-gradient(55% 50% at 102% 32%, rgba(255, 255, 255, .05), transparent 66%),
    radial-gradient(75% 55% at 45% 112%, rgba(255, 255, 255, .055), transparent 66%),
    linear-gradient(170deg, #111114 0%, #0a0a0c 45%, #060607 100%);
  background-attachment: fixed; }

a { color: var(--ink); text-decoration: none; }
/* Page width: wide enough to use big monitors (the sidebar takes 232px), padding growing with the screen. */
.wrap { max-width: 1640px; margin: 0 auto; padding: 0 clamp(20px, 2.6vw, 44px); }
.legal-foot { margin: 36px 0 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; color: var(--faint); text-align: center; }
.legal-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* Left sidebar: a full-height glass column attached to the left edge; the page sits to its right. */
:root { --side: 232px; }
body { padding-left: var(--side); }
.side { position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--side); display: flex; flex-direction: column; gap: 14px;
  padding: 20px 14px 18px; background: rgba(10, 10, 12, .62); border-right: 1px solid var(--line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.side > .brand { padding: 6px 10px 12px; }
.side > .brand img { width: 172px; }
.side nav { flex: 1; display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.side nav::-webkit-scrollbar { display: none; }
.side .grp { margin: 16px 12px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.side .grp:first-child { margin-top: 4px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 11px; color: var(--muted);
  font-size: 14px; white-space: nowrap; transition: color .15s, background .15s; }
.side nav a svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.side nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.side nav a.on { color: var(--ink); background: var(--glass-hi); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.side form button { width: 100%; justify-content: center; }
/* The signed-in member's chip above Refresh (accounts/, n4vid.uk only) */
.side .me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 13px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03); transition: background .15s, border-color .15s; }
.side .me:hover, .side .me.on { background: var(--glass-2); border-color: var(--line-2); }
.side .me-av { width: 32px; height: 32px; border-radius: 50%; flex: none; overflow: hidden; display: grid; place-items: center;
  background: var(--glass-hi); font-weight: 700; font-size: 14px; }
.side .me-av img { width: 100%; height: 100%; object-fit: cover; }
.side .me-txt { display: grid; min-width: 0; line-height: 1.25; }
.side .me-txt b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .me-txt small { font-size: 12px; color: var(--muted); }
/* The staff admin site (sitepages/): its banner, the "admin" tag on pages the public site leaves out, and staff's link
   to it under the account chip on the public site */
.side nav a .ao { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; padding: 1px 6px; border-radius: 999px; color: var(--warn); background: var(--warn-bg); }
.side .adminlink { display: block; margin-top: 6px; padding: 6px 10px; border-radius: 11px; font-size: 13px; color: var(--warn);
  border: 1px dashed rgba(243, 210, 122, .3); text-align: center; }
.side .adminlink:hover { background: var(--warn-bg); }
.adminbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 9px 14px; margin: 0 0 18px;
  border-radius: 12px; font-size: 13px; color: var(--warn); background: var(--warn-bg); border: 1px solid rgba(243, 210, 122, .25); }
.adminbar span { color: var(--ink-2); }
.adminbar a { margin-left: auto; color: var(--warn); }
.mbar, .scrim { display: none; }
/* The MAXED logo (static/brand/, white on transparent; black versions are there too) */
.brand { display: flex; align-items: center; }
.brand img { display: block; height: auto; }
.mbar .brand img { width: 104px; }

button, .btn { white-space: nowrap; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--glass-2);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: background .15s, transform .1s;
  display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { background: var(--glass-hi); }
button:active { transform: scale(.98); }
button.primary { background: #f4f4f6; color: #0b0b0d; border-color: transparent; font-weight: 600; }
button.primary:hover { background: #fff; }
button:disabled { opacity: .5; cursor: default; }

main { padding: 34px 0 64px; }
h1 { font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.03em; margin: 0 0 8px; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 36px 0 12px; }
.sub { color: var(--ink-2); margin: 0 0 22px; max-width: 760px; }
code { font: 13px ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--chip); padding: 1px 6px; border-radius: 6px; }

/* Glass surfaces */
.panel { position: relative; background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 20px 50px rgba(0, 0, 0, .35); }
.banner { padding: 11px 16px; border-radius: 14px; margin: 0 0 18px; border: 1px solid var(--line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }

/* Grainy mesh gradient: layered radial + conic fields with film grain on top. Used sparingly. */
.mesh { overflow: hidden; isolation: isolate; border-color: rgba(255, 255, 255, .14); }
.mesh::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(255, 112, 67, .85), transparent 55%),
    radial-gradient(70% 90% at 100% 15%, rgba(214, 62, 140, .55), transparent 60%),
    radial-gradient(100% 120% at 85% 110%, rgba(98, 72, 255, .9), transparent 60%),
    conic-gradient(from 210deg at 35% 65%, #1b1230, #2b1640, #121a3a, #1b1230); }
.mesh.cool::before {
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(70, 160, 255, .65), transparent 55%),
    radial-gradient(80% 110% at 0% 100%, rgba(40, 210, 190, .45), transparent 60%),
    radial-gradient(60% 80% at 60% 40%, rgba(120, 80, 255, .45), transparent 70%),
    conic-gradient(from 30deg at 60% 50%, #0e1626, #101b2e, #161230, #0e1626); }
.mesh::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--noise);
  opacity: .22; mix-blend-mode: overlay; }

/* Forms */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 16px; margin-bottom: 16px; }
.filters label { display: flex; flex-direction: column; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); gap: 6px; }
select, input { font: inherit; font-size: 14px; color: var(--ink); padding: 7px 12px; border-radius: 12px;
  border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); outline: none; transition: border-color .15s;
  color-scheme: dark; }
select:focus, input:focus { border-color: rgba(255, 255, 255, .35); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: #16161a; color: var(--ink); }
input[type=checkbox] { accent-color: #f4f4f6; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
td.num, th.num { text-align: right; }
td.reason { white-space: normal; color: var(--muted); font-size: 13px; min-width: 220px; }
tr:last-child td { border-bottom: 0; }
.who { font-weight: 600; }
.small { font-size: 12px; color: var(--muted); }
.pick { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: 12px;
  border: 1px solid var(--line-2); }
.pick.over { background: rgba(255, 255, 255, .92); color: #0b0b0d; border-color: transparent; }
.pick.under { background: var(--chip); color: var(--ink); }
.edge.pos { color: var(--good); font-weight: 600; }
.edge.neg { color: var(--muted); }
.chip { display: inline-block; background: var(--chip); border-radius: 999px; padding: 1px 8px; font-size: 11px;
  color: var(--ink-2); border: 1px solid var(--line); }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card { padding: 18px 20px; }
.card .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.card .v { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 4px; }
.slip { padding: 18px 20px; margin-bottom: 14px; }
.slip-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; margin-bottom: 8px; }
.slip-head .ev { font-size: 22px; font-weight: 700; color: var(--good); }
.muted { color: var(--muted); }
.empty { padding: 34px; text-align: center; color: var(--muted); }
.prose { max-width: 760px; }
.prose p, .prose li { color: var(--ink-2); }
svg text { fill: var(--muted); font-size: 11px; }
main, .panel, .table-wrap { min-width: 0; max-width: 100%; }
details summary { cursor: pointer; }

/* Narrow screens: a slim top bar with a menu button; the sidebar slides in over the page. */
@media (max-width: 900px) {
  body { padding-left: 0; }
  .mbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px;
    background: rgba(10, 10, 12, .72); border-bottom: 1px solid var(--line);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
  .mbar .menu { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }
  .mbar .menu svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .side { width: min(280px, 84vw); transform: translateX(-100%); transition: transform .22s ease; background: rgba(12, 12, 15, .94); }
  body.nav-open .side { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .5); }
  .scrim[hidden] { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 28px; }
  th, td { padding: 10px 8px; }
  .filters label { flex: 1 1 40%; }
}
