/* subtitld.cc components, round 2 (docs/design/round-2/README.md).
   Every value reads the custom properties in tokens.css. Rules: logical properties only (RTL),
   2px radius (4px for panels, dialogs, menus), no drop shadows, caps via CSS only. */

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; position: relative; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ol, ul, dl, dd, figure, blockquote, pre { margin: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: var(--fg-2); text-underline-offset: 3px; }
a:hover { color: var(--fg); }
button { font: inherit; color: inherit; }
.icon { flex: none; }
[dir="rtl"] .icon--flip-rtl { transform: scaleX(-1); }
/* A chevron-end pointing back: mirrored in LTR, and in RTL the flip above already points it back. */
.icon--back { transform: scaleX(-1); }
[dir="rtl"] .icon--back.icon--flip-rtl { transform: none; }
:where(input, select, textarea, button):focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }

[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
html.no-js .js-only { display: none !important; }
html.js .no-js-only { display: none !important; }
.skip-link { position: absolute; inset-inline-start: 16px; top: -100px; z-index: 60; }
.skip-link:focus { top: 8px; }

/* ---------- Type helpers ---------- */

.t-display { font: var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
.t-h1 { font: var(--f-h1); text-wrap: balance; }
.t-h2 { font: var(--f-h2); }
.t-h3 { font: var(--f-h3); }
.t-body { font: var(--f-body); }
.t-small { font: var(--f-small); }
.t-label { font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.t-micro { font: var(--f-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.t-code { font: var(--f-code); font-variant-numeric: tabular-nums; }
.t-code-lg { font: var(--f-code-lg); font-variant-numeric: tabular-nums; }
.fg { color: var(--fg); }
.fg-2 { color: var(--fg-2); }
.fg-3 { color: var(--fg-3); }
.warn { color: var(--warn); }
.pretty { text-wrap: pretty; }

/* ---------- Layout ---------- */

.site-main { position: relative; flex: 1; }
.page {
  position: relative; width: 100%; max-width: var(--content-max); margin: 0 auto;
  padding: var(--page-pad-top, 32px) var(--gutter) 64px; display: flex; flex-direction: column; gap: var(--page-gap, 24px);
}
.page--narrow { max-width: 1100px; }
.page--auth { max-width: 480px; --page-pad-top: 72px; }
.page--auth-wide { max-width: 600px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--xs { gap: 4px; }
.stack--sm { gap: 8px; }
.stack--md { gap: 12px; }
.stack--lg { gap: 24px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }
.self-center { align-self: center; }
.self-start { align-self: flex-start; }
.w-full { width: 100%; }
.flush { padding-inline: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
@media (max-width: 640px) { .page { --page-pad-top: 20px; } .page--auth { --page-pad-top: 32px; } }

.site-watermark { z-index: 0; }

/* ---------- Brand ---------- */

.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; flex: none; }
.logo-mark { flex: none; width: 28px; height: 28px; }
.logo-mark--hero { width: 56px; height: 56px; }
/* The caption shape follows the theme (sky in dark, slate in light); the arrow is always the brand green. */
.logo-mark__clip { fill: var(--fg-2); }
.logo-mark__arrow { fill: var(--ok-solid); }
.brand__word { font: 700 17px/1 var(--ff); letter-spacing: -.01em; }
.brand__cc { color: var(--ok); font-weight: 600; }
.brand--hero { gap: 16px; }
.brand--hero .brand__word { font-size: 34px; letter-spacing: -.015em; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h-default); padding: 4px 14px; border: 1px solid transparent; border-radius: var(--radius);
  font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase; text-align: center;
  text-decoration: none; cursor: pointer; background: transparent; color: var(--fg-2);
}
.btn--default { background: var(--btn); color: var(--btn-fg); border-color: var(--btn-line); box-shadow: var(--bevel); }
.btn--default:hover { background: var(--btn-h); color: var(--btn-fg); }
.btn--default:active { background: var(--btn-p); box-shadow: var(--bevel-pressed); }
.btn--go { background: var(--go); color: var(--go-fg); border-color: var(--go-line); }
.btn--go:hover { background: var(--go-h); color: var(--go-fg); }
.btn--go:active { background: var(--go-p); }
.btn--sky { background: var(--sky); color: var(--sky-fg); }
.btn--sky:hover { background: var(--sky-h); color: var(--sky-fg); }
.btn--outline { border-color: var(--line-2); color: var(--fg-2); }
.btn--outline:hover { background: var(--chip); color: var(--fg); }
.btn--danger { background: var(--red); color: var(--red-fg); }
.btn--danger:hover { background: var(--red-h); color: var(--red-fg); }
.btn--quiet { color: var(--fg-2); padding-inline: 8px; }
.btn--quiet:hover { color: var(--fg); }
.btn--sm { min-height: var(--h-dense); padding-inline: 10px; }
.btn--34 { min-height: 34px; }
.btn--md { min-height: var(--h-action); }
.btn--lg { min-height: var(--touch-min); font-size: 12px; padding-inline: 16px; }
.btn--xl { min-height: var(--h-field-xl); }
.btn--icon { width: var(--h-default); min-height: var(--h-default); padding: 0; }
.btn--icon.btn--lg { width: var(--touch-min); }
.btn--block { width: 100%; }
.btn--subtitld img { width: 18px; height: 18px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
@media (pointer: coarse) { .btn { min-height: var(--touch-min); } }

/* Secondary actions on the asset page: plain caps links with an icon. */
.action-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.action-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--fg-2); text-decoration: none;
  font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.action-link--bad { color: var(--bad); }

/* ---------- Header ---------- */

.site-header {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 20px; height: 56px;
  padding-inline: var(--gutter); background: var(--chrome); border-bottom: 1px solid var(--line);
}
.header-search {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px; height: var(--h-default);
  padding-inline: 12px; background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius);
  color: var(--fg-3);
}
.header-search:focus-within { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
.header-search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent;
  font: var(--f-small); color: var(--fg);
}
.header-search input::placeholder { color: var(--fg-3); }
.kbd { font: var(--f-micro); color: var(--fg-3); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 1px 6px; }
.header-nav { display: flex; align-items: center; gap: 18px; }
.header-link {
  display: inline-flex; align-items: center; height: 56px; color: var(--fg-2); text-decoration: none;
  font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase;
  border-top: 2px solid transparent; border-bottom: 2px solid transparent;
}
.header-link[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }
.header-text-link { font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-2); text-decoration: none; }
.bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: var(--h-default); height: var(--h-default); border-radius: var(--radius); color: var(--fg-2);
}
.bell[aria-current="page"] { color: var(--fg); background: var(--chip); }
.bell__count {
  position: absolute; top: 2px; inset-inline-end: 1px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius); background: var(--ok-solid); color: var(--go-fg); font: 700 10px/16px var(--ff); text-align: center;
}
.bell__dot { position: absolute; top: 10px; inset-inline-end: 10px; width: 8px; height: 8px; border-radius: var(--radius); background: var(--ok-solid); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px;
  border-radius: var(--radius); background: #566f84; color: #fff; font: 700 12px/1 var(--ff);
}
.avatar--20 { width: 20px; height: 20px; font-size: 10px; }
.avatar--28 { width: 28px; height: 28px; font-size: 11px; background: #4a5f70; }
.avatar--profile { width: 88px; height: 88px; border-radius: var(--radius-lg); font-size: 28px; }
.account-button { display: inline-flex; align-items: center; gap: 6px; height: var(--h-default); color: var(--fg-3); cursor: pointer; list-style: none; }
.account-button::-webkit-details-marker { display: none; }
.header-mobile { display: none; }
.icon-link { display: inline-flex; align-items: center; justify-content: center; width: var(--touch-min); height: var(--touch-min); color: var(--fg-2); position: relative; }
@media (max-width: 760px) {
  .site-header { gap: 4px; padding-inline: 16px 6px; }
  .site-header .brand { gap: 8px; }
  .site-header .logo-mark { width: 26px; height: 26px; }
  .site-header .brand__word { font-size: 16px; }
  .header-search, .header-nav { display: none; }
  .header-mobile { display: flex; align-items: center; margin-inline-start: auto; }
}

/* ---------- Menus (details/summary: work without JS) ---------- */

.menu-wrap { position: relative; }
.menu-wrap > summary { list-style: none; cursor: pointer; }
.menu-wrap > summary::-webkit-details-marker { display: none; }
.menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 20; min-width: 240px;
  background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--radius-lg); overflow: hidden;
}
.menu--start { inset-inline-start: 0; inset-inline-end: auto; }
.menu__head { padding: 8px 12px; background: var(--raised-bar); color: var(--fg-2); font: var(--f-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.menu__meta { padding: 10px 12px; font: var(--f-small); color: var(--fg-3); }
.menu__meta strong { display: block; color: var(--fg); font-weight: 600; }
.menu__item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: transparent;
  color: var(--fg); text-decoration: none; text-align: start; font: 600 14px/20px var(--ff); cursor: pointer;
}
.menu__item:hover { background: var(--chip); color: var(--fg); }
.menu__item small { font: var(--f-small); color: var(--fg-3); }
.menu__item--icon { justify-content: flex-start; color: var(--fg-2); font-weight: 500; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-2); background: var(--chrome);
  padding: 24px var(--gutter) 28px; display: flex; flex-direction: column; gap: 16px;
}
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; flex: 1 1 380px; font: var(--f-small); }
.footer-links a { color: var(--fg-2); text-decoration: none; }
.footer-links a:hover { color: var(--fg); }
.footer-links .footer-links__strong { color: var(--fg); font-weight: 600; }
.footer-prefs { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-note { font: 400 12px/18px var(--ff); color: var(--fg-3); max-width: 640px; }

.pref-select {
  position: relative; display: inline-flex; align-items: center; height: var(--h-dense);
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--field); color: var(--fg-2);
}
.pref-select select {
  appearance: none; height: 100%; padding-inline: 32px 30px; border: 0; background: transparent;
  font: var(--f-small); color: var(--fg-2); cursor: pointer;
}
.pref-select .icon { position: absolute; color: var(--fg-3); pointer-events: none; }
.pref-select__lead { inset-inline-start: 10px; }
.pref-select__chev { inset-inline-end: 10px; }

/* ---------- Fields ---------- */

.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-2); }
.field__hint { font: var(--f-small); color: var(--fg-3); }
.field__msg { display: flex; align-items: center; gap: 6px; font: var(--f-small); }
.field__msg--ok { color: var(--ok); }
.field__msg--bad { color: var(--bad); }
.input, .select, .textarea {
  width: 100%; min-height: var(--touch-min); padding: 0 12px; background: var(--field); color: var(--fg);
  border: 1px solid var(--line-2); border-radius: var(--radius); font: 500 15px/1.4 var(--ff);
}
.input:hover, .select:hover, .textarea:hover { background: var(--field-h); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .prefixed[aria-invalid="true"] { border-color: var(--bad); }
.textarea { padding-block: 10px; min-height: 96px; resize: vertical; }
.select { appearance: none; padding-inline-end: 36px; cursor: pointer; }
.select-wrap { position: relative; }
.select-wrap > .icon { position: absolute; inset-inline-end: 12px; top: 50%; margin-top: -6px; color: var(--fg-2); pointer-events: none; }
.prefixed {
  display: flex; align-items: center; min-height: var(--touch-min); padding-inline: 12px; background: var(--field);
  border: 1px solid var(--line-2); border-radius: var(--radius); font: var(--f-code); font-size: 15px;
}
.prefixed:focus-within { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
.prefixed > span { color: var(--fg-3); }
.prefixed > input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: transparent; font: inherit; color: var(--fg); }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font: var(--f-small); text-wrap: pretty; cursor: pointer; }
.checkbox input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.errors { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 7px; flex: none;
  border-radius: var(--radius); font: var(--f-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase; white-space: nowrap;
}
.badge--sm { height: 20px; padding: 0 6px; }
.badge--code { justify-content: center; min-width: 46px; height: 24px; padding: 0 6px; background: var(--code-chip); color: #fff; }
.badge--flag { border: 1px solid var(--line-2); color: var(--fg-2); }
.badge--mt { border: 1px dashed var(--line-2); color: var(--fg-2); }
.badge--links { background: var(--warn-bg); color: var(--warn); }
.badge--public { background: var(--ok-bg); color: var(--ok); }
.badge--unlisted { background: var(--chip); color: var(--fg-2); }
.badge--restricted { background: var(--warn-bg); color: var(--warn); }
.badge--draft { background: var(--chip); color: var(--fg-3); }
.badge--exact { background: var(--ok-solid); color: var(--go-fg); }
.badge--probable { border: 1px solid var(--ok); color: var(--ok); }
.badge--kind { background: var(--chip); color: var(--fg-2); height: 20px; padding: 0 6px; }
.badge--latest { background: var(--ok-bg); color: var(--ok); height: 20px; padding: 0 6px; }
.badge--chip { background: var(--chip); color: var(--fg-2); }
.badge .icon { width: 12px; height: 12px; }

/* ---------- Pills and chips ---------- */

.pills { display: flex; gap: 4px; overflow-x: auto; }
.pill {
  display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: var(--radius); white-space: nowrap;
  color: var(--fg-2); text-decoration: none; font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.pill[aria-selected="true"], .pill[aria-current="true"] { background: var(--accent); color: var(--on-accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--h-default); padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--fg); text-decoration: none; font: 600 13px/1.2 var(--ff);
}
.chip:hover { background: var(--chip); color: var(--fg); }
.chip__count { font-weight: 500; color: var(--fg-3); }

/* ---------- Search fields ---------- */

.searchbox {
  display: flex; align-items: center; gap: 12px; height: var(--h-field-xl); padding-inline: 16px;
  background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--fg-3);
}
.searchbox--accent { border-color: var(--accent); }
.searchbox:focus-within { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
.searchbox input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font: 400 17px/1.2 var(--ff); color: var(--fg);
}
.searchbox input::placeholder { color: var(--fg-3); }
.searchbox__busy { display: none; font: var(--f-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-3); }
.htmx-request .searchbox__busy, .searchbox__busy.htmx-request { display: inline; }
.filterbox {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px; height: var(--h-action); padding: 0 12px;
  background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--fg-3);
}
.filterbox:focus-within { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
.filterbox input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font: var(--f-small); color: var(--fg); }
.drop-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h-field-xl); padding: 0 16px;
  border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--fg-2); text-decoration: none;
  font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase;
}

/* ---------- Asset rows and cards ---------- */

.rows { background: var(--panel); border-bottom: 1px solid var(--line); border-radius: var(--radius); }
.asset-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 92px 112px auto; gap: 12px 16px; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--line);
}
.asset-row__main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.asset-row__title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.asset-row__title a { font: 600 15px/22px var(--ff); color: var(--fg); text-decoration: none; min-width: 0; }
.asset-row__title a:hover { text-decoration: underline; }
.asset-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font: var(--f-small); color: var(--fg-3); }
.asset-row__meta-rating { display: none; align-items: center; gap: 3px; color: var(--fg-2); font-weight: 700; }
.rating { display: inline-flex; align-items: center; gap: 5px; font: 700 13px/1 var(--ff); color: var(--fg); }
.rating .icon { color: var(--accent); }
.rating__count { font-weight: 500; color: var(--fg-3); }
.asset-row__unrated { font: var(--f-small); color: var(--fg-3); }
.asset-row__id { font: var(--f-code); font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--fg-3); }
/* Compact rows follow the width of their list, not the screen: the drop zone column is narrow on desktop too. */
.rows { container-type: inline-size; }
@container (max-width: 640px) {
  .asset-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .asset-row__rating, .asset-row__id { display: none; }
  .asset-row__meta-rating { display: inline-flex; }
}
@media (pointer: coarse) { .asset-row .btn--icon { width: var(--touch-min); min-height: var(--touch-min); } }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.asset-card {
  display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 14px; color: var(--fg); text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.asset-card:hover { border-color: var(--line-2); color: var(--fg); }
.asset-card__thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, #1a232b, #07090b);
  display: flex; align-items: flex-end; justify-content: center; padding: 0 12px 14px;
}
.asset-card__thumb .badge--code { position: absolute; top: 8px; inset-inline-start: 8px; min-width: 0; height: 22px; }
.asset-card__caption { background: rgba(7, 9, 11, .85); color: #fff; font: 600 13px/1.45 var(--ff); padding: 2px 8px; border-radius: var(--radius); text-align: center; text-wrap: balance; }
.asset-card__body { display: flex; flex-direction: column; gap: 2px; padding-inline: 4px; }
.asset-card__title { font: 600 14px/20px var(--ff); }
.asset-card__meta { font: 500 12px/18px var(--ff); color: var(--fg-3); }

/* ---------- Share link and download ---------- */

.share-field {
  display: flex; align-items: stretch; height: var(--touch-min); min-width: 0;
  background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden;
}
.share-field__text {
  flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: var(--f-code); font-variant-numeric: tabular-nums; color: var(--fg-3);
}
.share-field__text b { color: var(--fg); font-weight: 700; letter-spacing: .03em; }
.share-field__input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 12px; font: var(--f-code); color: var(--fg); }
.share-field__copy {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border: 0; border-inline-start: 1px solid var(--line-2);
  background: var(--chip); color: var(--fg-2); cursor: pointer; white-space: nowrap;
  font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.share-field__copy:hover { color: var(--fg); }
.share-field__copy:focus-visible { outline-offset: -4px; }
.share-field--lg { height: 56px; border-color: var(--accent); }
.share-field--lg .share-field__text { font: var(--f-code-lg); font-size: 20px; font-variant-numeric: tabular-nums; }
.share-field--lg .share-field__copy { background: var(--sky); color: var(--sky-fg); border-inline-start: 0; }

.split { position: relative; display: flex; }
.split > .btn { border-start-end-radius: 0; border-end-end-radius: 0; flex: 1; }
.split > details > summary {
  list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 100%; min-height: var(--touch-min);
  background: var(--go); color: var(--go-fg); border: 1px solid var(--go-line); border-inline-start: 1px solid rgba(11, 40, 8, .3);
  border-start-end-radius: var(--radius); border-end-end-radius: var(--radius); cursor: pointer;
}
.split > details > summary::-webkit-details-marker { display: none; }
.split > details > summary:hover { background: var(--go-h); }
.split .menu { top: 50px; inset-inline-start: 0; inset-inline-end: auto; min-width: 260px; }
.action-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.action-row > .share-field { flex: 1 1 320px; }
@media (max-width: 640px) { .action-row > * { flex: 1 1 100% !important; } }

/* ---------- Tabs ---------- */

/* The divider is drawn inside the strip, so the active tab's 2px underline covers it without overflowing. */
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; overflow-y: hidden; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; height: var(--touch-min); padding: 0 14px; white-space: nowrap;
  border-bottom: 2px solid transparent; color: var(--fg-2); text-decoration: none;
  font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.tab__count { font-weight: 500; color: var(--fg-3); }
.tab-panel { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }

/* ---------- Lists inside asset tabs ---------- */

.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.line { display: grid; grid-template-columns: 44px 230px 1fr; gap: 4px 16px; padding: 10px 14px; }
.line__n { font: var(--f-micro); font-variant-numeric: tabular-nums; color: var(--fg-3); padding-top: 4px; }
.line__t { font: var(--f-code); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--fg-2); padding-top: 2px; white-space: nowrap; }
.line__x { font: var(--f-line); white-space: pre-line; }
@media (max-width: 640px) { .line { grid-template-columns: 36px 1fr; } .line__x { grid-column: 2; } }

.version { display: grid; grid-template-columns: 56px 1fr auto; gap: 6px 16px; align-items: start; padding: 14px; }
.version__n { font: var(--f-code-lg); font-variant-numeric: tabular-nums; }
.version__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.version__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.version__flag { display: inline-flex; align-items: center; gap: 6px; font: var(--f-small); color: var(--warn); }
@media (max-width: 640px) { .version { grid-template-columns: 44px 1fr; } .version__actions { grid-column: 2; } }

.works { display: grid; grid-template-columns: 1fr 120px 160px; gap: 6px 16px; align-items: center; padding: 12px 14px; }
.works__file { font: 600 14px/20px var(--ff); overflow-wrap: anywhere; }
.works__offset { font: var(--f-code); font-variant-numeric: tabular-nums; }
.works__count { display: inline-flex; align-items: center; gap: 5px; font: var(--f-small); color: var(--fg-2); }
.works__count .icon { color: var(--ok); }
@media (max-width: 640px) { .works { grid-template-columns: 1fr auto; } .works__count { grid-column: 1 / -1; } }

/* ---------- Notices, empty states, loading, toast ---------- */

.notice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--radius); font: var(--f-small); background: var(--chip); }
.notice > .icon { margin-top: 2px; color: var(--fg-2); }
.notice--warn { background: var(--warn-bg); }
.notice--warn > .icon { color: var(--warn); }
.notice--bad { background: var(--bad-bg); }
.notice--bad > .icon { color: var(--bad); }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 20px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--radius-lg);
}
.empty > .icon { color: var(--fg-3); }
.empty__title { font: var(--f-h3); }
.empty__text { font: var(--f-small); color: var(--fg-2); max-width: 44ch; text-wrap: pretty; }

.skeleton { display: block; height: 12px; border-radius: var(--radius); background: var(--chip); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.htmx-swapping, [aria-busy="true"] > .results { opacity: .5; transition: opacity .15s; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }

.toast-region { position: fixed; z-index: 50; inset-inline: 0; bottom: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding-inline: 16px; }
.toast {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 14px;
  border-radius: var(--radius); background: rgba(26, 35, 43, .94); color: #fff; font: 600 13px/18px var(--ff);
}
.toast > .icon { color: var(--ok-solid); }
.toast--error > .icon { color: #e57f7f; }
.toast a { color: #b8cee0; }
.toast form { display: contents; }
.toast__action { margin-inline-start: 6px; padding: 4px 6px; border: 0; background: none; color: #b8cee0; font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase; cursor: pointer; }
.toast__action:hover { color: #fff; }

.ad-slot {
  align-self: center; display: flex; align-items: center; justify-content: center; width: 100%; max-width: 728px; height: 90px;
  border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--fg-3);
  font: var(--f-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
@media (max-width: 640px) { .ad-slot { max-width: 320px; height: 100px; } }

/* ---------- Caption box and video frame (dark in both themes) ---------- */

.caption {
  display: inline-block; background: var(--caption); color: #fff; padding: 3px 14px; border-radius: var(--radius);
  font: 600 clamp(18px, 1vw + 12px, 24px)/1.35 var(--ff);
}
.frame {
  position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: var(--radius); background: var(--frame);
  display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 8%;
}
.frame__tc {
  position: absolute; top: 10px; inset-inline-start: 10px; padding: 3px 7px; border-radius: var(--radius);
  background: rgba(7, 9, 11, .7); color: #b8cee0; font: var(--f-micro); font-variant-numeric: tabular-nums; letter-spacing: var(--tracking-caps);
}
.frame .caption { font: 600 16px/1.45 var(--ff); padding: 3px 10px; }

/* ---------- Video drop zone (home, variant b stacked) ---------- */

.dz {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 32px; padding: 18px;
  background: var(--panel); border: 1.5px dashed var(--line-2); border-radius: var(--radius-lg);
}
.dz[data-state="drag"] { border: 2px solid var(--accent); }
.dz[data-state="error"] { border: 1px solid var(--bad); }
.dz[data-state="hashing"], .dz[data-state="results"], .dz[data-state="nomatch"] { border: 1px solid var(--line); }
.dz__side { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; }
.dz__side [hidden] { display: none; }
.dz__captions { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.dz__file { font: 600 16px/22px var(--ff); color: var(--fg); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz__bar { position: relative; width: 100%; height: 14px; border-radius: var(--radius); background: var(--chip); overflow: hidden; }
.dz__bar::before, .dz__bar::after { content: ""; position: absolute; inset-block: 0; width: 3%; background: var(--accent); }
.dz__bar::before { inset-inline-start: 0; }
.dz__bar::after { inset-inline-end: 0; }
.dz__title { font: 600 18px/26px var(--ff); display: flex; align-items: center; gap: 8px; }
.dz__title .icon { color: var(--bad); }
.dz__text { font: 400 14px/21px var(--ff); color: var(--fg-2); }
.receipt { display: flex; flex-direction: column; background: var(--field); border: 1px solid var(--line); border-radius: var(--radius); }
.receipt__head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--fg-2); font: var(--f-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.receipt__head .icon { color: var(--ok); }
.receipt__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); }
.receipt__row dt { font: 500 13px/18px var(--ff); color: var(--fg-2); }
.receipt__row dd { font: var(--f-code); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--fg); }
.receipt__row dd:empty::before { content: "—"; color: var(--fg-3); }
.receipt__foot { padding: 10px 14px; border-top: 1px solid var(--line); font: 500 12px/17px var(--ff); color: var(--fg-3); }
.dz-results { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.dz-results__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 16px; }
.dz-results__head p:first-child { font: 600 15px/22px var(--ff); }
.dz-results__head p:last-child { font: 500 12px/16px var(--ff); color: var(--fg-3); }
.dz-results .rows { border-radius: 0; }

/* ---------- Home ---------- */

.home-hero { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: stretch; }
.way { display: flex; flex-direction: column; gap: 10px; }
.way__label { display: flex; align-items: center; gap: 8px; color: var(--fg-2); font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.way__card { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: clamp(18px, 2.2vw, 28px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.promo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.promo img { width: 32px; height: 32px; }
.promo p { flex: 1 1 300px; font: 500 14px/20px var(--ff); color: var(--fg-2); }
.promo b { color: var(--fg); }
.promo a { font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg); }

/* ---------- Search ---------- */

.search-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.search-top > .searchbox { flex: 1 1 420px; }
.results { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.results__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

/* Search: filter sidebar (a "Filters" button on phones), title cards, a title's page. */
.search-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.search-layout--start { grid-template-columns: minmax(0, 1fr); }
.filters__toggle { list-style: none; }
.filters__toggle::-webkit-details-marker { display: none; }
.filters__body { display: flex; flex-direction: column; gap: 22px; }
.facet { display: flex; flex-direction: column; gap: 2px; }
.facet legend { margin-bottom: 6px; font: var(--f-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-2); }
.facet__option { display: flex; align-items: center; gap: 10px; min-height: 32px; font: var(--f-small); color: var(--fg); cursor: pointer; }
.facet__option input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.facet__option > span:first-of-type { flex: 1; min-width: 0; }
.facet__count { font: 500 12px/1 var(--ff); font-variant-numeric: tabular-nums; color: var(--fg-3); }
.facet__more > summary { min-height: 32px; display: flex; align-items: center; font: var(--f-small); color: var(--fg-2); cursor: pointer; }
@media (min-width: 900px) { .filters__toggle { display: none; } }
@media (max-width: 899px) {
  .search-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .filters[open] > .filters__body { padding: 14px; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
}
.title-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 8px; }
.title-card {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; color: var(--fg); text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.title-card:hover { background: var(--panel-2); color: var(--fg); }
.title-card__thumb, .group-head__thumb {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 96px; aspect-ratio: 16 / 9;
  border-radius: var(--radius); background: var(--frame); color: #8b9cad;
}
.title-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.title-card__text b { font: 600 14px/20px var(--ff); }
.title-card__text span { font: var(--f-small); color: var(--fg-3); }
.title-card > .icon { color: var(--fg-3); }
.group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.group-head__thumb { width: 160px; }
.episodes { display: grid; grid-template-columns: repeat(auto-fill, 56px); gap: 6px; }
.episode {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 48px;
  border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--fg); text-decoration: none; font: 700 13px/1 var(--ff);
}
.episode span { font: 500 10px/1 var(--ff); color: var(--fg-3); }
.episode:hover { background: var(--chip); color: var(--fg); }
.episode.is-empty { color: var(--fg-3); }
.episode.is-current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.episode.is-current span { color: inherit; }
.lang-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: var(--f-h3); }
.lang-head__n { font: 500 13px/1 var(--ff); color: var(--fg-3); }

/* ---------- Asset page (layout 2a) ---------- */

.asset-hero { position: relative; min-height: 380px; display: flex; align-items: flex-end; background: var(--frame); overflow: hidden; color: #fff; }
.asset-hero__still { position: absolute; inset: 0; background-size: cover; background-position: center; filter: grayscale(1); }
.asset-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 9, 11, .15) 0, rgba(7, 9, 11, .55) 55%, rgba(7, 9, 11, .94) 100%); }
.asset-hero__credit { position: absolute; z-index: 1; top: 14px; inset-inline-end: var(--gutter); color: rgba(255, 255, 255, .7); font: var(--f-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.asset-hero__inner { position: relative; z-index: 1; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 28px var(--gutter) 24px; display: flex; flex-direction: column; gap: 12px; }
.asset-hero__badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.asset-hero__lang { font: 600 13px/1 var(--ff); color: #b8cee0; }
.asset-hero .badge--flag { border-color: rgba(255, 255, 255, .3); color: #b8cee0; }
.asset-hero .badge--public { background: rgba(85, 212, 63, .18); color: #6be052; }
.asset-hero .badge--unlisted { background: rgba(184, 206, 224, .14); color: #b8cee0; }
.asset-hero .badge--restricted { background: rgba(231, 185, 94, .18); color: #e7b95e; }
.asset-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font: var(--f-small); color: #b8cee0; }
.asset-hero__meta a { color: #b8cee0; }
.asset-hero__owner { display: inline-flex; align-items: center; gap: 6px; color: #fff !important; font-weight: 700; text-decoration: none; }
.asset-hero .rating { color: #fff; }
.asset-hero .rating .icon { color: #b8cee0; }
.asset-hero .rating__count { color: #b8cee0; }
@media (max-width: 640px) { .asset-hero { min-height: 300px; } }

/* ---------- Auth (login, welcome) ---------- */

.auth-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); background: var(--chrome); }
.auth-card { display: flex; flex-direction: column; gap: 24px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
@media (max-width: 640px) { .auth-card { padding: 20px; } }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 48px; border-radius: var(--radius);
  background: #fff; color: #1f1f1f; border: 1px solid #747775; font: 600 15px/1 var(--ff); cursor: pointer;
}
.google-btn:hover { background: #f8f9fa; }
.lang-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.lang-list li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 6px 0 10px; border-top: 1px solid var(--line); }
.lang-list li:first-child { border-top: 0; }
.lang-list__grip { color: var(--fg-3); cursor: grab; }
.lang-list__n { flex: none; width: 18px; font: var(--f-micro); font-variant-numeric: tabular-nums; color: var(--fg-3); }
.lang-list__name { flex: 1; font: 600 14px/1.3 var(--ff); }
.lang-list .btn--icon { color: var(--fg-2); }
.lang-list__add { padding-inline: 10px 6px; gap: 8px; }
.lang-list__add .select { min-height: var(--h-default); font-size: 14px; }

/* ---------- Settings, content pages, errors ---------- */

.with-nav { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  flex: none; display: flex; align-items: center; gap: 10px; height: var(--h-action); padding: 0 12px; border-radius: var(--radius); white-space: nowrap;
  color: var(--fg-2); text-decoration: none; font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.side-nav a:hover { color: var(--fg); }
.side-nav a[aria-current="page"] { background: var(--chip); color: var(--fg); }
.settings-body { display: flex; flex-direction: column; gap: 28px; min-width: 0; max-width: 680px; }
@media (max-width: 760px) {
  .with-nav { grid-template-columns: 1fr; }
  .side-nav { flex-direction: row; overflow-x: auto; border-bottom: 1px solid var(--line); }
}

.doc { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: block; padding: 6px 10px; border-inline-start: 2px solid var(--line); color: var(--fg-2); font: 500 13px/1.4 var(--ff); text-decoration: none; }
.toc a:hover { color: var(--fg); border-inline-start-color: var(--accent); }
@media (max-width: 760px) { .doc { grid-template-columns: 1fr; } .toc { display: none; } }
.article { display: flex; flex-direction: column; gap: 18px; max-width: 68ch; min-width: 0; }
.prose { display: flex; flex-direction: column; gap: 18px; }
.prose > p:first-child { font: 400 18px/1.65 var(--ff); color: var(--fg-2); text-wrap: pretty; }
.prose h2 { font: var(--f-h2); padding-top: 12px; }
.prose h3 { font: var(--f-h3); padding-top: 8px; }
.prose p, .prose li { font: 400 16px/1.7 var(--ff); text-wrap: pretty; }
.prose ul, .prose ol { display: flex; flex-direction: column; gap: 8px; padding-inline-start: 20px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose a { color: var(--fg); }
.prose strong { font-weight: 600; }
.prose code { font: var(--f-code); font-variant-numeric: tabular-nums; }
.prose pre { padding: 14px 16px; border-radius: var(--radius); background: var(--field); border: 1px solid var(--line); font: var(--f-code); white-space: pre-wrap; }
.prose blockquote { padding: 12px 16px; border-inline-start: 2px solid var(--accent); background: var(--chip); color: var(--fg-2); }
.prose blockquote p { font: 400 15px/1.6 var(--ff); }
.prose table { border-collapse: collapse; width: 100%; font: var(--f-small); }
.prose th, .prose td { text-align: start; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--fg-2); font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase; }

.error-page { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 40px 0; text-align: center; }
.error-page .frame { max-width: 560px; }
.error-page p.lead { color: var(--fg-2); max-width: 56ch; text-wrap: pretty; }
@media (max-width: 640px) { .error-page { padding: 16px 0; } }

/* ---------- Library, inbox, profiles ---------- */

.lib-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 130px 96px 36px; gap: 6px 16px; align-items: center; padding: 12px 14px; }
.lib-row__title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.lib-row__title > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lib-row__title a { font: 600 14px/20px var(--ff); color: var(--fg); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-row .badge { justify-self: start; }
@media (max-width: 760px) { .lib-row { grid-template-columns: minmax(0, 1fr) auto; } .lib-row__wide { display: none; } }

.inbox { max-width: 880px; }
.note { display: flex; gap: 12px; padding: 14px; }
.note--unread { background: var(--chip); }
.note__dot { flex: none; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; }
.note--unread .note__dot { background: var(--accent); }
.note__tile { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius); background: var(--field); color: var(--fg-2); }
.note__tile--bad { background: var(--bad-bg); color: var(--bad); }
.note__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; font: var(--f-small); }
.note__body b { font-weight: 700; }
.note__why { padding: 8px 10px; border-radius: var(--radius); background: var(--chip); color: var(--fg-2); }
.note__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.inbox__unread { margin-inline-start: 10px; font: var(--f-small); color: var(--fg-3); }

.profile-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.profile-head__body { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
.profile-grid--group { grid-template-columns: minmax(0, 1fr) 300px; }
.member { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.member a { flex: 1; font: 600 14px/20px var(--ff); color: var(--fg); text-decoration: none; }
@media (max-width: 760px) { .profile-grid--group { grid-template-columns: 1fr; } .avatar--profile { width: 64px; height: 64px; } }

/* ---------- Dialogs ---------- */

.dialog { padding: 0; width: min(560px, calc(100vw - 32px)); color: var(--fg); background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--radius-lg); }
.dialog::backdrop { background: var(--scrim); }
.dialog--inline { position: static; display: block; margin: 0; }
.dialog__bar { display: flex; align-items: center; gap: 12px; min-height: 44px; padding-inline: 16px 4px; background: var(--raised-bar); }
.dialog__bar h2 { flex: 1; font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-2); }
.dialog__body { display: flex; flex-direction: column; gap: 16px; padding: 20px 16px; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; background: var(--raised-bar); }
@media (max-width: 640px) {
  .dialog { width: 100vw; max-width: none; margin: auto 0 0; border-end-start-radius: 0; border-end-end-radius: 0; }
}

/* ---------- Share dialog, people lists, groups ---------- */

.dialog--share { width: min(580px, calc(100vw - 32px)); }
.dialog--share .vis-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.dialog--inline.dialog--share { width: 100%; max-width: 580px; margin-inline: auto; }
@media (min-width: 641px) { dialog.dialog--share { margin-block-start: 120px; } }
@media (max-width: 640px) { .dialog--share { width: 100vw; } }
.share-label { font: var(--f-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-2); padding: 0; margin-bottom: 2px; }
.share-status { display: flex; align-items: center; gap: 8px; font: var(--f-small); color: var(--fg-2); }
.share-status > .icon { color: var(--ok); }
.share-add { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.share-add__field { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.share-add .filterbox { flex: none; }
.share-add .select { min-height: var(--h-action); }

.confirm-box { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--warn); border-radius: var(--radius-lg); background: var(--warn-bg); }
.confirm-box__head { display: flex; gap: 10px; }
.confirm-box__head > .icon { flex: none; margin-top: 2px; color: var(--warn); }
.confirm-box__title { font: 600 14px/20px var(--ff); }
.confirm-box__indent { padding-inline-start: 26px; }

.person, .member-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 36px; gap: 12px; align-items: center; padding: 8px 6px 8px 12px; }
.member-row { grid-template-columns: 32px minmax(0, 1fr) auto auto; padding-inline-end: 8px; }
.person__who { min-width: 0; display: flex; flex-direction: column; }
.person__who > :first-child { font: 600 14px/20px var(--ff); color: var(--fg); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__sub { font: 400 12px/16px var(--ff); color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__level { padding-inline: 8px; font: 500 13px/1 var(--ff); color: var(--fg-2); }
.select--quiet { min-height: 32px; padding-block: 0; padding-inline: 8px 26px; border-color: transparent; background: transparent; font: 500 13px/1 var(--ff); color: var(--fg-2); }
.select--quiet:hover { background: var(--chip); }
.select-wrap--quiet > .icon { inset-inline-end: 8px; }
.avatar--40 { width: 40px; height: 40px; font-size: 14px; }
.chip-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--h-dense); padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius); font: 600 13px/1 var(--ff); color: var(--fg); text-decoration: none;
}
.chip-link:hover { background: var(--chip); }
.btn--bad-text, .btn--bad-text:hover { color: var(--bad); }
@media (max-width: 520px) { .member-row { gap: 8px; } .member-row .btn--sm .icon { display: none; } }

/* ---------- Wizard stepper and validation report ---------- */

.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.step { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 3px solid var(--line-2); color: var(--fg-3); font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase; }
.step__n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: var(--radius); border: 1px solid var(--line-2); font: var(--f-micro); }
.step--done, .step[aria-current="step"] { border-top-color: var(--accent); color: var(--fg); }
.step--done .step__n, .step[aria-current="step"] .step__n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.report { display: flex; flex-direction: column; gap: 10px; }
.problem { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 14px 16px; border-radius: var(--radius-lg); border: 1px solid var(--line-2); }
.problem--block { border-color: var(--bad); background: var(--bad-bg); }
.problem--block > .icon { color: var(--bad); }
.problem--warn { border-color: var(--warn); background: var(--warn-bg); }
.problem--warn > .icon { color: var(--warn); }
.problem__title { font: 600 14px/20px var(--ff); }
.problem__text { font: var(--f-small); color: var(--fg-2); }
.quality { display: grid; grid-template-columns: 18px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 14px; font: var(--f-small); }
.quality > .icon { color: var(--fg-3); }
.quality--ok > .icon { color: var(--ok); }

/* ---------- Design system page ---------- */

.ds-section { display: flex; flex-direction: column; gap: 16px; padding-block: 28px; border-bottom: 1px solid var(--line); }
.narrow-ds { max-width: 560px; }
.ds-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ds-icon { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 104px; padding: 16px 4px 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); font: 500 11px/14px var(--ff); color: var(--fg-3); }
.ds-icon .icon { color: var(--fg); }

/* ---------- Upload wizard ---------- */

.page--wizard { max-width: 960px; --page-pad-top: 36px; }
.wizard-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.wizard-step { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--fg-3); }
.wizard-step__bar { height: 3px; border-radius: var(--radius); background: var(--line-2); }
.wizard-step__label { display: flex; align-items: center; gap: 8px; font: var(--f-label); letter-spacing: var(--tracking-caps); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wizard-step__n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: var(--radius); background: var(--chip); color: var(--fg-3); font: var(--f-micro); }
.wizard-step.is-done, .wizard-step.is-current { color: var(--fg-2); }
.wizard-step.is-current { color: var(--fg); }
.wizard-step.is-done .wizard-step__bar, .wizard-step.is-current .wizard-step__bar { background: var(--accent); }
.wizard-step.is-done .wizard-step__n, .wizard-step.is-current .wizard-step__n { background: var(--accent); color: var(--on-accent); }

.dropfile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 320px;
  padding: 32px 20px; border: 1.5px dashed var(--line-2); border-radius: var(--radius-lg); background: var(--panel); text-align: center;
}
.dropfile > .icon { color: var(--fg-2); }
.dropfile.is-over { border: 2px solid var(--accent); }
.filecard { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.filecard > .icon { color: var(--fg-2); }
.filecard__body { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.filecard__name { font: 600 14px/20px var(--ff); overflow-wrap: anywhere; }

.detected { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px; }
/* The editor's labeled field: caps label above the value, inside one box. */
.lfield { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 8px 12px 10px; background: var(--field); border: 1px solid var(--line-2); border-radius: var(--radius); }
.lfield__label { font: var(--f-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-3); }
.lfield__value { font: 600 14px/20px var(--ff); }
.lfield--select select { appearance: none; width: 100%; padding: 0 20px 0 0; border: 0; background: transparent; color: var(--fg); font: 600 14px/20px var(--ff); cursor: pointer; }
.lfield--select > .icon { position: absolute; inset-inline-end: 12px; bottom: 14px; color: var(--fg-2); pointer-events: none; }
.lfield:focus-within { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }

.preview-line { display: grid; grid-template-columns: 230px 1fr; gap: 4px 16px; padding: 8px 14px; }
.preview-line__t { font: var(--f-code); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--fg-3); padding-top: 2px; white-space: nowrap; }
.preview-line__x { font: var(--f-line); white-space: pre-line; }
.preview-line--ad { background: var(--warn-bg); }
.preview-line--ad .preview-line__x { color: var(--warn); text-decoration: line-through; }
@media (max-width: 640px) { .preview-line { grid-template-columns: 1fr; } }

.badge--block { background: var(--bad-bg); color: var(--bad); }
.issue { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-lg); }
.issue > .icon { margin-top: 1px; color: var(--ok); }
.issue--block { border-color: var(--bad); background: var(--bad-bg); }
.issue--block > .icon { color: var(--bad); }
.issue--warn { border-color: var(--warn); background: var(--warn-bg); }
.issue--warn > .icon { color: var(--warn); }
.issue__body { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.issue__title { font: 600 14px/20px var(--ff); }
.issue__text { font: var(--f-small); color: var(--fg-2); text-wrap: pretty; }
.quality-row { display: grid; grid-template-columns: 180px 1fr; gap: 4px 14px; align-items: center; padding: 10px 14px; }
.quality-row__title { display: inline-flex; align-items: center; gap: 8px; font: 600 14px/20px var(--ff); }
.quality-row--ok .icon { color: var(--ok); }
.quality-row--warn .icon { color: var(--warn); }
.quality-row--info .icon { color: var(--fg-3); }
@media (max-width: 640px) { .quality-row { grid-template-columns: 1fr; } }
.suggestion { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--line-2); background: var(--chip); border-radius: var(--radius-lg); }
.suggestion > .icon { color: var(--fg-2); }
.suggestion > p { flex: 1 1 260px; }

.wizard-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.wizard-foot__buttons { display: flex; gap: 8px; }
@media (max-width: 640px) { .wizard-foot__buttons { flex: 1 1 100%; } .wizard-foot__buttons .btn { flex: 1; } }
.btn--disabled { background: var(--chip); color: var(--fg-3); border-color: var(--line-2); opacity: 1; }

.form-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid4 { grid-template-columns: 1fr; } .span-2, .span-4 { grid-column: auto; } }
.field__optional { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--fg-3); }
.title-field { position: relative; }
.title-suggestions { display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; }
/* After the rule above (same specificity). :empty would miss whitespace-only fragments. */
.title-suggestions:not(:has(*)) { display: none; }
.title-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--fg); font: 600 14px/20px var(--ff); text-align: start; cursor: pointer; }
.title-option:first-child { border-top: 0; }
.title-option:hover, .title-option:focus-visible { background: var(--chip); }
.title-option small { font: var(--f-small); color: var(--fg-3); }
.title-option--new { font: var(--f-small); color: var(--fg-2); }

.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented__item, .choice-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--fg-2); font: 600 14px/1 var(--ff); cursor: pointer; }
.choice-chip { min-height: 44px; padding: 0 14px 0 8px; color: var(--fg); }
.segmented__item input, .choice-chip input, .vis-card input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__item:has(input:checked), .choice-chip:has(input:checked) { border-color: var(--accent); background: var(--chip); color: var(--fg); }
.segmented__item:has(input:focus-visible), .choice-chip:has(input:focus-visible), .vis-card:has(input:focus-visible) { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
.checkbox--described { align-items: flex-start; min-height: 40px; padding-top: 8px; }
.checkbox--described > span { display: flex; flex-direction: column; gap: 2px; }
.checkbox--described b { font: 600 14px/20px var(--ff); color: var(--fg); }

.vis-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.vis-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 12px 36px; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: pointer; }
.vis-card::before { content: ""; position: absolute; top: 14px; inset-inline-start: 12px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-2); box-sizing: border-box; }
.vis-card:has(input:checked) { border-color: var(--accent); background: var(--chip); }
.vis-card:has(input:checked)::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 3.5px, transparent 4px); }
[dir="rtl"] .vis-card { padding: 12px 36px 12px 12px; }
.vis-card__head { display: flex; align-items: center; gap: 8px; font: 600 14px/20px var(--ff); }
.vis-card__text { font: 400 12px/17px var(--ff); color: var(--fg-3); }
.icon.ok { color: var(--ok); }
.icon.warn { color: var(--warn); }
.summary-card { padding: 16px; }

/* Published screen */
.published { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 48px 0; text-align: center; }
.published__tile { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--radius-lg); background: var(--ok-bg); color: var(--ok); }
.published .share-field { width: 100%; max-width: 640px; }
.published__downloads { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 14px; font: var(--f-small); color: var(--fg-3); }
.published__downloads a { font: var(--f-code); font-size: 12px; }

/* ---------- Rate dialog ---------- */

.dialog--rate { width: min(520px, calc(100vw - 32px)); }
.dialog--inline.dialog--rate { width: 100%; max-width: 520px; margin-inline: auto; }
@media (max-width: 640px) { .dialog--rate { width: 100vw; } }
/* Stars come in reverse order (5 → 1) so "this star and the ones before it" is a ~ sibling selector;
   row-reverse puts 1 first again, in either direction. */
.stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.stars__input { position: absolute; opacity: 0; pointer-events: none; }
.stars__star { display: inline-flex; padding: 4px; border-radius: var(--radius); color: var(--line-2); cursor: pointer; }
.stars__star .icon { width: 28px; height: 28px; }
.stars__input:checked ~ .stars__star, .stars__star:hover, .stars__star:hover ~ .stars__star { color: var(--accent); }
.stars:hover .stars__input:checked ~ .stars__star:not(:hover):not(:hover ~ .stars__star) { color: var(--line-2); }
.stars__input:focus-visible + .stars__star { outline: var(--focus-width) solid var(--accent); outline-offset: 0; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip { position: relative; display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius); font: 600 13px/1 var(--ff); color: var(--fg-2); cursor: pointer; }
.tag-chip input { position: absolute; opacity: 0; pointer-events: none; }
.tag-chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tag-chip:has(input:focus-visible) { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
.rate-panel__remove { margin-inline-end: auto; }

/* ---------- Video picker ("works with my file", upload step 2) ---------- */

.video-pick__box { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); }
.video-pick__icon { flex: none; display: inline-flex; padding-top: 2px; color: var(--fg-2); }
.video-pick__body { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.video-pick__status { font: 600 14px/20px var(--ff); overflow-wrap: anywhere; }
.video-pick__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.works-head { display: flex; flex-direction: column; gap: 12px; }
.works-confirm { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Signing in from Subtitld ---------- */

.consent__head { display: flex; align-items: flex-start; gap: 14px; }
.consent__icon { flex: none; border-radius: var(--radius-lg); }
.consent__scope { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.consent__scope > .icon { flex: none; margin-top: 2px; color: var(--fg-2); }
.consent__scope b { font: 600 14px/20px var(--ff); }
.consent__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
@media (max-width: 640px) { .consent__actions { flex-direction: column-reverse; } .consent__actions .btn { width: 100%; } }
.device-code {
  width: 100%; height: 64px; padding: 0 16px; text-align: center; text-transform: uppercase;
  font: 600 28px/1 var(--ff); letter-spacing: .3em; font-variant-numeric: tabular-nums;
  background: var(--field); color: var(--fg); border: 1px solid var(--line-2); border-radius: var(--radius);
}
.device-code[aria-invalid="true"] { border-color: var(--bad); }
.device-code:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
.device-code::placeholder { color: var(--fg-3); }
.link-button { padding: 0; border: 0; background: none; color: var(--fg-2); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-button:hover { color: var(--fg); }

/* ---------- Moderation, legal forms, account ---------- */

.form-panel { padding: 20px; margin-top: 32px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.form-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.lang-switch a { margin-inline-start: 4px; }
.lang-switch a[aria-current="page"] { color: var(--fg); text-decoration: none; }
.decision { display: flex; flex-direction: column; gap: 8px; }
.decision > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; }
.decision dt { font: var(--f-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-3); padding-top: 3px; }
.decision dd { margin: 0; font: var(--f-small); }
@media (max-width: 520px) { .decision > div { grid-template-columns: 1fr; gap: 2px; } }
.keep-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.keep-list li { display: flex; align-items: flex-start; gap: 8px; font: var(--f-small); }
.keep-list .icon { flex: none; margin-top: 3px; color: var(--fg-3); }
.danger-zone > summary { list-style: none; width: fit-content; }
.danger-zone > summary::-webkit-details-marker { display: none; }
.danger-zone[open] > summary { margin-bottom: 14px; }
.notice-page .list { background: var(--panel); }
.chip-link.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---------- Staff area ---------- */

.staff-header { display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); background: var(--chrome); }
.staff-search { flex: 0 1 420px; height: var(--h-default); margin-inline-start: auto; }
.staff { display: grid; grid-template-columns: 200px minmax(0, 1fr); flex: 1; }
.staff-nav { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; border-inline-end: 1px solid var(--line); }
.staff-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--radius); color: var(--fg-2); text-decoration: none; font: 600 13px/18px var(--ff); }
.staff-nav a:hover { color: var(--fg); background: var(--chip); }
.staff-nav a[aria-current="page"] { color: var(--fg); background: var(--chip); }
.staff-nav__n { font: 700 11px/1 var(--ff); color: var(--warn); }
.staff-nav__out { margin-top: 16px; justify-content: flex-start !important; color: var(--fg-3) !important; }
.staff-main { padding: 24px 28px 48px; min-width: 0; }
@media (max-width: 860px) {
  .staff { grid-template-columns: 1fr; }
  .staff-nav { flex-direction: row; overflow-x: auto; border-inline-end: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .staff-main { padding: 16px; }
  .staff-header .badge { display: none; }
}
.staff-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.staff-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--fg); text-decoration: none; }
.staff-stat__n { font: 600 28px/1.1 var(--ff); font-variant-numeric: tabular-nums; }
.staff-table { width: 100%; border-collapse: collapse; font: var(--f-small); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.staff-table th { position: sticky; top: 0; padding: 8px 10px; text-align: start; background: var(--raised-bar); font: var(--f-micro); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--fg-2); }
.staff-table td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.staff-table a { color: var(--fg); }
.nowrap { white-space: nowrap; }
.staff-card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.staff-card__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.staff-quote { margin: 0; padding: 10px 14px; border-inline-start: 3px solid var(--accent); background: var(--chip); border-radius: var(--radius); font: var(--f-small); }
.staff-lines { max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); font: var(--f-small); }
.staff-lines li { display: grid; grid-template-columns: 56px 110px minmax(0, 1fr); gap: 10px; padding: 4px 10px; border-top: 1px solid var(--line); }
.staff-lines li:first-child { border-top: 0; }
.staff-action { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.staff-action__reason, .staff-action__who { grid-column: 1 / -1; }
.staff-action > .btn { justify-self: start; }
@media (max-width: 640px) { .staff-action { grid-template-columns: 1fr; } }
