:root {
  --bg1: #2a0f1e;
  --bg2: #3a1630;
  --accent: #f472b6;
  --accent-2: #f9a8d4;
  --text: #fff7fb;
  --muted: #f3cde0;
  --card: rgba(255, 255, 255, 0.08);
  --ok: #f472b6;
  --bad: #fb7185;
  --shadow: 0 20px 60px rgba(0,0,0,0.35);
}

body[data-interface="light"] {
  --bg1: #f6f8fb;
  --bg2: #eef2f7;
  --accent: #2563eb;
  --accent-2: #0f766e;
  --text: #111827;
  --muted: #5b6472;
  --card: rgba(255, 255, 255, 0.92);
  --ok: #15803d;
  --bad: #b91c1c;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

body[data-interface="dark"] {
  --bg1: #161a21;
  --bg2: #202631;
  --accent: #38bdf8;
  --accent-2: #5eead4;
  --text: #f8fafc;
  --muted: #b7c0cc;
  --card: rgba(255, 255, 255, 0.07);
  --ok: #4ade80;
  --bad: #fb7185;
  --shadow: 0 20px 60px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% 10%, #5b1d47 0%, transparent 60%),
                  radial-gradient(1000px 800px at 90% 10%, #4a1b3c 0%, transparent 55%),
                  linear-gradient(180deg, var(--bg1), var(--bg2));
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

body[data-interface="light"] {
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
}

body[data-interface="dark"] {
  background: linear-gradient(180deg, var(--bg1), var(--bg2));
}

.app {
  width: min(1180px, 100%);
  display: grid;
  gap: 24px;
}

header {
  display: grid;
  gap: 8px;
}

body.settings-active .app,
body.questions-active .app,
body.stats-active .app {
  padding-top: 54px;
}

.interface-menu {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, calc((100vw - 1180px) / 2 + 18px));
  width: auto;
  z-index: 30;
}

.interface-trigger {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 0;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0,0,0,0.16);
  backdrop-filter: blur(14px);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.interface-trigger:hover,
.interface-menu.open .interface-trigger {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.34);
  background: rgba(255,255,255,0.16);
  box-shadow: 0 14px 34px rgba(0,0,0,0.2);
}

.interface-icon {
  width: 27px;
  height: 27px;
  display: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body[data-interface="light"] .interface-icon-light,
body[data-interface="dark"] .interface-icon-dark,
body[data-interface="secret"] .interface-icon-secret {
  display: block;
}

body.quiz-active .interface-menu {
  display: none;
}

.interface-menu-list {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 168px;
  max-width: calc(100vw - 28px);
  display: none;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255, 226, 240, 0.96);
  box-shadow: 0 16px 42px rgba(0,0,0,0.2);
  backdrop-filter: blur(14px);
  z-index: 31;
}

.interface-menu.open .interface-menu-list {
  display: grid;
  gap: 6px;
}

.interface-option {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  background: transparent;
  color: #3b0a26;
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 750;
  text-align: left;
  letter-spacing: 0;
}

.interface-option:hover,
.interface-option.active {
  color: #3b0a26;
  background: rgba(244, 114, 182, 0.22);
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--accent-2);
}

h1 {
  font-family: "IBM Plex Serif", "Georgia", serif;
  font-weight: 600;
  margin: 0;
  font-size: clamp(2rem, 2vw + 1.6rem, 3rem);
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-title-row h1 {
  min-width: 0;
}

.header-favicon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

body[data-interface="secret"] .header-favicon {
  display: none;
}

.sub {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.5;
}

.public-context {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, calc((100vw - 1180px) / 2 + 18px));
  z-index: 30;
}

.public-info-trigger {
  min-height: 44px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  backdrop-filter: blur(10px);
  cursor: pointer;
  padding: 0 15px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
}

.public-info-trigger:hover {
  border-color: rgba(255,255,255,0.26);
  background: rgba(255,255,255,0.14);
}

.public-info-modal {
  position: fixed;
  inset: 0;
  z-index: 44;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 28px);
  background: rgba(10, 12, 24, 0.66);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.public-info-modal-card {
  width: min(760px, 100%);
  max-height: min(780px, calc(100svh - 40px));
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    radial-gradient(circle at 18% 0%, rgba(249, 168, 212, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(58, 22, 48, 0.98), rgba(42, 15, 30, 0.98));
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0,0,0,0.42);
}

.public-info-modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: flex-start;
  padding: clamp(18px, 3vw, 24px) clamp(18px, 3vw, 24px) 0;
}

.public-info-modal-head h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.public-info-body {
  display: grid;
  gap: 16px;
  padding: 18px clamp(18px, 3vw, 24px) clamp(18px, 3vw, 24px);
}

.public-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(250px, 0.88fr);
  gap: 14px;
  align-items: stretch;
}

.public-info-card {
  min-width: 0;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.035);
  padding: 14px;
}

.public-eyebrow {
  margin-bottom: 6px;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.public-copy {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
}

.public-points {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.public-points li + li {
  margin-top: 4px;
}

.public-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-content: start;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  padding: 14px;
  font-size: 0.86rem;
  line-height: 1.55;
}

.public-note-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(249, 168, 212, 0.3);
  background: rgba(249, 168, 212, 0.12);
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1;
}

.public-note p {
  margin: 0;
}

.public-feedback {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(249, 168, 212, 0.26);
  background:
    radial-gradient(circle at 0% 0%, rgba(249, 168, 212, 0.2), transparent 42%),
    rgba(244, 114, 182, 0.1);
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.public-feedback-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.public-feedback-copy strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
}

.public-feedback-copy span {
  font-size: 0.9rem;
  line-height: 1.45;
}

.public-feedback-actions {
  min-width: max-content;
}

.public-feedback-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: #3b0a26;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 12px 24px rgba(244, 114, 182, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.public-feedback-actions a:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(244, 114, 182, 0.3);
}

.app-share-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.14);
  background: rgba(56, 189, 248, 0.06);
  color: var(--muted);
}

.app-share-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.app-share-copy span {
  font-size: 0.86rem;
  line-height: 1.4;
}

.app-share-btn,
.share-inline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  background: rgba(56, 189, 248, 0.1);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.app-share-btn:hover,
.share-inline-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.38);
  background: rgba(56, 189, 248, 0.16);
}

.share-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.16);
  background: rgba(56, 189, 248, 0.07);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.share-status {
  min-height: 16px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 750;
  text-align: center;
}

.public-info-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: center;
}

.public-info-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
}

.public-info-meta a {
  color: var(--text);
  font-weight: 850;
  text-decoration: none;
}

.public-info-meta a:hover {
  text-decoration: underline;
}

.public-close {
  width: auto;
}

.feedback-reminder-modal,
.support-reminder-modal {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(8px);
}

.feedback-reminder-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    linear-gradient(180deg, rgba(58, 22, 48, 0.98), rgba(42, 15, 30, 0.98));
  color: var(--text);
  box-shadow: 0 22px 70px rgba(0,0,0,0.36);
}

.feedback-reminder-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(244, 114, 182, 0.22);
  color: var(--accent-2);
}

.feedback-reminder-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feedback-reminder-card h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.feedback-reminder-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.feedback-reminder-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 2px;
  align-items: center;
}

.feedback-reminder-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #3b0a26;
  text-decoration: none;
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(242, 158, 56, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.feedback-reminder-link:hover {
  transform: translateY(-2px);
}

body[data-interface="light"] .feedback-reminder-card {
  border-color: rgba(15, 23, 42, 0.12);
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

body[data-interface="light"] .feedback-reminder-link {
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.16);
}

.support-reminder-card {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    linear-gradient(180deg, rgba(22, 30, 48, 0.98), rgba(15, 23, 42, 0.98));
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0,0,0,0.38);
}

.support-reminder-image-frame {
  position: relative;
  width: 100%;
  height: 230px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.support-reminder-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

.support-reminder-copy {
  display: grid;
  gap: 8px;
}

.support-reminder-eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.support-reminder-card h2 {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.18;
}

.support-reminder-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.48;
}

.support-reminder-donation {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(56, 189, 248, 0.1);
}

.support-mia-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #1d4ed8, #14b8a6);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.support-reminder-donation-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.support-reminder-donation-copy span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.support-reminder-donation-copy strong {
  color: var(--text);
  font-size: 1.08rem;
  letter-spacing: 0.02em;
}

.support-copy-status {
  min-height: 18px;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: center;
}

body[data-interface="light"] .support-reminder-card {
  border-color: rgba(15, 23, 42, 0.12);
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

body[data-interface="light"] .support-reminder-image-frame {
  border-color: rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

body[data-interface="light"] .support-reminder-donation {
  border-color: rgba(37, 99, 235, 0.16);
  background: #eff6ff;
}

body[data-interface="light"] .support-copy-status {
  color: #1d4ed8;
}

body[data-interface="light"] .app-share-card,
body[data-interface="light"] .share-inline {
  border-color: rgba(37, 99, 235, 0.12);
  background: #f8fafc;
}

body[data-interface="light"] .app-share-btn,
body[data-interface="light"] .share-inline-btn {
  border-color: rgba(37, 99, 235, 0.16);
  background: #eff6ff;
  color: #172033;
}

body[data-interface="light"] .share-status {
  color: #1d4ed8;
}

body[data-interface="secret"] .public-only {
  display: none !important;
}

body[data-interface="secret"].settings-active #public-context,
body[data-interface="secret"].questions-active #public-context,
body[data-interface="secret"].stats-active #public-context {
  display: block !important;
}

body[data-interface="secret"].settings-active #public-info-modal:not(.hidden),
body[data-interface="secret"].settings-active #public-contact:not(.hidden),
body[data-interface="secret"].questions-active #public-info-modal:not(.hidden),
body[data-interface="secret"].questions-active #public-contact:not(.hidden),
body[data-interface="secret"].stats-active #public-info-modal:not(.hidden),
body[data-interface="secret"].stats-active #public-contact:not(.hidden) {
  display: grid !important;
}

.panel {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: clamp(20px, 4vw, 32px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

body[data-interface="light"] .panel {
  border-color: rgba(15, 23, 42, 0.08);
  backdrop-filter: none;
}

body[data-interface="light"] .chip,
body[data-interface="light"] .public-info-card,
body[data-interface="light"] .public-note,
body[data-interface="light"] .settings-panel,
body[data-interface="light"] .mode-card,
body[data-interface="light"] .mode-option,
body[data-interface="light"] .answer-btn,
body[data-interface="light"] .review-item,
body[data-interface="light"] .qa-item,
body[data-interface="light"] .qa-option,
body[data-interface="light"] .stat-item,
body[data-interface="light"] .dropdown-trigger,
body[data-interface="light"] .number-input,
body[data-interface="light"] .field input[type="text"],
body[data-interface="light"] .field input[type="url"] {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

body[data-interface="light"] .public-info-trigger {
  border-color: rgba(15, 23, 42, 0.14);
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  backdrop-filter: none;
}

body[data-interface="light"] .header-favicon {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body[data-interface="light"] .public-note {
  color: var(--text);
}

body[data-interface="light"] .public-note-mark {
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

body[data-interface="light"] .public-feedback {
  border-color: rgba(37, 99, 235, 0.22);
  background:
    radial-gradient(circle at 0% 0%, rgba(37, 99, 235, 0.12), transparent 42%),
    #eff6ff;
  color: #475569;
}

body[data-interface="light"] .public-feedback-actions a {
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

body[data-interface="light"] .public-info-modal-card {
  border-color: rgba(15, 23, 42, 0.12);
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.2);
}

body[data-interface="light"] .public-feedback-actions a:hover {
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.24);
}

body[data-interface="light"] .public-info-trigger:hover {
  border-color: rgba(15, 23, 42, 0.22);
  background: rgba(37, 99, 235, 0.05);
}

body[data-interface="light"] .interface-menu {
  color: var(--text);
}

body[data-interface="light"] .interface-trigger {
  border-color: rgba(15, 23, 42, 0.14);
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

body[data-interface="light"] .interface-trigger:hover,
body[data-interface="light"] .interface-menu.open .interface-trigger {
  border-color: rgba(15, 23, 42, 0.22);
  background: #f8fafc;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

body[data-interface="light"] .interface-menu-list {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

body[data-interface="light"] .interface-option {
  color: var(--text);
}

body[data-interface="light"] .interface-option:hover,
body[data-interface="light"] .interface-option.active {
  color: var(--text);
  background: rgba(37, 99, 235, 0.1);
}

body[data-interface="light"] .answer-btn:hover,
body[data-interface="light"] .mode-option:hover,
body[data-interface="light"] button.ghost:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.06);
}

body[data-interface="light"] .mode-option.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.45);
  color: var(--text);
}

body[data-interface="light"] .qa-item {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

body[data-interface="light"] .qa-option {
  color: #111827;
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.14);
}

body[data-interface="light"] .qa-option.correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}

body[data-interface="light"] .qa-item .answer {
  color: #166534;
  font-weight: 700;
}

body[data-interface="light"] .stats-tab-bar {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(15, 23, 42, 0.04);
}

body[data-interface="light"] .stats-tab.active {
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

body[data-interface="light"] .qa-item .stats-wrong-count {
  color: #b91c1c;
}

body[data-interface="light"] button.ghost {
  border-color: rgba(15, 23, 42, 0.16);
}

body[data-interface="light"] .progress {
  background: rgba(15, 23, 42, 0.1);
}

body[data-interface="light"] .answer-btn {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

body[data-interface="light"] .answer-btn:hover {
  background: #eff6ff !important;
  border-color: #2563eb !important;
}

body[data-interface="light"] .answer-btn.selected {
  background: #dbeafe !important;
  border-color: #1d4ed8 !important;
  box-shadow: inset 0 0 0 1px #1d4ed8;
}

body[data-interface="light"] .answer-btn.correct {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #14532d !important;
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.35);
}

body[data-interface="light"] .answer-btn.wrong {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #7f1d1d !important;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.35);
}

body[data-interface="light"] .answer-btn.correct.selected {
  background: #dcfce7 !important;
  border-color: #15803d !important;
  color: #14532d !important;
}

body[data-interface="light"] .answer-btn.wrong.selected {
  background: #fee2e2 !important;
  border-color: #b91c1c !important;
  color: #7f1d1d !important;
}

body[data-interface="light"] .feedback.ok {
  color: #15803d;
  font-weight: 700;
}

body[data-interface="light"] .feedback.bad {
  color: #b91c1c;
  font-weight: 700;
}

body[data-interface="light"] .question-note {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #78350f;
}

body[data-interface="dark"] .panel {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.74);
}

body[data-interface="dark"] .chip,
body[data-interface="dark"] .settings-panel,
body[data-interface="dark"] .mode-card,
body[data-interface="dark"] .mode-option,
body[data-interface="dark"] .answer-btn,
body[data-interface="dark"] .review-item,
body[data-interface="dark"] .qa-item,
body[data-interface="dark"] .qa-option,
body[data-interface="dark"] .stat-item,
body[data-interface="dark"] .dropdown-trigger,
body[data-interface="dark"] .number-input,
body[data-interface="dark"] .field input[type="text"],
body[data-interface="dark"] .field input[type="url"] {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.5);
}

body[data-interface="dark"] .interface-menu {
  color: var(--text);
}

body[data-interface="dark"] .interface-trigger {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.64);
}

body[data-interface="dark"] .interface-trigger:hover,
body[data-interface="dark"] .interface-menu.open .interface-trigger {
  border-color: rgba(148, 163, 184, 0.36);
  background: rgba(30, 41, 59, 0.86);
}

body[data-interface="dark"] .interface-menu-list {
  background: #202631;
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 16px 42px rgba(0,0,0,0.36);
}

body[data-interface="dark"] .interface-option {
  color: var(--text);
}

body[data-interface="dark"] .interface-option:hover,
body[data-interface="dark"] .interface-option.active {
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.14);
}

body[data-interface="dark"] .mode-option.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(125, 211, 252, 0.55);
  color: #e0f2fe;
}

body[data-interface="dark"] .qa-item {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(148, 163, 184, 0.26);
}

body[data-interface="dark"] .qa-option {
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.92);
  border-color: rgba(148, 163, 184, 0.26);
}

body[data-interface="dark"] .qa-option.correct {
  background: rgba(22, 101, 52, 0.74);
  border-color: #4ade80;
  color: #dcfce7;
}

body[data-interface="dark"] .qa-item .answer {
  color: #86efac;
  font-weight: 700;
}

body[data-interface="dark"] .stats-tab-bar {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.62);
}

body[data-interface="dark"] .stats-tab.active {
  color: #082f49;
}

body[data-interface="dark"] .qa-item .stats-wrong-count {
  color: #fca5a5;
}

body[data-interface="dark"] .answer-btn {
  background: #111827 !important;
  border-color: #334155 !important;
  color: #f8fafc;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

body[data-interface="dark"] .answer-btn:hover {
  background: #172033 !important;
  border-color: #38bdf8 !important;
}

body[data-interface="dark"] .answer-btn.selected {
  background: #0c4a6e !important;
  border-color: #7dd3fc !important;
  color: #f0f9ff !important;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.55);
}

body[data-interface="dark"] .answer-btn.correct {
  background: rgba(20, 83, 45, 0.92) !important;
  border-color: #4ade80 !important;
  color: #dcfce7 !important;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.45);
}

body[data-interface="dark"] .answer-btn.wrong {
  background: rgba(127, 29, 29, 0.92) !important;
  border-color: #f87171 !important;
  color: #fee2e2 !important;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.45);
}

body[data-interface="dark"] .answer-btn.correct.selected {
  background: rgba(20, 83, 45, 0.96) !important;
  border-color: #86efac !important;
  color: #dcfce7 !important;
}

body[data-interface="dark"] .answer-btn.wrong.selected {
  background: rgba(127, 29, 29, 0.96) !important;
  border-color: #fca5a5 !important;
  color: #fee2e2 !important;
}

body[data-interface="dark"] .feedback.ok {
  color: #86efac;
  font-weight: 700;
}

body[data-interface="dark"] .feedback.bad {
  color: #fca5a5;
  font-weight: 700;
}

body[data-interface="dark"] .question-note {
  background: rgba(120, 53, 15, 0.32);
  border-color: rgba(251, 191, 36, 0.62);
  color: #fde68a;
}

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

.chip {
  border: 1px solid rgba(255,255,255,0.1);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.chip strong { color: inherit; }

.question {
  font-size: 1.35rem;
  line-height: 1.4;
  margin: 16px 0 24px 0;
}

.question-media-wrap {
  margin-top: 14px;
}

.question-media {
  width: min(520px, 100%);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  background: rgba(255,255,255,0.05);
}

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

.qa-image {
  width: min(420px, 100%);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  margin: 8px 0 10px 0;
  display: block;
}

.answers {
  display: grid;
  gap: 12px;
}

.answer-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, border 0.15s ease, background 0.15s ease;
}

.answer-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.2);
}

.answer-btn.correct {
  background: rgba(34, 197, 94, 0.38);
  border-color: rgba(34, 197, 94, 0.8);
}

.answer-btn.wrong {
  background: rgba(239, 68, 68, 0.35);
  border-color: rgba(239, 68, 68, 0.85);
}

.answer-btn.selected {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.14);
}

.answer-btn.wrong.selected {
  background: rgba(239, 68, 68, 0.45);
  border-color: rgba(239, 68, 68, 0.95);
}

.answer-btn.correct.selected {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.35);
}

.feedback {
  margin-top: 16px;
  min-height: 24px;
  font-size: 0.95rem;
}

#quiz-panel .feedback:empty {
  margin-top: 0;
  min-height: 0;
}

#quiz-panel .actions {
  margin-top: 16px;
}

#quiz-panel .feedback:empty + .actions {
  margin-top: 12px;
}

#quiz-panel .quiz-actions {
  width: min(520px, 100%);
  margin: 18px auto 0;
  padding: 8px;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(42, 15, 30, 0.78);
  box-shadow: 0 16px 42px rgba(0,0,0,0.22);
  backdrop-filter: blur(16px);
}

#quiz-panel .quiz-actions .primary {
  width: 100%;
  min-height: 54px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 1.04rem;
  font-weight: 850;
  box-shadow: 0 14px 28px rgba(244, 114, 182, 0.28);
}

#quiz-panel .quiz-actions .primary:disabled {
  cursor: default;
  opacity: 0.58;
  box-shadow: none;
  filter: saturate(0.72);
}

#quiz-panel .quiz-actions .primary:disabled:hover {
  transform: none;
}

body[data-interface="light"] #quiz-panel .quiz-actions {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255,255,255,0.86);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
}

body[data-interface="light"] #quiz-panel .quiz-actions .primary {
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.2);
}

body[data-interface="dark"] #quiz-panel .quiz-actions {
  border-color: rgba(255,255,255,0.12);
  background: rgba(22, 26, 33, 0.86);
  box-shadow: 0 18px 46px rgba(0,0,0,0.32);
}

.question-note {
  margin: 12px 0 16px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.1);
  color: #fde68a;
  font-size: 0.92rem;
  line-height: 1.45;
}

.secret-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 6, 16, 0.68);
  backdrop-filter: blur(10px);
}

.secret-modal-card {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.18);
  background:
    radial-gradient(circle at 18% 0%, rgba(249, 168, 212, 0.34), transparent 34%),
    linear-gradient(180deg, rgba(86, 25, 66, 0.98), rgba(42, 15, 30, 0.98));
  color: #fff7fb;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.secret-modal-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(244, 114, 182, 0.24);
  color: #fbcfe8;
  font-size: 1.55rem;
  line-height: 1;
}

.secret-modal-card h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.15;
}

.secret-modal-card p {
  margin: 0;
  color: #f3cde0;
  line-height: 1.5;
}

.secret-password-field {
  display: grid;
  gap: 8px;
  color: #fff7fb;
  font-weight: 750;
}

.secret-password-field input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 13px 14px;
  background: rgba(255,255,255,0.1);
  color: #fff7fb;
  font: inherit;
  outline: none;
}

.secret-password-field input::placeholder {
  color: rgba(255, 247, 251, 0.58);
}

.secret-password-field input:focus {
  border-color: rgba(249, 168, 212, 0.8);
  box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.18);
}

.secret-error {
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(251, 113, 133, 0.16);
  color: #fecdd3;
  font-size: 0.95rem;
  line-height: 1.4;
}

.secret-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

#secret-cancel-btn {
  border-color: rgba(255, 247, 251, 0.46);
  background: rgba(255, 247, 251, 0.14);
  color: #fff7fb;
  font-weight: 800;
}

#secret-cancel-btn:hover {
  border-color: rgba(255, 247, 251, 0.7);
  background: rgba(255, 247, 251, 0.22);
}

.secret-love-modal {
  position: fixed;
  inset: 0;
  z-index: 47;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(30, 6, 22, 0.72);
  backdrop-filter: blur(10px);
}

.secret-love-card {
  position: relative;
  isolation: isolate;
  width: min(460px, 100%);
  max-height: calc(100svh - 32px);
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.28);
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.06) 0 1px, transparent 1px 12px),
    radial-gradient(circle at 16% 0%, rgba(251, 207, 232, 0.46), transparent 36%),
    radial-gradient(circle at 100% 8%, rgba(244, 114, 182, 0.4), transparent 34%),
    linear-gradient(180deg, rgba(90, 24, 68, 0.98), rgba(42, 15, 30, 0.98));
  color: #fff7fb;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255,255,255,0.28);
}

.secret-love-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: -1;
  border-radius: 20px;
  border: 1px dashed rgba(251, 207, 232, 0.24);
  pointer-events: none;
}

.secret-love-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.secret-love-sparkles span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 247, 251, 0.16);
  color: #fff7fb;
  font-size: 1.05rem;
  text-shadow: 0 0 12px rgba(251, 207, 232, 0.95);
  box-shadow: 0 8px 22px rgba(244, 114, 182, 0.18);
}

.secret-love-sparkles span:nth-child(1) {
  top: 14px;
  left: 16px;
}

.secret-love-sparkles span:nth-child(2) {
  top: 18px;
  right: 18px;
}

.secret-love-sparkles span:nth-child(3) {
  right: 16px;
  bottom: 82px;
}

.secret-love-sparkles span:nth-child(4) {
  left: 18px;
  bottom: 78px;
}

.secret-love-image-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 368 / 300;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 18px;
  border: 2px solid rgba(255,255,255,0.88);
  background: #fff7fb;
  box-shadow: 0 16px 38px rgba(83, 16, 58, 0.28);
}

.secret-love-image-frame::after {
  content: "🐱  ☕  ✨";
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 247, 251, 0.88);
  color: #7a174f;
  font-size: 0.96rem;
  box-shadow: 0 8px 22px rgba(58, 16, 44, 0.14);
}

.secret-love-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

.secret-love-copy {
  display: grid;
  gap: 9px;
  padding: 2px 2px 0;
}

.secret-love-eyebrow {
  margin: 0;
  color: #fbcfe8;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.secret-love-card h2 {
  margin: 0;
  font-size: 1.46rem;
  line-height: 1.16;
  text-shadow: 0 2px 16px rgba(251, 207, 232, 0.22);
}

.secret-love-card p {
  margin: 0;
  color: #fde7f3;
  font-size: 0.98rem;
  line-height: 1.5;
}

.secret-love-charms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.secret-love-charms span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 247, 251, 0.14);
  border: 1px solid rgba(255, 247, 251, 0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}

.secret-love-actions {
  display: grid;
  margin-top: 2px;
}

.secret-love-close {
  width: 100%;
  min-height: 44px;
  background: linear-gradient(135deg, #f9a8d4, #f472b6);
  color: #4a1233;
  box-shadow:
    0 14px 30px rgba(244, 114, 182, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.36);
}

body.modal-open {
  overflow: hidden;
  touch-action: none;
}

.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }

.actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.menu-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
}

.menu-actions {
  display: grid;
  width: min(100%, 760px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  justify-content: stretch;
  margin-top: 18px;
  margin-left: auto;
  margin-right: auto;
}

.menu-secondary-actions {
  display: grid;
  display: contents;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.menu-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 0;
  max-width: none;
  min-height: 48px;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  font-weight: 760;
}

.menu-action-primary {
  min-height: 48px;
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-weight: 850;
}

.menu-action-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--accent-2);
}

.menu-action-primary .menu-action-icon {
  color: var(--accent);
}

.menu-action-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-start-actions {
  justify-content: center;
  margin-top: 18px;
}

.menu-start-actions .primary,
.settings-actions .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(280px, 100%);
  min-width: min(280px, 100%);
  min-height: 48px;
  padding: 0 24px;
  font-size: 0.96rem;
  font-weight: 850;
}

#menu-panel .label-with-info {
  position: relative;
  width: auto;
  justify-content: flex-start;
}

#menu-panel .label-with-info > span:first-child {
  color: var(--text);
  font-size: 1.04rem;
  font-weight: 850;
}

#menu-panel #section-field > label {
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 750;
}

#menu-panel .label-with-info .info-tip::after,
#menu-panel .label-with-info .info-tip::before {
  display: block;
}

#menu-panel .label-with-info .info-tip::after {
  left: 50%;
  right: auto;
  max-width: min(320px, calc(100vw - 48px));
  transform: translate(-50%, 4px);
}

#menu-panel .label-with-info .info-tip::before {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

#menu-panel .label-with-info .info-tip:hover::after,
#menu-panel .label-with-info .info-tip.tip-active::after,
#menu-panel .label-with-info .info-tip:focus::after,
#menu-panel .label-with-info .info-tip:focus-visible::after {
  transform: translate(-50%, 0);
}

#menu-panel .label-with-info::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  z-index: 60;
  width: max-content;
  max-width: min(300px, calc(100vw - 36px));
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid rgba(60, 64, 67, 0.14);
  background: rgba(255, 255, 255, 0.98);
  color: #202124;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.42;
  text-align: left;
  white-space: normal;
  box-shadow: 0 12px 32px rgba(60, 64, 67, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  display: none;
}

#menu-panel .label-with-info::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 61;
  border: 6px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.98);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.14s ease;
  display: none;
}

#menu-panel .label-with-info:hover::after,
#menu-panel .label-with-info:hover::before,
#menu-panel .label-with-info:focus-within::after,
#menu-panel .label-with-info:focus-within::before,
#menu-panel .label-with-info:has(.info-tip.tip-active)::after,
#menu-panel .label-with-info:has(.info-tip.tip-active)::before {
  opacity: 1;
}

#menu-panel .label-with-info:hover::after,
#menu-panel .label-with-info:focus-within::after,
#menu-panel .label-with-info:has(.info-tip.tip-active)::after {
  transform: translate(-50%, 0);
}

body[data-interface="dark"] #menu-panel .label-with-info::after {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.98);
  color: #f8fafc;
  box-shadow: 0 16px 36px rgba(0,0,0,0.38);
}

body[data-interface="dark"] #menu-panel .label-with-info::before {
  border-top-color: rgba(15, 23, 42, 0.98);
}

body[data-interface="secret"] #menu-panel .label-with-info::after {
  border-color: rgba(249, 168, 212, 0.24);
  background: rgba(58, 22, 48, 0.98);
  color: #fff7fb;
  box-shadow: 0 16px 36px rgba(0,0,0,0.34);
}

body[data-interface="secret"] #menu-panel .label-with-info::before {
  border-top-color: rgba(58, 22, 48, 0.98);
}

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

.field label {
  font-size: 0.85rem;
  color: var(--muted);
}

.field input[type="text"],
.field input[type="url"] {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.95rem;
}

.mode-card {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  display: grid;
  gap: 12px;
}

.settings-panel {
  margin-top: 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
}

.settings-panel .mode-card {
  margin-top: 0;
}

.settings-panel .mode-card + .mode-card {
  margin-top: 12px;
}

.settings-panel #limit-field + .answer-toggle-card {
  margin-top: 12px;
}

.answer-toggle-card {
  padding: 0;
}

.toggle-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 14px;
}

.toggle-copy {
  display: grid;
  min-width: 0;
}

.toggle-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.toggle-title {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 850;
  line-height: 1.2;
}

.answer-toggle-info::after {
  max-width: min(310px, calc(100vw - 48px));
}

.toggle-control {
  position: relative;
  display: block;
  width: 52px;
  height: 30px;
  cursor: pointer;
}

.toggle-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle-track {
  display: block;
  width: 52px;
  height: 30px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.16);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.toggle-thumb {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 5px 12px rgba(0,0,0,0.22);
  transform: translateX(0);
  transition: transform 0.16s ease;
}

.toggle-input:checked + .toggle-track {
  border-color: transparent;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(244, 114, 182, 0.2);
}

.toggle-input:checked + .toggle-track .toggle-thumb {
  transform: translateX(22px);
}

.toggle-input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.settings-actions {
  justify-content: center;
  margin-top: 14px;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

#settings-back-btn,
#qa-back-btn,
#stats-back-btn {
  width: auto;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border-radius: 14px;
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.07);
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 18px rgba(0,0,0,0.1);
}

#settings-back-btn::before,
#qa-back-btn::before,
#stats-back-btn::before {
  content: "";
  width: 10px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.9;
}

#settings-back-btn:hover,
#qa-back-btn:hover,
#stats-back-btn:hover {
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.13);
  color: var(--text);
  transform: translateY(-1px);
}

#settings-back-btn:focus-visible,
#qa-back-btn:focus-visible,
#stats-back-btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

body[data-interface="light"] #settings-back-btn,
body[data-interface="light"] #qa-back-btn,
body[data-interface="light"] #stats-back-btn {
  border-color: rgba(15, 23, 42, 0.13);
  background: #ffffff;
  color: #334155;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

body[data-interface="light"] #settings-back-btn:hover,
body[data-interface="light"] #qa-back-btn:hover,
body[data-interface="light"] #stats-back-btn:hover {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eff6ff;
  color: #1d4ed8;
}

body[data-interface="dark"] #settings-back-btn,
body[data-interface="dark"] #qa-back-btn,
body[data-interface="dark"] #stats-back-btn {
  border-color: rgba(125, 211, 252, 0.22);
  background: rgba(15, 23, 42, 0.52);
  color: #e0f2fe;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 8px 18px rgba(0, 0, 0, 0.22);
}

body[data-interface="dark"] #settings-back-btn:hover,
body[data-interface="dark"] #qa-back-btn:hover,
body[data-interface="dark"] #stats-back-btn:hover {
  border-color: rgba(125, 211, 252, 0.38);
  background: rgba(14, 116, 144, 0.24);
  color: #f0f9ff;
}

.view-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  margin-bottom: 0;
}

.view-header #qa-back-btn,
.view-header #settings-back-btn,
.view-header #stats-back-btn {
  justify-self: start;
}

.view-header::after {
  content: "";
  display: block;
  width: 124px;
  max-width: 18vw;
}

.view-title {
  margin: 0;
  display: grid;
  gap: 3px;
  color: var(--text);
  justify-self: center;
  text-align: center;
  font-size: clamp(1rem, 0.5vw + 0.92rem, 1.28rem);
  font-weight: 760;
  line-height: 1.25;
}

.view-title-main,
.view-title-subtitle {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.view-title-main {
  color: var(--text);
  font-size: inherit;
  font-weight: 760;
  line-height: 1.2;
}

.view-title-subtitle {
  color: var(--muted);
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(0.82rem, 0.35vw + 0.74rem, 0.96rem);
  font-weight: 500;
  line-height: 1.35;
}

.stats-view-title {
  font-size: clamp(1rem, 0.7vw + 0.95rem, 1.28rem);
  font-weight: 800;
}

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

.mode-option {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.mode-option:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.26);
}

.mode-option.active {
  background: rgba(244, 114, 182, 0.18);
  border-color: rgba(249, 168, 212, 0.65);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.mode-option strong {
  display: inline;
  font-size: 0.95rem;
}

.mode-label-row,
.label-with-info {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.mode-label-row {
  justify-content: space-between;
  width: 100%;
}

.label-with-info {
  width: 100%;
  justify-content: space-between;
}

.info-tip {
  position: relative;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(95, 99, 104, 0.1);
  color: #5f6368;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  cursor: help;
  box-shadow: none;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.info-tip:hover,
.info-tip.tip-active,
.info-tip:focus,
.info-tip:focus-visible {
  border-color: rgba(95, 99, 104, 0.08);
  background: rgba(95, 99, 104, 0.16);
  color: #3c4043;
  transform: translateY(-1px);
}

.info-tip:focus-visible {
  outline: 2px solid rgba(66, 133, 244, 0.55);
  outline-offset: 3px;
}

.info-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 60;
  width: max-content;
  max-width: min(260px, calc(100vw - 40px));
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid rgba(60, 64, 67, 0.14);
  background: rgba(255, 255, 255, 0.98);
  color: #202124;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.42;
  text-align: left;
  white-space: normal;
  box-shadow: 0 12px 32px rgba(60, 64, 67, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.info-tip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  z-index: 61;
  border: 6px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.98);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.14s ease;
}

body[data-interface="dark"] .info-tip {
  background: rgba(148, 163, 184, 0.13);
  color: #cbd5e1;
}

body[data-interface="dark"] .info-tip:hover,
body[data-interface="dark"] .info-tip.tip-active,
body[data-interface="dark"] .info-tip:focus,
body[data-interface="dark"] .info-tip:focus-visible {
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(148, 163, 184, 0.22);
  color: #f8fafc;
}

body[data-interface="dark"] .info-tip::after {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.98);
  color: #f8fafc;
  box-shadow: 0 16px 36px rgba(0,0,0,0.38);
}

body[data-interface="dark"] .info-tip::before {
  border-top-color: rgba(15, 23, 42, 0.98);
}

body[data-interface="secret"] .info-tip {
  background: rgba(255, 247, 251, 0.16);
  color: #fff7fb;
}

body[data-interface="secret"] .info-tip:hover,
body[data-interface="secret"] .info-tip.tip-active,
body[data-interface="secret"] .info-tip:focus,
body[data-interface="secret"] .info-tip:focus-visible {
  border-color: rgba(249, 168, 212, 0.2);
  background: rgba(255, 247, 251, 0.24);
  color: #ffffff;
}

body[data-interface="secret"] .info-tip::after {
  border-color: rgba(249, 168, 212, 0.24);
  background: rgba(58, 22, 48, 0.98);
  color: #fff7fb;
  box-shadow: 0 16px 36px rgba(0,0,0,0.34);
}

body[data-interface="secret"] .info-tip::before {
  border-top-color: rgba(58, 22, 48, 0.98);
}

.info-tip:hover::after,
.info-tip:hover::before,
.info-tip.tip-active::after,
.info-tip.tip-active::before,
.info-tip:focus::after,
.info-tip:focus::before,
.info-tip:focus-visible::after,
.info-tip:focus-visible::before {
  opacity: 1;
}

.info-tip:hover::after,
.info-tip.tip-active::after,
.info-tip:focus::after,
.info-tip:focus-visible::after {
  transform: translate(-50%, 0);
}

.mode-label-row .info-tip::after,
.label-with-info .info-tip::after {
  left: auto;
  right: 0;
  max-width: min(280px, calc(100vw - 36px));
  transform: translateY(4px);
}

.mode-label-row .info-tip::before,
.label-with-info .info-tip::before {
  left: auto;
  right: 3px;
  transform: none;
}

.mode-label-row .info-tip:hover::after,
.mode-label-row .info-tip.tip-active::after,
.mode-label-row .info-tip:focus::after,
.mode-label-row .info-tip:focus-visible::after,
.label-with-info .info-tip:hover::after,
.label-with-info .info-tip.tip-active::after,
.label-with-info .info-tip:focus::after,
.label-with-info .info-tip:focus-visible::after {
  transform: translateY(0);
}

.mode-details {
  display: grid;
  gap: 10px;
}

.number-input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.95rem;
  width: 100%;
}

.custom-limit-field {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.dropdown {
  position: relative;
  width: 100%;
}

.dropdown-trigger {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.95rem;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.dropdown-trigger::after {
  content: "▾";
  font-size: 0.9rem;
  color: var(--muted);
}

.dropdown-trigger.loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  opacity: 0.7;
  animation: dropdown-spin 0.7s linear infinite;
}

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

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: linear-gradient(180deg, rgba(255, 226, 240, 0.95), rgba(255, 199, 225, 0.95));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 5;
  max-height: 260px;
  overflow: auto;
  display: none;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.95rem;
  color: #3b0a26;
}

body[data-interface="light"] .dropdown-menu {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.12);
}

body[data-interface="light"] .dropdown-item {
  color: var(--text);
}

body[data-interface="light"] .dropdown-item:hover {
  background: rgba(37, 99, 235, 0.08);
}

body[data-interface="dark"] .dropdown-menu {
  background: #202631;
  border-color: rgba(255,255,255,0.14);
}

body[data-interface="dark"] .dropdown-item {
  color: var(--text);
}

body[data-interface="dark"] .dropdown-item:hover {
  background: rgba(56, 189, 248, 0.14);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(242, 114, 182, 0.25);
}

.dropdown-item.active {
  font-weight: 850;
  background: rgba(244, 114, 182, 0.22);
}

body[data-interface="light"] .dropdown-item.active {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

body[data-interface="dark"] .dropdown-item.active {
  background: rgba(56, 189, 248, 0.18);
  color: #e0f2fe;
}

.dropdown-item[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.stats-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.stats-tab-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}

.stats-tab {
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.stats-tab.active {
  background: var(--accent);
  color: #3b0a26;
  box-shadow: 0 10px 22px rgba(242, 158, 56, 0.24);
}

.stats-tab-content {
  display: grid;
  gap: 12px;
}

.stats-question-item {
  display: grid;
  gap: 6px;
}

.stats-wrong-count {
  font-weight: 800;
  color: var(--bad);
}

.qa-item .stats-muted-line {
  color: var(--muted);
  font-weight: 600;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.95rem;
}

.stat-item span {
  color: var(--muted);
  font-size: 0.85rem;
}

button.primary {
  background: var(--accent);
  color: #3b0a26;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 20px rgba(242, 158, 56, 0.3);
}

body[data-interface="light"] button.primary {
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.16);
}

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

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 12px 20px;
  cursor: pointer;
}

button.ghost.small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

#abandon-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 10px;
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.08);
  font-size: 0.82rem;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: none;
}

#abandon-btn::before {
  content: "×";
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1;
  opacity: 0.86;
}

#abandon-btn:hover {
  color: #fee2e2;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.45);
}

body[data-interface="light"] #abandon-btn {
  color: #991b1b;
  border-color: rgba(185, 28, 28, 0.18);
  background: rgba(254, 242, 242, 0.72);
}

body[data-interface="light"] #abandon-btn:hover {
  color: #7f1d1d;
  border-color: rgba(220, 38, 38, 0.34);
  background: #fee2e2;
}

body[data-interface="dark"] #abandon-btn {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.22);
  background: rgba(127, 29, 29, 0.24);
}

body[data-interface="dark"] #abandon-btn:hover {
  color: #fee2e2;
  border-color: rgba(252, 165, 165, 0.38);
  background: rgba(127, 29, 29, 0.42);
}

.hidden { display: none; }

.top-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 6px;
  min-height: 32px;
  gap: 10px;
}

.result {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--muted);
}

.review-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.review-item {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.review-item strong {
  color: var(--text);
}

.review-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.review-list-container {
  max-height: 70vh;
  overflow: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding-right: 4px;
  min-width: 0;
}

.qa-status {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(15, 23, 42, 0.92);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
  text-align: center;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.qa-status.complete {
  color: var(--accent-2);
}

body[data-interface="light"] .qa-status {
  border-color: rgba(37, 99, 235, 0.12);
  background: rgba(248, 250, 252, 0.94);
  color: #536071;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body[data-interface="light"] .qa-status.complete {
  color: #1d4ed8;
}

.qa-item {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  overflow-wrap: anywhere;
}

.qa-item .question {
  margin: 0 0 8px 0;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.qa-item .answer {
  color: var(--accent-2);
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.qa-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 8px 0 6px 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  min-width: 0;
}

.qa-option {
  min-width: 0;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  overflow-wrap: anywhere;
}

.qa-option.correct {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.18);
  color: #d9fbe2;
}

.answer-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #c8facc;
  margin-left: 8px;
  vertical-align: middle;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

.score {
  font-size: clamp(2.4rem, 2vw + 1.6rem, 3.2rem);
  color: var(--accent-2);
  font-weight: 600;
  margin: 12px 0 0 0;
}

@media (max-width: 640px) {
  body {
    min-height: 100svh;
    place-items: start center;
    padding: 86px 16px 24px;
    overscroll-behavior-x: contain;
  }
  body.menu-active {
    padding-top: clamp(136px, 15svh, 188px);
    padding-bottom: 44px;
  }
  .app {
    gap: 18px;
    touch-action: pan-y;
  }
  body.menu-active .app {
    gap: clamp(22px, 4svh, 34px);
  }
  .interface-menu {
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
  }
  .interface-trigger {
    width: 50px;
    height: 50px;
  }
  body.menu-active .interface-trigger {
    width: 56px;
    height: 56px;
  }
  .interface-icon {
    width: 24px;
    height: 24px;
  }
  .interface-menu-list {
    width: 154px;
  }
  #menu-panel {
    text-align: center;
    padding: 24px 20px;
  }
  #menu-panel .menu-grid {
    width: 100%;
    justify-items: center;
  }
  #menu-panel .menu-grid > div {
    width: min(100%, 440px);
  }
  #menu-panel .field {
    justify-items: center;
  }
  #menu-panel .label-with-info {
    width: auto;
    justify-content: center;
  }
  #menu-panel .label-with-info .info-tip::after,
  #menu-panel .label-with-info .info-tip::before {
    display: none;
  }
  #menu-panel .label-with-info::after,
  #menu-panel .label-with-info::before {
    display: block;
  }
  #menu-panel .dropdown {
    width: 100%;
  }
  #menu-panel .dropdown-trigger {
    position: relative;
    justify-content: center;
    min-height: 54px;
    padding-left: 42px;
    padding-right: 42px;
    border-radius: 14px;
    font-size: 1rem;
    text-align: center;
  }
  #menu-panel .dropdown-trigger::after {
    position: absolute;
    right: 14px;
  }
  #menu-panel .menu-actions,
  #menu-panel .menu-start-actions {
    width: 100%;
    justify-content: center;
  }
  #menu-panel .menu-actions {
    grid-template-columns: minmax(0, 1fr);
  }
  #menu-panel .menu-secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #menu-panel .menu-start-actions,
  #settings-panel .settings-actions {
    align-items: center;
  }
  #menu-panel .menu-actions button {
    min-height: 52px;
    font-size: 0.98rem;
    font-weight: 750;
  }
  #menu-panel .menu-action-primary {
    min-height: 58px;
    font-size: 1.04rem;
  }
  #menu-panel .menu-secondary-actions {
    gap: 9px;
  }
  #menu-panel .menu-start-actions .primary,
  #settings-panel .settings-actions .primary {
    width: min(280px, 100%);
    min-width: 0;
    min-height: 56px;
    font-size: 1.02rem;
    font-weight: 850;
  }
  header {
    gap: 6px;
  }
  h1 {
    font-size: clamp(1.68rem, 7vw, 2.2rem);
    line-height: 1.08;
  }
  .header-title-row {
    align-items: flex-start;
    gap: 9px;
  }
  .header-favicon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
  }
  .public-context {
    top: max(14px, env(safe-area-inset-top));
    left: 14px;
  }
  .public-info-trigger {
    min-height: 44px;
    padding: 0 14px;
    font-size: 0.86rem;
  }
  body.menu-active .public-info-trigger {
    min-height: 48px;
    padding: 0 16px;
    font-size: 0.9rem;
  }
  .public-info-modal {
    align-items: center;
    place-items: center;
    padding: 12px;
  }
  .public-info-modal-card {
    width: 100%;
    max-height: min(88svh, calc(100svh - 24px));
    border-radius: 18px;
  }
  .public-info-modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 10px;
    background: inherit;
    box-shadow: 0 1px 0 rgba(255,255,255,0.08);
  }
  .public-info-modal-head h2 {
    font-size: 1.22rem;
  }
  .public-close {
    min-height: 38px;
    padding: 8px 10px;
  }
  .public-info-body {
    gap: 10px;
    padding: 2px 14px max(14px, env(safe-area-inset-bottom));
  }
  .public-info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .public-info-card,
  .public-note {
    border-radius: 14px;
    padding: 12px;
  }
  .public-eyebrow {
    margin-bottom: 4px;
    font-size: 0.68rem;
  }
  .public-copy,
  .public-note {
    font-size: 0.84rem;
    line-height: 1.45;
  }
  .public-points {
    margin-top: 8px;
    padding-left: 16px;
    font-size: 0.82rem;
    line-height: 1.45;
  }
  .public-note-mark {
    width: 24px;
    height: 24px;
  }
  .public-feedback {
    grid-template-columns: 1fr;
    order: -1;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
  }
  .public-feedback-copy strong {
    font-size: 0.95rem;
  }
  .public-feedback-copy span {
    font-size: 0.84rem;
    line-height: 1.4;
  }
  .public-feedback-actions {
    min-width: 0;
  }
  .public-feedback-actions a {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }
  .app-share-card,
  .share-inline {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .app-share-btn,
  .share-inline-btn {
    width: 100%;
    min-height: 40px;
  }
  .public-info-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px 7px;
    font-size: 0.65rem;
  }
  .public-info-meta span {
    min-height: 24px;
    padding: 4px 8px;
  }
  .info-tip::after {
    max-width: min(250px, calc(100vw - 54px));
    font-size: 0.8rem;
    overflow-wrap: anywhere;
  }
  .label-with-info .info-tip::after {
    max-width: min(250px, calc(100vw - 54px));
  }
  .mode-label-row .info-tip::after {
    max-width: min(200px, calc(100vw - 88px));
  }
  .toggle-setting {
    gap: 12px;
    padding: 12px;
  }
  .answer-toggle-info::after {
    max-width: min(245px, calc(100vw - 54px));
  }
  .toggle-control,
  .toggle-track {
    width: 48px;
    height: 28px;
  }
  .toggle-thumb {
    width: 20px;
    height: 20px;
  }
  .toggle-input:checked + .toggle-track .toggle-thumb {
    transform: translateX(20px);
  }
  .feedback-reminder-modal,
  .support-reminder-modal,
  .secret-love-modal {
    place-items: center;
    padding: 16px;
  }
  .secret-love-card {
    width: min(100%, 430px);
    max-height: calc(100svh - 32px);
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
  }
  .secret-love-image-frame {
    border-radius: 16px;
  }
  .secret-love-card h2 {
    font-size: 1.24rem;
  }
  .secret-love-card p {
    font-size: 0.9rem;
    line-height: 1.45;
  }
  .feedback-reminder-card {
    width: min(100%, 430px);
    max-height: calc(100svh - 32px);
    gap: 12px;
    padding: 20px;
    border-radius: 22px;
  }
  .feedback-reminder-icon {
    width: 44px;
    height: 44px;
    border-radius: 15px;
  }
  .feedback-reminder-card h2 {
    font-size: 1.22rem;
  }
  .feedback-reminder-card p {
    font-size: 0.9rem;
    line-height: 1.45;
  }
  .feedback-reminder-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .feedback-reminder-actions .ghost,
  .feedback-reminder-link {
    width: 100%;
    min-height: 44px;
  }
  .feedback-reminder-link {
    order: -1;
  }
  .support-reminder-card {
    width: min(100%, 430px);
    max-height: calc(100svh - 32px);
    overflow: auto;
    gap: 12px;
    padding: 18px;
    border-radius: 22px;
  }
  .support-reminder-image-frame {
    height: 205px;
    border-radius: 16px;
  }
  .support-reminder-card h2 {
    font-size: 1.18rem;
  }
  .support-reminder-card p {
    font-size: 0.9rem;
    line-height: 1.45;
  }
  .support-reminder-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .stats { flex-direction: column; align-items: flex-start; }
  .question { font-size: 1.2rem; }
  .stats button.ghost.small { align-self: flex-start; }
  .stats.quiz-stats { flex-direction: row; align-items: center; }
  .menu-grid { gap: 24px; }
  .panel { padding: 20px; }
  body.settings-active .app,
  body.questions-active .app,
  body.stats-active .app {
    padding-top: 0;
  }
  body.questions-active h1 {
    font-size: clamp(1.52rem, 6vw, 1.95rem);
    line-height: 1.05;
  }
  .actions { flex-direction: column; align-items: stretch; }
  .menu-actions {
    align-items: stretch;
  }
  .menu-actions button {
    padding-left: 10px;
    padding-right: 10px;
  }
  button.primary, button.ghost { width: 100%; justify-content: center; }
  #quiz-panel .top-controls button.ghost {
    width: auto;
  }
  #abandon-btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 0.78rem;
  }
  .view-header #settings-back-btn,
  .view-header #qa-back-btn,
  .view-header #stats-back-btn {
    width: auto;
    min-height: 44px;
    padding: 0 16px;
    align-self: center;
    justify-self: start;
    font-size: 0.95rem;
  }
  .view-header {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: stretch;
    align-items: center;
    gap: 12px;
    min-height: 0;
    margin-bottom: 0;
    text-align: left;
  }
  .view-header::after {
    display: none;
  }
  .view-title {
    width: 100%;
    justify-self: center;
    text-align: left;
    font-size: 1.18rem;
  }
  .view-title-subtitle {
    font-size: 0.86rem;
    text-align: left;
  }
  .mode-switch { grid-template-columns: 1fr; }
  .review-list-container { max-height: 75vh; padding-right: 0; }
  .qa-item { padding: 14px; }
  #quiz-panel .stats { position: sticky; top: 0; z-index: 2; background: rgba(255, 230, 242, 0.6); backdrop-filter: blur(8px); padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.2); }
  body[data-interface="light"] #quiz-panel .stats { background: rgba(246, 248, 251, 0.88); border-bottom-color: rgba(15, 23, 42, 0.08); }
  body[data-interface="dark"] #quiz-panel .stats { background: rgba(22, 26, 33, 0.88); border-bottom-color: rgba(255,255,255,0.12); }
  #stats-panel .stats { gap: 10px; }
}

@media (max-width: 380px) {
  body {
    padding-left: 12px;
    padding-right: 12px;
  }
  .public-context {
    left: 10px;
  }
  .interface-menu {
    right: 10px;
  }
  .public-info-trigger {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.78rem;
  }
  .interface-trigger {
    width: 46px;
    height: 46px;
  }
  h1 {
    font-size: clamp(1.52rem, 7vw, 1.9rem);
  }
  .header-favicon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
  }
  .public-info-modal {
    padding: 8px;
  }
  .public-info-modal-card {
    max-height: calc(100svh - 16px);
    border-radius: 16px;
  }
  .public-info-modal-head {
    padding: 12px 12px 8px;
  }
  .public-info-modal-head h2 {
    font-size: 1.12rem;
  }
  .public-info-body {
    padding: 2px 12px max(12px, env(safe-area-inset-bottom));
  }
  .public-copy,
  .public-points,
  .public-note,
  .public-feedback-copy span {
    font-size: 0.8rem;
  }
  .public-info-meta {
    font-size: 0.62rem;
  }
}
