/*
 * Quizzer visual system
 *
 * This is the final visual cascade for shared UI primitives. Page-specific
 * styles may control layout, but colors, typography, borders, radii and
 * component states must come from this file.
 */

:root {
  /* Brand */
  --qz-color-ink: #18213a;
  --qz-color-ink-soft: #25304f;
  --qz-color-blue: #3155f5;
  --qz-color-blue-hover: #2445db;
  --qz-color-blue-soft: #eef1ff;
  --qz-color-blue-line: #cfd7ff;
  --qz-color-coral: #ff5d67;
  --qz-color-coral-hover: #e94e5a;
  --qz-color-coral-soft: #fff0f1;
  --qz-color-coral-line: #ffb9bf;
  --qz-color-gold: #ffd84d;
  --qz-color-gold-soft: #fff7cf;
  --qz-color-gold-line: #e9cb63;

  /* Surfaces */
  --qz-color-page: #fff8e9;
  --qz-color-surface: #fffdf7;
  --qz-color-surface-soft: #fff8ec;
  --qz-color-neutral-soft: #f0f1f6;
  --qz-color-line: #ded4c2;
  --qz-color-line-strong: #cfc2aa;
  --qz-color-muted: #687086;

  /* Semantic colors */
  --qz-color-success: #19815f;
  --qz-color-success-soft: #e5fbf2;
  --qz-color-success-line: #a7dec9;
  --qz-color-warning: #9a6410;
  --qz-color-warning-soft: #fff5d9;
  --qz-color-danger: #b83250;
  --qz-color-danger-soft: #fff0f1;

  --qz-control-height: 44px;
  --qz-font-meta: 12px;

  /* Typography */
  --qz-font-body: "Nunito Sans Variable", "Nunito Sans", ui-sans-serif, system-ui, sans-serif;
  --qz-font-display: "Unbounded Variable", "Unbounded", "Arial Rounded MT Bold", sans-serif;

  /* Shape */
  --qz-border-width: 2px;
  --qz-border: var(--qz-border-width) solid var(--qz-color-line);
  --qz-radius-small: 10px;
  --qz-radius-control: 14px;
  --qz-radius-action: 16px;
  --qz-radius-block: 18px;
  --qz-radius-card: 24px;
  --qz-radius-pill: 999px;

  /* Elevation */
  --qz-shadow-card: 0 16px 36px rgba(49, 85, 245, 0.09);
  --qz-shadow-action: 0 12px 24px rgba(49, 85, 245, 0.20);
  --qz-shadow-pop: 8px 8px 0 rgba(24, 33, 58, 0.24);
  --qz-shadow-coral: 0 16px 32px rgba(255, 93, 103, 0.10);
  --qz-shadow-coral-hover: 0 20px 38px rgba(255, 93, 103, 0.15);
  --qz-shadow-gold: 0 14px 30px rgba(255, 216, 77, 0.16);
  --qz-shadow-selected: 0 8px 18px rgba(49, 85, 245, 0.24);

  /* Keep legacy tokens mapped to the same source of truth. */
  --ink: var(--qz-color-ink);
  --ink-2: var(--qz-color-ink-soft);
  --surface: var(--qz-color-surface);
  --soft: var(--qz-color-page);
  --line: var(--qz-color-line);
  --muted: var(--qz-color-muted);
  --coral: var(--qz-color-coral);
  --gold: var(--qz-color-gold);
  --blue: var(--qz-color-blue);
  --shadow: var(--qz-shadow-card);
}

body,
button,
input,
select,
textarea {
  font-family: var(--qz-font-body);
}

body,
.workspace,
.editor-shell .workspace,
.host-session-workspace {
  color: var(--qz-color-ink);
  background-color: var(--qz-color-page);
}

h1,
h2,
h3,
.brand strong,
.entry-brand strong,
.quiz-row-main strong,
.host-session-title,
.host-stage-card h2,
.host-focus-card > strong,
.host-section-head h3,
.player-question h1,
.player-state h1,
.join-form h1,
.winner strong {
  font-family: var(--qz-font-display);
  font-style: normal;
  letter-spacing: -0.035em;
}

/* Shared actions */
.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn,
.host-open-screen,
.host-stop-button,
.entry-choice,
.question-type-choice,
.image-upload-btn {
  border-width: var(--qz-border-width);
  border-style: solid;
}

.primary-btn {
  color: white;
  background: var(--qz-color-blue);
  border-color: var(--qz-color-blue);
  border-radius: var(--qz-radius-action);
  box-shadow: var(--qz-shadow-action);
}

.primary-btn:hover {
  background: var(--qz-color-blue-hover);
  border-color: var(--qz-color-blue-hover);
}

.primary-btn.danger-btn {
  background: var(--qz-color-coral);
  border-color: var(--qz-color-coral);
}

.primary-btn.danger-btn:hover {
  background: var(--qz-color-coral-hover);
  border-color: var(--qz-color-coral-hover);
}

.secondary-btn {
  color: var(--qz-color-blue);
  background: var(--qz-color-blue-soft);
  border-color: var(--qz-color-blue-line);
  border-radius: var(--qz-radius-action);
}

.ghost-btn,
.icon-btn {
  color: var(--qz-color-ink);
  background: var(--qz-color-surface);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-action);
}

.ghost-btn:hover,
.icon-btn:hover {
  color: var(--qz-color-blue);
  background: var(--qz-color-blue-soft);
  border-color: #aebcff;
}

.icon-btn.accent {
  color: white;
  background: var(--qz-color-coral);
  border-color: var(--qz-color-coral);
}

.icon-btn.danger,
.host-stop-button {
  color: var(--qz-color-danger);
}

.text-btn,
.breadcrumb-link,
.brand-home {
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* Form controls */
input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
select,
textarea,
.calm-quiz-meta input,
.calm-quiz-meta textarea,
.calm-points-field input {
  color: var(--qz-color-ink);
  background: var(--qz-color-surface);
  border: var(--qz-border);
  border-radius: var(--qz-radius-control);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--qz-color-blue);
  box-shadow: 0 0 0 4px rgba(49, 85, 245, 0.12);
}

/* Pills and compact status markers are filled, not outlined. */
.save-status,
.connection-badge,
.phase-pill,
.round-index,
.quiz-meta span,
.current-account-label,
.host-player-row em {
  border: 0;
  border-radius: var(--qz-radius-pill);
}

/* Major surfaces */
.panel,
.quiz-row,
.entry-card,
.calm-editor .round-block,
.calm-settings-panel,
.mobile-quiz-settings,
.host-session-topbar,
.host-main-panel,
.host-side-panel,
.host-finished-card {
  background: var(--qz-color-surface);
  border: var(--qz-border);
  box-shadow: var(--qz-shadow-card);
}

.panel,
.entry-card,
.host-main-panel,
.host-side-panel,
.host-finished-card {
  border-radius: var(--qz-radius-card);
}

.host-finished-card {
  overflow: hidden;
  border-color: var(--qz-color-gold-line);
  box-shadow: var(--qz-shadow-gold);
}

.host-finished-kicker {
  color: var(--qz-color-blue);
}

.host-finished-copy p,
.host-finished-stats dt {
  color: var(--qz-color-muted);
}

.host-finished-stats > div {
  background: var(--qz-color-gold-soft);
  border-radius: var(--qz-radius-block);
}

.quiz-row {
  border-radius: 22px;
}

.dashboard-quiz {
  background: var(--qz-color-surface);
  border-left: 8px solid var(--qz-color-coral);
  box-shadow: var(--qz-shadow-card);
}

.dashboard-quiz:hover {
  border-color: var(--qz-color-line-strong);
  border-left-color: var(--qz-color-coral);
  box-shadow: var(--qz-shadow-card);
}

.dashboard-quiz .quiz-art {
  background: var(--qz-color-gold-soft);
}

.calm-editor .round-block,
.calm-settings-panel,
.mobile-quiz-settings {
  border-radius: 20px;
}

.panel.calm-editor-main {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Nested cards use the same 2px component outline. One-pixel rules are
   reserved for separators and dense list rows below. */
.calm-editor .question-block,
.calm-editor .round-settings,
.calm-editor .bottom-item-toolbar,
.calm-editor .question-type-choice,
.image-source-editor,
.host-stage-card,
.host-activity-card,
.host-focus-card,
.host-side-panel .host-timeline,
.validation-summary,
.access-notice,
.permission-choice,
.access-toggle {
  border-width: var(--qz-border-width);
  border-style: solid;
}

.calm-editor .question-block {
  background: var(--qz-color-surface);
  border-color: var(--qz-color-line);
  border-left: 5px solid var(--qz-color-blue);
  border-radius: var(--qz-radius-action);
}

.calm-editor .round-block {
  background: var(--qz-color-gold-soft);
  border-color: var(--qz-color-gold-line);
  box-shadow: var(--qz-shadow-gold);
}

.calm-editor .round-summary > span:first-child,
.calm-editor .question-number {
  color: white;
  background: var(--qz-color-coral);
}

.calm-settings-panel,
.mobile-quiz-settings {
  background: var(--qz-color-surface);
  border-color: var(--qz-color-blue-line);
}

.calm-editor .round-settings,
.calm-editor .bottom-item-toolbar,
.calm-editor .question-type-choice,
.image-source-editor {
  background: var(--qz-color-surface);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-control);
}

.image-source-editor summary .image-source-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 8px;
  color: var(--qz-color-muted);
  background: var(--qz-color-neutral-soft);
  border: 1px solid var(--qz-color-line);
  border-radius: var(--qz-radius-pill);
  font-size: var(--qz-font-meta);
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.image-source-editor summary .image-source-status::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  background: var(--qz-color-muted);
  border-radius: 50%;
  content: "";
}

.image-source-editor.has-image summary .image-source-status {
  color: var(--qz-color-success);
  background: var(--qz-color-success-soft);
  border-color: var(--qz-color-success-line);
}

.image-source-editor.has-image summary .image-source-status::before {
  background: var(--qz-color-success);
}

.image-source-editor.compact summary .image-source-status {
  display: inline-flex;
}

.calm-editor .round-settings[open] > summary,
.calm-editor .bottom-item-toolbar[open] > summary,
.calm-editor .round-body,
.calm-editor .question-body-fields,
.advanced-settings,
.rounds-section-head {
  border-color: var(--qz-color-line);
}

.calm-editor .drag-handle,
.calm-editor .icon-btn {
  background: var(--qz-color-surface);
  border: var(--qz-border);
  border-radius: var(--qz-radius-control);
}

.calm-editor .icon-btn.danger {
  color: var(--qz-color-danger);
  background: var(--qz-color-surface);
  border-color: #ead6da;
}

.calm-validation,
.calm-validation.ready,
.calm-validation.has-errors {
  background: var(--qz-color-surface);
  border: var(--qz-border);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-control);
}

.calm-validation.has-errors {
  background: var(--qz-color-warning-soft);
  border-color: var(--qz-color-gold-line);
}

.calm-validation.ready {
  background: var(--qz-color-success-soft);
  border-color: var(--qz-color-success-line);
}

.calm-mode-switch {
  gap: 6px;
  padding: 4px;
  background: var(--qz-color-neutral-soft);
  border: var(--qz-border);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-action);
}

.calm-mode-switch button {
  border: 0;
  border-radius: 11px;
  color: var(--qz-color-muted);
  background: transparent;
  box-shadow: none;
  opacity: 0.62;
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.calm-mode-switch button + button {
  border-left: 0;
}

.calm-mode-switch button.active,
.calm-mode-switch button[aria-pressed="true"] {
  color: white;
  background: var(--qz-color-blue);
  box-shadow: var(--qz-shadow-selected);
  opacity: 1;
}

.calm-mode-switch button:not(.active):hover {
  color: var(--qz-color-ink);
  background: var(--qz-color-surface);
  opacity: 0.82;
}

.calm-points-field {
  background: var(--qz-color-blue-soft);
  border: var(--qz-border);
  border-color: var(--qz-color-blue-line);
  border-radius: var(--qz-radius-control);
}

.rounds-section-head .secondary-btn {
  border-width: var(--qz-border-width);
}

/* Host console */
.host-session-topbar {
  border-radius: 20px;
  border-left: var(--qz-border);
  box-shadow: var(--qz-shadow-card);
}

.host-open-screen {
  color: var(--qz-color-blue);
  background: var(--qz-color-blue-soft);
  border-color: var(--qz-color-blue-line);
  border-radius: var(--qz-radius-control);
}

.host-session-mode {
  padding: 6px 10px;
  color: var(--qz-color-blue);
  background: var(--qz-color-blue-soft);
  border-left: 0;
  border-radius: var(--qz-radius-pill);
}

.host-stage-card {
  background-color: var(--qz-color-blue);
  border-color: rgba(255, 255, 255, 0.24);
  border-radius: var(--qz-radius-block);
}

.host-answer-status,
.host-stage-timer,
.host-stage-option,
.host-stage-simple-head > strong {
  border-width: var(--qz-border-width);
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.24);
}

.host-answer-status,
.host-stage-timer,
.host-stage-simple-head > strong {
  border-radius: var(--qz-radius-control);
}

.host-stage-option {
  border-radius: 12px;
}

.host-activity-card {
  background: var(--qz-color-surface);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-action);
}

.host-focus-card {
  background: var(--qz-color-gold-soft);
  border-color: var(--qz-color-gold-line);
  border-radius: var(--qz-radius-block);
}

.host-side-panel .host-timeline {
  background: var(--qz-color-surface);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-control);
}

.host-stop-button {
  background: var(--qz-color-surface);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-control);
}

.host-stop-button:hover {
  transform: translateY(-2px);
}

.host-utility-actions .ghost-btn:hover {
  transform: none;
  border-color: #aebcff;
  box-shadow: inset 0 0 0 1px #aebcff;
}

/* Dense rows use a deliberate 1px hairline so the compact host view does not
   become visually heavy. */
.host-stat-option,
.host-player-row,
.host-side-panel .timeline-row {
  background: var(--qz-color-surface-soft);
  border: 1px solid var(--qz-color-line);
  border-radius: var(--qz-radius-small);
}

.host-player-row em {
  background: #f2f4f8;
}

/* Public/player surfaces use the same geometry, with a festive offset shadow. */
.auth-card,
.player-card,
.confirm-dialog {
  background: var(--qz-color-page);
  border: var(--qz-border-width) solid var(--qz-color-ink);
  border-radius: var(--qz-radius-card);
  box-shadow: var(--qz-shadow-pop);
}

.player-option,
.winner {
  background: var(--qz-color-surface);
  border: var(--qz-border);
  border-radius: var(--qz-radius-block);
}

.player-option.selected {
  background: var(--qz-color-blue-soft);
  border-color: var(--qz-color-blue);
}

.answer-tile {
  border-width: var(--qz-border-width);
  border-radius: var(--qz-radius-block);
}

.qr-image,
#joinQr,
#hostQr,
.public-qr-image,
.qr-stage #joinQr,
.answer-sent-icon {
  border-width: var(--qz-border-width);
}

.toast {
  color: var(--qz-color-ink);
  background: var(--qz-color-gold);
  border: var(--qz-border-width) solid var(--qz-color-ink);
  border-radius: var(--qz-radius-action);
}

/* The only square icon language is Phosphor. Disclosure carets rotate in
   place; navigation arrows keep their direction. */
.ph,
.ph-bold,
.ph-fill,
.disclosure-caret {
  flex: 0 0 auto;
  line-height: 1;
}

.disclosure-caret {
  transition: transform 160ms ease;
}

@media (max-width: 680px) {
  .panel,
  .entry-card,
  .auth-card,
  .player-card,
  .confirm-dialog,
  .host-main-panel,
  .host-side-panel,
  .calm-editor .round-block,
  .calm-settings-panel,
  .mobile-quiz-settings {
    border-radius: 20px;
  }

  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .icon-btn,
  .host-open-screen,
  .host-stop-button {
    border-radius: var(--qz-radius-control);
  }

  .host-stage-card,
  .host-activity-card,
  .host-focus-card {
    border-radius: var(--qz-radius-action);
  }

  .auth-card,
  .player-card,
  .confirm-dialog {
    box-shadow: 6px 6px 0 rgba(24, 33, 58, 0.24);
  }

  .dashboard-quiz {
    border-left-width: 6px;
  }

  .host-session-mode {
    display: inline-flex;
    justify-self: start;
    width: fit-content;
    max-width: 100%;
    padding: 3px 7px;
    overflow: hidden;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Account, billing and operations screens reuse the shared product language. */
.mobile-nav-trigger,
.mobile-nav-scrim,
.sidebar-mobile-head,
.sidebar-mobile-logout {
  display: none;
}

.sidebar-account {
  color: var(--qz-color-ink);
  background: var(--qz-color-surface);
  border: var(--qz-border);
  border-color: var(--qz-color-blue-line);
  box-shadow: var(--qz-shadow-card);
}

.sidebar-balance {
  color: var(--qz-color-blue);
  background: var(--qz-color-blue-soft);
  border: var(--qz-border);
  border-color: var(--qz-color-blue-line);
  border-radius: var(--qz-radius-control);
}

.auth-screen {
  place-items: center;
  min-height: 100dvh;
  height: 100dvh;
  padding: 12px;
  overflow: hidden;
}

.auth-card {
  width: min(440px, 100%);
  max-height: calc(100dvh - 24px);
  padding: 20px 28px;
  overflow: hidden;
  background: var(--qz-color-surface);
  border: var(--qz-border);
  border-color: var(--qz-color-blue-line);
  box-shadow: var(--qz-shadow-card);
}

.auth-card > img {
  width: 80px;
  height: 80px;
  margin: -2px auto 0;
}

.auth-kicker {
  font-size: 13px;
}

.auth-brand-kicker {
  color: var(--qz-color-muted);
}

.auth-card-intro {
  display: grid;
  align-content: start;
  min-height: 76px;
}

.auth-card-intro h1 {
  margin: 7px 0 5px;
  font-size: 28px;
  line-height: 1.12;
}

.auth-card-intro p {
  margin: 0;
  color: var(--qz-color-muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

.auth-mode-tabs {
  margin-top: 10px;
  padding: 4px;
  background: var(--qz-color-neutral-soft);
  border: var(--qz-border);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-action);
}

.auth-mode-tabs button {
  padding: 8px;
  color: var(--qz-color-muted);
  border-radius: 11px;
  box-shadow: none;
}

.auth-mode-tabs button:hover {
  color: var(--qz-color-ink);
  background: var(--qz-color-surface);
}

.auth-mode-tabs button.active,
.auth-mode-tabs button.active:hover {
  color: white;
  background: var(--qz-color-blue);
  box-shadow: var(--qz-shadow-selected);
}

.entry-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 28px 18px;
  background: var(--qz-color-blue-soft);
}

.entry-card {
  width: min(760px, 100%);
  padding: clamp(24px, 5vw, 48px);
  border-color: var(--qz-color-blue-line);
}

.entry-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.entry-brand img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.entry-brand strong,
.entry-brand span {
  display: block;
}

.entry-brand span {
  margin-top: 3px;
  color: var(--qz-color-muted);
  font-size: 12px;
}

.entry-copy {
  max-width: 560px;
  margin: 28px auto 0;
  text-align: center;
}

.entry-copy h1 {
  margin: 10px 0;
  font-size: clamp(30px, 6vw, 50px);
}

.entry-copy p {
  margin: 0;
  color: var(--qz-color-muted);
  font-size: 16px;
}

.entry-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.entry-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 16px;
  color: var(--qz-color-blue);
  background: var(--qz-color-blue-soft);
  border-color: var(--qz-color-blue-line);
  border-radius: var(--qz-radius-action);
  box-shadow: var(--qz-shadow-card);
  text-align: left;
}

.entry-choice:hover {
  color: var(--qz-color-blue-hover);
  background: var(--qz-color-surface);
  border-color: var(--qz-color-blue);
  box-shadow: var(--qz-shadow-selected);
}

.entry-choice.primary-choice,
.entry-choice.primary-choice:hover {
  color: white;
  background: var(--qz-color-blue);
  border-color: var(--qz-color-blue);
  box-shadow: var(--qz-shadow-action);
}

.entry-choice.primary-choice:hover {
  background: var(--qz-color-blue-hover);
  border-color: var(--qz-color-blue-hover);
}

.entry-choice span,
.entry-choice strong,
.entry-choice small {
  display: block;
}

.entry-choice small {
  margin-top: 4px;
  color: inherit;
  opacity: 0.76;
}

.terms-choice a,
.entry-legal a,
.sidebar-legal a,
.billing-legal a {
  color: var(--qz-color-blue);
}

.legal-screen {
  background: var(--qz-color-page);
}

.legal-card {
  background: var(--qz-color-surface);
  border: var(--qz-border);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-card);
  box-shadow: var(--qz-shadow-card);
}

.balance-hero {
  color: var(--qz-color-ink);
  background: var(--qz-color-blue-soft);
  border: var(--qz-border);
  border-color: var(--qz-color-blue-line);
  border-radius: var(--qz-radius-card);
  box-shadow: var(--qz-shadow-card);
}

.package-card,
.metric-grid article,
.admin-user-credit {
  background: var(--qz-color-surface);
  border: var(--qz-border);
  border-color: var(--qz-color-line);
  box-shadow: none;
}

.package-card {
  border-radius: var(--qz-radius-block);
}

.package-card.featured {
  background: var(--qz-color-blue-soft);
  border-color: var(--qz-color-blue);
  box-shadow: var(--qz-shadow-selected);
}

.package-badge {
  color: white;
  background: var(--qz-color-coral);
  border: 0;
  border-radius: var(--qz-radius-pill);
}

.data-table-wrap {
  border: var(--qz-border);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-action);
}

.data-table {
  background: var(--qz-color-surface);
}

.data-table th {
  background: var(--qz-color-surface-soft);
}

.status-pill {
  color: var(--qz-color-muted);
  background: var(--qz-color-neutral-soft);
  border: 0;
  border-radius: var(--qz-radius-pill);
}

.status-paid {
  color: var(--qz-color-success);
  background: var(--qz-color-success-soft);
}

.status-refunded,
.status-partially_refunded {
  color: var(--qz-color-warning);
  background: var(--qz-color-warning-soft);
}

.admin-tabs button {
  color: var(--qz-color-muted);
  background: var(--qz-color-surface);
  border: var(--qz-border);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-control);
  box-shadow: none;
}

.admin-tabs button:hover {
  color: var(--qz-color-blue);
  background: var(--qz-color-blue-soft);
  border-color: var(--qz-color-blue-line);
}

.admin-tabs button.active,
.admin-tabs button.active:hover {
  color: white;
  background: var(--qz-color-blue);
  border-color: var(--qz-color-blue);
  box-shadow: var(--qz-shadow-selected);
}

.metric-grid article,
.admin-user-credit {
  border-radius: var(--qz-radius-block);
}

.admin-user-credit {
  background: var(--qz-color-surface-soft);
}

.preview-check,
.preview-player-banner,
.screen-preview-banner {
  color: var(--qz-color-blue);
  background: var(--qz-color-blue-soft);
  border-color: var(--qz-color-blue-line) !important;
}

.preview-stage > span {
  color: white;
  background: var(--qz-color-blue);
  border: var(--qz-border);
  border-color: var(--qz-color-blue);
  border-radius: var(--qz-radius-action);
}

@media (max-width: 980px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  .app-shell:not(.host-session-shell) {
    grid-template-columns: minmax(0, 1fr);
  }

  .mobile-nav-trigger {
    position: sticky;
    z-index: 45;
    top: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 62px;
    padding: 10px 16px;
    color: var(--qz-color-ink);
    background: var(--qz-color-surface);
    border: 0;
    border-bottom: 2px solid var(--qz-color-line);
    border-radius: 0;
    box-shadow: var(--qz-shadow-card);
    text-align: left;
  }

  .mobile-nav-trigger:hover {
    color: var(--qz-color-blue);
    background: var(--qz-color-blue-soft);
    transform: none;
  }

  .mobile-nav-trigger > i {
    color: var(--qz-color-blue);
    font-size: 24px;
  }

  .mobile-nav-trigger-title {
    overflow: hidden;
    font-family: "Unbounded Variable", sans-serif;
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-trigger-balance {
    color: var(--qz-color-blue);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
  }

  .mobile-nav-scrim {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: block;
    background: color-mix(in srgb, var(--qz-color-ink) 34%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .mobile-nav-scrim.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    z-index: 80;
    top: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: min(326px, calc(100vw - 36px));
    height: 100dvh;
    padding: 20px 18px 78px;
    overflow-y: auto;
    border-radius: 0 var(--qz-radius-card) var(--qz-radius-card) 0;
    box-shadow: var(--qz-shadow-card);
    transform: translateX(-104%);
    transition: transform 200ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -4px 0 12px;
    color: white;
    font-size: 12px;
    font-weight: 800;
  }

  .sidebar-mobile-head .icon-btn {
    width: 38px;
    height: 38px;
    color: white;
    background: color-mix(in srgb, var(--qz-color-surface) 12%, transparent);
    border-color: color-mix(in srgb, var(--qz-color-surface) 22%, transparent);
    box-shadow: none;
  }

  .sidebar-mobile-head .icon-btn:hover {
    background: color-mix(in srgb, var(--qz-color-surface) 20%, transparent);
  }

  .brand {
    margin-bottom: 22px;
  }

  .nav-item {
    justify-content: flex-start;
    width: 100%;
    text-align: left;
  }

  .sidebar-account {
    position: static;
    display: grid;
    margin-top: 24px;
  }

  .sidebar-account > span,
  .sidebar-account > strong,
  .sidebar-legal {
    display: block;
  }

  .sidebar-legal {
    display: grid;
  }

  .sidebar-logout {
    margin-top: 10px;
  }

  .sidebar-account .sidebar-logout {
    display: none;
  }

  .sidebar-mobile-logout {
    position: absolute;
    z-index: 3;
    right: 18px;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 9px 12px;
    color: white;
    background: var(--qz-color-blue);
    border: var(--qz-border);
    border-color: var(--qz-color-blue);
    border-radius: var(--qz-radius-control);
    box-shadow: var(--qz-shadow-selected);
    font-weight: 850;
  }

  .sidebar-mobile-logout:hover {
    color: white;
    background: var(--qz-color-blue);
    border-color: var(--qz-color-blue);
  }

  .workspace {
    min-height: calc(100dvh - 62px);
  }
}

@media (max-width: 680px) {
  .entry-card {
    padding: 24px 18px;
  }

  .entry-actions {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .auth-screen {
    padding: 8px;
  }

  .auth-card {
    width: min(400px, 100%);
    max-height: calc(100dvh - 16px);
    padding: 12px 14px;
  }

  .auth-card > img {
    width: 54px;
    height: 54px;
    margin-top: -1px;
  }

  .auth-card-intro {
    min-height: 62px;
  }

  .auth-card-intro h1 {
    margin: 5px 0 3px;
    font-size: 21px;
  }

  .auth-card-intro p {
    font-size: var(--qz-font-meta);
  }

  .auth-mode-tabs {
    margin-top: 7px;
  }

  .auth-mode-tabs button {
    padding: 7px;
  }

  .balance-hero {
    padding: 20px;
  }

  .package-card {
    align-items: flex-start;
    text-align: left;
  }

  .package-card .primary-btn {
    width: 100%;
    justify-content: center;
  }

  .admin-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .admin-tabs button {
    min-width: 0;
    white-space: normal;
  }

  .data-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table {
    min-width: 0;
    background: transparent;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    margin-bottom: 10px;
    padding: 5px 12px;
    background: var(--qz-color-surface);
    border: var(--qz-border);
    border-color: var(--qz-color-line);
    border-radius: var(--qz-radius-action);
  }

  .data-table td {
    display: grid;
    grid-template-columns: minmax(88px, 0.65fr) minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--qz-color-line);
    overflow-wrap: anywhere;
  }

  .data-table td:last-child {
    border-bottom: 0;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--qz-color-muted);
    font-size: var(--qz-font-meta);
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .data-table .empty-table-row {
    padding: 18px 12px;
  }

  .data-table .empty-table-row td {
    display: block;
    padding: 0;
    border: 0;
    text-align: center;
  }

  .data-table .empty-table-row td::before {
    content: none;
  }

  .admin-payment-table,
  .refund-form {
    min-width: 0;
  }

  .document-editor textarea {
    min-height: 420px;
  }

  .legal-card {
    padding: 24px 20px;
  }
}

/* Mobile polish for the billing release. Keep these overrides at the end of
   the cascade so the new account surfaces cannot disturb established layouts. */
@media (max-width: 980px) {
  .mobile-nav-trigger {
    gap: 9px;
    min-height: 58px;
    padding: 9px 12px;
  }

  .mobile-nav-trigger-title {
    min-width: 0;
    font-size: clamp(11px, 3.35vw, 14px);
  }

  .mobile-nav-trigger-balance {
    font-size: var(--qz-font-meta);
  }

  .sidebar {
    width: min(304px, calc(100vw - 28px));
    padding: 16px 14px 70px;
  }

  .sidebar-mobile-logout {
    right: 14px;
    left: 14px;
  }

  .sidebar-mobile-head {
    margin: 0 2px 10px;
  }

  .sidebar .brand {
    gap: 8px;
    margin-bottom: 14px;
  }

  .sidebar .brand-mark,
  .sidebar .brand-mark img {
    width: 48px;
    height: 48px;
  }

  .sidebar .brand strong {
    font-size: 17px;
  }

  .sidebar .nav-item {
    justify-content: flex-start;
    min-height: 44px;
    margin-bottom: 4px;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 14px;
  }

  .sidebar-account {
    gap: 2px;
    margin-top: 14px;
    padding: 12px;
    border-radius: 16px;
  }

  .sidebar-balance {
    width: 100%;
    margin: 0 0 8px;
    padding: 7px 9px;
  }

  .sidebar-account > span {
    font-size: 14px;
  }

  .sidebar-account > strong {
    font-size: var(--qz-font-meta);
  }

  .sidebar-legal {
    gap: 4px;
    margin-top: 8px;
  }

  .sidebar-legal a {
    font-size: var(--qz-font-meta);
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .sidebar-logout {
    min-height: 34px;
    margin-top: 8px;
    font-size: 12px;
  }
}

@media (max-width: 680px) {
  .view-payment .workspace > .topbar,
  .view-admin .workspace > .topbar {
    display: none;
  }

  .view-payment .workspace,
  .view-admin .workspace {
    padding-top: 16px;
  }

  .view-quizzes .dashboard-quiz .row-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) 38px;
  }

  .view-quizzes .dashboard-quiz .row-actions .primary-btn {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 42px;
  }

  .view-quizzes .dashboard-quiz .row-actions .icon-btn {
    grid-column: 3;
    grid-row: 1;
  }

  .billing-page,
  .admin-content {
    gap: 14px;
  }

  .view-payment .balance-hero {
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
  }

  .view-payment .balance-hero > div strong {
    font-size: 40px;
  }

  .view-payment .balance-hero > div em {
    font-size: 18px;
  }

  .view-payment .balance-hero p {
    font-size: 13px;
    line-height: 1.42;
  }

  .view-payment .panel {
    padding: 16px;
  }

  .view-payment .panel-head {
    margin-bottom: 12px;
  }

  .view-payment .panel-head h2 {
    font-size: 20px;
  }

  .view-payment .panel-head p {
    font-size: 13px;
    line-height: 1.4;
  }

  .view-payment .package-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 14px;
  }

  .view-payment .package-card {
    align-items: center;
    padding: 18px 9px 12px;
    border-radius: 16px;
    text-align: center;
  }

  .view-payment .package-card > strong {
    font-size: 34px;
  }

  .view-payment .package-card > span:not(.package-badge) {
    margin: 2px 0 10px;
    font-size: 12px;
  }

  .view-payment .package-card h3 {
    font-size: 18px;
  }

  .view-payment .package-card small {
    margin: 3px 0 12px;
    font-size: var(--qz-font-meta);
  }

  .view-payment .package-card .primary-btn {
    min-height: 40px;
    padding: 8px;
    font-size: 12px;
  }

  .view-admin .admin-tabs {
    display: flex;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0 0 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .view-admin .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .view-admin .admin-tabs button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .view-admin .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .view-admin .metric-grid article {
    padding: 14px;
  }

  .view-admin .metric-grid strong {
    font-size: 22px;
  }

  .launch-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    padding: 18px 16px;
    overflow-y: auto;
  }

  .launch-dialog h2 {
    margin: 7px 0 14px;
    font-size: 23px;
    line-height: 1.12;
  }

  .launch-dialog .dialog-kicker {
    font-size: var(--qz-font-meta);
  }

  .launch-dialog .launch-check {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .launch-dialog .launch-check > i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .launch-dialog .preview-check > i {
    background: var(--qz-color-blue);
  }

  .launch-dialog .launch-check strong {
    font-size: 14px;
    line-height: 1.25;
  }

  .launch-dialog .launch-check small {
    font-size: var(--qz-font-meta);
    line-height: 1.35;
  }

  .launch-dialog .dialog-actions {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 8px;
    margin-top: 14px;
  }

  .launch-dialog .dialog-actions > * {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.15;
    white-space: normal;
  }

  .host-session-mode {
    width: auto;
    max-width: 100%;
    overflow: visible;
    font-size: var(--qz-font-meta);
    line-height: 1.2;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 360px) {
  .mobile-nav-trigger-balance {
    font-size: var(--qz-font-meta);
  }

  .view-payment .package-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Focused account and administration refinements. */
.auth-form-stage {
  min-height: 274px;
}

.auth-form-stage .login-form {
  gap: 10px;
  margin-top: 12px;
}

.auth-form-stage .login-form label {
  gap: 4px;
  font-size: 12px;
}

.auth-form-stage .login-form input {
  min-height: 42px;
  padding: 9px 11px;
}

.auth-form-stage .login-form .primary-btn {
  min-height: 42px;
}

.auth-card .terms-choice {
  font-size: var(--qz-font-meta);
  line-height: 1.35;
}

.auth-card .entry-legal {
  margin-top: 10px;
}

.quiz-meta span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  line-height: 1.15;
  text-align: center;
}

.launch-dialog .preview-check > i {
  color: white;
  background: var(--qz-color-blue);
  border-color: var(--qz-color-blue);
}

.admin-tabs {
  align-items: stretch;
  gap: 10px;
}

.admin-tabs button,
.admin-tabs button:hover,
.admin-tabs button.active,
.admin-tabs button.active:hover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--qz-radius-action);
  font-size: 13px;
  line-height: 1.15;
}

.admin-tabs button:not(.active),
.admin-tabs button:not(.active):hover {
  color: var(--qz-color-blue);
  background: var(--qz-color-surface);
  border-color: var(--qz-color-blue-line);
}

.admin-user-credit.is-inactive {
  opacity: 0.68;
}

.admin-user-actions {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-user-actions .current-account-label {
  margin-left: 2px;
}

.user-edit-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.user-active-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--qz-color-ink);
}

.user-active-choice input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.event-registry {
  margin-top: 18px;
}

.event-registry summary {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  color: var(--qz-color-blue);
  background: var(--qz-color-surface);
  border: var(--qz-border);
  border-color: var(--qz-color-blue-line);
  border-radius: var(--qz-radius-action);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.event-registry summary::-webkit-details-marker {
  display: none;
}

.event-registry summary strong {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  min-height: 25px;
  padding: 0 7px;
  color: white;
  background: var(--qz-color-blue);
  border-radius: var(--qz-radius-pill);
  font-size: var(--qz-font-meta);
}

.event-registry[open] summary {
  margin-bottom: 12px;
  background: var(--qz-color-blue-soft);
}

.data-table td small {
  display: block;
  margin-top: 3px;
  color: var(--qz-color-muted);
  font-size: var(--qz-font-meta);
}

@media (max-width: 680px) {
  .auth-form-stage {
    min-height: 252px;
  }

  .auth-form-stage .login-form {
    gap: 8px;
    margin-top: 9px;
  }

  .auth-form-stage .login-form label {
    font-size: var(--qz-font-meta);
  }

  .auth-form-stage .login-form input {
    min-height: 38px;
    padding: 7px 9px;
  }

  .auth-form-stage .login-form .primary-btn {
    min-height: 40px;
  }

  .auth-card .field-help {
    font-size: var(--qz-font-meta);
    line-height: 1.2;
  }

  .auth-card .terms-choice {
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 7px;
    font-size: var(--qz-font-meta);
    line-height: 1.25;
  }

  .auth-card .terms-choice input {
    width: 16px;
    height: 16px;
    min-height: 16px;
  }

  .auth-card .entry-legal {
    gap: 4px 8px;
    margin-top: 7px;
  }

  .auth-card .entry-legal a {
    font-size: var(--qz-font-meta);
  }

  .view-admin .admin-tabs button,
  .view-admin .admin-tabs button:hover,
  .view-admin .admin-tabs button.active,
  .view-admin .admin-tabs button.active:hover {
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 12px;
    font-size: 12px;
  }

  .admin-user-actions,
  .admin-user-credit form {
    grid-column: 1 / -1;
  }

  .admin-user-actions .ghost-btn {
    flex: 1 1 140px;
  }

  .event-registry summary {
    width: 100%;
    justify-content: center;
  }
}

/* Registration consent remains one clear, tappable control at every width. */
.auth-card {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.auth-form-stage .login-form .terms-choice {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  color: var(--qz-color-muted);
  background: var(--qz-color-surface-soft);
  border: var(--qz-border);
  border-radius: var(--qz-radius-control);
  font-size: var(--qz-font-meta);
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}

.auth-form-stage .login-form .terms-choice > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.auth-form-stage .login-form .terms-choice input[type="checkbox"] {
  box-sizing: border-box;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--qz-color-blue);
  background: transparent;
  border: 0;
  border-radius: 5px;
  box-shadow: none;
  cursor: pointer;
}

.auth-form-stage .login-form .terms-choice input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(49, 85, 245, .24);
  outline-offset: 2px;
}

.auth-form-stage .login-form .terms-choice a {
  text-underline-offset: 2px;
}

/* Every question image uses the same no-crop rule on shared, player and host screens. */
.question-media-frame,
.player-question-media-frame,
.host-stage-media-frame {
  position: relative;
}

.question-media-frame .question-illustration,
.player-question-media-frame .question-illustration,
.host-stage-media-frame .question-illustration {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  object-fit: contain;
  object-position: center;
  background: transparent;
  border: 0;
  border-radius: inherit;
}

.host-stage-media-frame .question-illustration {
  box-sizing: border-box;
  padding: 8px;
}

.player-question-media-frame {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(42dvh, 420px);
  margin: 4px auto 14px;
  overflow: hidden;
  background: var(--qz-color-blue-soft);
  border: var(--qz-border);
  border-color: var(--qz-color-blue-line);
  border-radius: var(--qz-radius-block);
}

/* A compact, consistent hierarchy for the quiz editor. */
.calm-editor .round-block {
  overflow: hidden;
  background: var(--qz-color-surface);
  border: var(--qz-border);
  border-color: var(--qz-color-gold-line);
  border-radius: var(--qz-radius-block);
  box-shadow: var(--qz-shadow-gold);
}

.calm-editor .round-head {
  background: var(--qz-color-gold-soft);
}

.calm-editor .round-body {
  padding: 14px;
  background: var(--qz-color-surface);
  border-top: 1px solid var(--qz-color-gold-line);
}

.calm-editor .question-block {
  background: var(--qz-color-surface);
  border: var(--qz-border);
  border-color: var(--qz-color-line);
  border-left: 5px solid var(--qz-color-blue);
  border-radius: var(--qz-radius-action);
  box-shadow: none;
}

.calm-editor .question-head {
  min-height: 52px;
  padding: 8px 10px;
}

.calm-editor .question-number {
  width: 32px;
  min-width: 32px;
  height: 32px;
  font-family: var(--qz-font-body);
  font-size: 13px;
  font-weight: 900;
}

.calm-editor .question-title strong {
  font-family: var(--qz-font-body);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.22;
  letter-spacing: 0;
}

.calm-editor .question-title em {
  margin-top: 1px;
  font-size: var(--qz-font-meta);
  line-height: 1.25;
}

.calm-editor .question-actions {
  gap: 4px;
}

.calm-editor .question-actions .icon-btn,
.calm-editor .question-actions .drag-handle {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: var(--qz-radius-small);
}

.calm-editor .question-body-fields {
  gap: 10px;
  padding: 12px;
  background: var(--qz-color-surface);
  border-top: 1px solid var(--qz-color-line);
}

.calm-editor .form-grid > label,
.calm-editor .question-body-fields > label {
  gap: 5px;
  color: var(--qz-color-muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.calm-editor .form-grid textarea,
.calm-editor .question-body-fields > label > textarea {
  min-height: 46px;
  padding: 10px 12px;
  color: var(--qz-color-ink);
  font-size: 14px;
  line-height: 1.35;
}

.calm-editor .image-source-editor {
  margin: 0;
}

.calm-editor .image-source-editor summary {
  min-height: 44px;
  padding: 8px 11px;
}

.calm-editor .question-points {
  grid-template-columns: minmax(210px, .82fr) minmax(300px, 1.18fr);
  align-items: center;
  gap: 8px 12px;
  margin: 0;
  padding: 10px 12px;
  background: var(--qz-color-neutral-soft);
  border: var(--qz-border);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-control);
}

.calm-editor .question-points > div:first-child {
  gap: 8px;
}

.calm-editor .question-points strong {
  font-size: 13px;
  line-height: 1.2;
}

.calm-editor .question-points small {
  font-size: var(--qz-font-meta);
}

.calm-editor .points-choice {
  gap: 6px;
}

.calm-editor .points-choice button {
  min-height: 38px;
  padding: 7px 9px;
  border-width: var(--qz-border-width);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-small);
  font-size: var(--qz-font-meta);
}

.calm-editor .custom-points-input {
  grid-column: 2;
  grid-template-columns: minmax(0, 1fr) 90px;
  gap: 8px;
  margin: 0;
  font-size: var(--qz-font-meta);
}

.calm-editor .custom-points-input input {
  min-height: 38px;
  padding: 7px 9px;
}

.calm-editor .answer-type-hint {
  padding: 9px 11px;
  background: var(--qz-color-success-soft);
  border: var(--qz-border);
  border-color: var(--qz-color-success-line);
  border-radius: var(--qz-radius-control);
  font-size: 12px;
}

.calm-editor .options-editor {
  gap: 8px;
  margin-top: 0;
}

.calm-editor .option-line {
  gap: 8px;
  padding: 8px 10px;
  background: var(--qz-color-surface-soft);
  border: var(--qz-border);
  border-color: var(--qz-color-line);
  border-radius: var(--qz-radius-control);
}

.calm-editor .option-content {
  gap: 3px;
}

.calm-editor .option-content > input {
  min-height: 42px;
  padding: 8px 11px;
  font-size: 14px;
}

.calm-editor .image-source-editor.compact {
  background: transparent;
  border: 0;
}

.calm-editor .image-source-editor.compact summary {
  min-height: 34px;
  padding: 4px 7px;
}

.calm-editor .round-settings,
.calm-editor .bottom-item-toolbar {
  border: var(--qz-border);
  border-color: var(--qz-color-line);
  box-shadow: none;
}

@media (min-width: 681px) {
  .calm-editor .question-actions {
    grid-template-columns: repeat(5, 34px);
  }
}

@media (max-width: 680px) {
  .auth-form-stage .login-form .terms-choice {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 9px;
    padding: 9px 10px;
    font-size: var(--qz-font-meta);
    line-height: 1.35;
  }

  .auth-form-stage .login-form .terms-choice input[type="checkbox"] {
    width: 20px;
    min-width: 20px;
    height: 20px;
    min-height: 20px;
    padding: 0;
  }

  .player-question-media-frame {
    aspect-ratio: 4 / 3;
    max-height: 40dvh;
    border-radius: var(--qz-radius-action);
  }

  .calm-editor .round-body {
    padding: 10px;
  }

  .calm-editor .question-head {
    min-height: 48px;
    padding: 7px 8px;
  }

  .calm-editor .question-title strong {
    font-size: 13px;
  }

  .calm-editor .question-actions {
    grid-template-columns: repeat(5, 32px);
    gap: 4px;
  }

  .calm-editor .question-actions .icon-btn,
  .calm-editor .question-actions .drag-handle {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
  }

  .calm-editor .question-body-fields {
    gap: 8px;
    padding: 10px;
  }

  .calm-editor .form-grid textarea,
  .calm-editor .question-body-fields > label > textarea {
    min-height: 44px;
    padding: 9px 10px;
  }

  .calm-editor .question-points {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .calm-editor .custom-points-input {
    grid-column: 1;
  }

  .calm-editor .option-line {
    gap: 6px;
    padding: 7px;
  }
}


/* Shared interaction rules: the editor and navigation set the product baseline. */
.primary-btn.danger-btn,
.primary-btn.danger-btn:hover,
.icon-btn.accent {
  color: var(--qz-color-ink);
}

.package-badge,
.calm-editor .question-number,
.calm-editor .round-summary > span:first-child {
  color: #fff;
}

.form-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 14px;
  color: var(--qz-color-danger);
  background: var(--qz-color-danger-soft);
  border: var(--qz-border-width) solid var(--qz-color-coral-line);
  border-radius: var(--qz-radius-control);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn,
.auth-back,
.auth-mode-tabs button,
.view-admin .admin-tabs button,
.view-payment .package-card .primary-btn,
.auth-form-stage .login-form .primary-btn,
.calm-editor .points-choice button,
.image-source-controls .image-remove-btn {
  min-height: var(--qz-control-height);
}

.calm-editor .question-actions {
  grid-template-columns: repeat(5, var(--qz-control-height));
}

.calm-editor .question-actions .icon-btn,
.calm-editor .question-actions .drag-handle,
.calm-editor .option-line > .icon-btn {
  width: var(--qz-control-height);
  min-width: var(--qz-control-height);
  height: var(--qz-control-height);
  min-height: var(--qz-control-height);
}

.auth-form-stage .login-form input:not([type="checkbox"]),
.admin-user-form input,
.user-edit-form input:not([type="checkbox"]),
.password-reset-form input {
  min-height: var(--qz-control-height);
  font-size: 16px;
}

.entry-legal a,
.sidebar-legal a,
.field-help,
.calm-editor .question-title em,
.calm-editor .question-points small {
  font-size: var(--qz-font-meta);
  line-height: 1.4;
}

.confirm-dialog {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

:is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--qz-color-gold);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .sidebar { visibility: hidden; }
  .sidebar.is-open { visibility: visible; }
  .mobile-nav-scrim { visibility: hidden; }
  .mobile-nav-scrim.is-visible { visibility: visible; }
}

@media (max-width: 680px) {
  .calm-editor .question-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .calm-editor .question-actions {
    justify-content: end;
  }
  .auth-card .entry-legal a {
    font-size: var(--qz-font-meta);
  }
  .auth-form-stage .login-form label {
    font-size: 13px;
  }
  .host-session-mode {
    font-size: var(--qz-font-meta);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* All administration sections remain discoverable on narrow screens. */
.view-admin .admin-tabs {
  flex-wrap: wrap;
  overflow: visible;
}

@media (max-width: 680px) {
  .view-admin .admin-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }
  .view-admin .admin-tabs button,
  .view-admin .admin-tabs button:hover,
  .view-admin .admin-tabs button.active,
  .view-admin .admin-tabs button.active:hover {
    width: 100%;
    min-width: 0;
    min-height: var(--qz-control-height);
    white-space: normal;
    border-radius: var(--qz-radius-action);
  }
}

.user-avatar {
  color: var(--qz-color-blue);
  background: var(--qz-color-blue-soft);
}
.legal-card .auth-kicker {
  color: var(--qz-color-muted);
}
