/* Vanilla Case List beta.
   Palette, borders and shadows are the original VCL site's tokens (old
   styles.css :root). Type: Bitter for headings, Source Sans 3 for
   everything else, both served from /static/fonts (SIL Open Font License).
   Layout: a presenter scene with a dialogue box, the Docket, a sticky case
   search, a case grid of manila folders, and a case detail view. */

@font-face {
  font-family: "Bitter";
  src: url("../fonts/bitter-latin-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
/* Ace Attorney by David Fens (FontStruct, non-commercial license; see
   static/fonts/LICENSE-AceAttorney.txt). Presenter dialogue box only. It is a
   pixel font drawn on a 1/16 em grid: crispest at 16px (phones), slightly
   larger at 20px elsewhere for reading. Characters
   it lacks (accents, ellipsis) fall back to Source Sans 3. */
@font-face {
  font-family: "Ace Attorney";
  src: url("../fonts/ace-attorney.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* From the old site */
  --cream: #f5e7c4;
  --cream-light: #fcf2d9;
  --cream-deep: #e9d29a;
  --paper: #fffaeb;
  --ink: #2a1f0a;
  --ink-soft: #4d3c1a;
  --ink-light: #7a6738;
  --navy: #0a2563;
  --easy: #1d4391;
  --easy-bg: #d6e2f7;
  --medium: #b8860b;
  --medium-bg: #f5d050;
  --easy-strip: #0a2563;
  --medium-strip: #8f6408;
  --hard-strip: #7d1a1f;
  --hard: #b13438;
  --hard-bg: #f0bdbd;
  --gold: #c9962b;
  --red-deep: #7d1a1f;

  /* Added for this build */
  --cream-stripe: #f0e0b6;
  --manila: var(--cream-deep);
  --manila-dark: #cdb06a;
  --paper-text: var(--cream-light);
  --green: #3f7330;
  --focus: #1d4391;

  --border: 3px solid var(--ink);
  /* Shadows are kept for things you pick up or that float: case cards, the
     case page folder, buttons, menus, pop-up messages and the stuck search
     bar. Panels, badges and logo frames sit flat on the page. */
  --shadow: 0 4px 0 rgba(42, 31, 10, 0.85);
  --shadow-sm: 0 2px 0 rgba(42, 31, 10, 0.85);
  --shadow-lift: 0 7px 0 rgba(42, 31, 10, 0.85);

  --font-display: "Bitter", "Rockwell", Georgia, serif;
  --font-ui: "Source Sans 3", "Segoe UI", system-ui, sans-serif;

  --gutter: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font-ui);
  background-color: var(--cream);
  background-image: repeating-linear-gradient(135deg, var(--cream) 0 16px, var(--cream-stripe) 16px 32px);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--easy); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; }

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

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

.skip { position: absolute; left: var(--gutter); top: -100px; background: var(--paper); padding: 8px 12px; z-index: 10; border: var(--border); }
.skip:focus { top: 8px; }

/* Site-wide notice (admins) and a suspended account's own note: no Hide button. */
.sitenotice { background: var(--hard-strip); color: var(--paper-text); border-bottom: var(--border); }
.sitenotice__inner, .suspended-note__inner { max-width: 1200px; margin: 0 auto; padding: 8px var(--gutter); text-align: center; font-weight: 600; }
.sitenotice a { color: inherit; font-weight: 700; }
.suspended-note { background: var(--medium-bg); color: var(--ink); border-bottom: var(--border); }
.suspended-note__inner { font-weight: 400; }
.wide .sitenotice__inner, .wide .suspended-note__inner { max-width: none; }
.suspend-form { display: grid; gap: 6px; margin: 6px 0; }

/* Event banner (set on the Docket settings page; see app/event.py). */
.eventbar { background: var(--navy); color: var(--paper-text); border-bottom: var(--border); }
.eventbar__inner {
  max-width: 1200px; margin: 0 auto; padding: 8px var(--gutter);
  display: flex; align-items: center; justify-content: center; gap: 8px 16px;
}
.eventbar__text { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 12px; text-align: center; }
.eventbar__title { font: 700 1.0625rem/1.25 var(--font-display); letter-spacing: 0.04em; }
.eventbar__dates { font-weight: 600; }
.eventbar__status {
  font: 700 0.8125rem/1 var(--font-ui); padding: 4px 9px; border-radius: 999px;
  background: var(--paper-text); color: var(--navy); align-self: center;
}
.eventbar--running .eventbar__status { background: var(--medium-bg); color: var(--ink); }
.eventbar__link {
  flex: none; font: 700 0.875rem/1 var(--font-ui); padding: 6px 12px; border: 2px solid var(--paper-text);
  color: var(--paper-text); text-decoration: none;
}
.eventbar__link:hover, .eventbar__link:focus-visible { background: var(--paper-text); color: var(--navy); }
.eventbar__toggle {
  flex: none; display: none; align-items: center; gap: 4px; padding: 4px 6px; border: 0; background: transparent;
  color: var(--paper-text); font: 700 0.8125rem/1 var(--font-ui); cursor: pointer;
}
.js .eventbar__toggle { display: inline-flex; }
.eventbar__toggle:hover { background: rgba(255, 255, 255, 0.15); }
.eventbar__toggle svg { width: 14px; height: 14px; display: block; transition: transform 160ms ease; }
.eventbar__toggle-show { display: none; }
/* Folded: one thin line with the event name and Show. */
.event-folded .eventbar__inner { padding-top: 3px; padding-bottom: 3px; }
.event-folded .eventbar__dates, .event-folded .eventbar__status, .event-folded .eventbar__link { display: none; }
.event-folded .eventbar__title { font-size: 0.8125rem; flex-basis: auto; }
.event-folded .eventbar__toggle-hide { display: none; }
.event-folded .eventbar__toggle-show { display: inline; }
.event-folded .eventbar__toggle svg { transform: rotate(180deg); }
@media (max-width: 600px) {
  .eventbar__inner { padding: 6px 6px 6px var(--gutter); gap: 8px; }
  .eventbar__title { font-size: 0.9375rem; flex-basis: 100%; }
  .eventbar__dates { font-size: 0.875rem; }
  .eventbar__link { padding: 5px 8px; font-size: 0.8125rem; }
}

/* Header */

.site-head { background: var(--paper); border-bottom: var(--border); }

.site-head__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand__logo { height: 84px; width: auto; }
@media (max-width: 480px) { .brand__logo { height: 44px; } }
.brand__name { font: 700 1.625rem/1.1 var(--font-display); }
.brand__beta {
  font: 700 0.75rem/1 var(--font-ui);
  color: var(--paper-text);
  background: var(--hard);
  padding: 4px 7px;
  border-radius: 3px;
  align-self: flex-end;
  margin-bottom: 10px;
}

.site-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  padding: 6px 12px;
  border: 2px solid transparent;
  border-radius: 4px;
}
.site-nav a:hover { border-color: var(--ink); background: var(--cream); }

/* Credits: one quiet line under the header row, split by thin rules. On
   phones each part gets its own line. */
.credits {
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(1200px - 2 * var(--gutter));
  margin: 0 auto;
  padding: 7px 0 9px;
  border-top: 1px dashed var(--manila-dark);
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.credits strong { color: var(--ink); }
.credits__part + .credits__part { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--manila-dark); }
@media (max-width: 600px) {
  .credits { flex-direction: column; }
  .credits__part + .credits__part { margin-left: 0; padding-left: 0; border-left: 0; }
}
.site-nav a[aria-current="page"] { border-color: var(--ink); background: var(--cream); }  /* same as the current dropdown menu */

/* Header links carry a small icon (hidden on phones to keep two rows). */
.site-nav > a { display: inline-flex; align-items: center; gap: 6px; }
.site-nav > a.login { display: inline-block; }
.nav__icon { width: 1.15em; height: 1.15em; flex: none; color: var(--navy); }
@media (max-width: 480px) { .nav__icon { display: none; } }

/* Discord invite (on the credits line): the Discord-blue mark. */
.hub__icon { width: 1.2em; height: 1.2em; flex: none; color: #4752c4; }
/* The Casing Hub invite sits at the end of the credits line, pushed right. */
.credits .credits__hub { margin-left: auto; padding-left: 12px; border-left: 0; }
.credits .hub { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); text-decoration: none; }
.credits .hub:hover { text-decoration: underline; }
.credits .hub__icon { width: 1.25em; height: 1.25em; }
@media (max-width: 600px) { .credits .credits__hub { margin-left: 0; padding-left: 0; margin-top: 2px; } }

/* FAQ page */
.faq { max-width: 860px; }
.faq__intro { margin: 0 0 18px; }
.faq__group { margin-bottom: 22px; }
.faq__group .panel__body { padding: 4px 14px; }
.faq__item { border-bottom: 1px dashed var(--manila-dark); }
.faq__item:last-child { border-bottom: 0; }
.faq__item summary {
  cursor: pointer; padding: 12px 28px 12px 0; position: relative;
  font: 700 1.0625rem/1.4 var(--font-display); list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+"; position: absolute; right: 4px; top: 10px;
  font: 700 1.25rem/1 var(--font-ui); color: var(--ink-soft);
}
.faq__item[open] summary::after { content: "\2212"; }
.faq__item summary:hover { color: var(--navy); }
.faq__item > :not(summary) { margin: 0 0 12px; }
.faq__item ul { padding-left: 1.3em; }
.faq__item li + li { margin-top: 4px; }
.faq__foot { margin: 0; }

.page { max-width: 1200px; margin: 0 auto; padding: 24px var(--gutter) 48px; }

/* Shared panel: paper, ink border, navy title bar */

.panel { background: var(--paper); border: var(--border); border-radius: 0; overflow: hidden; }
.panel__bar {
  margin: 0;
  padding: 8px 14px;
  background: var(--navy);
  color: var(--paper-text);
  font: 700 1.25rem/1.3 var(--font-display);
}
.panel__body { padding: 12px 14px 14px; }

.btn {
  display: inline-block;
  font: 700 0.9375rem/1.2 var(--font-ui);
  padding: 9px 16px;
  border: var(--border);
  border-radius: 3px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  cursor: pointer;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn--ink { background: var(--ink); color: var(--paper-text); }
.btn--plain { background: var(--paper); color: var(--ink); }
.btn--plain:hover { background: var(--cream-deep); }
/* A button already pressed and working (Pick for me): darkened, no more presses. */
.btn.is-busy { filter: brightness(0.72) saturate(0.6); cursor: progress; transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn--green { background: var(--green); color: var(--paper-text); }
.link-quiet { color: var(--ink-soft); }

/* Primary action: open a case or its document */

.btn--primary {
  font: 700 1.125rem/1.2 var(--font-ui);
  padding: 11px 20px;
  background: var(--hard);
  color: var(--paper-text);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--red-deep); }

/* Top row: scene and Docket */

.top { display: grid; gap: 24px; margin-bottom: 28px; }
.top > * { min-width: 0; }

/* Three columns on wide screens (scene, Docket, activity). Between 900 and
   1150px the activity column moves below the other two. */
@media (min-width: 900px) {
  .top { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
  .top > .activity { grid-column: 1 / -1; }
}
@media (min-width: 1150px) {
  .top { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); }
  .top > .activity { grid-column: auto; align-self: stretch; }
  /* The Docket reaches the bottom of the row too; the What's new banner
     takes the height that is left (see .newslide). */
  .top > .docket { align-self: stretch; display: flex; flex-direction: column; }
  .top > .docket > .panel__body { flex: 1; display: flex; flex-direction: column; }
  .top > .docket .newslide { flex: 1; }
}

.scene { position: relative; }

/* A 4:3 screen like the games: background and sprite fill it, and the
   dialogue box sits over the bottom third. AO sprites and backgrounds are
   drawn for 4:3, so they fit without cropping. */
.scene__screen {
  position: relative;
  aspect-ratio: 4 / 3;
  border: var(--border);
  border-radius: 0;
  overflow: hidden;
  background: var(--manila);
}
.scene__stage { position: absolute; inset: 0; }

.scene__stage--plain {
  background:
    linear-gradient(to bottom, transparent 72%, var(--ink-soft) 72%, var(--ink-soft) 73.5%, #7b5d3a 73.5%),
    radial-gradient(ellipse at 50% 30%, var(--paper), var(--manila) 75%);
}

.scene__bg, .scene__sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scene__bg { object-position: 50% 60%; }
.scene__sprite { object-fit: contain; object-position: 50% 100%; }
.is-pixel { image-rendering: pixelated; }

/* The dialogue box sits inside the bottom of the screen, as in the games. */
.dialogue {
  position: absolute;
  z-index: 2;
  left: 10px;
  right: 10px;
  bottom: 10px;
  min-height: 5.9em;
  padding: 16px 44px 12px 18px;
  /* Like the games' text box: dark and see-through, a thin light frame. */
  background: rgba(18, 28, 58, 0.72);
  color: #f4f6fb;
  border: 2px solid rgba(232, 236, 245, 0.9);
  outline: 2px solid rgba(20, 16, 8, 0.5);
  border-radius: 6px;
  font: 400 20px/1.5 "Ace Attorney", var(--font-ui);
  font-synthesis: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
  cursor: default;
}

.dialogue__name {
  position: absolute;
  top: -0.95em;
  left: 10px;
  margin: 0;
  padding: 1px 12px;
  background: rgba(64, 78, 112, 0.95);
  color: #fff;
  border: 2px solid rgba(232, 236, 245, 0.9);
  border-radius: 4px;
  font: 400 16px/1.4 "Ace Attorney", var(--font-ui);
  font-synthesis: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.dialogue__lines { list-style: none; margin: 0; padding: 0; }
.dialogue__line + .dialogue__line { margin-top: 0.6em; }
.js .dialogue__line { display: none; }
.js .dialogue__line.is-current { display: block; }
.js .dialogue[data-ready] { cursor: pointer; }

.dialogue__next {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: none;
}
.js .dialogue__next { display: block; }
.dialogue__next span {
  display: block;
  margin: auto;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #fff;
}
.dialogue[data-typing] .dialogue__next span { visibility: hidden; }
.dialogue:not([data-typing]) .dialogue__next span { animation: nudge 0.9s steps(2, jump-none) infinite; }
@keyframes nudge { to { transform: translateX(4px); } }

.scene__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
/* Buttons that sit side by side are the same size; color alone marks the main one. */
.scene__actions .btn, .detail__actions .btn { font-size: 1.0625rem; padding: 10px 18px; }
/* Pick for me stretches over the rest of the row, so the buttons end level
   with the right edge of the presenter screen above. */
.scene__actions .btn { justify-content: center; text-align: center; }
.scene__actions .btn--primary { flex: 3 1 0; }
.scene__actions [data-random] { flex: 2 1 0; }

@media (max-width: 480px) {
  .dialogue { left: 7px; right: 7px; bottom: 7px; min-height: 5.2em; padding: 14px 40px 10px 14px; font-size: 16px; }
}

/* The Docket */

.docket__lines { margin: 0; }
.docket__lines div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--manila-dark); }
.docket__lines dt { color: var(--ink-soft); }
.docket__lines dd { margin: 0; font-weight: 700; text-align: right; }
.docket__sub { margin: 14px 0 4px; font-size: 1rem; }
.docket__event-when { display: block; font-weight: 400; font-size: 0.875rem; color: var(--ink-soft); }
/* What's new: the new cases' logos, each a link to its case. */
.newgrid {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}
.newgrid__item {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  padding: 3px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--easy-bg);
  transition: transform 140ms cubic-bezier(.2, .8, .3, 1.2);
}
.newgrid__item--easy { background: var(--easy-bg); }
.newgrid__item--medium { background: var(--medium-bg); }
.newgrid__item--hard { background: var(--hard-bg); }
/* The logo is pinned inside the box, so a taller logo image cannot stretch it:
   every box stays exactly 16:9 and the logo scales to fit. */
.newgrid__item { position: relative; overflow: hidden; }
.newgrid__item img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; }
.newgrid__item:hover, .newgrid__item:focus-visible { transform: translateY(-3px); }
.newgrid__text { font: 700 0.75rem/1.2 var(--font-display); text-align: center; color: var(--ink); }
.docket__empty { margin: 0; color: var(--ink-soft); }

/* What's new banner: one case per slide, logo left and details right
   (difficulty, title, author, a short description; no other labels), or
   stacked when the Docket is narrow (a container query on the banner's own
   width). The track scrolls sideways and snaps to each slide; vcl.js moves it
   on its own and wires the controls. */
.newslide { display: flex; flex-direction: column; min-width: 0; container-type: inline-size; }
.newslide__track {
  list-style: none; margin: 6px 0 0; padding: 0;
  position: relative; display: flex; flex: 1; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.newslide__track::-webkit-scrollbar { display: none; }
.newslide__track:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.newslide__slide {
  flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always;
  display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); gap: 12px; align-items: center;
  padding: 2px 2px 4px;
}
.newslide__logo { width: 100%; }
.newslide__logo:hover, .newslide__logo:focus-visible { transform: none; }
.newslide__info { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.newslide__info > p { margin: 0; }
.newslide__diff {
  padding: 0 7px; border-radius: 2px; font: 700 0.6875rem/1.6 var(--font-ui); letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--paper-text); background: var(--easy-strip);
}
.newslide__diff--medium { background: var(--medium-strip); }
.newslide__diff--hard { background: var(--hard-strip); }
.newslide__title { margin: 0; font: 700 1rem/1.25 var(--font-display); overflow-wrap: anywhere; }
.newslide__title a { color: var(--ink); text-decoration: none; }
.newslide__title a:hover { text-decoration: underline; }
.newslide__by { font-size: 0.8125rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.newslide__desc {
  font-size: 0.8125rem; line-height: 1.4; color: var(--ink-soft);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.newslide__open { margin-top: 4px; }

/* The three-column Docket is about 320px wide: still two columns, a little
   tighter. Only very narrow banners stack. */
@container (max-width: 380px) {
  .newslide__slide { grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); gap: 10px; }
  .newslide__title { font-size: 0.9375rem; }
  .newslide__desc { -webkit-line-clamp: 2; line-clamp: 2; }
  /* The title and logo already open the case; save the height. */
  .newslide__open { display: none; }
}
@container (max-width: 250px) {
  .newslide__slide { grid-template-columns: minmax(0, 1fr); align-content: start; }
}

.newslide__controls { display: none; }
.js .newslide__controls { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.newslide__btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); color: var(--ink);
  font: 700 1.25rem/1 var(--font-ui); cursor: pointer;
}
.newslide__btn:hover { background: var(--cream-deep); }
.newslide__btn span { margin-top: -2px; }
.newslide__dots { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0 4px; flex: 1; justify-content: center; }
.newslide__dots button {
  display: block; width: 10px; height: 10px; padding: 0; border: 2px solid var(--ink); border-radius: 50%;
  background: var(--paper); cursor: pointer;
}
.newslide__dots button[aria-current="true"] { background: var(--ink); }
.newslide__count { font-size: 0.8125rem; font-weight: 700; color: var(--ink-soft); min-width: 3.2em; text-align: center; }
/* Pause shows two bars; once paused it shows a play triangle. */
.newslide__pause-icon { display: block; width: 10px; height: 11px; margin: 0 !important;
  border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.newslide__pause[aria-pressed="true"] .newslide__pause-icon {
  width: 0; height: 0; margin-left: 3px !important; border-right: 0;
  border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 10px solid currentColor;
}
/* Many new cases: the dots would crowd the row, so only the count shows. */
.newslide--crowded .newslide__dots { display: none; }
.newslide--crowded .newslide__count { flex: 1; }

/* Recent activity. On wide screens the list scrolls inside the column so
   the column never makes the top section taller than its neighbors. */
.activity { display: flex; flex-direction: column; }
.activity__body { position: relative; flex: 1 1 auto; }
.activity__list { list-style: none; margin: 0; padding: 4px 0; }
.activity__item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 14px;
  border-bottom: 1px dashed var(--manila-dark);
}
.activity__item:last-child { border-bottom: 0; }
.activity__avatar { width: 28px; height: 28px; }
.activity__text { margin: 0; font-size: 0.8125rem; line-height: 1.45; overflow-wrap: anywhere; }
.activity__name { font-weight: 700; color: var(--ink); }
.activity__score { font-weight: 700; color: var(--navy); white-space: nowrap; }
.activity__time { display: block; color: var(--ink-light); font-size: 0.75rem; }
.activity__empty { margin: 0; padding: 12px 14px; color: var(--ink-soft); }

@media (min-width: 1150px) {
  .activity__body { min-height: 220px; }
  .activity__list { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; }
}
@media (min-width: 900px) and (max-width: 1149px) {
  .activity__list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; }
  .activity__item:nth-child(n+9) { display: none; }
  .activity__item:last-child { border-bottom: 1px dashed var(--manila-dark); }
}
@media (max-width: 899px) {
  .activity__item:nth-child(n+6) { display: none; }
}

.role-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 3px;
  font: 700 0.6875rem/1.5 var(--font-ui);
  vertical-align: 1px;
  color: var(--paper-text);
  background: var(--easy-strip);
}
.role-tag--admin { background: var(--hard-strip); }

/* Staff names: colored with a soft glow of the same color. Two classes so
   list rules like ".online__list a { color }" cannot override the color. Admin uses the
   Hard red, Editor the Easy blue. The Admin/Editor tags only appear on
   profile pages now. */
/* Everyone else's name is ink, wherever it appears (case activity, forum
   posts...), instead of the default link blue. */
.who { color: var(--ink); font-weight: 700; }
.who.who--admin, .who.who--editor { font-weight: 700; text-decoration-thickness: 1px; }
.who.who--admin { color: var(--hard-strip); text-shadow: 0 0 5px rgba(214, 48, 56, 0.4); }
.who.who--editor { color: var(--easy); text-shadow: 0 0 5px rgba(60, 120, 235, 0.4); }
.ranking__avatar { width: 44px; height: 44px; }
.ranking--people .ranking__main { display: block; }
.ranking--people .who { font-weight: 700; font-size: 1.0625rem; }
.ranking--people .who:not(.who--admin):not(.who--editor) { color: var(--ink); }
.ranking--people .ranking__by { display: block; }

/* Titles are outlined, so they never look like the solid Admin and Editor tags. */
.title-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  border: 1px solid var(--medium-strip);
  border-radius: 3px;
  font: 700 0.6875rem/1.4 var(--font-ui);
  vertical-align: 1px;
  color: var(--medium-strip);
  background: var(--paper);
  white-space: nowrap;
}
.profile__marks .title-tag { font-size: 0.75rem; }
.profile__joined { margin-left: 10px; }

/* Users directory: six to a row on desktop, avatar first. */
.ugrid { list-style: none; margin: 14px 0 20px; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 480px) { .ugrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 760px) { .ugrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .ugrid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.ucard {
  display: grid; justify-items: center; align-content: start; gap: 4px; height: 100%; padding: 16px 10px 14px; text-align: center;
  background: var(--paper); border: var(--border); color: var(--ink); text-decoration: none;
  transition: transform 140ms ease;
}
.ucard:hover, .ucard:focus-visible { transform: translateY(-3px); }
.ucard__avatar { width: 96px; height: 96px; margin-bottom: 6px; }
.ucard__name { font-weight: 700; font-size: 1.0625rem; line-height: 1.25; overflow-wrap: anywhere; }
.ucard:hover .ucard__name { text-decoration: underline; }
.ucard__title .title-tag { margin-left: 0; }
.ucard__joined { font-size: 0.8125rem; color: var(--ink-soft); }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pager a { padding: 5px 12px; border: 2px solid var(--ink); border-radius: 3px; background: var(--paper); color: var(--ink); font-weight: 700; text-decoration: none; }
.pager a:hover { background: var(--cream); }
.pager a[aria-current="page"] { background: var(--navy); color: var(--paper-text); }
/* On profiles the Admin or Editor tag sits next to the name, at a readable size. */
.profile__name .role-tag { margin-left: 12px; padding: 3px 10px; border-radius: 3px; font-size: 0.9375rem; line-height: 1.3; vertical-align: 6px; }
.titlepick summary, .renamer summary { cursor: pointer; }
.renamer { margin-top: 4px; font-size: 0.875rem; }
.renamer form { margin: 6px 0 2px; }
.titlepick .title-tag:first-child { margin-left: 0; }
.titlepick__edit { margin-left: 8px; font-size: 0.8125rem; text-decoration: underline; color: var(--easy); }
.titlepick fieldset { border: 0; margin: 6px 0; padding: 0; display: grid; gap: 4px; }
.titles-add { margin-top: 16px; align-items: end; }

/* Evidence record */

.record__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.record__title {
  margin: 0;
  padding: 6px 22px 5px;
  background: var(--navy);
  color: var(--paper-text);
  font-size: 1.375rem;
  border-radius: 0;
}
.record__count { margin: 0 4px 6px 0; color: var(--ink-soft); font-weight: 700; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px;
  background: var(--paper);
  border: var(--border);
  border-radius: 0;
  transition: box-shadow 0.2s ease, border-radius 0.2s ease;
}

/* The search bar sticks to the top of the screen once scrolled past.
   On phones it only sticks with JavaScript, which collapses it (below). */
.searchbar { position: sticky; top: 8px; z-index: 30; margin-bottom: 28px; transition: transform 220ms ease; }
.searchbar.is-hidden { transform: translateY(calc(-100% - 16px)); }
.searchbar:focus-within { transform: none; }
.searchbar-sentinel { height: 1px; margin-bottom: -1px; }
.searchbar.is-stuck .toolbar {
  border-radius: 0;
  box-shadow: 0 5px 0 rgba(42, 31, 10, 0.85);
}
.toolbar__count { display: none; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.searchbar.is-stuck .toolbar__count { display: inline; }
.toolbar__more {
  display: none;
  align-items: center;
  padding: 7px 12px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  font: 700 0.875rem/1.2 var(--font-ui);
  cursor: pointer;
}
.searchbar.is-open .toolbar__more { background: var(--navy); color: var(--paper-text); }

@media (max-width: 700px) {
  .searchbar { position: static; }
  .js .searchbar { position: sticky; }
  .js .searchbar.is-stuck .toolbar { padding: 10px; gap: 8px; }
  .js .searchbar.is-stuck .toolbar__search { flex: 1 1 0; min-width: 0; }
  .js .searchbar.is-stuck .toolbar__more { display: inline-flex; }
  .js .searchbar.is-stuck .toolbar__count { display: none; }
  .js .searchbar.is-stuck:not(.is-open) .toolbar__diff,
  .js .searchbar.is-stuck:not(.is-open) .toolbar__selects,
  .js .searchbar.is-stuck:not(.is-open) .toggle,
  .js .searchbar.is-stuck:not(.is-open) .toolbar__actions { display: none; }
  /* Opened: search and Filters stay on the first row, each group below gets its own. */
  .js .searchbar.is-stuck.is-open .toolbar__diff,
  .js .searchbar.is-stuck.is-open .toolbar__selects,
  .js .searchbar.is-stuck.is-open .toggle { flex: 1 1 100%; }
}

.toolbar__search { flex: 1 1 260px; }
.toolbar__diff { display: flex; gap: 6px; border: 0; margin: 0; padding: 0; }
.toolbar__selects { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar__actions { display: flex; align-items: center; gap: 14px; }
.js [data-hide-with-js] { display: none; }

input[type="search"], select {
  font: inherit;
  width: 100%;
  padding: 7px 10px;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
}
select { width: auto; }

.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-block;
  padding: 4px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  background: var(--paper);
}
.chip--easy input:checked + span { background: var(--easy); color: var(--paper-text); }
.chip--medium input:checked + span { background: var(--medium-strip); color: var(--paper-text); }
.chip--hard input:checked + span { background: var(--hard); color: var(--paper-text); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.toggle { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 700; font-size: 0.875rem; }
.toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }

.shelf { margin-bottom: 32px; }
.shelf__label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 1.375rem;
}
.shelf__label::after { content: ""; flex: 1; height: 3px; background: var(--ink); border-radius: 2px; }
/* Folding shelf (profile Favorites): the header is the toggle, Show / Hide at the end. */
.shelf--fold > summary { cursor: pointer; list-style: none; }
.shelf--fold > summary::-webkit-details-marker { display: none; }
.shelf__heading { margin: 0; font-size: inherit; }
.shelf__toggle { order: 2; font: 700 0.875rem/1 var(--font-ui); padding: 5px 10px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); }
.shelf__toggle::before { content: "Show"; }
.shelf--fold[open] .shelf__toggle::before { content: "Hide"; }
.shelf--fold > summary:hover .shelf__toggle { background: var(--cream); }
.shelf--fold:not([open]) > summary { margin-bottom: 0; }
.shelf__count {
  font: 700 0.8125rem/1 var(--font-ui);
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper-text);
}
.shelf__label--easy .shelf__count { background: var(--easy); }
.shelf__label--medium .shelf__count { background: var(--medium-strip); }
.shelf__label--hard .shelf__count { background: var(--hard); }

.evidence-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 24px;
}
.evidence-grid > li { min-width: 0; }

@media (max-width: 700px) {
  .evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
}

/* One case: a manila folder holding an evidence icon. */
.evidence {
  position: relative;
  display: flex;
  flex-direction: column;
  /* Room above for the tab, without spilling past the grid cell below. */
  height: calc(100% - 22px);
  margin-top: 22px;
  padding: 10px 10px 12px;
  background: var(--manila);
  border: var(--border);
  border-radius: 0;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none;
}

.evidence__tab {
  position: absolute;
  left: -3px;
  bottom: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 1px;
  background: var(--easy-strip);
  color: var(--paper-text);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  border: var(--border);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  font: 700 0.8125rem/1.5 var(--font-ui);
}
.evidence--medium .evidence__tab { background: var(--medium-strip); }
.evidence--hard .evidence__tab { background: var(--hard-strip); }

.evidence__frame {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--paper);
  border: 2px solid var(--gold);
  outline: 2px solid var(--ink);
  outline-offset: 0;
  border-radius: 0;
  padding: 4px;
  margin-bottom: 9px;
}
/* Logos of any shape fit inside the same 16:9 frame, so every card in a row lines up. */
.evidence__frame img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; }
.evidence--easy .evidence__frame, .detail--easy .detail__frame img, .ranking__logo--easy { background-color: var(--easy-bg); }
.evidence--medium .evidence__frame, .detail--medium .detail__frame img, .ranking__logo--medium { background-color: var(--medium-bg); }
.evidence--hard .evidence__frame, .detail--hard .detail__frame img, .ranking__logo--hard { background-color: var(--hard-bg); }

.evidence__noimg {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 6px;
  text-align: center;
  font: 700 0.875rem/1.2 var(--font-display);
  color: var(--ink-soft);
}

.evidence__name {
  font: 700 1.0625rem/1.25 var(--font-display);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.evidence__by { margin-top: 3px; font-size: 0.8125rem; color: var(--ink-soft); overflow-wrap: anywhere; }

/* Length gets its own label at the foot of the card
   so badges line up across a row. */
.evidence__meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: auto; padding-top: 10px;
}
.evidence__by { margin-bottom: 2px; }
/* Badges are paper file labels: ink border, a color strip on the left, a
   small drop shadow. Length and tags share this shape (see .tag below). */
.length-badge, .tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px 1px 6px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-left-width: 6px;
  border-radius: 2px;
  font: 700 0.75rem/1.5 var(--font-ui);
  color: var(--ink);
  white-space: nowrap;
}
.length-badge--short { border-left-color: #4f9aa4; }
.length-badge--moderate { border-left-color: #e0913f; }
.length-badge--long { border-left-color: #a35a87; }
.meter { display: inline-flex; align-items: flex-end; gap: 2px; color: var(--ink-soft); }
.meter i { width: 4px; border-radius: 1px; background: currentColor; opacity: 0.25; }
.meter i:nth-child(1) { height: 5px; }
.meter i:nth-child(2) { height: 8px; }
.meter i:nth-child(3) { height: 11px; }
.meter i.on { opacity: 1; }

.evidence:hover, .evidence:focus-visible { transform: translateY(-5px) rotate(-0.7deg); box-shadow: var(--shadow-lift); }
.evidence-grid > li:nth-child(even) .evidence:hover,
.evidence-grid > li:nth-child(even) .evidence:focus-visible { transform: translateY(-5px) rotate(0.7deg); }
.evidence:hover .evidence__name { text-decoration: underline; }
.evidence { transition: transform 160ms cubic-bezier(.2, .8, .3, 1.2), box-shadow 160ms ease-out; }
.evidence.is-pressed { transform: translateY(-2px) scale(0.98); transition-duration: 80ms; }

@media (max-width: 520px) {
  .evidence { padding: 8px 8px 10px; }
  .evidence__name { font-size: 0.9375rem; }
}

.empty { max-width: 560px; }

/* Case detail: the evidence check view */

.crumb { margin: 0 0 16px; font-weight: 700; }

.detail {
  position: relative;
  background: var(--manila);
  border: var(--border);
  border-radius: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.folder-cover { display: none; }

.detail__name {
  margin: 0;
  padding: 12px 18px;
  background: var(--navy);
  color: var(--paper-text);
  font-size: 2rem;
  border-bottom: 6px solid var(--easy);
}
.detail--medium .detail__name { border-bottom-color: var(--medium); }
.detail--hard .detail__name { border-bottom-color: var(--hard); }

.detail__top { display: grid; gap: 18px; padding: 18px; }

@media (min-width: 760px) {
  .detail__top { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; padding: 22px; }
}

.detail__frame { margin: 0; }
.detail__frame img, .detail__frame .evidence__noimg {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--paper);
  border: 3px solid var(--gold);
  outline: 3px solid var(--ink);
  border-radius: 0;
  padding: 6px;
}
.detail__frame figcaption { margin-top: 8px; font-size: 0.8125rem; color: var(--ink-soft); }

.detail__facts {
  margin: 0;
  background: var(--paper);
  border: var(--border);
  border-radius: 0;
  padding: 6px 14px;
}
.detail__facts div {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--manila-dark);
}
.detail__facts div:last-child { border-bottom: 0; }
.detail__facts dt { color: var(--ink-soft); }
.detail__facts dd { margin: 0; font-weight: 700; }
.detail__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail__facts dd.detail__quiet { font-weight: 400; color: var(--ink-soft); }

.diff-pill { display: inline-block; padding: 1px 10px; border-radius: 999px; border: 2px solid var(--ink); color: var(--paper-text); background: var(--easy); }
.diff-pill--medium { background: var(--medium-strip); }
.diff-pill--hard { background: var(--hard); }

/* Tags: same label shape as length; the strip and icon carry the meaning. */
.tag { border-left-color: var(--ink-light); }
.tag__icon { width: 1.05em; height: 1.05em; flex: 0 0 auto; }
.tag--new { border-left-color: var(--gold); }
.tag--new .tag__icon { color: var(--medium-strip); }
.tag--tutorial { border-left-color: #82a8e6; }
.tag--tutorial .tag__icon { color: var(--easy); }
.tag--custom { border-left-color: var(--easy); }
.tag--custom .tag__icon { color: var(--easy); }
.tag--nsfw { border-left-color: var(--hard); background: #fbe3e1; color: var(--hard-strip); }

.detail__desc {
  margin: 0 18px;
  padding: 16px 18px;
  background: var(--paper);
  border: var(--border);
  border-radius: 0;
}
.detail__desc p { margin: 0 0 1em; }
.detail__desc p:last-child { margin-bottom: 0; }
.detail__none { color: var(--ink-soft); }

@media (min-width: 760px) { .detail__desc { margin: 0 22px; } }

.detail__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 20px 18px 22px; }
@media (min-width: 760px) { .detail__actions, .detail__log { justify-content: center; } }
.detail__fav { margin: 0; }
/* Spoiler reviews: folded behind a bar until opened. */
.spoiler { margin-top: 6px; }
.spoiler__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 12px; cursor: pointer; list-style: none;
  background: var(--ink); color: var(--paper-text); border-radius: 3px; font-size: 0.9375rem;
}
.spoiler__bar::-webkit-details-marker { display: none; }
.spoiler__show, .spoiler__hide { text-decoration: underline; }
.spoiler__hide, .spoiler[open] .spoiler__show { display: none; }
.spoiler[open] .spoiler__hide { display: inline; }
.spoiler[open] > .spoiler__bar { margin-bottom: 8px; }
.reviewform__spoilers { margin: 4px 0 8px; }
.reviewform__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 22px; margin: 4px 0 8px; }
.reviewform__row .reviewform__spoilers { margin: 0 0 6px; }
.reviewform__score { display: grid; gap: 4px; }
.reviewform__score select { min-width: 140px; }
.reviewedit { margin: 4px 0 14px; }
.reviewedit > summary { list-style: none; display: inline-block; }
.reviewedit > summary::-webkit-details-marker { display: none; }
.reviewedit[open] > summary { margin-bottom: 10px; background: var(--cream-deep); }
.review__score--none { color: var(--ink-light); font-weight: 400; font-style: italic; }
.queue-item__approve { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }

/* Helpful / Funny under reviews */
.review__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; }
.vote { margin: 0; }
.vote__btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--paper); color: var(--ink); font: 700 0.8125rem/1.3 var(--font-ui); cursor: pointer;
}
.vote__btn:hover { background: var(--cream); }
.vote__icon { width: 15px; height: 15px; flex: none; }
.vote__btn--helpful[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--paper-text); }
.vote__btn--funny[aria-pressed="true"] { background: var(--medium-bg); }
.vote__btn:disabled { opacity: 0.6; cursor: progress; }
.review__votes { flex: 1 1 100%; margin: 2px 0 0; font-size: 0.75rem; color: var(--ink-light); }

/* Reviewer signatures: 6:1, at most 600 x 100 */
.signature { display: block; width: 100%; max-width: 600px; height: auto; aspect-ratio: 6 / 1; object-fit: cover; border: 1px solid var(--manila-dark); background: var(--cream); }
.review__signature { margin-top: 10px; }

/* Author's notes on case pages */
.authornotes { margin: 0 22px 18px; padding: 12px 16px; background: var(--cream-light); border: 2px dashed var(--manila-dark); }
.authornotes__title { margin: 0 0 6px; font-size: 1.0625rem; }
.authornote { padding: 6px 0 8px; border-bottom: 1px dashed var(--manila-dark); }
.authornote:last-of-type { border-bottom: 0; }
.authornote__meta { margin: 0 0 2px; }
.authornote__body p { margin: 0 0 6px; }
.authornote__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 0.875rem; }
.authornote__tools form { margin: 0; }
.authornote__tools summary { cursor: pointer; text-decoration: underline; }
.authornote__tools textarea, .authornotes__new textarea { display: block; width: 100%; margin: 6px 0; }
.authornotes__new { margin-top: 8px; }
.authornotes__new summary { cursor: pointer; font-weight: 700; }
@media (max-width: 600px) { .authornotes { margin: 0 12px 14px; padding: 10px 12px; } }
.follows { list-style: none; margin: 8px 0 4px; padding: 0; }
.follows__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--manila-dark); }
.follows__item:last-child { border-bottom: 0; }
.follows__item form { margin: 0; }
.sigform { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 8px; }
.sigform .field__label { flex: 1 1 100%; margin: 0; }
#signature .signature { margin: 6px 0 10px; }
.queue-item .signature { margin: 8px 0; }
.signature--old { opacity: 0.7; max-width: 300px; }
.approvaltabs { margin-top: 0; }
.profile__id { flex-wrap: wrap; }
.profile__signature { flex: 0 1 600px; margin-left: auto; max-width: 600px; align-self: center; }  /* full shown size, 600 x 100 */
@media (max-width: 1150px) { .profile__signature { margin-left: 0; } }
@media (max-width: 760px) { .profile__signature { flex-basis: 100%; max-width: 600px; } }
.btn__icon { width: 1em; height: 1em; margin-right: 0.45em; vertical-align: -0.12em; }
.btn--plain .btn__icon { color: var(--medium-strip); }
@media (min-width: 760px) { .detail__actions { padding: 22px; } }

/* Error pages and the NSFW gate. Not ".notice": that is a notification row,
   whose last-child rule removed this box's bottom border. */
.msgbox { max-width: 640px; margin: 0 auto; }
.msgbox h1 { font-size: 1.375rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0 0; }

@media (max-width: 480px) {
  .detail__name { font-size: 1.5rem; }
  .brand__name { font-size: 1.375rem; }
}

@media (prefers-reduced-motion: reduce) {
  .evidence, .btn, .flashes, #results[aria-busy="true"] { transition: none; }
  .evidence:hover, .evidence:focus-visible { transform: none; }
  .dialogue:not([data-typing]) .dialogue__next span { animation: none; }
}

/* Accounts: header menu, flashes */

.site-nav { align-items: center; }
.login { background: var(--navy); color: var(--paper-text) !important; border-color: var(--ink) !important; }
.login:hover { background: var(--easy) !important; }
/* Phones: header links fit in two rows under the logo. */
@media (max-width: 480px) {
  .login__long { display: none; }
  .site-nav { gap: 4px; }
  .site-nav a, .navmenu summary { padding: 5px 8px; font-size: 0.9375rem; }
  .usermenu__name { display: none; }   /* avatar and count only, so the links fit two rows */
  /* The avatar is the button by itself (no pill around it, which left a
     cream ring); the queue count sits on its corner. */
  .site-nav .usermenu summary { position: relative; gap: 0; padding: 0; border: 0; background: none; }
  .site-nav .usermenu summary .avatar--sm { width: 36px; height: 36px; }
  .site-nav .usermenu summary .badge { position: absolute; top: -5px; right: -9px; box-shadow: 0 0 0 2px var(--paper); }
}

.usermenu { position: relative; }
/* Resources menu in the header: looks like the other nav links. */
.navmenu { position: relative; }
.navmenu summary {
  display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer;
  padding: 6px 12px; border: 2px solid transparent; border-radius: 4px; font-weight: 700; color: var(--ink);
}
.navmenu summary::-webkit-details-marker { display: none; }
.navmenu summary:hover, .navmenu[open] summary, .navmenu summary.is-current { border-color: var(--ink); background: var(--cream); }
.navmenu__caret { border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 6px solid currentColor; }
.navmenu[open] .navmenu__caret { transform: rotate(180deg); }
.navmenu__list {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; width: 260px;
  display: grid; padding: 6px; background: var(--paper); border: var(--border); border-radius: 3px; box-shadow: var(--shadow);
}
.site-nav .navmenu__list a { display: grid; padding: 8px 10px; border: 0; border-radius: 4px; }
.site-nav .navmenu__list a:hover { background: var(--cream); }
.navmenu__list span { font-weight: 400; font-size: 0.875rem; color: var(--ink-soft); }
/* Phones: header menus open as a panel across the screen, just under their
   button (vcl.js sets --menu-top), so they never run off either edge. */
@media (max-width: 480px) { .navmenu__list { position: fixed; left: 12px; right: 12px; width: auto; top: var(--menu-top, 120px); } }
.usermenu summary {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--paper); cursor: pointer; list-style: none; font-weight: 700;
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu__name { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 210px;
  display: grid; padding: 6px; background: var(--paper); border: var(--border); border-radius: 3px; box-shadow: var(--shadow);
}
.usermenu__list a, .usermenu__list button {
  display: block; text-align: left; padding: 8px 10px; border-radius: 4px; border: 0; background: none;
  font: inherit; font-weight: 700; color: var(--ink); text-decoration: none; cursor: pointer; width: 100%;
}
.usermenu__list a:hover, .usermenu__list button:hover { background: var(--cream); }
.usermenu__queue { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; }

/* Notifications bell, left of the account menu (see app/notify.py). */
.bell { position: relative; }
.bell summary {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; list-style: none; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--paper); color: var(--ink);
}
.bell summary::-webkit-details-marker { display: none; }
.bell summary:hover, .bell[open] summary { background: var(--cream); }
.bell__icon { width: 21px; height: 21px; display: block; }
.bell__count { position: absolute; top: -6px; right: -9px; box-shadow: 0 0 0 2px var(--paper); }
.bell__panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 360px; max-width: calc(100vw - 24px);
  background: var(--paper); border: var(--border); border-radius: 3px; box-shadow: var(--shadow);
}
.bell__head { margin: 0; padding: 10px 14px 8px; font: 700 1rem/1.2 var(--font-display); border-bottom: 2px solid var(--ink); }
.bell__panel .bell__list { max-height: min(420px, 60vh); overflow-y: auto; }
.bell__list { list-style: none; margin: 0; padding: 0; }
.bell__empty { margin: 0; padding: 12px 14px; color: var(--ink-soft); font-size: 0.9375rem; }
.site-nav .bell__all { display: block; padding: 9px 14px; border: 0; border-top: 2px solid var(--ink); border-radius: 0; text-align: center; font-weight: 700; }
.site-nav .bell__all:hover { background: var(--cream); }
.notice { padding: 10px 14px; border-bottom: 1px dashed var(--manila-dark); }
.notice:last-child { border-bottom: 0; }
.notice.is-unread { background: var(--cream-light); box-shadow: inset 4px 0 0 var(--hard); }
.notice__text { margin: 0; font-size: 0.9375rem; line-height: 1.4; }
.site-nav .notice__text a { display: inline; padding: 0; border: 0; font-weight: 700; text-decoration: underline; }
.site-nav .notice__text a:hover { background: none; color: var(--easy); }
.notice__detail { margin: 3px 0 0; font-size: 0.875rem; color: var(--ink-soft); }
.notice__time { margin: 3px 0 0; font-size: 0.8125rem; color: var(--ink-light); }
.notices { max-width: 760px; margin-bottom: 18px; background: var(--paper); border: var(--border); }
.notices .notice { padding: 12px 16px; }
.notices .notice__text { font-size: 1rem; }
@media (max-width: 480px) {
  .bell summary { width: 36px; height: 36px; }
  .bell__icon { width: 19px; height: 19px; }
  /* On phones the panel spans the screen just under the bell (top set by vcl.js). */
  .bell__panel { position: fixed; left: 12px; right: 12px; top: var(--bell-top, 120px); width: auto; max-width: none; }
}

/* The bell and the account menu as one pill with a divider. The pill is the
   anchor for both drop-downs, so they line up with its right edge. */
.userbar {
  position: relative; display: inline-flex; align-items: stretch;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--paper);
}
.userbar > .bell, .userbar > .usermenu { position: static; display: flex; }
.userbar .bell summary { width: 42px; height: auto; min-height: 36px; border: 0; border-radius: 999px 0 0 999px; background: none; }
.userbar .usermenu summary { border: 0; border-radius: 999px; background: none; padding: 2px 10px 2px 3px; }
.userbar .bell + .usermenu summary { border-left: 2px solid var(--ink); border-radius: 0 999px 999px 0; padding-left: 6px; }
.userbar .bell summary:hover, .userbar .bell[open] summary,
.userbar .usermenu summary:hover, .userbar .usermenu[open] summary { background: var(--cream); }
.userbar .bell__count { top: -8px; right: 2px; }
@media (max-width: 480px) {
  .userbar .bell summary { width: 36px; min-height: 34px; }
  .site-nav .userbar .usermenu summary { padding: 2px 3px 2px 4px; }
  .site-nav .userbar .bell + .usermenu summary { border-left: 2px solid var(--ink); border-radius: 0 999px 999px 0; }
  .site-nav .userbar .usermenu summary .avatar--sm { width: 30px; height: 30px; }
  .site-nav .userbar .usermenu summary .badge { top: -8px; right: -10px; }
}

/* Round avatars. The ink ring is drawn as background showing through the
   padding, not as a border: with a border, phones' fractional pixel scaling
   smooths the border's inner edge and the picture's edge separately, and the
   page showed through between them as a faint light ring. Inside the ring the
   background is cream, so transparent avatars still sit on cream. */
.avatar, .ucard__avatar {
  --ring: 2px;
  box-sizing: border-box; border: 0; border-radius: 50%; padding: var(--ring);
  background: radial-gradient(closest-side, var(--cream) calc(100% - var(--ring) - 1px), var(--ink) calc(100% - var(--ring) - 0.5px));
}
.avatar { flex: 0 0 auto; }
.ucard__avatar, .avatar--lg { --ring: 3px; }
.avatar--sm { width: 28px; height: 28px; }
.avatar--lg { width: 72px; height: 72px; }

.badge {
  display: inline-block; min-width: 1.5em; padding: 1px 6px; border-radius: 999px;
  background: var(--hard); color: var(--paper-text); font: 700 0.75rem/1.4 var(--font-ui); text-align: center;
}

/* Notices sit at the bottom of the screen, so they are seen wherever the page
   is scrolled. They fade after a few seconds (script) or eight (no script). */
.flashes {
  position: fixed; z-index: 60; left: 50%; bottom: 16px; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px);
  display: grid; gap: 8px; cursor: pointer;
  transition: opacity 0.3s ease, visibility 0.3s;
  animation: flash-out 0.3s ease 8s forwards;
}
.flashes.is-hidden { opacity: 0; visibility: hidden; }
@keyframes flash-out { to { opacity: 0; visibility: hidden; } }
.flash {
  margin: 0; padding: 10px 16px; background: var(--navy); color: var(--paper-text);
  border: var(--border); border-radius: 3px; box-shadow: var(--shadow); font-weight: 700;
}

#results[aria-busy="true"] { opacity: 0.55; transition: opacity 0.15s; }

.hint { color: var(--ink-light); font-size: 0.8125rem; }
.note { color: var(--ink-soft); }
.small { font-size: 0.8125rem; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: 20px; }

.btn--gold { background: var(--medium-bg); color: var(--ink); }
.btn--danger { background: var(--red-deep); color: var(--paper-text); }
.btn--sm { padding: 4px 10px; font-size: 0.8125rem; box-shadow: none; border-width: 2px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }

/* Case page: rating and reviews */

.community { display: grid; gap: 24px; margin-top: 28px; }
@media (min-width: 900px) { .community { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: start; } }

.community__side { display: grid; gap: 24px; align-content: start; min-width: 0; }
/* Case activity: this case's own feed. */
.caseact__list { list-style: none; margin: 0; padding: 4px 0; max-height: 420px; overflow-y: auto; }
.caseact__item { padding: 8px 14px; border-bottom: 1px dashed var(--manila-dark); }
.caseact__item:last-child { border-bottom: 0; }
.caseact__text { margin: 0; font-size: 0.875rem; line-height: 1.45; overflow-wrap: anywhere; }
.caseact__item--update .caseact__text, .caseact__item--added .caseact__text { color: var(--ink-soft); }
.caseact__quiet { color: var(--ink-light); }
.caseact__empty { margin: 0; padding: 12px 14px; color: var(--ink-soft); }
.rating { display: grid; gap: 18px; }
.rating__score { margin: 0; display: flex; align-items: baseline; gap: 6px; }
.rating__num { font: 700 3rem/1 var(--font-display); color: var(--navy); }
.rating__of { font-weight: 700; color: var(--ink-light); }
.rating__votes { margin: 2px 0 0; color: var(--ink-soft); font-weight: 700; }
.rating__none { margin: 0; color: var(--ink-soft); }
.rating__mine { display: grid; gap: 12px; padding-top: 14px; border-top: 2px dashed var(--manila-dark); }
.rating__mine > p { margin: 0; }

.dist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 3px; max-width: 320px; }
.dist li { display: grid; grid-template-columns: 1.6em 1fr 2.2em; gap: 6px; align-items: center; font-size: 0.75rem; }
.dist__label { text-align: right; color: var(--ink-light); font-weight: 700; }
.dist__bar { height: 9px; background: var(--cream); border: 1px solid var(--manila-dark); border-radius: 2px; overflow: hidden; }
.dist__fill { display: block; height: 100%; background: var(--navy); }
.dist__n { color: var(--ink-light); }
.dist--wide { max-width: 480px; margin-bottom: 18px; }
.w0 { width: 0; } .w10 { width: 10%; } .w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; }
.w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; } .w100 { width: 100%; }

.scorepick { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; max-width: 440px; }
.scorepick legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.scorepick label { position: relative; min-width: 0; }
.scorepick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.scorepick span {
  display: grid; place-items: center; width: 100%; height: 38px;
  border: 2px solid var(--ink); border-radius: 3px; background: var(--paper);
  font: 700 1rem/1 var(--font-ui); cursor: pointer;
}
.scorepick label:hover span { background: var(--cream); }
.scorepick input:checked + span { background: var(--navy); color: var(--paper-text); }
.scorepick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.status { margin: 0 0 14px; padding: 10px 12px; border-radius: 0; border: 2px solid; font-weight: 700; }
.status--pending { background: var(--medium-bg); border-color: var(--medium); }
.status--rejected { background: var(--hard-bg); border-color: var(--hard); }

.reviewform { display: grid; gap: 6px; margin-bottom: 8px; }
textarea, input[type="text"], input[type="url"], input[type="date"], input[type="file"] {
  font: inherit; width: 100%; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 2px;
  background: #fff; color: var(--ink);
}
input[type="file"] { padding: 6px; background: var(--paper); }
textarea { resize: vertical; line-height: 1.5; }

.review { border-top: 2px dashed var(--manila-dark); padding: 16px 0 6px; }
.review:first-of-type { margin-top: 18px; }
.review__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.review__name { font-weight: 700; color: var(--ink); }
.review__score { display: inline-block; white-space: nowrap; font-weight: 700; color: var(--paper-text); background: var(--navy); padding: 1px 8px; border-radius: 999px; font-size: 0.8125rem; line-height: 1.5; }
.review__date { color: var(--ink-light); font-size: 0.8125rem; }
.review__body { margin-top: 8px; overflow-wrap: anywhere; }
.review__body p { margin: 0 0 0.8em; }
.review__report summary { cursor: pointer; color: var(--ink-light); font-size: 0.8125rem; }
.review__report form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.review__report input[type="text"] { flex: 1 1 200px; width: auto; }
.review__case { margin: 0 0 6px; font-weight: 700; }
.profile .review { border-top: var(--border); padding: 0; margin: 0 0 14px; }
.profile .pactivity { margin-bottom: 28px; }
.profile .caselog { margin-bottom: 22px; }

/* Profile case log: played count with a progress bar, then the three lists. */
.caselog__headline { margin: 0 0 6px; font-size: 1.125rem; }
.caselog__headline strong { font: 700 1.75rem/1 var(--font-display); color: var(--navy); }
.caselog__headline .caselog__watched-n { font: 700 1.125rem/1 var(--font-display); }
/* Played is solid green, watched is striped green after it (an SVG inside). */
.caselog__bar {
  display: block; width: 100%; height: 18px; margin: 0 0 10px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--cream); overflow: hidden;
}
.caselog__bar svg { display: block; }
.caselog__played { fill: var(--green); }
.caselog__seam { fill: var(--ink); }
.caselog__key { display: flex; align-items: center; gap: 6px; margin: -4px 0 10px; font-size: 0.875rem; color: var(--ink-soft); }
.caselog__swatch { display: inline-block; width: 16px; height: 11px; border: 1.5px solid var(--ink); }
.caselog__swatch + .caselog__swatch, .caselog__key .caselog__swatch--watched { margin-left: 12px; }
.caselog__swatch--played { background: var(--green); }
.caselog__swatch--watched { background: repeating-linear-gradient(-45deg, var(--green) 0 3px, #a9c79a 3px 6px); }
.caselog__counts { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-soft); }
.caselog__count strong { color: var(--ink); }
.caselog__group { border-top: 1px dashed var(--manila-dark); }
.caselog__group summary { cursor: pointer; padding: 8px 0; font-weight: 700; }
.caselog__grid { margin: 0 0 10px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

/* Profile recent activity: small case logo, what they did, when. */
.pactivity__list { list-style: none; margin: 0; padding: 4px 14px 8px; }
.pactivity__item {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px dashed var(--manila-dark);
}
.pactivity__item:last-child { border-bottom: 0; }
.pactivity__logo { display: grid; place-items: center; aspect-ratio: 16 / 9; padding: 2px; border: 2px solid var(--ink); border-radius: 0; background: var(--easy-bg); }
.pactivity__logo { position: relative; overflow: hidden; }
.pactivity__logo img { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); object-fit: contain; }
.pactivity__item .activity__time { white-space: nowrap; }

/* Case page: the person's own case log choice. */
.detail__log { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -6px 18px 20px; }
@media (min-width: 760px) { .detail__log { margin: -6px 22px 22px; } }
.detail__log-label { font-weight: 700; color: var(--ink-soft); font-size: 0.9375rem; }
.logselect {
  font: 700 0.9375rem/1.2 var(--font-ui); color: var(--ink); padding: 7px 34px 7px 12px;
  border: 2px solid var(--ink); border-left-width: 6px; border-radius: 2px; background-color: var(--paper);
}
.logselect--none { border-left-color: var(--ink-light); }
.logselect--played { border-left-color: var(--green); }
.logselect--want { border-left-color: var(--gold); }
.logselect--watched { border-left-color: var(--easy); }
/* Profile reviews: case logo on the left, the review beside it. */
.review__split { display: grid; grid-template-columns: clamp(96px, 24%, 220px) minmax(0, 1fr); gap: 16px; align-items: start; }
.review__main { min-width: 0; }
.review__date { white-space: nowrap; }
.review__main > .review__case { margin-top: 0; }
.review__logo {
  display: grid; place-items: center; aspect-ratio: 16 / 9; padding: 3px;
  border: 2px solid var(--ink); border-radius: 0; background: var(--easy-bg);
  overflow: hidden; text-decoration: none;
  transition: transform 140ms ease;
}
.review__logo--medium { background: var(--medium-bg); }
.review__logo--hard { background: var(--hard-bg); }
.review__logo { position: relative; overflow: hidden; }
.review__logo img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; }
.review__logo:hover { transform: translateY(-2px); }
.review__logo-text { font: 700 0.75rem/1.2 var(--font-display); text-align: center; color: var(--ink); }
@media (max-width: 480px) { .review__split { gap: 12px; } }

/* Leaderboard */

.toolbar--tabs { display: grid; gap: 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a {
  padding: 5px 14px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 700;
  color: var(--ink); text-decoration: none; background: var(--paper);
}
.tabs a[aria-current="page"] { background: var(--navy); color: var(--paper-text); }
.tabs .tab--easy[aria-current="page"] { background: var(--easy); }
.tabs .tab--medium[aria-current="page"] { background: var(--medium-strip); }
.tabs .tab--hard[aria-current="page"] { background: var(--hard); }

.top-layout { display: grid; gap: 24px; }

/* Leaderboard picker: folder tabs over the board. */
.boardtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; padding: 0 4px; border-bottom: 3px solid var(--ink); }
.boardtabs a {
  margin-bottom: -3px; padding: 8px 18px 7px; border: 3px solid var(--ink); border-radius: 3px 3px 0 0;
  background: var(--manila); color: var(--ink); text-decoration: none; font: 700 1.0625rem/1.2 var(--font-display);
}
.boardtabs a:hover { background: var(--paper); }
.boardtabs a[aria-current="page"] { background: var(--navy); color: var(--paper-text); }
.tabs--period { margin-bottom: 8px; }
@media (max-width: 600px) {
  /* Four tabs do not fit one row on phones: a 2 by 2 grid of buttons instead. */
  .boardtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0; border-bottom: 0; }
  .boardtabs a { margin-bottom: 0; border-radius: 3px; text-align: center; padding: 8px 10px; font-size: 1rem; }
}
@media (min-width: 900px) { .top-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; } }

.ranking { list-style: none; margin: 0; padding: 0; }
.ranking__row {
  display: grid; grid-template-columns: 2.2em auto minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 14px; border-bottom: 1px dashed var(--manila-dark);
}
.ranking__row:last-child { border-bottom: 0; }
.ranking__pos { font: 700 1.375rem/1 var(--font-display); color: var(--ink-light); text-align: right; }
.ranking__row:nth-child(-n+3) .ranking__pos { color: var(--gold); }
.ranking__logo { width: 96px; aspect-ratio: 16 / 9; object-fit: contain; background: var(--paper); border: 2px solid var(--gold); border-radius: 0; }
.ranking__main { display: grid; min-width: 0; }
.ranking__title { font: 700 1.0625rem/1.25 var(--font-display); color: var(--ink); }
.ranking__by { font-size: 0.8125rem; color: var(--ink-light); }
.ranking__labels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.diff-pill--sm { padding: 0 8px; font-size: 0.75rem; font-weight: 700; line-height: 1.5; border-width: 1px; }
.ranking__score { display: grid; justify-items: end; }
.ranking__score strong { font: 700 1.5rem/1 var(--font-display); color: var(--navy); }
.ranking__score span { font-size: 0.75rem; color: var(--ink-light); }
@media (max-width: 520px) {
  .ranking__row { grid-template-columns: 1.8em minmax(0, 1fr) auto; }
  .ranking__logo { display: none; }
  /* Most reviews keeps its avatar, so it needs the avatar column back. */
  .ranking--people .ranking__row { grid-template-columns: 1.8em auto minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .ranking__avatar { width: 36px; height: 36px; }
}
/* Top rated: how scores work */
.scorehow { margin: 8px 0 0; padding: 8px 12px; background: var(--paper); border: 2px dashed var(--manila-dark); }
.scorehow summary { cursor: pointer; font-weight: 700; }
.scorehow p { margin: 8px 0 0; }
.scorehow__formula { font: 700 0.9375rem/1.4 var(--font-ui); color: var(--navy); }
.loved { margin: 0; padding-left: 1.4em; }
.loved li + li { margin-top: 4px; }

.diff-text { font-weight: 700; }
.diff-text--easy { color: var(--easy); }
.diff-text--medium { color: var(--medium-strip); }
.diff-text--hard { color: var(--hard); }

/* Profiles */

.profile { display: grid; gap: 8px; }
.profile__head { margin-bottom: 18px; }
.profile__id { display: flex; align-items: center; gap: 16px; }
.profile__name { margin: 0; font: 700 1.75rem/1.2 var(--font-display); }
.chiplist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chiplist a { display: inline-block; padding: 4px 12px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); font-weight: 700; color: var(--ink); text-decoration: none; }

.danger { padding-top: 16px; border-top: 2px dashed var(--manila-dark); }
.danger p { margin-top: 0; }

/* Editor tools */

.subnav {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; padding: 8px;
  background: var(--paper); border: var(--border); border-radius: 0;
}
.subnav a { padding: 6px 12px; border-radius: 4px; font-weight: 700; color: var(--ink); text-decoration: none; }
.subnav a:hover { background: var(--cream); }
.subnav a[aria-current="page"] { background: var(--navy); color: var(--paper-text); }

.rowbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-form input[type="search"], .inline-form input[type="text"] { width: auto; flex: 1 1 200px; }
.filters-row { margin-bottom: 16px; }
.filters-row label:not(.toggle) { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.875rem; }

/* Panels stacked directly in the page (editor pages) get space between them. */
.page > .panel + .panel { margin-top: 24px; }

.data { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data th { text-align: left; padding: 8px; border-bottom: 3px solid var(--ink); font-size: 0.8125rem; }
.flagtag { display: inline-block; margin: 0 4px 2px 0; padding: 1px 6px; border-radius: 3px; background: var(--hard-bg); color: var(--red-deep); font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.sortlink { color: var(--ink); text-decoration: none; white-space: nowrap; }
.sortlink:hover { text-decoration: underline; }
.sortlink.is-active { color: var(--navy); }
.sortlink__arrow { display: inline-block; margin-left: 5px; vertical-align: 2px; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.sortlink__arrow--down { border-top: 6px solid currentColor; }
.sortlink__arrow--up { border-bottom: 6px solid currentColor; }
.data td { padding: 8px; border-bottom: 1px dashed var(--manila-dark); vertical-align: top; }
.data tr.is-muted td { opacity: 0.55; }
.panel__body { overflow-x: auto; }

.form-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .form-grid { grid-template-columns: 1fr 1fr; } .field--wide { grid-column: 1 / -1; } }
.form-grid .toggle { align-self: center; }
.form-logo { width: 240px; aspect-ratio: 16 / 9; object-fit: contain; background: var(--paper); border: 2px solid var(--gold); margin-bottom: 6px; }
fieldset.field { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field > legend { padding: 0; margin-bottom: 4px; }

.errors { background: var(--hard-bg); border: 2px solid var(--hard); border-radius: 0; padding: 10px 14px; margin-bottom: 16px; }
.errors p, .errors ul { margin: 0; }
.errors ul { padding-left: 1.2em; }

.rev { padding: 14px 0; border-top: 2px dashed var(--manila-dark); }
.rev__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.rev__summary { margin: 6px 0; font-style: italic; }
.diff { margin: 8px 0 10px; }
.diff td { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 32em; }
.diff__old { background: #fbe3e3; }
.diff__new { background: #e3f0dc; }

.queue-item { padding: 16px 0; border-top: 2px dashed var(--manila-dark); }
.queue-item:first-of-type { border-top: 0; }
.queue-item__head { display: flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 700; }
.queue-item__body { margin: 8px 0 12px; padding: 12px 14px; background: #fff; border: 2px solid var(--ink); border-radius: 0; max-width: 75ch; overflow-wrap: anywhere; }
.queue-item__body p { margin: 0 0 0.8em; }
.queue-item__body p:last-child { margin-bottom: 0; }
.queue-item__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.status-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; border: 2px solid var(--ink); }
.status-pill--approved { background: var(--green); color: var(--paper-text); }
.status-pill--pending { background: var(--medium-bg); }
.status-pill--rejected, .status-pill--removed { background: var(--hard-bg); }


/* Motion. Everything here is skipped for visitors who ask for reduced
   motion: boot.js does not add the classes, and the rules below are off. */

/* Home page, once per visit: the presenter steps in, then the dialogue box
   rises, then the Docket slides in. Text typing starts after (vcl.js). */
.intro .scene__sprite { animation: step-in 520ms cubic-bezier(.2, .8, .2, 1) 120ms both; }
.intro .dialogue { animation: rise 420ms cubic-bezier(.2, .8, .2, 1) 380ms both; }
.intro .scene__actions { animation: fade-in 300ms ease 640ms both; }
.intro .docket { animation: slide-in 460ms cubic-bezier(.2, .8, .2, 1) 260ms both; }
@keyframes step-in { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* New badge: pressed on like a rubber stamp when its card first scrolls into view. */
.tag--new.pre-stamp { opacity: 0; }
.tag--new.stamp-in { animation: stamp 420ms cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes stamp {
  0% { opacity: 0; transform: scale(2.4) rotate(-14deg); }
  55% { opacity: 1; transform: scale(0.9) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* Case page, when opened from a case card: the case file is pulled out of
   its folder. The closed folder front (tab and label) gives a small tug,
   then drops away downward while the document rises into place. Nothing
   hinges sideways, so it does not read as a book cover. */
.folder-opening main { overflow: clip; }   /* the falling folder never adds scroll */
.folder-opening .detail { overflow: visible; animation: folder-arrive 700ms cubic-bezier(.2, .8, .2, 1) 120ms both; }
.folder-opening .detail__name { border-radius: 3px 3px 0 0; }
.folder-opening .detail::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: 0;
  background: rgba(42, 31, 10, 0.28);
  animation: folder-shade 700ms ease-out 260ms both;
}
.folder-opening .folder-cover {
  position: absolute;
  inset: -3px;
  z-index: 5;
  display: grid;
  place-items: start center;
  /* Label near the top, so it is on screen even when the case page is long. */
  padding-top: clamp(56px, 18vh, 200px);
  pointer-events: none;
  border: var(--border);
  border-radius: 0;
  background: linear-gradient(to bottom, #efdaa4, var(--manila) 55%, var(--manila-dark));
  /* The shadow above the folder's top edge is what sells the document
     sliding out from inside it. */
  box-shadow: 0 -10px 18px -6px rgba(42, 31, 10, 0.45), 6px 6px 0 rgba(42, 31, 10, 0.25);
  animation: folder-drop 820ms both;
}
.folder-cover__tab {
  position: absolute;
  top: -3px;
  left: 28px;
  padding: 3px 16px 4px;
  border: var(--border);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: var(--easy-strip);
  color: var(--paper-text);
  font: 700 0.875rem/1.4 var(--font-ui);
}
.detail--medium .folder-cover__tab { background: var(--medium-strip); }
.detail--hard .folder-cover__tab { background: var(--hard-strip); }
.folder-cover__label {
  display: grid;
  gap: 4px;
  max-width: min(80%, 34rem);
  padding: 16px 26px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 3px;
  box-shadow: 2px 2px 0 rgba(42, 31, 10, 0.3);
  text-align: center;
  transform: rotate(-1.2deg);
}
.folder-cover__title { font: 700 1.75rem/1.15 var(--font-display); color: var(--ink); }
.folder-cover__by { color: var(--ink-soft); font-weight: 700; }

@keyframes folder-arrive { from { transform: translateY(28px); } to { transform: none; } }
@keyframes folder-drop {
  0% { transform: none; animation-timing-function: cubic-bezier(.3, 0, .4, 1); }
  14% { transform: translateY(-8px); animation-timing-function: cubic-bezier(.55, 0, .8, .4); }
  70% { opacity: 1; }
  100% { transform: translateY(min(75vh, 640px)) rotate(1.5deg); opacity: 0; }
}
@keyframes folder-shade { from { opacity: 1; } to { opacity: 0; } }

@media (max-width: 480px) {
  .folder-cover__title { font-size: 1.375rem; }
  .folder-cover__label { padding: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .intro .scene__sprite, .intro .dialogue, .intro .scene__actions, .intro .docket,
  .tag--new.stamp-in, .folder-opening .detail { animation: none; }
  .tag--new.pre-stamp { opacity: 1; }
  .folder-opening .folder-cover, .folder-opening .detail::after { display: none; }
  .evidence.is-pressed { transform: none; }
  .searchbar { transition: none; }
}

/* Footer */

.site-foot { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter) 32px; color: var(--ink-soft); font-size: 0.8125rem; }
.site-foot p { margin: 0 0 4px; }
.site-foot__legal { margin-top: 10px !important; padding-top: 10px; border-top: 1px dashed var(--manila-dark); }
.site-foot__legal a { color: inherit; }
/* Full width (footer button; class "wide" on <html>, set by boot.js).
   Only on screens wider than 1300px, where it makes a difference. The header,
   banner and footer always widen; listing pages widen their content; reading
   pages (case pages, FAQ, privacy) stay at the standard width. */
.wide-toggle__wrap { display: none; }
.wide-toggle {
  display: inline; padding: 0; border: 0; background: none;
  font: inherit; color: inherit; text-decoration: underline; cursor: pointer;
}
.wide-toggle__icon { width: 14px; height: 14px; margin-right: 4px; vertical-align: -3px; }
.wide-toggle__off, .wide .wide-toggle__on { display: none; }
.wide .wide-toggle__off { display: inline; }
@media (min-width: 1300px) {
  .js .wide-toggle__wrap { display: inline; }
  .wide .site-head__inner, .wide .eventbar__inner, .wide .site-foot { max-width: none; }
  .wide .credits { max-width: none; }
  .wide[data-page="home"] .page, .wide[data-page="profile"] .page, .wide[data-page="users"] .page,
  .wide[data-page="leaderboards"] .page, .wide[data-page="tierlist"] .page, .wide[data-page="tierlist-edit"] .page { max-width: none; }
  /* Folders and user cards keep their size; more fit on a row. */
  .wide .evidence-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .wide .ugrid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  /* The presenter stays about its usual size; Docket and activity take the room. */
  .wide .top { grid-template-columns: minmax(0, 480px) minmax(0, 1fr) minmax(0, 1fr); }
}

/* Privacy policy page */
.policy { max-width: 860px; }
.policy__updated { margin: 0 0 16px; color: var(--ink-soft); }
.policy__group { margin-bottom: 20px; }
.policy__group .panel__body { padding: 6px 18px 4px; }
.policy__group p, .policy__group li { line-height: 1.55; }
.policy__group ul { padding-left: 1.3em; }
.policy__group li + li { margin-top: 4px; }

.online {
  margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font-size: 0.875rem;
}
.online__title { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 1rem; }
.online__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(63, 115, 48, 0.2); }
.online__list { margin: 0; line-height: 1.7; }
.online__list a { font-weight: 700; color: var(--ink); }

/* Share button: same shape as a plain button, a little smaller. Only shown
   with scripts on, since it needs them to work. */
.sharebtn {
  display: none; align-items: center; gap: 6px; padding: 6px 12px;
  font: 700 0.875rem/1.2 var(--font-ui); color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: 3px; box-shadow: var(--shadow-sm); cursor: pointer;
}
.js .sharebtn { display: inline-flex; }
.sharebtn:hover { background: var(--cream); }
.sharebtn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.sharebtn__icon { width: 1.05em; height: 1.05em; color: var(--navy); }
.detail__actions .sharebtn { font-size: 1.0625rem; padding: 10px 18px; border-width: 3px; }
.profile__id { position: relative; }
/* Public profile color schemes (presets in social.PROFILE_THEMES; keep the
   two lists the same). The theme recolors the profile's bars and accents. */
.profile--classic, .themepick__opt--classic { --theme: #0a2563; }
.profile--crimson, .themepick__opt--crimson { --theme: #7d1a1f; }
.profile--forest, .themepick__opt--forest { --theme: #2f5d27; }
.profile--gold, .themepick__opt--gold { --theme: #8f6408; }
.profile--plum, .themepick__opt--plum { --theme: #5b2a6e; }
.profile--teal, .themepick__opt--teal { --theme: #0f5e63; }
.profile--slate, .themepick__opt--slate { --theme: #3a4250; }
.profile--rose, .themepick__opt--rose { --theme: #9c2f5e; }
.profile--midnight, .themepick__opt--midnight { --theme: #16161f; }
.profile[class*="profile--"] { --navy: var(--theme); }
.profile[class*="profile--"] .profile__head { border-top: 6px solid var(--theme); }
.profile[class*="profile--"] .profile__name { color: var(--theme); }
.profile--midnight .profile__name, .profile--slate .profile__name { color: var(--ink); }
.themepick__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; padding: 0; border: 0; }
.themepick__opt { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 2px solid var(--manila-dark); border-radius: 4px; cursor: pointer; background: var(--paper); }
.themepick__opt:has(input:checked) { border-color: var(--ink); background: var(--cream); font-weight: 700; }
.themepick__opt input { margin: 0; }
.themepick__swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); background: var(--theme); flex: none; }

/* Public profile page backgrounds (presets in social.PROFILE_BACKGROUNDS;
   keep the two lists the same). Light only: headings sit on it in ink. */
html[data-profile-bg="manila"], .bgpick--manila { --bg-a: #f5e7c4; --bg-b: #f0e0b6; }
html[data-profile-bg="sky"], .bgpick--sky { --bg-a: #dce8f5; --bg-b: #d0dff0; }
html[data-profile-bg="mint"], .bgpick--mint { --bg-a: #dcefdc; --bg-b: #cfe6cf; }
html[data-profile-bg="seafoam"], .bgpick--seafoam { --bg-a: #d8eeec; --bg-b: #cbe5e2; }
html[data-profile-bg="lavender"], .bgpick--lavender { --bg-a: #e7def2; --bg-b: #ddd1ec; }
html[data-profile-bg="blush"], .bgpick--blush { --bg-a: #f6dede; --bg-b: #efd0d0; }
html[data-profile-bg="peach"], .bgpick--peach { --bg-a: #f9e2cc; --bg-b: #f3d5b8; }
html[data-profile-bg="stone"], .bgpick--stone { --bg-a: #e6e3dd; --bg-b: #dbd7cf; }
html[data-profile-bg="paper"], .bgpick--paper { --bg-a: #fffaeb; --bg-b: #fffaeb; }
html[data-profile-bg] body { background-color: var(--bg-a); background-image: repeating-linear-gradient(135deg, var(--bg-a) 0 16px, var(--bg-b) 16px 32px); }
.themepick__head { margin: 14px 0 0; font: 700 1rem/1.3 var(--font-ui); }
.themepick__swatch--bg { border-radius: 4px; background: repeating-linear-gradient(135deg, var(--bg-a) 0 5px, var(--bg-b) 5px 10px); }

/* Profile actions under the name: Follow, Share, follower count. */
.profile__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.profile__actions .profile__follow { margin: 0; }
.profile__followers { font-size: 0.875rem; color: var(--ink-soft); }
.profile__followers strong { color: var(--ink); }
/* Share matches the small Follow button next to it. */
.profile__actions .sharebtn { padding: 4px 10px; font-size: 0.8125rem; line-height: 1.2; border-width: 2px; box-shadow: none; }
/* Avatar and name stay side by side; the signature takes its own row when narrow. */
.profile__id > div { flex: 1 1 320px; min-width: 0; }  /* the name block keeps room; the signature wraps below when both do not fit */

/* Tier lists (read-only): colored label, then a row of case logos. */
.tiers { border: var(--border); background: var(--paper); }
.tiers__row { display: grid; grid-template-columns: 120px minmax(0, 1fr); border-bottom: 2px solid var(--ink); }
.tiers__row:last-child { border-bottom: 0; }
.tiers__label {
  display: grid; place-items: center; padding: 8px; border-right: 2px solid var(--ink);
  font: 700 1.25rem/1.15 var(--font-display); color: var(--ink); text-align: center; overflow-wrap: anywhere;
}
.tiers__label--red { background: #ff7f7f; }
.tiers__label--orange { background: #ffbf7f; }
.tiers__label--yellow { background: #ffdf7f; }
.tiers__label--lime { background: #ffff7f; }
.tiers__label--green { background: #bfff7f; }
.tiers__label--mint { background: #7fff7f; }
.tiers__label--cyan { background: #7fffff; }
.tiers__label--blue { background: #7fbfff; }
.tiers__label--purple { background: #bf7fff; }
.tiers__label--pink { background: #ff7fdf; }
.tiers__label--gray { background: #cfcfcf; }
.tiers__cases { list-style: none; margin: 0; padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; min-height: 84px; align-content: flex-start; }
.tiers__case { display: grid; place-items: center; width: 128px; aspect-ratio: 16 / 9; padding: 2px; border: 2px solid var(--ink); text-decoration: none; }
.tiers__case { position: relative; overflow: hidden; }
.tiers__case img { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); object-fit: contain; }
.tiers__case span { font: 700 0.75rem/1.2 var(--font-display); color: var(--ink); text-align: center; }
@media (max-width: 600px) {
  .tiers__row { grid-template-columns: 72px minmax(0, 1fr); }
  .tiers__label { font-size: 1rem; }
  .tiers__case { width: 88px; }
}
.tiers__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 10px 0 0; }
.tiers__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 6px; }
.staff-remove { margin-top: 18px; }
/* Tier list activity icon: three tiny tier rows (color label, then the row). */
.pactivity__logo--tiers { grid-template-rows: repeat(3, 1fr); place-items: stretch; gap: 2px; padding: 3px; background: var(--paper); }
.pactivity__logo--tiers span { --c: #ff7f7f; background: linear-gradient(to right, var(--c) 0 30%, var(--ink) 30% calc(30% + 1px), #f3e6c4 calc(30% + 1px)); border: 1px solid var(--ink); }
.pactivity__logo--tiers span:nth-child(2) { --c: #ffdf7f; }
.pactivity__logo--tiers span:nth-child(3) { --c: #bfff7f; }

/* Tier list editor */
.tiered__help { margin: 0 0 10px; }
.tiered__status { font-weight: 700; color: var(--green); }
.tiered__status.is-bad { color: var(--hard-strip); }
.tiered__rows { border: var(--border); background: var(--paper); }
.tiered__row { display: grid; grid-template-columns: 200px minmax(0, 1fr); border-bottom: 2px solid var(--ink); }
.tiered__row:last-child { border-bottom: 0; }
.tiered__label { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; gap: 6px; padding: 8px; border-right: 2px solid var(--ink); }
.tiered__label .tiered__name { grid-column: 1 / -1; }
input.tiered__name {
  width: 100%; padding: 4px 6px; border: 2px solid transparent; border-radius: 2px; background: transparent;
  font: 700 1.25rem/1.2 var(--font-display); color: var(--ink); text-align: center;
}
input.tiered__name:hover, input.tiered__name:focus { border-color: var(--ink); background: rgba(255, 255, 255, 0.6); }
select.tiered__color { min-width: 0; font-size: 0.8125rem; padding: 2px 4px; background-color: rgba(255, 255, 255, 0.7); }
.tiered__tools { display: flex; gap: 3px; }
.tiered__tool { width: 24px; height: 24px; padding: 2px; border: 2px solid var(--ink); border-radius: 2px; background: var(--paper); color: var(--ink); cursor: pointer; }
.tiered__tool:hover { background: var(--cream); }
.tiered__tool svg { width: 100%; height: 100%; }
.tiered__cases { list-style: none; margin: 0; padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; min-height: 96px; align-content: flex-start; }
.tiered__cases.is-over { background: rgba(10, 37, 99, 0.08); outline: 3px dashed var(--navy); outline-offset: -6px; }
.has-selection .tiered__cases { outline: 2px dashed rgba(10, 37, 99, 0.35); outline-offset: -5px; cursor: copy; }
.tiered__case {
  display: grid; place-items: center; width: 128px; aspect-ratio: 16 / 9; padding: 2px; border: 2px solid var(--ink);
  cursor: grab; transition: transform 120ms ease, box-shadow 120ms ease;
}
.tiered__case { position: relative; overflow: hidden; }
.tiered__case img { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); object-fit: contain; pointer-events: none; }
.tiered__case span { font: 700 0.75rem/1.2 var(--font-display); color: var(--ink); }
.tiered__case:hover { transform: translateY(-2px); }
.is-selected > .tiered__case { outline: 4px solid var(--navy); outline-offset: 1px; transform: translateY(-2px); }
.is-dragging > .tiered__case { opacity: 0.4; }
.tiered__add { margin: 10px 0 20px; }
.tiered__placebar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; margin: 0 auto; width: fit-content;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px;
  padding: 8px 10px; background: var(--paper); border: var(--border); border-radius: 3px; box-shadow: var(--shadow);
}
.tiered__placebar[hidden] { display: none; }
.tiered__placebar-label { font-weight: 700; color: var(--ink-soft); margin-right: 2px; }
.tiered__placebar button {
  padding: 6px 12px; border: 2px solid var(--ink); border-radius: 2px; cursor: pointer;
  font: 700 0.9375rem/1.2 var(--font-display); color: var(--ink);
}
.tiered__placebar .tiered__placebar-pool, .tiered__placebar .tiered__placebar-cancel { background: var(--paper); font-family: var(--font-ui); }
.tiered__placebar .tiered__placebar-cancel { border-color: transparent; text-decoration: underline; }
.tiered__pool { margin-bottom: 18px; }
.tiered__count { font-size: 0.9375rem; opacity: 0.8; }
.tiered__filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-bottom: 8px; }
.tiered__filters input[type="search"] { flex: 1 1 260px; }
/* The pool sits under the tiers at every width; it scrolls inside itself so
   the tiers stay close above it while dragging. */
.tiered__cases--pool { max-height: min(440px, 45vh); overflow-y: auto; padding: 4px; }
.tiered__delete summary { cursor: pointer; color: var(--ink-soft); }
@media (max-width: 600px) {
  .tiered__row { grid-template-columns: 108px minmax(0, 1fr); }
  input.tiered__name { font-size: 1rem; }
  .tiered__label { grid-template-columns: minmax(0, 1fr); }
  .tiered__tools { justify-content: center; }
  .tiered__case { width: 88px; }
}


/* Forum (app/forum.py, templates/forum/) */

.forum__standing { margin: 0 0 14px; }
.forum__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.forum__head .hint { margin: 0; }
.forum__pager { margin: 10px 0; }
.pager__gap { align-self: center; color: var(--ink-light); }
.forum__mark {
  display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 2px; vertical-align: 2px;
  font: 700 0.6875rem/1.6 var(--font-ui); letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--navy); color: var(--paper-text);
}
.forum__mark--lock { background: var(--ink-soft); }
.forum__mark--removed { background: var(--hard); }

/* Categories and thread lists: one row each, three parts that stack on phones. */
.forum__cats, .forum__threads { list-style: none; margin: 0; padding: 0; }
.forum__cat, .forum__thread {
  display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem minmax(0, 14rem); gap: 14px; align-items: center;
  padding: 12px 0; border-top: 1px dashed var(--manila-dark);
}
.forum__cat:first-child, .forum__thread:first-child { border-top: 0; }
.forum__cat p, .forum__thread p { margin: 0; }
.forum__cat-name { margin: 0; font-size: 1.125rem; }
.forum__cat-desc { color: var(--ink-soft); font-size: 0.9375rem; }
.forum__cat-counts, .forum__thread-counts { font-size: 0.875rem; color: var(--ink-soft); }
.forum__cat-latest, .forum__thread-last { display: flex; flex-direction: column; gap: 2px; font-size: 0.875rem; min-width: 0; }
.forum__cat-latest a { font-weight: 700; overflow-wrap: anywhere; }
.forum__cat-latest .hint, .forum__thread-last .hint, .forum__thread-main .hint { font-size: 0.8125rem; margin: 0; }
.forum__thread-title { font-weight: 700; overflow-wrap: anywhere; }
.forum__thread.is-pinned { background: linear-gradient(90deg, var(--cream-light), transparent); }
.forum__thread.is-removed { opacity: 0.6; }
@media (max-width: 700px) {
  .forum__cat, .forum__thread { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .forum__cat-latest, .forum__thread-last { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 0 8px; }
  .forum__cat-counts, .forum__thread-counts { text-align: right; }
}

/* A thread: each post is a bordered card, the author in a shaded column on
   the left (on top, on phones), the post on the right under a date rule. */
.thread__title { overflow-wrap: anywhere; }
.thread__staff { margin: 0 0 14px; padding: 8px 12px; border: 2px dashed var(--manila-dark); background: var(--cream-light); }
.thread__staff summary { font-weight: 700; cursor: pointer; }
.thread__staff-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.post {
  display: grid; grid-template-columns: 10rem minmax(0, 1fr);
  border: 2px solid var(--ink); border-radius: 3px; background: var(--paper); scroll-margin-top: 80px;
}
.post:target { outline: 3px solid var(--focus); outline-offset: 2px; }
.post__author {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0;
  padding: 14px 10px; background: var(--cream-light); border-right: 2px solid var(--ink); border-radius: 1px 0 0 1px;
}
.post__author p { margin: 0; }
.post__avatar { width: 52px; height: 52px; }
/* Name, title and role badge, spaced apart and wrapping as needed. */
.post__name { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; font-weight: 700; overflow-wrap: anywhere; }
.post__name .role-tag, .post__name .title-tag { margin: 0; }
.post__stats { font-size: 0.75rem; color: var(--ink-light); }
.post__main { min-width: 0; padding: 12px 16px 14px; }
.post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 10px; padding-bottom: 7px;
  border-bottom: 1px dashed var(--manila-dark); font-size: 0.8125rem; color: var(--ink-light); }
.post__time { color: inherit; }
.post__edited { font-style: italic; }
.post__body { overflow-wrap: anywhere; line-height: 1.6; }
.post__gone { margin: 0; font-style: italic; color: var(--ink-soft); }
.post--deleted { border-style: dashed; }
.post--deleted .post__author { opacity: 0.6; }
.post--shadow { opacity: 0.75; }
.post--new { border-color: var(--hard); box-shadow: inset 5px 0 0 var(--hard); }
.post--new .post__author { border-right-color: var(--hard); padding-left: 15px; }
.post__staffview { margin-top: 8px; font-size: 0.875rem; }
.post__sig { margin-top: 12px; }
.post__sig summary { font-size: 0.75rem; color: var(--ink-light); cursor: pointer; }
.post__sig .signature { margin-top: 6px; }
.post__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; padding-top: 8px;
  border-top: 1px dashed var(--manila-dark); font-size: 0.875rem; }
.post__actions a, .post__actions .linkbtn { color: var(--ink-soft); }
/* Nothing to show (a visitor, no likes yet): no empty row and rule. */
.post__actions:not(:has(> :not([hidden]))) { display: none; }
.post__inline { display: inline; margin: 0; }
.post__report summary { color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.post__report form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 8px; }
.post__report label { display: flex; flex-direction: column; gap: 2px; font-size: 0.8125rem; }
@media (max-width: 600px) {
  .post { grid-template-columns: minmax(0, 1fr); }
  .post__author { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; gap: 4px 10px;
    padding: 10px 12px; border-right: 0; border-bottom: 2px solid var(--ink); border-radius: 1px 1px 0 0; }
  .post--new .post__author { border-bottom-color: var(--hard); padding-left: 17px; }
  .post__avatar { width: 38px; height: 38px; }
  .post__name { justify-content: flex-start; }
  .post__main { padding: 10px 12px 12px; }
}
/* The thread's header row: who started it and the counts, Follow at the right. */
.thread__info { margin: 0; font-size: 0.875rem; color: var(--ink-soft); }
.thread__info a { font-weight: 700; color: var(--ink); }
.thread__reply { margin-top: 18px; padding-top: 16px; border-top: 3px solid var(--ink); }

/* Formatted post text (forum_markup.py). */
.post__body > :first-child { margin-top: 0; }
.fp-h { margin: 14px 0 6px; font-size: 1.25rem; }
.fp-list { margin: 6px 0; padding-left: 1.6em; }
.fp-code { margin: 8px 0; padding: 10px 12px; overflow-x: auto; background: var(--ink); color: var(--cream-light); border-radius: 3px; font-size: 0.875rem; white-space: pre-wrap; }
.fp-quote { margin: 10px 0; padding: 8px 14px; border-left: 5px solid var(--manila-dark); background: var(--cream-light); }
.fp-quote .fp-quote { background: var(--paper); }
.fp-quote__head { margin: 0 0 4px; font-size: 0.8125rem; font-weight: 700; }
.fp-quote__head a { color: var(--ink-soft); }
.fp-spoiler { margin: 8px 0; border: 2px solid var(--ink); border-radius: 3px; }
.fp-spoiler > summary { padding: 4px 10px; background: var(--ink); color: var(--paper-text); font-weight: 700; cursor: pointer; }
.fp-spoiler__body { padding: 8px 12px; }
.fp-img { display: block; max-width: 100%; max-height: 480px; width: auto; height: auto; margin: 8px 0; border: 1px solid var(--manila-dark); }
.fp-imgask {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0; padding: 8px 12px;
  border: 2px dashed var(--manila-dark); background: var(--cream-light); font-size: 0.875rem;
}
.fp-embed {
  display: inline-flex; align-items: center; gap: 12px; max-width: 100%; margin: 6px 0; padding: 8px 12px 8px 8px;
  border: 2px solid var(--ink); border-radius: 3px; background: var(--paper); color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow-sm); vertical-align: middle;
}
.fp-embed:hover { background: var(--cream-light); }
.fp-embed__logo { width: 120px; flex: none; }
.fp-embed__avatar { width: 44px; height: 44px; flex: none; }
.fp-embed__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.fp-embed__kind { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-light); }
.fp-embed__title { font: 700 1rem/1.25 var(--font-display); overflow-wrap: anywhere; }
.fp-embed__sub { font-size: 0.8125rem; color: var(--ink-soft); overflow-wrap: anywhere; }
@media (max-width: 480px) { .fp-embed__logo { width: 88px; } }

/* Writing posts. */
.composer { display: flex; flex-direction: column; gap: 6px; }
.composer__label { font-weight: 700; }
.composer__bar { display: none; }
.js .composer__bar { display: flex; flex-wrap: wrap; gap: 4px; }
.composer__bar button {
  padding: 3px 9px; border: 2px solid var(--ink); border-radius: 3px; background: var(--paper); color: var(--ink);
  font: 600 0.8125rem/1.4 var(--font-ui); cursor: pointer;
}
.composer__bar button:hover { background: var(--cream-deep); }
.composer textarea { width: 100%; min-height: 10rem; padding: 10px; border: 2px solid var(--ink); border-radius: 3px; font: 400 1rem/1.5 var(--font-ui); background: var(--paper); resize: vertical; }
.composer__help { font-size: 0.8125rem; color: var(--ink-soft); }
.composer__help summary { cursor: pointer; }
.composer__help ul { margin: 6px 0; padding-left: 1.3em; }
.compose__title { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: 700; }
.compose__title input, .compose__note input { padding: 8px 10px; border: 2px solid var(--ink); border-radius: 3px; font: inherit; font-weight: 400; background: var(--paper); }
.compose__note { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; font-weight: 700; }
.compose__error { margin: 0 0 12px; padding: 8px 12px; border: 2px solid var(--hard); background: var(--hard-bg); font-weight: 700; }
.compose__preview { margin: 0 0 16px; padding: 12px 14px; border: 2px dashed var(--manila-dark); background: var(--cream-light); }
.compose__preview-label { margin: 0 0 6px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-light); }
.history__item { padding: 12px 0; border-top: 1px dashed var(--manila-dark); }
.history__head { margin: 0 0 6px; font-size: 0.9375rem; }
.history__text { margin: 0; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--cream-light); border: 1px solid var(--manila-dark); font: 400 0.875rem/1.5 var(--font-ui); }
.pactivity__logo--forum { color: var(--navy); background: var(--cream-light); }
.pactivity__logo--forum svg { width: 60%; height: 80%; }

/* Forum phase 2: unread marks, following, likes, mentions, search. */
.forum__mark--new { background: var(--hard); color: var(--paper-text); text-decoration: none; }
a.forum__mark--new:hover { background: var(--red-deep); }
.forum__thread.is-unread .forum__thread-title > a:last-of-type { color: var(--ink); }
.forum__thread-title .forum__thread-cat { font-weight: 400; font-size: 0.8125rem; }
.forum__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.forum__tools form { margin: 0; }
.forum__readall { margin: 0 0 6px; text-align: right; font-size: 0.875rem; }
.forum__search { display: flex; gap: 6px; align-items: center; flex: 1 1 260px; max-width: 420px; }
.forum__search .btn { align-self: stretch; }
.forum__search input[type="search"] { flex: 1; min-width: 0; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 3px; font: inherit; background: var(--paper); }
.forum__search--wide { max-width: none; flex-wrap: wrap; margin-bottom: 12px; }
.forum__search--wide select { padding: 6px 8px; border: 2px solid var(--ink); border-radius: 3px; font: inherit; background: var(--paper); }
.thread__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.thread__bar form { margin: 0; }
.post__like {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--paper); color: var(--ink); font: 700 0.8125rem/1.4 var(--font-ui); cursor: pointer;
}
.post__like svg { width: 14px; height: 14px; color: var(--ink-light); }
.post__like:hover { background: var(--cream); }
.post__like[aria-pressed="true"] { background: var(--hard-bg); border-color: var(--hard); }
.post__like[aria-pressed="true"] svg { color: var(--hard); }
.post__likes { font-size: 0.8125rem; font-weight: 700; color: var(--ink-soft); }
.fp-mention { font-weight: 700; color: var(--easy); text-decoration: none; background: var(--easy-bg); padding: 0 3px; border-radius: 3px; }
.fp-mention:hover { text-decoration: underline; }
.search-results { list-style: none; margin: 0; padding: 0; }
.search-result { padding: 12px 0; border-top: 1px dashed var(--manila-dark); }
.search-result p { margin: 0 0 3px; }
.search-result__title { font-weight: 700; overflow-wrap: anywhere; }
.search-result__snippet { font-size: 0.9375rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.search-result mark { background: var(--medium-bg); color: var(--ink); padding: 0 1px; }

/* Deleting a case (editor). */
.danger-zone { margin-top: 24px; border-color: var(--hard); }
.danger-zone > .panel__bar { background: var(--hard); }
.delete__counts { margin: 4px 0 14px; padding-left: 1.3em; }
.delete__choice { margin: 0 0 14px; padding: 10px 14px; border: 2px dashed var(--manila-dark); }
.delete__choice legend { font-weight: 700; padding: 0 4px; }
.delete__opt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; }
.delete__opt select { max-width: 100%; padding: 6px 8px; border: 2px solid var(--ink); border-radius: 3px; font: inherit; font-weight: 400; background: var(--paper); }
.delete__confirm input { max-width: 420px; }
.log__copy pre { max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.75rem; }

/* Recent activity: See all link, excerpts, folded runs (app/activity.py). */
.activity__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.activity__bar a { font: 700 0.8125rem/1 var(--font-ui); color: var(--paper-text); white-space: nowrap; }
.activity__score--none { color: var(--ink-light); font-weight: 600; }
.actexcerpt {
  margin: 3px 0 1px; padding-left: 8px; border-left: 3px solid var(--manila-dark); color: var(--ink-soft);
  font-size: 0.8125rem; line-height: 1.4; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.actexcerpt--note { font-style: italic; border-left-color: var(--navy); }
.actexcerpt--spoiler { font-style: italic; color: var(--ink-light); }
.actgroup summary { list-style: none; cursor: pointer; }
.actgroup summary::-webkit-details-marker { display: none; }
.actgroup__toggle { margin-left: 4px; font-size: 0.75rem; text-decoration: underline; color: var(--ink-soft); }
.actgroup__hide, .actgroup[open] .actgroup__show { display: none; }
.actgroup[open] .actgroup__hide { display: inline; }
.actgroup__cases { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin: 6px 0 2px; padding: 0; }
.actgroup__cases .newgrid__item { border-width: 1px; padding: 2px; }
.actgroup__cases .newgrid__item:hover { transform: none; }

/* All activity page. */
.allact__tabs { margin: 0; padding: 8px 10px 0; }
/* Its own list: the home column's caps (how many entries, pinned height) do not apply. */
.allact__list { list-style: none; margin: 0; padding: 0; }
.allact .activity__item { display: grid; padding: 10px 16px; border-bottom: 1px dashed var(--manila-dark); }
.allact .activity__text { font-size: 0.9375rem; }
.allact .actexcerpt { font-size: 0.875rem; }
.allact .actgroup__cases { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-width: 640px; }
.allact__day { list-style: none; }
.allact__day h2 { margin: 0; padding: 8px 16px 4px; font: 700 0.75rem/1.2 var(--font-ui); letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-light); background: var(--cream-light); border-bottom: 1px dashed var(--manila-dark); }
.allact__pager { padding: 14px; align-items: center; }
.allact__page { font-weight: 700; color: var(--ink-soft); }

/* Title icons (titlestyle.py): text height, before the name. The fill
   starts at the outer edge, so a gradient does not repeat under a see-through
   border (it showed as a sliver of the other end's color on each side). */
.title-tag { align-items: center; background-origin: border-box; }
.title-tag__icon { display: inline-block; width: auto; height: 1.15em; max-width: 3.5em; margin: 0 3px 0 -1px; vertical-align: -0.2em; object-fit: contain; }

/* Title look editor (admin Titles page). */
.titles__lookrow td { padding-top: 0; border-bottom: 2px solid var(--manila-dark); }
.look > summary { font-size: 0.875rem; font-weight: 700; cursor: pointer; }
.look__form { margin-top: 8px; }
.look__grid { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; }
.look__field { display: flex; flex-direction: column; gap: 3px; font-size: 0.8125rem; font-weight: 700; }
.look__field input[type="color"] { width: 54px; height: 32px; padding: 2px; border: 2px solid var(--ink); border-radius: 3px; background: var(--paper); cursor: pointer; }
.look__field select { padding: 4px 6px; border: 2px solid var(--ink); border-radius: 3px; font: inherit; font-weight: 400; background: var(--paper); }
.look__check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 6px; }
.look__preview { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 6px; }
.look__on { display: inline-flex; align-items: center; padding: 8px 12px; border: 1px solid var(--manila-dark); border-radius: 3px; font-size: 0.9375rem; }
.look__on--paper { background: var(--paper); }
.look__on--cream { background: var(--cream); }
.look__warn { margin: 6px 0; padding: 6px 10px; border: 2px solid var(--medium-strip); background: var(--medium-bg); font-size: 0.8125rem; font-weight: 700; }
