:root {
  --bg: #edf4fb;
  --bg-deep: #dbe9f7;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #ffffff;
  --ink: #132238;
  --muted: #65758d;
  --line: rgba(19, 34, 56, 0.1);
  --brand: #1386dc;
  --brand-dark: #0d2f71;
  --brand-soft: #ddf1ff;
  --brand-soft-2: #eef8ff;
  --accent-warm: #f3b302;
  --accent-warm-ink: #8a5a00;
  --accent-success: #20b46a;
  --accent-success-ink: #166534;
  --accent-success-soft: #e9f8ef;
  --shadow: 0 24px 60px rgba(13, 47, 113, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--ink);
  background: #f8fafc;
  animation: pageFadeIn 160ms ease-out both;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

.clean-shell {
  background: #f8fafc;
}

.floating-sidebar,
.hero-banner,
.panel {
  backdrop-filter: blur(16px);
}

.floating-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 28px 80px rgba(13, 47, 113, 0.12);
}

.premium-sidebar {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  position: relative;
}

.premium-sidebar::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #0d2f71 0%, #1386dc 100%);
}

.brand-panel {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 82px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 30px rgba(13, 47, 113, 0.1);
}

.brand-logo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
}

.sidebar-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef2f7;
}

.sidebar-brand-logo {
  width: 176px;
  max-width: 100%;
  height: auto;
  display: block;
  filter: none;
}

.eyebrow,
.hero-label,
.section-kicker,
.flashcard-type,
.input-label,
.user-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.05;
}

h2 {
  font-size: 32px;
  line-height: 1.08;
}

h3 {
  font-size: 22px;
  line-height: 1.15;
}

h4 {
  font-size: 17px;
  line-height: 1.25;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  text-decoration: none;
  color: #475569;
  font-weight: 700;
  background: transparent;
  transition: background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.nav-link span:nth-child(2) {
  min-width: 0;
}

.nav-link:hover {
  background: #f8fbff;
  color: var(--brand-dark);
  transform: translateX(2px);
}

.nav-link.active {
  background: linear-gradient(90deg, #eff6ff 0%, #f8fbff 100%);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(19, 134, 220, 0.1);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
}

.nav-icon svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.nav-badge {
  margin-left: auto;
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.nav-badge-secondary {
  background: #7c3aed;
}

.nav-link.active .nav-icon {
  background: linear-gradient(180deg, #0d2f71 0%, #1386dc 100%);
  color: #ffffff;
}

.user-card {
  margin-top: auto;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(221, 241, 255, 0.8) 100%);
  border: 1px solid rgba(19, 134, 220, 0.12);
}

.premium-user-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.clean-ghost-button {
  background: #ffffff;
  border: 1px solid #dbe4ee;
}

.premium-user-card strong,
.premium-user-card .user-label {
  color: var(--ink);
}

.premium-user-card .user-plan {
  color: var(--muted);
}

.user-plan {
  display: block;
  margin: 4px 0 16px;
  color: var(--muted);
}

.sidebar-token-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #dbe4ee;
  background: #ffffff;
  color: var(--brand-dark);
  font-weight: 700;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.sidebar-token-trigger:hover {
  border-color: rgba(19, 134, 220, 0.28);
  box-shadow: 0 12px 28px rgba(13, 47, 113, 0.08);
  transform: translateY(-1px);
}

.sidebar-token-trigger.is-active {
  border-color: rgba(19, 134, 220, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(233, 244, 255, 0.9) 100%);
}

.sidebar-token-trigger__label {
  font-size: 14px;
  white-space: nowrap;
}

.sidebar-token-trigger__status {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workspace {
  min-width: 0;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
}

.calendar-panel {
  margin-bottom: 20px;
}

.page-header,
.panel-head,
.answer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-header {
  margin-bottom: 18px;
}

.badge,
.pill,
.result-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(19, 34, 56, 0.08);
}

.badge.soft,
.pill {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.metric-widgets {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.metric-widget {
  min-width: 176px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(19, 34, 56, 0.08);
  box-shadow: none;
}

.metric-widget p {
  color: var(--muted);
  font-size: 13px;
}

.progress-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fff;
}

.progress-ring span {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 800;
  color: var(--brand-dark);
}

.progress-ring-blue {
  background: conic-gradient(var(--brand) 0 108deg, rgba(19, 134, 220, 0.14) 108deg 360deg);
}

.progress-ring-gold {
  background: conic-gradient(#f3b302 0 220deg, rgba(243, 179, 2, 0.14) 220deg 360deg);
}

.hero-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  margin-bottom: 20px;
  border-radius: 30px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
  border: 1px solid #e5e7eb;
}

.hero-copy {
  max-width: 760px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 400;
}

.hero-label {
  color: var(--brand-dark);
}

.hero-actions {
  display: grid;
  gap: 12px;
  min-width: 260px;
}

.homepage-hero {
  display: grid;
  gap: 22px;
}

.dashboard-metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.dashboard-metric-card {
  min-height: 72px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.dashboard-metric-card strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.05;
}

.dashboard-metric-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hero-dual-actions,
.hero-triple-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hero-triple-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-action-card {
  display: block;
  padding: 22px;
  border-radius: 24px;
  text-decoration: none;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #dbe4ee;
  border-top: 3px solid var(--brand-dark);
}

.hero-action-card.secondary {
  background: #f8fbff;
  border-top-color: var(--brand);
}

.hero-action-kicker {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.hero-action-card strong {
  display: block;
  font-size: 22px;
  line-height: 1.15;
  margin-bottom: 8px;
}

.hero-action-card p {
  color: var(--muted);
  line-height: 1.55;
}

.hero-action-context {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.guided-card {
  display: grid;
  gap: 12px;
  align-content: start;
  background: #fcfdff;
  border-style: dashed;
  border-top-color: #c7d8ec;
}

.guided-card .hero-action-kicker {
  color: #5d7497;
}

.guided-card strong {
  font-size: 20px;
}

.guided-input-stack {
  display: grid;
  gap: 8px;
}

.guided-theme-input {
  min-height: 52px;
}

.dashboard-empty-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid #dbe7f4;
  border-radius: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #eef8ff 100%);
  box-shadow: 0 16px 40px rgba(13, 47, 113, 0.08);
}

.dashboard-empty-state h3 {
  margin: 4px 0 8px;
  font-size: clamp(24px, 3vw, 34px);
}

.dashboard-empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.onboarding-video-card {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
  padding: 24px;
  border-color: color-mix(in srgb, var(--brand-dark) 24%, var(--line));
  background: linear-gradient(135deg, var(--panel-strong) 0%, var(--brand-soft-2) 100%);
}

.onboarding-video-copy h3 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 34px);
}

.video-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  background: var(--ink);
  border: 1px solid var(--line);
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.tutorials-player-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.tutorial-player-empty {
  display: grid;
  place-items: center;
  background: var(--brand-soft-2);
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.tutorials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tutorial-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(13, 47, 113, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.tutorial-card:hover,
.tutorial-card.active {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  box-shadow: 0 18px 42px rgba(13, 47, 113, 0.12);
}

.tutorial-thumb {
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: var(--brand-soft-2);
  color: var(--brand-dark);
  font-weight: 900;
}

.tutorial-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tutorial-card-body {
  display: grid;
  gap: 6px;
}

.tutorial-card-body strong {
  font-size: 16px;
  line-height: 1.3;
}

.tutorial-card-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tutorials-empty-card {
  grid-column: 1 / -1;
}

.empty-illustration {
  width: 88px;
  height: 72px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid #dbe7f4;
}

.empty-illustration svg {
  width: 76px;
  height: 58px;
  fill: #ddf1ff;
  stroke: var(--brand-dark);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guided-start-button {
  width: 100%;
}

.hero-cta {
  margin: 0;
}

.hero-secondary-link {
  text-align: center;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.calendar-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
  margin-top: 18px;
}

.calendar-month,
.calendar-sidepanel {
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 18px;
}

.calendar-head,
.calendar-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calendar-head {
  margin-bottom: 18px;
}

.weekly-head {
  margin-bottom: 12px;
}

.streak-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.streak-widget {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--brand-soft-2);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.streak-widget svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.streak-widget em {
  font-style: normal;
  color: var(--muted);
  font-weight: 700;
}

.streak-widget.streak-warm {
  background: color-mix(in srgb, var(--accent-warm) 18%, var(--panel-strong));
  color: var(--accent-warm-ink);
}

.streak-widget.streak-strong {
  background: var(--accent-success-soft);
  color: var(--accent-success-ink);
}

.streak-widget.streak-strong em {
  color: var(--accent-success-ink);
}

.weekly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.week-day-card {
  min-height: 76px;
  padding: 10px 8px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.week-day-card strong {
  font-size: 18px;
}

.week-day-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.week-note {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.week-activity-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: transparent;
}

.week-activity-dot.has-activity {
  border-color: var(--accent-success);
  background: var(--accent-success);
}

.week-today-label {
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
}

.past-day {
  opacity: 0.72;
}

.current-day {
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
  border-color: var(--brand-dark);
}

.event-dots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.event-dots i,
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-go { background: #ff4d8d; }
.dot-prev { background: #f3b302; }
.dot-cli { background: #1d8eff; }
.dot-cx { background: #7a55ff; }
.dot-ped { background: #20b46a; }

.calendar-sidepanel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.study-progress-card {
  gap: 16px;
}

.study-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.study-progress-detail {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.study-progress-badge {
  min-width: 72px;
  min-height: 72px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f5fbff 0%, #eef6ff 100%);
  border: 1px solid #dbe4ee;
  display: grid;
  place-items: center;
}

.study-progress-badge strong {
  font-size: 20px;
  color: var(--brand-dark);
}

.study-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.study-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #25c5ff 0%, var(--brand) 100%);
}

.study-session-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.study-progress-cta {
  flex: 0 0 auto;
  padding: 10px 14px;
  text-decoration: none;
}

.latest-correction-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid #e2eaf3;
}

.latest-correction-card strong {
  display: block;
  margin-top: 4px;
}

.study-progress-actions {
  display: grid;
  gap: 12px;
}

.compact-action {
  padding: 14px 16px;
}

.calendar-today p {
  margin-bottom: 6px;
}

.revision-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.revision-item.clickable {
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.revision-item.clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(13, 47, 113, 0.08);
}

.revision-item p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.play-icon {
  margin-left: auto;
  color: var(--brand);
  font-size: 18px;
  font-weight: 800;
}

.calendar-legend {
  margin-top: auto;
  flex-wrap: wrap;
  justify-content: flex-start;
  color: var(--muted);
  font-size: 13px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.split-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 20px;
}

.panel {
  padding: 22px;
  border-radius: 30px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: none;
}

.oracle-home {
  min-height: 980px;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}

.primary-button,
.ghost-button {
  padding: 14px 18px;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  background: linear-gradient(135deg, #25c5ff 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: 0 14px 24px rgba(19, 134, 220, 0.18);
}

.ghost-button {
  width: 100%;
  background: rgba(255, 255, 255, 0.74);
  color: var(--brand-dark);
  border: 1px solid rgba(19, 134, 220, 0.12);
}

.result-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(238, 248, 255, 0.92) 100%);
  border: 1px solid rgba(19, 134, 220, 0.1);
}

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

.result-tag {
  background: var(--brand-dark);
  color: #fff;
}

.result-block {
  padding: 14px 0;
  border-top: 1px solid rgba(19, 34, 56, 0.08);
}

.result-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.result-title {
  margin-bottom: 6px;
  font-weight: 800;
}

.result-block p:last-child,
.flashcard-card p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.chat-shell {
  margin-top: 16px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(19, 34, 56, 0.08);
  overflow: hidden;
}

.chat-thread {
  padding: 24px;
  display: grid;
  gap: 14px;
  min-height: 680px;
  max-height: 760px;
  overflow: auto;
}

.chat-message {
  max-width: 82%;
  padding: 16px 18px;
  border-radius: 22px;
  line-height: 1.65;
}

.user-message {
  margin-left: auto;
  background: linear-gradient(135deg, rgba(19, 134, 220, 0.12) 0%, rgba(19, 134, 220, 0.18) 100%);
  border: 1px solid rgba(19, 134, 220, 0.12);
}

.assistant-message {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(19, 34, 56, 0.08);
}

.chat-role {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-dark);
}

.chat-message p + p,
.chat-message p + ul,
.chat-message p + ol {
  margin-top: 10px;
}

.chat-bullets,
.chat-fixation {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.chat-bullets li,
.chat-fixation li {
  margin-top: 6px;
}

.muted-text {
  color: var(--muted);
  font-size: 14px;
}

.thinking-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
}

.thinking-dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.thinking-dots i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  background: linear-gradient(180deg, #51c5ff 0%, #1386dc 100%);
  animation: thinkingPulse 1s infinite ease-in-out;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes thinkingPulse {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.nested-bullets {
  margin-top: 8px;
  padding-left: 18px;
}

.chat-composer {
  border-top: 1px solid rgba(19, 34, 56, 0.08);
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.composer-input {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  padding: 16px 18px;
  border: 1px solid rgba(19, 34, 56, 0.1);
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.hint-button {
  width: auto;
  white-space: nowrap;
}

.composer-submit {
  width: auto;
  min-width: 220px;
}

.oracle-message-input {
  min-height: 180px;
}

.mini-result-label {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-dark);
}

.cards-preview {
  display: grid;
  gap: 14px;
  margin: 16px 0 20px;
}

.post-actions {
  margin-top: 16px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.bank-selector {
  margin-bottom: 16px;
}

.bank-selector.compact {
  margin-bottom: 18px;
}

.bank-chips,
.action-buttons,
.flashcard-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bank-chip,
.secondary-button,
.group-pill {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
}

.bank-chip {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(19, 34, 56, 0.08);
  color: var(--ink);
}

.bank-helper {
  margin: 4px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.chip-note {
  margin-left: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bank-chip.active,
.group-pill.active {
  background: var(--brand-dark);
  color: #fff;
}

.bank-chip.active .chip-note {
  color: rgba(255, 255, 255, 0.72);
}

.secondary-button {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-dark);
  border: 1px solid rgba(19, 134, 220, 0.14);
  cursor: pointer;
}

.danger-button {
  color: #9f1239;
  background: #fff5f7;
  border-color: rgba(190, 24, 93, 0.18);
}

.danger-button:hover {
  background: #ffe4ea;
}

.advanced-button {
  background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
  color: #7c2d12;
  border-color: rgba(180, 83, 9, 0.2);
}

.advanced-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffedd5 0%, #fef3c7 100%);
  box-shadow: 0 14px 30px rgba(180, 83, 9, 0.12);
}

.advanced-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.button-subcopy {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: #be123c;
}

.finalize-button {
  width: auto;
  flex: 1;
}

.top-actions .secondary-button {
  flex: 1;
}

.advanced-review-card {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 64%, #eff6ff 100%);
  border: 1px solid rgba(180, 83, 9, 0.18);
}

.advanced-review-card h4 {
  margin: 4px 0 0;
  color: var(--brand-dark);
  font-size: 20px;
}

.advanced-review-eyebrow {
  margin: 0;
  color: #9a3412;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.memory-phrase {
  padding: 12px 14px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.simplified-actions {
  display: grid;
  gap: 12px;
}

.correction-meta-panel {
  padding: 16px 18px;
  border-radius: 22px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.correction-meta-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 140px;
  gap: 12px;
  margin-top: 12px;
}

.bank-reveal {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(19, 134, 220, 0.05);
  border: 1px dashed rgba(19, 134, 220, 0.2);
}

.bank-reveal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.confirm-fixation-button {
  width: auto;
  min-width: 180px;
}

.confirm-fixation-button[aria-busy="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.button-spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  animation: spin 780ms linear infinite;
}

.fixation-loading,
.fixation-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.fixation-loading-message {
  opacity: 1;
  transition: opacity 300ms ease;
}

.fixation-loading-message.is-fading {
  opacity: 0;
}

.fixation-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
  animation: pulseDot 1200ms ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseDot {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.preview-card {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(19, 34, 56, 0.08);
}

.preview-card.accent {
  background: linear-gradient(180deg, #ffffff 0%, #eef8ff 100%);
}

.preview-card.soft {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
}

.preview-card p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.deck-status {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0 8px;
}

.deck-status-item {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(19, 34, 56, 0.08);
}

.deck-value {
  display: block;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.deck-label {
  color: var(--muted);
  font-size: 13px;
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.summary-item {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(19, 34, 56, 0.08);
}

.summary-value {
  display: block;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.summary-label {
  color: var(--muted);
  font-size: 13px;
}

.review-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
  background: #f8fafc;
}

.oracle-review-shell {
  background: #f8fafc;
}

.clean-review-topic {
  margin: 8px 0 4px;
}

.clean-topic-subtitle {
  color: var(--muted);
  line-height: 1.6;
}

.progress-card {
  margin-top: 26px;
}

.oracle-progress-card,
.clean-progress-card {
  padding: 18px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.oracle-meter {
  margin: 18px 0 16px;
}

.oracle-meter-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: #e5edf6;
  overflow: hidden;
}

.oracle-meter-fill {
  width: 68%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7dcfff 0%, #31b7ff 45%, #0f80dd 100%);
  box-shadow: 0 0 24px rgba(125, 207, 255, 0.34);
}

.daily-fill {
  width: 46%;
}

.oracle-progress-summary,
.clean-progress-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
}

.oracle-progress-summary strong,
.clean-progress-summary strong {
  font-size: 34px;
  color: var(--brand-dark);
}

.oracle-progress-summary span,
.clean-progress-summary span {
  color: var(--muted);
  font-weight: 600;
}

.review-queue {
  display: grid;
  gap: 12px;
  margin: 18px 0 22px;
}

.queue-item,
.clean-queue-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.queue-item strong {
  display: block;
  margin-bottom: 4px;
}

.queue-item span,
.meter-caption {
  color: var(--muted);
  font-size: 13px;
}

.review-main {
  min-width: 0;
}

.history-topbar {
  margin-bottom: 20px;
}

.history-search-block {
  display: grid;
  gap: 10px;
}

.history-search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.history-search-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.history-search-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.history-month-nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.month-nav-button {
  width: 34px;
  height: 34px;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.month-nav-button:hover {
  transform: translateY(-1px);
  border-color: rgba(19, 134, 220, 0.22);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
  gap: 20px;
}

.calendar-history-layout {
  grid-template-columns: minmax(360px, 0.95fr) minmax(0, 1.05fr);
}

.single-history-layout {
  grid-template-columns: 1fr;
}

.history-calendar-column {
  display: grid;
  gap: 20px;
}

.history-list,
.history-detail {
  min-width: 0;
}

.history-calendar-panel,
.history-day-list-panel {
  min-width: 0;
}

.history-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.history-weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.history-day {
  min-height: 72px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.history-day:hover {
  transform: translateY(-1px);
  border-color: rgba(19, 134, 220, 0.18);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.history-day span {
  font-weight: 700;
}

.history-day i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.history-day.has-history {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.history-day.active {
  border-color: rgba(19, 134, 220, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #edf6ff 100%);
  box-shadow: inset 0 0 0 1px rgba(19, 134, 220, 0.08);
}

.history-day.muted {
  opacity: 0.45;
}

.history-entry-list {
  display: grid;
  gap: 16px;
}

.history-group + .history-group {
  margin-top: 22px;
}

.history-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
}

.history-date-row strong {
  color: var(--ink);
  font-size: 16px;
}

.history-entry {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.history-entry:hover {
  transform: translateY(-1px);
  border-color: rgba(19, 134, 220, 0.18);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.history-entry.active {
  background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
  border-color: rgba(19, 134, 220, 0.22);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
  position: relative;
}

.history-entry.active::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #0d2f71 0%, #1386dc 100%);
}

.history-entry-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.history-area {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.history-entry p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.history-reference-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.history-reference-line a {
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}

.history-entry-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.history-open-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #dbe4ee;
  background: #f8fbff;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.history-open-button:hover {
  transform: translateY(-1px);
  border-color: rgba(19, 134, 220, 0.18);
  background: #eef6ff;
}

.history-open-button::before {
  content: ">";
  font-size: 12px;
  line-height: 1;
}

.history-entry.active .history-open-button::before {
  content: "v";
}

.history-entry-detail {
  margin-top: 16px;
  padding: 18px;
  border-top: 1px solid #eef2f7;
  border-radius: 18px;
  background: #fbfdff;
}

.history-inline-detail-head {
  display: flex;
  justify-content: flex-end;
}

.history-count {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.history-detail-block {
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid #eef2f7;
}

.history-detail-block:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.history-bullets {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.history-subhead {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.history-flashcards {
  display: grid;
  gap: 12px;
}

.history-card {
  padding: 18px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid #dfe7f1;
}

.history-card-label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.history-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.4;
}

.history-card p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 460px);
  gap: 24px;
  padding: 24px;
  background: #f8fafc;
}

.auth-panel {
  border-radius: 32px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 32px;
}

.auth-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.auth-logo {
  width: 240px;
  max-width: 100%;
  height: auto;
}

.auth-copy {
  max-width: 540px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 6px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.auth-tab {
  border: 0;
  background: transparent;
  padding: 12px 18px;
  border-radius: 14px;
  font: inherit;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.active {
  background: #ffffff;
  color: var(--brand-dark);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field,
.composer-stack {
  display: grid;
  gap: 8px;
}

.auth-field span {
  font-size: 14px;
  font-weight: 700;
}

.auth-field input,
.text-input,
.history-search-input {
  min-height: 52px;
  width: 100%;
  border-radius: 18px;
  border: 1px solid #dbe4ee;
  padding: 0 16px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.auth-submit {
  margin-top: 4px;
}

.auth-feedback {
  min-height: 24px;
  margin-top: 16px;
  color: #b42318;
  font-weight: 600;
}

.functional-chat-page {
  min-height: auto;
}

.input-label {
  font-size: 12px;
}

.fixation-item {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.answer-copy {
  text-align: center;
  color: var(--muted);
  line-height: 1.65;
  font-size: 26px;
  min-height: 150px;
  display: grid;
  place-items: center;
  gap: 16px;
}

.answer-copy p {
  max-width: 860px;
  margin: 0;
}

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

.flashcard-actions {
  margin-left: auto;
}

.flashcard-actions-menu {
  position: relative;
}

.flashcard-actions-menu summary {
  list-style: none;
}

.flashcard-actions-menu summary::-webkit-details-marker {
  display: none;
}

.flashcard-actions-trigger {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 999px;
  border: 1px solid #dbe4ee;
  background: #ffffff;
  cursor: pointer;
}

.flashcard-actions-trigger span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--brand-dark);
  display: inline-block;
}

.flashcard-actions-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #dbe4ee;
  box-shadow: 0 16px 32px rgba(15, 31, 61, 0.12);
  z-index: 5;
}

.flashcard-menu-button {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  font: inherit;
  font-weight: 600;
  color: var(--brand-dark);
  cursor: pointer;
}

.flashcard-menu-button:hover {
  background: #f8fafc;
}

.danger-text {
  color: #b42318;
}

.flashcard-edit-form {
  width: min(760px, 100%);
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  text-align: left;
}

.flashcard-edit-textarea {
  min-height: 104px;
  resize: vertical;
}

.flashcard-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.flashcard-save-button,
.flashcard-cancel-button {
  width: auto;
}

.history-empty {
  padding: 18px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px dashed #dbe4ee;
  color: var(--muted);
}

.smart-review-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.smart-review-title {
  text-align: left;
  margin-bottom: 8px;
}

.smart-review-copy {
  margin: 0;
  text-align: left;
  max-width: 720px;
}

.smart-review-list {
  display: grid;
  gap: 14px;
}

.smart-review-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.smart-review-main {
  display: grid;
  gap: 10px;
}

.smart-review-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.smart-review-context {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-dark);
}

.smart-review-main strong {
  font-size: 18px;
  line-height: 1.35;
}

.smart-review-main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.smart-review-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brand-dark);
}

.smart-review-details div {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.smart-review-actions {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 150px;
}

.smart-pending-panel {
  display: grid;
  gap: 18px;
}

.oracle-review-main,
.clean-review-main {
  padding-top: 4px;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.study-card {
  overflow: hidden;
  border-radius: 28px;
  background: #ffffff;
  margin-bottom: 18px;
  border: 1px solid #e5e7eb;
}

.reveal-answer {
  display: flex;
  justify-content: center;
  margin: -2px 0 18px;
}

.reveal-button {
  min-width: 220px;
}

.oracle-study-card,
.clean-study-card {
  border: 1px solid #e5e7eb;
  box-shadow: none;
}

.study-topbar {
  height: 16px;
}

.study-topbar.yellow {
  background: #ffd400;
}

.oracle-topbar,
.clean-topbar {
  background: linear-gradient(90deg, #0d2f71 0%, #1d4f91 52%, #1386dc 100%);
}

.study-card {
  perspective: 1200px;
}

.study-card.answer-visible .study-content {
  animation: flashcardFlip 420ms ease;
}

.study-card.card-type-erro_central .clean-topbar {
  background: linear-gradient(90deg, #9f1239 0%, #e74c3c 100%);
}

.study-card.card-type-ponto_essencial .clean-topbar {
  background: linear-gradient(90deg, #0d2f71 0%, #1d4f91 52%, #1386dc 100%);
}

.study-card.card-type-armadilha_de_prova .clean-topbar {
  background: linear-gradient(90deg, #92400e 0%, #f3b302 100%);
}

.study-card.card-type-complete .clean-topbar {
  background: linear-gradient(90deg, #047857 0%, #22c55e 100%);
}

@keyframes flashcardFlip {
  0% {
    transform: rotateY(0deg);
  }
  48% {
    transform: rotateY(90deg) scale(0.98);
  }
  100% {
    transform: rotateY(0deg);
  }
}

.study-content {
  min-height: 210px;
  padding: 38px 36px;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
}

.study-content h3 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.2;
  font-weight: 400;
  max-width: 820px;
}

.face-mark {
  position: absolute;
  top: 24px;
  left: 24px;
  font-size: 42px;
  font-weight: 800;
  color: rgba(19, 34, 56, 0.08);
}

.study-label {
  position: absolute;
  top: 34px;
  left: 82px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-dark);
}

.flashcard-context {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.flashcard-source-link,
.auth-help-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 12px;
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: none;
}

.flashcard-source-link:hover,
.auth-help-link:hover {
  text-decoration: underline;
}

.inline-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.coach-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  border: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.38);
  cursor: pointer;
}

.extension-token-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.extension-token-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
}

.extension-token-dialog {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 32px));
  margin: 72px auto 0;
}

.extension-token-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid #dbe4ee;
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 22px;
  line-height: 1;
}

.coach-bubble {
  position: absolute;
  left: min(520px, 28vw);
  bottom: 120px;
  max-width: 420px;
  padding: 18px 20px;
  border-radius: 22px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
  line-height: 1.5;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.coach-bubble::after {
  content: "";
  position: absolute;
  left: 42px;
  bottom: -12px;
  width: 24px;
  height: 24px;
  background: #ffffff;
  transform: rotate(45deg);
}

.shortcut-hint,
.app-toast {
  position: fixed;
  right: 24px;
  z-index: 60;
  border: 1px solid #dbe7f4;
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand-dark);
  box-shadow: 0 18px 46px rgba(13, 47, 113, 0.18);
  font-weight: 800;
}

.shortcut-hint {
  bottom: 24px;
  padding: 14px 18px;
  cursor: pointer;
}

.app-toast {
  top: 24px;
  padding: 14px 18px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .smart-review-card {
    grid-template-columns: 1fr;
  }

  .smart-review-actions {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.question-face h3,
.answer-face h3 {
  max-width: 800px;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.22;
}

.knowledge-panel {
  padding: 24px 28px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
}

.oracle-knowledge-panel,
.clean-knowledge-panel {
  border: 1px solid #e5e7eb;
  box-shadow: none;
}

.knowledge-title {
  text-align: center;
  font-weight: 700;
  margin-bottom: 18px;
}

.anticipation-copy {
  max-width: 560px;
  margin: 0 auto 18px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

.anticipation-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.anticipation-button {
  min-height: 60px;
}

.knowledge-scale {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
}

.oracle-knowledge-scale {
  gap: 16px;
}

.oracle-text-scale {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.scale-bubble {
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(19, 34, 56, 0.12);
}

.scale-pill {
  min-height: 70px;
  padding: 16px 14px;
  border: 0;
  border-radius: 22px;
  font: inherit;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
}

.oracle-level {
  background: linear-gradient(180deg, #f5fbff 0%, #e6f3ff 100%);
  color: var(--brand-dark);
  border: 1px solid rgba(19, 134, 220, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 12px 24px rgba(13, 47, 113, 0.08);
}

.oracle-level.level-1 {
  background: linear-gradient(180deg, #fff1f2 0%, #fecdd3 100%);
  color: #9f1239;
  border-color: #fecdd3;
}

.oracle-level.level-2 {
  background: linear-gradient(180deg, #fff7ed 0%, #fed7aa 100%);
  color: #9a3412;
  border-color: #fed7aa;
}

.oracle-level.level-3 {
  background: linear-gradient(180deg, #ecfdf5 0%, #bbf7d0 100%);
  color: #166534;
  border-color: #bbf7d0;
}

.oracle-level.level-4 {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  color: #fff;
  border-color: #16a34a;
}

.scale-bubble.active,
.scale-pill.active {
  transform: scale(1.08);
  box-shadow: 0 18px 34px rgba(19, 134, 220, 0.18);
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.flashcard-stack {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.flashcard-card {
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(19, 34, 56, 0.08);
}

.flashcard-card.accent {
  background: linear-gradient(180deg, #ffffff 0%, #eef8ff 100%);
}

.flashcard-card.soft-accent {
  background: linear-gradient(180deg, #ffffff 0%, #f3fbff 100%);
}

.section-link {
  color: var(--brand-dark);
  text-decoration: none;
  font-weight: 800;
}

.support-panel {
  gap: 24px;
}

.support-form {
  display: grid;
  gap: 18px;
}

.support-form-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.support-select,
.support-input {
  min-height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(19, 34, 56, 0.14);
  background: #fff;
  padding: 0 16px;
  font: inherit;
  color: var(--text);
}

.support-message-input {
  min-height: 180px;
}

.support-file-input {
  min-height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(19, 34, 56, 0.14);
  background: #fff;
  padding: 12px 16px;
  font: inherit;
  color: var(--ink);
}

.support-feedback {
  min-height: 24px;
  margin: 0;
  color: #0f6d2f;
  font-weight: 600;
}

.range-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.admin-metric-card h3 {
  margin: 6px 0 8px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
}

.admin-users-panel {
  margin-bottom: 24px;
}

.admin-user-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-user-summary span {
  border: 1px solid #dbe7f4;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
}

.admin-table-panel {
  min-width: 0;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.admin-subline {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.admin-status-select {
  min-width: 116px;
  border: 1px solid #dbe7f4;
  border-radius: 999px;
  font-weight: 800;
  padding: 9px 12px;
}

.admin-status-select.status-active {
  background: #ecfdf5;
  color: #047857;
}

.admin-status-select.status-trial {
  background: #eff6ff;
  color: #1d4ed8;
}

.admin-status-select.status-blocked {
  background: #fef2f2;
  color: #b91c1c;
}

.admin-status-select:disabled {
  opacity: 0.7;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .floating-sidebar {
    position: static;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

  .home-grid,
  .review-shell {
    grid-template-columns: 1fr;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .tutorials-grid {
    grid-template-columns: 1fr;
  }

  .tutorial-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .history-layout {
    grid-template-columns: 1fr;
  }

  .support-form-grid {
    grid-template-columns: 1fr;
  }

  .correction-meta-grid {
    grid-template-columns: 1fr;
  }

  .admin-summary-grid,
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .page-header,
  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  h2 {
    font-size: 26px;
  }

  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    width: 100%;
    min-width: 0;
  }

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

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

  .dashboard-metric-strip {
    grid-template-columns: 1fr;
  }

  .study-session-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-widgets {
    width: 100%;
  }

  .metric-widget {
    width: 100%;
  }

  .dashboard-empty-state {
    grid-template-columns: 1fr;
  }

  .review-summary,
  .knowledge-scale {
    grid-template-columns: 1fr;
  }

  .review-header,
  .composer-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-entry-top {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .history-count {
    grid-column: 2;
    width: fit-content;
  }

  .history-subhead {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-weekdays,
  .history-calendar-grid {
    gap: 6px;
  }

  .history-day {
    min-height: 64px;
    border-radius: 16px;
  }

  .oracle-text-scale {
    grid-template-columns: 1fr 1fr;
  }

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

  .chat-message {
    max-width: 100%;
  }

  .study-content {
    min-height: 220px;
    padding: 38px 24px;
  }

  .deck-status {
    grid-template-columns: 1fr;
  }

  .weekly-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
  }

  .week-day-card {
    min-height: 70px;
    border-radius: 14px;
  }

.streak-widget {
  align-items: flex-start;
  border-radius: 18px;
  flex-direction: column;
}
}

.extension-token-head {
  align-items: flex-start;
  gap: 12px;
}

.status-pill {
  align-self: flex-start;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-alt, #f4f8fc);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.status-pill.is-active {
  color: var(--brand-deep);
  border-color: rgba(31, 91, 160, 0.16);
  background: rgba(31, 91, 160, 0.08);
}

.extension-token-status-text,
.extension-token-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.extension-token-actions,
.extension-token-copy-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.extension-token-actions > * {
  flex: 0 0 auto;
}

.extension-token-copy-row .text-input {
  flex: 1 1 320px;
}

.extension-token-output {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: var(--panel-alt, #f4f8fc);
}

.extension-token-dialog .ghost-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Mobile nav ── */
.mobile-top-bar {
  display: none;
}

@media (max-width: 768px) {
  /* Top bar fixo */
  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    padding: 0 16px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 900;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  }
  .mobile-top-bar-logo {
    height: 32px;
    width: auto;
  }
  .mobile-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
  }
  .mobile-hamburger span {
    display: block;
    height: 2px;
    background: #0f1f3d;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
  }
  body.nav-open .mobile-hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  body.nav-open .mobile-hamburger span:nth-child(2) {
    opacity: 0;
  }
  body.nav-open .mobile-hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Scrim atrás do menu */
  .nav-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 950;
  }
  body.nav-open .nav-scrim {
    display: block;
  }

  /* Sidebar vira drawer */
  .app-shell {
    grid-template-columns: 1fr;
    padding-top: 70px;
  }
  .floating-sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100dvh;
    width: 260px;
    z-index: 1000;
    border-radius: 0 24px 24px 0;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }
  body.nav-open .floating-sidebar {
    transform: translateX(0);
  }

  /* Flashcard: botões de avaliação maiores no toque */
  .scale-bubble {
    width: 72px;
    height: 72px;
    font-size: 13px;
  }
  .scale-pill {
    min-height: 80px;
    font-size: 14px;
  }
  .knowledge-scale {
    gap: 14px;
  }
}
