/* Anarchy Workspace — black, white and greys. Red only means "warning".
   Dark by default, light on request. Sharp edges, HUD-style frames, motion that respects "reduce motion". */

/* Fonts (static/fonts, SIL Open Font License): Chakra Petch for titles, labels and numbers, Barlow for text. */
@font-face { font-family: "Chakra Petch"; font-weight: 500; font-display: swap; src: url("/static/fonts/chakra-petch-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url("/static/fonts/chakra-petch-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700 800; font-display: swap; src: url("/static/fonts/chakra-petch-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/static/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: italic; font-display: swap; src: url("/static/fonts/barlow-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("/static/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/static/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("/static/fonts/barlow-latin-700-normal.woff2") format("woff2"); }

/* Corner brackets of the frames: registered so their colour and size can animate. */
@property --corner { syntax: "<color>"; inherits: false; initial-value: #5a5a5a; }
@property --corner-size { syntax: "<length>"; inherits: false; initial-value: 8px; }

:root {
  /* Light theme */
  --bg: #ededed;
  --panel: #ffffff;
  --raise: #f6f6f6;
  --hover: #e8e8e8;
  --line: #dcdcdc;
  --line-strong: #c4c4c4;
  --text: #141414;
  --text-strong: #000000;
  --muted: #555555;
  --faint: #8a8a8a;
  --accent: #0a0a0a;         /* the "brand" colour is black on light surfaces… */
  --accent-strong: #2b2b2b;
  --accent-soft: rgba(0, 0, 0, 0.06);
  --accent-ink: #ffffff;
  --glow: rgba(0, 0, 0, 0.18);
  --ok: #000000;            /* done / active: solid black (white in dark) */
  --warn: #6b6b6b;          /* waiting / on hold: grey */
  --danger: #c62f2f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.16);
  --backdrop: rgba(10, 10, 10, 0.45);
  --edge: rgba(0, 0, 0, 0.13);   /* outline of framed boxes */
  --frame: #8f8f8f;              /* their corner brackets */
  --sans: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Chakra Petch", "Bahnschrift", "Segoe UI", sans-serif;
  --mono: var(--display);        /* numbers, IDs, times: the squared HUD figures */
  --code: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --radius: 2px;
  --radius-sm: 2px;
  --cut: 10px; /* size of the chamfered corners */
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

/* Dark theme, and the always-dark surfaces (sidebar, console, login art) */
html[data-theme="dark"], .dark-surface {
  --bg: #0a0a0a;
  --panel: #121212;
  --raise: #171717;
  --hover: #1e1e1e;
  --line: #252525;
  --line-strong: #383838;
  --text: #e6e6e6;
  --text-strong: #ffffff;
  --muted: #9b9b9b;
  --faint: #626262;
  --accent: #ffffff;         /* …and white on dark ones */
  --accent-strong: #d4d4d4;
  --accent-soft: rgba(255, 255, 255, 0.07);
  --accent-ink: #0a0a0a;
  --glow: rgba(255, 255, 255, 0.28);
  --ok: #ffffff;
  --warn: #a3a3a3;
  --edge: rgba(255, 255, 255, 0.09);
  --frame: #5a5a5a;
  --danger: #f05252;
  --shadow-sm: none;
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.7);
  --backdrop: rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

* { box-sizing: border-box; scrollbar-width: thin; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  scrollbar-color: var(--line-strong) transparent;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text-strong); }
p a, td a, .link { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
p a:hover, td a:hover, .link:hover { text-decoration-color: var(--accent); }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: 0.01em; margin: 0; color: var(--text-strong); }
h1 { font-size: 44px; line-height: 1; text-transform: uppercase; letter-spacing: 0.03em; }
h2 { font-size: 20px; text-transform: uppercase; letter-spacing: 0.06em; }
h3 { font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; }
.mono { font-family: var(--mono); font-weight: 600; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
code, kbd, textarea.mono, .code { font-family: var(--code); font-weight: 400; letter-spacing: 0; font-size: 0.9em; }
/* Thin scrollbars everywhere, so wide tables and boards stay clean. */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
[hidden] { display: none !important; }
::selection { background: var(--text-strong); color: var(--bg); }

/* --- Logo ------------------------------------------------------------------- */
/* The mark is inline SVG (logo() in deps.py) and takes the text colour, so it is white on dark and black on light. */
.logo-svg { display: block; color: var(--text-strong); overflow: visible; }
.logo-svg .logo-stroke { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-dasharray: 1; stroke-dashoffset: 0; opacity: 0; }

/* The brand lockup: ANARCHY over ESPORTS & ACADEMY, white and grey. */
.lockup { display: inline-flex; flex-direction: column; line-height: 1; }
.lockup-word { font: 700 17px/1 var(--display); letter-spacing: .2em; color: var(--text-strong); font-stretch: condensed; }
.lockup-sub { margin-top: 5px; font: 600 8.5px/1 var(--display); letter-spacing: .42em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

/* --- Shell ---------------------------------------------------------------- */

.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  grid-template-rows: 60px 1fr;
  min-height: 100vh;
}
.sidebar {
  grid-row: 1 / -1;
  background: #080808;
  color: var(--muted);
  border-right: 1px solid #1c1c1c;
  padding: 0 12px 20px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.side-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 10px 26px;
  color: var(--text-strong);
}
.side-brand .logo-svg { width: 30px; height: 48px; flex-shrink: 0; }
.side-label { font: 600 10px/1.2 var(--display); letter-spacing: 0.24em; text-transform: uppercase; color: var(--faint); padding: 18px 12px 8px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 12px; margin: 1px 0; border-radius: var(--radius-sm); color: var(--muted);
  position: relative; font: 600 12px/1.3 var(--display); letter-spacing: 0.14em; text-transform: uppercase;
}
.sidebar a:hover { color: var(--text-strong); background: rgba(255, 255, 255, 0.05); }
.sidebar a.active { color: var(--text-strong); background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)); }
.sidebar a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sidebar .ext { color: var(--faint); font-size: 12px; }
.sidebar hr { border-top-color: #1f1f1f; margin: 12px 8px; }
.side-foot { margin-top: auto; padding: 16px 12px 0; font: 600 10.5px var(--display); color: var(--faint); letter-spacing: 0.14em; text-transform: uppercase; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.top-brand { display: none; align-items: center; gap: 10px; color: var(--text-strong); }
.top-brand .logo-svg { width: 20px; height: 32px; }
.top-brand .lockup-word { font-size: 14px; }
.top-brand .lockup-sub { font-size: 7px; }
.search-trigger {
  flex: 0 1 440px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--faint);
  font: inherit;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--muted); }
kbd {
  font-family: var(--mono); font-size: 10.5px;
  border: 1px solid var(--line-strong); border-radius: 0;
  padding: 1px 6px; color: var(--muted); background: var(--raise);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid transparent; border-radius: var(--radius);
  background: none; color: var(--muted); cursor: pointer; position: relative; font-size: 18px;
}
.icon-btn:hover { background: var(--hover); color: var(--text-strong); }
.bell .badge {
  position: absolute; top: 3px; right: 1px;
  background: var(--danger); color: #fff;
  font: 600 10px/16px var(--sans);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.theme-toggle .moon { display: none; }
html[data-theme="dark"] .theme-toggle .moon { display: block; }
html[data-theme="dark"] .theme-toggle .sun { display: none; }
.nav-toggle { display: none; }

.profile-menu { position: relative; }
.profile-menu summary { list-style: none; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 10px 4px 4px; border-radius: var(--radius); }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu summary:hover { background: var(--hover); }
.avatar {
  width: 30px; height: 30px; border-radius: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--text-strong); color: var(--bg);
  font: 700 13px var(--display);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}
.profile-name { color: var(--text); font-weight: 500; }
.menu {
  position: absolute; right: 0; top: 46px; width: 230px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px; box-shadow: var(--shadow-lg);
}
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu a, .menu button {
  display: block; width: 100%; text-align: left; padding: 8px 10px;
  background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; border-radius: var(--radius-sm);
}
.menu a:hover, .menu button:hover { background: var(--hover); }

.content { padding: 36px 44px 90px; min-width: 0; max-width: 1320px; width: 100%; }

/* Shown on every page while the Director is viewing as someone else: impossible to miss. */
.view-as-bar {
  position: sticky; top: 68px; z-index: 15; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: -8px 0 24px; padding: 12px 14px 12px 18px; color: #fff;
  background: repeating-linear-gradient(-45deg, #111 0 14px, #1c1c1c 14px 28px); border: 1px solid #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12), var(--shadow-lg);
  --accent: #fff; --accent-strong: #d4d4d4; --accent-ink: #0a0a0a;
}
.view-as-bar span { flex: 1; min-width: 240px; font-size: 13.5px; }
.view-as-bar strong { font: 700 13px var(--display); letter-spacing: .14em; text-transform: uppercase; margin-right: 4px; }
/* Grouped menu entries (Work, Stats, Library): the pages fold out under the entry when you are in it,
   and tabs at the top of the page switch between them. */
.sidebar .nav-more { margin-left: auto; min-width: 18px; padding: 0 4px; text-align: center; font: 600 9.5px/1.6 var(--display); color: var(--faint); border: 1px solid var(--line-strong); }
.sidebar a.active .nav-more { color: var(--text-strong); border-color: var(--text-strong); }
.sidebar .nav-children { list-style: none; margin: 2px 0 6px 14px; padding: 0 0 0 10px; border-left: 1px solid #262626; }
.sidebar .nav-children a { padding: 5px 10px; font-size: 11px; color: var(--faint); }
.sidebar .nav-children a.active { color: var(--text-strong); background: none; }
.sidebar .nav-children a.active::before { left: -11px; top: 6px; bottom: 6px; width: 2px; }
.group-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: -6px 0 22px; }
.group-tabs .group-name { margin-right: 10px; font: 600 10.5px var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--faint); }
.group-tabs a { padding: 6px 14px; font: 600 11px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--edge); }
.group-tabs a:hover { color: var(--text-strong); border-color: var(--line-strong); }
.group-tabs a.active { color: var(--accent-ink); background: var(--text-strong); border-color: var(--text-strong); }
/* --- Page structure ------------------------------------------------------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 34px; flex-wrap: wrap; }
.eyebrow {
  font: 600 11px/1.2 var(--display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint);
  margin-bottom: 10px;
}
.eyebrow::before { content: "//"; margin-right: 8px; color: var(--accent); letter-spacing: 0; }
.eyebrow .num { color: var(--accent); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.section { margin-bottom: 36px; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding-bottom: 10px; margin-bottom: 12px;
  /* a hairline with a bright stub on the left */
  background: linear-gradient(var(--accent) 0 0) 0 100% / 34px 1px no-repeat, linear-gradient(var(--line) 0 0) 0 100% / 100% 1px no-repeat;
}
.section-title { font: 600 12px/1.2 var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-strong); }
.section-title::before { content: ""; display: inline-block; width: 6px; height: 6px; background: var(--accent); margin-right: 10px; vertical-align: 1px; }
.section-head a { font: 600 11px var(--display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.section-head a:hover { color: var(--text-strong); }

.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* --- Frames ------------------------------------------------------------------ */
/* Every box that holds information gets a thin edge and four corner brackets, like a game HUD.
   The top-left bracket is always bright; the others light up and grow when the pointer is on the box. */
.panel, .stats, details.drawer, .table-wrap, .rows, .column, .card, .week-day, .empty {
  --corner: var(--frame);
  --corner-size: 8px;
  --surface: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 0;
  background:
    linear-gradient(var(--accent) 0 0) 0 0 / var(--corner-size) 2px,
    linear-gradient(var(--accent) 0 0) 0 0 / 2px var(--corner-size),
    linear-gradient(var(--corner) 0 0) 100% 0 / var(--corner-size) 2px,
    linear-gradient(var(--corner) 0 0) 100% 0 / 2px var(--corner-size),
    linear-gradient(var(--corner) 0 0) 0 100% / var(--corner-size) 2px,
    linear-gradient(var(--corner) 0 0) 0 100% / 2px var(--corner-size),
    linear-gradient(var(--corner) 0 0) 100% 100% / var(--corner-size) 2px,
    linear-gradient(var(--corner) 0 0) 100% 100% / 2px var(--corner-size),
    var(--surface);
  background-repeat: no-repeat;
  background-origin: border-box;
  box-shadow: var(--shadow-sm);
  transition: --corner .3s, --corner-size .35s var(--ease), border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.panel:hover, .stats:hover, details.drawer:hover, .table-wrap:hover, .rows:hover, .card:hover, .week-day:hover {
  --corner: var(--accent); --corner-size: 13px;
}
/* Inside a framed box, lists and tables sit flat. */
:is(.panel, details.drawer, .card) :is(.table-wrap, .rows, .empty) {
  border: 0; background: none; box-shadow: none; padding-left: 0; padding-right: 0;
}

.panel { padding: 22px; }
.panel + .panel { margin-top: 16px; }
a.panel:hover { border-color: var(--line-strong); color: inherit; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); overflow: hidden; }
.stat { padding: 18px 22px 16px; border-right: 1px solid var(--line); transition: background .2s; }
.stat:last-child { border-right: 0; }
.stat::before { content: ""; display: block; width: 16px; height: 2px; margin-bottom: 14px; background: var(--line-strong); transition: width .35s var(--ease), background .35s; }
.stat:hover { background: var(--accent-soft); }
.stat:hover::before { width: 42px; background: var(--accent); }
.stat-value { font: 700 46px/1 var(--display); letter-spacing: 0.01em; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.stat-label { font: 600 10.5px/1.2 var(--display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); margin-top: 8px; }

/* Nothing to show: a dashed box instead of a lonely line of text. */
.empty {
  border-style: dashed; border-color: var(--line-strong); --surface: transparent;
  padding: 18px 18px; font: 600 11px/1.4 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint);
}
.empty::before { content: "// "; color: var(--muted); }
:is(.panel, details.drawer, .card) .empty { padding: 10px 0; }

/* --- Lists & tables ------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font: 600 10.5px/1.2 var(--display); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--faint); padding: 14px 14px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.table-wrap > table > thead th { background: color-mix(in srgb, var(--raise) 55%, transparent); }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child > td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--accent-soft); }
.table-wrap { overflow-x: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font: 600 16px/1.2 var(--display); color: var(--text-strong); }
td.num.zero, .nil { color: var(--faint); }

/* A person: their number as a small tag, then the name. */
.person-link { display: inline-flex; align-items: center; gap: 9px; color: var(--text-strong); font-weight: 600; white-space: nowrap; }
.person-link:hover .person-name { text-decoration: underline; text-underline-offset: 3px; }
.id-tag, .chip {
  display: inline-block; font: 600 10.5px/1.5 var(--display); letter-spacing: 0.06em; color: var(--muted);
  border: 1px solid var(--line-strong); padding: 0 5px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chip { color: var(--text-strong); border-color: var(--accent); }
/* Small labels on cards and rows: game, role, source, dates. */
.tag {
  display: inline-flex; align-items: center; gap: 5px; font: 600 10px/1.6 var(--display); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); background: var(--accent-soft); padding: 1px 7px; white-space: nowrap;
}
a.tag:hover { color: var(--text-strong); }
.tag-strong { color: var(--accent-ink); background: var(--text-strong); }
.tag-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
/* A player's rank: six chevrons that fill up from Recruit (1) to Legend (6). */
.rank { display: inline-flex; align-items: center; gap: 7px; font: 600 10.5px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--text-strong); white-space: nowrap; vertical-align: middle; }
.rank-mark { width: 12px; height: 19px; flex-shrink: 0; overflow: visible; }
.rank-mark path { fill: none; stroke-width: 1.8; stroke-linecap: square; stroke-linejoin: miter; }
.rank-mark .on { stroke: var(--text-strong); }
.rank-mark .off { stroke: var(--line-strong); }
.rank-1 .rank-name, .rank-2 .rank-name { color: var(--muted); }
.rank-5 .rank-mark, .rank-6 .rank-mark { filter: drop-shadow(0 0 3px var(--glow)); }
.rank-6 .rank-name { text-shadow: 0 0 12px var(--glow); }
.profile-head .rank { font-size: 12px; }
.profile-head .rank-mark { width: 15px; height: 24px; }
/* The whole ladder, current rank lit (profile). */
.rank-ladder { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.rank-ladder li { display: flex; justify-content: center; padding: 14px 6px; border: 1px solid var(--edge); background: var(--panel); opacity: .45; transition: opacity .2s, border-color .2s; }
.rank-ladder li.passed { opacity: .75; }
.rank-ladder li.current { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 22px -8px var(--glow); }
.rank-ladder .rank { flex-direction: column; gap: 8px; }
.rank-ladder .rank-mark { width: 16px; height: 25px; }
@media (max-width: 700px) { .rank-ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Team tag before a player's name (ANR | Amir), the Anarchy emblem of the first (white) and second (red)
   teams, and in-team roles. The emblem is the logo used as a stencil, so it takes any colour. */
.team-tag { font: 700 .92em var(--display); letter-spacing: .06em; color: var(--muted); margin-right: 7px; padding-right: 7px; border-right: 1px solid var(--line-strong); }
.emblem {
  display: inline-block; flex-shrink: 0; width: 11px; height: 17px; vertical-align: -3px; background: var(--text-strong);
  -webkit-mask: url("/static/brand/logo-white.png") center / contain no-repeat; mask: url("/static/brand/logo-white.png") center / contain no-repeat;
}
.emblem-second { background: #e5383b; }
.emblem-lg { width: 20px; height: 32px; vertical-align: -6px; }
.emblem-first.emblem-lg { filter: drop-shadow(0 0 6px var(--glow)); }
.emblem-second.emblem-lg { filter: drop-shadow(0 0 6px rgba(229, 56, 59, .5)); }
.role-chip { display: inline-block; margin: 0 4px 2px 0; padding: 0 6px; font: 600 9.5px/1.7 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--text-strong); border: 1px solid var(--accent); white-space: nowrap; }
.division-label { display: inline-flex; align-items: center; gap: 8px; font: 600 10.5px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--text-strong); }
/* Role toggles inside the roster sheet. */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-toggle { padding: 2px 7px; font: 600 9.5px/1.5 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); background: none; border: 1px dashed var(--line-strong); cursor: pointer; }
.chip-toggle:hover { color: var(--text-strong); border-color: var(--text-strong); }
.chip-toggle[aria-pressed="true"] { color: var(--accent-ink); background: var(--text-strong); border: 1px solid var(--text-strong); }
/* A thin level meter under a score (fill = --v). */
.meter { display: block; width: 58px; height: 3px; margin: 6px 0 0 auto; background: linear-gradient(var(--text-strong) 0 0) 0 0 / var(--v, 0%) 100% no-repeat, var(--hover); }

.rows { list-style: none; margin: 0; padding: 0 16px; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); transition: padding-left .2s var(--ease); }
.rows li:last-child { border-bottom: 0; }
.rows li:hover { padding-left: 6px; }
.rows .meta { color: var(--faint); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rows .meta.mono { color: var(--text-strong); font-size: 14px; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 0; margin: 0; }
.kv dt { color: var(--faint); font: 600 10.5px/1.2 var(--display); letter-spacing: 0.16em; text-transform: uppercase; padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
.kv dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }

/* Status pills stay black, white and grey: solid = done/active, outline = in progress, dashed = waiting, red = stopped. */
.pill {
  display: inline-block; font: 600 10px/1.6 var(--display); letter-spacing: 0.14em; text-transform: uppercase;
  padding: 1px 8px; border: 1px solid var(--line-strong); border-radius: 0; color: var(--muted); white-space: nowrap;
}
.pill-accent { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 10px var(--glow); }
.pill-ok { border-color: var(--ok); background: var(--ok); color: var(--bg); }
.pill-warn { border-color: var(--warn); border-style: dashed; color: var(--warn); }
.pill-danger { border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: var(--danger); }

/* --- Tabs ------------------------------------------------------------------ */

.tabs { display: flex; gap: 2px; box-shadow: inset 0 -1px var(--line); margin-bottom: 28px; overflow-x: auto; overflow-y: hidden; }
.tabs a {
  padding: 11px 16px; color: var(--muted); border-bottom: 2px solid transparent;
  font: 600 11.5px/1.2 var(--display); letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap;
}
.tabs a:hover { color: var(--text-strong); background: var(--accent-soft); }
.tabs a.active { color: var(--text-strong); border-bottom-color: var(--accent); background: linear-gradient(to top, var(--accent-soft), transparent 80%); }

/* --- Forms & buttons ------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 0;
  padding: 9px 16px; font: 600 11.5px/1.2 var(--display); letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--hover); color: var(--text-strong); border-color: var(--text-strong); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }
.btn-ghost { background: none; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: var(--hover); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-small { padding: 6px 11px; font-size: 10.5px; }
.btn kbd { font-size: 10px; text-transform: none; }
form.inline { display: inline; }

label { display: block; font: 600 10.5px/1.3 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], input[type=url], input[type=time],
input[type=tel], input[type=search], select, textarea {
  width: 100%; background: var(--panel); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 0;
  padding: 9px 11px; font: inherit;
}
/* Own drop-down arrow, the same in every browser and theme. */
select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 10px 6px;
}
select option { background: var(--panel); color: var(--text); }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-soft); outline-offset: 0; border-color: var(--accent);
}
.hint { font-size: 13px; color: var(--faint); margin-top: 6px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 1 1 160px; }

details.drawer { margin-bottom: 22px; }
details.drawer > summary {
  cursor: pointer; padding: 14px 18px; color: var(--text-strong); list-style: none;
  font: 600 12px/1.2 var(--display); letter-spacing: 0.16em; text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
}
details.drawer > summary::before {
  content: "+"; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border: 1px solid var(--line-strong); color: var(--accent); font: 700 14px/1 var(--display); transition: transform .3s var(--ease), border-color .2s;
}
details.drawer > summary:hover::before { border-color: var(--accent); }
details.drawer[open] > summary::before { content: "–"; transform: rotate(180deg); }
details.drawer > summary::-webkit-details-marker { display: none; }
details.drawer > .drawer-body { padding: 4px 18px 18px; }

.flash {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  border: 1px solid var(--edge); border-left: 3px solid var(--ok);
  background: var(--panel); padding: 12px 16px; margin-bottom: 24px; border-radius: 0;
  box-shadow: var(--shadow-sm);
}
.flash-error { border-left-color: var(--danger); }
.flash a { text-decoration: underline; }
.copy-row { display: flex; gap: 6px; flex: 1 1 360px; }
.copy-row input { flex: 1; font-family: var(--code); font-weight: 400; }

/* --- Sheets (tables edited in place) ------------------------------------------ */
/* Editable cells look like plain text with a small bracket in the corner; hovering a row outlines its
   fields, clicking one opens it. Changed cells are marked until "Apply changes". */

table.sheet td { padding: 4px 6px; vertical-align: middle; }
table.sheet td:first-child { padding-left: 10px; }
.cell {
  width: 100%; min-width: 70px;
  background-color: transparent !important; border: 1px solid transparent !important; border-radius: 0 !important;
  color: var(--text); font: inherit; padding: 7px 8px !important;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
table.sheet .cell:not(select):not([type=date]):not([type=hidden]), .info-grid .cell:not(select):not([type=date]) {
  background-image: linear-gradient(var(--line-strong) 0 0), linear-gradient(var(--line-strong) 0 0);
  background-repeat: no-repeat; background-position: right bottom, right bottom; background-size: 7px 1px, 1px 7px;
}
select.cell { padding-right: 26px !important; min-width: 150px; background-position: right 8px center; }
td select.cell[name$=".status"], .card select {
  font: 600 11px/1.2 var(--display); letter-spacing: 0.12em; text-transform: uppercase;
}
td select.cell[name$=".status"] { min-width: 110px; }
input.cell[type=date] { min-width: 140px; font-family: var(--display); font-weight: 500; }
input.cell[type=number] { font-family: var(--display); font-weight: 600; }
table.sheet tr:hover .cell:not([type=hidden]), .cell:hover { border-color: var(--edge) !important; }
.cell:hover { border-color: var(--line-strong) !important; }
.cell:focus { outline: none; border-color: var(--accent) !important; background-color: var(--bg) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
.cell::placeholder { color: var(--faint); }
.cell-text { display: block; padding: 7px 8px; color: var(--muted); }
td.dirty, .sheet-cell.dirty { background: var(--accent-soft); box-shadow: inset 2px 0 var(--accent); }
td.dirty .cell { color: var(--text-strong); }
.new-row td { background: var(--raise); }
.deleting td, .deleting .cell { text-decoration: line-through; color: var(--faint) !important; opacity: .6; }
.deleting [data-delete-row] { color: var(--accent); opacity: 1; text-decoration: none; }
.row-open {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  color: var(--faint); background: none; border: 1px solid transparent; cursor: pointer; font-size: 15px; padding: 0;
  transition: color .15s, border-color .15s, transform .2s var(--ease);
}
.row-open:hover { color: var(--text-strong); border-color: var(--line-strong); transform: translateX(3px); }
.add-row { margin-top: 10px; }
textarea.cell { min-height: 0; resize: vertical; line-height: 1.5; }
.apply-bar {
  position: sticky; bottom: 18px; z-index: 10;
  display: flex; align-items: center; gap: 12px; justify-content: flex-end;
  margin-top: 16px; padding: 10px 12px 10px 18px;
  --accent: #ffffff; --accent-strong: #d4d4d4; --accent-ink: #0a0a0a; --glow: rgba(255, 255, 255, .28);
  background: #0a0a0a; color: #e6e6e6; border: 1px solid #2a2a2a; border-top: 2px solid #fff;
  border-radius: 0; box-shadow: var(--shadow-lg);
}
.apply-bar span { margin-right: auto; color: #a3a3a3; font: 600 11px var(--display); letter-spacing: .14em; text-transform: uppercase; }
.apply-bar strong { color: #fff; font: 700 15px var(--display); margin-right: 4px; }
.apply-bar .btn-ghost { color: #a3a3a3; }
.apply-bar .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.info-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr); border-top: 1px solid var(--line); }
.info-grid > * { border-bottom: 1px solid var(--line); }
.info-grid .info-label { color: var(--faint); font: 600 10.5px/1.3 var(--display); letter-spacing: .16em; text-transform: uppercase; padding: 13px 0 10px; }
.info-grid .info-label .cell { color: var(--faint); font: inherit; letter-spacing: inherit; text-transform: inherit; }
.info-grid .info-value { padding: 2px 0; }

/* --- Schedule week ----------------------------------------------------------- */

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.week-day { min-height: 170px; padding: 0 6px 6px; }
.week-day.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 24px -8px var(--glow); --corner: var(--accent); }
.week-head { display: flex; justify-content: space-between; padding: 11px 4px 9px; border-bottom: 1px solid var(--line); margin-bottom: 6px; font: 600 10.5px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.is-today .week-head { color: var(--accent); }
.week-event { display: flex; flex-direction: column; gap: 2px; padding: 8px 9px; margin-bottom: 6px; background: var(--raise); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 0; transition: border-color .15s, transform .2s var(--ease); }
.week-event:hover { border-color: var(--line-strong); color: inherit; transform: translateX(2px); }
.week-title { font-weight: 600; line-height: 1.3; }
.week-event.kind-training { border-left-color: var(--accent); }
.week-event.kind-scrim, .week-event.kind-match { border-left-color: var(--muted); border-left-style: dashed; }
.week-event.kind-vod_review { border-left-color: var(--faint); }
.week-event.cancelled { opacity: .45; text-decoration: line-through; }

.avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo { overflow: hidden; position: relative; }
.photo-form { margin-top: 6px; }
.photo-form input[type=file] { font-size: 12px; color: var(--muted); max-width: 200px; }

.md { line-height: 1.75; max-width: 760px; font-size: 16px; }
.md h2 { font-size: 22px; margin: 32px 0 10px; }
.md h3 { font-size: 17px; margin: 24px 0 8px; }
.md h4 { font: 600 12px var(--display); margin: 20px 0 6px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.md p { margin: 0 0 14px; }
.md ul, .md ol { padding-left: 22px; margin: 0 0 14px; }
.md li { margin-bottom: 5px; }
.md blockquote { margin: 0 0 14px; padding: 6px 16px; border-left: 3px solid var(--accent); color: var(--muted); background: var(--accent-soft); }
.md code { background: var(--hover); padding: 1px 5px; }
.kb-nav a { display: block; padding: 7px 12px; color: var(--muted); border-left: 2px solid transparent; }
.kb-nav a:hover { color: var(--text-strong); }
.kb-nav a.active { color: var(--text-strong); border-left-color: var(--accent); font-weight: 600; }
.kb-nav .kb-section { font: 600 10.5px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--faint); padding: 16px 12px 4px; }

.kb-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; }
@media (max-width: 820px) { .kb-layout { grid-template-columns: minmax(0, 1fr); } }

.hbar { display: grid; grid-template-columns: 140px 1fr 60px; gap: 12px; align-items: center; padding: 6px 0; font-size: 14px; }
.hbar .bar { height: 10px; }

@media (max-width: 1000px) {
  .week { grid-template-columns: minmax(0, 1fr); }
  .week-day { min-height: 0; }
}

/* --- Scores & progress bars ---------------------------------------------------- */
/* Bars are cut into blocks like a game meter: 10 blocks by default (scores out of 10),
   or one block per task where the template sets --n. */

.score-row { display: grid; grid-template-columns: 150px 1fr 76px; align-items: center; gap: 14px; padding: 9px 0; }
.score-name { color: var(--muted); font: 600 11px/1.3 var(--display); letter-spacing: .12em; text-transform: uppercase; }
.bar { --n: 10; height: 8px; background: var(--hover); position: relative; overflow: visible; }
.bar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--n) - 2px), var(--surface, var(--bg)) calc(100% / var(--n) - 2px) calc(100% / var(--n)));
}
.bar-fill {
  position: absolute; inset: 0 auto 0 0; background: var(--text-strong); box-shadow: 0 0 12px var(--glow);
  transform-origin: left; animation: grow 1.1s var(--ease) .2s both;
}
.bar-prev { position: absolute; top: -4px; bottom: -4px; width: 3px; z-index: 1; background: var(--muted); box-shadow: 0 0 0 2px var(--surface, var(--bg)); }
.score-value { font: 600 15px/1.2 var(--display); text-align: right; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.delta-up { color: var(--ok); }
.delta-down { color: var(--danger); }

.progression { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.prog-step { text-align: center; min-width: 56px; }
.prog-step .mono { font-size: 22px; color: var(--text-strong); }

/* A process shown as arrow-shaped steps (the Academy cycle). */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 4px; }
.steps li {
  position: relative; padding: 12px 22px 12px 24px; background: var(--panel); color: var(--muted);
  font: 600 11px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  transition: background .2s, color .2s;
}
.steps li:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); padding-left: 16px; }
.steps li:hover { background: var(--text-strong); color: var(--bg); }
.steps .step-index { display: block; font-size: 18px; letter-spacing: 0; color: var(--text-strong); margin-bottom: 4px; }
.steps li:hover .step-index { color: var(--bg); }
/* The role hierarchy, top to bottom. */
.ladder { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.ladder li {
  position: relative; display: grid; grid-template-columns: 34px minmax(110px, auto) minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 6px; border: 1px solid var(--edge); background: var(--panel);
}
.ladder li + li::before { content: ""; position: absolute; left: 30px; top: -7px; height: 6px; border-left: 1px dashed var(--line-strong); }
.ladder li.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ladder-level { font: 700 18px/1 var(--display); color: var(--faint); }
.ladder-name { font: 700 14px/1.2 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--text-strong); }
.ladder-desc { color: var(--muted); font-size: 13px; min-width: 0; }
.ladder-count { font: 600 11px var(--display); letter-spacing: .08em; color: var(--faint); white-space: nowrap; }
@media (max-width: 700px) { .ladder li { grid-template-columns: 30px minmax(0, 1fr) auto; } .ladder-desc, .ladder-count { display: none; } }

/* Every role's permissions side by side. */
.matrix th.matrix-role { text-align: center; white-space: nowrap; }
.matrix th.matrix-role a { color: var(--text-strong); }
.matrix .matrix-group td { padding: 16px 14px 6px; font: 600 10.5px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); background: none; border-bottom: 1px solid var(--line-strong); }
.matrix tbody tr.matrix-group:hover { background: none; box-shadow: none; }
.matrix .matrix-label { min-width: 220px; font-size: 13.5px; }
.matrix .matrix-cell { text-align: center; padding: 3px 4px; }
.matrix select.cell { min-width: 74px; width: 74px; margin: 0 auto; text-align: center; font: 600 10.5px var(--display); letter-spacing: .1em; text-transform: uppercase; padding: 5px 18px 5px 6px !important; background-position: right 5px center; }
.scope { display: inline-block; min-width: 54px; padding: 3px 6px; font: 600 10.5px var(--display); letter-spacing: .1em; text-transform: uppercase; }
.scope-off { color: var(--faint); }
.scope-own { color: var(--muted); }
.scope-team { color: var(--text); }
.scope-all { color: var(--text-strong); }
span.scope-all { background: var(--accent-soft); }
select.scope-all { color: var(--text-strong) !important; }
select.scope-off { color: var(--faint) !important; }
/* First and second team cards on the Teams page. */
.elite-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.elite-head h2 a { color: var(--text-strong); }
.elite-second { --corner: #e5383b; }
.elite-second::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: #e5383b; }
.elite-first::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--text-strong); box-shadow: 0 0 12px var(--glow); }
/* Checkbox rows (teams of a session) and small fold-out parts of a form. */
.check-row { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 8px 0 2px; }
.check-row .pick { padding: 4px 8px; border: 1px solid var(--edge); background: var(--raise); }
.check-row .pick:has(input:checked) { border-color: var(--accent); color: var(--text-strong); }
details.subdrawer { margin: 4px 0 16px; }
.private-pick { margin: 10px 0 4px; font-size: 13px; }
details.subdrawer > summary { cursor: pointer; list-style: none; font: 600 11px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
details.subdrawer > summary::before { content: "+ "; color: var(--accent); }
details.subdrawer[open] > summary::before { content: "– "; }
details.subdrawer > summary::-webkit-details-marker { display: none; }

/* Sessions on a profile: when, what, with which content. */
.session-list li.session-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: start; gap: 14px; padding: 14px 0; }
.session-list li.session-row:hover { padding-left: 0; }
.session-when { display: flex; flex-direction: column; gap: 2px; }
.session-when .mono { color: var(--text-strong); }
.session-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.session-body .card-tags { margin: 0; }
.session-title { font: 700 14px/1.3 var(--display); letter-spacing: .05em; text-transform: uppercase; color: var(--text-strong); }
.session-title.cancelled { text-decoration: line-through; color: var(--faint); }
/* Stars and the private to-do list. */
.star-btn { gap: 6px; }
.star-btn .star-icon { font-size: 14px; line-height: 1; letter-spacing: 0; }
.star-btn.on { color: var(--text-strong); border-color: var(--line-strong); }
.star-btn.on .star-icon { text-shadow: 0 0 10px var(--glow); }
.sidebar .starred a { justify-content: flex-start; gap: 8px; letter-spacing: .06em; text-transform: none; font: 500 13px/1.3 var(--sans); }
.sidebar .star-mini { color: var(--faint); font-size: 11px; }
.sidebar .starred a:hover .star-mini, .sidebar .starred a.active .star-mini { color: var(--text-strong); }
.sidebar .star-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-add { display: flex; gap: 6px; margin-bottom: 10px; }
.todo-add input { flex: 1; }
.todo-list li { justify-content: flex-start; gap: 10px; }
.todo-text { flex: 1; min-width: 0; }
.todo-check {
  width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--line-strong); background: none; color: var(--accent-ink); font: 700 12px/1 var(--display); cursor: pointer;
}
.todo-check:hover { border-color: var(--accent); }
.todo-list li.done .todo-check { background: var(--text-strong); border-color: var(--text-strong); }
.todo-list li.done .todo-text { color: var(--faint); text-decoration: line-through; }
/* Rankings: position, score with a meter, top three lit. */
.ranking .rank-pos { font: 700 18px var(--display); color: var(--faint); width: 48px; }
.ranking .rank-score { font-size: 18px; }
.ranking .rank-score .meter { width: 72px; }
.ranking tr.podium .rank-pos { color: var(--text-strong); }
.ranking tr.podium-1 { background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }
.ranking tr.podium-1 .rank-pos { font-size: 24px; text-shadow: 0 0 14px var(--glow); }
.ranking tr.podium-1 td:first-child { box-shadow: inset 3px 0 var(--accent); }
/* Documents page. */
.doc-filter { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 18px; }
.doc-filter .field { margin: 0; flex: 1 1 160px; }
.doc-filter .field:first-child { flex: 2 1 260px; }
.doc-week { margin-bottom: 18px; }
.doc-week-head { font: 600 11px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.doc-row { align-items: flex-start !important; }
.doc-owner { min-width: 0; flex: 1 1 40%; }
.doc-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: 1 1 50%; }
.doc-link { font: 600 11px/1.6 var(--display); letter-spacing: .06em; padding: 2px 8px; border: 1px solid var(--line-strong); color: var(--text-strong); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.doc-link:hover { border-color: var(--accent); background: var(--accent-soft); }
/* --- Boards ---------------------------------------------------------------- */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.column { --surface: color-mix(in srgb, var(--panel) 45%, var(--bg)); min-height: 140px; box-shadow: none; }
.column-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px 11px; border-bottom: 1px solid var(--line);
  font: 600 11px/1.2 var(--display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-strong);
}
.column-head .col-index { color: var(--faint); letter-spacing: 0.04em; }
.column-head .count {
  margin-left: auto; min-width: 24px; text-align: center; padding: 1px 5px;
  border: 1px solid var(--line-strong); color: var(--muted); letter-spacing: 0.04em;
}
.column:has(.card) .count { border-color: var(--accent); color: var(--text-strong); }
.column-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 70px; }
.column-empty { padding: 18px 6px; text-align: center; font: 600 10px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); border: 1px dashed var(--line); }
.column-body:has(.card) .column-empty { display: none; }

.card { --surface: var(--raise); padding: 13px 14px 12px; }
.card:hover { border-color: var(--line-strong); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.card-title { display: block; font: 700 15px/1.25 var(--display); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-strong); margin-bottom: 6px; }
.card-top .card-title { margin-bottom: 0; }
.card-age { font: 500 11px var(--display); color: var(--faint); white-space: nowrap; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.card-source { font-size: 13px; color: var(--muted); margin: -2px 0 8px; }
.card-source::before { content: "↳ "; color: var(--faint); }
.card-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--faint); font-size: 13px; flex-wrap: wrap; }
.card select { width: 100%; padding: 6px 28px 6px 9px; margin-top: 2px; background-color: var(--bg); border-color: var(--edge); }
.card select:hover { border-color: var(--line-strong); }
.card .overdue { color: var(--danger); }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); overflow: hidden; background: var(--panel); }
.segmented label { margin: 0; padding: 8px 16px; cursor: pointer; color: var(--muted); border-right: 1px solid var(--line); }
.segmented label:last-child { border-right: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--text-strong); color: var(--bg); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.assign-panel { margin-bottom: 14px; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; max-height: 320px; overflow-y: auto;
  border: 1px solid var(--line); padding: 12px; background: var(--raise); }
.pick-head { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 13px; }
.pick-head strong { margin-right: auto; }
.pick { display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 3px 4px; color: var(--text); font: 400 14px var(--sans); letter-spacing: 0; text-transform: none; cursor: pointer; }
.pick:hover { background: var(--hover); }
.card-group { font: 600 10.5px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
/* Card actions: one row of small commands under a dashed line. */
.card-actions { display: grid; grid-auto-flow: column; justify-content: space-between; gap: 2px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line-strong); }
.card-actions .btn-small { padding: 4px 2px; font-size: 10px; letter-spacing: .08em; background: none; border: 0; color: var(--muted); position: relative; }
.card-actions .btn-small::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 1px; height: 1px; background: currentColor; transform: scaleX(0); transition: transform .2s var(--ease); }
.card-actions .btn-small:hover { color: var(--text-strong); background: none; }
.card-actions .btn-small:hover::after { transform: scaleX(1); }
.card-actions .btn-danger, .card-actions .btn-danger:hover { color: var(--danger); }
.card[draggable="true"] { cursor: grab; }
.card.dragging { opacity: .4; }
.column-body.drop-target { background: var(--accent-soft); outline: 1px dashed var(--accent); outline-offset: -4px; }

/* --- New member form ----------------------------------------------------------- */
/* Numbered steps on the left, a live ID card on the right that fills in as you type. */

.onboard { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.onboard-steps { min-width: 0; }
.onboard-step { margin-bottom: 16px; }
.panel.onboard-step + .panel.onboard-step { margin-top: 0; }
.step-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.step-head h3 { font-size: 15px; letter-spacing: .14em; }
.step-head .hint { margin: 4px 0 0; }
.step-no { font: 700 30px/1 var(--display); color: var(--text-strong); min-width: 42px; }
.identity { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 20px; align-items: start; }
.identity-fields { min-width: 0; }

/* Photo picker: a dashed square that shows the picture once one is chosen. */
.dropzone {
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  width: 132px; height: 132px; margin: 0; cursor: pointer; overflow: hidden;
  border: 1px dashed var(--line-strong); background: var(--raise); color: var(--muted);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  transition: border-color .2s, color .2s, background .2s;
}
.dropzone:hover { border-color: var(--accent); color: var(--text-strong); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.dropzone-text { display: flex; flex-direction: column; gap: 6px; font: 600 12px var(--display); letter-spacing: .16em; }
.dropzone-text small { font: 500 9.5px var(--display); letter-spacing: .08em; text-transform: none; color: var(--faint); }
.has-photo .dropzone-text { opacity: 0; }

/* Newsroom: the story on the left, category / cover / publish on the right. */
.news-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.news-layout .panel + .panel { margin-top: 0; }
.news-body-input { font-size: 13px; line-height: 1.6; }
.label-text { display: block; font: 600 10.5px/1.3 var(--display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.cover-drop {
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  width: 100%; aspect-ratio: 16 / 9; margin: 0; cursor: pointer; overflow: hidden;
  border: 1px dashed var(--line-strong); background: var(--raise); color: var(--muted);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  transition: border-color .2s, color .2s, background .2s;
}
.cover-drop:hover { border-color: var(--accent); color: var(--text-strong); background: var(--accent-soft); }
.cover-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cover-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cover-drop.has-cover .dropzone-text { opacity: 0; }
.news-buttons { display: grid; gap: 10px; margin-top: 6px; }
.news-buttons .hint { margin: 0; }
.news-danger { margin-top: 28px; }
.newsroom-note { margin-top: 18px; }
@media (max-width: 980px) { .news-layout { grid-template-columns: 1fr; } }

/* An on/off switch drawn from a checkbox. */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; margin-bottom: 16px; color: var(--text-strong); font-size: 12px; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 20px; margin: 0; border: 1px solid var(--line-strong); background: var(--raise); position: relative; cursor: pointer; transition: background .2s, border-color .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; background: var(--muted); transition: transform .25s var(--ease), background .2s; }
.switch input:checked { background: var(--text-strong); border-color: var(--text-strong); }
.switch input:checked::after { transform: translateX(20px); background: var(--bg); }
.login-fields { border: 0; margin: 0; padding: 0; min-width: 0; transition: opacity .2s; }
.login-fields.off { opacity: .35; }
.onboard-submit { margin-top: 6px; }

/* The ID card preview. */
.id-card {
  position: sticky; top: 84px; padding: 18px 18px 16px; color: #e6e6e6;
  background: linear-gradient(160deg, #1b1b1b, #0a0a0a); border: 1px solid #2c2c2c;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
  box-shadow: var(--shadow-lg);
}
.id-card::before { content: ""; position: absolute; left: 0; top: 0; width: 64px; height: 2px; background: #fff; box-shadow: 0 0 14px rgba(255, 255, 255, .7); }
.id-card-top { display: flex; justify-content: space-between; font: 600 9.5px var(--display); letter-spacing: .24em; text-transform: uppercase; color: #8a8a8a; margin-bottom: 16px; }
.id-photo {
  width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative;
  background: repeating-linear-gradient(135deg, #151515 0 8px, #111 8px 16px); border: 1px solid #2c2c2c;
  font: 700 72px var(--display); color: #2e2e2e;
}
.id-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(.15) contrast(1.05); }
.id-name { margin-top: 14px; font: 700 24px/1.05 var(--display); letter-spacing: .04em; text-transform: uppercase; color: #fff; overflow-wrap: anywhere; }
.id-sub { margin-top: 4px; min-height: 1.2em; color: #9b9b9b; font-size: 13px; }
.id-facts { display: grid; grid-template-columns: 76px 1fr; gap: 6px 10px; margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed #333; }
.id-facts dt { font: 600 9.5px/1.6 var(--display); letter-spacing: .18em; text-transform: uppercase; color: #6f6f6f; }
.id-facts dd { margin: 0; font: 600 12.5px/1.4 var(--display); color: #e6e6e6; overflow-wrap: anywhere; }
.id-barcode { height: 22px; margin-top: 16px; opacity: .55; background: repeating-linear-gradient(90deg, #fff 0 2px, transparent 2px 4px, #fff 4px 5px, transparent 5px 9px, #fff 9px 12px, transparent 12px 14px); }

@media (max-width: 1000px) {
  .onboard { grid-template-columns: minmax(0, 1fr); }
  .id-card { display: none; }
}
@media (max-width: 560px) {
  .identity { grid-template-columns: minmax(0, 1fr); }
}
/* --- Profile header -------------------------------------------------------- */

.profile-head { display: flex; gap: 24px; align-items: center; margin-bottom: 28px; flex-wrap: wrap; }
.photo {
  width: 96px; height: 96px; flex-shrink: 0;
  background: var(--text-strong); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font: 700 34px var(--display);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}
.profile-sub { color: var(--muted); margin-top: 8px; }

/* --- Login & public pages: a black stage, the mark drawn in white ------------------- */

.auth {
  --bg: #050505;
  --mx: 50%; --my: 40%;       /* cursor position, set by fx.js */
  --px: 0; --py: 0;           /* cursor from the centre, -1 to 1 (fx.js) */
  position: relative; min-height: 100vh; overflow: hidden;
  background: #050505; color: var(--text);
  display: flex; flex-direction: column;
}

/* Intro: a white blade cuts the screen open. Played once per browser session. */
.auth-intro { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.auth-intro .half { position: absolute; left: 0; right: 0; height: 50.5%; background: #000; }
.auth-intro .half.top { top: 0; animation: open-top .9s var(--ease) .75s both; }
.auth-intro .half.bottom { bottom: 0; animation: open-bottom .9s var(--ease) .75s both; }
.auth-intro .cut-line {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; z-index: 1;
  background: linear-gradient(90deg, transparent, #fff 15%, #fff 85%, transparent);
  box-shadow: 0 0 18px #fff, 0 0 60px rgba(255, 255, 255, .6);
  transform-origin: left; animation: cut 1.4s var(--ease) both;
}
html[data-intro="seen"] .auth-intro { display: none; }

.auth-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.auth-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* A fine grid, only visible around the cursor. */
.auth-grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(420px circle at var(--mx) var(--my), #000, transparent 70%);
  mask-image: radial-gradient(420px circle at var(--mx) var(--my), #000, transparent 70%);
}
.auth-spot { position: absolute; inset: 0; background: radial-gradient(600px circle at var(--mx) var(--my), rgba(255,255,255,.06), transparent 65%); }
/* The giant embossed mark, like the cover of the Anarchy book. */
.auth-emboss {
  position: absolute; right: -6vw; top: -10vh; height: 130vh; width: auto; aspect-ratio: 581 / 932; color: #0d0d0d;
  filter: drop-shadow(-1px -1px 0 rgba(255,255,255,.05)) drop-shadow(2px 3px 0 rgba(0,0,0,.9));
  transform: rotate(-4deg); translate: calc(var(--px) * -26px) calc(var(--py) * -26px);
  animation: emboss-in 2.2s var(--ease) .6s both;
}
.auth-slash {
  position: absolute; left: -30%; width: 160%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.0) 25%, #fff 50%, transparent 62%);
  box-shadow: 0 0 12px rgba(255,255,255,.5);
  transform: rotate(-24deg); opacity: 0;
  animation: slash 9s var(--ease) infinite;
}
.auth-slash.s1 { top: 26%; animation-delay: 2.6s; }
.auth-slash.s2 { top: 58%; animation-delay: 5.4s; }
.auth-slash.s3 { top: 84%; animation-delay: 8s; }
.auth-grain {
  position: absolute; inset: -60%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: .06; animation: grain 1.1s steps(5) infinite;
}

.auth-top, .auth-main, .auth-foot { position: relative; z-index: 1; }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 30px 48px; animation: rise .8s var(--ease) 1.5s both; }
.auth-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; }
.auth-brand .logo-svg { width: 22px; height: 36px; }
/* The slogan, top right: a white bar, then the words. */
.auth-slogan { display: inline-flex; align-items: center; gap: 12px; font: 600 11px/1.3 var(--display); letter-spacing: .28em; text-transform: uppercase; color: #bdbdbd; text-align: right; }
.auth-slogan::before { content: ""; width: 26px; height: 2px; flex-shrink: 0; background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .7); }

.auth-main {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  align-items: center; gap: 48px; padding: 0 56px;
}
.auth-hero { display: flex; align-items: center; flex-wrap: wrap; gap: 28px 44px; min-width: 0; }
.hero-logo {
  position: relative; width: clamp(150px, 19vw, 290px); aspect-ratio: 581 / 932; flex-shrink: 0;
  transform: perspective(900px) rotateX(calc(var(--py) * -9deg)) rotateY(calc(var(--px) * 12deg));
  transition: transform .25s ease-out;
}
.hero-logo .logo-svg { width: 100%; height: 100%; color: #fff; filter: drop-shadow(0 0 30px rgba(255,255,255,.12)); }
.hero-logo .logo-stroke { stroke-width: 2; animation: draw 2s var(--ease) 1.1s both; }
.hero-logo .logo-fill { animation: fill-in 1s ease-out 2.6s both; }
/* A light sweeps across the mark every few seconds. */
.hero-shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.95) 50%, transparent 65%) no-repeat;
  background-size: 300% 100%; background-position: 150% 0;
  -webkit-mask: url("/static/brand/logo-white.png") center / 100% 100% no-repeat;
  mask: url("/static/brand/logo-white.png") center / 100% 100% no-repeat;
  mix-blend-mode: overlay; animation: shine 5.5s ease-in-out 4s infinite;
}
.hero-lockup { min-width: 0; }
.hero-word {
  font: 800 clamp(52px, 7.4vw, 120px)/.86 var(--display); letter-spacing: .06em; color: #fff;
  font-stretch: condensed; text-transform: uppercase; white-space: nowrap; position: relative;
  animation: rise .9s var(--ease) 1.6s both;
}
/* Every few seconds fx.js adds .glitch: the word splits into grey slices for a moment. */
.hero-word span { display: inline-block; position: relative; }
.hero-word span::before, .hero-word span::after { content: attr(data-text); position: absolute; left: 0; top: 0; opacity: 0; pointer-events: none; }
.hero-word.glitch span { animation: glitch .38s steps(2) both; }
.hero-word.glitch span::before { opacity: 1; color: #a8a8a8; animation: glitch-a .38s steps(3) both; }
.hero-word.glitch span::after { opacity: 1; color: #3a3a3a; animation: glitch-b .38s steps(3) both; }
.hero-sub.typing::after { content: ""; display: inline-block; width: .55em; height: 2px; margin-left: -.4em; background: #fff; vertical-align: -1px; animation: blink .7s steps(2) infinite; }
html[data-intro="seen"] .auth-top, html[data-intro="seen"] .hero-word, html[data-intro="seen"] .auth-emboss { animation-delay: .05s; }
html[data-intro="seen"] .hero-logo .logo-stroke { animation-duration: 1.4s; animation-delay: .1s; }
html[data-intro="seen"] .hero-logo .logo-fill { animation-delay: 1.05s; }
html[data-intro="seen"] .hero-rule { animation-delay: .9s; }
html[data-intro="seen"] .hero-meta { animation-delay: 1s; }
html[data-intro="seen"] .auth-foot { animation-delay: .6s; }
.hero-sub {
  margin-top: 14px; font: 600 clamp(11px, 1.15vw, 16px)/1 var(--display); letter-spacing: .62em; text-transform: uppercase;
  color: #8f8f8f; white-space: nowrap; min-height: 1em;
}
.hero-rule { width: 64px; height: 2px; background: #fff; margin: 26px 0 14px; transform-origin: left; animation: grow 1s var(--ease) 2.4s both; }
.hero-meta { font: 600 10.5px var(--display); letter-spacing: .32em; text-transform: uppercase; color: #5f5f5f; animation: rise .8s var(--ease) 2.5s both; }

.auth-panel {
  position: relative; padding: 42px 38px 38px;
  background: linear-gradient(160deg, rgba(26, 26, 26, .78), rgba(8, 8, 8, .92));
  border: 1px solid #262626;
  backdrop-filter: blur(16px);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
  animation: panel-in 1s var(--ease) 1.4s both;
}
.auth-panel::before { content: ""; position: absolute; left: 0; top: 0; width: 72px; height: 2px; background: #fff; box-shadow: 0 0 16px rgba(255,255,255,.7); }
.auth-panel::after { content: ""; position: absolute; right: 0; top: 0; width: 37px; height: 1px; background: #fff; transform-origin: right top; transform: rotate(45deg); opacity: .8; }
.auth-panel.shake { animation: shake .55s var(--ease); }
.auth-panel .public { min-height: 0; padding: 0; display: block; background: none; }
.auth-panel .public-box, .auth-panel .public-wide { max-width: none; }
.auth-panel .public-box > * { animation: rise .7s var(--ease) both; animation-delay: 1.7s; }
.auth-panel .public-box > :nth-child(3) { animation-delay: 1.8s; }
.auth-panel .public-box > :nth-child(4) { animation-delay: 1.9s; }
.auth-panel .public-box > :nth-child(n+5) { animation-delay: 2s; }
html[data-intro="seen"] .auth-panel, html[data-intro="seen"] .auth-panel .public-box > * { animation-delay: .2s; }
.public .brand { display: none; }
.auth h1 { font-size: 42px; margin-bottom: 8px; }
.auth .lead { color: var(--muted); margin: 0 0 30px; }
.auth label { text-transform: uppercase; letter-spacing: .2em; font: 600 10.5px var(--display); color: var(--faint); }
.auth input[type=text], .auth input[type=password], .auth input[type=email], .auth select, .auth textarea {
  background: transparent; border: 0; border-bottom: 1px solid #333; border-radius: 0;
  padding: 10px 0; font-size: 15px; color: #fff;
  /* a white line grows under the field when it is focused */
  background-image: linear-gradient(#fff, #fff); background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 1px;
  transition: background-size .45s var(--ease), border-color .2s;
}
.auth select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.6'/%3E%3C/svg%3E"), linear-gradient(#fff, #fff);
  background-position: right 2px center, 0 100%; background-size: 10px 6px, 0% 1px; padding-right: 22px;
}
.auth select option { background: #121212; }
.auth textarea { border: 1px solid #333; padding: 10px; }
.auth input:focus, .auth select:focus, .auth textarea:focus { outline: none; border-color: #333; box-shadow: none; background-size: 100% 1px; }
.auth select:focus { background-size: 10px 6px, 100% 1px; }
.auth .btn-primary { width: 100%; justify-content: center; padding: 15px 18px !important; font: 700 13px var(--display); letter-spacing: .32em; text-transform: uppercase; margin-top: 8px; }
.auth .btn-primary.busy { pointer-events: none; }
.auth .btn-primary.busy::before { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: #0a0a0a; transform-origin: left; animation: busy 1.2s ease-in-out infinite; }

/* Bottom: the five Academy dimensions scroll by. */
.auth-foot { border-top: 1px solid #1a1a1a; overflow: hidden; animation: rise .8s var(--ease) 2.2s both; }
.ticker { display: flex; width: max-content; animation: ticker 38s linear infinite; }
.ticker span { padding: 16px 30px; font: 700 13px var(--display); letter-spacing: .4em; text-transform: uppercase; color: #3a3a3a; white-space: nowrap; }
.ticker span::after { content: "/"; margin-left: 60px; color: #242424; }
.ticker span:hover { color: #fff; }

/* --- Console (always dark: it is a terminal) ------------------------------------- */

.console {
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: #070708; color: var(--text);
  display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 420px; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.console-bar { display: flex; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--faint); }
.console-out { flex: 1; overflow-y: auto; padding: 16px; font: 13px/1.6 var(--mono); }
.console-out .cmd { color: var(--text); margin-top: 10px; }
.console-out .cmd::before { content: "> "; color: var(--accent); }
.console-out .ok { color: var(--muted); white-space: pre-wrap; }
.console-out .err { color: var(--danger); white-space: pre-wrap; }
.console-out a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); }
.console-out table { width: auto; margin: 6px 0 4px; }
.console-out th, .console-out td { font: 12.5px var(--mono); padding: 2px 16px 2px 0; border: 0; text-transform: none; letter-spacing: 0; }
.console-out th { color: var(--faint); }
.console-out tbody tr:hover { background: none; }
.console-in { position: relative; border-top: 1px solid var(--line); display: flex; align-items: center; }
.console-in .prompt { color: var(--accent); font-family: var(--mono); padding-left: 16px; }
.console-in textarea {
  border: 0; background: none; color: var(--text); font: 13px/1.5 var(--mono); padding: 12px 10px; min-height: 0; height: 44px; resize: none;
}
.console-in textarea:focus { outline: none; }
.suggest {
  position: absolute; bottom: 100%; left: 0; right: 0; max-height: 260px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line-strong); border-bottom: 0;
}
.suggest div { display: flex; justify-content: space-between; gap: 18px; padding: 6px 14px; cursor: pointer; font: 12.5px var(--mono); }
.suggest div span:last-child { color: var(--faint); font-family: var(--sans); text-align: right; }
.suggest div.on, .suggest div:hover { background: var(--hover); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); }
.chip { font: 12px var(--mono); padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.chip:hover { color: var(--text-strong); border-color: var(--accent); }

/* --- Command palette --------------------------------------------------------- */

.palette { position: fixed; inset: 0; background: var(--backdrop); backdrop-filter: blur(3px); z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 0; }
.palette-box { width: 100%; max-width: 600px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.palette-input { border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; padding: 17px 18px !important; font-size: 15px !important; background: none !important; outline: none !important; }
.palette-results { max-height: 50vh; overflow-y: auto; padding: 6px 0; }
.palette-group { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); padding: 10px 18px 4px; }
.palette-item { display: flex; justify-content: space-between; padding: 9px 18px; cursor: pointer; }
.palette-item .hint { margin: 0; }
.palette-item.on { background: var(--hover); box-shadow: inset 3px 0 var(--accent); }
.palette-foot { display: flex; gap: 16px; padding: 9px 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11px; }

/* --- Edge: the aggressive details ------------------------------------------------ */

/* Chamfered primary buttons: a light sweep on hover, a slight pull toward the cursor (fx.js). */
.btn-primary {
  position: relative; overflow: hidden; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: 12px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
  box-shadow: none; transition: background .15s, translate .25s var(--ease), box-shadow .2s;
}
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(128, 128, 128, .45), transparent);
  transform: skewX(-20deg); transition: left .55s var(--ease);
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:hover { box-shadow: 0 0 0 1px var(--accent), 0 8px 26px var(--glow); }
.btn-small.btn-primary { font-size: 11px; --cut: 7px; }
.apply-bar .btn-primary { border-radius: 0; }

/* A soft light follows the cursor over panels and cards (fx.js sets --mx/--my). */
.panel, .stats, .column, details.drawer, .card, .week-day { position: relative; }
.panel::after, .stats::after, .card::after, .week-day::after, .column::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 70%);
}
.panel:hover::after, .stats:hover::after, .card:hover::after, .week-day:hover::after, .column:hover::after { opacity: 1; }
a.panel, .card { transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
a.panel:hover, .card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 12px 30px rgba(0, 0, 0, .28); }

/* Section titles: a slanted bar that slices in. */
.section-title::before { width: 14px; height: 4px; transform: skewX(-30deg); vertical-align: 2px; animation: slice-in .7s var(--ease) .2s both; }
.eyebrow { color: var(--muted); }
.page-head h1 { position: relative; }
.page-head h1::after {
  content: ""; position: absolute; left: 0; bottom: -10px; height: 2px; width: 56px; background: var(--accent);
  transform-origin: left; animation: grow .8s var(--ease) .25s both;
}

/* Table rows: a hard edge on hover. */
tbody tr { transition: background .15s; }
tbody tr:hover { box-shadow: inset 2px 0 var(--accent); }

/* Sidebar: glowing active marker, items slide on hover, the mark redraws itself on hover. */
.sidebar { background: #070707; }
.sidebar a { transition: color .15s, background .15s, padding-left .2s var(--ease); }
.sidebar a:hover { padding-left: 16px; }
.sidebar a.active::before { box-shadow: 0 0 12px rgba(255, 255, 255, .8); }
.side-brand .logo-svg { transition: transform .5s var(--ease), filter .5s; }
.side-brand:hover .logo-svg { transform: rotate(-8deg) scale(1.08); filter: drop-shadow(0 0 10px rgba(255, 255, 255, .45)); }
.side-brand .logo-stroke { opacity: 0; }
.side-brand:hover .logo-stroke { animation: redraw 1.2s var(--ease); }
.side-brand:hover .logo-fill { animation: refill 1.2s var(--ease); }

/* A white line runs across the top as each page loads. */
.shell::before {
  content: ""; position: fixed; left: 0; top: 0; height: 2px; z-index: 60; width: 100%;
  background: linear-gradient(90deg, transparent, var(--text-strong), transparent);
  box-shadow: 0 0 12px var(--glow);
  transform-origin: left; animation: load-line 1s var(--ease) both;
}

/* Page content rises in, block by block. */
.content > * { animation: rise .6s var(--ease) both; }
.content > :nth-child(2) { animation-delay: .06s; }
.content > :nth-child(3) { animation-delay: .12s; }
.content > :nth-child(4) { animation-delay: .18s; }
.content > :nth-child(5) { animation-delay: .24s; }
.content > :nth-child(n+6) { animation-delay: .3s; }
.stat { transition: background .2s; }
.flash { animation: rise .5s var(--ease) both, flash-in 1.2s ease-out both; }

/* --- Motion ---------------------------------------------------------------------- */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes slice-in { from { transform: skewX(-30deg) translateX(-14px); opacity: 0; } to { transform: skewX(-30deg); opacity: 1; } }
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -6%); }
  60% { transform: translate(-3%, 7%); } 80% { transform: translate(7%, 2%); } 100% { transform: translate(0, 0); }
}
@keyframes slash {
  0% { opacity: 0; transform: rotate(-24deg) translateX(-45%); }
  6% { opacity: 1; }
  16% { opacity: 0; transform: rotate(-24deg) translateX(45%); }
  100% { opacity: 0; transform: rotate(-24deg) translateX(45%); }
}
@keyframes blink { 50% { opacity: .2; } }
@keyframes cut { 0% { transform: scaleX(0); opacity: 1; } 45% { transform: scaleX(1); opacity: 1; } 60% { opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes open-top { to { transform: translateY(-101%); } }
@keyframes open-bottom { to { transform: translateY(101%); } }
@keyframes draw {
  0% { stroke-dashoffset: 1; opacity: 1; }
  80% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes fill-in { from { fill-opacity: 0; filter: blur(6px); } to { fill-opacity: 1; filter: none; } }
@keyframes redraw { 0% { stroke-dashoffset: 1; opacity: 1; } 75% { stroke-dashoffset: 0; opacity: 1; } 100% { opacity: 0; } }
@keyframes refill { 0%, 30% { fill-opacity: 0; } 100% { fill-opacity: 1; } }
@keyframes emboss-in { from { opacity: 0; transform: translateX(8vw) rotate(-4deg) scale(1.08); } to { opacity: 1; } }
@keyframes shine { 0% { background-position: 150% 0; } 35%, 100% { background-position: -50% 0; } }
@keyframes glitch {
  0% { transform: translate(0); clip-path: inset(0 0 0 0); text-shadow: none; }
  20% { transform: translate(-4px, 1px); clip-path: inset(10% 0 55% 0); text-shadow: 3px 0 #9a9a9a, -3px 0 #444; }
  40% { transform: translate(4px, -1px); clip-path: inset(60% 0 8% 0); text-shadow: -4px 0 #bdbdbd, 2px 0 #333; }
  60% { transform: translate(-2px); clip-path: inset(30% 0 35% 0); }
  80% { transform: translate(2px); clip-path: inset(0 0 0 0); text-shadow: 2px 0 #777; }
  100% { transform: translate(0); clip-path: inset(0 0 0 0); text-shadow: none; }
}
@keyframes glitch-a { 0% { transform: translate(-7px, -1px); clip-path: inset(0 0 72% 0); } 33% { transform: translate(6px, 0); clip-path: inset(38% 0 36% 0); } 66% { transform: translate(-4px, 1px); clip-path: inset(70% 0 6% 0); } 100% { transform: none; clip-path: inset(0 0 100% 0); } }
@keyframes glitch-b { 0% { transform: translate(7px, 1px); clip-path: inset(64% 0 0 0); } 33% { transform: translate(-6px, 0); clip-path: inset(12% 0 62% 0); } 66% { transform: translate(5px, -1px); clip-path: inset(44% 0 30% 0); } 100% { transform: none; clip-path: inset(100% 0 0 0); } }
@keyframes shake { 0%, 100% { transform: none; } 15% { transform: translateX(-12px); } 30% { transform: translateX(10px); } 45% { transform: translateX(-7px); } 60% { transform: translateX(5px); } 75% { transform: translateX(-2px); } }
@keyframes panel-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes busy { 0% { transform: scaleX(0); transform-origin: left; } 50% { transform: scaleX(1); transform-origin: left; } 51% { transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; } }
@keyframes load-line { 0% { transform: scaleX(0); opacity: 1; } 70% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes flash-in { from { box-shadow: 0 0 0 2px var(--accent); } to { box-shadow: var(--shadow-sm); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .auth-slash, .auth-grain, .auth-intro, .auth-canvas { display: none; }
}

/* --- Responsive ---------------------------------------------------------------- */

@media (max-width: 1000px) {
  .grid-3, .grid-main { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 30px 28px 80px; }
}
@media (max-width: 1100px) {
  .auth-main { grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 8px 24px 32px; justify-items: start; }
  .auth-panel { width: 100%; max-width: 460px; }
  .hero-logo { width: clamp(90px, 16vw, 150px); }
  .hero-word { font-size: clamp(44px, 9vw, 84px); }
  .auth-emboss { opacity: .6; }
}
@media (max-width: 640px) {
  .auth-top { padding: 20px; }
  .auth-slogan { font-size: 8.5px; letter-spacing: .16em; gap: 8px; max-width: 55%; }
  .auth-slogan::before { width: 14px; }
  .auth-hero { gap: 18px; }
  .hero-logo { width: 72px; }
  .hero-word { font-size: 46px; }
  .hero-sub { letter-spacing: .42em; font-size: 10.5px; }
  .hero-rule, .hero-meta { display: none; }
  .auth-panel { padding: 32px 22px 26px; }
  .auth h1 { font-size: 34px; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 60px 1fr; }
  .nav-toggle { display: inline-flex; }
  .top-brand { display: flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .profile-name, .search-trigger span { display: none; }
  .search-trigger { flex: 0 0 auto; margin-left: auto; padding: 8px 10px; }
  .topbar-right { margin-left: 0; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px; height: auto;
    z-index: 40; transform: translateX(-100%); transition: transform .18s ease;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .content { padding: 22px 16px 60px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 120px 1fr; }
  .score-row { grid-template-columns: 110px 1fr 56px; gap: 10px; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  h1 { font-size: 25px; }
  .apply-bar { border-radius: var(--radius); }
}
