/* ---------------------------------------------------------------------------
   PSCNET Admin — design system
   Hand-authored, no build step. Light mode only.

   Deliberately NOT the site's brand blue. The public theme owns #0a7bc4, and
   an admin painted in it reads as another page of the site — the wrong signal
   when one screen publishes and the other only reads. Indigo is the working
   surface: adjacent enough to sit beside the blue logo, distinct enough that
   you always know which side of the product you are on. Neutrals are a true
   grey rather than the site's blue-tinted ink, so the accent is the only
   colour competing with the content.

   Surfaces carry shadow rather than outline. Hairlines are kept for things
   you type into and for dividers inside a card, where an edge is information.
   --------------------------------------------------------------------------- */

/* --- Fonts ---------------------------------------------------------------- */
@font-face { font-family: "Inter"; src: url("/theme/fonts/inter-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; font-style: normal; }
@font-face { font-family: "Inter"; src: url("/theme/fonts/inter-500-latin.woff2") format("woff2"); font-weight: 500; font-display: swap; font-style: normal; }
@font-face { font-family: "Inter"; src: url("/theme/fonts/inter-600-latin.woff2") format("woff2"); font-weight: 600; font-display: swap; font-style: normal; }
@font-face { font-family: "Inter"; src: url("/theme/fonts/inter-700-latin.woff2") format("woff2"); font-weight: 700; font-display: swap; font-style: normal; }

/* --- Tokens --------------------------------------------------------------- */
:root {
  /* Accent — indigo. The admin's own colour. */
  --ac-50:  #eef2ff;
  --ac-100: #e0e7ff;
  --ac-200: #c7d2fe;
  --ac-300: #a5b4fc;
  --ac-400: #818cf8;
  --ac-500: #6366f1;
  --ac-600: #4f46e5;
  --ac-700: #4338ca;
  --ac-800: #3730a3;
  --ac-900: #312e81;
  --ac-950: #1e1b4b;

  /* Neutrals — true grey, so nothing competes with the accent. */
  --n-50:  #fafafa;
  --n-100: #f4f4f5;
  --n-200: #e4e4e7;
  --n-300: #d4d4d8;
  --n-400: #a1a1aa;
  --n-500: #71717a;
  --n-600: #52525b;
  --n-700: #3f3f46;
  --n-800: #27272a;
  --n-900: #18181b;
  --n-950: #09090b;

  /* Semantic */
  --bg:          #f4f4f6;
  --surface:     #ffffff;
  --surface-2:   var(--n-50);
  --border:      var(--n-200);
  --divider:     #f1f1f4;
  --text:        var(--n-900);
  --text-soft:   var(--n-600);
  --muted:       var(--n-500);
  --accent:      var(--ac-600);
  --accent-hover:var(--ac-700);
  --accent-soft: var(--ac-50);
  --on-accent:   #ffffff;
  /* Kept for anything that still wants a soft ring — fields no longer do. */
  --ring:        rgba(99, 102, 241, .25);
  /* What a focused field's border turns: light grey, one step down from the
     resting --n-300. Not ink, which made a focused field look outlined rather
     than active, and not the accent, which already means "primary button" and
     "this filter is on" — a third meaning for the same colour is one too many.
     Focus here is a quiet shift in the border, not a highlight. */
  --field-focus: var(--n-400);

  /* Top bar. Deep slate rather than plain black — it has enough blue in it
     to sit with the indigo accent, and enough depth that the white cards
     below read as the working surface and the bar reads as chrome. */
  --bar:         #0f172a;
  --bar-text:    #f8fafc;
  --bar-soft:    rgba(248, 250, 252, .56);
  --bar-dim:     rgba(248, 250, 252, .40);
  --bar-fill:    rgba(255, 255, 255, .07);
  --bar-line:    rgba(255, 255, 255, .13);

  --danger:      #b91c1c;
  --danger-700:  #991b1b;
  --danger-bg:   #fef2f2;
  --danger-bd:   #fecaca;
  --success:     #047857;
  --success-700: #036049;
  --success-bg:  #ecfdf5;
  --success-bd:  #a7f3d0;
  --warn:        #b45309;
  --warn-700:    #92400e;
  --warn-bg:     #fffbeb;
  --warn-bd:     #fde68a;

  /* Control sizing. Every field, select and button reads these, so "slightly
     more compact" is one edit rather than a sweep through the file. */
  --field-py:  8px;
  --field-px:  11px;
  --field-fs:  13.5px;
  --btn-py:    9px;
  --btn-px:    15px;
  --btn-fs:    13.5px;

  /* Toolbar controls. Tabs, search and filters sit on one line, so they share
     a height and a corner radius — a pill beside a rounded rectangle beside a
     segmented track reads as three separate bars rather than one. */
  --bar-h:     34px;
  --bar-r:     9px;
  /* Heights, so every variant at a given size is the same box. */
  --btn-h:     36px;
  --btn-h-sm:  30px;
  --btn-h-lg:  44px;
  --label-fs:  12.5px;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  /* Two layers each: a tight contact shadow, then the soft ambient one. */
  --shadow-xs: 0 1px 2px rgba(24, 24, 27, .05);
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, .04), 0 1px 3px rgba(24, 24, 27, .05);
  --shadow:    0 1px 2px rgba(24, 24, 27, .04), 0 6px 16px -6px rgba(24, 24, 27, .12);
  --shadow-md: 0 2px 4px rgba(24, 24, 27, .04), 0 12px 28px -10px rgba(24, 24, 27, .16);
  --shadow-lg: 0 4px 8px rgba(24, 24, 27, .05), 0 24px 48px -16px rgba(24, 24, 27, .20);
}

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

/* Every `display` declared below outranks the browser's own [hidden] rule, so
   markup that hides a thing was being ignored — it had caught the combobox
   filter, the picker's ✕ and the address row before this went in. One rule,
   rather than remembering to write [hidden] into every component. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }

/* Everything clickable gets the hand. :where() keeps this at zero specificity,
   so a component that means otherwise (a leaf twist, a disabled nav item)
   still wins without !important. */
:where(a[href], button, summary, select, label[for], [role="button"], [role="link"], [role="tab"],
       input:is([type="button"], [type="submit"], [type="reset"], [type="image"], [type="checkbox"], [type="radio"], [type="file"], [type="color"])) { cursor: pointer; }
:where(button, input, select):disabled, :where([aria-disabled="true"]) { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Fields are the exception, across the whole admin: a text box, a select or a
   combobox says it has focus by taking the accent border, so an outline drawn
   on top of that is a second ring saying the same thing. Buttons, links and
   checkboxes keep theirs — on those the outline is the only indicator. */
.a-input:focus,
.a-input:focus-visible,
.a-combo-btn:focus,
.a-combo-btn:focus-visible,
.cat-search input:focus,
.cat-search input:focus-visible { outline: none; }

/* --- Auth shell ----------------------------------------------------------- */
.auth {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 40px 20px 32px;
  isolation: isolate;
}

/* A faint accent wash, so the page is not a flat grey rectangle. */
.auth::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 46% at 50% -4%, rgba(99, 102, 241, .12) 0%, transparent 68%),
    linear-gradient(180deg, #fbfbfd 0%, var(--bg) 46%);
  pointer-events: none;
}

.auth-head { text-align: center; }
.auth-card {
  width: 100%;
  max-width: 396px;
  padding: 32px 34px 34px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.brand-logo { display: inline-block; height: 34px; width: auto; margin-bottom: 20px; }

.auth-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.auth-title-sub { margin-top: 6px; color: var(--text-soft); font-size: 13.5px; }

.auth-alt {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--divider);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.auth-alt a { font-weight: 500; }

.auth-foot {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
}

/* --- Form ----------------------------------------------------------------- */
.a-form { margin-top: 22px; display: grid; gap: 14px; }
.a-field { display: grid; gap: 5px; }
.a-label { font-size: var(--label-fs); font-weight: 600; color: var(--n-800); }
.a-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.a-label-row a { font-size: 12px; font-weight: 500; }

/* Inputs keep their outline — an edge is what says "type here". */
.a-input {
  width: 100%;
  padding: var(--field-py) var(--field-px);
  font-size: var(--field-fs);
  line-height: 1.45;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--n-300);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.a-input::placeholder { color: var(--n-400); }
.a-input:hover { border-color: var(--n-400); }
.a-input:focus { border-color: var(--field-focus); box-shadow: var(--shadow-xs); }
.a-input[aria-invalid="true"] { border-color: var(--danger); }
.a-input[aria-invalid="true"]:focus { border-color: var(--danger); box-shadow: var(--shadow-xs); }
.a-input:-webkit-autofill { -webkit-text-fill-color: var(--text); box-shadow: 0 0 0 1000px #fff inset; }

.a-input-group { position: relative; }
.a-input-group .a-input { padding-right: 38px; }
.a-eye {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--n-400); cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.a-eye:hover { background: var(--surface-2); color: var(--text-soft); }
.a-eye svg { width: 16px; height: 16px; }
.a-eye .eye-off { display: none; }
.a-eye[aria-pressed="true"] .eye-on { display: none; }
.a-eye[aria-pressed="true"] .eye-off { display: block; }

/* Captcha: tinted panel, no outline. */
.captcha-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.captcha-img { height: 46px; width: auto; border-radius: 5px; background: #fff; user-select: none; }
.captcha-refresh {
  margin-left: auto;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: 7px;
  background: var(--surface); color: var(--muted);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: color .15s ease;
}
.captcha-refresh:hover { color: var(--accent); }
.captcha-refresh svg { width: 16px; height: 16px; }

.a-hint { font-size: 12px; color: var(--muted); }
.a-error { font-size: 12px; color: var(--danger); font-weight: 500; }

.a-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-soft); cursor: pointer; user-select: none; }
.a-check input {
  appearance: none; -webkit-appearance: none;
  width: 15px; height: 15px; margin: 0;
  border: 1px solid var(--n-300); border-radius: 5px;
  background: var(--surface); cursor: pointer;
  display: grid; place-items: center;
  transition: background-color .12s ease, border-color .12s ease;
}
.a-check input:checked { background: var(--accent); border-color: var(--accent); }
.a-check input:checked::after {
  content: "";
  width: 9px; height: 5px;
  border: 2px solid var(--on-accent); border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(.5px, -1px);
}
.a-check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Buttons -------------------------------------------------------------- */
/* --- Buttons -------------------------------------------------------------- */
/* One box, many intents.
   Every variant is the same size at the same size class, because the box is
   set by min-height and a transparent 1px border that the outline variants
   simply colour in — a solid button and an outline button are then the same
   height to the pixel, and an <a> dressed as a button matches a real <button>.

   Solid    primary · success · warning · danger      an action, and how it feels
   Bordered secondary (ghost is the same thing)       the companion to a primary
   Outline  outline-primary · -success · -warning · -danger · -secondary
   Quiet    quiet                                     a link that needs a hit area

   <x-admin.button variant="danger" size="sm">Delete for good</x-admin.button> */

.a-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--btn-h);
  padding: 0 var(--btn-px);
  font-size: var(--btn-fs); font-weight: 600; letter-spacing: -.005em;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  background: transparent; color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.a-btn:hover { text-decoration: none; }
.a-btn[disabled], .a-btn[aria-busy="true"] { opacity: .55; pointer-events: none; }

/* --- sizes: the only thing that changes the box --- */
.a-btn-sm { min-height: var(--btn-h-sm); padding: 0 11px; font-size: 12.5px; gap: 6px; }
.a-btn-lg { min-height: var(--btn-h-lg); padding: 0 18px; font-size: 14.5px; }
.a-btn-block { width: 100%; }
/* Square, for a button that is only an icon. */
.a-btn-icon { padding: 0; width: var(--btn-h); }
.a-btn-icon.a-btn-sm { width: var(--btn-h-sm); }
.a-btn-icon.a-btn-lg { width: var(--btn-h-lg); }
.a-btn svg { width: 16px; height: 16px; flex: none; }
.a-btn-sm svg { width: 14px; height: 14px; }

/* --- solid: the action is the point --- */
.a-btn-primary {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(24, 24, 27, .12);
}
.a-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.a-btn-primary:active { background: var(--ac-800); border-color: var(--ac-800); }

.a-btn-success {
  background: var(--success); color: #fff; border-color: var(--success);
  box-shadow: 0 1px 2px rgba(24, 24, 27, .12);
}
.a-btn-success:hover { background: var(--success-700); border-color: var(--success-700); color: #fff; }

.a-btn-warning {
  background: var(--warn); color: #fff; border-color: var(--warn);
  box-shadow: 0 1px 2px rgba(24, 24, 27, .12);
}
.a-btn-warning:hover { background: var(--warn-700); border-color: var(--warn-700); color: #fff; }

.a-btn-danger {
  background: var(--danger); color: #fff; border-color: var(--danger);
  box-shadow: 0 1px 2px rgba(24, 24, 27, .12);
}
.a-btn-danger:hover { background: var(--danger-700); border-color: var(--danger-700); color: #fff; }

/* --- bordered neutral: what stands next to a primary ---
   ghost is the same button under its older name — twelve screens call it that. */
.a-btn-secondary, .a-btn-ghost {
  background: var(--surface); color: var(--text-soft); border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.a-btn-secondary:hover, .a-btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--n-300); }

/* --- outline: the intent, without the weight --- */
.a-btn-outline-primary { color: var(--accent); border-color: var(--ac-200); background: var(--surface); }
.a-btn-outline-primary:hover { background: var(--ac-50); border-color: var(--accent); color: var(--accent); }

.a-btn-outline-success { color: var(--success); border-color: var(--success-bd); background: var(--surface); }
.a-btn-outline-success:hover { background: var(--success-bg); border-color: var(--success); color: var(--success); }

.a-btn-outline-warning { color: var(--warn); border-color: var(--warn-bd); background: var(--surface); }
.a-btn-outline-warning:hover { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }

.a-btn-outline-danger { color: var(--danger); border-color: var(--danger-bd); background: var(--surface); }
.a-btn-outline-danger:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }

.a-btn-outline-secondary { color: var(--text-soft); border-color: var(--n-300); background: transparent; }
.a-btn-outline-secondary:hover { background: var(--surface-2); color: var(--text); }

/* --- quiet: a link that needs a hit area --- */
.a-btn-quiet { color: var(--text-soft); }
.a-btn-quiet:hover { background: var(--surface-2); color: var(--text); }

/* Sign-in keeps the roomier control — it is one form on an empty page, and the
   density that helps a 53-row tree does nothing for it. */
.a-input-lg { padding: 10px 12px; font-size: 14.5px; }

.a-spinner {
  width: 15px; height: 15px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: a-spin .6s linear infinite;
  display: none;
}
.a-btn[aria-busy="true"] .a-spinner { display: block; }
@keyframes a-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .a-spinner { animation-duration: 2s; } }

/* --- Select and the searchable combobox ----------------------------------- */
/* The native control, styled. It is what the form posts, and what shows with
   scripting off; controls.js builds the combobox below over it. */
.a-select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  cursor: pointer;
}

/* Every select is replaced by this searchable combobox — built over the same
   <select>, which stays in the DOM and stays the thing that submits. */
.a-combo { position: relative; }
.a-combo select { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }

.a-combo-btn {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: var(--field-py) var(--field-px);
  font-size: var(--field-fs); line-height: 1.45;
  text-align: left;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--n-300); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.a-combo-btn:hover { border-color: var(--n-400); }
.a-combo-btn[aria-expanded="true"], .a-combo-btn:focus { border-color: var(--field-focus); box-shadow: var(--shadow-xs); }
.a-combo-btn[aria-invalid="true"] { border-color: var(--danger); }
.a-combo-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-combo-value.is-placeholder { color: var(--n-400); }
.a-combo-caret { width: 14px; height: 14px; flex: none; color: var(--muted); }

/* Fixed, not absolute, and positioned by script.

   A panel keeps `overflow: hidden` so its content stays inside its rounded
   corners, which also clips anything a field inside it wants to open. Rather
   than opening holes in that panel by panel — and hitting it again inside the
   inline editor, and again in the next sticky column — the popup leaves the
   clipping context altogether. Its coordinates come from the button's own
   rect, so no ancestor's overflow, transform or stacking context can reach it.

   z-index clears the mobile scrim at 30 and the sidebar at 40. */
.a-combo-pop {
  position: fixed; z-index: 60;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--border);
  overflow: hidden;
}

.a-combo-search {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--divider);
}

/* The list takes focus when there is no filter box above it to take it. */
.a-combo-list:focus { outline: none; }
.a-combo-list:focus-visible { outline: none; }
.a-combo-search svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.a-combo-search input { width: 100%; padding: 0; border: 0; background: none; outline: none; font-size: 13px; }

.a-combo-list { list-style: none; margin: 0; padding: 5px; max-height: 244px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.a-combo-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
}
.a-combo-opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The tree connector in front of a nested option. Monospace so the rails line
   up down the list, and quiet enough that it frames the name rather than
   competing with it. */
.a-combo-guide {
  flex: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--n-400);
  white-space: pre;
  letter-spacing: -.04em;
}
.a-combo-opt.is-active .a-combo-guide,
.a-combo-opt[aria-selected="true"] .a-combo-guide { color: var(--ac-400); }
.a-combo-opt.is-active { background: var(--n-100); }
.a-combo-opt[aria-selected="true"] { color: var(--ac-700); font-weight: 600; }
.a-combo-opt[aria-selected="true"]::after {
  content: ""; flex: none;
  width: 11px; height: 6px;
  border: 2px solid currentColor; border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -2px);
}
.a-combo-none { padding: 12px 14px; font-size: 12.5px; color: var(--muted); }

/* --- Alerts --------------------------------------------------------------- */
/* These keep a hairline: a tinted block with no edge reads as page background. */
.a-alert {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-soft);
}
.a-alert svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.a-alert strong { font-weight: 600; }
.a-alert-danger  { background: var(--danger-bg);  border-color: var(--danger-bd);  color: var(--danger); }
.a-alert-warn    { background: var(--warn-bg);    border-color: var(--warn-bd);    color: var(--warn); }
.a-alert-success { background: var(--success-bg); border-color: var(--success-bd); color: var(--success); }

/* --- Bits ----------------------------------------------------------------- */

/* Named for the site theme's helper so the same markup can be pasted either
   way round. It was missing here, and the admin has markup that assumes it:
   the answer radio in a question row carries a spoken label next to the
   letter, which without this rule printed "Option B is the answer" straight
   through the middle of the B pill. Clipped rather than display:none, because
   a screen reader has to be able to reach it. */
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.a-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  border-radius: 999px;
  background: var(--n-100); color: var(--muted);
}
.a-badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.a-badge-local { color: var(--warn); background: var(--warn-bg); }

/* ---------------------------------------------------------------------------
   Signed-in shell
   --------------------------------------------------------------------------- */

.shell { display: flex; min-height: 100dvh; background: var(--bg); }

/* --- Sidebar -------------------------------------------------------------- */
/* White against the grey page is separation enough; no rule down the edge. */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 248px;
  display: flex; flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform: translateX(-100%);
  transition: transform .22s ease;
}
.sidebar.is-open { transform: none; }
@media (min-width: 1024px) {
  .sidebar { position: sticky; height: 100dvh; transform: none; flex: none; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

.sidebar-brand { display: flex; align-items: center; gap: 9px; padding: 16px 20px 14px; }
.sidebar-brand img { height: 26px; width: auto; }
.sidebar-kicker {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  padding: 3px 7px;
  background: var(--n-100); border-radius: 999px;
}

.nav { flex: 1; overflow-y: auto; padding: 6px 12px 14px; }
.nav-label {
  padding: 0 8px;
  margin: 16px 0 6px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--n-400);
}
.nav-label:first-child { margin-top: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  margin-bottom: 1px;
  font-size: 14.5px; font-weight: 500;
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
a.nav-item:hover { background: var(--n-100); color: var(--text); text-decoration: none; }
.nav-item.is-active { background: var(--accent-soft); color: var(--ac-800); font-weight: 600; }
.nav-item.is-disabled { color: var(--n-400); cursor: default; }

/* Each section carries its own tint, set per item as --icon in the layout.
   Disabled ones keep the colour at lower strength — greying them out would
   lose the one cue that tells the sections apart. */
.nav-icon { width: 18px; height: 18px; flex: none; color: var(--icon, var(--n-400)); }
.nav-item.is-disabled .nav-icon { opacity: .55; }
a.nav-item:hover .nav-icon { opacity: 1; }

.nav-soon {
  margin-left: auto;
  padding: 1px 6px;
  font-size: 10px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--n-500);
  background: var(--n-100); border-radius: 999px;
}
.nav-soon-inline { margin: 0 2px; display: inline-block; vertical-align: 1px; }

.sidebar-foot { padding: 12px 20px 16px; font-size: 12px; color: var(--n-400); }

.avatar {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
}

/* --- Account menu --------------------------------------------------------- */
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--surface);
  border: 0; border-radius: 999px;
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--border);
  color: var(--text); cursor: pointer;
  transition: box-shadow .15s ease;
}
.user-btn:hover { box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--n-300); }
.user-btn[aria-expanded="true"] { box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--accent); }
.user-btn-name { font-size: 13px; font-weight: 500; }
@media (max-width: 599px) { .user-btn-name { display: none; } }
.user-btn-caret { width: 14px; height: 14px; color: var(--muted); }

/* The panel sits inside the dark bar, so it has to state its own colours —
   inheriting the bar's near-white text put white type on a white card. */
.menu-pop {
  position: absolute; top: calc(100% + 10px); right: 0;
  z-index: 50;
  min-width: 252px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.menu-head { display: flex; align-items: center; gap: 11px; padding: 14px; }
.menu-avatar {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft); color: var(--ac-700);
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
}
.menu-id { min-width: 0; }
.menu-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.menu-mail {
  display: block; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.menu-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 0 14px 12px;
}
.menu-role {
  padding: 2px 8px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ac-700); background: var(--accent-soft);
  border-radius: 999px;
}
.menu-since { font-size: 11.5px; color: var(--muted); }

.menu-list { padding: 6px; border-top: 1px solid var(--divider); }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  font-size: 13.5px; font-weight: 500; text-align: left;
  background: transparent; border: 0; border-radius: var(--radius-sm);
  color: var(--text-soft);
  cursor: pointer;
}
.menu-item:hover { background: var(--n-100); color: var(--text); text-decoration: none; }
.menu-item svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.menu-item:hover svg { color: var(--text-soft); }
.menu-item-danger:hover { background: var(--danger-bg); color: var(--danger); }
.menu-item-danger:hover svg { color: var(--danger); }

/* --- Main column ---------------------------------------------------------- */
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* The bar lifts off the page with a shadow instead of a rule, so nothing
   draws a line across the screen while you read. The inset highlight along
   the top edge is what keeps a dark band from looking like a flat cut-out. */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  min-height: 56px;
  background: var(--bar);
  color: var(--bar-text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 1px 3px rgba(2, 6, 23, .22);
}
@media (min-width: 1024px) { .topbar { padding: 0 24px; } }

/* Everything inside the bar is light-on-dark. Scoped, so the same components
   keep their light-surface styling everywhere else on the page. */
.topbar .menu-btn,
.topbar .user-btn {
  background: var(--bar-fill);
  color: var(--bar-text);
  box-shadow: inset 0 0 0 1px var(--bar-line);
}
.topbar .menu-btn:hover,
.topbar .user-btn:hover {
  background: rgba(255, 255, 255, .13);
  color: var(--bar-text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.topbar .user-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, .13);
  box-shadow: inset 0 0 0 1px var(--ac-400);
}
.topbar .avatar { background: var(--ac-500); }
.topbar .a-badge { background: var(--bar-fill); color: var(--bar-soft); }
.topbar .a-badge-local { background: rgba(245, 158, 11, .16); color: #fbbf24; }
.topbar :focus-visible { outline-color: var(--ac-300); }

/* A quiet text link rather than a button: it leaves the admin, so it should
   not compete with the controls that act on it. */
.bar-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 9px;
  font-size: 13px; font-weight: 500;
  color: var(--bar-soft);
  border-radius: var(--radius-sm);
}
.bar-link:hover { color: var(--bar-text); background: var(--bar-fill); text-decoration: none; }
.bar-link svg { width: 15px; height: 15px; }
@media (max-width: 767px) { .bar-link span { display: none; } .bar-link { padding: 7px; } }

.topbar-rule { width: 1px; height: 22px; background: var(--bar-line); }
@media (max-width: 599px) { .topbar-rule { display: none; } }

.menu-btn {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-soft);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--border);
  cursor: pointer;
}
.menu-btn:hover { background: var(--surface-2); }
.menu-btn svg { width: 17px; height: 17px; }
@media (min-width: 1024px) { .menu-btn { display: none; } }

/* Breadcrumbs. Replaced a section label stacked over a page title, which
   between them said less than this does — and left every screen with a child
   page repeating a trail in its own body to make up the difference. */
.topbar-crumbs {
  min-width: 0; flex: 1;
  display: flex; align-items: center; gap: 3px;
  /* A deep trail on a narrow window scrolls rather than wrapping the bar to
     two lines or squeezing the account menu off the end. */
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.topbar-crumbs::-webkit-scrollbar { display: none; }

.tcrumb {
  flex: none;
  padding: 3px 6px;
  font-size: 13px; font-weight: 500;
  color: var(--bar-soft);
  border-radius: 6px;
  white-space: nowrap;
  max-width: 26ch; overflow: hidden; text-overflow: ellipsis;
}
a.tcrumb:hover { color: var(--bar-text); background: var(--bar-fill); text-decoration: none; }

/* The separator is drawn from sibling position, so a page emits its trail
   without knowing how many steps came before it. */
.tcrumb + .tcrumb::before {
  content: "/";
  margin-right: 9px; margin-left: -3px;
  color: var(--bar-line);
  font-weight: 400;
}

/* The last step is the page you are on, and carries the weight the page title
   used to. Again by position: nobody has to count. */
.topbar-crumbs > .tcrumb:last-child {
  color: var(--bar-text);
  font-weight: 600;
  letter-spacing: -.01em;
}

.tcrumb-home { display: inline-grid; place-items: center; padding: 5px; }
.tcrumb-home svg { width: 15px; height: 15px; }
.tcrumb-home::before { content: none; }

/* On a narrow window only the tail is worth the width. */
@media (max-width: 599px) {
  .topbar-crumbs > .tcrumb:not(:last-child):not(:nth-last-child(2)):not(.tcrumb-home) { display: none; }
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* The account button carries name over role, so the bar says who you are and
   what you may do without a click. */
.user-btn-text { display: grid; gap: 0; text-align: left; line-height: 1.2; }
.user-btn-name { font-size: 12.5px; font-weight: 600; }
.user-btn-role {
  font-size: 10px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--bar-dim);
}
@media (max-width: 599px) { .user-btn-text { display: none; } }

.page { flex: 1; padding: 20px 16px 32px; display: grid; gap: 18px; align-content: start; }
@media (min-width: 1024px) { .page { padding: 24px 24px 40px; gap: 20px; } }

/* --- Page frame ----------------------------------------------------------- */
/* Every screen is a title section over a body, drawn by x-admin.page. Actions
   that act on the page as a whole sit on the title's line; anything acting on
   one panel stays inside that panel. */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head-main { display: grid; gap: 2px; min-width: 0; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.page-sub { font-size: 13px; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* A screen whose real subject is the first thing in its body — the editor,
   where the post's title is a field — does not need a 20px heading repeating
   what the page is. Title and sub share one line at label size, and the height
   that saves goes to the work. */
.page-head-dense { align-items: center; }
.page-head-dense .page-head-main {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 2px 10px;
}
.page-head-dense .page-title { font-size: 15px; letter-spacing: -.01em; }
.page-head-dense .page-sub { font-size: 12.5px; }

/* Less air above and below it, to match. Kept behind :has so a browser
   without it simply gets the ordinary spacing. */
.page:has(> .page-head-dense) { padding-top: 16px; gap: 14px; }
@media (min-width: 1024px) { .page:has(> .page-head-dense) { padding-top: 18px; gap: 16px; } }

@media (max-width: 719px) {
  /* Narrow: the actions drop under the title rather than squeezing it. */
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-actions { flex-wrap: wrap; }
}

.page-body { display: grid; gap: 18px; align-content: start; }
@media (min-width: 1024px) { .page-body { gap: 20px; } }

/* Main work on the left, the aside that supports it on the right. Used by
   every screen deep enough to have a second column. */
.page-split { align-items: start; }
@media (min-width: 1180px) {
  .page-split { grid-template-columns: minmax(0, 1.6fr) minmax(330px, 1fr); }
  /* A long list is a long scroll; the aside should still be there at the end. */
  .page-split > .panel-stack { position: sticky; top: 20px; }
}

/* --- Page section blocks -------------------------------------------------- */
.block { display: grid; gap: 12px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.block-title {
  font-size: 11.5px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}

/* --- Cards ---------------------------------------------------------------- */
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat {
  position: relative;
  padding: 16px 56px 16px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, transform .18s ease;
}
.stat:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-icon {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--accent-soft); color: var(--accent);
}
.stat-icon .nav-icon { width: 17px; height: 17px; color: inherit; opacity: 1; }
.stat-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.stat-value { margin-top: 6px; font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-meta { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* --- Panels --------------------------------------------------------------- */
.panel-grid { display: grid; gap: 18px; }
@media (min-width: 1100px) { .panel-grid { grid-template-columns: 1.35fr 1fr; align-items: start; } }
/* min-width: 0 for the same reason .pform-main has it: this is a grid item,
   and a grid item's default min-width is auto — it will not shrink below the
   widest thing inside it, so one long filename in an image picker pushed the
   whole aside wider than its track and the row hung out of the panel. */
.panel-stack { display: grid; gap: 18px; align-content: start; min-width: 0; }

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 15px 18px 13px;
}
.panel-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.panel-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.panel-note { font-size: 12px; color: var(--muted); white-space: nowrap; }
.panel-band { padding: 0 18px 14px; }
.panel-body { padding: 0 18px 8px; }
.empty { padding: 14px 0; font-size: 13px; color: var(--muted); }

.progress { height: 6px; background: var(--n-200); border-radius: 999px; overflow: hidden; }
.progress-bar {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--ac-400), var(--ac-600));
  border-radius: 999px;
}

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.dot-done { background: var(--success); }
.dot-empty { background: var(--warn); }
.dot-pending { background: var(--n-300); }

/* --- Lists ---------------------------------------------------------------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.check {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
}
.check:last-child { border-bottom: 0; }
.check-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--n-300); }
.check-done .check-dot { background: var(--success); }
.check-empty .check-dot { background: var(--warn); }
.check-pending .check-dot { background: var(--n-300); }
.check-main { min-width: 0; flex: 1; }
.check-label { display: block; font-size: 13.5px; font-weight: 600; }
.check-note { display: block; font-size: 12px; color: var(--muted); }
.check-count { font-size: 13px; font-weight: 600; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.check-pending .check-count { color: var(--n-300); }

.row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
}
.row:last-child { border-bottom: 0; }
.row-main { min-width: 0; flex: 1; }
.row-title { display: block; font-size: 13.5px; font-weight: 600; }
.row-sub { display: block; font-size: 12px; color: var(--muted); }
.row-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }

.kv { margin: 0; }
.kv-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
}
.kv-row:last-child { border-bottom: 0; }
.kv dt { font-size: 12.5px; color: var(--muted); }
.kv dd { margin: 0; font-size: 12.5px; font-weight: 500; text-align: right; overflow-wrap: anywhere; }

/* --- Callout -------------------------------------------------------------- */
.callout {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 16px 18px;
  background: var(--accent-soft);
  border-radius: var(--radius);
}
.callout-icon {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  background: #fff; color: var(--accent);
  box-shadow: var(--shadow-xs);
}
.callout-icon svg { width: 17px; height: 17px; }
.callout-title { font-size: 13.5px; font-weight: 700; color: var(--ac-950); }
.callout-text { margin-top: 4px; font-size: 13px; line-height: 1.65; color: var(--ac-900); }
.callout-text code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #fff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* The same shape in the warning palette, for a callout that reports a fault
   rather than explaining something. */
.callout-warn { background: var(--warn-bg); }
.callout-warn .callout-icon { color: var(--warn); }
.callout-warn .callout-title { color: var(--warn-700); }
.callout-warn .callout-text { color: var(--warn-700); }

/* --- Mobile scrim --------------------------------------------------------- */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(9, 9, 11, .35); }
@media (min-width: 1024px) { .scrim { display: none; } }

/* --- Section placeholder -------------------------------------------------- */
/* The page behind a sidebar entry with no screen yet. */
.stub {
  display: grid; justify-items: center;
  gap: 10px;
  max-width: 520px;
  margin: 12px auto;
  padding: 34px 28px 30px;
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.stub-icon {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: color-mix(in srgb, var(--icon, var(--accent)) 12%, #fff);
  color: var(--icon, var(--accent));
}
.stub-icon .nav-icon { width: 24px; height: 24px; color: inherit; opacity: 1; }
.stub-text { max-width: 44ch; font-size: 13.5px; line-height: 1.65; color: var(--text-soft); }
.stub-actions { margin-top: 8px; }

/* --- Categories ----------------------------------------------------------- */
/* The tree and its editor. This replaces WordPress's three screens — a list, a
   two-field Quick Edit and a full edit page — because 53 rows across three
   tiers fit on one, and losing your place in a tree to rename one thing is
   what makes the WordPress screen tiring. */

.cat-tree-panel { padding-bottom: 10px; }

/* The search box on every list screen. It sits in a row with dropdowns and a
   segmented control, so it is shaped like them: same height, same corner, same
   one-pixel border that darkens on hover and turns to ink on focus. */
.cat-search {
  display: flex; align-items: center; gap: 8px;
  min-height: var(--bar-h);
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--n-300);
  border-radius: var(--bar-r);
  box-shadow: var(--shadow-xs);
  transition: border-color .14s ease;
}
.cat-search:hover { border-color: var(--n-400); }
.cat-search:focus-within { border-color: var(--field-focus); }
.cat-search svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.cat-search:focus-within svg { color: var(--text-soft); }
.cat-search input { width: 170px; padding: 0; border: 0; background: none; outline: none; font-size: 13px; }
.cat-search input::placeholder { color: var(--n-400); }
.cat-search input::-webkit-search-cancel-button { cursor: pointer; }

/* --- The tree ------------------------------------------------------------- */
.ctree, .ctree-children { list-style: none; margin: 0; padding: 0; }
.ctree { padding: 2px 10px 8px; }

/* Children hang off a guide line, so depth is legible at a glance rather than
   counted from the em-dashes WordPress prints in front of the name. */
.ctree-children {
  margin-left: 30px;
  padding-left: 14px;
  border-left: 1px solid var(--n-200);
}
.ctree-item.is-collapsed > .ctree-children { display: none; }

.ctree-row {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 6px;
  border-radius: 10px;
  transition: background .12s ease;
}
.ctree-row:hover { background: var(--n-100); }
.ctree-item:target > .ctree-row { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--ac-200); }

/* Disclosure. Leaves keep the same box so every name in a tier starts on the
   same x, whether or not anything hangs off it. */
.ctree-twist {
  width: 20px; height: 20px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 6px;
  background: none; color: var(--n-400);
  cursor: pointer;
  transition: transform .16s ease, color .12s ease;
  transform: rotate(90deg);
}
.ctree-twist:hover { color: var(--text); }
.ctree-twist svg { width: 14px; height: 14px; }
.ctree-twist.is-leaf { cursor: default; }
.ctree-item.is-collapsed > .ctree-row > .ctree-twist { transform: none; }
@media (prefers-reduced-motion: reduce) { .ctree-twist { transition: none; } }

/* Tier marker. Told apart by shape, not only by indent: a board carries its
   initial, a level a bar, an exam a dot. */
.ctree-mark { flex: none; display: grid; place-items: center; }
.ctree-d0 > .ctree-row > .ctree-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--accent-soft); color: var(--ac-700);
  font-size: 12px; font-weight: 700; letter-spacing: -.01em;
}
.ctree-d1 > .ctree-row > .ctree-mark { width: 3px; height: 17px; border-radius: 2px; background: var(--n-300); }
.ctree-d2 > .ctree-row > .ctree-mark { width: 5px; height: 5px; margin: 0 -1px; border-radius: 50%; background: var(--n-300); }
.ctree-row:hover .ctree-mark { background: var(--n-400); }
.ctree-d0 > .ctree-row:hover > .ctree-mark { background: var(--ac-100); }

/* The whole name block opens the category, so the target is the row rather
   than a 15px pencil at the end of it. */
.ctree-main { min-width: 0; flex: 1; display: grid; gap: 1px; color: inherit; }
.ctree-main:hover { text-decoration: none; color: inherit; }
.ctree-main:hover .ctree-title { color: var(--accent); }
.ctree-line { display: flex; align-items: center; gap: 8px; min-width: 0; }

/* Weight falls away with depth, so a board reads as a board without being
   shouted, and 41 exams do not compete with the 9 boards above them. */
.ctree-title { font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctree-d0 .ctree-title { font-size: 14.5px; font-weight: 650; }
.ctree-d1 .ctree-title { font-size: 13.5px; }
.ctree-d2 .ctree-title { font-size: 13px; font-weight: 500; color: var(--text-soft); }

.ctree-chip {
  flex: none;
  padding: 1px 7px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .01em;
  color: var(--muted); background: var(--n-100);
  border-radius: 999px;
}
.ctree-row:hover .ctree-chip { background: var(--surface); }

.ctree-path {
  font-size: 11px; color: var(--n-400);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* One figure, and what it is. Parents show their own posts over the subtree
   total, because the two genuinely differ — posts are filed at every tier, so
   Kerala PSC holds 5,516 of the 11,787 under it rather than all of them. */
.ctree-counts { flex: none; width: 84px; text-align: right; display: grid; gap: 0; line-height: 1.25; }
.ctree-count { font-size: 13px; font-weight: 600; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.ctree-d0 .ctree-count { font-size: 14px; color: var(--text); }
.ctree-unit { font-size: 10.5px; color: var(--n-400); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Readership, in the same shape as the post count beside it so the two read as
   a pair of columns rather than as a number somebody appended. */
.ctree-views { flex: none; width: 76px; text-align: right; display: grid; gap: 0; line-height: 1.25; }

/* Actions rest at zero opacity and come up on hover — 53 rows times five
   controls is 265 icons, and left visible they are louder than the tree they
   act on. Never display:none: they stay in the tab order, :focus-within brings
   them up for anyone on a keyboard, and a device without hover shows them
   outright. */
.ctree-actions {
  flex: none; display: flex; align-items: center; gap: 6px;
  opacity: 0;
  transition: opacity .13s ease;
}
.ctree-row:hover .ctree-actions,
.ctree-row:focus-within .ctree-actions { opacity: 1; }
@media (hover: none) { .ctree-actions { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ctree-actions { transition: none; } }

/* Reordering and editing are different jobs; the gap says so without a rule. */
.ctree-group { display: flex; align-items: center; gap: 1px; }
.ctree-group form { display: contents; }

.ctree-act {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0; border-radius: 7px;
  background: none; color: var(--n-500);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.ctree-act:hover { background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow-xs); }
.ctree-act svg { width: 15px; height: 15px; }
.ctree-act:disabled { opacity: .28; cursor: not-allowed; }
.ctree-act:disabled:hover { background: none; color: var(--n-500); box-shadow: none; }
.ctree-act-danger:hover { background: var(--danger-bg); color: var(--danger); box-shadow: none; }

@media (max-width: 860px) { .ctree-counts, .ctree-views { display: none; } }

.ctree-none { padding: 8px 18px 18px; font-size: 13px; color: var(--muted); }

/* --- Category form -------------------------------------------------------- */
.cform { display: grid; gap: 14px; }
.cform-field { display: grid; gap: 5px; }
/* minmax(0, 1fr) rather than the default 1fr, so a field that cannot wrap —
   a filename, a long URL readout — is clipped or ellipsised inside the panel
   instead of widening it. The default `auto` track sizes to content. */
.panel-body-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 0 18px 18px; }

/* The path is the permalink, so the form shows the address it is about to
   create. Styled as a readout rather than as a field — it took a border and a
   grey fill before, which made it read as an input somebody had disabled. */
.cform-url { display: grid; gap: 3px; padding: 2px 0 1px; }
.cform-url-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
}
.cform-url code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; color: var(--ac-800);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cform-actions { display: flex; align-items: center; gap: 8px; margin-top: 2px; }

/* --- Breadcrumbs ---------------------------------------------------------- */
/* Read off the materialised path, so the trail costs no queries. */
.crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-bottom: 4px;
  font-size: 12px; color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs-sep { color: var(--n-300); }
.crumbs [aria-current] { color: var(--text-soft); font-weight: 500; }

/* --- Danger panel --------------------------------------------------------- */
/* Tinted rather than outlined: the panels around it carry no border either,
   and an edge here would be the only one on the page. */
.panel.danger { background: var(--danger-bg); box-shadow: none; }
.panel.danger .panel-title { color: var(--danger); }
.panel.danger .panel-sub { color: color-mix(in srgb, var(--danger) 72%, #fff); }

/* --- Tree summary --------------------------------------------------------- */

/* --- Media library -------------------------------------------------------- */

/* Drop zone. A dashed edge is the one place in this admin where a border earns
   its keep: the whole point is a target you can see the boundary of. */
.drop {
  position: relative;
  border: 1.5px dashed var(--n-300);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color .15s ease, background-color .15s ease;
}
.drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-inner { display: grid; justify-items: center; gap: 4px; padding: 26px 20px; text-align: center; }
.drop-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--accent-soft); color: var(--accent);
}
.drop.is-over .drop-icon { background: #fff; }
.drop-icon svg { width: 20px; height: 20px; }
.drop-title { margin-top: 6px; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.drop-sub { font-size: 12.5px; color: var(--muted); }
.drop-pick { position: relative; margin-top: 10px; overflow: hidden; cursor: pointer; }
/* The real input, invisible but still the thing that gets clicked — so this is
   a label wrapping a control rather than a button faking one. */
.drop-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.drop-go { margin-top: 10px; }

/* Upload queue. One row per file, each landing or failing on its own — a batch
   that reports a single verdict tells you nothing about which file was wrong. */
.drop-queue { list-style: none; margin: 0; padding: 0 16px 14px; display: grid; gap: 6px; }
.dq {
  display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; align-items: center; gap: 12px;
  padding: 8px 11px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.dq-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.dq-bar { height: 4px; background: var(--n-200); border-radius: 999px; overflow: hidden; }
.dq-fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .18s ease; }
.dq-state { font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.dq.is-done .dq-fill { background: var(--success); }
.dq.is-failed { background: var(--danger-bg); }
.dq.is-failed .dq-fill { background: var(--danger); }
.dq.is-failed .dq-state { color: var(--danger); text-align: left; grid-column: 2 / -1; }
@media (prefers-reduced-motion: reduce) { .dq-fill { transition: none; } }

/* --- Toolbar -------------------------------------------------------------- */
.media-bar { flex-wrap: wrap; gap: 12px; align-items: center; }
.media-search { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Segmented control, for choices that are one-of rather than a menu. Sized off
   --bar-h so the track ends level with the search box and the filters on the
   same line. */
.seg {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border-radius: calc(var(--bar-r) + 3px);
  box-shadow: inset 0 0 0 1px var(--border);
}
.seg-item {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: calc(var(--bar-h) - 6px);
  padding: 0 10px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-soft);
  border: 0; background: none;
  border-radius: var(--bar-r);
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.seg-item:hover { background: rgba(0, 0, 0, .035); color: var(--text); text-decoration: none; }
.seg-item.is-on, .seg-item.is-on:hover {
  background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* The count is a number, not part of the name of the tab. Giving it its own
   chip means the eye reads "Drafts" and "1" as a label and a quantity rather
   than as one run of text. */
.seg-count {
  display: inline-grid; place-items: center;
  min-width: 19px; height: 18px; padding: 0 5px;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--muted); background: var(--n-200);
  border-radius: 999px;
}
.seg-item.is-on .seg-count { color: var(--ac-700); background: var(--accent-soft); }

.seg-icons .seg-item { padding: 0 9px; }
.seg-icons svg { width: 15px; height: 15px; }

/* --- Grid ----------------------------------------------------------------- */
.mgrid {
  list-style: none; margin: 0;
  padding: 4px 18px 18px;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}
.mtile-link { display: grid; gap: 7px; color: inherit; }
.mtile-link:hover { text-decoration: none; }

.mtile-frame {
  position: relative;
  aspect-ratio: 1;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  /* Checkerboard, so a transparent PNG reads as transparent rather than as a
     white image on a white card. */
  background-color: var(--surface-2);
  background-image:
    linear-gradient(45deg, var(--n-200) 25%, transparent 25%, transparent 75%, var(--n-200) 75%),
    linear-gradient(45deg, var(--n-200) 25%, transparent 25%, transparent 75%, var(--n-200) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
  box-shadow: inset 0 0 0 1px var(--border);
  transition: box-shadow .15s ease;
}
.mtile-link:hover .mtile-frame { box-shadow: inset 0 0 0 1px var(--accent), var(--shadow); }
.mtile-frame img { width: 100%; height: 100%; object-fit: contain; }

.mtile-body { display: grid; gap: 1px; }
.mtile-name { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtile-link:hover .mtile-name { color: var(--accent); }
.mtile-meta { font-size: 11px; color: var(--muted); }

/* Freshly uploaded, so the eye catches where it landed. */
.mtile.is-new .mtile-frame { animation: m-land .5s ease; }
@keyframes m-land { from { box-shadow: inset 0 0 0 2px var(--accent); transform: scale(.96); } }
@media (prefers-reduced-motion: reduce) { .mtile.is-new .mtile-frame { animation: none; } }

/* A PDF has no thumbnail — Imagick and Ghostscript are not installed — so its
   extension is the picture. */
.mfile {
  display: grid; place-items: center;
  padding: 4px 7px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  color: var(--ac-700); background: var(--accent-soft);
  border-radius: 5px;
}
.mfile-lg { padding: 9px 13px; font-size: 13px; border-radius: 8px; }

/* --- List view ------------------------------------------------------------ */
.mlist .row { gap: 14px; }
.mlist-thumb {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}
.mlist-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mlist .row-meta { width: 92px; text-align: right; }
@media (max-width: 767px) { .mlist .row-meta:not(:last-child) { display: none; } }

/* --- Detail --------------------------------------------------------------- */
.mpreview {
  display: grid; place-items: center;
  padding: 20px;
  min-height: 220px;
  background-color: var(--surface-2);
  background-image:
    linear-gradient(45deg, var(--n-200) 25%, transparent 25%, transparent 75%, var(--n-200) 75%),
    linear-gradient(45deg, var(--n-200) 25%, transparent 25%, transparent 75%, var(--n-200) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
.mpreview img { max-width: 100%; max-height: 460px; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.mpreview-file { display: grid; justify-items: center; gap: 8px; padding: 24px; color: inherit; }
.mpreview-file:hover { text-decoration: none; }
.mpreview-name { font-size: 13.5px; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.mpreview-hint { font-size: 12px; color: var(--muted); }

.copy-row {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 4px; padding: 8px 9px 8px 11px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.copy-value {
  flex: 1; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; color: var(--text-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kv-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }

/* --- Empty state ---------------------------------------------------------- */
.media-empty { padding: 34px 20px 40px; text-align: center; }
.media-empty-title { font-size: 14px; font-weight: 600; }
.media-empty-text { margin-top: 4px; font-size: 13px; color: var(--muted); }

/* --- Pager ---------------------------------------------------------------- */
.pager {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 13px 18px;
  border-top: 1px solid var(--divider);
  font-size: 12.5px; color: var(--muted);
}
.pager-count { font-variant-numeric: tabular-nums; }
.pager-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pager-num { min-width: 32px; text-align: center; font-variant-numeric: tabular-nums; }
.pager-link.is-current { color: #fff; background: var(--accent); box-shadow: none; pointer-events: none; }
.pager-gap { padding: 0 2px; color: var(--muted); }
.pager-link {
  padding: 5px 11px;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--border);
}
.pager-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.pager-link.is-off { opacity: .45; pointer-events: none; box-shadow: inset 0 0 0 1px var(--border); background: none; }

.media-note {
  margin: 0 18px 4px;
  padding: 10px 12px;
  font-size: 12.5px; line-height: 1.6;
  color: var(--warn);
  background: var(--warn-bg);
  border-radius: var(--radius-sm);
}
.danger-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- Posts: the list ------------------------------------------------------ */
/* Built to be filtered, not paged through: at five thousand rows, finding one
   by clicking Next is not something anybody does twice. So the toolbar carries
   every way of narrowing the list, on one line. */

.plist-bar { flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-bottom: 14px; }

.plist-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.plist-filters .a-field { width: auto; gap: 0; }
.plist-filters .a-input, .plist-filters .a-combo-btn {
  min-width: 164px; min-height: var(--bar-h);
  padding-block: 0;
  border-radius: var(--bar-r);
  font-size: 12.5px;
}
.plist-filters .a-select { padding-right: 30px; }

/* Category names run long — "Kerala PSC Previous Question Papers" is a real
   one — so that filter gets room to show what it is set to rather than an
   ellipsis. The kind filter needs less: its longest label is "General
   knowledge". */
.fbit-wide .a-input, .fbit-wide .a-combo-btn { min-width: 224px; }

/* A filter that is doing something looks like it. Three quiet dropdowns in a
   row give no clue which of them is the reason the list is short — so a set
   one carries the accent, and the others stay out of the way. */
.fbit.is-set .a-combo-btn,
.fbit.is-set .a-input {
  border-color: var(--ac-300);
  background: var(--accent-soft);
  color: var(--ac-700);
  font-weight: 600;
}
.fbit.is-set .a-combo-caret { color: var(--ac-500); }

/* Sized like the controls it clears, so it reads as the last thing in the row
   rather than a glyph floating beside it — and so the row does not change
   height the moment a filter is set. */
.plist-clear {
  display: grid; place-items: center;
  width: var(--bar-h); height: var(--bar-h);
  border-radius: var(--bar-r);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: color .14s ease, background .14s ease, box-shadow .14s ease;
}
.plist-clear svg { width: 14px; height: 14px; }
.plist-clear:hover {
  background: var(--danger-bg); color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger-bd);
}

/* Column labels. Small, quiet, and aligned to the row grid below — so the
   pills and dates read as columns rather than as decoration. */
.plist-head, .prow {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 110px 92px 68px 96px 52px;
  align-items: center;
  gap: 14px;
}

.plist-head {
  padding: 8px 18px;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  background: var(--surface-2);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.plist-head-when { text-align: right; }

.plist { padding: 0; }

.prow {
  padding: 9px 18px;
  border-bottom: 1px solid var(--divider);
  transition: background .12s ease;
}
.prow:last-child { border-bottom: 0; }
.prow:hover { background: var(--surface-2); }

.prow-thumb {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}
.prow:hover .prow-thumb { background: var(--surface); }
.prow-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* The stand-in is held back so that a row with a real picture reads first —
   it is there to keep the column a column, not to be looked at. */
.prow-thumb.is-blank img { opacity: .55; }
.prow:hover .prow-thumb.is-blank img { opacity: .75; }

.prow .row-title { font-size: 13.5px; line-height: 1.35; }
.prow .row-sub { margin-top: 1px; font-size: 11.5px; }
.prow-path { font-variant-numeric: tabular-nums; }
.prow-dot { margin: 0 6px; color: var(--n-300); }
.prow-type { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Not a status — the row's standing is the pill's job — so this reads as a
   note on the kind rather than a second badge competing with it. */
.prow-static {
  margin-left: 5px; padding: 1px 6px;
  border-radius: 999px;
  background: var(--warn-bg); color: var(--warn);
  font-size: 10.5px; font-weight: 600;
}
.prow-when { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }

/* Always there, not on hover. A control you have to find by pointing at it is
   a control half the people using the screen never learn about — and on a
   touchscreen there is no pointing at all.

   Five thousand of them could still read as a wall of buttons, so the dots are
   held at the quietest grey that stays legible and come up to full ink on the
   row under the pointer: present on every row, loud on the one being worked. */
.prow-actions { justify-content: flex-end; }
.prow-actions .amenu-btn { color: var(--n-400); }
.prow:hover .prow-actions .amenu-btn,
.arow:hover .prow-actions .amenu-btn { color: var(--text-soft); }

@media (max-width: 1023px) {
  .plist-head { display: none; }
  .prow { grid-template-columns: 38px minmax(0, 1fr) auto; row-gap: 6px; }
  .prow-type, .prow-when, .prow-views { display: none; }
}

/* State as a shape as well as a word, so a row's standing reads without being
   read. */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap;
  justify-self: start;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-live { color: #047857; background: #d1fae5; }
.pill-draft { color: #57534e; background: #ececea; }
.pill-later { color: #a16207; background: #fef3c7; }
.pill-pending { color: #6d28d9; background: #ede9fe; }
.pill-gone { color: #9f1239; background: #ffe4e6; }

/* --- Comments ------------------------------------------------------------- */

/* The post list's grid with a different middle. What is being judged here is
   the comment, not the person who left it — so the comment is the line set at
   reading size, and the name above it is a label on it. */

.clist-head, .clist .crow { grid-template-columns: 34px minmax(0, 1fr) 92px 104px 44px; }

/* Every tab but Approved is a queue, and on a queue the one thing being done
   is approving — so the button is out on the row and the column widens to
   hold it. */
.clist-head.is-queue, .clist.is-queue .crow { grid-template-columns: 34px minmax(0, 1fr) 92px 104px 148px; }

.crow {
  display: grid;
  align-items: start;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--divider);
  transition: background .12s ease;
}
.crow:last-child { border-bottom: 0; }
.crow:hover { background: var(--surface-2); }

/* An initial in the writer's own colour, keyed off their address — so a run of
   rows left by one person reads as one person before any of them is read. The
   post list has a picture in this column; the two lists line up because of it. */
.crow-face {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: hsl(var(--h, 240) 56% 94%);
  color: hsl(var(--h, 240) 42% 34%);
  font-size: 14px; font-weight: 700;
  user-select: none;
}

.crow-who { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.crow-who .row-title { font-size: 13px; }

/* Facts about the row rather than states of it, so they are grey chips and not
   another pill — the pill column is the one place a status is stated. */
.crow-tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--n-100); color: var(--muted);
  font-size: 10.5px; font-weight: 600;
}

.crow-body {
  margin: 3px 0 4px;
  font-size: 13px; line-height: 1.5;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.crow-meta { display: flex; align-items: center; flex-wrap: wrap; font-size: 11.5px; }
.crow-meta a { color: var(--muted); }
.crow-meta a:hover { color: var(--accent); text-decoration: underline; }

/* The date it was left, and how long ago that was: the queue is read in days
   and the archive in years, and one column has to answer both. */
.crow-when { display: grid; gap: 1px; justify-items: end; padding-top: 2px; text-align: right; }
.crow-ago { font-size: 11px; color: var(--n-400); font-variant-numeric: tabular-nums; }

/* Always visible, unlike the post list's. There, the row is a thing to open;
   here it is a thing to answer, and every row on the screen wants answering. */
.crow-do { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.crow-do .a-btn { white-space: nowrap; }

/* Answering, on the row's second line and lined up under the comment being
   answered — the same place the reply would appear on the site. Closed it is
   one quiet word, so thirty of them down a page stay out of the way. */
.crow-reply { grid-column: 2 / -1; }
.crow-reply > summary {
  display: inline-flex; align-items: center; gap: 5px;
  width: fit-content;
  padding: 2px 0;
  color: var(--muted);
  font-size: 11.5px; font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: color .12s ease;
}
.crow-reply > summary::-webkit-details-marker { display: none; }
.crow-reply > summary svg { width: 13px; height: 13px; }
.crow-reply > summary:hover, .crow-reply[open] > summary { color: var(--accent); }
.crow-reply > summary:focus-visible { outline: 2px solid var(--field-focus); outline-offset: 2px; border-radius: 4px; }

.crow-reply-form { display: grid; gap: 8px; max-width: 620px; margin: 8px 0 4px; }
.crow-reply-form textarea { font-size: 13px; }
.crow-reply-foot { display: flex; align-items: center; gap: 10px; }
.crow-reply-note { font-size: 11.5px; color: var(--muted); }

/* The two ends of a custom range, sized like the dropdown they replace. */
.cdate { display: flex; align-items: center; gap: 6px; }
.cdate .a-input {
  width: auto; min-height: var(--bar-h);
  padding-block: 0;
  border-radius: var(--bar-r);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.cdate-to { font-size: 12px; color: var(--muted); }

@media (max-width: 1023px) {
  .clist-head { display: none; }
  .clist .crow, .clist.is-queue .crow { grid-template-columns: 34px minmax(0, 1fr) auto; row-gap: 8px; }
  /* The pill keeps its place beside the name; the date and the controls drop
     under the comment, across the two columns it was using. */
  .crow-when { grid-column: 2 / -1; justify-items: start; text-align: left; }
  .crow-do { grid-column: 2 / -1; justify-content: flex-start; }
}

/* --- Posts: the editor ---------------------------------------------------- */

/* A narrower aside than the category screen wants: everything in it is a short
   control, and the body is where the work happens. */
@media (min-width: 1180px) {
  .page-split.page-editor { grid-template-columns: minmax(0, 1fr) 300px; }
}

.pform { display: contents; }
.pform-main { display: grid; gap: 18px; align-content: start; min-width: 0; }
@media (min-width: 1024px) { .pform-main { gap: 20px; } }

/* The aside is a column of small forms, so it is set tighter than a panel in
   the main column. */
.pform-side .panel-head { padding: 15px 16px 12px; }
.pform-side .panel-body { padding: 0 16px 10px; }
.pform-side .panel-body-form { padding: 0 16px 18px; gap: 16px; }
.pform-side .panel-title { font-size: 13px; }
.pform-side .a-btn { width: 100%; justify-content: center; }

/* Save, then the two things that are not saving. Stacked rather than in a row:
   at 300px wide, three buttons abreast are three unreadable buttons.

   Set apart from the fields above by a rule and real space — the last thing
   before it is a two-line hint, and a primary button hard against a line of
   grey text reads as part of the sentence. */
.pform-actions {
  display: grid; gap: 8px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
}

.ptitle-panel .panel-body-form { padding-top: 14px; padding-bottom: 16px; gap: 14px; }

.a-input-xl {
  padding: 6px 0;
  border: 0; border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: 23px; font-weight: 700; letter-spacing: -.025em; line-height: 1.25;
}
.a-input-xl:focus { background: none; box-shadow: inset 0 -2px 0 var(--field-focus); }
.a-input-xl::placeholder { color: var(--n-300); font-weight: 700; }

/* The address reads as a line of the URL rather than a field, because it is
   derived and most of the time nobody needs to touch it. */
.purl { display: flex; align-items: baseline; gap: 8px; min-width: 0; margin-top: -8px; }
.purl-label { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.purl-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; color: var(--text-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.purl-edit {
  padding: 0; border: 0; background: none;
  font: inherit; font-size: 12px; color: var(--accent);
  cursor: pointer;
}
.purl-edit:hover { text-decoration: underline; }

/* The host, so the readout is an address rather than a fragment of one. */
.purl-host { color: var(--muted); }

/* Editing it in place, still shaped like the URL. The host and the trailing
   slash are inside the control but outside the field: the part you can change
   looks like the part you can change. */
.purl-field { display: grid; gap: 6px; }
.purl-edit-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.purl-box {
  display: flex; align-items: center;
  flex: 1; min-width: 260px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--n-300);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition: border-color .15s ease;
}
.purl-box:hover { border-color: var(--n-400); }
.purl-box:focus-within { border-color: var(--field-focus); }
.purl-box:has(.purl-input[aria-invalid="true"]) { border-color: var(--danger); }

.purl-affix {
  flex: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; color: var(--muted);
  user-select: none;
}
.purl-input {
  flex: 1; min-width: 0;
  padding: 8px 1px;
  border: 0; background: none; outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; color: var(--text);
}
.purl-input::placeholder { color: var(--n-400); }

/* --- Filing --------------------------------------------------------------- */
/* Where the post lands, spelled out. The dropdown above can only show the leaf,
   and "10th Level" on its own does not say which board it hangs off. */

/* A field that begins a new question rather than continuing the last one:
   Kind then Category, Status then Publish date. It gets a step down from what
   is above it, and keeps anything that belongs to it in the same group. */
.a-step { display: grid; gap: 10px; margin-top: 8px; }

/* The trail sits directly under the Category field and reads as its answer, so
   it keeps a gap of its own rather than being pushed against the field or the
   panel edge. */
.filing { display: grid; gap: 6px; margin-bottom: 2px; }

.filing-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 2px; line-height: 1.5; }

.filing-step {
  display: inline-flex; align-items: center;
  font-size: 11.5px; line-height: 1.4;
  color: var(--muted);
}
.filing-step + .filing-step::before {
  content: "";
  width: 4px; height: 4px;
  margin: 0 7px;
  border-top: 1.4px solid var(--n-300);
  border-right: 1.4px solid var(--n-300);
  transform: rotate(45deg);
}
.filing-step.is-leaf {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ac-50);
  color: var(--text);
  font-weight: 600;
}

.filing-none { font-size: 11.5px; line-height: 1.5; color: var(--warn); }

/* --- The body ------------------------------------------------------------- */

.pbody { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.75; resize: vertical; min-height: 420px; }

.sc-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  background: var(--surface-2);
}
.sc-label { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.sc-btn {
  padding: 4px 9px;
  border: 0; border-radius: 7px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  font: inherit; font-size: 12px; color: var(--text-soft);
  cursor: pointer;
  transition: color .12s ease, box-shadow .12s ease;
}
.sc-btn:hover { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.pbody-preview {
  min-height: 420px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}
.pbody-preview-out { font-size: 14.5px; line-height: 1.7; }
.pbody-preview-out > :first-child { margin-top: 0; }
.pbody-warn {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: #fef3c7;
  color: #92400e;
  font-size: 12.5px;
}

.a-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; margin-top: -2px; }
/* Sitting on the label's line, it needs no pull of its own. */
.a-label-row .a-count { margin-top: 0; font-weight: 500; }
.a-count.is-over { color: #b45309; font-weight: 600; }

.a-rule { height: 1px; margin: 4px 0; border: 0; background: var(--divider); }

/* --- Tabs ----------------------------------------------------------------- */
/* For one panel holding more fields than anybody needs at once. The strip is
   built from the panels by controls.js rather than written into the markup, so
   with scripting off this is three headed sections stacked — every field
   present, every one reachable, nothing hidden behind a control that is not
   working. The tab strip is the same segmented control the list screens use.

   Every panel stays in the DOM whichever tab is open, so the form posts the
   same fields either way and a closed tab is never a dropped value. */
.tabs-nav { justify-self: start; }
.tabs-panel { display: grid; gap: 16px; }

/* The heading each panel carries for the scripting-off case; the tab says the
   same thing once there is a tab. */
.tabs-head { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.is-tabbed .tabs-head { display: none; }


/* --- Action menu ---------------------------------------------------------- */
/* One button per row instead of a strip of them. The items are written inline
   in the markup and moved into the popup by controls.js, so a row with
   scripting off still carries every action — it degrades to a short list, not
   to a button that does nothing.

   The rows themselves are .menu-item, the same ones the topbar's user menu
   uses: two kinds of menu row in one admin is one too many. Everything named
   here is what this menu has that that one does not — a trigger, and a popup
   that has to be told where it is.

   That popup is fixed-position for the same reason the combobox's is: a panel
   keeps `overflow: hidden` so its corners stay rounded, and an absolutely
   positioned menu would be cut off by it. */
.amenu { display: flex; align-items: center; gap: 4px; }
.amenu-btn svg { width: 16px; height: 16px; }

/* The button's own hover has to read against the row's hover, and the row's
   hover is already the quiet button's wash — so pointing at the dots would
   have changed nothing. It takes a fill one step darker and a hairline ring
   instead, which reads on a plain row and on a hovered one.

   Held while the menu is open, so the row you are acting on stays marked once
   the popup is covering it. */
.amenu-btn { transition: background .12s ease, color .12s ease, box-shadow .12s ease; }
/* Written through .amenu so it outranks the row-hover colour above — the two
   selectors would otherwise tie, and the row would win over the pointer. */
.amenu .amenu-btn:hover,
.amenu .amenu-btn:focus-visible,
.amenu.is-open .amenu-btn {
  background: var(--n-100);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}
.amenu.is-open .amenu-btn { background: var(--n-200); }

.amenu-pop {
  position: fixed; z-index: 60;
  min-width: 190px;
  padding: 5px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--border);
}

.amenu-pop .menu-item:focus-visible { background: var(--n-100); color: var(--text); outline: none; }
.amenu-pop .menu-item:focus-visible svg { color: var(--text-soft); }

/* Red before it is hovered, not after: by the time the pointer is on it, the
   warning has come too late to be a warning. */
.amenu-pop .menu-item-danger, .amenu-pop .menu-item-danger svg { color: var(--danger); }
.amenu-pop .menu-item-danger:focus-visible { background: var(--danger-bg); color: var(--danger); }
.amenu-pop .menu-item-danger:focus-visible svg { color: var(--danger); }

/* Anything that posts sits below a rule: reading down the menu, the line is
   where looking stops and changing starts. */
.amenu-pop .amenu-form { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--divider); }

/* …one rule, not one per item. A menu with four forms in it — the comment
   queue's — was drawing a line above every one of them. The line belongs
   wherever looking turns into changing, whichever way round they are written. */
.amenu-pop .amenu-form:first-child,
.amenu-pop .amenu-form + .amenu-form { margin-top: 0; padding-top: 0; border-top: 0; }
.amenu-pop .amenu-form + a.menu-item { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--divider); }

/* Scripting off. The items stay where they were written — stacked, wrapping in
   whatever room the column has, still every one of them. */
.amenu:not(.is-menu) { flex-direction: column; align-items: flex-end; gap: 2px; }
.amenu:not(.is-menu) .menu-item {
  width: auto; padding: 1px 0;
  font-size: 12px; text-align: right;
  color: var(--accent);
}
.amenu:not(.is-menu) .menu-item:hover { background: none; text-decoration: underline; }
.amenu:not(.is-menu) .menu-item svg { display: none; }

/* --- Search and share previews -------------------------------------------- */
/* Worth the space: neither a Google result nor a WhatsApp card looks anything
   like the fields that produce it. */

.serp {
  display: grid; gap: 2px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}
.serp-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.serp-url { font-size: 12.5px; color: #4d5156; }
.serp-title {
  font-size: 18px; line-height: 1.3; color: #1a0dab;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.serp-desc {
  font-size: 13px; line-height: 1.58; color: #4d5156;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* Preview on the left, the fields that change it on the right — the same
   shape in both tabs, so moving between them does not move the preview.

   Named .seo-split rather than .share-row because the public theme already has
   a .share-row of its own; the two stylesheets never load together, but one
   name meaning two things is a trap for whoever reads this next.

   The preview column is capped: a share card is narrow by nature, and a Google
   result given half a wide monitor stops looking like a Google result. */
.seo-split { display: grid; gap: 18px; align-items: start; }
@media (min-width: 900px) {
  .seo-split { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
}

/* Tighter than a normal stack of fields: the title and the description are
   one search result between them, not two unrelated questions. */
.seo-fields { display: grid; gap: 12px; min-width: 0; }

/* A line under a tab saying what the tab is for, where the fields alone do
   not make that obvious. */
.seo-group-note { font-size: 12px; line-height: 1.5; color: var(--muted); }

/* Advanced was one long column of short fields nobody reaches for. Two to a
   row, it is half the height and no harder to read. */
.seo-pair { display: grid; gap: 12px 16px; align-items: start; }
@media (min-width: 760px) { .seo-pair { grid-template-columns: 1fr 1fr; } }

.seo-checks { display: grid; gap: 9px; padding-top: 2px; }

.share-card {
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  overflow: hidden;
}
.share-card .serp-label { padding: 12px 14px 0; margin: 0 0 8px; }
.share-img { position: relative; aspect-ratio: 1200 / 630; background: var(--surface-2); display: grid; place-items: center; }
.share-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.share-img.is-blank img { opacity: .6; }
.share-img-note {
  position: absolute; inset-inline: 0; bottom: 10px;
  text-align: center;
  font-size: 11.5px; color: var(--muted);
}
.share-text { display: grid; gap: 3px; padding: 10px 14px 14px; border-top: 1px solid var(--divider); }
.share-host { font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.share-title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.share-desc {
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.panel-note-warn { color: #92400e; background: #fef3c7; padding: 3px 9px; border-radius: 999px; }

/* --- Image picker ---------------------------------------------------------- */

.imgpick { gap: 8px; min-width: 0; }

/* A thumbnail, a name and the buttons, on one line. This was a 16:9 frame the
   width of the column — which, sitting beside the share card, was the same
   picture twice, and the copy you could not click was the bigger one. The chip
   says which picture is set; the dialog is where you look at it. */
.imgpick-row {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}
.imgpick-chip {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}
.imgpick-chip img { width: 100%; height: 100%; object-fit: cover; }
.imgpick-chip.is-blank img { opacity: .5; }

.imgpick-file {
  flex: 1; min-width: 0;
  font-size: 12.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.imgpick-file.is-blank { color: var(--muted); }

/* Sized to their own text — the aside makes every other button full width,
   and three full-width buttons on one line is no line at all. */
.imgpick-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.imgpick-actions .a-btn { width: auto; }

.imgpick-dialog {
  width: min(620px, 92vw);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.imgpick-dialog::backdrop { background: rgba(9, 9, 11, .45); }
.imgpick-dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.imgpick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px;
  max-height: 52vh; overflow-y: auto;
  padding: 16px;
  margin: 0; list-style: none;
}
.imgpick-tile {
  width: 100%;
  display: grid; gap: 5px;
  padding: 0; border: 0; background: none;
  font: inherit; text-align: left; cursor: pointer;
}
.imgpick-tile img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--border);
  transition: box-shadow .12s ease;
}
.imgpick-tile:hover img, .imgpick-tile:focus-visible img { box-shadow: 0 0 0 2px var(--accent); }
.imgpick-name {
  font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.imgpick-foot { padding: 0 16px 16px; font-size: 12.5px; color: var(--muted); }

/* --- Accounts ------------------------------------------------------------- */
/* The same list geometry as the posts screen, on its own columns: no
   thumbnail, and a role where the kind sits. Everything else — the head band,
   the hover, the actions revealing on hover — is inherited from .row/.prow so
   the two lists cannot drift apart. */
.alist-head, .arow {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 96px 92px 108px 52px;
  align-items: center;
  gap: 14px;
}

.alist-head {
  padding: 8px 18px;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  background: var(--surface-2);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.alist-head-when { text-align: right; }

.arow {
  padding: 9px 18px;
  border-bottom: 1px solid var(--divider);
  transition: background .12s ease;
}
.arow:last-child { border-bottom: 0; }
.arow:hover { background: var(--surface-2); }
.arow .row-title { font-size: 13.5px; line-height: 1.35; }
.arow .row-sub { margin-top: 1px; font-size: 11.5px; }

/* Initials, not a photograph: nothing uploads one, and a generic silhouette
   in every row would say less than two letters do.

   In the person's own colour, keyed off their address — the same disc the
   comment queue draws, for the same reason. A page of twenty-five strangers
   whose discs are all one indigo gives the eye nothing to hold on to; a page
   of twenty-five different ones can be scrolled back through by memory. */
.arow-avatar {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: hsl(var(--h, 240) 56% 94%);
  color: hsl(var(--h, 240) 42% 34%);
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  user-select: none;
}

/* The name and everything said about the name. A row rather than a run of
   inline spans, so a pill sitting next to a long name wraps under it instead
   of stretching the column — and a name with no spaces in it ends in an
   ellipsis rather than pushing the columns to its right off the panel. */
.arow-who { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.arow-who .row-title {
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* The same for the line under it: an address is as long as somebody made it. */
.arow .row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Confirmed. A tick and no word: on the tab this screen opens on every row
   carries one, and a mark that is merely present costs less to skip than a
   label that has to be read each time. */
.arow-tick {
  width: 13px; height: 13px; flex: none;
  color: var(--success);
}

.arow-noid { color: var(--n-300); }

.arow-you {
  margin-left: 6px; padding: 1px 6px;
  border-radius: 999px;
  background: var(--n-100); color: var(--muted);
  font-size: 10.5px; font-weight: 600; letter-spacing: .03em;
  vertical-align: 1px;
}
/* Unverified is the one thing on this row that is a problem rather than a
   fact, so it is the one thing wearing a colour. Small and outlined rather
   than a filled pill: the pill is the standing's shape, and a second filled
   badge beside it would read as a second standing. */
.arow-flag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--warn-bg);
  box-shadow: inset 0 0 0 1px var(--warn-bd);
  color: var(--warn-700);
  font-size: 10.5px; font-weight: 600;
  white-space: nowrap;
}
.arow-role { font-size: 12px; color: var(--muted); white-space: nowrap; }
.arow-warn { color: var(--warn); }

/* --- Multi-select --------------------------------------------------------- */
/* Built over a <select multiple>, so it borrows the whole combobox look and
   adds only what differs: a tick box on each row, an on state, and a foot that
   says how many are chosen and offers to undo it. */

/* The native fallback. Without scripting this is a list box, and it should
   still look like the fields around it rather than an OS control dropped in. */
.a-select-multi {
  height: auto; min-height: 0;
  padding: 5px; background-image: none;
}
.a-select-multi option { padding: 4px 6px; border-radius: 5px; }

.a-combo-multi .a-combo-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.a-combo-opt-multi { align-items: center; gap: 9px; }

/* Tree mode: indent by depth, a chevron on rows with something under them,
   and an empty slot of the same width on the rest so the boxes line up. */
.a-combo-opt-tree { padding-left: calc(4px + var(--depth, 0) * 20px); gap: 6px; }
.a-combo-twist {
  width: 20px; height: 20px; flex: none;
  display: grid; place-items: center;
  border-radius: 5px;
  color: var(--n-400);
  visibility: hidden;
}
.a-combo-twist svg { width: 13px; height: 13px; transition: transform .15s ease; }
.a-combo-opt-tree.has-children .a-combo-twist { visibility: visible; cursor: pointer; }
.a-combo-opt-tree.has-children .a-combo-twist:hover { background: var(--n-200); color: var(--text); }
.a-combo-opt-tree[aria-expanded="true"] .a-combo-twist svg { transform: rotate(90deg); }
/* While searching every ancestor is shown open, whatever its chevron says. */
.a-combo-opt-tree.is-searching .a-combo-twist { visibility: hidden; }
.a-combo-opt-tree .a-combo-box { margin: 0 3px 0 2px; }

/* Under a chosen row: already covered, so the box reads as ticked by its parent. */
.a-combo-included { display: none; flex: none; font-size: 11px; font-weight: 500; color: var(--muted); }
.a-combo-opt-multi.is-covered:not(.is-on) .a-combo-included { display: inline; }
.a-combo-opt-multi.is-covered:not(.is-on) .a-combo-box { background: var(--ac-100); border-color: var(--ac-300); }
.a-combo-opt-multi.is-covered:not(.is-on) .a-combo-tick { opacity: 1; color: var(--ac-500); }

/* A real box rather than a tick that appears out of nowhere: an empty square
   is what says the row can be chosen as well as unchosen. */
.a-combo-box {
  width: 16px; height: 16px; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--n-300);
  border-radius: 5px;
  background: var(--surface);
  color: #fff;
  transition: background .1s ease, border-color .1s ease;
}
.a-combo-tick { width: 11px; height: 11px; opacity: 0; }
.a-combo-opt-multi.is-on .a-combo-box { background: var(--accent); border-color: var(--accent); }
.a-combo-opt-multi.is-on .a-combo-tick { opacity: 1; }
.a-combo-opt-multi.is-on .a-combo-opt-label { font-weight: 600; }

.a-combo-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 4px; padding: 7px 10px 3px;
  border-top: 1px solid var(--divider);
  font-size: 11.5px; color: var(--muted);
}
.a-combo-tally { font-variant-numeric: tabular-nums; }
.a-combo-clear {
  padding: 0; border: 0; background: none;
  font: inherit; font-weight: 600; color: var(--accent);
  cursor: pointer;
}
.a-combo-clear:hover { text-decoration: underline; }

/* Students carry a boards column where users carry a role, and it needs the
   width that the one-word role column did not. Where staff carry a standing,
   they carry a readership — narrower, because it is four figures at most. */
.alist-head-boards, .arow-boards {
  grid-template-columns: 34px minmax(0, 1fr) minmax(150px, 210px) 74px 100px 52px;
}

/* Tabular figures and a right edge, so the column reads down the page as a
   column of numbers rather than a ragged left margin — the same treatment the
   post list's views column gets, because it is the same number about the other
   side of the same event. */
.alist-head-views { text-align: right; }
.arow-views {
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text-soft);
}
.arow-views .is-none, .arow .prow-when .is-none { color: var(--n-300); }

.arow-boards-cell {
  display: flex; align-items: center; flex-wrap: nowrap; gap: 4px;
  min-width: 0; overflow: hidden;
}
.arow-board {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  font-size: 11.5px; color: var(--text-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.arow:hover .arow-board { background: var(--surface); }
.arow-board-more {
  flex: none;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums;
  cursor: default;
}
.arow-board-none { color: var(--n-300); }

/* The accounts list had no narrow-screen rules at all, so six fixed columns on
   a tablet squeezed the name — the one thing the row exists to show — down to
   an ellipsis while a blank boards cell held its width. Below the desktop
   width the columns that are context go and the ones that are the answer
   stay. A learner's standing survives it either way: it rides beside the name
   rather than in a column. */
@media (max-width: 1023px) {
  .alist-head { display: none; }
  .arow, .arow-boards { grid-template-columns: 34px minmax(0, 1fr) auto 52px; }
  .arow-boards-cell, .arow-role, .arow .prow-when { display: none; }
}

/* On a phone the learner list keeps who it is and nothing else; the staff list
   keeps the standing, which is the whole reason that screen gets opened. */
@media (max-width: 600px) {
  .arow-boards { grid-template-columns: 34px minmax(0, 1fr) 52px; }
  .arow-views { display: none; }
}

/* The row menu stays put on people lists. On the post list it appears on
   hover, which is right for a page you scan; here it is the column, and a
   column that is blank until you touch it reads as no actions at all. */

/* --- Post body: the editor and its two modes ------------------------------- */
/* The mode switch is the same segmented control the list screens use, sitting
   in the panel head where the panel's own title is — it belongs to the body
   panel, not to the page. */
.pbody-modes { flex: none; }

/* In Visual the editor stands in for the textarea, so it should meet the panel
   the way the textarea did rather than float inside it. */
.pbody-panel .ta-editor { width: 100%; }
.pbody-panel .panel-body-form { padding-top: 0; }

/* Source keeps the monospace textarea and the Insert bar above it; Visual
   hides both, because a shortcode bar that types into a hidden field is a
   button that appears to do nothing. */
.pbody-panel .sc-bar[hidden] { display: none !important; }

/* --- Media picker ---------------------------------------------------------- */
/* The dialog behind AdminMediaPicker, opened from the featured image, the
   share image and the post editor's toolbar. It lives here rather than in the
   editor's stylesheet because two of those three are ordinary admin fields —
   the editor is a caller, not the owner.

   Its own overlay and panel rather than the admin's other dialog styles: this
   one is wide, has tabs, and is opened over a form it must not disturb. */
.mpick-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(24, 24, 27, .45);
}
.mpick {
  width: min(880px, 100%);
  max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  padding: 16px 18px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.mpick-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }

.mpick-tabs { display: flex; gap: 2px; margin: 10px 0 14px; border-bottom: 1px solid var(--divider); }
.mpick-tab {
  padding: 8px 14px;
  border: 0; border-bottom: 2px solid transparent;
  background: none;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer;
}
.mpick-tab:hover { color: var(--text); }
.mpick-tab.is-on { color: var(--accent); border-bottom-color: var(--accent); }

.mpick-body { flex: 1; min-height: 0; overflow-y: auto; }

.mpick-pane[data-pane-body="library"] { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 232px; }
@media (max-width: 720px) {
  .mpick-pane[data-pane-body="library"] { grid-template-columns: minmax(0, 1fr); }
}
.mpick-main { display: grid; gap: 10px; align-content: start; min-width: 0; }

.mpick-search {
  width: 100%; min-height: var(--bar-h);
  padding: 0 11px;
  border: 1px solid var(--n-300);
  border-radius: var(--radius-sm);
  font: inherit; font-size: 13px;
}
.mpick-search:focus { outline: none; border-color: var(--field-focus); }

.mpick-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  max-height: 340px; overflow-y: auto;
  padding: 2px; align-content: start;
}
.mpick-tile {
  display: grid; gap: 5px;
  padding: 0; border: 0; background: none;
  font: inherit; text-align: left; cursor: pointer;
}
/* The ring goes on the frame, not the tile, so the filename underneath is not
   boxed in with the picture. */
.mpick-frame {
  display: block; overflow: hidden;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
}
.mpick-frame img { width: 100%; height: 100%; object-fit: cover; }
.mpick-tile:hover .mpick-frame { box-shadow: inset 0 0 0 1px var(--n-300); }
.mpick-tile.is-on .mpick-frame { box-shadow: 0 0 0 2px var(--accent); }
.mpick-name { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpick-tile.is-on .mpick-name { color: var(--text); font-weight: 600; }

.mpick-status { font-size: 12.5px; color: var(--muted); }
.mpick-status.is-bad { color: var(--danger); }

.mpick-side {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  align-self: start;
}
.mpick-side-empty { font-size: 12.5px; line-height: 1.6; color: var(--n-400); }
.mpick-details { display: grid; gap: 10px; }
.mpick-details-img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}
.mpick-details-name { font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.mpick-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 11.5px; }
.mpick-facts dt { color: var(--n-400); }
.mpick-facts dd { margin: 0; color: var(--muted); }

.mpick-drop {
  display: grid; justify-items: center; gap: 6px;
  padding: 40px 20px;
  border: 2px dashed var(--n-300);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center; cursor: pointer;
}
.mpick-drop:hover, .mpick-drop:focus-visible, .mpick-drop.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}
.mpick-drop svg { width: 26px; height: 26px; color: var(--n-400); }
.mpick-drop-title { font-size: 14px; font-weight: 600; }
.mpick-drop-sub { margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }

.mpick-queue { display: grid; gap: 4px; margin-top: 12px; list-style: none; }
.mpick-queue-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12.5px;
}
.mpick-queue-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpick-queue-state { flex: none; color: var(--muted); }
.mpick-queue-row.is-done .mpick-queue-state { color: var(--success); }
.mpick-queue-row.is-bad .mpick-queue-state { color: var(--danger); }

.mpick-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--divider); }
/* What is about to be used, said next to the button that uses it. */
.mpick-chosen {
  margin-right: auto; max-width: 45%;
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- The facts table ---------------------------------------------------
   A post's labelled rows: "Last Date", "Department", "Total Questions". Two
   columns because that is what the row is — a label and a value — and the
   label column is fixed so eleven rows read as a table rather than as eleven
   pairs of boxes.

   The grip and the remove button are added by posts.js. With no scripting
   there is no drag and no X, and the three spare rows at the foot are how a
   fact gets added — so nothing here is a control that does nothing. */

.specs { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

.specs-row {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.specs-cell { display: grid; gap: 4px; min-width: 0; }

/* The value box grows with what is in it; the label never needs to. */
.specs-value { resize: vertical; line-height: 1.5; }

.specs-dated { color: var(--accent); }

/* A row nobody has typed in yet is quieter than one that holds a fact, so a
   panel with three spares at the foot does not look like a panel with three
   things missing. */
.specs-row:has(.specs-label:placeholder-shown):has(.specs-value:placeholder-shown) .a-input {
  border-style: dashed;
  border-color: var(--n-300);
}

/* ---- what posts.js adds ------------------------------------------------ */

.specs.is-live .specs-row { grid-template-columns: 1.25rem minmax(0, 15rem) minmax(0, 1fr) 1.75rem; }

.specs-grip {
  align-self: center;
  padding: 4px 0;
  color: var(--n-300);
  cursor: grab;
  text-align: center;
  line-height: 1;
  user-select: none;
}

.specs-grip:hover { color: var(--muted); }
.specs-row.is-dragging { opacity: .45; }
.specs-row.is-over .a-input { border-color: var(--accent); }

.specs-drop {
  align-self: center;
  width: 1.75rem; height: 1.75rem;
  display: grid; place-items: center;
  border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--n-300);
  cursor: pointer;
}

.specs-drop:hover { background: var(--surface-2); color: var(--danger); }
.specs-drop svg { width: 15px; height: 15px; }

.specs-add { margin-top: 12px; }

@media (max-width: 720px) {
  .specs-row,
  .specs.is-live .specs-row { grid-template-columns: minmax(0, 1fr); }
  .specs-grip { display: none; }
  .specs-drop { justify-self: end; }
}

/* ---- A paper's questions -----------------------------------------------
   Twenty-five to a page, each one a card. Everything in a row is a submit
   button carrying its own verb, so reordering and deleting need no scripting
   — which is also why nothing here is styled as a control that does nothing
   until a script arrives. */

.qsearch { display: flex; gap: 8px; align-items: center; padding: 12px 14px; }
.qsearch .a-input { flex: 1 1 auto; }

.qempty { display: grid; gap: 12px; justify-items: start; }
.qempty p { margin: 0; color: var(--muted); }

.qlist { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }

.qrow {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Where a move or an add just landed. */
.qrow:target { border-color: var(--accent); box-shadow: var(--shadow-xs); }

/* The number is a field, not a form section. Inline with its label it costs
   one line at the top of the card instead of three, which over a 71-question
   paper is most of a screen of scrolling. */
.qrow-head { display: flex; align-items: center; gap: 10px; }
.qrow-no { display: flex; align-items: center; gap: 8px; }
.qrow-no .a-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.qrow-no .a-input {
  width: 3.5rem;
  padding-left: 6px; padding-right: 6px;
  text-align: center; font-weight: 600;
}
.qrow-pos { font-size: 12px; color: var(--n-400); }
.qrow-acts { margin-left: auto; display: flex; gap: 4px; }

.qrow-act {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--muted);
  cursor: pointer;
}

.qrow-act svg { width: 15px; height: 15px; }
.qrow-act:hover { background: var(--surface-2); color: var(--text); }
.qrow-act-danger:hover { color: var(--danger); border-color: var(--danger); }

.qrow-stem { display: grid; gap: 4px; }
.qrow-stem textarea { line-height: 1.5; }

.qopts { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.qopt { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 8px; align-items: start; }

/* The letter is the radio. Pressing it is how the answer is set — one gesture
   rather than a letter to read and a control to find. */
.qopt-key {
  position: relative;
  display: grid; place-items: center;
  height: 2.25rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-weight: 600; font-size: 13px; color: var(--muted);
  cursor: pointer;
}

.qopt-key input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.qopt-key:hover { border-color: var(--n-400); color: var(--text); }
.qopt-key:has(input:focus-visible) { outline: 2px solid var(--field-focus); outline-offset: 1px; }
.qopt-text { line-height: 1.5; }

/* The answer is carried by the field as well as the letter. Checking a paper
   means reading down four options twenty-five times over, and a 2.25rem pill
   is too small a mark to find at that speed — the tinted field is visible
   from the scroll position rather than from the line you are on. */
.qopt.is-answer .qopt-key { background: var(--success); border-color: var(--success); color: #fff; }
.qopt.is-answer .qopt-text { border-color: var(--success-bd); background: var(--success-bg); }
.qopt.is-answer .qopt-text:hover { border-color: var(--success); }
.qopt.is-answer .qopt-text:focus { border-color: var(--success); }

.qrow-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  padding-top: 10px; border-top: 1px solid var(--divider);
  font-size: 13px;
}

/* Both were bare browser controls while every other tick in the admin is a
   drawn one. "No option is correct" is the fifth member of the A–D radio
   group and needs to look like a choice, so it takes the same green the
   letters take; cancelled is a fact about the exam, so it takes red. Reading
   the state off the chip is what stops the two being confused. */
.qnone, .qcancel {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text-soft);
  cursor: pointer; user-select: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.qnone:hover, .qcancel:hover { border-color: var(--n-400); color: var(--text); }
.qnone:has(input:checked) { background: var(--success-bg); border-color: var(--success-bd); color: var(--success-700); }
.qcancel:has(input:checked) { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--danger-700); }

.qnone input, .qcancel input {
  appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px; margin: 0; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--n-300); border-radius: 5px;
  background: var(--surface); cursor: pointer;
}
.qnone input { border-radius: 50%; }
.qnone input:checked { border-color: var(--success); }
.qnone input:checked::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.qcancel input:checked { background: var(--danger); border-color: var(--danger); }
.qcancel input:checked::after {
  content: "";
  width: 8px; height: 4px;
  border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(.5px, -1px);
}
.qnone input:focus-visible, .qcancel input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Secondary to the options above it, so the label does not compete with
   "Question" for the same weight. */
.qrow-said { display: grid; gap: 4px; flex: 1 1 18rem; min-width: 0; }
.qrow-said .a-label { font-size: 12px; font-weight: 500; color: var(--muted); }

.qnote { font-size: 13px; }
.qnote summary { cursor: pointer; color: var(--muted); }
.qnote summary:hover { color: var(--text); }
.qnote textarea { margin-top: 6px; }

/* Twenty-five questions is taller than a screen, and a Save you have to
   scroll back to is a Save that gets forgotten. */
.qbar {
  position: sticky; bottom: 0; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 14px; padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.qbar-note { margin-left: auto; font-size: 12.5px; color: var(--muted); }

@media (max-width: 720px) {
  .qopt { grid-template-columns: 2rem minmax(0, 1fr); }
  .qbar-note { margin-left: 0; width: 100%; }
}

/* The one counted entry in the sidebar: a report is a reader waiting on an
   answer, and the number is the only reminder there is — nothing here mails. */
.nav-count {
  margin-left: auto;
  min-width: 1.25rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 1.5;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---- The reports queue -------------------------------------------------
   A reader has told us a question is wrong. The remark comes first — it is the
   only part a person wrote, and it decides whether the rest is worth reading —
   then what they were looking at, then where to go and fix it. */

.qrep-list { display: grid; gap: 12px; margin: 0; padding: 14px; list-style: none; }

.qrep {
  display: grid; gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.qrep-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font-size: 13px; }
.qrep-who { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.qrep-who a { color: var(--muted); }
.qrep-when { margin-left: auto; color: var(--muted); font-size: 12.5px; }

.qrep-said { margin: 0; font-size: 14.5px; line-height: 1.55; }

/* A snapshot, taken when the report was filed — what the reader saw, which is
   not what the card says once somebody has fixed it. */
.qrep-seen {
  display: flex; gap: 8px;
  margin: 0;
  padding: 9px 12px;
  background: var(--surface-2);
  border-left: 2px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px; color: var(--text-soft);
}

.qrep-n { flex: none; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.qrep-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding-top: 10px; border-top: 1px solid var(--divider);
  font-size: 13px;
}

.qrep-where { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrep-acts { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.qrep-acts form { display: contents; }
.qrep-gone { color: var(--muted); font-size: 12.5px; font-style: italic; }

@media (max-width: 720px) {
  .qrep-when, .qrep-acts { margin-left: 0; }
}

/* ---- Analytics ----------------------------------------------------------
   The reporting section. Everything here is read-only, so there is no form
   styling below — what there is instead is three ways of drawing a quantity:
   a line over time, a meter against its neighbours, and a column per hour.

   No charting library. This admin has no build step for vendor JavaScript and
   one line chart does not justify acquiring one; drawing the SVG in the Blade
   also means the chart is in the HTML, so it prints and it is never an empty
   box waiting on a script. */

/* The trend chart. The SVG carries a fixed 1000-wide viewBox and stretches,
   so nothing measures anything and there is no resize handler. */
.chart { margin: 0; }
.chart-svg { display: block; width: 100%; height: auto; }

.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-scale,
.chart-tick { fill: var(--muted); font-size: 11px; font-family: inherit; }

.chart-area { fill: var(--accent-soft); }

/* vector-effect keeps the stroke one pixel however the viewBox is scaled —
   without it a wide panel stretches the line into a smear. */
.chart-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.chart-line-visitors { stroke: var(--muted); stroke-dasharray: 4 3; stroke-width: 1.5; }

.chart-key { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.chart-key-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch { width: 14px; height: 3px; border-radius: 2px; background: var(--accent); }
.chart-swatch-visitors { background: var(--muted); }

/* A breakdown row: label, proportional meter, value. Named `meter` rather
   than `bar`, which in this stylesheet already means the top bar.

   The meter is scaled against the biggest row rather than the total, so a
   list where one value takes 90% still says something about the other nine. */
.meter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(60px, 2fr) auto;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
}
.meter-row + .meter-row { border-top: 1px solid var(--divider); }

.meter-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}
.meter-label a { color: inherit; text-decoration: none; }
.meter-label a:hover { text-decoration: underline; }

.meter-track { height: 6px; border-radius: 3px; background: var(--divider); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

.meter-value { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter-share { color: var(--muted); font-size: 11px; margin-left: 4px; }

/* Today, by hour. Twenty-four columns that always occupy the full width, so
   the shape of a day is comparable at a glance from one visit to the next. */
.hours {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 3px;
    align-items: end;
    height: 108px;
}
.hour { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 4px; }
.hour-bar {
    display: block;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
    opacity: .72;
    min-height: 2px;
}
.hour-label { font-size: 10px; color: var(--muted); text-align: center; height: 12px; }

/* Which way a figure moved against the period before it. Up is not always
   good — a bounce rate rising is not a win — so these are coloured as
   direction, never as judgement. */
.trend { font-variant-numeric: tabular-nums; font-weight: 600; margin-right: 4px; }
.trend-up { color: var(--success); }
.trend-down { color: var(--warn); }

/* A data table: the post list in the analytics section, which is figures
   rather than the row-with-actions the content lists use. */
.table-scroll { overflow-x: auto; }

.dtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.dtable th,
.dtable td { padding: 9px 10px; text-align: left; vertical-align: top; }
.dtable thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.dtable tbody tr + tr td { border-top: 1px solid var(--divider); }
.dtable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.dtable-title { display: block; color: inherit; text-decoration: none; font-weight: 600; }
.dtable-title:hover { text-decoration: underline; }
.dtable-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.dtable-sub a { color: inherit; }

/* Said where a panel covers a shorter period than the chart above it. */
.note {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-left: 3px solid var(--border);
    font-size: 12.5px;
    color: var(--muted);
}

/* The views column on the post list. A fixed narrow column of tabular figures,
   so the number never pushes the title around and the column reads down the
   page as a column. The category tree has its own — see .ctree-views, which
   has to match the post count it sits beside rather than this. */
.prow-views {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.prow-views .is-none { color: var(--muted); }

/* --- Packages ------------------------------------------------------------- */

/* The post list's grid, with the columns a package is scanned for: what it
   covers, whether it is on sale, and what it starts at. */
.pklist-head, .pkrow { grid-template-columns: 38px minmax(0, 1fr) 92px 64px 76px 96px 52px; }

.pkrow-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: #fef3c7; color: #b45309;
}
.pkrow-mark .nav-icon { width: 19px; height: 19px; color: inherit; opacity: 1; }
.pkrow-plans { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pkrow-price { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pkrow-price .is-none { font-weight: 400; color: var(--muted); }

@media (max-width: 1023px) {
  .pkrow { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .pkrow-plans, .pkrow-price { display: none; }
}

/* The split layout pins its second column; this page's first one is a stack
   too, and a column that long must scroll with the page. */
.page-split > .pk-main { position: static; }

/* Every plan is its own small form, so a price is changed where it is read. */
.plan-list { display: grid; }
.plan-item { padding: 14px 18px; border-top: 1px solid var(--divider); }
.plan-item.is-off { background: var(--surface-2); }
.plan-item-new { background: var(--surface-2); }

.plan-form {
  display: grid; gap: 10px 12px; align-items: start;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 720px) {
  .plan-form { grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); }
}
.plan-form-foot {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
}
.plan-form-foot .a-check { margin-right: auto; }

.plan-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; }
.plan-summary-name { font-size: 13.5px; font-weight: 600; }
.plan-summary-price { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-summary-mrp { font-size: 12px; color: var(--muted); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.plan-summary-meta { font-size: 12px; color: var(--muted); }

.plan-summary-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }
.plan-summary-actions form { display: inline; }

/* --- Subscriptions -------------------------------------------------------- */

.slist-head, .srow { grid-template-columns: 34px minmax(0, 1.2fr) minmax(0, 1fr) 80px 88px 120px 38px; }
.srow-package { min-width: 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow-source { font-size: 12px; color: var(--muted); }
.srow .prow-when { display: grid; justify-items: end; line-height: 1.3; }
.srow-left { font-size: 11px; color: var(--muted); }
.srow-soon, .srow-soon .srow-left { color: var(--warn); font-weight: 600; }

@media (max-width: 1023px) {
  .slist-head { display: none; }
  .srow { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .srow-package, .srow-source, .srow .prow-when { display: none; }
}

/* One learner's access. Changing a date and revoking are both rarely done and
   both need a field, so each opens in place rather than living on the row. */
.access-note { margin: -4px 0 10px; font-size: 12px; color: var(--muted); }
.access-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.access-drawer > summary { list-style: none; cursor: pointer; }
.access-drawer > summary::-webkit-details-marker { display: none; }
.access-drawer[open] { flex-basis: 100%; }
.access-form {
  display: grid; gap: 10px; align-items: end;
  margin-top: 10px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
}
@media (min-width: 720px) {
  .access-form { grid-template-columns: minmax(0, 220px) auto auto; justify-content: start; }
  .access-form .a-check { padding-bottom: 9px; }
}

/* --- Orders --------------------------------------------------------------- */

.olist-head, .orow { grid-template-columns: 150px minmax(0, 1.2fr) minmax(0, 1fr) 90px 88px 130px; }
.orow { align-items: center; }
.orow-number { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.orow-amount { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.orders-date { width: 150px; height: 36px; padding-block: 0; font-size: 13px; }
.orders-date.is-set { border-color: var(--accent); }

@media (max-width: 1023px) {
  .olist-head { display: none; }
  .orow { grid-template-columns: minmax(0, 1fr) auto; }
  .orow > .row-main:nth-child(3), .orow .prow-when, .orow-amount { display: none; }
}

/* --- Sales reports -------------------------------------------------------- */

.rpt-change { margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.rpt-change.is-up { background: #d1fae5; color: #047857; }
.rpt-change.is-down { background: #ffe4e6; color: #9f1239; }
.rpt-slash { color: var(--n-300); font-weight: 400; }

.rpt-funnel { display: grid; gap: 12px; padding: 4px 0 12px; }
@media (min-width: 760px) { .rpt-funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rpt-step { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.rpt-step-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rpt-step-label { font-size: 13px; font-weight: 600; }
.rpt-step-sub { font-size: 12px; color: var(--muted); }

.rpt-table-head, .rpt-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 110px 130px 110px; gap: 14px; align-items: center; }
.rpt-demand-head, .rpt-demand-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 120px; gap: 14px; align-items: center; }
.rpt-row, .rpt-demand-row { padding: 9px 18px; border-bottom: 1px solid var(--divider); }
.rpt-row-sub { padding-block: 5px; background: var(--surface-2); }
.rpt-row-sub .row-sub { padding-left: 14px; }
.rpt-num { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rpt-strong { font-weight: 700; }
.rpt-indent { padding-left: calc(var(--depth, 0) * 18px); }
.rpt-reason { font-weight: 500; }

@media (max-width: 760px) {
  .rpt-table-head, .rpt-demand-head { display: none; }
  .rpt-row { grid-template-columns: minmax(0, 1fr) auto; }
  .rpt-row > .rpt-num:not(.rpt-strong) { display: none; }
}
.stat-link { display: block; color: inherit; text-decoration: none; }
.stat-link:hover { text-decoration: none; }
