/* BitFlip Mods - one stylesheet, no framework, no build step.
 *
 * Restraint is the point: a near-black neutral ground, one cyan accent that
 * stands for the flipped bit, and type that is readable before it is clever.
 * No gradients on large surfaces, no faux terminals, no neon.
 *
 * Inline styles are not used anywhere, because the public Content-Security-
 * Policy is style-src 'self'. Add rules here rather than in a template.
 */

:root {
  --ink: #e8eaed;
  --ink-dim: #a5adba;
  --ink-faint: #78818f;
  --ground: #0f1216;
  --panel: #161a20;
  --panel-raised: #1c2128;
  --line: #262c35;
  --line-strong: #38414d;
  --accent: #4fd1c5;
  --accent-ink: #0b1a18;
  --accent-dim: #2b8b83;
  --warn: #e3b341;
  --bad: #f07c72;
  --good: #63c77a;

  --radius: 6px;
  --radius-lg: 10px;
  --wrap: 68rem;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { flex: 1 0 auto; }

/* ---------- links, headings, type ---------- */

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #7ee3d9; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 0.6em;
  font-weight: 650;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.8rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: 1.12rem;
  color: var(--ink-dim);
  max-width: 46rem;
}

code, kbd, samp, .mono { font-family: var(--mono); font-size: 0.92em; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(15, 18, 22, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.brand-mark { width: 2.6rem; height: 1.5rem; flex: none; }
.bit-off { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.bit-on { fill: var(--accent); stroke: none; }
.bit-text { font-family: var(--mono); font-size: 9px; font-weight: 700; }
.bit-text-off { fill: var(--ink-faint); }
.bit-text-on { fill: var(--accent-ink); }

.brand-text strong { font-weight: 800; }

.site-nav {
  display: flex;
  gap: 1.35rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: 0.97rem;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- sections ---------- */

.section { padding: 3.25rem 0; }
.section-tight { padding: 2rem 0; }
.section + .section { border-top: 1px solid var(--line); }

.hero { padding: 4.5rem 0 3.5rem; }

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.hero h1 { max-width: 34rem; }
.hero h1 .flip { color: var(--accent); }

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

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

.button {
  display: inline-block;
  padding: 0.62rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.97rem;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.button:hover { background: #63ded2; color: var(--accent-ink); }

.button-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.button-quiet:hover { background: var(--panel-raised); color: var(--ink); border-color: var(--ink-faint); }

.button-small { padding: 0.4rem 0.8rem; font-size: 0.88rem; }

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

.grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card h3 { margin: 0; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--accent); text-decoration: underline; }
.card p { color: var(--ink-dim); margin: 0; }

.card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.86rem;
  color: var(--ink-faint);
}

.card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  object-fit: cover;
  background: var(--panel-raised);
}

/* ---------- badges ---------- */

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  white-space: nowrap;
}

.badge-released { border-color: var(--accent-dim); color: var(--accent); }
.badge-beta,
.badge-alpha { border-color: var(--warn); color: var(--warn); }
.badge-in_development { border-color: var(--line-strong); color: var(--ink-faint); }
.badge-maintenance { border-color: var(--line-strong); color: var(--ink-dim); }
.badge-deprecated { border-color: var(--bad); color: var(--bad); }

.badge-new { border-color: var(--accent-dim); color: var(--accent); }
.badge-investigating { border-color: var(--warn); color: var(--warn); }
.badge-waiting_for_user { border-color: var(--warn); color: var(--warn); }
.badge-resolved { border-color: var(--good); color: var(--good); }
.badge-closed { border-color: var(--line-strong); color: var(--ink-faint); }

/* ---------- detail pages ---------- */

.page-head { padding: 2.75rem 0 1.5rem; }
.page-head .badge { vertical-align: middle; }

.breadcrumb {
  font-size: 0.9rem;
  color: var(--ink-faint);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--ink-dim); }

.detail-layout {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
  padding-bottom: 3.5rem;
}

.prose { max-width: 42rem; }
.prose h2 { margin-top: 2rem; }

.sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.sidebar h2 { font-size: 1rem; margin-bottom: 0.75rem; }

.facts { margin: 0; }
.facts dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.facts dd { margin: 0 0 0.85rem; }
.facts dd:last-child { margin-bottom: 0; }

.sidebar-actions { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.25rem; }

/* ---------- notices ---------- */

.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1.5rem;
}
.notice-warn { border-left-color: var(--warn); }
.notice-bad { border-left-color: var(--bad); }
.notice h2, .notice h3 { margin-top: 0; }

.messages { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.message {
  border: 1px solid var(--line);
  border-left: 3px solid var(--good);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.7rem 1rem;
  margin-bottom: 0.5rem;
}
.message-error { border-left-color: var(--bad); }
.message-warning { border-left-color: var(--warn); }

/* ---------- misc ---------- */

.inline-list { list-style: none; display: flex; gap: 1rem; flex-wrap: wrap; margin: 0; padding: 0; }

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.4rem;
  margin-bottom: 1rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85rem;
  display: grid;
  place-items: center;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: var(--ink-faint);
}

table.plain { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
table.plain th,
table.plain td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain th { color: var(--ink-faint); font-weight: 600; white-space: nowrap; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 2rem 0;
  color: var(--ink-faint);
  font-size: 0.92rem;
}
.footer-inner { display: grid; gap: 0.6rem; }
.footer-brand { font-family: var(--mono); letter-spacing: 0.14em; color: var(--ink-dim); margin: 0; }
.footer-nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.footer-nav a { color: var(--ink-dim); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-note { margin: 0; max-width: 42rem; }

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

@media (max-width: 52rem) {
  .detail-layout,
  .form-layout { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 3rem 0 2.5rem; }
  .header-inner { padding-bottom: 0.6rem; }
  .site-nav { gap: 1rem; width: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .bit-on { transition: fill 200ms ease; }
}

/* A light-mode courtesy: the palette above is designed dark, so light mode
 * lifts the ground rather than inverting the whole design. */
@media (prefers-color-scheme: light) {
  :root {
    --ink: #16191d;
    --ink-dim: #4a515b;
    --ink-faint: #6b7280;
    --ground: #f7f8fa;
    --panel: #ffffff;
    --panel-raised: #eef1f5;
    --line: #e0e4ea;
    --line-strong: #c4ccd6;
    --accent: #10796f;
    --accent-ink: #ffffff;
    --accent-dim: #10796f;
    --warn: #8a5c00;
    --bad: #b3261e;
    --good: #1a7f37;
  }
  .site-header { background: rgba(247, 248, 250, 0.94); }
  .bit-text-off { fill: var(--ink-faint); }
  a:hover { color: #0b5b53; }
  .button:hover { background: #0b5b53; }
}

/* Visible to a screen reader, not on screen. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Support UX components
   --------------------------------------------------------------------------
   The support flow: form, upload control, help disclosures, confirmation and
   the reporter's ticket page. Reuses the tokens at the top of this file - no
   new palette, no new fonts, no framework. Kept as its own section so the
   brand layer above stays readable.
   ========================================================================== */

/* ---------- vertical rhythm ---------- */

.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 1.75rem; }
.stack-sm > * + * { margin-top: 0.5rem; }

/* ---------- panels: the card that groups a set of fields ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel + .panel { margin-top: 1.25rem; }

.panel-head {
  padding: 1rem 1.35rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.005em;
}

.panel-head p {
  margin: 0.3rem 0 0;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

.panel-body { padding: 1.35rem; }

/* A numbered marker in a panel head, so a long form reads as a sequence. */
.step-marker {
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  vertical-align: 0.05em;
}

/* ---------- form fields ---------- */

.field { margin-bottom: 1.5rem; }
.field:last-child { margin-bottom: 0; }

.field > label {
  display: block;
  font-weight: 600;
  font-size: 0.97rem;
  margin-bottom: 0.3rem;
  color: var(--ink);
}

.field .help {
  display: block;
  color: var(--ink-faint);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  background: var(--ground);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 0.62rem 0.75rem;
  font: inherit;
  line-height: 1.45;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--ink-faint); opacity: 0.75; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--ink-faint); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  /* A ring rather than an outline, so the shape follows the border radius. */
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}

.field textarea { resize: vertical; min-height: 7rem; }

.field select {
  appearance: none;
  padding-right: 2.25rem;
}

.select-wrap { position: relative; }

.select-wrap::after {
  content: "";
  position: absolute;
  right: 0.95rem;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--ink-faint);
  border-bottom: 2px solid var(--ink-faint);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* Error state: colour plus a left rule, so it does not rely on colour alone. */
.field-invalid > label { color: var(--bad); }

.field-invalid input[type="text"],
.field-invalid input[type="email"],
.field-invalid select,
.field-invalid textarea {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 7%, var(--ground));
}

.field-invalid input:focus,
.field-invalid select:focus,
.field-invalid textarea:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 30%, transparent);
}

.field .errorlist {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0 0 0 0.75rem;
  border-left: 2px solid var(--bad);
  color: var(--bad);
  font-size: 0.9rem;
}

.field .errorlist li + li { margin-top: 0.2rem; }

.required-mark { color: var(--accent); font-weight: 700; }

.optional-tag {
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  margin-left: 0.35rem;
}

/* ---------- the upload control ---------- */

.upload { margin-bottom: 1.5rem; }
.upload:last-child { margin-bottom: 0; }

.upload > label.upload-label {
  display: block;
  font-weight: 600;
  font-size: 0.97rem;
  margin-bottom: 0.3rem;
}

/* The real input stays in the DOM and keeps focus and keyboard behaviour; it
   is only moved out of sight. display:none would make it unfocusable. */
.upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
}

.upload-drop {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 1.1rem 1.15rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--ground);
  color: var(--ink-dim);
  cursor: pointer;
  text-align: left;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.upload-drop:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--ground));
}

/* Keyboard focus lands on the hidden input, so style its sibling. */
.upload-input:focus-visible + .upload-drop {
  border-color: var(--accent);
  border-style: solid;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}

.upload-drop.is-dragging {
  border-color: var(--accent);
  border-style: solid;
  background: color-mix(in srgb, var(--accent) 10%, var(--ground));
}

.upload-icon {
  flex: none;
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

.upload-icon svg { width: 1.2rem; height: 1.2rem; }

.upload-text { min-width: 0; }
.upload-text strong { display: block; color: var(--ink); font-weight: 600; font-size: 0.97rem; }
.upload-text span { display: block; color: var(--ink-faint); font-size: 0.85rem; margin-top: 0.15rem; }

.upload-files { list-style: none; margin: 0.65rem 0 0; padding: 0; }

.upload-files li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--good);
  border-radius: var(--radius);
  background: var(--panel-raised);
  font-size: 0.89rem;
}

.upload-files li + li { margin-top: 0.35rem; }
.upload-files[hidden] { display: none; }
.upload-file-name { font-family: var(--mono); color: var(--ink); word-break: break-all; }
.upload-file-size { margin-left: auto; color: var(--ink-faint); white-space: nowrap; }

.upload-types {
  margin: 0.55rem 0 0;
  font-size: 0.83rem;
  color: var(--ink-faint);
}

.upload-types code {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  margin-right: 0.2rem;
  font-size: 0.92em;
}

/* ---------- the honeypot ---------- */

/* Off-screen and hidden from assistive technology, but a real, fillable field
   that a bot will happily complete. NOT type=hidden and NOT display:none:
   bots skip both. Removing this rule would make the trap visible to humans, so
   it lives with the form components rather than in a utilities section. */
.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- compact lists used in sidebars ---------- */

.file-list { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.file-list li { padding: 0.28rem 0; color: var(--ink-dim); }
.file-list li + li { border-top: 1px solid var(--line); }
.file-list .mono { color: var(--ink-faint); font-size: 0.85em; }

/* ---------- help disclosures ---------- */

.help-disclosure {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-raised);
  overflow: hidden;
}

.help-disclosure + .help-disclosure { margin-top: 0.6rem; }

.help-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink);
  list-style: none;
}

.help-disclosure > summary::-webkit-details-marker { display: none; }

.help-disclosure > summary::before {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 140ms ease;
}

.help-disclosure[open] > summary::before { transform: rotate(45deg); }
.help-disclosure > summary:hover { background: var(--panel); }
.help-disclosure > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.help-disclosure-body {
  padding: 1rem 1.15rem 1.15rem;
  border-top: 1px solid var(--line);
}

.help-body > h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  margin: 1.5rem 0 0.5rem;
}

.help-body > h3:first-child { margin-top: 0; }
.help-body p { font-size: 0.95rem; }

.help-list { margin: 0 0 1rem; padding-left: 1.1rem; }
.help-list li { margin-bottom: 0.35rem; font-size: 0.94rem; }
.help-list code { color: var(--accent); }

.help-note {
  font-size: 0.88rem;
  color: var(--ink-faint);
  line-height: 1.55;
}

.path-box {
  background: var(--ground);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  overflow-x: auto;
}

.path-box code { color: var(--accent); font-size: 0.88rem; white-space: nowrap; }

.steps-compact li { margin-bottom: 0.55rem; font-size: 0.95rem; }

/* ---------- callouts ---------- */

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.95rem 1.1rem;
}

.callout-good { border-left-color: var(--good); }
.callout-warn { border-left-color: var(--warn); }
.callout-bad { border-left-color: var(--bad); }
.callout p { font-size: 0.93rem; }
.callout p:last-child { margin-bottom: 0; }
.callout h3 { font-size: 1rem; margin-bottom: 0.4rem; }

/* ---------- form-level errors ---------- */

.form-errors {
  border: 1px solid var(--bad);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bad) 9%, var(--panel));
  padding: 0.95rem 1.1rem;
  margin-bottom: 1.5rem;
}

.form-errors h2 { font-size: 1rem; margin-bottom: 0.4rem; color: var(--bad); }
.form-errors ul { margin: 0; padding-left: 1.2rem; font-size: 0.93rem; }

/* ---------- submit row ---------- */

.form-actions {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 0.35rem;
}

.form-actions .help { margin: 0; }
.button-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* ---------- confirmation page ---------- */

.ticket-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 1.5rem;
  border-top: 3px solid var(--good);
}

.ticket-number {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--ground);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.35rem 0.8rem;
}

.secret-box {
  background: var(--ground);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.secret-url {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.6;
  word-break: break-all;
  color: var(--ink);
  display: block;
}

.secret-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.copy-status { font-size: 0.88rem; color: var(--good); font-weight: 600; }
.copy-status[hidden] { display: none; }

/* ---------- ticket timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 1.1rem 1.25rem;
}

.timeline-item + .timeline-item { margin-top: 0.75rem; }
.timeline-item-staff { border-left: 3px solid var(--accent); background: var(--panel-raised); }

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: baseline;
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}

.timeline-author { font-weight: 700; color: var(--ink); font-size: 0.93rem; }
.timeline-item p { font-size: 0.95rem; }

.attachment-list { list-style: none; margin: 0; padding: 0; }

.attachment-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-raised);
  font-size: 0.89rem;
}

.attachment-list li + li { margin-top: 0.4rem; }
.attachment-list .mono { color: var(--ink); word-break: break-all; }
.attachment-kind { margin-left: auto; color: var(--ink-faint); white-space: nowrap; font-size: 0.83rem; }
.attachment-list li.is-purged { opacity: 0.65; }

/* ---------- status pill ---------- */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}

.status-new { border-color: var(--accent-dim); color: var(--accent); }
.status-investigating,
.status-waiting_for_user { border-color: var(--warn); color: var(--warn); }
.status-resolved { border-color: var(--good); color: var(--good); }
.status-closed { border-color: var(--line-strong); color: var(--ink-faint); }

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

@media (max-width: 40rem) {
  .panel-body { padding: 1.1rem; }
  .panel-head { padding: 0.9rem 1.1rem 0.75rem; }
  .upload-drop { flex-direction: column; align-items: flex-start; gap: 0.7rem; }
  .ticket-number { font-size: 1.25rem; }
  .form-actions .button { width: 100%; text-align: center; }
  .timeline-head { gap: 0.25rem; }
}

/* Honour a reduced-motion preference for the transitions added above. */
@media (prefers-reduced-motion: reduce) {
  .field input,
  .field select,
  .field textarea,
  .upload-drop,
  .help-disclosure > summary::before { transition: none; }
}

/* ==========================================================================
   Audience selector and developer documentation
   ========================================================================== */

.audience {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.audience-option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--ground);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.audience-option:hover { border-color: var(--accent); }

.audience-option input { margin-top: 0.3rem; flex: none; accent-color: var(--accent); }

/* :has lets the whole card show selection; without support the radio still
   shows it, so this is an enhancement rather than the only signal. */
.audience-option:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--ground));
}

.audience-option:has(input:focus-visible) {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}

.audience-text strong { display: block; font-size: 0.98rem; color: var(--ink); }
.audience-text span { display: block; font-size: 0.87rem; color: var(--ink-faint); margin-top: 0.15rem; }

.audience-hint[hidden] { display: none; }

/* ---------- documentation pages ---------- */

.doc-body h2 {
  margin-top: 2.25rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}

.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { margin-top: 1.6rem; font-size: 1.02rem; }
.doc-body ol.steps { margin-top: 1rem; }

.code-block {
  background: var(--ground);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

.code-block code {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
}

.doc-table th,
.doc-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
}

.doc-table thead th {
  color: var(--ink-faint);
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom-color: var(--line-strong);
  white-space: nowrap;
}

.doc-table td code { color: var(--accent); word-break: break-word; }

.doc-nav { list-style: none; margin: 0; padding: 0; }

.doc-nav li + li { margin-top: 0.15rem; }

.doc-nav a,
.doc-nav span {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--ink-dim);
  border-left: 2px solid transparent;
}

.doc-nav a:hover { background: var(--panel-raised); color: var(--ink); }

.doc-nav span[aria-current] {
  background: var(--panel-raised);
  border-left-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}

/* ==========================================================================
   Steam Workshop links
   --------------------------------------------------------------------------
   Rendered only for projects that have a Workshop URL; see
   catalog/templates/catalog/_steam_link.html. The glyph is inline SVG using
   currentColor, so both forms inherit their surroundings rather than needing
   an icon font or a second colour system.
   ========================================================================== */

.steam-glyph { width: 1.05em; height: 1.05em; flex: none; }

/* Grid card: quiet until you look at it. */
.steam-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0.25rem;
  border-radius: var(--radius);
  color: var(--ink-faint);
  line-height: 0;
  transition: color 120ms ease, background-color 120ms ease;
}

.steam-icon-link .steam-glyph { width: 1.3rem; height: 1.3rem; }
.steam-icon-link:hover { color: var(--accent); background: var(--panel-raised); }
.steam-icon-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Detail page: the main call to action for a released mod. */
.steam-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.68rem 1.1rem;
}

@media (prefers-reduced-motion: reduce) {
  .steam-icon-link { transition: none; }
}
