@font-face {
  font-family: "InterVariable";
  src: url("./assets/InterVariable.woff2?v=4.1") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0e1218;
  --surface: #171c24;
  --surface-2: #1d2430;
  --surface-3: #273241;
  --border: #2a3545;
  --border-soft: #202a36;
  --text: #f2f5f8;
  --muted: #a2b0c2;
  --faint: #8d9cb0;
  --red: #f25555;
  --red-dark: #c53c47;
  --gold: #f3c74e;
  --green: #32d296;
  --green-soft: rgba(50, 210, 150, 0.14);
  --blue: #63b3ff;
  --teal: #4fd4b0;
  --amber: #f5bb4b;
  --coral: #f37875;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;
  --text-display: 68px;
  --weight-regular: 400;
  --weight-semibold: 600;
  --weight-display: 800;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-modal: 18px;
  --radius-pill: 999px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "InterVariable", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-optical-sizing: auto;
  font-feature-settings: "liga" 1, "calt" 1;
  font-weight: var(--weight-regular);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

body {
  overscroll-behavior-y: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
a,
summary,
input,
textarea,
select {
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 120ms ease;
}

button,
summary {
  touch-action: manipulation;
}

button:not(:disabled):active,
summary:active {
  transform: translateY(1px) scale(0.985);
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

@media (hover: hover) {
  .btn:not(:disabled):hover,
  .tab:not(:disabled):hover,
  .segment:not(:disabled):hover,
  .icon-btn:not(:disabled):hover,
  .content-open:not(:disabled):hover,
  .dashboard-shortcuts > button:not(:disabled):hover {
    filter: brightness(1.08);
  }
}

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

.app-shell {
  min-height: 100dvh;
  background: var(--bg);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: calc(64px + var(--safe-top));
  padding: calc(11px + var(--safe-top)) 17px 11px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(14, 18, 24, 0.94);
  backdrop-filter: blur(20px);
}

.brand-mark {
  width: 54px;
  height: 46px;
  flex: 0 0 auto;
}

.repte-logo {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius);
  object-fit: cover;
}

.brand-copy {
  line-height: 1;
}

.brand-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 3px;
}

.brand-title {
  display: block;
  color: var(--red);
  font-size: var(--text-md);
  font-weight: var(--weight-display);
  letter-spacing: 1.5px;
}

.connection-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.connection-dot.demo {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.header-notification-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
}

.header-notification-button:hover,
.header-notification-button:active {
  border-color: rgba(52, 199, 89, 0.55);
  background: rgba(52, 199, 89, 0.1);
}

.header-notification-button svg { width: 19px; height: 19px; }
.header-notification-button > span {
  position: absolute;
  top: -3px;
  right: -3px;
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: var(--weight-bold);
}

.main-content {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 22px 16px calc(88px + var(--safe-bottom));
}

.page-head {
  margin-bottom: 20px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: var(--text-3xl);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 11px;
  font-size: var(--text-xl);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 5px;
  font-size: var(--text-md);
}

.muted {
  color: var(--muted);
}

.caption {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.section-title {
  margin: 25px 0 12px;
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.panel,
.routine-row,
.history-row,
.diagnostic-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel {
  padding: 15px;
}

.score-panel {
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
}

.score-panel small {
  display: block;
  color: var(--faint);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.score-panel strong {
  display: block;
  margin-top: 3px;
  color: var(--gold);
  font-size: var(--text-lg);
}

.score-pass,
.score-fail {
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  padding: 6px 9px;
  font-size: var(--text-xs);
  font-weight: var(--weight-display);
}

.score-pass {
  background: rgba(52, 199, 89, 0.14);
  color: var(--green);
}

.score-fail {
  background: rgba(229, 9, 47, 0.16);
  color: #ff4969;
}

.plan-day {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
}

.plan-day.done {
  border-color: rgba(52, 199, 89, 0.35);
  background: rgba(52, 199, 89, 0.07);
}

.plan-note {
  min-height: 74px;
  margin-top: 4px;
  font-size: var(--text-sm);
}

.stack {
  display: grid;
  gap: 13px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-panel {
  margin-top: 13px;
  border-color: rgba(255, 215, 0, 0.22);
}

.quick-panel h3 {
  margin: 8px 0 4px;
}

.ai-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}

.ai-heading svg {
  width: 17px;
  height: 17px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.btn {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 13px;
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.btn:disabled {
  cursor: progress;
  opacity: 0.55;
}

.btn-primary {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-outline-red {
  border-color: var(--red);
  color: var(--red);
}

.btn-outline-gold {
  border-color: rgba(255, 215, 0, 0.55);
  color: var(--gold);
}

.btn-green {
  border-color: var(--green);
  background: var(--green);
  color: #08140b;
}

.btn-danger {
  border-color: rgba(229, 9, 47, 0.6);
  color: #ff4969;
}

.btn-wide {
  width: 100%;
}

.primary-action {
  min-height: 50px;
  margin-top: 14px;
  font-size: var(--text-base);
  letter-spacing: 0.3px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 25px;
}

.section-heading .section-title {
  margin: 0 0 12px;
}

.btn-compact {
  min-height: 34px;
  margin-bottom: 12px;
  padding: 0 11px;
  color: var(--green);
}

.btn-compact.btn-green {
  color: #08140b;
}

.routine-list,
.history-list,
.diagnostics-list {
  display: grid;
  gap: 9px;
}

.routine-row,
.history-row,
.diagnostic-row {
  padding: 14px;
}

.routine-preview {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.preview-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.preview-row small {
  flex: 0 0 auto;
  color: var(--faint);
}

.history-head {
  align-items: flex-start;
}

.history-head .history-open {
  flex: 1 1 auto;
  min-width: 0;
}

.history-score-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex: 0 0 auto;
}

.history-score-actions .text-btn {
  font-size: var(--text-xs);
}

.mini-actions {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 10px;
}

.text-btn,
.history-open,
.diagnostic-open {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--green);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-align: left;
}

.danger-text {
  color: #ff5c76;
}

.history-stats,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.history-stats {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.history-stats span,
.metric-grid span {
  display: grid;
  gap: 3px;
}

.history-stats small,
.metric-grid small {
  color: var(--faint);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
}

.volume-chart {
  display: flex;
  height: 150px;
  align-items: end;
  justify-content: space-around;
  gap: 9px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.volume-chart span {
  width: min(34px, 12%);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--green);
}

.routine-meta,
.history-meta {
  color: var(--muted);
  font-size: var(--text-sm);
}

.tiny-label {
  display: block;
  color: var(--faint);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.metric {
  color: var(--red);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.field-grid {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 5px;
}

.field label {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 11px;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
}

.textarea {
  min-height: 140px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 9, 47, 0.13);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #0a0a0b;
}

.filter-row {
  display: flex;
  gap: 7px;
  margin-bottom: 13px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.filter-chip {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.filter-chip.active {
  border-color: var(--green);
  background: var(--green);
  color: #07120a;
}

.exercise-library {
  display: grid;
  max-height: 42dvh;
  gap: 6px;
  overflow: auto;
}

.exercise-option {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 9px 11px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.exercise-option small {
  color: var(--faint);
  font-size: var(--text-xs);
}

.exercise-option b {
  color: var(--green);
  font-size: var(--text-xl);
}

.custom-exercise {
  margin-top: 14px;
}

.segment {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.segment.active {
  background: var(--surface-3);
  color: var(--green);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + var(--safe-bottom));
  border-top: 1px solid var(--border-soft);
  background: rgba(14, 18, 24, 0.96);
  backdrop-filter: blur(20px);
}

.tab {
  display: grid;
  min-height: 52px;
  place-items: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.tab svg {
  width: 19px;
  height: 19px;
}

.tab.active {
  color: var(--red);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.72);
}

.modal {
  max-height: 92dvh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-modal) var(--radius-modal) 0 0;
  padding: 18px 16px calc(22px + var(--safe-bottom));
  background: var(--surface);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.icon-btn {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.notice {
  padding: 11px 12px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 215, 0, 0.08);
  color: #ffe876;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.error {
  padding: 11px 12px;
  border: 1px solid rgba(229, 9, 47, 0.45);
  border-radius: var(--radius);
  background: rgba(229, 9, 47, 0.12);
  color: #ff6c85;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.success {
  padding: 11px 12px;
  border: 1px solid rgba(52, 199, 89, 0.42);
  border-radius: var(--radius);
  background: rgba(52, 199, 89, 0.1);
  color: #82e79a;
  font-size: var(--text-sm);
}

.auth-shell {
  display: grid;
  min-height: 100dvh;
  align-content: center;
  padding: 28px 20px;
  background: var(--bg);
}

.auth-card {
  width: min(100%, 420px);
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.auth-logo {
  width: 96px;
  height: 80px;
  margin: 0 auto 15px;
}

.repte-logo-large {
  border-radius: var(--radius-lg);
}

.auth-title {
  margin-bottom: 7px;
  color: var(--red);
  text-align: center;
  font-size: var(--text-xl);
  font-weight: var(--weight-display);
  letter-spacing: 1.3px;
}

.auth-copy {
  margin-bottom: 18px;
  color: var(--muted);
  text-align: center;
  font-size: var(--text-base);
  line-height: 1.45;
}

.trial-offer {
  margin: 0 0 18px;
  border: 1px solid rgba(245, 179, 1, .5);
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(245, 179, 1, .08);
  text-align: left;
}
.trial-offer strong { color: var(--gold); font-size: var(--text-base); }
.trial-offer p { margin: 6px 0 14px; color: var(--muted); font-size: var(--text-sm); }
.trial-offer a { text-decoration: none; }

.auth-support {
  margin: 17px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: var(--text-xs);
  line-height: 1.45;
}

.auth-support a {
  color: var(--gold);
  font-weight: var(--weight-semibold);
}

.live-bar {
  position: sticky;
  bottom: calc(63px + var(--safe-bottom));
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid rgba(52, 199, 89, 0.55);
  border-radius: var(--radius-lg);
  background: #101712;
}

.set-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) 44px;
  gap: 7px;
  align-items: center;
}

.set-labels {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1fr) 44px;
  gap: 7px;
  color: var(--faint);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-align: center;
}

.set-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.check-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}

.check-btn.done {
  border-color: var(--green);
  background: rgba(52, 199, 89, 0.12);
  color: var(--green);
}

.empty {
  padding: 24px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
  font-size: var(--text-base);
}

.install-hint {
  display: none;
}

a {
  color: var(--gold);
}

@media (min-width: 760px) {
  .main-content {
    padding-top: 30px;
  }

  .modal-backdrop {
    place-items: center;
  }

  .modal {
    width: min(92vw, 620px);
    border-radius: var(--radius-modal);
    padding-bottom: 20px;
  }
}

@media (display-mode: browser) and (max-width: 640px) {
  .install-hint {
    display: block;
  }
}

.bottom-nav.four-tabs {
  grid-template-columns: repeat(4, 1fr);
}

.icon-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.icon-text svg,
.btn svg,
.test-meta svg,
.timer-pill svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.test-list,
.episode-list,
.answer-list {
  display: grid;
  gap: 11px;
}

.episode-group {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.episode-group[open] {
  border-color: rgba(242, 85, 85, 0.5);
  background: var(--surface-2);
}

.episode-group.empty-episode {
  background: var(--surface);
}

.episode-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 11px;
  cursor: pointer;
  list-style: none;
}

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

.episode-summary::after {
  content: "";
  grid-column: 3;
  grid-row: 1;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255, 255, 255, 0.66);
  border-bottom: 2px solid rgba(255, 255, 255, 0.66);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.episode-group[open] .episode-summary::after {
  transform: rotate(225deg);
}

.episode-title {
  overflow: hidden;
  min-width: 0;
  color: var(--text);
  font-size: var(--text-base);
  font-weight: var(--weight-display);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-count {
  grid-column: 2;
  grid-row: 1;
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  background: rgba(255, 215, 0, 0.075);
  color: var(--gold);
  font-size: var(--text-xs);
  font-weight: var(--weight-display);
  line-height: 1;
  white-space: nowrap;
}

.empty-episode .episode-count {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.episode-body {
  display: grid;
  gap: 11px;
  padding: 0 10px 10px;
}

.episode-body .test-card {
  background: var(--surface-2);
}

.result-episode-body .history-row {
  background: var(--surface-2);
}

.result-episode-group[open] {
  border-color: rgba(63, 183, 255, 0.38);
  background: var(--surface-2);
}

.result-category-group[open] {
  border-color: rgba(52, 199, 89, 0.38);
  background: var(--surface-2);
}

.admin-test-groups {
  padding-bottom: 4px;
}

.admin-episode-body .admin-test-row {
  background: var(--surface-2);
}

.admin-category-group[open] {
  border-color: rgba(255, 215, 0, 0.38);
  background: var(--surface-2);
}

.admin-test-row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-test-copy {
  min-width: 0;
}

.admin-test-copy h3 {
  overflow-wrap: anywhere;
  margin: 0 0 5px;
}

.admin-test-copy .caption {
  margin: 0;
}

.admin-test-actions {
  flex: 0 0 auto;
  margin-top: 2px;
}

@media (max-width: 430px) {
  .admin-test-row-main {
    display: grid;
  }

  .admin-test-actions {
    margin-top: 3px;
  }
}

.compact-empty {
  min-height: 74px;
  padding: 18px;
}

.test-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  background: var(--surface);
}

.test-card h3 {
  margin: 12px 0 6px;
  font-size: var(--text-lg);
  line-height: 1.2;
}

.type-pill {
  border-radius: var(--radius-pill);
  padding: 6px 9px;
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--weight-display);
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.type-pill.tema {
  background: var(--red);
}

.type-pill.bloc {
  background: #2f7df6;
}

.type-pill.simulacre {
  background: var(--green);
  color: #07120a;
}

.test-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.test-card-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.test-card-stats span {
  display: grid;
  gap: 3px;
}

.test-card-stats small {
  color: var(--faint);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
}

.test-card-stats strong {
  color: var(--text);
  font-size: var(--text-base);
}

.sticky-filter {
  position: sticky;
  top: calc(64px + var(--safe-top));
  z-index: 9;
  margin: 14px -16px 13px;
  padding: 8px 16px;
  background: rgba(14, 18, 24, 0.94);
  backdrop-filter: blur(18px);
}

@media (max-width: 520px) {
  .episode-list {
    gap: 8px;
  }

  .test-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.locked-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.locked-row svg {
  width: 30px;
  height: 30px;
  color: var(--gold);
}

.exam-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.exam-head h1 {
  margin-top: 4px;
  font-size: var(--text-2xl);
}

.timer-pill {
  display: inline-flex;
  min-width: 100px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(255, 215, 0, 0.38);
  border-radius: var(--radius-pill);
  background: rgba(255, 215, 0, 0.08);
  color: var(--gold);
  font-size: var(--text-sm);
  font-weight: var(--weight-display);
}

.timer-pill.muted-timer {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--muted);
}

.progress-panel,
.question-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.progress-panel {
  padding: 12px;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.progress-track {
  height: 8px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.question-card {
  margin-top: 13px;
  padding: 16px;
}

.question-card h2 {
  margin: 7px 0 15px;
  font-size: var(--text-xl);
  line-height: 1.3;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.question-category {
  border: 1px solid rgba(180, 140, 255, 0.34);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  background: rgba(180, 140, 255, 0.08);
  color: #c8a9ff;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.question-stimulus {
  display: grid;
  place-items: center;
  margin: 0 0 15px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px;
  background: #f5f7fa;
}

.question-stimulus img {
  display: block;
  width: 100%;
  max-width: 660px;
  height: auto;
}

.question-count {
  color: var(--faint);
  font-size: var(--text-xs);
  font-weight: var(--weight-display);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.option-list {
  display: grid;
  gap: 9px;
}

.option-btn {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  line-height: 1.35;
}

.option-btn.selected {
  border-color: var(--red);
  background: rgba(229, 9, 47, 0.13);
}

.option-letter {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--gold);
  font-size: var(--text-sm);
  font-weight: var(--weight-display);
}

.exam-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.question-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 7px;
  margin-top: 13px;
}

.question-map button {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.question-map button.done {
  border-color: rgba(52, 199, 89, 0.5);
  color: var(--green);
}

.question-map button.active {
  border-color: var(--red);
  color: var(--red);
}

.exam-exit {
  margin-top: 14px;
}

.vertical-actions {
  display: grid;
  margin-top: 14px;
}

.answer-review {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 13px;
  background: var(--surface);
}

.answer-review.correct {
  border-color: rgba(52, 199, 89, 0.42);
}

.answer-review.wrong {
  border-color: rgba(229, 9, 47, 0.5);
}

.answer-review.blank {
  border-color: rgba(255, 215, 0, 0.35);
}

.answer-review h3 {
  margin-top: 7px;
  line-height: 1.3;
}

.answer-review p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.45;
}

.review-block {
  border-left: 3px solid var(--gold);
  padding-left: 10px;
  color: #ffe876 !important;
}

.result-hero {
  margin-bottom: 13px;
}

.result-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.result-summary-grid span {
  display: grid;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px;
  background: var(--surface-2);
}

.result-summary-grid small,
.category-results small {
  color: var(--muted);
  font-size: var(--text-xs);
}

.category-results {
  display: grid;
  gap: 9px;
  margin-bottom: 13px;
  border: 1px solid rgba(180, 140, 255, 0.28);
  border-radius: var(--radius-lg);
  padding: 13px;
  background: rgba(180, 140, 255, 0.05);
}

.category-results > div {
  display: grid;
  gap: 7px;
}

.category-results article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-results article span {
  display: grid;
  gap: 2px;
}

.category-results article b {
  color: #c8a9ff;
}

.manual-entry {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  border-color: rgba(255, 215, 0, 0.28);
  background: var(--surface);
}

.manual-entry-icon,
.manual-intro-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 215, 0, 0.34);
  border-radius: var(--radius-lg);
  background: rgba(255, 215, 0, 0.1);
  color: var(--gold);
}

.manual-entry-icon svg,
.manual-intro-icon svg {
  width: 19px;
  height: 19px;
}

.manual-entry-copy {
  min-width: 0;
}

.manual-entry-copy h3 {
  margin: 3px 0 5px;
  font-size: var(--text-lg);
}

.manual-entry-copy p {
  margin: 0 0 11px;
}

.manual-intro {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 13px;
  padding: 4px 2px 12px;
  border-bottom: 1px solid var(--border);
}

.manual-intro strong {
  display: block;
  margin-bottom: 3px;
  font-size: var(--text-md);
}

.manual-intro p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.manual-list {
  display: grid;
  gap: 8px;
}

.manual-section {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.manual-section[open] {
  border-color: rgba(63, 183, 255, 0.34);
  background: var(--surface-2);
}

.manual-section summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  color: var(--text);
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  list-style: none;
}

.manual-section summary::-webkit-details-marker {
  display: none;
}

.manual-chevron {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: var(--text-lg);
  line-height: 1;
  transition: transform 0.18s ease;
}

.manual-section[open] .manual-chevron {
  transform: rotate(180deg);
}

.manual-section-body {
  padding: 0 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.manual-section-body p {
  margin: 10px 0 0;
}

.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.test-import-area {
  min-height: 260px;
  line-height: 1.45;
}

@media (max-width: 420px) {
  .exam-head {
    display: grid;
  }

  .timer-pill {
    justify-self: start;
  }

  .exam-actions {
    grid-template-columns: 1fr;
  }

  .two-cols {
    grid-template-columns: 1fr;
  }
}

/* Academy shell */
.has-mini-player .main-content {
  padding-bottom: calc(154px + var(--safe-bottom));
}

.home-welcome {
  padding: 3px 0 19px;
  border-bottom: 1px solid var(--border);
}

.home-welcome h1 {
  max-width: 520px;
  margin: 5px 0 7px;
  font-size: var(--text-3xl);
}

.home-welcome p {
  max-width: 560px;
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.5;
}

.continue-band {
  margin: 18px -16px 0;
  padding: 17px 16px;
  border-top: 1px solid rgba(255, 73, 105, 0.25);
  border-bottom: 1px solid rgba(255, 73, 105, 0.25);
  background: var(--surface);
}

.compact-heading {
  margin: 0 0 12px;
}

.compact-heading h2 {
  margin: 4px 0 0;
  font-size: var(--text-lg);
  line-height: 1.25;
}

.content-type-badge {
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  font-size: var(--text-xs);
  font-weight: var(--weight-display);
  text-transform: uppercase;
}

.content-type-badge.podcast { color: var(--coral); }
.content-type-badge.resum { color: var(--teal); }
.content-type-badge.esquema { color: var(--blue); }
.content-type-badge.infografia { color: var(--amber); }

.continue-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 13px;
}

.continue-progress > span,
.slim-progress {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
}

.continue-progress > span > span,
.slim-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.continue-progress small {
  color: var(--muted);
  font-size: var(--text-xs);
}

.home-metrics,
.progress-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0 22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.progress-overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-metrics span,
.progress-overview span {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 13px 9px;
  border-right: 1px solid var(--border);
}

.home-metrics span:last-child,
.progress-overview span:last-child {
  border-right: 0;
}

.home-metrics small,
.progress-overview small {
  overflow: hidden;
  color: var(--faint);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.home-metrics strong,
.progress-overview strong {
  font-size: var(--text-lg);
}

.home-section {
  margin-top: 22px;
}

.episode-preview {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 11px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.episode-number,
.episode-index,
.episode-detail-number {
  display: grid;
  place-items: center;
  color: var(--red);
  font-weight: var(--weight-display);
  font-variant-numeric: tabular-nums;
}

.episode-number {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(229, 9, 47, 0.42);
  border-radius: var(--radius);
  background: rgba(229, 9, 47, 0.08);
  font-size: var(--text-lg);
}

.episode-preview strong,
.episode-preview small,
.episode-preview .slim-progress {
  display: block;
}

.episode-preview small {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: var(--text-xs);
}

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

.quick-action {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 1px 10px;
  min-height: 72px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.quick-action > span {
  display: grid;
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--red);
}

.quick-action svg { width: 18px; height: 18px; }
.quick-action strong { align-self: end; font-size: var(--text-base); }
.quick-action small { align-self: start; color: var(--muted); font-size: var(--text-xs); }

/* Syllabus */
.syllabus-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border);
}

.syllabus-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  min-height: 65px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 8px 3px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.syllabus-row:not(:disabled):hover { background: var(--surface); }
.syllabus-row.featured {
  margin: 8px 0;
  border: 1px solid color-mix(in srgb, var(--area-color) 48%, var(--border));
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--surface-2);
}
.syllabus-row.featured + .syllabus-row { border-top: 1px solid var(--border); }
.syllabus-row.unavailable { opacity: 0.48; }
.syllabus-row .episode-index { color: var(--area-color); font-size: var(--text-md); }
.syllabus-copy { min-width: 0; }
.syllabus-copy strong,
.syllabus-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.syllabus-copy strong { font-size: var(--text-base); }
.syllabus-copy small { margin-top: 4px; color: var(--muted); font-size: var(--text-xs); }

.episode-status {
  min-width: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-display);
  text-align: center;
}

.episode-status.in-progress,
.episode-status.complete {
  border-color: rgba(50, 210, 150, 0.38);
  background: var(--green-soft);
  color: var(--green);
}

.back-link {
  min-height: 34px;
  margin: -4px 0 14px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.episode-detail-head {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.episode-detail-number {
  width: 62px;
  height: 62px;
  border: 1px solid rgba(229, 9, 47, 0.45);
  border-radius: var(--radius);
  background: rgba(229, 9, 47, 0.09);
  font-size: var(--text-2xl);
}

.episode-detail-head h1 { margin: 4px 0 5px; font-size: var(--text-2xl); }
.episode-detail-head p { margin: 0; color: var(--muted); font-size: var(--text-xs); }
.episode-detail-progress { height: 5px; margin: 17px 0 27px; overflow: hidden; border-radius: var(--radius-pill); background: var(--surface-3); }
.episode-detail-progress span { display: block; height: 100%; background: var(--green); }
.content-section { margin-top: 24px; }
.content-section h2 { margin-bottom: 10px; font-size: var(--text-md); }
.content-resource-list,
.episode-test-list { display: grid; border-top: 1px solid var(--border); }

.content-row,
.episode-test-row,
.admin-media-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 11px;
  min-height: 64px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.content-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.content-icon svg { width: 18px; height: 18px; }
.content-icon.podcast { color: var(--coral); background: rgba(255, 73, 105, 0.08); }
.content-icon.resum { color: var(--teal); background: rgba(76, 201, 167, 0.08); }
.content-icon.esquema { color: var(--blue); background: rgba(90, 169, 255, 0.08); }
.content-icon.infografia { color: var(--amber); background: rgba(242, 169, 59, 0.08); }
.content-icon.test { color: var(--gold); background: rgba(255, 215, 0, 0.08); }
.content-icon.extra { color: var(--blue); background: rgba(90, 169, 255, 0.08); }

.content-row-main {
  display: grid;
  min-width: 0;
  gap: 4px;
  border: 0;
  padding: 9px 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.content-row-main strong,
.content-row-main small,
.episode-test-row > div strong,
.episode-test-row > div small,
.admin-media-row > div strong,
.admin-media-row > div small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-row-main strong,
.episode-test-row > div strong,
.admin-media-row > div strong { font-size: var(--text-base); }
.content-row-main small,
.episode-test-row > div small,
.admin-media-row > div small { color: var(--muted); font-size: var(--text-xs); }

.content-open {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--text-base);
  font-weight: var(--weight-display);
}

.content-open svg { width: 15px; height: 15px; }
.content-row.done .content-open { border-color: rgba(52, 199, 89, 0.45); color: var(--green); }

/* Persistent player */
.mini-player {
  position: fixed;
  right: 8px;
  bottom: calc(65px + var(--safe-bottom));
  left: 8px;
  z-index: 19;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  min-height: 62px;
  overflow: hidden;
  border: 1px solid rgba(255, 73, 105, 0.35);
  border-radius: var(--radius);
  background: rgba(20, 17, 20, 0.98);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(20px);
}

.mini-player-main {
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 0;
  padding: 8px 6px 9px 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.mini-player-copy { min-width: 0; }
.mini-player-copy strong,
.mini-player-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-player-copy strong { font-size: var(--text-sm); }
.mini-player-copy small { margin-top: 4px; color: var(--muted); font-size: var(--text-xs); }
.mini-player-toggle { display: grid; width: 44px; border: 0; place-items: center; background: transparent; color: var(--text); }
.mini-player-toggle svg { width: 21px; height: 21px; }
.mini-player-track { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--surface-3); }
.mini-player-track span { display: block; height: 100%; background: var(--coral); }

.player-modal { text-align: center; }
.player-art {
  display: grid;
  width: min(58vw, 250px);
  aspect-ratio: 1;
  margin: 4px auto 20px;
  place-content: center;
  border: 1px solid rgba(229, 9, 47, 0.48);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.4);
}

.player-art span { color: #fff; font-size: var(--text-display); font-weight: var(--weight-display); line-height: 1; }
.player-art small { margin-top: 8px; color: var(--gold); font-size: var(--text-xs); font-weight: var(--weight-display); letter-spacing: 2px; }
.player-copy { margin-bottom: 20px; }
.player-copy h2 { margin: 9px 0 5px; font-size: var(--text-xl); }
.player-copy p { margin: 0; color: var(--muted); font-size: var(--text-xs); }
.player-seek { width: 100%; accent-color: var(--coral); }
.player-times { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.player-controls { display: grid; grid-template-columns: 52px 68px 52px; gap: 24px; align-items: center; justify-content: center; margin: 22px 0 17px; }
.player-primary,
.player-secondary { display: grid; place-items: center; border-radius: 50%; }
.player-primary { width: 68px; height: 68px; border: 0; background: var(--red); color: #fff; }
.player-primary svg { width: 28px; height: 28px; }
.player-secondary { position: relative; width: 52px; height: 52px; overflow: visible; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.player-secondary svg { width: 31px; height: 31px; overflow: visible; }
.player-secondary small { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; color: var(--text); font-size: var(--text-xs); font-weight: var(--weight-display); line-height: 1; pointer-events: none; }
.playback-rate { min-height: 36px; border: 1px solid var(--border); border-radius: var(--radius); padding: 0 12px; background: var(--surface-2); color: var(--muted); font-size: var(--text-xs); }
.playback-rate strong { color: var(--text); }
.player-background-note { max-width: 410px; margin: 17px auto 0; color: var(--faint); font-size: var(--text-xs); line-height: 1.45; }

/* Protected documents */
.document-modal { width: min(100%, 760px); }
.document-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 14px; text-align: left; }
.document-heading h2 { margin: 4px 0 0; font-size: var(--text-lg); }
.document-stage { display: grid; min-height: 320px; max-height: 66dvh; overflow: auto; place-items: start center; border: 1px solid var(--border); border-radius: var(--radius); background: #d6d6d6; }
.document-stage canvas { display: block; max-width: 100%; flex: none; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25); }
.document-loading { place-self: center; padding: 30px; color: #333; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.document-toolbar { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 10px; align-items: center; margin-top: 12px; }
.document-toolbar > span { color: var(--muted); font-size: var(--text-xs); text-align: center; }
.document-toolbar .icon-btn { border-radius: var(--radius); }
.document-toolbar .icon-btn:disabled { opacity: 0.35; }
.document-download { width: 100%; margin-top: 12px; justify-content: center; }
.document-download svg { width: 16px; height: 16px; }

/* Management */
.management-entry {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  align-items: center;
  margin-top: 13px;
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 215, 0, 0.055);
  color: var(--text);
  text-align: left;
}

.management-entry > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: var(--radius); background: rgba(255, 215, 0, 0.1); color: var(--gold); }
.management-entry svg { width: 20px; height: 20px; }
.management-entry strong,
.management-entry small { display: block; }
.management-entry strong { font-size: var(--text-base); }
.management-entry small { margin-top: 4px; color: var(--muted); font-size: var(--text-xs); }
.management-entry b { color: var(--gold); font-size: var(--text-xl); }
.admin-segments { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.admin-content-list { display: grid; gap: 8px; }
.admin-trial-access { display: grid; gap: 14px; }
.admin-trial-heading { display: flex; align-items: center; gap: 11px; }
.admin-trial-heading h2 { margin: 3px 0 0; }
.admin-trial-heading .content-icon { flex: 0 0 auto; }
.admin-trial-feedback { margin: 0; }
.admin-trial-result { display: grid; gap: 10px; }
.admin-trial-result .tiny-label { color: inherit; opacity: 0.76; }
.admin-trial-result > div > strong { display: block; margin-top: 3px; color: var(--text); font-size: var(--text-base); overflow-wrap: anywhere; }
.admin-trial-result > small { color: inherit; opacity: 0.82; }
.admin-trial-code { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 7px 10px; align-items: center; padding-top: 10px; border-top: 1px solid rgba(52, 199, 89, 0.28); }
.admin-trial-code .tiny-label { grid-column: 1 / -1; }
.admin-trial-code > strong { min-width: 0; overflow-wrap: anywhere; letter-spacing: 0.4px; }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(52, 199, 89, 0.42); border-radius: var(--radius); background: rgba(5, 5, 5, 0.2); color: var(--text); }
.icon-button:hover { border-color: var(--green); color: var(--green); }
.icon-button svg { width: 18px; height: 18px; }
.admin-content-group .episode-title { font-size: var(--text-sm); }
.admin-media-row .btn { white-space: nowrap; }
.admin-media-actions { display: grid; justify-items: end; align-content: center; gap: 5px; min-width: 104px; }
.admin-media-delete { min-height: 22px; padding: 0; font-size: var(--text-xs); }
.extra-content-form { display: grid; gap: 9px; margin-top: 7px; border-top: 1px solid var(--border); padding: 13px 1px 2px; }
.extra-content-form .tiny-label { color: var(--blue); }
.extra-content-form .btn { justify-self: start; }

/* Notifications */
.notification-modal { width: min(100%, 620px); }
.push-onboarding-modal { width: min(100%, 500px); }
.push-onboarding { display: grid; justify-items: center; padding: 14px 5px 3px; text-align: center; }
.push-onboarding-icon { display: grid; width: 62px; height: 62px; margin-bottom: 18px; place-items: center; border: 1px solid rgba(52, 199, 89, 0.46); border-radius: var(--radius-lg); background: var(--green-soft); color: var(--green); }
.push-onboarding-icon svg { width: 29px; height: 29px; }
.push-onboarding .tiny-label { color: var(--green); }
.push-onboarding h2 { margin: 7px 0 9px; font-size: var(--text-xl); }
.push-onboarding p { max-width: 390px; margin: 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.55; }
.push-onboarding-actions { display: grid; width: 100%; gap: 5px; margin-top: 22px; }
.push-onboarding-actions .text-btn { width: 100%; min-height: 42px; color: var(--muted); text-align: center; }
.push-state,
.push-permission-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}
.push-permission-button { border-color: rgba(52, 199, 89, 0.38); cursor: pointer; }
.push-permission-button:hover,
.push-permission-button:active { background: rgba(52, 199, 89, 0.09); }
.push-state > svg,
.push-permission-button > svg { width: 22px; height: 22px; color: var(--green); justify-self: center; }
.push-state strong,
.push-state small,
.push-permission-button strong,
.push-permission-button small { display: block; }
.push-state strong,
.push-permission-button strong { font-size: var(--text-sm); }
.push-state small,
.push-permission-button small { margin-top: 3px; color: var(--muted); font-size: var(--text-xs); line-height: 1.4; }
.push-state.warning > svg { color: var(--gold); }
.push-state.muted > svg { color: var(--muted); }
.notification-list-heading { display: flex; align-items: center; justify-content: space-between; margin: 17px 2px 9px; }
.notification-list-heading .tiny-label { color: var(--muted); }
.notification-list-heading strong { display: grid; min-width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text); font-size: var(--text-xs); }
.notification-list { display: grid; gap: 7px; }
.notification-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.notification-row.unread { border-color: rgba(52, 199, 89, 0.38); background: rgba(52, 199, 89, 0.06); }
.notification-row.selected { border-color: var(--green); background: rgba(52, 199, 89, 0.1); }
.notification-row:hover { background: var(--surface-2); }
.notification-status { display: grid; width: 24px; height: 24px; margin-top: 2px; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--green); }
.notification-row.unread .notification-status { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 6px var(--surface); }
.notification-status svg { width: 14px; height: 14px; }
.notification-copy { min-width: 0; }
.notification-copy strong,
.notification-copy small { display: block; }
.notification-copy strong { margin-top: 4px; font-size: var(--text-base); }
.notification-copy small { margin-top: 5px; overflow: hidden; color: var(--muted); font-size: var(--text-xs); line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.notification-copy p { margin: 8px 0 1px; color: var(--muted); font-size: var(--text-sm); line-height: 1.55; white-space: normal; }
.notification-meta { display: flex; gap: 8px; align-items: center; justify-content: space-between; color: var(--green); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.notification-meta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-meta em { flex: 0 0 auto; border-radius: 999px; padding: 3px 7px; background: var(--green-soft); color: var(--green); font-size: var(--text-xs); font-style: normal; }
.notification-meta em.read { background: var(--surface-3); color: var(--muted); }
.read-summary { margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.read-summary h2 { margin: 5px 0 9px; font-size: var(--text-lg); }
.read-summary > strong { color: var(--green); font-size: var(--text-sm); }
.read-receipt-list { display: grid; gap: 6px; }
.read-receipt-list article { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; border-bottom: 1px solid var(--border-soft); padding: 10px 2px; }
.read-receipt-list article > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.read-receipt-list svg { width: 16px; height: 16px; }
.read-receipt-list strong,
.read-receipt-list small { display: block; overflow-wrap: anywhere; }
.read-receipt-list strong { font-size: var(--text-sm); }
.read-receipt-list small { margin-top: 3px; color: var(--muted); font-size: var(--text-xs); }
.profile-notifications { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; align-items: start; }
.profile-notification-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: var(--radius); background: var(--green-soft); color: var(--green); }
.profile-notification-icon svg { width: 21px; height: 21px; }
.profile-notifications h3 { margin: 4px 0 3px; }
.profile-notifications .btn { margin-top: 10px; }
.notification-admin-grid { display: grid; gap: 18px; }
.notification-compose { display: grid; gap: 14px; }
.notification-summary-input { min-height: 112px; resize: vertical; }
.notification-audience { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; border: 0; padding: 0; }
.notification-audience legend { grid-column: 1 / -1; margin-bottom: 2px; color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.notification-audience label { position: relative; min-width: 0; }
.notification-audience input { position: absolute; opacity: 0; pointer-events: none; }
.notification-audience label > span { display: grid; min-height: 94px; align-content: start; border: 1px solid var(--border); border-radius: var(--radius); padding: 11px; background: var(--surface-2); }
.notification-audience label > span > svg { width: 19px; height: 19px; margin-bottom: 8px; color: var(--muted); }
.notification-audience strong,
.notification-audience small { display: block; }
.notification-audience strong { font-size: var(--text-sm); }
.notification-audience small { margin-top: 3px; color: var(--muted); font-size: var(--text-xs); line-height: 1.35; }
.notification-audience input:checked + span { border-color: var(--green); background: var(--green-soft); }
.notification-audience input:checked + span > svg { color: var(--green); }
.admin-notification-history { min-width: 0; }
.admin-notification-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--border); padding: 14px 1px; }
.admin-notification-row h3 { margin: 4px 0 5px; font-size: var(--text-base); }
.admin-notification-row p { margin: 0 0 6px; color: var(--muted); font-size: var(--text-sm); line-height: 1.45; }
.admin-notification-row small { color: var(--faint); font-size: var(--text-xs); }
.admin-notification-actions { display: grid; justify-items: end; gap: 7px; }
.admin-notification-actions .btn { gap: 6px; white-space: nowrap; }
.admin-notification-actions svg { width: 15px; height: 15px; }

/* Study dashboard and areas */
.area-a { --area-color: #ff4969; --area-soft: rgba(255, 73, 105, 0.11); }
.area-b { --area-color: #5aa9ff; --area-soft: rgba(90, 169, 255, 0.11); }
.area-c { --area-color: #4cc9a7; --area-soft: rgba(76, 201, 167, 0.11); }
.area-d { --area-color: #f2a93b; --area-soft: rgba(242, 169, 59, 0.12); }
.area-e { --area-color: #b48cff; --area-soft: rgba(180, 140, 255, 0.12); }

.dashboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 0 18px;
}

.dashboard-head h1 { margin: 5px 0 0; font-size: var(--text-3xl); }
.dashboard-head time { max-width: 150px; color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 1.35; text-align: right; }

.next-study-band {
  margin: 0 -16px;
  border-top: 1px solid color-mix(in srgb, var(--area-color) 40%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--area-color) 40%, transparent);
  padding: 17px 16px 0;
  background: var(--surface);
}

.next-study-kicker { display: flex; align-items: center; justify-content: space-between; color: var(--area-color); font-size: var(--text-xs); font-weight: var(--weight-display); }
.next-study-kicker span { letter-spacing: 1.1px; }
.next-study-main { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 14px; align-items: center; padding: 17px 0 14px; }
.next-study-number { display: grid; width: 56px; height: 56px; place-items: center; border: 1px solid var(--area-color); border-radius: var(--radius); background: var(--area-soft); color: var(--area-color); font-size: var(--text-xl); font-weight: var(--weight-display); }
.next-study-main small { color: var(--area-color); font-size: var(--text-xs); font-weight: var(--weight-display); }
.next-study-main h2 { margin: 4px 0; font-size: var(--text-xl); line-height: 1.18; }
.next-study-main p { margin: 0; color: var(--muted); font-size: var(--text-xs); }
.next-study-progress { height: 4px; overflow: hidden; background: var(--surface-3); }
.next-study-progress span { display: block; height: 100%; background: var(--green); }
.dashboard-primary { display: flex; width: calc(100% + 32px); min-height: 47px; align-items: center; justify-content: space-between; margin: 15px -16px 0; border: 0; border-top: 1px solid var(--border); padding: 0 16px; background: var(--surface-2); color: var(--text); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.dashboard-primary b { color: var(--area-color); font-size: var(--text-xl); }

.dashboard-section { margin-top: 25px; }
.dashboard-section.home-progress { margin-top: 8px; }
.home-notifications { margin: 17px -16px 20px; border-top: 1px solid rgba(52, 199, 89, 0.28); border-bottom: 1px solid rgba(52, 199, 89, 0.28); padding: 14px 16px 0; background: rgba(52, 199, 89, 0.045); }
.home-notifications-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding-bottom: 10px; }
.home-notifications-icon { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(52, 199, 89, 0.4); border-radius: var(--radius); background: var(--green-soft); color: var(--green); }
.home-notifications-icon svg { width: 18px; height: 18px; }
.home-notifications-head .tiny-label { color: var(--green); }
.home-notifications-head h2 { margin: 3px 0 0; font-size: var(--text-base); }
.home-notifications-head > strong { min-width: 27px; border-radius: var(--radius-pill); padding: 5px 8px; background: var(--green-soft); color: var(--green); text-align: center; font-size: var(--text-xs); }
.home-notifications-list { border-top: 1px solid var(--border); }
.home-notification-row { display: grid; grid-template-columns: minmax(0, 1fr) 18px; gap: 10px; width: 100%; align-items: center; border: 0; border-bottom: 1px solid var(--border); padding: 11px 0; background: transparent; color: var(--text); text-align: left; }
.home-notification-row:hover { background: rgba(52, 199, 89, 0.035); }
.home-notification-row span { min-width: 0; }
.home-notification-row small, .home-notification-row strong, .home-notification-row em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-notification-row small { margin-bottom: 3px; color: var(--green); font-size: var(--text-xs); }
.home-notification-row strong { font-size: var(--text-sm); }
.home-notification-row em { margin-top: 3px; color: var(--muted); font-size: var(--text-xs); font-style: normal; }
.home-notification-row > b { color: var(--green); font-size: var(--text-lg); }
.home-notifications-more { display: flex; width: calc(100% + 32px); min-height: 42px; align-items: center; justify-content: space-between; margin: 0 -16px; border: 0; padding: 0 16px; background: var(--surface-2); color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.home-notifications-more span { color: var(--green); font-size: var(--text-lg); }
.dashboard-section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.dashboard-section-head h2 { margin: 4px 0 0; font-size: var(--text-lg); }
.dashboard-section-head button { border: 0; padding: 5px 0; background: transparent; color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.area-progress-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.area-progress-item { display: grid; grid-template-columns: 35px minmax(0, 1fr); gap: 9px; min-height: 68px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 9px; background: var(--surface); color: var(--text); text-align: left; }
.area-progress-item:hover { border-color: color-mix(in srgb, var(--area-color) 40%, var(--border)); background: var(--surface-2); }
.area-progress-item .area-letter { display: grid; width: 35px; height: 35px; place-items: center; border-radius: var(--radius); background: var(--area-soft); color: var(--area-color); font-size: var(--text-md); font-weight: var(--weight-display); }
.area-progress-copy { min-width: 0; }
.area-progress-copy strong, .area-progress-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-progress-copy strong { font-size: var(--text-xs); }
.area-progress-copy small { margin: 3px 0 7px; color: var(--muted); font-size: var(--text-xs); }
.area-progress-copy small.progress-count { color: var(--green); font-weight: var(--weight-semibold); }
.area-progress-item .slim-progress { height: 3px; }
.area-progress-item .slim-progress span { background: var(--green); }

.weekly-highlight, .resume-audio { display: grid; grid-template-columns: 42px minmax(0, 1fr) 38px; gap: 11px; align-items: center; margin: 22px -16px 0; border-top: 1px solid rgba(242, 169, 59, 0.25); border-bottom: 1px solid rgba(242, 169, 59, 0.25); padding: 13px 16px; background: rgba(242, 169, 59, 0.055); }
.weekly-highlight-mark { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid rgba(242, 169, 59, 0.5); border-radius: var(--radius); background: rgba(242, 169, 59, 0.1); color: var(--amber); font-size: var(--text-lg); font-weight: var(--weight-display); }
.weekly-highlight h2 { margin: 4px 0; font-size: var(--text-base); line-height: 1.25; }
.weekly-highlight small { color: var(--muted); font-size: var(--text-xs); }
.resume-audio { margin-top: 12px; border-color: rgba(255, 73, 105, 0.2); background: rgba(255, 73, 105, 0.04); }
.resume-audio > button { min-width: 0; border: 0; padding: 0; background: transparent; color: var(--text); text-align: left; }
.resume-audio > button strong, .resume-audio > button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-audio > button strong { margin: 4px 0; font-size: var(--text-sm); }
.resume-audio > button small { color: var(--muted); font-size: var(--text-xs); }
.resume-audio .resume-play { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(255, 73, 105, 0.35); border-radius: 50%; background: rgba(255, 73, 105, 0.1); color: var(--coral); }
.resume-play svg { width: 15px; height: 15px; }
.dashboard-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.dashboard-shortcuts > button { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; min-height: 56px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 9px; background: var(--surface); color: var(--text); text-align: left; }
.dashboard-shortcuts > button > svg { width: 18px; height: 18px; color: var(--blue); }
.dashboard-shortcuts span strong, .dashboard-shortcuts span small { display: block; }
.dashboard-shortcuts span strong { font-size: var(--text-xs); }
.dashboard-shortcuts span small { margin-top: 3px; color: var(--muted); font-size: var(--text-xs); }
.dashboard-shortcuts b { color: var(--muted); }

.syllabus-page-head { margin-bottom: 14px; }
.syllabus-area-tabs, .admin-content-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.syllabus-area-tabs button, .admin-content-tabs button { display: grid; min-height: 45px; place-content: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.syllabus-area-tabs button > span { color: var(--area-color); font-size: var(--text-md); font-weight: var(--weight-display); }
.syllabus-area-tabs button > small { margin-top: 2px; font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.syllabus-area-tabs button.active, .admin-content-tabs button.active { border-color: var(--area-color); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--area-color) 18%, transparent); background: var(--surface-2); color: var(--text); }
.admin-content-tabs button { color: var(--area-color); font-size: var(--text-md); font-weight: var(--weight-display); }
.syllabus-area-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -16px; border-top: 1px solid color-mix(in srgb, var(--area-color) 35%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--area-color) 35%, transparent); padding: 13px 16px; background: var(--surface); }
.syllabus-area-head > div { display: flex; min-width: 0; align-items: center; gap: 11px; }
.syllabus-area-head .area-letter { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: var(--radius); background: var(--area-color); color: #08080a; font-size: var(--text-lg); font-weight: var(--weight-display); }
.syllabus-area-head h2 { margin: 3px 0 0; font-size: var(--text-md); }
.syllabus-area-head > strong { color: var(--green); font-size: var(--text-md); }
.weekly-library { display: grid; border-top: 1px solid var(--border); }
.weekly-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 36px; gap: 11px; min-height: 70px; align-items: center; border-bottom: 1px solid var(--border); }
.weekly-date { display: grid; width: 40px; height: 43px; place-content: center; border: 1px solid rgba(242, 169, 59, 0.38); border-radius: var(--radius); color: var(--amber); text-align: center; }
.weekly-date b { font-size: var(--text-md); line-height: 1; }
.weekly-date small { margin-top: 3px; font-size: var(--text-xs); font-weight: var(--weight-semibold); text-transform: uppercase; }
.weekly-row-main { min-width: 0; border: 0; padding: 10px 0; background: transparent; color: var(--text); text-align: left; }
.weekly-row-main strong, .weekly-row-main small { display: block; }
.weekly-row-main strong { font-size: var(--text-sm); line-height: 1.3; }
.weekly-row-main small { margin-top: 5px; color: var(--muted); font-size: var(--text-xs); }
.weekly-row.done .content-open { border-color: rgba(52, 199, 89, 0.45); color: var(--green); }
.content-icon.actualitat { color: var(--amber); background: rgba(242, 169, 59, 0.09); }
.content-type-badge.actualitat { color: var(--amber); }
.content-icon.qui-es-qui { color: var(--teal); background: rgba(76, 201, 167, 0.1); }
.content-icon.institucions { color: var(--blue); background: rgba(90, 169, 255, 0.1); }
.content-icon.claus { color: var(--coral); background: rgba(255, 73, 105, 0.1); }
.content-icon.psicotecnic { color: #b48cff; background: rgba(180, 140, 255, 0.12); }

/* Entrenament psicotècnic */
.psychometric-intro { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; margin: 14px 0; border: 1px solid rgba(180, 140, 255, 0.3); border-radius: var(--radius); padding: 13px; background: rgba(180, 140, 255, 0.06); }
.psychometric-intro .content-icon { width: 44px; height: 44px; }
.psychometric-intro h3 { margin: 3px 0 5px; font-size: var(--text-base); }
.psychometric-intro p { margin: 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.45; }
.psychometric-list { display: grid; border-top: 1px solid var(--border); }
.psychometric-group { margin-top: 18px; }
.psychometric-group-head { display: grid; gap: 3px; margin-bottom: 8px; }
.psychometric-group-head .tiny-label { color: #c8a9ff; }
.psychometric-group-head p { margin: 0; color: var(--muted); font-size: var(--text-xs); }
.psychometric-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 36px; gap: 10px; min-height: 86px; align-items: center; border-bottom: 1px solid var(--border); }
.psychometric-row.has-online { grid-template-columns: 34px minmax(0, 1fr) auto 36px; }
.psychometric-step { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid rgba(180, 140, 255, 0.45); border-radius: 50%; background: rgba(180, 140, 255, 0.1); color: #c8a9ff; font-size: var(--text-sm); font-weight: var(--weight-display); }
.psychometric-row.done .psychometric-step { border-color: rgba(52, 199, 89, 0.48); background: rgba(52, 199, 89, 0.1); color: var(--green); }
.psychometric-main { min-width: 0; border: 0; padding: 11px 0; background: transparent; color: var(--text); text-align: left; }
.psychometric-main strong, .psychometric-main small, .psychometric-main em { display: block; }
.psychometric-main strong { font-size: var(--text-sm); line-height: 1.3; }
.psychometric-main small { margin-top: 4px; color: var(--muted); font-size: var(--text-xs); line-height: 1.4; }
.psychometric-main em { margin-top: 5px; color: #b48cff; font-size: var(--text-xs); font-style: normal; font-weight: var(--weight-semibold); }
.psychometric-online {
  min-height: 40px;
  margin-bottom: 0;
  border-color: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0 15px;
  box-shadow: 0 6px 16px rgba(242, 85, 85, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, #d73546 0%, #b6263b 100%);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: var(--weight-display);
  letter-spacing: 0.15px;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(9, 22, 44, 0.3);
  white-space: nowrap;
}
.psychometric-online svg { width: 15px; height: 15px; color: #ffe08a; }
.psychometric-online:hover { border-color: rgba(255, 224, 138, 0.65); background: linear-gradient(135deg, #d13a4b 0%, #ad2036 100%); }
.official-archive { margin-top: 26px; }
.official-exam-list { display: grid; gap: 11px; }
.official-exam-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; border: 1px solid rgba(180, 140, 255, 0.28); border-radius: var(--radius); padding: 14px; background: linear-gradient(145deg, rgba(180, 140, 255, 0.08), rgba(255, 255, 255, 0.02)); }
.official-exam-copy { min-width: 0; }
.official-badge { display: inline-flex; width: fit-content; border-radius: 999px; padding: 4px 8px; background: rgba(180, 140, 255, 0.12); color: #c8a9ff; font-size: 10px; font-weight: var(--weight-display); letter-spacing: .35px; text-transform: uppercase; }
.official-exam-copy h4 { margin: 7px 0 5px; font-size: var(--text-base); }
.official-exam-copy p { margin: 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.45; }
.official-exam-copy small { display: block; margin-top: 7px; color: #c8a9ff; font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.official-exam-actions { display: grid; min-width: 218px; gap: 8px; }
.official-exam-actions .btn, .official-guide-intro .btn { min-height: 42px; justify-content: center; margin: 0; text-decoration: none; }
.official-source-note { display: grid; gap: 6px; margin-top: 12px; border-left: 3px solid #b48cff; padding: 10px 12px; background: rgba(180, 140, 255, 0.05); }
.official-source-note strong { font-size: var(--text-sm); }
.official-source-note span, .official-source-note small { color: var(--muted); font-size: var(--text-xs); line-height: 1.45; }
.official-source-note small { color: var(--faint); }
.official-guide-modal { width: min(94vw, 820px); }
.official-guide-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; border: 1px solid rgba(180, 140, 255, 0.25); border-radius: var(--radius); padding: 13px; background: rgba(180, 140, 255, 0.06); }
.official-guide-intro p { margin: 8px 0 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.5; }
.official-guide-progress { display: grid; gap: 7px; margin: 14px 0; }
.official-guide-progress > span { color: var(--muted); font-size: var(--text-xs); }
.official-guide-progress strong { color: #c8a9ff; }
.official-guide-list { display: grid; gap: 7px; }
.official-guide-question { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.official-guide-question[open] { border-color: rgba(180, 140, 255, 0.42); }
.official-guide-question.done { border-color: rgba(52, 199, 89, 0.32); }
.official-guide-question summary { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 18px; gap: 9px; align-items: center; min-height: 52px; padding: 8px 11px; cursor: pointer; list-style: none; }
.official-guide-question summary::-webkit-details-marker { display: none; }
.official-guide-question summary > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: rgba(180, 140, 255, 0.12); color: #c8a9ff; font-size: var(--text-xs); font-weight: var(--weight-display); }
.official-guide-question.done summary > span { background: rgba(52, 199, 89, 0.12); color: var(--green); }
.official-guide-question summary strong { font-size: var(--text-sm); }
.official-guide-question summary em { color: #c8a9ff; font-size: var(--text-xs); font-style: normal; font-weight: var(--weight-display); }
.official-guide-question summary b { color: var(--faint); font-weight: 400; transition: transform .18s ease; }
.official-guide-question[open] summary b { transform: rotate(180deg); }
.official-guide-body { border-top: 1px solid var(--border); padding: 13px; }
.guide-family { display: inline-flex; border-radius: 999px; padding: 4px 8px; background: rgba(255, 255, 255, 0.05); color: var(--gold); font-size: var(--text-xs); font-weight: var(--weight-display); }
.official-guide-body dl { display: grid; gap: 10px; margin: 12px 0; }
.official-guide-body dl div { display: grid; gap: 3px; }
.guide-block-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.guide-block-meta small { color: var(--faint); font-size: var(--text-xs); }
.guide-learning { display: grid; gap: 10px; margin-top: 14px; }
.guide-learning > div { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 9px; align-items: start; }
.guide-section-number { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid rgba(180, 140, 255, 0.35); border-radius: 50%; background: rgba(180, 140, 255, 0.1); color: #c8a9ff; font-size: var(--text-xs); font-weight: var(--weight-display); }
.guide-learning h4 { margin: 3px 0 5px; color: var(--text); font-size: var(--text-sm); }
.guide-learning p { margin: 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.55; }
.guide-learning ol { display: grid; gap: 7px; margin: 7px 0 0; padding-left: 20px; color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }
.guide-learning li::marker { color: #c8a9ff; font-weight: var(--weight-display); }
.guide-example { display: grid; gap: 5px; margin-top: 13px; border: 1px solid rgba(90, 169, 255, 0.25); border-radius: 10px; padding: 10px 11px; background: rgba(90, 169, 255, 0.06); }
.guide-example strong { color: var(--blue); font-size: var(--text-xs); text-transform: uppercase; }
.guide-example p { margin: 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.5; }
.official-guide-body dt { color: var(--faint); font-size: 10px; font-weight: var(--weight-display); letter-spacing: .4px; text-transform: uppercase; }
.official-guide-body dd { margin: 0; color: var(--muted); font-size: var(--text-sm); line-height: 1.45; }
.official-guide-body dl .guide-speed-tip { border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; padding: 8px 10px; background: rgba(224, 205, 161, 0.06); }
.guide-speed-tip dt { color: var(--gold); }
.official-guide-body dl .guide-stuck-tip { border-left: 3px solid var(--blue); border-radius: 0 8px 8px 0; padding: 8px 10px; background: rgba(90, 169, 255, 0.05); }
.guide-stuck-tip dt { color: var(--blue); }
.guide-solutions { display: grid; gap: 8px; margin: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 12px 0; }
.guide-solutions .tiny-label, .official-full-key .tiny-label { color: #c8a9ff; }
.guide-answer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.guide-answer-grid > span { display: flex; min-height: 34px; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--border); border-radius: 8px; background: rgba(255, 255, 255, 0.025); color: #c8a9ff; font-size: var(--text-sm); font-weight: var(--weight-display); }
.guide-answer-grid > span b { color: var(--muted); font-size: var(--text-xs); }
.official-guide-body .btn { min-height: 40px; margin: 0; }
.official-full-key { display: grid; gap: 7px; margin-top: 16px; border: 1px solid rgba(180, 140, 255, 0.28); border-radius: var(--radius); padding: 13px; background: rgba(180, 140, 255, 0.05); }
.official-full-key p { margin: 0 0 3px; color: var(--muted); font-size: var(--text-xs); }

@media (max-width: 560px) {
  .psychometric-row.has-online { grid-template-columns: 34px minmax(0, 1fr) 40px; row-gap: 10px; padding: 10px 0; }
  .psychometric-row.has-online .psychometric-step { grid-column: 1; grid-row: 1; }
  .psychometric-row.has-online .psychometric-main { grid-column: 2 / 4; grid-row: 1; padding: 2px 0; }
  .psychometric-online { grid-column: 2; grid-row: 2; width: 100%; min-height: 42px; }
  .psychometric-row.has-online .content-open { grid-column: 3; grid-row: 2; justify-self: end; }
  .official-exam-card { grid-template-columns: 1fr; }
  .official-exam-actions { min-width: 0; }
  .official-guide-intro { grid-template-columns: 1fr; }
  .official-guide-question summary { grid-template-columns: 34px minmax(0, 1fr) 18px; }
  .official-guide-question summary em { grid-column: 2; }
  .official-guide-question summary b { grid-column: 3; grid-row: 1 / 3; }
  .guide-block-meta { align-items: flex-start; flex-direction: column; gap: 6px; }
  .guide-answer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.weekly-admin { display: grid; gap: 13px; }
.weekly-news-form { display: grid; gap: 11px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 14px 0; }
.weekly-admin-list { display: grid; border-top: 1px solid var(--border); }
.weekly-admin-row { padding: 7px 0; }
.file-input { min-height: 46px; padding-top: 9px; }

/* Ambit D library */
.d-section-grid { display: grid; gap: 9px; margin-top: 14px; }
.d-section-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 92px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--d-section-color) 42%, var(--border));
  border-radius: var(--radius);
  padding: 13px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}
.d-section-card > b { color: var(--d-section-color); font-size: var(--text-xl); }
.d-section-card .d-section-icon { width: 42px; height: 42px; color: var(--d-section-color); background: var(--d-section-soft); }
.d-section-copy { display: grid; min-width: 0; gap: 3px; }
.d-section-copy .tiny-label { color: var(--d-section-color); }
.d-section-copy strong { font-size: var(--text-base); }
.d-section-copy small { overflow: hidden; color: var(--muted); font-size: var(--text-xs); line-height: 1.35; }
.d-section-copy em { color: var(--d-section-color); font-size: var(--text-xs); font-style: normal; font-weight: var(--weight-semibold); }
.d-section-actualitat { --d-section-color: var(--amber); --d-section-soft: rgba(242, 169, 59, 0.09); }
.d-section-qui-es-qui { --d-section-color: var(--teal); --d-section-soft: rgba(76, 201, 167, 0.09); }
.d-section-institucions { --d-section-color: var(--blue); --d-section-soft: rgba(90, 169, 255, 0.09); }
.d-section-claus { --d-section-color: var(--coral); --d-section-soft: rgba(255, 73, 105, 0.09); }

.d-section-detail-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0 -16px 14px;
  border-top: 1px solid color-mix(in srgb, var(--d-section-color) 38%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--d-section-color) 38%, transparent);
  padding: 14px 16px;
  background: var(--d-section-soft);
}
.d-section-detail-head .d-section-icon { width: 42px; height: 42px; color: var(--d-section-color); background: color-mix(in srgb, var(--d-section-color) 11%, transparent); }
.d-section-detail-head h2 { margin: 3px 0; font-size: var(--text-md); }
.d-section-detail-head p { margin: 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.35; }
.d-section-detail-head > strong { color: var(--d-section-color); font-size: var(--text-base); }
.d-content-list { display: grid; border-top: 1px solid var(--border); }
.d-content-row { min-height: 68px; }

.d-admin-list { display: grid; gap: 9px; }
.d-admin-section { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.d-admin-section > summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 64px;
  align-items: center;
  padding: 10px;
  cursor: pointer;
  list-style: none;
}
.d-admin-section > summary::-webkit-details-marker { display: none; }
.d-admin-section > summary .d-section-icon { width: 38px; height: 38px; }
.d-admin-section > summary strong,
.d-admin-section > summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-admin-section > summary strong { font-size: var(--text-base); }
.d-admin-section > summary small { margin-top: 3px; color: var(--muted); font-size: var(--text-xs); }
.d-admin-section > summary > b { color: var(--muted); font-size: var(--text-md); transition: transform 160ms ease; }
.d-admin-section[open] > summary > b { transform: rotate(180deg); }
.d-admin-section-body { border-top: 1px solid var(--border); padding: 0 11px 11px; }
.d-section-form { display: grid; gap: 10px; padding: 13px 0; }
.d-admin-content-list { display: grid; border-top: 1px solid var(--border); }
.d-admin-content-row { padding: 7px 0; }

/* Tests and progress by study area */
.study-scope-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 16px 0;
}

.study-scope-tabs button {
  display: grid;
  min-height: 48px;
  place-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.study-scope-tabs button > span { color: var(--area-color); font-size: var(--text-md); font-weight: var(--weight-display); }
.study-scope-tabs button > small { margin-top: 2px; font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.study-scope-tabs button.active { border-color: var(--area-color); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--area-color) 18%, transparent); background: var(--surface-2); color: var(--text); }
.study-scope-tabs .simulations { --area-color: var(--gold); --area-soft: rgba(255, 215, 0, 0.1); }

.tests-scope-head,
.results-scope-head {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  background: var(--surface);
}

.tests-scope-head h2,
.results-scope-head h2 { margin: 4px 0 0; font-size: var(--text-lg); }
.tests-scope-head > div:last-child { display: grid; flex: 0 0 auto; gap: 3px; color: var(--muted); font-size: var(--text-xs); text-align: right; }
.tests-scope-head > div:last-child strong { color: var(--green); font-size: var(--text-base); }

.tests-scope-metrics,
.progress-snapshot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px 0 21px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.tests-scope-metrics > span,
.progress-snapshot > span { display: grid; min-width: 0; gap: 4px; padding: 11px 9px; border-right: 1px solid var(--border); }
.tests-scope-metrics > span:last-child,
.progress-snapshot > span:last-child { border-right: 0; }
.tests-scope-metrics small,
.progress-snapshot small { overflow: hidden; color: var(--faint); font-size: var(--text-xs); font-weight: var(--weight-semibold); text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.tests-scope-metrics strong,
.progress-snapshot strong { font-size: var(--text-lg); }
.tests-scope-metrics > span:nth-child(2) strong,
.progress-snapshot > span:nth-child(1) strong,
.progress-snapshot > span:nth-child(2) strong { color: var(--green); }

.progress-areas { margin: 4px 0 18px; }
.progress-areas .dashboard-section-head { margin-bottom: 10px; }
.results-scope-head { margin-top: 4px; }
.results-scope-head > strong { display: grid; min-width: 32px; height: 32px; place-items: center; border: 1px solid rgba(63, 183, 255, 0.35); border-radius: 50%; color: var(--blue); font-size: var(--text-sm); }
.result-scope-list { display: grid; gap: 10px; margin-top: 12px; }
.result-scope-list .history-row { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }

.test-scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.test-scope-card { min-height: 130px; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--surface); color: var(--text); text-align: left; }
.test-scope-card:hover { border-color: color-mix(in srgb, var(--area-color) 42%, var(--border)); background: var(--surface-2); }
.test-scope-card.area-e { grid-column: 1 / -1; }
.test-scope-card.simulations { --area-color: var(--gold); --area-soft: rgba(255, 215, 0, 0.1); grid-column: 1 / -1; }
.test-scope-card-head { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.test-scope-card-head > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: var(--radius); background: var(--area-soft); color: var(--area-color); font-size: var(--text-lg); font-weight: var(--weight-display); }
.test-scope-card-head small, .test-scope-card-head strong { display: block; overflow: hidden; }
.test-scope-card-head small { color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
.test-scope-card-head strong { margin-top: 3px; font-size: var(--text-base); line-height: 1.2; overflow-wrap: anywhere; }
.test-scope-card-head b { color: var(--area-color); font-size: var(--text-xl); }
.test-scope-card-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; border-top: 1px solid var(--border); padding-top: 10px; }
.test-scope-card-stats span { display: grid; gap: 3px; min-width: 0; }
.test-scope-card-stats small { min-height: 27px; color: var(--faint); font-size: var(--text-xs); font-weight: var(--weight-semibold); line-height: 1.2; overflow-wrap: anywhere; text-transform: uppercase; }
.test-scope-card-stats strong { font-size: var(--text-base); }
.test-scope-card-stats span:first-child strong { color: var(--green); }

.d-tests-page-head { margin-bottom: 17px; }
.d-tests-page-head h1 { margin-top: 5px; }
.d-test-section-card { min-height: 168px; }
.d-test-section-card.d-test-actualitat { --area-color: #f59e0b; --area-soft: rgba(245, 158, 11, 0.12); }
.d-test-section-card.d-test-qui-es-qui { --area-color: #a78bfa; --area-soft: rgba(167, 139, 250, 0.12); }
.d-test-section-description { min-height: 34px; margin: 12px 0 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.35; }
.d-test-section-card .test-scope-card-stats { margin-top: 11px; }

@media (min-width: 760px) {
  .mini-player { right: calc((100vw - 728px) / 2); left: calc((100vw - 728px) / 2); }
}

@media (max-width: 520px) {
  .admin-segments .segment { padding-inline: 5px; font-size: 11px; }
  .admin-notification-row { grid-template-columns: 1fr; }
  .admin-notification-actions { grid-template-columns: auto auto; justify-content: space-between; justify-items: stretch; }
  .notification-audience { grid-template-columns: 1fr; }
  .home-actions { grid-template-columns: 1fr; }
  .progress-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-overview span:nth-child(2) { border-right: 0; }
  .progress-overview span:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .episode-test-row { grid-template-columns: 38px minmax(0, 1fr); padding: 8px 0; }
  .episode-test-row .btn { grid-column: 2; justify-self: start; }
  .admin-media-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .admin-media-row > div small { max-width: 150px; }
  .admin-media-actions { min-width: 96px; }
  .admin-media-actions .btn { min-width: 96px; max-width: none; }
  .study-scope-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .study-scope-tabs button > small { font-size: var(--text-xs); }
}

@media (max-width: 390px) {
  .dashboard-head { align-items: start; }
  .dashboard-head time { max-width: 110px; }
  .dashboard-shortcuts { grid-template-columns: 1fr; }
  .area-progress-copy strong { font-size: var(--text-xs); }
  .next-study-main h2 { font-size: var(--text-lg); }
}
