:root {
  color-scheme: dark;
  --bg: #262626;
  --bg-elevated: #2f2f2f;
  --panel: #1d1d1d;
  --panel-soft: #202020;
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f5f5f5;
  --muted: #a7a7a7;
  --blue: #1984ff;
  --blue-strong: #1f89ff;
  --brand-yellow: #fde910;
  --brand-yellow-ink: #111111;
  --green: #32d067;
  --orange: #f7a31c;
  --purple: #ab56e9;
  --sky: #55b8f0;
  --red: #ff4b68;
  --shadow: 0 20px 42px rgba(0, 0, 0, 0.22);
  --radius-xl: 28px;
  --radius-lg: 24px;
  --radius-md: 20px;
  --radius-sm: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  background:
    radial-gradient(circle at top center, rgba(25, 132, 255, 0.08), transparent 26%),
    var(--bg);
}

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

button {
  border: 0;
  background: none;
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 12px 0 112px;
}

.topbar {
  padding: 0 14px 14px;
}

.brand-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.brand-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7a31c, #ff4b68 58%, #1984ff);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
}

.topbar-kicker,
.section-kicker,
.small-label {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

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

h1 {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 600;
}

h2 {
  font-size: 20px;
  font-weight: 700;
}

h3 {
  font-size: 18px;
  font-weight: 700;
}

.topbar-subtitle,
.sheet-copy,
.helper-text,
.muted,
.empty-copy {
  color: var(--muted);
  line-height: 1.45;
}

.topbar-subtitle {
  margin-top: 4px;
  font-size: 14px;
}

.screen-stack {
  padding: 0 14px;
}

.screen {
  display: none;
  gap: 16px;
}

.screen.active {
  display: grid;
}

.hero-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px;
  border-radius: var(--radius-xl);
  background: var(--brand-yellow);
  color: var(--brand-yellow-ink);
  box-shadow: var(--shadow);
  text-align: left;
}

.hero-banner.compact {
  padding: 16px 18px;
}

.hero-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(17, 17, 17, 0.08);
  font-size: 22px;
  flex: 0 0 auto;
}

.hero-banner-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.hero-banner-copy strong {
  font-size: 17px;
  font-weight: 700;
}

.hero-banner-copy span {
  font-size: 13px;
  opacity: 0.92;
}

.hero-banner-chevron {
  margin-left: auto;
  font-size: 34px;
  line-height: 1;
  opacity: 0.8;
}

.card,
.output-card,
.settings-list {
  background: var(--panel);
  border-radius: var(--radius-xl);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.card,
.output-card {
  padding: 18px;
}

.daily-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.card-heading,
.sheet-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.plan-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(25, 132, 255, 0.18);
  color: #cfe5ff;
  font-size: 12px;
  font-weight: 700;
}

.plan-badge.active {
  background: rgba(50, 208, 103, 0.18);
  color: #dfffea;
}

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

.metric-card {
  padding: 16px;
  border-radius: 22px;
  background: #212121;
  border: 1px solid var(--panel-border);
}

.metric-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 28px;
}

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

.metric-card.tone-accent {
  background: linear-gradient(180deg, rgba(25, 132, 255, 0.18), rgba(25, 132, 255, 0.08));
}

.metric-card.tone-success {
  background: linear-gradient(180deg, rgba(50, 208, 103, 0.18), rgba(50, 208, 103, 0.08));
}

.stack,
.plan-list {
  display: grid;
  gap: 12px;
}

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

.summary-item,
.focus-note,
.plan-item,
.mistake-card,
.word-card,
.insight-card {
  padding: 14px;
  border-radius: 20px;
  background: #232323;
  border: 1px solid var(--panel-border);
}

.word-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.word-text {
  flex: 1;
  font-size: 16px;
  word-break: break-word;
}

.word-tts-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(25, 132, 255, 0.15);
  color: var(--blue);
  flex: 0 0 auto;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.word-tts-btn:hover,
.word-tts-btn:active,
.word-tts-btn.playing {
  background: var(--blue);
  color: #fff;
  transform: scale(1.05);
}

.word-tts-btn svg {
  width: 20px;
  height: 20px;
}

.word-meaning {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.word-example {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  line-height: 1.45;
  font-style: italic;
  margin: 0;
}

.premium-card {
  background:
    radial-gradient(circle at top right, rgba(25, 132, 255, 0.16), transparent 36%),
    var(--panel);
}

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

.meter-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--sky));
}

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

.benefits-list p {
  padding: 12px 14px;
  border-radius: 16px;
  background: #232323;
  border: 1px solid var(--panel-border);
}

.summary-item strong,
.focus-note strong {
  display: block;
  margin-top: 6px;
}

textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: #252525;
  color: var(--text);
}

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

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

.primary-button,
.secondary-button,
.text-button,
.sheet-action-button {
  cursor: pointer;
}

a.hero-banner,
a.primary-button,
a.secondary-button,
a.text-button {
  text-decoration: none;
}

.primary-button,
.secondary-button,
.sheet-action-button {
  min-height: 48px;
  border-radius: 16px;
  padding: 0 16px;
}

a.primary-button,
a.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-button {
  background: var(--brand-yellow);
  color: var(--brand-yellow-ink);
}

.secondary-button {
  background: #2a2a2a;
  color: var(--text);
}

.text-button {
  color: var(--brand-yellow);
}

.hidden {
  display: none !important;
}

.output-card {
  margin-top: 14px;
  background: #222a34;
}

.plan-item {
  display: grid;
  gap: 8px;
}

.plan-index {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(25, 132, 255, 0.18);
  color: #89c4ff;
  font-weight: 700;
}

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

.calendar-day {
  aspect-ratio: 1;
  border-radius: 14px;
  background: #202020;
  border: 1px solid var(--panel-border);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
}

.calendar-day.active {
  background: rgba(25, 132, 255, 0.18);
  color: #dfefff;
}

.calendar-day.completed {
  background: rgba(50, 208, 103, 0.24);
  color: #f4fff8;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 6px;
  background: #202020;
}

.legend-dot.active {
  background: rgba(25, 132, 255, 0.8);
}

.legend-dot.completed {
  background: rgba(50, 208, 103, 0.9);
}

.settings-section {
  display: grid;
  gap: 14px;
}

.settings-list {
  overflow: hidden;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 84px;
  padding: 0 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  flex: 0 0 auto;
}

.settings-icon.blue {
  background: var(--blue);
}

.settings-icon.orange {
  background: var(--orange);
}

.settings-icon.purple {
  background: var(--purple);
}

.settings-icon.green {
  background: var(--green);
}

.settings-icon.sky {
  background: var(--sky);
}

.settings-icon.red {
  background: var(--red);
}

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

.settings-copy strong {
  font-size: 18px;
  font-weight: 500;
}

.settings-copy span {
  color: var(--muted);
  font-size: 13px;
}

.settings-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 36px;
  line-height: 1;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(24, 24, 24, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-button {
  min-height: 72px;
  display: grid;
  place-items: center;
  gap: 6px;
  color: #8f8f8f;
  font-size: 13px;
  font-weight: 500;
}

.nav-button.active {
  color: var(--brand-yellow);
}

.nav-icon {
  font-size: 24px;
  line-height: 1;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: #1f1f1f;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  margin: 0 auto 14px;
  background: rgba(255, 255, 255, 0.18);
}

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

.sheet-form label {
  display: grid;
  gap: 8px;
}

.sheet-form span {
  color: var(--muted);
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.sheet-action-button.secondary {
  background: #2a2a2a;
  color: var(--text);
}

.sheet-action-button.primary {
  background: var(--brand-yellow);
  color: var(--brand-yellow-ink);
}

.reset-warning {
  padding: 14px;
  border-radius: 18px;
  margin-bottom: 14px;
  background: rgba(255, 75, 104, 0.12);
  color: #ffdbe1;
}

.myroom-text {
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

.myroom-footer {
  margin-top: 20px;
}

@media (min-width: 900px) {
  .app-shell {
    max-width: 760px;
    margin: 0 auto;
  }
}

.profile-wrapper {
  padding: 24px;
  text-align: center;
}
.profile-quote {
  font-size: 18px;
  margin-bottom: 24px;
  color: var(--sky);
}
.profile-username {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.profile-stat {
  background: #232323;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 16px;
}
.stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 24px;
  font-weight: 600;
}
.profile-calendar {
  margin-bottom: 24px;
}
.profile-footer {
  font-size: 16px;
  color: var(--muted);
}
.profile-footer div:first-child {
  margin-bottom: 4px;
}

.calendar-day.today {
  background: var(--blue);
  color: #fff;
}