/* ==========================================================================
   THUGS(red) Nextgen — terminal design system
   --------------------------------------------------------------------------
   One stylesheet, no framework. Fonts are self-hosted under /fonts (nothing is
   fetched from a third party, so the CSP stays 'self' and no visitor IP leaks
   to a font CDN). Palette is the classic ANSI 16 mapped to a dark CRT, with the
   site's red as the accent. Layout is a centred column of "terminal windows".
   ========================================================================== */

/* --------------------------------------------------------------- fonts ---- */
/* JetBrains Mono — Apache License 2.0. Variable file: one download covers every
   weight we use, so 100..800 is declared as a range rather than per-weight. */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                 U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                 U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Share Tech Mono — SIL Open Font License 1.1. Used only for display accents
   (brand, headings, ASCII art) where the wider, squarer glyphs read as CRT. */
@font-face {
  font-family: "Share Tech Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/share-tech-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* ANSI-ish base palette */
  --ansi-black:   #0b0d10;
  --ansi-red:     #ff3b47;
  --ansi-green:   #3ddc84;
  --ansi-yellow:  #ffcc55;
  --ansi-blue:    #4aa8ff;
  --ansi-magenta: #c98bff;
  --ansi-cyan:    #4fe3d2;
  --ansi-white:   #d7dce2;
  --ansi-bright-black: #4a5260;

  /* surfaces */
  --bg:          #08090b;
  --bg-alt:      #0c0f13;
  --panel:       #0e1217;
  --panel-2:     #131820;
  --line:        #1e2630;
  --line-soft:   #161c24;

  /* text */
  --fg:          #cfd6de;
  --fg-dim:      #8b95a3;
  --fg-faint:    #5d6673;
  --fg-bright:   #f2f6fa;

  --accent:      var(--ansi-red);
  --accent-soft: rgba(255, 59, 71, 0.14);
  --ok:          var(--ansi-green);
  --warn:        var(--ansi-yellow);
  --info:        var(--ansi-cyan);

  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Fira Code",
          "Cascadia Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --display: "Share Tech Mono", var(--mono);

  --radius: 6px;
  --gap: 1.25rem;
  --wrap: 1180px;

  --glow-red:  0 0 0 1px rgba(255, 59, 71, 0.35), 0 0 22px -6px rgba(255, 59, 71, 0.55);
  --glow-green: 0 0 0 1px rgba(61, 220, 132, 0.3), 0 0 20px -8px rgba(61, 220, 132, 0.5);
}

/* --------------------------------------------------------------- reset ---- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img, svg, canvas { max-width: 100%; }
img { height: auto; border-radius: 4px; }

a {
  color: var(--ansi-cyan);
  text-decoration: none;
  border-bottom: 1px dotted rgba(79, 227, 210, 0.4);
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
a:hover, a:focus-visible {
  color: var(--fg-bright);
  border-bottom-color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--ansi-cyan);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  color: var(--fg-bright);
  line-height: 1.25;
  margin: 0 0 .6em;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1, h2 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: .01em;
}
h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); }
h2 { font-size: clamp(1.2rem, 1rem + .8vw, 1.5rem); }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; color: var(--fg); }

p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.3rem; }
li { margin: .2rem 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

code, kbd, samp { font-family: var(--mono); font-size: .92em; }
code {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: .08em .38em;
  color: var(--ansi-green);
}

pre {
  margin: 0 0 1rem;
  overflow-x: auto;
}
pre.code {
  background: #06080a;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  color: var(--fg-dim);
  font-size: .86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
pre.code code { background: none; border: 0; padding: 0; }

.dim   { color: var(--fg-dim); }
.faint { color: var(--fg-faint); }
.ok    { color: var(--ok); }
.warn  { color: var(--warn); }
.bad   { color: var(--accent); }
.mono  { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: .6rem 1rem;
  border: 0;
}
.skip-link:focus {
  left: 0;
}

/* ------------------------------------------------------------ background -- */

#bg-net {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
  background:
    radial-gradient(1100px 620px at 78% -10%, rgba(255, 59, 71, 0.10), transparent 60%),
    radial-gradient(900px 520px at 8% 8%, rgba(79, 227, 210, 0.07), transparent 60%),
    var(--bg);
}

/* Faint CRT scanlines over everything, purely decorative. */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.014) 0px,
    rgba(255, 255, 255, 0.014) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* ----------------------------------------------------------------- shell -- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2rem);
}

.site-main {
  flex: 1 0 auto;
  padding-block: 2rem 4rem;
}

/* ------------------------------------------------------------------ head -- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

/* The header needs a wider container than the content column. Signed in, the
   nav gains "manage" and "admin" and the session box gains a role chip, name
   and logout button — at the 1180px content width that overflowed and wrapped
   the nav onto a second line under the logo. */
.site-head .wrap { max-width: 1640px; }

.head-inner {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: 58px;
  flex-wrap: wrap;
}



.brand {
  border: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.22rem;
  letter-spacing: .04em;
  white-space: nowrap;
  color: var(--fg-bright);
}
.brand-bracket { color: var(--fg-faint); }
.brand-thugs   { color: var(--fg-bright); }
.brand-red     { color: var(--accent); text-shadow: 0 0 14px rgba(255, 59, 71, .55); }
.brand-cursor  { color: var(--accent); animation: blink 1.15s steps(2, start) infinite; margin-left: .1rem; }

@keyframes blink { to { visibility: hidden; } }
.blink { animation: blink 1.15s steps(2, start) infinite; color: var(--ok); }

.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: .3rem .45rem;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--fg-dim);
  font-size: .84rem;
  white-space: nowrap;
}
.site-nav a:hover, .site-nav a:focus-visible {
  color: var(--fg-bright);
  background: var(--panel-2);
  border-color: var(--line);
}
.site-nav a.is-active {
  color: var(--fg-bright);
  background: var(--accent-soft);
  border-color: rgba(255, 59, 71, .45);
}
.nav-slash { color: var(--fg-faint); margin-right: 1px; }
.site-nav a.is-active .nav-slash { color: var(--accent); }

.session-box {
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* manage / admin — app controls, pinned next to the session box so they are
   never the entries that scroll out of the nav. */
.app-link {
  display: inline-block;
  padding: .28rem .55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--fg-dim);
  font-size: .8rem;
  white-space: nowrap;
}
.app-link::before { content: "/"; color: var(--fg-faint); margin-right: 1px; }
.app-link:hover,
.app-link:focus-visible {
  color: var(--fg-bright);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.app-link.is-active {
  color: var(--fg-bright);
  background: var(--accent-soft);
  border-color: rgba(255, 59, 71, .45);
}
.app-link.is-active::before { color: var(--accent); }
.whoami {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .2rem .5rem;
  font-size: .82rem;
  color: var(--fg);
  background: var(--panel);
}
.whoami-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.role-chip {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .05rem .35rem;
  border-radius: 3px;
  border: 1px solid;
}
.role-admin    { color: var(--accent);      border-color: rgba(255,59,71,.5);   background: rgba(255,59,71,.10); }
/* Moderator sits between member and admin on the ladder, so it gets a hue
   between their green and red rather than a fourth unrelated colour. */
.role-moderator { color: var(--ansi-yellow); border-color: rgba(255,204,85,.45); background: rgba(255,204,85,.08); }
.role-member   { color: var(--ok);          border-color: rgba(61,220,132,.45); background: rgba(61,220,132,.08); }
.role-follower { color: var(--ansi-blue);   border-color: rgba(74,168,255,.4);  background: rgba(74,168,255,.08); }
.role-guest    { color: var(--fg-faint);    border-color: var(--line); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .35rem .6rem;
  font-family: var(--mono);
  font-size: .85rem;
  cursor: pointer;
}

/* From tablet width up the header stays on exactly one row: brand, nav, session
   box. The nav is the flexible part — if a signed-in admin's 13 entries do not
   fit, it scrolls horizontally rather than wrapping under the logo. */
@media (min-width: 900px) {
  .head-inner { flex-wrap: nowrap; }

  .site-nav {
    min-width: 0;              /* lets a flex child actually shrink */
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;     /* the row is short; a scrollbar would dominate */
    -ms-overflow-style: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { flex-wrap: nowrap; }

  /* When the nav genuinely overflows, fade its trailing edge so it is obvious
     there is more to scroll to. app.js adds the class only when it applies, so
     a nav that fits keeps a hard edge. */
  .site-nav.has-overflow {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent);
  }
  .site-nav.has-overflow.at-end {
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 30px), transparent);
    mask-image: linear-gradient(to left, #000 calc(100% - 30px), transparent);
  }

  .brand,
  .session-box { flex: none; }
}

/* Reclaim a little width before the nav has to scroll. */
@media (min-width: 900px) and (max-width: 1500px) {
  .site-nav a { padding-inline: .38rem; }
  .whoami-name { max-width: 9ch; }
}

/* --------------------------------------------------------------- anchors -- */
/* The site header is sticky, so an element jumped to via #fragment would sit
   underneath it. scroll-margin-top reserves the header's height plus a little
   breathing room, for anything that can be an anchor target. */
.site-main [id] {
  scroll-margin-top: 84px;
}

/* ---------------------------------------------------------------- window -- */

.term-window {
  background: linear-gradient(180deg, rgba(14,18,23,.96), rgba(10,13,17,.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: var(--gap);
  overflow: hidden;
  box-shadow: 0 18px 40px -28px rgba(0,0,0,.9);
}

.term-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .75rem;
  background: #10151b;
  border-bottom: 1px solid var(--line);
  font-size: .78rem;
  color: var(--fg-dim);
}
.term-dots { display: inline-flex; gap: .3rem; }
.term-dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: #2a323d; display: block;
}
.term-dots i:nth-child(1) { background: #ff5f57; }
.term-dots i:nth-child(2) { background: #febc2e; }
.term-dots i:nth-child(3) { background: #28c840; }
.term-title { letter-spacing: .04em; }
.term-title::before { content: "~/ "; color: var(--fg-faint); }
.term-bar .term-actions { margin-left: auto; display: flex; gap: .4rem; align-items: center; }

.term-body { padding: clamp(1rem, 2.4vw, 1.6rem); }
.term-body > :last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ hero -- */

.hero {
  position: relative;
  padding: clamp(1.6rem, 4vw, 3rem) 0 1rem;
}

.hero-ascii {
  color: var(--accent);
  font-size: clamp(.34rem, 1.35vw, .78rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  text-shadow: 0 0 18px rgba(255, 59, 71, .45);
  overflow-x: auto;
}

.hero-lede {
  font-size: clamp(1rem, .95rem + .35vw, 1.15rem);
  max-width: 62ch;
  color: var(--fg);
}

.hero-line {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: baseline;
  color: var(--fg-dim);
  font-size: .9rem;
  margin-bottom: .8rem;
}
.prompt { white-space: nowrap; }
.prompt-user { color: var(--ok); }
.prompt-path { color: var(--ansi-blue); }
.typed { color: var(--fg-bright); }
.caret {
  display: inline-block;
  width: .55em; height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.05s steps(2, start) infinite;
}

/* ----------------------------------------------------------------- grids -- */

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: var(--gap);
  align-items: start;
}

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

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  height: 100%;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
a.card { border-bottom: 1px solid var(--line); color: inherit; }
a.card:hover, a.card:focus-visible {
  border-color: rgba(255, 59, 71, .5);
  transform: translateY(-2px);
  box-shadow: var(--glow-red);
}
.card h3 { margin-bottom: .35rem; font-size: 1rem; }
.card p  { color: var(--fg-dim); font-size: .9rem; margin-bottom: .6rem; }
.card > :last-child { margin-bottom: 0; }
.card-foot {
  margin-top: auto;
  padding-top: .6rem;
  color: var(--fg-faint);
  font-size: .78rem;
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

.card-sigil {
  font-size: .75rem;
  color: var(--accent);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: .3rem;
  display: block;
}

/* Project tiles on the frontpage */
.tile {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255,59,71,.05), transparent 55%),
    var(--panel);
  padding: 1.1rem;
  color: inherit;
  overflow: hidden;
}
.tile::after {
  content: "";
  position: absolute;
  inset: auto -40% -60% auto;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,59,71,.16), transparent 65%);
  opacity: 0;
  transition: opacity .25s ease;
}
.tile:hover::after, .tile:focus-visible::after { opacity: 1; }
.tile:hover, .tile:focus-visible { border-color: rgba(255,59,71,.55); transform: translateY(-2px); }
.tile h3 { display: flex; align-items: center; gap: .5rem; }
.tile .tile-host { font-size: .76rem; color: var(--fg-faint); word-break: break-all; }
.tile-badge {
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  border: 1px solid rgba(61,220,132,.4);
  color: var(--ok);
  border-radius: 3px;
  padding: .05rem .3rem;
}
.tile-badge.wip { color: var(--warn); border-color: rgba(255,204,85,.45); }
.tile-badge.offensive { color: var(--accent); border-color: rgba(255,59,71,.45); }

/* ------------------------------------------------------------------ tags -- */

/* Live "someone is home" indicator next to the Discord online count. */
.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(61, 220, 132, .6);
  animation: pulse-dot 2.2s ease-out infinite;
  vertical-align: middle;
}
@keyframes pulse-dot {
  70%  { box-shadow: 0 0 0 7px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

.tag-row { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag {
  display: inline-block;
  font-size: .72rem;
  padding: .1rem .45rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel-2);
  color: var(--fg-dim);
  white-space: nowrap;
}
a.tag { border-bottom: 1px solid var(--line); }
a.tag:hover { color: var(--fg-bright); border-color: rgba(255,59,71,.5); }
.tag-accent { color: var(--accent); border-color: rgba(255,59,71,.35); }
.tag-cyan   { color: var(--ansi-cyan); border-color: rgba(79,227,210,.3); }
.tag-green  { color: var(--ok); border-color: rgba(61,220,132,.3); }
.tag-yellow { color: var(--warn); border-color: rgba(255,204,85,.3); }
.tag-magenta{ color: var(--ansi-magenta); border-color: rgba(201,139,255,.3); }
.tag-blue   { color: var(--ansi-blue); border-color: rgba(74,168,255,.3); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--accent);
  color: #0b0d10;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: .45rem .9rem;
  font-family: var(--mono);
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s ease, transform .12s ease, background-color .15s ease;
}
.btn:hover, .btn:focus-visible { filter: brightness(1.12); color: #0b0d10; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  color: var(--fg-bright);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.btn-danger { background: transparent; color: var(--accent); border-color: rgba(255,59,71,.5); }
.btn-danger:hover { background: var(--accent); color: #0b0d10; }
.btn-sm { padding: .25rem .6rem; font-size: .78rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.inline-form { display: inline; }

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

.form-grid { display: grid; gap: 1rem; }
.form-row { display: grid; gap: .35rem; }
.form-row.two   { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
/* Narrower minimums than .two because these hold dates and small integers, not
   free text — 220px each would drop four number fields onto four rows. */
.form-row.three { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.form-row.four  { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; }

label { font-size: .84rem; color: var(--fg-dim); }
label .req { color: var(--accent); }

input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=date], input[type=search], input[type=file],
select, textarea {
  width: 100%;
  background: #06080a;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--fg-bright);
  font-family: var(--mono);
  font-size: .9rem;
  padding: .5rem .65rem;
}
textarea { min-height: 7rem; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,59,71,.12);
}
input::placeholder, textarea::placeholder { color: var(--fg-faint); }
input[type=file] { padding: .4rem; cursor: pointer; }
input[type=file]::file-selector-button {
  background: var(--panel-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: .3rem .6rem;
  margin-right: .6rem;
  font-family: var(--mono);
  cursor: pointer;
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-dim) 50%),
                    linear-gradient(135deg, var(--fg-dim) 50%, transparent 50%);
  background-position: calc(100% - 15px) center, calc(100% - 10px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}
.hint { font-size: .76rem; color: var(--fg-faint); }
.check-row { display: flex; align-items: center; gap: .5rem; }
.check-row input { width: auto; }
.check-row label { color: var(--fg); }

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0 0 1rem;
}
legend { color: var(--accent); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; padding-inline: .4rem; }

.form-narrow { max-width: 460px; margin-inline: auto; }

/* ---------------------------------------------------------------- tables -- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
  background: var(--panel);
}
table.data th, table.data td {
  padding: .55rem .7rem;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
table.data thead th {
  background: #10151b;
  color: var(--fg-dim);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data tbody tr:hover { background: rgba(255,255,255,.02); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* Writeups grouping: competition > category > challenge */
.group-head td {
  background: #0b1016;
  border-top: 1px solid var(--line);
  color: var(--fg-bright);
  font-weight: 700;
}
.group-head .count { color: var(--fg-faint); font-weight: 400; font-size: .78rem; }
.sub-head td {
  background: #0a0d12;
  color: var(--ansi-cyan);
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.tree-branch { color: var(--fg-faint); }

/* ---------------------------------------------------------------- flashes -- */

.flash-stack { margin-top: 1rem; display: grid; gap: .5rem; }
.flash {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 4px;
  background: var(--panel);
  padding: .6rem .8rem;
  font-size: .88rem;
}
.flash-sigil { font-weight: 700; }
.flash-ok    { border-left-color: var(--ok);     }
.flash-ok    .flash-sigil { color: var(--ok); }
.flash-error { border-left-color: var(--accent); }
.flash-error .flash-sigil { color: var(--accent); }
.flash-warn  { border-left-color: var(--warn);   }
.flash-warn  .flash-sigil { color: var(--warn); }
.flash-info  { border-left-color: var(--info);   }
.flash-info  .flash-sigil { color: var(--info); }

.notice {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  color: var(--fg-dim);
  background: rgba(255,255,255,.015);
  font-size: .88rem;
}
.notice-warn { border-color: rgba(255,204,85,.4); color: var(--warn); }
.notice-bad  { border-color: rgba(255,59,71,.45); color: #ffb3b8; }

/* ------------------------------------------------------------ page pieces -- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.page-head p { margin: 0; max-width: 70ch; color: var(--fg-dim); }
.page-head h1 { margin-bottom: .2rem; }

.crumbs {
  font-size: .78rem;
  color: var(--fg-faint);
  margin-bottom: .8rem;
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}
.crumbs a { border: 0; color: var(--fg-dim); }
.crumbs a:hover { color: var(--ansi-cyan); }
.crumbs .sep { color: var(--line); }

.section-title {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 2rem 0 1rem;
  color: var(--fg-bright);
  font-size: 1.05rem;
}
.section-title::before { content: "##"; color: var(--accent); }
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .8rem;
  margin-bottom: var(--gap);
}
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: .8rem .9rem;
}
.stat-value { font-family: var(--display); font-size: 1.7rem; color: var(--fg-bright); line-height: 1.1; }
.stat-label { font-size: .74rem; color: var(--fg-faint); text-transform: uppercase; letter-spacing: .07em; }
.stat-accent .stat-value { color: var(--accent); }
.stat-ok .stat-value { color: var(--ok); }

.member-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .7rem; list-style: none; padding: 0; }
.member {
  display: flex;
  align-items: center;
  gap: .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: .6rem .8rem;
}
.member-avatar {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 700;
  font-size: .9rem;
  flex: none;
}
.member-name { color: var(--fg-bright); font-weight: 700; font-size: .9rem; }
.member-role { font-size: .74rem; color: var(--fg-faint); }

.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: .35rem .9rem; font-size: .88rem; }
.kv dt { color: var(--fg-faint); }
.kv dd { margin: 0; color: var(--fg); word-break: break-word; }

.prose { max-width: 74ch; }
.prose h2 { margin-top: 1.8rem; }
.prose h3 { margin-top: 1.4rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .3rem 0; }
.prose > :first-child { margin-top: 0; }

.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.link-list li {
  display: flex;
  gap: .7rem;
  align-items: baseline;
  border-bottom: 1px dotted var(--line);
  padding-bottom: .45rem;
  margin: 0;
}
.link-list .lnk-name { min-width: 12rem; }
.link-list .lnk-desc { color: var(--fg-dim); font-size: .86rem; }

.toc { position: sticky; top: 76px; }
.toc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .2rem; }
.toc a { display: block; padding: .2rem .4rem; font-size: .84rem; color: var(--fg-dim); border: 0; border-left: 2px solid var(--line); }
.toc a:hover, .toc a.is-active { color: var(--fg-bright); border-left-color: var(--accent); background: rgba(255,255,255,.02); }

/* Writeup reader */
.reader {
  background: #06080a;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1rem, 2.5vw, 1.8rem);
}
.reader h1, .reader h2, .reader h3 { color: var(--ansi-cyan); }
.reader pre.code { background: #040608; }
/* Inline styles are blocked by the CSP, so one-off tweaks live here. */
.hash-block { font-size: .7rem; letter-spacing: .02em; }
.wrap-anywhere { overflow-wrap: anywhere; }

/* Copyable command block: the button floats over the top-right of the <pre>. */
.code-block { position: relative; }
.code-block pre.code { padding-right: 4.5rem; }
.code-copy {
  position: absolute;
  top: .5rem;
  right: .5rem;
  z-index: 1;
  background: var(--panel-2);
}

.pdf-frame {
  width: 100%;
  height: min(80vh, 900px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #06080a;
}

/* ---------------------------------------------------------------- charts -- */

/* Server-rendered inline SVG, drawn by app/lib/Charts.php. The CSP has no
   'unsafe-inline' for styles either, so the markup cannot carry a style="…"
   attribute: it ships geometry plus these classes, and every colour, stroke
   width and font size lives here. */

.chart { display: block; width: 100%; height: auto; }
.chart-radar { max-width: 420px; margin-inline: auto; }
.chart-donut { max-width: 220px; margin-inline: auto; }

/* Grid and axes: solid hairlines one step off the surface. Never dashed —
   dashing reads as "threshold" when it is only a grid. */
.chart-grid { fill: none; stroke: var(--line); stroke-width: 1; }

/* Text wears text tokens, never a series colour. The mark beside it carries
   identity; the label only has to be readable. */
.chart-label   { fill: var(--fg-dim); font-family: var(--mono); font-size: 10px; }
.chart-tick    { fill: var(--fg-faint); font-family: var(--mono); font-size: 9px; }

/* Radar. One series, so one colour and no legend — thin stroke, quiet fill. */
.chart-radar-area { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.chart-radar-dot  { fill: var(--accent); }

/* Donut. The 2px separation between segments is a gap in the surface, not a
   stroke drawn around each arc. */
.chart-arc { fill: none; stroke-width: 15; stroke-linecap: butt; }
.chart-hole-value { fill: var(--fg-bright); font-family: var(--display); font-size: 24px; }
.chart-hole-label { fill: var(--fg-faint); font-family: var(--mono); font-size: 8px; }

/* Categorical slots, in a fixed order — the order *is* the colourblind-safety
   mechanism, so assign in sequence and never reorder or cycle.

   Derived from the site's own ANSI hues by keeping each hue angle and moving
   only lightness into the dark-mode mark band (OKLCH L ~ 0.60); the raw
   --ansi-* values are tuned for text and sit far too light (L 0.71–0.87).
   Validated against the panel surface #0c0f14 — lightness band, chroma floor,
   protanopia/deuteranopia adjacent ΔE 22.5, normal-vision ΔE 23.5 and contrast
   vs surface all pass. Re-run the checker before touching any of them.

   Each slot sets both `stroke` (for the SVG arc) and `background-color` (for the
   legend swatch); the other property is simply ignored by whichever element it
   does not apply to, which keeps one hex per slot instead of two. */
.chart-s1      { stroke: #ef0130; background-color: #ef0130; }
.chart-s2      { stroke: #9f59d6; background-color: #9f59d6; }
.chart-s3      { stroke: #a17904; background-color: #a17904; }
.chart-s4      { stroke: #0583de; background-color: #0583de; }
.chart-s5      { stroke: #069954; background-color: #069954; }
/* The folded tail is de-emphasis grey, not a sixth identity. */
.chart-s-other { stroke: var(--ansi-bright-black); background-color: var(--ansi-bright-black); }

/* The legend doubles as the table view: with no tooltip layer, this is where a
   share is readable as a number. */
.chart-legend { list-style: none; padding: 0; margin: .9rem 0 0; font-size: .8rem; }
.chart-legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .55rem;
  padding: .2rem 0;
  border-top: 1px solid var(--line-soft);
}
.chart-legend li:first-child { border-top: 0; }
.chart-swatch { width: 10px; height: 10px; border-radius: 2px; }
.chart-legend-name { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend-n    { color: var(--fg-bright); font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-legend-pct  { color: var(--fg-faint); font-variant-numeric: tabular-nums; text-align: right; min-width: 3.6em; }

.chart-note { color: var(--fg-faint); font-size: .74rem; margin: .7rem 0 0; }

/* Meter. Stretched by preserveAspectRatio="none", so the height here is the
   only thing setting it — the viewBox's 6 units are arbitrary. */
.chart-meter { display: block; width: 100%; height: 5px; margin-top: .55rem; }
.chart-meter-track { fill: var(--line); }
.chart-meter-fill  { fill: var(--accent); }

/* ------------------------------------------------------- results strip -- */

.result-strip { list-style: none; margin: 0; padding: 0; }
.result + .result { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line-soft); }

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  justify-content: space-between;
}
.result-name  { font-weight: 700; color: var(--fg-bright); }
.result-when  { color: var(--fg-faint); font-family: var(--mono); font-size: .74rem; }

/* Figures wrap rather than scroll: this box is wide on a desktop and one
   column on a phone, and a placing that slides out of view is worse than one
   on a second line. */
.result-figures {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .9rem;
  margin-top: .35rem;
  font-size: .82rem;
  color: var(--fg-dim);
}
.result-place,
.result-stat   { font-variant-numeric: tabular-nums; }
.result-place strong,
.result-stat strong { color: var(--fg-bright); }
/* A win carries the highlight that a "top N%" tag carries for everything else
   — Competitions::topLabel() returns nothing for 1st, so this is the only
   thing marking it. */
.result-win strong { color: var(--ok); }
.result-format {
  margin-left: auto;
  color: var(--fg-faint);
  font-family: var(--mono);
  font-size: .72rem;
}
.result-note { margin: .5rem 0 0; color: var(--fg-faint); font-size: .78rem; }

/* -------------------------------------------------------- solved board -- */

/* Columns, not a grid: the groups are wildly different heights (six challenges
   in one category, two in another) and CSS columns pack them by flow, which is
   the whole point. A grid would leave a ragged hole under every short group.
   column-width rather than column-count so it becomes one column on a phone
   without a media query. */
.board { columns: 15rem; column-gap: var(--gap); }
.board-group { break-inside: avoid; margin: 0 0 1rem; }

.board-cat {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  margin: 0 0 .35rem;
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--fg-dim);
}
.board-cat a { color: inherit; }
.board-cat a:hover { color: var(--accent); }
.board-n {
  color: var(--fg-faint);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.board-list { list-style: none; margin: 0; padding: 0; font-size: .8rem; }
.board-list li { margin: 0 0 .1rem; }
.board-list a {
  display: block;
  padding: .15rem .4rem;
  border-left: 2px solid var(--line);
  color: var(--fg-dim);
  /* Long challenge names are common and a column is narrow, so clip rather
     than let one name widen every column. The full title is on the tooltip. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
.board-list a:hover,
.board-list a:focus-visible {
  border-left-color: var(--accent);
  background: var(--panel-2);
  color: var(--fg-bright);
}

/* ------------------------------------------------------------------ foot -- */

.site-foot {
  flex: none;
  border-top: 1px solid var(--line);
  background: rgba(8,9,11,.9);
  padding-block: 1.6rem 1.2rem;
  font-size: .85rem;
}
.foot-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.4rem;
  margin-bottom: 1.2rem;
}
.foot-h { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: .4rem; }
.foot-list { list-style: none; padding: 0; margin: 0; }
.foot-list li { margin: .15rem 0; }
.foot-list a { color: var(--fg-dim); border: 0; }
.foot-list a:hover { color: var(--fg-bright); }
.foot-prompt {
  margin: 0;
  padding-top: .9rem;
  border-top: 1px solid var(--line-soft);
  color: var(--fg-dim);
  font-size: .8rem;
  word-break: break-word;
}

/* ----------------------------------------------------------------- error -- */

.error-shell { max-width: 720px; margin-inline: auto; }
.error-code {
  font-family: var(--display);
  font-size: clamp(3rem, 12vw, 6rem);
  line-height: 1;
  color: var(--accent);
  margin: 0 0 .4rem;
  text-shadow: 0 0 30px rgba(255,59,71,.4);
  font-weight: 400;
}
.page-error { display: block; }
.page-error .error-shell { margin-top: 3rem; }

.page-maintenance { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.maint-shell { width: min(680px, 100%); }
.maint-art { color: var(--accent); font-size: .8rem; line-height: 1.2; }

/* -------------------------------------------------------------- utilities -- */

.stack > * + * { margin-top: 1rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.flex { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; gap: .6rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pill-nav { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}
.filter-bar .form-row { flex: 1 1 180px; }

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .toc { position: static; }
}

@media (max-width: 780px) {
  .nav-toggle { display: inline-block; order: 2; }
  .session-box { order: 3; }
  .site-nav {
    order: 4;
    width: 100%;
    margin-left: 0;
    display: none;
    padding-bottom: .6rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: .1rem; }
  .site-nav a { display: block; padding: .5rem .6rem; }
  .head-inner { min-height: 52px; }
}

@media (max-width: 520px) {
  body { font-size: 14px; }
  .whoami-name { display: none; }
  table.data { font-size: .8rem; }
}

@media print {
  #bg-net, .scanlines, .site-head, .site-foot, .btn-row, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .term-window { border-color: #999; }

  /* Chart text is set with `fill`, which the body colour override above does not
     touch, so dim-on-dark labels would print as pale grey on white. The series
     hues themselves already sit in a mid-lightness band and print fine. */
  .chart-label, .chart-hole-value, .chart-legend-name, .chart-legend-n { fill: #000; color: #000; }
  .chart-tick, .chart-hole-label, .chart-legend-pct { fill: #444; color: #444; }
  .chart-grid { stroke: #bbb; }
}

/* ------------------------------------------------------------- advisories -- */

/* Severity chips. Ordered by how loud they are, which is the point: a reader
   scanning the index should be able to find the critical one without reading a
   word. The hues are the ANSI palette, not the darker chart steps — these are
   small text on a dark panel, which is what --ansi-* is tuned for. */
.sev-critical { color: #fff;              border-color: var(--accent);        background: rgba(255,59,71,.28); }
.sev-high     { color: var(--accent);     border-color: rgba(255,59,71,.5);   background: rgba(255,59,71,.10); }
.sev-medium   { color: var(--ansi-yellow);border-color: rgba(255,204,85,.45); background: rgba(255,204,85,.08); }
.sev-low      { color: var(--ansi-blue);  border-color: rgba(74,168,255,.4);  background: rgba(74,168,255,.08); }
.sev-none     { color: var(--fg-faint);   border-color: var(--line); }

.adv-ref {
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--fg-dim);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .1rem .4rem;
}

.adv-eyebrow { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0 0 .5rem; }

.card-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; }

.adv-card {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: .9rem 1rem;
}
.adv-card:hover { border-left-color: var(--accent); }
.adv-card-head { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-bottom: .45rem; }
.adv-card-title { font-size: 1.02rem; margin: 0 0 .3rem; }
.adv-card-affects { margin: 0 0 .3rem; font-size: .86rem; }
.adv-card-affects .faint { margin-left: .4rem; }
.adv-card-summary { margin: 0 0 .4rem; font-size: .9rem; }
.adv-card-foot { margin: 0; font-size: .78rem; }

/* The rendered advisory body. It reuses .reader, so this is only the parts a
   writeup does not have. */
.adv-body .adv-h { color: var(--ansi-cyan); margin-top: 1.6rem; }
.adv-body .adv-h:first-child { margin-top: 0; }
.adv-body .adv-list { padding-left: 1.1rem; }
.adv-body .adv-table { margin: 1rem 0; }

.adv-note {
  border: 1px solid rgba(255,59,71,.35);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  padding: .8rem 1rem;
  margin: 1.1rem 0;
}
.adv-note-label {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .35rem;
}
.adv-note p:last-child { margin-bottom: 0; }

.adv-timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.adv-timeline li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: .6rem;
  padding-left: .8rem;
  border-left: 2px solid var(--line);
}
.adv-timeline li:hover { border-left-color: var(--accent); }
.adv-timeline time { color: var(--fg-faint); font-size: .82rem; }

/* Report-a-problem, collapsed at the foot of a writeup or advisory. */
.report-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: .7rem 1rem;
}
.report-box > summary {
  cursor: pointer;
  color: var(--fg-dim);
  font-size: .86rem;
}
.report-box > summary:hover { color: var(--fg-bright); }
.report-box[open] > summary { margin-bottom: .7rem; color: var(--fg-bright); }

/* A count on a Manage nav pill. Only rendered when non-zero — a permanent "0"
   trains people to stop reading the number. */
.pill-badge {
  display: inline-block;
  margin-left: .35rem;
  min-width: 1.2em;
  padding: 0 .3em;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  text-align: center;
}
.tag-accent .pill-badge { background: var(--bg); color: var(--accent); }

/* -------------------------------------------------- syntax highlighting -- */

/* Token colours for code rendered by Thugs\Highlight. The same token kinds are
   coloured for print in Pdf::SYNTAX with a *different* palette, and that is
   deliberate: this is bright text on a near-black terminal panel, that is dark
   ink on #f6f8fa paper. Adding a kind means adding it here, in Highlight::KINDS
   and in Pdf::SYNTAX — contrib/tests/unit.php checks the first two agree. */
.hl-keyword     { color: var(--ansi-magenta); }
.hl-string      { color: var(--ansi-green); }
.hl-number      { color: var(--ansi-yellow); }
.hl-comment     { color: var(--fg-faint); font-style: italic; }
.hl-function    { color: var(--ansi-blue); }
.hl-variable    { color: var(--accent); }
.hl-type        { color: var(--ansi-cyan); }
.hl-builtin     { color: var(--ansi-cyan); }
.hl-operator    { color: var(--fg-dim); }
.hl-punctuation { color: var(--fg-faint); }

.code-lang {
  position: absolute;
  top: .5rem;
  right: 4.6rem;
  z-index: 1;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.code-caption {
  font-size: .78rem;
  color: var(--fg-faint);
  font-style: italic;
  margin-top: -.6rem;
  margin-bottom: 1rem;
}

/* ------------------------------------------------------ the block editor -- */

/* Only ever rendered on /manage/advisories/*, which is the one page served with
   style-src 'unsafe-inline' — see Security::allowInlineStyles(). These styles
   are still here rather than inline; the relaxation is for what a
   contenteditable surface does to its own elements while you type, not a
   licence to stop using the stylesheet. */

.editor-mount { display: grid; gap: .8rem; }

.eb-blocks { display: grid; gap: .7rem; }

.eb-block {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg-alt);
}
.eb-block:focus-within { border-left-color: var(--accent); }

.eb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .35rem .6rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
}
.eb-type {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.eb-tools { display: flex; gap: .25rem; }

.eb-body { padding: .7rem .8rem; display: grid; gap: .5rem; }

.eb-editable {
  min-height: 1.6em;
  padding: .4rem .55rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: .9rem;
  line-height: 1.6;
  outline: none;
}
.eb-editable:focus { border-color: var(--accent); }
/* The placeholder for a contenteditable, which has no placeholder attribute. */
.eb-editable:empty::before {
  content: attr(data-placeholder);
  color: var(--fg-faint);
}
.eb-editable code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 .25em;
}
.eb-editable a { color: var(--ansi-blue); }

.eb-heading-text { font-size: 1.05rem; color: var(--ansi-cyan); }

.eb-level, .eb-lang { max-width: 16rem; }
.eb-codebar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.eb-codebar .eb-caption { flex: 1 1 16rem; }

.eb-code {
  width: 100%;
  font-family: var(--mono);
  font-size: .84rem;
  line-height: 1.55;
  tab-size: 2;
}

/* The server-rendered preview sitting under the code box. This is literally the
   markup the published page will carry. */
.eb-preview {
  margin: 0;
  min-height: 2.4rem;
  border-style: dashed;
}
.eb-preview:empty::before {
  content: "preview appears here as you type";
  color: var(--fg-faint);
  font-style: italic;
}

.eb-items { display: grid; gap: .35rem; }
.eb-item { display: grid; grid-template-columns: auto 1fr auto; gap: .45rem; align-items: start; }
.eb-bullet { color: var(--accent); padding-top: .45rem; }

.eb-table { margin: 0; }
.eb-table th, .eb-table td { padding: .2rem; }
.eb-table .eb-editable { border-color: transparent; background: transparent; }
.eb-table .eb-editable:focus { border-color: var(--accent); background: var(--bg); }
.eb-rowtools { width: 2.5rem; }

.eb-notelabel { max-width: 12rem; }

.eb-palette {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  padding: .6rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.eb-palette-label {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-right: .2rem;
}
