/* Shared accordion, Misc/Ops link rows, and the ← Admin page header.
   Hashed with the other sheets (scripts/build.mjs ensure: section →
   assets/section-<hash>.css). Dev, which has no such <link> yet, gets the
   same rules from a <style> js/components/section.js inserts before paint.
   Same measurements as the old .adm-section / .adm-sub-section rules. */

.adm-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color 120ms ease;
}
.adm-section:focus-within { border-color: var(--border); }
.adm-section-summary {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; cursor: pointer; list-style: none; user-select: none; outline: none;
}
.adm-section-summary::-webkit-details-marker, .adm-section-summary::marker { display: none; }
.adm-section-summary:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.adm-section-summary:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.adm-section-title { font-size: 14px; font-weight: 600; color: var(--text-1); flex: 1; }
.adm-section-extra { display: flex; align-items: center; }
.adm-chevron { font-size: 18px; color: var(--text-muted); transition: transform 180ms ease; line-height: 1; flex-shrink: 0; }
.adm-section[open] > summary .adm-chevron { transform: rotate(90deg); }
.adm-section-body { padding: 4px 18px 18px; border-top: 1px solid var(--border-subtle); }

/* Nested accordion. Summary text is the title alone (call sites rewrite
   textContent). The chevron is ::after so that rewrite does not remove it. */
.adm-sub-section {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  margin: 10px 0;
  overflow: hidden;
}
.adm-sub-summary {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  cursor: pointer; list-style: none; user-select: none; outline: none;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  background: color-mix(in srgb, var(--bg-raised, #1b2536) 60%, transparent);
}
.adm-sub-summary::-webkit-details-marker, .adm-sub-summary::marker { display: none; }
.adm-sub-summary:hover { color: var(--text-1); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.adm-sub-summary::after {
  content: '›';
  margin-left: auto;
  font-size: 16px;
  color: var(--text-muted);
  transition: transform 180ms ease;
  line-height: 1;
  flex-shrink: 0;
}
.adm-sub-section[open] > .adm-sub-summary::after { transform: rotate(90deg); }
/* Top padding matters: with 0 the first content row of every unfolded
   sub-panel collided with the header bar. */
.adm-sub-body { padding: 10px 14px 14px; overflow-x: auto; }

/* Misc/Ops destination. Same frame as a sub-section (border, radius, padding,
   tint, type) but the whole row is a link. */
.adm-link-item {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--bg-raised, #1b2536) 60%, transparent);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.adm-link-item:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.adm-link-item:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); outline: none; }
.adm-link-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.adm-link-item-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.adm-link-item-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.adm-link-item--flash { animation: adm-link-flash 1.6s ease; }
@keyframes adm-link-flash {
  0% { background: color-mix(in srgb, var(--accent) 28%, transparent); box-shadow: inset 0 0 0 2px var(--accent); }
  100% { background: color-mix(in srgb, var(--bg-raised, #1b2536) 60%, transparent); box-shadow: inset 0 0 0 0 transparent; }
}

/* ← Admin sits above the H1. Column, not a row, so the link is not beside the title.
   stretch (not flex-start) so a subtitle and a list appended into the header
   (Cost Studio provenance) take the column width and wrap at 390px. */
.page-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.page-header-back {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); text-decoration: none;
  line-height: 1.2;
}
.page-header-sub,
.page-header > ul {
  min-width: 0;
}
.page-header > ul { width: 100%; }
.page-header-back:hover { color: var(--accent); }
.page-header-sub { margin: 0; }
