/* ===== Auth (login / 2FA) ================================================= */
.page-auth { min-height: 100vh; min-height: 100dvh; }
.auth-theme-toggle {
  position: fixed;
  top: var(--sp-4); right: var(--sp-4);
  z-index: var(--z-sticky);
}
.auth-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--sp-6);
}
.auth-card {
  width: min(440px, 100%);
  padding: clamp(24px, 4vw, 38px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: var(--sp-5);
}
.auth-head { display: grid; gap: var(--sp-2); }
.auth-title { font-size: clamp(24px, 4vw, 30px); margin: 0; }
.auth-subtitle { margin: 0; color: var(--text-muted); line-height: 1.55; }
.login-submit { margin-top: var(--sp-1); }
.auth-foot { margin: 0; font-size: 12px; color: var(--text-subtle); text-align: center; }
.auth-foot a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .auth-foot a:hover { color: var(--text); } }
.auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
@media (hover: hover) and (pointer: fine) { .auth-back:hover { color: var(--text); } }
.auth-back-link {
  display: inline-block; margin-top: var(--sp-3);
  text-align: center; font-size: 13px; color: var(--text-muted);
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) { .auth-back-link:hover { color: var(--text); } }

/* ---- Account chooser (login page) ---------------------------------------- */
.account-chooser { display: grid; gap: var(--sp-2); margin-top: var(--sp-2); }
.account-chooser__item-form { margin: 0; }
.account-chooser__item {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: 58px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text); text-align: left; cursor: pointer;
  transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .account-chooser__item:hover { border-color: var(--accent-border); background: var(--surface-2, var(--surface-3)); } }
.account-chooser__avatar {
  flex: 0 0 38px; width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-pill);
  background: linear-gradient(150deg, var(--accent-fill), var(--accent-fill-deep));
  color: var(--text-on-accent); font-weight: 700; font-size: 15px;
}
.account-chooser__email {
  flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account-chooser__chevron {
  flex: 0 0 18px; width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  color: var(--text-muted);
}
.account-chooser__add {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 50px; padding: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-1);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; color: var(--text);
  text-decoration: none; cursor: pointer;
  transition: border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .account-chooser__add:hover { border-color: var(--accent-border); color: var(--accent); } }
.account-chooser__add-icon {
  flex: 0 0 38px; width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--surface-3);
}
.account-chooser__add-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 2FA code entry */
.code-input-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(6px, 1.6vw, 12px);
}
.code-input-cell {
  width: 100%;
  min-height: 60px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-inset);
  color: var(--text);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.code-input-cell:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.code-input-cell.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.confirm-error { margin: 0; font-size: 13px; color: var(--danger-text); min-height: 18px; }
.confirm-secondary { display: grid; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--border); }
.confirm-spam-note { margin: 0; font-size: 12px; color: var(--text-subtle); }
.confirm-resend { display: flex; align-items: center; min-height: 20px; font-size: 13px; color: var(--text-muted); }
.confirm-resend a { color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .confirm-resend a:hover { text-decoration: underline; } }

@media (max-width: 560px) {
  .code-input-cell { min-height: 50px; font-size: 20px; }
}

/* ===== Error callout ====================================================== */
.error-callout {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--danger-soft);
  border: 1px solid var(--border);
}
.error-callout__title { color: var(--danger-text); font-size: 13px; }
.error-callout__body { white-space: pre-wrap; line-height: 1.5; color: var(--text); }

/* ===== Referrals ========================================================== */
.referrals-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
  align-items: stretch;
}
.referrals-program-card { display: grid; gap: var(--sp-3); align-content: start; }
.referrals-summary-card { display: flex; flex-direction: column; }
.referrals-summary-card .stat-card__value { margin-top: var(--sp-2); }
.referrals-summary-card .stat-card__note { margin-top: auto; padding-top: var(--sp-2); }
.referrals-text { margin: 0; color: var(--text); line-height: 1.55; }
.referrals-text a { color: var(--accent); font-weight: 600; }
@media (max-width: 920px) {
  .referrals-grid { grid-template-columns: 1fr; }
}

/* ===== Legal ============================================================== */
.legal-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: var(--topbar-height);
  padding: 0 clamp(16px, 4vw, 48px);
  background: var(--surface-glass);
  backdrop-filter: blur(var(--material-thin-blur));
  -webkit-backdrop-filter: blur(var(--material-thin-blur));
  border-bottom: 1px solid var(--border);
}
.legal-layout { padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 48px); }
.legal-card {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 44px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-md);
}
.legal-card h1 { font-size: clamp(26px, 4vw, 36px); margin-bottom: var(--sp-2); }
.legal-updated { margin: 0 0 var(--sp-8); color: var(--text-subtle); font-size: 14px; }
.legal-block { margin-top: var(--sp-8); display: grid; gap: var(--sp-3); }
.legal-block h2 { font-size: clamp(19px, 2.4vw, 23px); }
.legal-block p, .legal-block li { color: var(--text-muted); line-height: 1.65; max-width: var(--prose-max); }
.legal-block ol, .legal-block ul { display: grid; gap: var(--sp-2); padding-left: var(--sp-5); }
.legal-block ol { list-style: decimal; }
.legal-block ul { list-style: disc; }
.legal-block li::marker { color: var(--text-subtle); }
.legal-block strong { color: var(--text); }
.legal-block a { color: var(--accent); text-underline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .legal-block a:hover { text-decoration: underline; } }

/* ===== Activities ========================================================= */
.activity-action, .activity-platform {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
  font-weight: 600;
  color: var(--text);
}
.activity-action__icon, .activity-platform__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  color: var(--text-muted);
}
.activity-action__icon svg, .activity-platform__icon svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.activity-action__label { min-width: 0; }
.activity-action--login .activity-action__icon { background: var(--success-soft); color: var(--success-text); }
.activity-action--logout .activity-action__icon { background: var(--surface-3); color: var(--text-muted); }
.activity-action--danger .activity-action__icon { background: var(--danger-soft); color: var(--danger-text); }
.activity-action--security .activity-action__icon { background: var(--info-soft); color: var(--info-text); }
.activity-action--payment .activity-action__icon { background: var(--warn-soft); color: var(--warn-text); }
.activity-action--settings .activity-action__icon { background: var(--purple-soft); color: var(--purple-text); }
.activity-platform--windows .activity-platform__icon { background: var(--info-soft); color: var(--info-text); }
.activity-platform--android .activity-platform__icon { background: var(--success-soft); color: var(--success-text); }
.activity-platform--unknown .activity-platform__icon { background: var(--surface-3); color: var(--text-muted); }

/* ===== Sessions =========================================================== */
.sessions-filter { margin-bottom: var(--sp-4); }
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: end; }
.filter-bar .form-item { flex: 1 1 220px; max-width: 320px; display: grid; gap: var(--sp-2); }
.filter-bar .form-item label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.filter-submit { align-self: end; min-width: 140px; }

.sessions-chart-panel { margin-bottom: var(--sp-4); }
.sessions-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.sessions-chart-head .panel-title { margin: 0; }
.sessions-chart-canvas-wrap {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface-inset);
  padding: var(--sp-2);
}
#sessionsSuccessChart { width: 100%; height: 200px; display: block; }
.sessions-chart-tooltip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 12px));
  pointer-events: none;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  min-width: 150px;
  padding: var(--sp-2) var(--sp-3);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 2px;
  z-index: 2;
}
.sessions-chart-tooltip[hidden] { display: none; }
.sessions-chart-tooltip strong { font-size: 16px; line-height: 1.1; color: var(--accent); }
.sessions-chart-tooltip span, .sessions-chart-tooltip em { font-style: normal; font-size: 11px; color: var(--text-muted); }

/* --- Level breakdown -------------------------------------------------------
   Per-session report of the levels that actually ran. It matters most for the
   Arena, where the line-up and the per-level minutes are assembled by the
   operator in a playlist and exist nowhere else after the session ends. */
/* One column wider than the shared default now that the level report is there */
.page-sessions .table-scroll table { min-width: 1010px; }

.quest-cell__text { display: inline-flex; flex-direction: column; gap: 2px; min-width: 0; }
.quest-playlist { font-size: 11px; color: var(--text-muted); }

.levels-toggle {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-out),
              border-color var(--dur-2) var(--ease-out),
              color var(--dur-2) var(--ease-out),
              background-color var(--dur-2) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .levels-toggle:hover { color: var(--text); border-color: var(--accent-border); } }
/* Feedback on the press itself, not on release */
.levels-toggle:active { transform: scale(0.96); }
.levels-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.levels-toggle__chevron {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform var(--dur-3) var(--ease-out);
}
tr.is-expanded .levels-toggle { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
tr.is-expanded .levels-toggle__chevron { transform: rotate(180deg); }

.table-scroll tbody tr.levels-row > td {
  padding: 0;
  background: var(--surface-inset);
}
.levels-panel { height: 0; overflow: hidden; opacity: 0; }
.levels-panel__inner { display: grid; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); }
.levels-panel__head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.levels-panel__head strong { font-size: 13px; }
.levels-panel__meta { color: var(--text-muted); font-size: 12px; }
.levels-panel__meta strong { color: var(--text); font-size: inherit; }
.levels-panel__empty { margin: 0; color: var(--text-muted); font-size: 13px; }

.level-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.level-item {
  display: grid;
  grid-template-columns: 20px minmax(140px, 1.2fr) minmax(60px, 2fr) auto 108px;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13px;
}
.level-item.is-skipped { opacity: 0.55; }
.level-item__order { color: var(--text-subtle); text-align: right; font-variant-numeric: tabular-nums; }
.level-item__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.level-item__bar { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.level-item__bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.level-item.is-skipped .level-item__bar i { background: var(--text-subtle); }
.level-item__time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.level-item__time em { font-style: normal; color: var(--text-subtle); }
.level-item__reason {
  justify-self: end;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.level-completed { background: var(--success-soft); color: var(--success-text); }
.level-admin { background: var(--info-soft); color: var(--info-text); }
.level-skipped { background: var(--surface-3); color: var(--text-subtle); }
.level-other { background: var(--surface-3); color: var(--text-muted); }

.level-item__restart-badge { margin-left: 4px; opacity: 0.8; }

.level-restarts {
  padding: 3px 12px 9px 44px;
  margin-top: -4px;
  border-radius: var(--r-sm);
  background: var(--surface-inset);
}
.level-attempts { list-style: none; margin: 0; padding: 0; position: relative; }
.level-attempts::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--border-strong);
}
.level-attempt {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  position: relative;
  padding: 5px 0 5px 19px;
  font-size: 12px;
}
.level-attempt__dot {
  position: absolute;
  left: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--text-subtle);
}
.level-attempt.is-final .level-attempt__dot { border-color: var(--accent); background: var(--accent); }
.level-attempt__index { flex: 0 0 66px; color: var(--text-subtle); }
.level-attempt.is-final .level-attempt__index { color: var(--text); font-weight: 600; }
.level-attempt__time { flex: 1 1 auto; color: var(--text-muted); white-space: nowrap; }
.level-attempt__reason {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* Per-player connected time and what it was billed at — see decodeSessionAttendance().
   Same grid rhythm as .level-item so the two lists in one disclosure panel read as one system. */
.attendance-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.attendance-item {
  display: grid;
  grid-template-columns: 56px minmax(60px, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13px;
}
.attendance-item__headset { color: var(--text-subtle); font-weight: 600; }
.attendance-item__time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.attendance-item__billed {
  justify-self: end;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--info-soft);
  color: var(--info-text);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.session-card-levels {
  list-style: none;
  margin: 0;
  padding: var(--sp-2) 0 0;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 4px;
}
.session-card-levels li { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: 12px; color: var(--text-muted); }
.session-card-levels li.is-skipped { opacity: 0.55; }

@media (prefers-reduced-motion: reduce) {
  .levels-toggle:active { transform: none; }
  .levels-toggle__chevron { transition: none; }
}

/* Custom date picker */
.custom-date-field { position: relative; }
.custom-date-field .input { cursor: pointer; }
.custom-date-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: var(--z-dropdown);
  width: 292px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-3);
}
.custom-date-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.custom-date-title { font-weight: 600; color: var(--text); }
.custom-date-nav {
  width: 30px; height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .custom-date-nav:hover { border-color: var(--accent-border); } }
.custom-date-weekdays, .custom-date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.custom-date-weekdays { margin-bottom: 6px; }
.custom-date-weekdays span { text-align: center; font-size: 11px; color: var(--text-subtle); }
.custom-date-day {
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .custom-date-day:hover { border-color: var(--accent-border); } }
.custom-date-day.muted { color: var(--text-subtle); opacity: 0.6; }
.custom-date-day.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); font-weight: 700; }
.custom-date-grid-month, .custom-date-grid-year { grid-template-columns: repeat(4, 1fr); }
.custom-date-cell {
  height: 36px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
@media (hover: hover) and (pointer: fine) { .custom-date-cell:hover { border-color: var(--accent-border); } }
.custom-date-cell.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }

@media (max-width: 760px) {
  .page-sessions .table-scroll { display: none; }
  .page-sessions .cards-mobile { display: grid; gap: var(--sp-3); padding: var(--sp-4); }
  .filter-bar .form-item { flex-basis: 100%; max-width: none; }
  .filter-submit { width: 100%; }
}

/* ===== Devices ============================================================ */
.headset-model-cell { display: inline-flex; align-items: center; gap: var(--sp-3); }
.headset-model-name { font-weight: 600; color: var(--accent); }
.headset-model-image { width: 44px; height: 44px; object-fit: contain; user-select: none; -webkit-user-drag: none; }
@media (hover: hover) and (pointer: fine) { .devices-table tbody tr:hover { background: var(--surface-3); } }

@media (max-width: 760px) {
  .page-devices .table-scroll { display: none; }
  .page-devices .cards-mobile {
    display: grid;
    gap: var(--sp-3);
    padding: var(--sp-4);
  }
  .page-devices .session-card .session-card-id { display: flex; gap: 6px; min-width: 0; }
  .page-devices .headset-id-mobile { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ===== Downloads ========================================================== */
.downloads-layout { display: grid; gap: var(--sp-8); }
.dl-page-head .page-title { margin: 0; }
.dl-beta-note { margin: var(--sp-3) 0 0; color: var(--text-secondary); font-size: 14px; max-width: 60ch; }

/* --- Sections -------------------------------------------------------------- */
.dl-section { display: grid; gap: var(--sp-5); }
.dl-section-head { display: flex; align-items: center; gap: var(--sp-4); }
.dl-step {
  flex: 0 0 40px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.dl-section-head h2 { margin: 0 0 2px; font-size: clamp(18px, 2vw, 22px); }
.dl-section-head p { margin: 0; color: var(--text-muted); font-size: 14px; }
.dl-duo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); align-items: start; }

/* --- Cards ------------------------------------------------------------------ */
.dl-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .dl-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-md); }
}
.dl-card-head { display: flex; align-items: flex-start; gap: var(--sp-4); }
.dl-card-titles { min-width: 0; }
.dl-card-titles h3 { margin: 0 0 4px; font-size: clamp(17px, 1.5vw, 20px); }
.dl-card-titles p { margin: 0; color: var(--text-muted); font-size: 14px; }
.dl-platform {
  display: inline-flex;
  margin-bottom: 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.dl-icon {
  flex: 0 0 56px;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  color: var(--accent);
}
.dl-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dl-features { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); align-content: start; }
.dl-feature { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text); line-height: 1.45; }
.dl-feature-icon { flex: 0 0 18px; display: grid; place-items: center; margin-top: 1px; }
.dl-feature-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.dl-feature.is-in .dl-feature-icon { color: var(--success); }
.dl-feature.is-note { color: var(--text-muted); }
.dl-feature.is-note .dl-feature-icon { color: var(--text-subtle); }
.dl-card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: var(--sp-4); margin-top: auto; }
.dl-card-foot--beta { border-top-style: dashed; margin-top: var(--sp-3); }
.dl-meta-pills { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.dl-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}
.dl-pill strong { color: var(--text); }
.dl-pill--beta { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }
.dl-btn { min-width: 170px; gap: 8px; }
.dl-release-note {
  border: 1px solid var(--border);
  background: var(--surface-3);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.dl-release-note summary {
  cursor: pointer;
  list-style: none;
  padding: var(--sp-3) var(--sp-4);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  user-select: none;
  display: flex; align-items: center; gap: 8px;
  transition: background var(--dur-2) var(--ease-out);
}
.dl-release-note summary::-webkit-details-marker { display: none; }
.dl-release-note summary::before {
  content: "";
  width: 7px; height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--dur-2) var(--ease-out);
  flex: 0 0 auto;
}
.dl-release-note[open] summary::before { transform: rotate(45deg); }
@media (hover: hover) and (pointer: fine) {
  .dl-release-note summary:hover { background: var(--surface-2); }
}
.dl-release-note p { margin: 0; padding: 0 var(--sp-4) var(--sp-3); color: var(--text-muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }

@media (max-width: 900px) { .dl-duo-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .dl-card-foot { flex-direction: column; align-items: stretch; }
  .dl-btn { width: 100%; }
}

/* ===== Finances =========================================================== */
.finance-summary-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: var(--sp-4); align-items: stretch; }
.finance-summary-card { display: flex; flex-direction: column; }
.finance-summary-card > .finance-summary-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--sp-3); }
.finance-summary-main { display: grid; gap: var(--sp-3); }
.finance-summary-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.finance-summary-label { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--text-muted); }
.finance-summary-note { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.45; }


.finance-topup-presets { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.finance-topup-preset {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600; font-size: 13px;
  cursor: pointer; white-space: nowrap;
  transition: border-color var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .finance-topup-preset:hover { border-color: var(--accent-border); background: var(--surface-3); } }


.finance-head { align-items: center; margin-bottom: var(--sp-4); }
.finance-stat { display: grid; gap: 2px; min-width: 0; }
.finance-stat__label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.finance-stat__value { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.finance-stat__value.is-negative { color: var(--danger-text); }
.finance-stat .finance-help__trigger { width: 18px; height: 18px; font-size: 11px; }
.finance-buy { margin-bottom: var(--sp-3); }
.finance-buy__form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
.finance-buy__main, .finance-buy__side { display: grid; gap: var(--sp-3); }
.finance-buy__price { margin: 0; font-size: 15px; color: var(--text-muted); }
.finance-buy__price strong { color: var(--text); font-size: 18px; }
.finance-buy .form-row { margin: 0; }
.finance-notice { margin: 0 0 var(--sp-3); padding: 10px 14px; border-radius: var(--r-md); background: var(--success-soft); color: var(--success-text); font-size: 14px; font-weight: 500; }
.finance-notice.is-error { background: var(--danger-soft); color: var(--danger-text); }
@media (max-width: 760px) { .finance-buy__form { grid-template-columns: 1fr; } }

.finance-help { position: relative; display: inline-flex; }
.finance-help__trigger {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.finance-help__panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: min(420px, calc(100vw - 48px));
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  color: var(--text-muted);
  font-size: 13px; line-height: 1.45;
  z-index: var(--z-dropdown);
  opacity: 0; transform: translateY(-6px);
  visibility: hidden; pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
}
.finance-help.is-open .finance-help__panel { opacity: 1; transform: translateY(0); visibility: visible; pointer-events: auto; transition-delay: 0s; }
.finance-help__panel a { color: var(--accent); }

.finance-amount-positive { color: var(--success-text); }
.finance-amount-negative { color: var(--danger-text); }

.site-legal-footer { margin-top: var(--sp-5); border-top: 1px solid var(--border); padding-top: var(--sp-4); }
.site-legal-footer__line { margin: 0; display: flex; justify-content: center; align-items: center; gap: var(--sp-2); flex-wrap: wrap; color: var(--text-subtle); font-size: 12px; }
.site-legal-footer__line a { color: var(--text-muted); }
@media (hover: hover) and (pointer: fine) { .site-legal-footer__line a:hover { color: var(--text); } }

.auth-legal-note { margin: 0; text-align: center; color: var(--text-subtle); font-size: 12px; line-height: 1.5; }
.auth-legal-note a { color: var(--text-muted); }
@media (hover: hover) and (pointer: fine) { .auth-legal-note a:hover { color: var(--text); } }

/* ===== Registration by invite ============================================= */
.auth-card--wide { width: min(640px, 100%); }
.register-section { display: grid; gap: var(--sp-3); margin: 0; padding: var(--sp-4) 0 0; border: 0; border-top: 1px solid var(--border); min-width: 0; }
.register-section__title { padding: 0; margin-bottom: var(--sp-1); font-size: 15px; font-weight: 600; color: var(--text); }
.register-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-4); align-items: start; }
.register-grid > .form-row { align-content: start; }
.register-points { display: grid; gap: var(--sp-2); }
.register-point { display: flex; align-items: center; gap: var(--sp-2); }
.register-point .input { flex: 1 1 auto; }
.register-point [data-point-remove][hidden], .register-add[hidden] { display: none; }
.register-add { justify-self: start; }
.register-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--text-muted); cursor: pointer; }
.register-check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.register-check a { color: var(--accent); }
.register-code { font-family: var(--font-mono); font-size: 22px; letter-spacing: 0.35em; text-align: center; }
.register-actions { display: flex; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.register-actions form { margin: 0; }
.register-required-note { margin: 0; }
.req { margin-left: 2px; color: var(--danger-text); font-weight: 600; }
.register-section .form-row { position: relative; }
.field-hint {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--text-subtle);
  font: 700 10px/1 var(--font-sans);
  vertical-align: 1px;
  cursor: help;
}
.field-hint::after {
  content: attr(data-hint);
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: var(--z-tooltip);
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), visibility var(--dur-2);
  pointer-events: none;
}
.field-hint:hover, .field-hint:focus-visible { color: var(--accent); border-color: var(--accent); }
.field-hint:hover::after, .field-hint:focus::after { opacity: 1; visibility: visible; transform: translateY(0); }
.field-error { margin: 0; color: var(--danger-text); font-size: 12px; line-height: 1.4; }
.input.is-invalid { border-color: var(--danger-text); }
@media (max-width: 560px) {
  .register-grid { grid-template-columns: 1fr; }
}


@media (max-width: 640px) {
  .page-finances .table-scroll table { min-width: 720px; }
}

/* Finances fills the viewport: the transactions table scrolls internally and
   the legal footer is pinned, so the page itself never scrolls (desktop). */
@media (min-width: 761px) {
  body.page-finances { overflow: hidden; }
  .page-finances .app-content { height: 100vh; height: 100dvh; }
  .page-finances .main-area { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .page-finances .content-wrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .page-finances .finance-head, .page-finances .finance-tabs, .page-finances .finance-requisites, .page-finances .finance-buy, .page-finances .finance-notice { flex: 0 0 auto; }
  .page-finances .table-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-bottom: var(--sp-3); }
  .page-finances .table-card .table-scroll { flex: 1 1 auto; min-height: 0; max-height: none; }
  .page-finances .site-legal-footer { flex: 0 0 auto; margin-top: 0; }
}

/* ===== Inline control row ================================================= */
.settings-inline-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-2);
  align-items: center;
}
.settings-inline-button { white-space: nowrap; }
.settings-inline-button[hidden] { display: none; }

@media (max-width: 640px) {
  .settings-inline-controls { grid-template-columns: 1fr; }
  .settings-inline-button { width: 100%; }
}

/* ===== Chat composer: support and documentation ============================ */
.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.chat-composer:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.chat-composer textarea {
  flex: 1;
  min-width: 0;
  height: 40px;
  max-height: 160px;
  padding: 9px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  line-height: 22px;
  resize: none;
}
.chat-composer textarea::placeholder { color: var(--text-subtle); }
.chat-send,
.chat-mic {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.chat-send { background: var(--accent); color: #fff; }
.chat-send:disabled { opacity: 0.5; cursor: default; }
.chat-send svg,
.chat-mic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-send__stop,
.chat-send.is-running .chat-send__go { display: none; }
.chat-send.is-running .chat-send__stop { display: block; fill: currentColor; stroke: none; }
.chat-mic { background: transparent; color: var(--text-muted); }
.chat-mic[hidden] { display: none; }
@media (hover: hover) and (pointer: fine) { .chat-mic:hover { background: var(--surface-3); color: var(--text); } }

/* ===== Support: tickets on the left, the dialog on the right =============== */
.page-support { --support-top: var(--sp-4); --support-bottom: var(--sp-4); }
.page-support .main-area { padding-top: var(--support-top); padding-bottom: var(--support-bottom); }
.page-support .content-wrap {
  display: flex;
  flex-direction: column;
  height: max(480px, calc(100vh - var(--support-top) - var(--support-bottom)));
  height: max(480px, calc(100dvh - var(--support-top) - var(--support-bottom)));
}
.page-support .site-legal-footer { flex: 0 0 auto; margin-top: var(--sp-3); padding-top: var(--sp-3); }
.support-chat {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
}
.support-list {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}
.support-list__head,
.support-dialog__head {
  flex: 0 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.support-list__head { justify-content: space-between; }
.support-list__title { margin: 0; font-size: 20px; }
.support-list__empty { margin: 0; padding: var(--sp-5) var(--sp-4); color: var(--text-muted); font-size: 14px; }
.support-list__items {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 2px;
  padding: var(--sp-2);
}
.support-item {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 10px var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text);
  text-decoration: none;
}
.support-item.is-active { background: var(--accent-soft); }
@media (hover: hover) and (pointer: fine) { .support-item:not(.is-active):hover { background: var(--surface-3); } }
.support-item__top,
.support-item__bottom { min-width: 0; display: flex; align-items: center; gap: var(--sp-2); }
.support-item__subject,
.support-item__preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-item__subject { font-size: 14px; font-weight: 600; }
.support-item__preview { min-height: 18px; color: var(--text-muted); font-size: 13px; line-height: 18px; }
.support-item__date { flex-shrink: 0; color: var(--text-subtle); font-size: 12px; font-variant-numeric: tabular-nums; }
.support-item__dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.support-item__dot[hidden] { display: none; }
.support-dialog { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.support-dialog__title { flex: 1; min-width: 0; margin: 0; overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.support-subject-out { animation: support-subject-out 180ms ease-in forwards; }
.support-subject-in { animation: support-subject-in 900ms ease-out; }
@keyframes support-subject-out { to { opacity: 0; transform: translateY(-3px); } }
@keyframes support-subject-in {
  0% { opacity: 0; transform: translateY(3px); color: var(--accent); }
  30% { opacity: 1; transform: none; color: var(--accent); }
}
.support-dialog__back {
  display: none;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin-left: calc(var(--sp-2) * -1);
  place-items: center;
  border-radius: var(--r-md);
  color: var(--text-muted);
}
.support-dialog__back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.support-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
}
.support-thread > :first-child { margin-top: auto; }
.support-thread--empty { align-items: center; justify-content: center; }
.support-thread--empty > :first-child { margin-top: 0; }
.support-empty { display: grid; justify-items: center; gap: var(--sp-3); max-width: 320px; color: var(--text-muted); font-size: 14px; text-align: center; }
.support-empty p { margin: 0; }
.support-empty svg { width: 36px; height: 36px; fill: none; stroke: var(--text-subtle); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.support-bubble {
  flex-shrink: 0;
  max-width: min(76%, 640px);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-lg);
}
.support-bubble--user { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: var(--r-xs); }
.support-bubble--admin { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: var(--r-xs); }
.support-bubble__who { margin-bottom: 2px; color: var(--accent); font-size: 12px; font-weight: 600; }
.support-bubble__text { color: var(--text); font-size: 14px; line-height: 1.5; word-break: break-word; }
.support-bubble__time { margin-top: 2px; color: var(--text-subtle); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.support-error { margin: 0 var(--sp-4) var(--sp-2); color: var(--danger-text); font-size: 13px; }
.support-composer { flex: 0 0 auto; display: grid; gap: var(--sp-1); padding: var(--sp-3) var(--sp-4) var(--sp-4); }
.support-composer .field-counter:not(.is-near):not(.is-limit) { display: none; }

@media (max-width: 900px) {
  .support-chat { grid-template-columns: minmax(0, 1fr); }
  .support-list { border-right: 0; }
  .support-chat[data-view="list"] .support-dialog,
  .support-chat[data-view="dialog"] .support-list { display: none; }
  .support-dialog__back { display: grid; }
  .support-bubble { max-width: 90%; }
}
@media (max-width: 760px) {
  .page-support { --support-top: calc(42px + var(--sp-8)); }
  .page-support .content-wrap { height: auto; }
  .support-chat {
    flex: none;
    height: calc(100vh - var(--support-top) - var(--support-bottom));
    height: calc(100dvh - var(--support-top) - var(--support-bottom));
  }
  .support-thread { padding: var(--sp-4); }
}

/* ===== Assistant: chat inside the documentation ============================ */
.docs-main { min-width: 0; display: grid; }
.docs-sheet[hidden],
.docs-chat[hidden] { display: none; }
.docs-toc .docs-tab--ask { display: flex; align-items: center; gap: var(--sp-2); color: var(--accent); }
.docs-toc .docs-tab--ask::before {
  content: '';
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  background: currentColor;
  -webkit-mask: var(--ai-mark) center / contain no-repeat;
  mask: var(--ai-mark) center / contain no-repeat;
}
.docs-chat {
  min-width: 0;
  min-height: calc(100vh - 136px);
  min-height: calc(100dvh - 136px);
  display: flex;
  flex-direction: column;
  padding: 0;
}
.docs-chat__head {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--border);
}
.docs-chat__title { margin: 0; font-size: 16px; }
[data-assistant-reset][hidden] { display: none; }
.docs-ask {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  display: grid;
  gap: var(--sp-1);
  margin-inline: -4px;
  padding: var(--sp-8) 4px var(--sp-4);
  background: linear-gradient(to bottom, transparent, var(--bg) var(--sp-6));
  pointer-events: none;
}
.docs-ask > * { pointer-events: auto; }
.docs-ask .chat-composer { box-shadow: var(--shadow-md); }
.ai-frame.is-listening .chat-composer,
.ai-frame.is-transcribing .chat-composer { border-color: var(--accent); }
.voice-bar {
  flex: 1;
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  animation: ai-fade var(--dur-3) var(--ease-out);
}
.voice-bar[hidden] { display: none; }
.voice-bar__time { flex-shrink: 0; min-width: 34px; color: var(--text); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.voice-bar__time.is-near { color: var(--danger-text); }
.voice-bar__label { display: none; flex: 1; min-width: 0; color: var(--text-muted); font-size: 14px; }
.voice-bar__wave { flex: 1; min-width: 0; height: 32px; }
.voice-bar__spin {
  display: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: docs-spin 0.8s linear infinite;
}
.ai-frame.is-listening textarea,
.ai-frame.is-transcribing textarea,
.ai-frame.is-listening .chat-send,
.ai-frame.is-transcribing .chat-send,
.ai-frame.is-transcribing [data-assistant-mic],
.ai-frame.is-transcribing [data-voice-mic],
.ai-frame.is-transcribing .voice-bar__time,
.ai-frame.is-transcribing .voice-bar__wave { display: none; }
.ai-frame.is-transcribing .voice-bar__label { display: block; }
.ai-frame.is-transcribing .voice-bar__spin { display: block; }
.chat-mic__done,
.ai-frame.is-listening .chat-mic__idle { display: none; }
.ai-frame.is-listening .chat-mic__done { display: block; }
.ai-frame.is-listening [data-assistant-mic],
.ai-frame.is-listening [data-voice-mic] { background: var(--accent); color: #fff; }
.voice-cancel[hidden] { display: none; }
.docs-ask__hint,
.voice-hint { margin: 0; padding: 0 var(--sp-4); color: var(--text-muted); font-size: 13px; }
.docs-ask__hint[hidden],
.voice-hint[hidden] { display: none; }
.docs-ask__note { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.3; text-align: center; }
.assistant-thread {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-6) var(--sp-5);
}
.assistant-hello { margin: auto; display: grid; justify-items: center; gap: var(--sp-3); }
.assistant-hello[hidden] { display: none; }
.assistant-hello__title { margin: 0; color: var(--text); font-size: 22px; font-weight: 600; line-height: 1.3; text-align: center; }
.ai-mark {
  width: 44px;
  height: 44px;
  background: var(--accent);
  -webkit-mask: var(--ai-mark) center / contain no-repeat;
  mask: var(--ai-mark) center / contain no-repeat;
}
.assistant-message { flex-shrink: 0; display: flex; flex-direction: column; align-items: stretch; }
.assistant-message--user { align-items: flex-end; }
.assistant-meta {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 30px;
  margin-bottom: calc(var(--sp-2) * -1);
  color: var(--text-subtle);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
}
.assistant-message:hover .assistant-meta,
.assistant-message:focus-within .assistant-meta,
.assistant-message.is-last .assistant-meta { opacity: 1; }
.assistant-action {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.assistant-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.assistant-action--retry { display: none; }
.assistant-message.is-last .assistant-action--retry { display: grid; }
.assistant-time { padding-inline: var(--sp-1); font-size: 12px; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .assistant-action:hover { background: var(--surface-3); color: var(--text); } }
@media (hover: none) { .assistant-meta { opacity: 1; } }
.assistant-down {
  position: absolute;
  top: 0;
  left: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transform: translateX(-50%);
}
.assistant-down[hidden] { display: none; }
.assistant-down svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.assistant-bubble {
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}
.assistant-bubble--user {
  max-width: 80%;
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface-3);
  border-radius: var(--r-xl);
}
.assistant-bubble--bot { align-self: stretch; }
.assistant-message.is-editing { align-items: stretch; }
.assistant-message.is-editing .assistant-meta,
.assistant-bubble.is-editing .assistant-text { display: none; }
.assistant-bubble--user.is-editing { max-width: 100%; }
.assistant-edit { display: grid; gap: var(--sp-2); }
.assistant-edit textarea {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
}
.assistant-edit__actions { display: flex; justify-content: flex-end; gap: var(--sp-2); }
.assistant-bubble.is-new { animation: ai-fade var(--dur-3) var(--ease-out); }
.assistant-text p { margin: 0; }
.assistant-text p + p,
.assistant-text p + ul,
.assistant-text p + ol,
.assistant-text ul + p,
.assistant-text ol + p { margin-top: var(--sp-3); }
.assistant-text ul,
.assistant-text ol { margin: 0; padding-left: 22px; }
.assistant-text ul { list-style: disc; }
.assistant-text ol { list-style: decimal; }
.assistant-text li + li { margin-top: var(--sp-1); }
.assistant-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.assistant-text code { font-size: 13px; }
.assistant-text p > a:only-child {
  display: inline-block;
  padding: 3px var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
}
.assistant-text p > a:only-child { margin-bottom: var(--sp-2); }
.assistant-support { margin-top: var(--sp-3); }
.assistant-notice__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.assistant-notice__actions .assistant-support { margin-top: 0; }
.assistant-notice {
  flex-shrink: 0;
  display: grid;
  justify-items: start;
  gap: var(--sp-2);
  color: var(--text-muted);
  font-size: 14px;
}
.assistant-think {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: calc(var(--sp-2) * -1);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}
.assistant-think__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-spark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--ai-mark) center / contain no-repeat;
  mask: var(--ai-mark) center / contain no-repeat;
}
.assistant-think.is-live .ai-spark { background: var(--accent); }
.assistant-think__clock { flex-shrink: 0; color: var(--text-subtle); font-size: 12px; font-variant-numeric: tabular-nums; }
.assistant-think__clock:empty { display: none; }
.assistant-think.is-live .assistant-think__title {
  background: linear-gradient(90deg, var(--text-muted) 35%, var(--text) 50%, var(--text-muted) 65%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: assistant-shimmer 1.8s linear infinite;
}
.assistant-stopped { flex-shrink: 0; font-size: 13px; color: var(--text-muted); }
:root { --ai-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cmask id='m'%3E%3Crect width='32' height='32' fill='%23fff'/%3E%3Cpath d='M6.8 19.6q3.1-5 6.2 0M19 19.6q3.1-5 6.2 0' fill='none' stroke='%23000' stroke-width='2.8' stroke-linecap='round'/%3E%3C/mask%3E%3Cg mask='url(%23m)'%3E%3Cpath d='M22.5 9.5 25.5 4.5' stroke='%23000' stroke-width='2.4' stroke-linecap='round'/%3E%3Ccircle cx='26' cy='3.8' r='2.4'/%3E%3Crect x='1.5' y='9' width='29' height='18' rx='9'/%3E%3C/g%3E%3C/svg%3E"); }
@keyframes assistant-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes ai-fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .assistant-think.is-live .assistant-think__title { animation-duration: 1.8s !important; animation-iteration-count: infinite !important; }
  .voice-bar__spin { animation-duration: 0.8s !important; animation-iteration-count: infinite !important; }
  .support-subject-out { animation-duration: 180ms !important; }
  .support-subject-in { animation-duration: 900ms !important; }
}
@media (max-width: 760px) {
  .docs-chat__head { padding-inline: calc(42px + var(--sp-4)) var(--sp-4); }
  .assistant-thread { padding: var(--sp-5) var(--sp-4); }
  .assistant-bubble--user { max-width: 90%; }
}
@media print {
  .docs-ask { display: none; }
}

.field-counter {
  justify-self: end;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.field-counter.is-near { color: var(--warn-text); }
.field-counter.is-limit { color: var(--danger-text); font-weight: 600; }

/* ===== Launcher authorization (/link-launcher) =========================== */
.link-launcher-card { width: min(520px, 100%); }
.link-launcher-inner {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--sp-4);
}
.link-launcher-icon {
  display: grid;
  place-items: center;
  width: 72px; height: 72px;
  border-radius: var(--r-2xl);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
}
.link-launcher-icon svg { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.link-launcher-icon--success { background: var(--success-soft); border-color: var(--success); color: var(--success-text); }
.link-launcher-icon--warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn-text); }
.link-launcher-title { margin: 0; font-size: clamp(20px, 3vw, 26px); }
.link-launcher-text { margin: 0; color: var(--text-muted); line-height: 1.6; }
.link-launcher-actions { margin-top: var(--sp-2); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); }
.link-launcher-hint { margin: 0; font-size: 13px; color: var(--text-subtle); }
.link-launcher-accounts {
  width: 100%;
  display: grid;
  gap: var(--sp-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-1);
}
.link-launcher-account { border: none; background: none; }
.link-launcher-account-hint { margin-left: auto; font-size: 12px; color: var(--text-subtle); }

.finance-requisites { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.finance-tabs { align-self: flex-start; max-width: 100%; overflow-x: auto; margin-bottom: var(--sp-3); }
.finance-req-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3) var(--sp-5); margin: 0; }
.finance-req-grid dt { color: var(--text-muted); font-size: 12px; margin-bottom: 2px; }
.finance-req-grid dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.finance-topup-total { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.finance-topup-total strong { font-variant-numeric: tabular-nums; text-align: right; }

/* ===== Points ============================================================= */
.success-callout {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--success-soft);
  border: 1px solid var(--border);
}
.success-callout__title { color: var(--success-text); font-size: 13px; }
.success-callout__body { white-space: pre-wrap; line-height: 1.5; color: var(--text); }
.points-card { margin-bottom: var(--sp-4); }
.points-table td { vertical-align: top; }
.points-name { display: block; }
.points-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.points-code { font-weight: 600; user-select: all; }
.points-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: flex-end; align-items: flex-start; }
.points-actions .inline-form { margin: 0; }
.points-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.points-steps { margin: 0; padding-left: 20px; display: grid; gap: var(--sp-2); line-height: 1.55; }
.confirm-modal .modal__dialog { width: min(100%, 440px); gap: var(--sp-3); }
.confirm-modal .panel-title { margin: 0; }
.confirm-modal__text { margin: 0; color: var(--text-muted); line-height: 1.55; }
.confirm-modal__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-2); }
.point-scope { min-width: 200px; }
.point-scope-form { margin: 0; }
.point-scope-form .point-scope > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.point-label { display: block; margin-top: 2px; font-size: 12px; color: var(--text-muted); }

/* ===== Docs =============================================================== */
.docs {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
}
.docs-public-main { flex: 1 1 auto; padding: var(--sp-6) clamp(16px, 4vw, 48px) var(--sp-10); }

.docs-nav { padding: var(--sp-2); }
.docs-nav__toggle { display: none; }
.docs-toc { display: grid; gap: 2px; }
.docs-tab {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 6px var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.docs-tab:not(.docs-tab--sub):not(:first-child) { margin-top: var(--sp-2); }
.docs-tab--sub { min-height: 32px; padding-left: var(--sp-6); color: var(--text-muted); font-size: 13.5px; font-weight: 500; }
.docs-tab.is-active { background: var(--accent-soft); color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .docs-tab:not(.is-active):hover { background: var(--surface-3); color: var(--text); } }

.docs-sheet { min-width: 0; padding: clamp(20px, 3vw, 36px); }
.docs-sheet:focus { outline: none; }
.docs-section { display: none; scroll-margin-top: 100vh; }
.docs-section.is-active { display: block; }

.docs-prose { font-size: 15px; line-height: 1.65; }
.docs-prose h2 { margin-bottom: var(--sp-4); font-size: clamp(24px, 2.6vw, 30px); }
.docs-prose h3 { margin: var(--sp-8) 0 var(--sp-3); font-size: 18px; scroll-margin-top: var(--sp-6); }
.page-docs--public .docs-prose h3 { scroll-margin-top: calc(var(--topbar-height) + var(--sp-6)); }
.docs-prose h2 + h3 { margin-top: 0; }
.docs-prose h4 { font-size: 15px; }
.docs-prose p + p { margin-top: var(--sp-3); }
.docs-prose ul, .docs-prose ol { display: grid; gap: 6px; margin: var(--sp-3) 0; padding-left: 22px; }
.docs-prose ul { list-style: disc; }
.docs-prose ol { list-style: decimal; }
.docs-prose li::marker { color: var(--text-subtle); }
.docs-prose li > ul, .docs-prose li > ol, .docs-prose li > .note { margin-top: var(--sp-2); margin-bottom: 0; }
.docs-prose strong { font-weight: 600; }
.docs-prose a { color: var(--accent); font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .docs-prose a:hover { text-decoration: underline; text-underline-offset: 3px; } }
.docs-prose small { color: var(--text-subtle); font-size: 12.5px; }

.docs-prose figure { margin: var(--sp-5) 0; }
.docs-prose .img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-inset); }
.docs-prose .img--compact { width: auto; max-width: min(100%, 520px); margin-inline: auto; }
.docs-prose .caption { margin-top: var(--sp-2); color: var(--text-muted); font-size: 13px; text-align: center; }
.docs-prose .docs-videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); margin: var(--sp-3) 0 var(--sp-2); }
.docs-prose .docs-videos figure { margin: 0; }
.docs-prose .docs-videos video { display: block; width: 100%; height: auto; border-radius: var(--r-md); background: #000; }
.docs-prose .docs-videos figcaption { margin-top: var(--sp-2); font-size: 14px; font-weight: 600; }
.docs-player { position: relative; overflow: hidden; border-radius: var(--r-md); background: #000; isolation: isolate; }
.docs-prose .docs-player video { border-radius: 0; cursor: pointer; }
.docs-player.is-full { display: flex; align-items: center; border-radius: 0; }
.docs-prose .docs-player.is-full video { width: 100%; height: 100%; object-fit: contain; }
.docs-player.is-playing:not(.is-awake) video { cursor: none; }
.docs-player__big {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: var(--accent-fill);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out), opacity var(--dur-2) var(--ease-out);
}
.docs-player__big svg { width: 26px; height: 26px; margin-left: -1.7px; fill: currentColor; }
.docs-player__big .is-stroke { margin-left: 0; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.docs-player__big:active { transform: scale(0.94); }
.docs-player.is-playing .docs-player__big { opacity: 0; pointer-events: none; transform: scale(0.8); }
@media (hover: hover) and (pointer: fine) {
  .docs-player:not(.is-playing):hover .docs-player__big { background: var(--accent-fill-hover); transform: scale(1.08); }
}
.docs-player__dur {
  position: absolute;
  right: var(--sp-3);
  bottom: var(--sp-3);
  padding: 3px 8px;
  border-radius: var(--r-xs);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-out);
}
.docs-player.is-started .docs-player__dur { opacity: 0; }
@media (max-width: 760px) { .docs-player__big { width: 56px; height: 56px; margin: -28px 0 0 -28px; } .docs-player__big svg { width: 22px; height: 22px; } }
.docs-player__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: docs-spin 0.8s linear infinite;
  transition: opacity var(--dur-2) var(--ease-out);
}
.docs-player.is-waiting .docs-player__spinner { opacity: 1; }
@keyframes docs-spin { to { transform: rotate(360deg); } }

.docs-player__bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-6) var(--sp-2) var(--sp-2);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-3) var(--ease-out);
}
.docs-player.is-started.is-awake .docs-player__bar,
.docs-player.is-started:not(.is-playing) .docs-player__bar { opacity: 1; pointer-events: auto; }
.docs-player__btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  color: #fff;
  transition: background-color var(--dur-1) var(--ease-out);
}
.docs-player__btn svg { width: 20px; height: 20px; fill: currentColor; }
.docs-player__btn .is-stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .docs-player__btn:hover { background: rgba(255, 255, 255, 0.16); } }
.docs-player__track {
  position: relative;
  flex: 1 1 auto;
  height: 28px;
  margin: 0 var(--sp-2);
  cursor: pointer;
  touch-action: none;
}
.docs-player__track::before,
.docs-player__buffer,
.docs-player__fill {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  transform-origin: left center;
  transition: height var(--dur-1) var(--ease-out), margin var(--dur-1) var(--ease-out);
}
.docs-player__track::before { background: rgba(255, 255, 255, 0.25); }
.docs-player__buffer { background: rgba(255, 255, 255, 0.35); transform: scaleX(0); }
.docs-player__fill { background: var(--accent); transform: scaleX(0); }
.docs-player__knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  transform: scale(0);
  transition: transform var(--dur-1) var(--ease-out);
}
.docs-player__track:focus-visible .docs-player__knob { transform: scale(1); }
@media (hover: hover) and (pointer: fine) {
  .docs-player__track:hover::before, .docs-player__track:hover .docs-player__buffer, .docs-player__track:hover .docs-player__fill { height: 6px; margin-top: -3px; }
  .docs-player__track:hover .docs-player__knob { transform: scale(1); }
}
@media (pointer: coarse) { .docs-player__knob { transform: scale(1); } }
.docs-player__time { flex: 0 0 auto; margin-right: var(--sp-1); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.docs-player:focus { outline: none; }
.docs-player:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.docs-player__flash { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(0, 0, 0, 0.5); color: #fff; opacity: 0; pointer-events: none; }
.docs-player__flash svg { width: 26px; height: 26px; fill: currentColor; }
.docs-player__flash.is-on { animation: docs-flash 0.55s ease-out; }
@keyframes docs-flash { 0% { opacity: 0.9; transform: scale(0.8); } 100% { opacity: 0; transform: scale(1.35); } }
.docs-player__tip { position: absolute; bottom: 100%; left: 0; margin-bottom: 6px; padding: 3px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.8); color: #fff;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; transform: translateX(-50%); opacity: 0; pointer-events: none; transition: opacity 0.15s ease; }
.docs-player__vol { display: flex; align-items: center; flex: none; }
.docs-player__range { -webkit-appearance: none; appearance: none; width: 0; height: 4px; margin: 0; border-radius: 2px; opacity: 0; cursor: pointer;
  background: linear-gradient(to right, #fff var(--level, 100%), rgba(255, 255, 255, 0.3) var(--level, 100%)); transition: width 0.2s ease, opacity 0.2s ease, margin 0.2s ease; }
.docs-player__range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.docs-player__range::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.docs-player__vol:hover .docs-player__range, .docs-player__vol:focus-within .docs-player__range { width: 72px; margin: 0 8px 0 2px; opacity: 1; }
@media (hover: hover) and (pointer: fine) { .docs-player__track:hover .docs-player__tip { opacity: 1; } }
@media (pointer: coarse) { .docs-player__range { display: none; } }

.docs-prose .note, .docs-prose .warn {
  margin: var(--sp-4) 0;
  padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--info);
  border-radius: var(--r-sm);
  background: var(--info-soft);
  font-size: 14.5px;
}
.docs-prose .warn { border-left-color: var(--warn); background: var(--warn-soft); }
.docs-prose .callout {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-3);
}
.docs-prose .callout-header { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); color: var(--accent); }
.docs-prose .callout-header h4 { color: var(--text); }
.docs-prose .callout > :last-child { margin-bottom: 0; }
.docs-prose .kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  vertical-align: 1px;
}
.docs-prose .status-list { list-style: none; padding-left: 0; }
.docs-prose .status-list li { display: flex; align-items: baseline; gap: 10px; }
.docs-prose .status-indicator { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; transform: translateY(1px); background: var(--text-subtle); }
.docs-prose .status-indicator.green { background: var(--success); }
.docs-prose .status-indicator.red { background: var(--danger); }
.docs-prose .status-indicator.orange { background: var(--warn); }
.docs-prose .status-indicator.blue { background: var(--info); }
.docs-prose .support-note { margin-top: var(--sp-6); color: var(--text-muted); font-size: 14px; }

@media (max-width: 1000px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
  .docs-nav__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    width: 100%;
    min-height: 40px;
    padding: 0 var(--sp-3);
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
  }
  .docs-nav__toggle svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-2) var(--ease-out); }
  .docs-nav.is-open .docs-nav__toggle svg { transform: rotate(180deg); }
  .docs-toc { display: none; margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--border); }
  .docs-nav.is-open .docs-toc { display: grid; }
}
@media (max-width: 760px) {
  .page-docs:not(.page-docs--public) .main-area { padding-top: var(--sp-4); }
  .page-docs:not(.page-docs--public) .docs-nav { margin-left: calc(42px + var(--sp-3)); }
  .docs-nav { padding: 1px; }
  .docs-nav.is-open { padding-bottom: var(--sp-2); }
  .docs-toc { margin-inline: var(--sp-1); }
  .docs-sheet { padding: var(--sp-5) var(--sp-4); }
  .docs-prose ul, .docs-prose ol { padding-left: 20px; }
  .docs-prose .docs-videos { grid-template-columns: minmax(0, 1fr); }
}
