:root {
  --bg: #eff5ff;
  --bg-strong: #dde8ff;
  --panel: rgba(251, 253, 255, 0.88);
  --panel-strong: #fdfefe;
  --line: rgba(16, 35, 60, 0.12);
  --ink: #10233c;
  --muted: #516277;
  --accent: #ff6b4a;
  --accent-strong: #db5235;
  --accent-soft: rgba(255, 107, 74, 0.12);
  --teal: #12857c;
  --teal-soft: rgba(18, 133, 124, 0.12);
  --gold: #f4b63f;
  --sky: #5d8bff;
  --sky-soft: rgba(93, 139, 255, 0.14);
  --shadow: 0 24px 70px rgba(16, 35, 60, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 107, 74, 0.16), transparent 22%),
    radial-gradient(circle at 86% 14%, rgba(93, 139, 255, 0.22), transparent 20%),
    radial-gradient(circle at 85% 82%, rgba(18, 133, 124, 0.18), transparent 20%),
    linear-gradient(180deg, #f8fbff 0%, #edf4ff 48%, #edf7f5 100%);
}

a {
  color: inherit;
}

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

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.background-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.72;
  pointer-events: none;
}

.orb-a {
  top: -80px;
  right: -40px;
  width: 320px;
  height: 320px;
  background: rgba(255, 107, 74, 0.22);
}

.orb-b {
  bottom: -100px;
  left: -50px;
  width: 340px;
  height: 340px;
  background: rgba(93, 139, 255, 0.2);
}

.background-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(16, 35, 60, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 35, 60, 0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 85%);
  pointer-events: none;
}

.app-header,
.app-main {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 26px 0 18px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sky);
}

.app-header h1 {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.8rem, 4vw, 3.35rem);
  line-height: 0.96;
  max-width: 9ch;
}

.header-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 62px;
  gap: 12px;
  flex-wrap: wrap;
}

.app-main {
  padding-bottom: 44px;
}

.hero-card,
.panel,
.stat-card,
.mini-card,
.table-card,
.leaderboard-card,
.question-card,
.attempt-card,
.presentation-card,
.task-card,
.rank-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  min-width: 0;
  max-width: 100%;
}

.hero-card,
.panel,
.table-card,
.leaderboard-card {
  border-radius: var(--radius-xl);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 22px;
  padding: 30px;
}

.hero-copy h2 {
  margin: 0 0 12px;
  font-family: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.94;
}

.hero-copy p,
.support-text,
.muted {
  color: var(--muted);
}

.hero-actions,
.grid-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.login-options,
.stats-grid,
.two-col,
.three-col,
.four-col,
.cards-grid,
.feature-grid {
  display: grid;
  gap: 18px;
}

.login-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

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

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.feature-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.panel {
  padding: 24px;
}

.section-title,
h2,
h3 {
  font-family: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
}

.mini-card,
.stat-card,
.presentation-card,
.task-card,
.rank-card,
.question-card,
.attempt-card {
  border-radius: var(--radius-lg);
  padding: 18px;
}

.stat-card h3,
.mini-card h3,
.presentation-card h3,
.task-card h3,
.rank-card h3,
.question-card h3,
.attempt-card h3 {
  margin: 0 0 8px;
}

.value {
  display: block;
  margin-top: 10px;
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1;
}

.value.small {
  font-size: 1.35rem;
}

.accent-value {
  color: var(--accent);
}

.teal-value {
  color: var(--teal);
}

.badge-row,
.pill-row,
.rank-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(111, 88, 53, 0.14);
  background: rgba(255, 255, 255, 0.8);
  font-size: 0.88rem;
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.badge.teal,
.pill.teal {
  background: var(--teal-soft);
  color: var(--teal);
  border-color: rgba(13, 124, 114, 0.14);
}

.badge.accent,
.pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(211, 95, 61, 0.14);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), #ff8b55);
  color: #fff;
  box-shadow: 0 12px 28px rgba(255, 107, 74, 0.26);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  border: 1px solid var(--line);
}

.button.teal {
  background: linear-gradient(135deg, var(--teal), #1d968c);
  color: #fff;
  box-shadow: 0 12px 28px rgba(18, 133, 124, 0.24);
}

.button.subtle {
  background: transparent;
  color: var(--ink);
  border: 1px dashed rgba(111, 88, 53, 0.2);
}

.button.danger {
  background: rgba(211, 95, 61, 0.12);
  color: var(--accent);
  border: 1px solid rgba(211, 95, 61, 0.16);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.login-card {
  position: relative;
  overflow: hidden;
  min-height: 240px;
  background:
    radial-gradient(circle at top right, rgba(93, 139, 255, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.92));
}

.login-card::after {
  content: "";
  position: absolute;
  inset: auto -18px -20px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  transform: rotate(18deg);
  border: 14px solid rgba(255, 107, 74, 0.12);
}

.login-card-tag {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(16, 35, 60, 0.08);
  color: var(--sky);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-simple {
  display: grid;
  gap: 28px;
  max-width: 980px;
  margin: clamp(12px, 3vw, 28px) auto 0;
  padding: clamp(26px, 4vw, 36px);
  text-align: center;
  background:
    radial-gradient(circle at top left, rgba(255, 107, 74, 0.12), transparent 32%),
    radial-gradient(circle at bottom right, rgba(93, 139, 255, 0.18), transparent 36%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.94));
}

.landing-simple-header {
  display: grid;
  justify-items: center;
}

.landing-simple-title {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.landing-simple-options {
  align-items: stretch;
}

.landing-simple .login-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  text-align: left;
}

.landing-simple .login-card h3 {
  margin: 0 0 18px;
  font-size: clamp(1.5rem, 3vw, 1.8rem);
}

.landing-simple .grid-actions {
  margin-top: auto;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  min-width: 0;
}

.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 10px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.tab-button-label {
  min-width: 0;
}

.tab-button-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.tab-button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.tab-button.active .tab-button-badge {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.full .field,
.field.full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 35, 60, 0.15);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(93, 139, 255, 0.22);
  border-color: rgba(93, 139, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(93, 139, 255, 0.08);
}

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

.anti-bot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.calculator-display {
  text-align: right;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  min-width: 0;
}

.calculator-button {
  min-height: 54px;
  border-radius: 18px;
  padding: 12px;
}

.note-editor {
  min-height: 320px;
}

.inline-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.table-card {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

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

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(111, 88, 53, 0.1);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: none;
}

.rank-table td:first-child,
.rank-table th:first-child {
  width: 72px;
}

.rank-table td,
.rank-table th,
.rank-table td strong,
.rank-table td .muted {
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.stats-view td,
.stats-view th,
.stats-view td strong,
.stats-view td .muted,
.stats-view h3,
.stats-view p,
.stats-view .badge,
.stats-view .value {
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.empty-state {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(111, 88, 53, 0.18);
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
}

.split-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.split-header > * {
  min-width: 0;
}

.presentation-group {
  padding: 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.76);
  box-shadow: var(--shadow);
}

.presentation-preview-panel {
  display: grid;
  gap: 16px;
}

.presentation-frame-shell {
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(111, 88, 53, 0.12);
  background: rgba(255, 255, 255, 0.85);
}

.presentation-frame-shell.document-mode {
  min-height: clamp(480px, 82dvh, 1100px);
  height: clamp(480px, 82dvh, 1100px);
}

.presentation-frame-shell.canvas-mode {
  height: auto;
  min-height: 0;
  padding: 16px;
  overflow: visible;
}

.presentation-frame-shell.image-mode {
  overflow: hidden;
}

.presentation-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: none;
  background: #fff;
}

.presentation-preview-image {
  display: block;
  width: 100%;
  max-height: 82dvh;
  object-fit: contain;
  background: #fff;
}

.presentation-pdf-viewer {
  display: grid;
  gap: 16px;
}

.presentation-pdf-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.presentation-pdf-pages {
  display: grid;
  gap: 18px;
}

.presentation-pdf-page {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.presentation-pdf-page-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.presentation-pdf-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid rgba(111, 88, 53, 0.14);
  background: #fff;
  box-shadow: 0 18px 40px rgba(16, 33, 59, 0.08);
}

.split-header h2,
.split-header h3,
.section-title {
  margin: 0;
}

.section-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.watermark-layer {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  pointer-events: none;
  z-index: 5;
  opacity: 0.14;
  font-size: clamp(2rem, 9vw, 5.5rem);
  font-weight: 800;
  transform: rotate(-18deg);
  color: rgba(31, 42, 55, 0.48);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.protected-mode .watermark-layer {
  display: grid;
}

.protection-shield {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 252, 247, 0.98);
  z-index: 30;
}

.protection-shield.active {
  display: flex;
}

.protection-shield-card {
  width: min(100%, 560px);
  padding: 28px;
  border-radius: 24px;
  border: 1px solid rgba(111, 88, 53, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 245, 239, 0.98));
  box-shadow: 0 24px 60px rgba(31, 42, 55, 0.12);
  text-align: center;
}

.protection-shield-card h3 {
  margin: 0 0 12px;
}

.protection-shield-card .badge-row {
  justify-content: center;
  margin-top: 16px;
}

.protected-mode {
  -webkit-touch-callout: none;
}

.protected-mode * {
  user-select: none;
}

.protected-mode input,
.protected-mode textarea {
  user-select: text;
}

.question-options {
  display: grid;
  gap: 10px;
}

.question-options.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-label,
.input-answer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(111, 88, 53, 0.14);
  background: rgba(255, 255, 255, 0.78);
}

.option-label input,
.input-answer input {
  flex: 0 0 auto;
}

.selection-only .option-label {
  position: relative;
  justify-content: center;
  min-height: 58px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  user-select: none;
}

.selection-only .option-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.selection-only .option-label span {
  font-weight: 800;
  letter-spacing: 0.04em;
}

.selection-only .option-label:hover {
  border-color: rgba(93, 139, 255, 0.24);
  background: rgba(93, 139, 255, 0.08);
}

.selection-only .option-label.is-selected,
.selection-only .option-label:has(input:checked) {
  background: rgba(93, 139, 255, 0.16);
  border-color: rgba(93, 139, 255, 0.48);
  box-shadow: 0 0 0 4px rgba(93, 139, 255, 0.1);
}

.selection-only .option-label:has(input:focus-visible) {
  outline: 2px solid rgba(93, 139, 255, 0.34);
  outline-offset: 2px;
}

.quiz-meta,
.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.attempt-list {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 12;
  min-width: 280px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(31, 42, 55, 0.92);
  color: #fff;
  box-shadow: 0 16px 42px rgba(31, 42, 55, 0.22);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

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

.kpi-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  min-width: 0;
}

.kpi {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(16, 35, 60, 0.1);
  min-width: 124px;
}

.kpi strong {
  display: block;
  font-size: 1.15rem;
}

.notice {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(18, 133, 124, 0.08);
  border: 1px solid rgba(18, 133, 124, 0.16);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.request-image-wrap {
  margin: 14px 0 10px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(111, 88, 53, 0.12);
}

.request-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
}

.note-warning {
  background: rgba(255, 107, 74, 0.1);
  border-color: rgba(255, 107, 74, 0.18);
}

.landing-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(255, 107, 74, 0.12), transparent 34%),
    radial-gradient(circle at bottom right, rgba(93, 139, 255, 0.18), transparent 40%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(245, 250, 255, 0.92));
}

.landing-hero::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 24px;
  border: 1px dashed rgba(16, 35, 60, 0.1);
  pointer-events: none;
}

.hero-copy-energetic {
  position: relative;
  z-index: 1;
}

.hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.hero-mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(16, 35, 60, 0.07);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-stage {
  position: relative;
  display: grid;
  gap: 16px;
  z-index: 1;
}

.hero-scene {
  position: relative;
  min-height: 255px;
  padding: 18px;
  border-radius: 26px;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(16, 35, 60, 0.94), rgba(29, 65, 112, 0.94));
  color: #fff;
  box-shadow: 0 18px 40px rgba(16, 35, 60, 0.24);
}

.scene-core {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  gap: 8px;
  width: min(76%, 270px);
  padding: 20px;
  text-align: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), rgba(93, 139, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.scene-core strong {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  letter-spacing: 0.08em;
}

.scene-core-label {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.scene-core span:last-child {
  color: rgba(255, 255, 255, 0.82);
}

.scene-orbit {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(12px);
}

.orbit-1 {
  top: 20px;
  left: 20px;
}

.orbit-2 {
  top: 28%;
  right: 16px;
}

.orbit-3 {
  bottom: 18px;
  left: 16%;
}

.hero-sticker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hero-sticker {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(16, 35, 60, 0.1);
  box-shadow: var(--shadow);
}

.sticker-coral {
  background: linear-gradient(180deg, rgba(255, 239, 234, 0.98), rgba(255, 247, 242, 0.98));
}

.sticker-teal {
  background: linear-gradient(180deg, rgba(231, 250, 247, 0.98), rgba(244, 255, 253, 0.98));
}

.sticker-kicker {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sky);
  font-weight: 700;
}

.hero-sticker strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.hero-sticker p {
  margin: 0;
  color: var(--muted);
}

.feature-chip-card {
  background: rgba(255, 255, 255, 0.9);
}

.feature-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--sky-soft);
  border: 1px solid rgba(93, 139, 255, 0.16);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.energetic-notice {
  background: linear-gradient(180deg, rgba(255, 245, 240, 0.94), rgba(255, 251, 248, 0.94));
}

.landing-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 249, 255, 0.9));
}

.login-shell {
  align-items: stretch;
}

.login-panel {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(241, 248, 255, 0.95));
}

.login-aside {
  align-content: start;
}

.login-demo-card,
.physics-mood-card {
  background: rgba(255, 255, 255, 0.9);
}

.login-notice {
  background: linear-gradient(180deg, rgba(237, 250, 248, 0.94), rgba(245, 255, 253, 0.94));
}

.physics-mood-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.formula-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(16, 35, 60, 0.08);
  color: var(--ink);
  font-weight: 700;
}

.note-preview-box {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(111, 88, 53, 0.12);
  background: rgba(255, 255, 255, 0.72);
  white-space: pre-wrap;
  line-height: 1.6;
  word-break: break-word;
}

.note-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}

.note-details[open] summary {
  margin-bottom: 10px;
}

@media (max-width: 1040px) {
  .hero-card,
  .feature-grid,
  .login-options,
  .stats-grid,
  .three-col,
  .four-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  .app-header {
    flex-direction: column;
    padding-top: 22px;
  }

  .hero-card,
  .feature-grid,
  .login-options,
  .two-col,
  .three-col,
  .four-col,
  .stats-grid,
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .panel,
  .hero-card {
    padding: 20px;
  }

  .landing-simple {
    padding: 22px;
    gap: 22px;
  }

  .landing-simple-title {
    max-width: 12ch;
    font-size: clamp(2.1rem, 11vw, 3.2rem);
  }

  .hero-copy h2 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .button {
    width: 100%;
  }

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 2px 8px;
    margin: 0 -2px 20px;
    scrollbar-width: thin;
  }

  .tabs .tab-button {
    width: auto;
    min-width: max-content;
  }

  .grid-actions,
  .hero-actions {
    flex-direction: column;
  }

  .hero-scene {
    min-height: 220px;
  }

  th,
  td {
    padding: 12px;
  }
}

@media (max-width: 560px) {
  .app-header,
  .app-main {
    width: min(calc(100% - 20px), var(--max-width));
  }

  .app-header h1 {
    max-width: none;
    font-size: clamp(1.8rem, 9vw, 2.4rem);
  }

  .header-status {
    justify-content: flex-start;
  }

  .hero-card,
  .panel {
    border-radius: 22px;
  }

  .mini-card,
  .stat-card,
  .presentation-card,
  .task-card,
  .rank-card,
  .question-card,
  .attempt-card {
    padding: 16px;
  }

  .split-header {
    gap: 12px;
  }

  .split-header .button,
  .split-header a.button {
    width: 100%;
  }

  .badge-row,
  .pill-row,
  .rank-pills {
    gap: 6px;
  }

  .badge,
  .pill {
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .kpi-strip {
    flex-direction: column;
  }

  .kpi {
    min-width: 0;
    width: 100%;
  }

  .table-card table {
    min-width: 620px;
  }

  .presentation-frame-shell.document-mode {
    min-height: 72dvh;
    height: 72dvh;
  }

  .presentation-frame-shell.canvas-mode {
    padding: 12px;
  }

  .notice,
  .inline-note,
  td,
  th,
  p,
  h2,
  h3 {
    overflow-wrap: anywhere;
  }

  .scene-core {
    width: min(82%, 250px);
    padding: 18px;
  }

  .scene-orbit {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .hero-mini-badge,
  .feature-chip,
  .badge,
  .pill {
    font-size: 0.8rem;
  }

  .toast {
    right: 10px;
    left: 10px;
    bottom: 12px;
    max-width: none;
    min-width: 0;
  }
}
