/*
 * PHASE 8Q.2-H1: THE ADMIN CONSOLE.
 * ADMIN UI MODERN: the same console, redrawn as a mobile-first admin portal --
 * a landing dashboard of area cards, panels instead of long raw lists, status
 * chips, filter chips, a section row that stays in reach while scrolling, and
 * destructive actions that look destructive. Presentation only: no selector
 * here hides a control, and every tappable thing is at least 44px tall.
 *
 * Mobile first: on a phone the section list is ONE row of horizontally
 * scrolling chips (the row scrolls, the page never does), pinned just under
 * the app bar, and every block is full width. From 960px the chips become a
 * sticky sidebar and the shell is allowed wider than the 720px phone column --
 * an administrator at a desk is reading tables, not tapping cards.
 *
 * ONLY EXISTING TOKENS. phase8q2-admin-ui.test.js and the 8C all-sheets guard
 * fail if this file reads a custom property nothing defines -- the 8B lesson
 * (four imaginary tokens, white cards) applied before the fact. Tints are
 * color-mix() of those tokens; this sheet defines no tokens of its own.
 *
 * No horizontal overflow at 320-430: every flexible child has `min-width: 0`,
 * long words wrap (`overflow-wrap: anywhere`), raw JSON scrolls INSIDE its own
 * box, and the chip rows are the only horizontally scrolling elements.
 */

:root[data-route="admin-console"] .main {
  max-width: 1180px;
}

.ac {
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* buttons drawn as links never carry the global link underline in here */
.ac a.btn,
.ac .ac__card,
.ac .ac__navlink,
.ac .ac__chip {
  text-decoration: none;
}

.ac a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ac__head {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ac__crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.ac__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.ac__lede {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-dim);
}

.ac__lede:empty { display: none; }

.ac__layout {
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* ---------------------------- the section list --------------------------- */

.ac__nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 8px 0;
  min-width: 0;
  max-width: 100%;
  /* stays under the app bar while the page scrolls: the way back is always one tap */
  position: sticky;
  top: calc(var(--safe-top) + 65px);
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.ac__nav::-webkit-scrollbar { display: none; }

.ac__navlink,
.ac__chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.ac__navlink:hover,
.ac__chip:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.ac__navlink[aria-current="page"],
.ac__chip[aria-current="page"] {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

/* sub-views: one scrolling row of tabs on a phone, never a wrapped pile */
.ac__subnav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding-bottom: 2px;
  min-width: 0;
  max-width: 100%;
}

.ac__subnav::-webkit-scrollbar { display: none; }

/* "On this page" (a long game page): small chips that scroll the page to a block */
.ac__jump {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding-bottom: 2px;
  min-width: 0;
  max-width: 100%;
}

.ac__jump::-webkit-scrollbar { display: none; }

.ac__jump:empty { display: none; }

.ac__jump-link {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.ac__jump-link:hover { color: var(--text); border-color: var(--accent-dim); }

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

/* a block scrolled to lands below the app bar and the pinned section row */
.ac__block { scroll-margin-top: calc(var(--safe-top) + 140px); }

/* a settings editor painted straight into the page (Rewards, Rules) is a card too */
.ac__body > .ac__settings {
  padding: 16px var(--gutter);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

.ac__body > .ac__settings > .ac__group-title:first-child { margin-top: 0; }

.ac__settings-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.ac__settings-list > .ac__group {
  padding: 4px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
}

.ac__body {
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* -------------------------------- blocks -------------------------------- */

.ac__block {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px var(--gutter);
  min-width: 0;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text) 4%, transparent) inset;
}

.ac__block-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.ac__page-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.ac__group-title {
  margin: 16px 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.ac__hint {
  margin: 4px 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-faint);
}

.ac__text {
  margin: 6px 0;
  color: var(--text);
}

.ac__ok {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elev-2));
  color: var(--accent);
  font-weight: 600;
}

.ac__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 4px;
  color: var(--accent);
  font-weight: 600;
}

.ac__grid {
  display: grid;
  gap: 16px;
  min-width: 0;
}

/* ------------------------------ dashboard ------------------------------- */

.ac__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
  gap: 10px;
  min-width: 0;
}

.ac__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 88px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--bg-elev-2), var(--bg-elev));
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 120ms ease, transform 120ms ease;
}

.ac__card::after {
  content: "›";
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text-faint);
}

.ac__card:hover {
  border-color: var(--accent-dim);
}

.ac__card:active { transform: scale(0.98); }

.ac__card-title {
  display: block;
  padding-right: 14px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
}

.ac__card-hint {
  display: block;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-dim);
}

.ac__card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
  padding-top: 6px;
}

.ac__cards--compact .ac__card,
.ac__card--compact {
  min-height: 64px;
  background: var(--bg-elev-2);
}

.ac__cards--compact .ac__card-hint { display: none; }

/* ------------------------------ status chips ----------------------------- */

.ac__pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  line-height: 1.3;
  white-space: nowrap;
}

.ac__pill[data-ac-tone="live"] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.ac__pill[data-ac-tone="pending"] {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
}

.ac__pill[data-ac-tone="danger"] {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.ac__pill[data-ac-tone="muted"] {
  color: var(--text-faint);
  border-color: var(--line-soft);
  background: transparent;
}

/* ------------------------------ filters ---------------------------------- */

.ac__filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 2px 0 6px;
  min-width: 0;
  max-width: 100%;
}

.ac__filters::-webkit-scrollbar { display: none; }

.ac__filter {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.ac__filter[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elev-2));
}

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

.ac__count {
  margin: 2px 0 8px;
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* ------------------------------ panels ----------------------------------- */

.ac__panels {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.ac__panel {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
}

.ac__panel > .ac__group-title:first-child {
  margin-top: 0;
}

/* ------------------------------ key / value ----------------------------- */

.ac__kv {
  margin: 0;
  display: grid;
  gap: 2px;
}

.ac__kv-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
  min-width: 0;
}

.ac__kv-row:last-child { border-bottom: 0; }

.ac__kv-row dt {
  color: var(--text-dim);
  min-width: 0;
}

.ac__kv-row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  min-width: 0;
}

/* a bare state word in a value cell reads as a chip (the word is unchanged) */
.ac__kv-row dd[data-ac-tone] {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.ac__kv-row dd[data-ac-tone="live"] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.ac__kv-row dd[data-ac-tone="pending"] {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
}

.ac__kv-row dd[data-ac-tone="danger"] {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.ac__kv-row dd[data-ac-tone="muted"] {
  color: var(--text-faint);
  border-color: var(--line-soft);
}

/* a short key/value list read as stat tiles (the prize counts) */
.ac__stats {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}

.ac__stats .ac__kv-row {
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
}

.ac__stats .ac__kv-row:last-child { border-bottom: 1px solid var(--line-soft); }

.ac__stats .ac__kv-row dd {
  text-align: left;
  font-size: 1.3rem;
  font-weight: 750;
}

/* in a stat tile the state word is the big number: coloured, not boxed */
.ac__stats .ac__kv-row dd[data-ac-tone] {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
}

.ac__stats .ac__kv-row dt {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ------------------------------ lists ------------------------------------ */

.ac__list,
.ac__games,
.ac__directory,
.ac__players,
.ac__attention {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ac__list li {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-dim);
}

.ac__feed li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
}

.ac__feed li:last-child { border-bottom: 0; }

/* a whole row is the tap target: its link stretches over it */
.ac__game-row,
.ac__player-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 10px;
  min-height: 52px;
  padding: 8px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  min-width: 0;
}

.ac__game-row:hover,
.ac__player-row:hover {
  border-color: var(--accent-dim);
}

.ac__game-row .ac__link,
.ac__player-row .ac__link {
  margin-top: 0;
  font-weight: 650;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.ac__game-row .ac__link::after,
.ac__player-row .ac__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.ac__player-row {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.ac__player-row .ac__hint {
  margin: 0;
}

.ac__state {
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.ac__prize-row {
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  color: var(--text);
}

.ac__list .ac__prize-row { color: var(--text); }
.ac__prize-row[data-ac-tone="live"] { border-left-color: var(--accent); }
.ac__prize-row[data-ac-tone="pending"] { border-left-color: var(--warn); }
.ac__prize-row[data-ac-tone="muted"] { border-left-color: var(--line-soft); color: var(--text-faint); }

/* ------------------------------ attention -------------------------------- */

.ac__alert {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left-width: 4px;
  background: var(--bg-elev-2);
}

.ac__alert--error {
  border-left-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 7%, var(--bg-elev-2));
}

.ac__alert--warn {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 6%, var(--bg-elev-2));
}

.ac__alert--info  { border-left-color: var(--accent-dim); }

.ac__alert-level {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.ac__alert--error .ac__alert-level { color: var(--danger); }
.ac__alert--warn .ac__alert-level { color: var(--warn); }

.ac__alert-title { font-weight: 600; }

.ac__alert .ac__link { justify-self: start; }

.ac__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ------------------------------ settings -------------------------------- */

.ac__settings { display: grid; gap: 8px; min-width: 0; }

.ac__group {
  min-width: 0;
}

.ac__setting {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
  min-width: 0;
}

.ac__setting:last-child { border-bottom: 0; }

.ac__setting-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
}

.ac__setting-label { font-weight: 650; }

.ac__setting-current {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.ac__setting-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.ac__input {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  /* 16px keeps iOS from zooming the page when a field takes focus */
  font-size: 16px;
}

.ac__save { min-width: 88px; }

.ac__search {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  margin: 4px 0 8px;
  font-size: 16px;
}

.ac__status {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.ac__status[data-ac-result="ok"] { color: var(--accent); }
.ac__status[data-ac-result="error"] { color: var(--danger); }

/* 8U.3: the manual adjustment's TRANSACTION TYPE (Award / Reimburse / Deduct).
 * 8U.4: three stacked, full-width cards. The fieldset
 * draws no box of its own (the cards are the boxes); every card is the label
 * of its radio, so a tap anywhere selects it. Title and description are both
 * forced to block, so they can never run together on one line.
 */
.ac__choices {
  display: grid;
  gap: 10px;
  margin: 12px 0 14px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.ac__choices > legend {
  padding: 0;
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.ac__choice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
  min-height: 44px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elev-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ac__choice input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.ac__choice-text {
  display: block;
  min-width: 0;
}

.ac__choice-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.ac__choice-desc {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-dim);
  overflow-wrap: break-word;
}

.ac__choice--on,
.ac__choice:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elev-2));
  box-shadow: inset 0 0 0 1px var(--accent);
}

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

[data-ac-block="adjust"] .ac__input {
  display: block;
  width: 100%;
  margin: 6px 0;
}

/* -------------------------- current round / override -------------------- */

.ac__frozen { display: grid; gap: 8px; }

.ac__frozen-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.ac__frozen-row:last-child { border-bottom: 0; }

.ac__override {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--warn);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--warn) 6%, transparent);
}

.ac__override .ac__input { flex: 1 1 100%; }

/* --------------------------- destructive actions ------------------------- */

/*
 * A destructive action never looks like a routine one: a tinted red fill and
 * a solid red edge, in the console and in every panel it borrows. The
 * confirmation dialog behind each one is unchanged.
 */
.ac .btn--danger {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 700;
}

.ac :is(.btn--danger):hover:not([disabled]) {
  background: color-mix(in srgb, var(--danger) 22%, transparent);
}

.ac :is(.btn--danger):focus-visible {
  outline-color: var(--danger);
}

.ac .btn:disabled,
.ac .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* every button in the console and its borrowed panels is a full finger target */
.ac .btn,
.ac .btn--small {
  min-height: 44px;
}

/* ------------------------------ collapsibles ----------------------------- */

.ac__details {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  margin-top: 8px;
  background: color-mix(in srgb, var(--bg-elev-2) 50%, transparent);
}

.ac__summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 650;
  color: var(--text-dim);
  list-style: none;
}

.ac__summary::-webkit-details-marker { display: none; }

.ac__summary::before {
  content: "›";
  flex: 0 0 auto;
  display: inline-block;
  width: 14px;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text-faint);
  transition: transform 120ms ease;
}

.ac__details[open] > .ac__summary::before { transform: rotate(90deg); }

.ac__details[open] > .ac__summary { color: var(--text); }

.ac__details-body { padding-bottom: 12px; min-width: 0; }

.ac__raw {
  max-width: 100%;
  max-height: 420px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 0.75rem;
  white-space: pre;
}

.ac__legacy,
.ac__external { min-width: 0; max-width: 100%; }

/* ----------------------- the Profile entry point ------------------------ */

.admin-entry__more { margin-top: 10px; }

.admin-entry__summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--text-dim);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .ac__card,
  .ac__summary::before { transition: none; }
  .ac__card:active { transform: none; }
}

/* ------------------------------- tablet --------------------------------- */

@media (min-width: 640px) {
  .ac__grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    align-items: start;
  }

  .ac__panels {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    align-items: start;
  }

  .ac__cards {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}

/* ------------------------------- desktop -------------------------------- */

@media (min-width: 960px) {
  .ac__layout {
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
  }

  .ac__nav {
    position: sticky;
    top: 72px;
    flex-direction: column;
    gap: 2px;
    overflow-x: visible;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-elev);
    backdrop-filter: none;
  }

  .ac__navlink {
    border-radius: var(--radius-sm);
    border-color: transparent;
    background: transparent;
    white-space: normal;
  }

  .ac__navlink:hover {
    background: var(--bg-elev-2);
  }

  .ac__subnav,
  .ac__jump {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .ac__block { scroll-margin-top: 88px; }
}
