:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f0f5f4;
  --ink: #17212b;
  --muted: #66717f;
  --line: #dfe5ea;
  --accent: #c94d63;
  --accent-2: #168c84;
  --accent-3: #d39128;
  --accent-4: #4b5cc4;
  --danger: #b43a33;
  --shadow: 0 16px 40px rgba(31, 42, 55, 0.09);
  --radius: 8px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(22, 140, 132, 0.06) 0, transparent 260px),
    var(--bg);
  overscroll-behavior-y: contain;
}

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

button {
  cursor: pointer;
  touch-action: manipulation;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 84px;
  padding: 16px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid rgba(223, 229, 234, 0.86);
  background: rgba(247, 248, 251, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: var(--radius);
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: var(--shadow);
}

.brand h1,
.panel h2,
.schema-panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.1;
}

.brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.top-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.top-metrics strong {
  min-width: 70px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: #ffffff;
  text-align: center;
  background: var(--ink);
}

.workspace {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 24px;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 44px) 44px;
}

.sidebar {
  position: sticky;
  top: 108px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: start;
  min-height: 360px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.nav-item span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  background: #eef2f6;
  font-size: 12px;
  font-weight: 800;
}

.nav-item.active,
.nav-item:hover {
  border-color: rgba(201, 77, 99, 0.26);
  background: rgba(201, 77, 99, 0.09);
}

.nav-item.active span {
  color: #ffffff;
  background: var(--accent);
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.dashboard-grid,
.study-layout,
.import-grid {
  display: grid;
  gap: 20px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
}

.study-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
}

.import-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.daily-panel,
.method-panel,
.today-panel,
.word-panel,
.list-panel,
.repeat-panel,
.feedback-panel,
.context-panel,
.dictation-panel,
.dictation-list-panel,
.favorites-panel,
.import-panel {
  padding: clamp(16px, 3vw, 24px);
}

.today-panel,
.context-panel,
.favorites-panel,
.import-panel {
  margin-top: 20px;
}

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

.compact-heading {
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel h2 {
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.16;
}

.compact-heading h2,
.schema-panel h3 {
  font-size: 20px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 750;
  letter-spacing: 0;
}

.primary-btn {
  color: #ffffff;
  background: var(--accent);
}

.primary-btn:hover {
  background: #b94357;
}

.secondary-btn {
  color: #ffffff;
  background: var(--accent-2);
}

.secondary-btn:hover {
  background: #117870;
}

.ghost-btn {
  color: var(--ink);
  border-color: var(--line);
  background: #ffffff;
}

.ghost-btn:hover {
  border-color: #c6d0d8;
  background: #f4f7fa;
}

.danger-btn {
  color: #ffffff;
  background: var(--danger);
}

.wide-btn {
  min-width: 140px;
  padding-inline: 22px;
}

.icon-btn {
  display: grid;
  width: 44px;
  min-width: 44px;
  place-items: center;
  color: var(--ink);
  border-color: var(--line);
  background: #ffffff;
  font-size: 20px;
}

.inline-actions,
.player-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.inline-actions button,
.player-controls button,
.panel-heading button {
  padding: 0 16px;
}

.progress-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.progress-ring {
  position: relative;
  width: 132px;
  height: 132px;
}

.progress-ring svg {
  width: 132px;
  height: 132px;
  transform: rotate(-90deg);
}

.progress-ring circle {
  fill: none;
  stroke-width: 11;
}

.ring-track {
  stroke: #e6ebef;
}

.ring-fill {
  stroke: var(--accent-2);
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.25s ease;
}

.progress-ring span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 27px;
  font-weight: 850;
}

.target-control {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  font-size: 16px;
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 9px 11px;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(22, 140, 132, 0.14);
}

.stepper {
  display: grid;
  grid-template-columns: 42px minmax(70px, 1fr) 42px;
  gap: 8px;
  max-width: 230px;
}

.stepper button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  font-weight: 900;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.stat-strip div {
  min-height: 84px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.stat-strip span {
  display: block;
  font-size: 26px;
  font-weight: 850;
}

.stat-strip small {
  color: var(--muted);
}

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

.method-step {
  display: grid;
  grid-template-columns: 46px minmax(80px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  text-align: left;
}

.method-step span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 850;
}

.method-step:nth-child(2) span {
  background: var(--accent-2);
}

.method-step:nth-child(3) span {
  background: var(--accent-3);
}

.method-step:nth-child(4) span {
  background: var(--accent-4);
}

.method-step strong {
  white-space: nowrap;
}

.method-step small {
  color: var(--muted);
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.mini-word-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.mini-word-card button {
  width: fit-content;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--accent-2);
  font-weight: 800;
}

.word-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.word-title h3 {
  margin: 0;
  font-size: clamp(36px, 7vw, 68px);
  line-height: 0.95;
  letter-spacing: 0;
}

.word-title span,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.phonetic-row,
.tag-row,
.family-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #ffffff;
  font-size: 13px;
}

.meaning {
  margin: 16px 0;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 850;
}

.example-box {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 14px;
  border-left: 4px solid var(--accent-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #f4fbfa;
}

.example-box p {
  margin: 0;
}

.example-box .zh {
  color: var(--muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
}

.search-box {
  margin-bottom: 12px;
}

.word-list {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.word-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.word-row.active {
  border-color: rgba(201, 77, 99, 0.45);
  background: rgba(201, 77, 99, 0.07);
}

.word-row strong {
  display: block;
}

.word-row small {
  color: var(--muted);
}

.word-row button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.repeat-card {
  display: grid;
  gap: 14px;
  min-height: 250px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.repeat-card h3 {
  margin: 0;
  font-size: clamp(42px, 8vw, 74px);
  line-height: 0.95;
}

.repeat-card p {
  margin: 0;
}

.manual-transcript {
  margin-top: 16px;
}

.support-note {
  min-height: 42px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #ffffff;
}

.score-stack {
  display: grid;
  gap: 18px;
  margin: 18px 0;
}

.score-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.score-bar {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebef;
}

.score-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-2);
  transition: width 0.25s ease;
}

.tips-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.scenario-tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin-bottom: 18px;
  padding-bottom: 4px;
}

.scenario-tabs button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.scenario-tabs button.active {
  color: #ffffff;
  border-color: var(--accent-2);
  background: var(--accent-2);
}

.passage-area {
  display: grid;
  gap: 18px;
}

.passage-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.passage-text {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.85;
}

.reader-word {
  display: inline;
  padding: 2px 2px;
  border-radius: 4px;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(102, 113, 127, 0.28);
  text-underline-offset: 4px;
  cursor: pointer;
}

.reader-word:hover {
  background: rgba(22, 140, 132, 0.11);
}

.target-word {
  color: #8a263b;
  background: rgba(201, 77, 99, 0.13);
  font-weight: 850;
  text-decoration-color: rgba(201, 77, 99, 0.45);
}

.translation {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.translation summary {
  width: fit-content;
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--accent-2);
  font-weight: 850;
  cursor: pointer;
}

.translation p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.question-area {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.question-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.question-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.option-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
}

.option-list input {
  width: 18px;
  min-height: 18px;
}

.answer-feedback {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius);
  color: var(--ink);
  background: #f1f6f3;
  line-height: 1.7;
}

.answer-feedback.visible {
  display: block;
}

.dictation-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.dictation-card p {
  min-height: 36px;
  margin: 0;
  color: var(--muted);
}

.dictation-card input {
  font-size: 24px;
  font-weight: 800;
}

.dictation-result {
  min-height: 52px;
  padding: 12px;
  border: 1px dashed #c9d2da;
  border-radius: var(--radius);
  background: #ffffff;
  line-height: 1.65;
}

.add-favorite-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(200px, 1fr) auto;
  gap: 10px;
  margin-bottom: 16px;
}

.add-favorite-row button {
  padding-inline: 18px;
}

.favorites-table {
  display: grid;
  gap: 10px;
}

.favorite-row {
  display: grid;
  grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.favorite-row strong {
  display: block;
  font-size: 18px;
}

.favorite-row small {
  color: var(--muted);
}

.favorite-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.export-box {
  margin-top: 16px;
}

.file-input,
.paste-box {
  margin-bottom: 14px;
}

.schema-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

pre {
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: #37424f;
  white-space: pre-wrap;
}

.word-popover {
  position: fixed;
  z-index: 30;
  width: min(360px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.word-popover h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.word-popover p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.55;
}

.word-popover .popover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.word-popover button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.word-popover button.primary {
  color: #ffffff;
  border-color: var(--accent-2);
  background: var(--accent-2);
}

.word-popover input {
  margin-top: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  min-width: 200px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #ffffff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.empty-state {
  padding: 20px;
  border: 1px dashed #c9d2da;
  border-radius: var(--radius);
  color: var(--muted);
  background: #ffffff;
  text-align: center;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(7, minmax(118px, 1fr));
    min-height: 0;
    overflow: auto;
  }

  .nav-item {
    justify-content: center;
  }

  .dashboard-grid,
  .study-layout,
  .import-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    background: var(--bg);
  }

  .topbar,
  .panel-heading,
  .progress-row {
    align-items: stretch;
  }

  .panel-heading {
    flex-direction: column;
  }

  .topbar {
    min-height: 0;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    gap: 10px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    font-size: 12px;
  }

  .brand h1 {
    font-size: 20px;
  }

  .brand p {
    max-width: 260px;
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-metrics {
    display: grid;
    grid-template-columns: auto minmax(58px, 1fr) auto minmax(58px, 1fr);
    justify-content: stretch;
    gap: 8px;
    font-size: 12px;
  }

  .top-metrics #todayLabel {
    grid-column: 1 / -1;
  }

  .top-metrics strong {
    min-width: 0;
    padding: 8px 10px;
  }

  .workspace {
    display: block;
    padding: 14px 10px calc(92px + env(safe-area-inset-bottom));
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 24;
    display: grid;
    grid-template-columns: repeat(7, minmax(74px, 1fr));
    gap: 6px;
    min-height: 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    overflow-x: auto;
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -12px 30px rgba(31, 42, 55, 0.12);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 74px;
    min-height: 58px;
    padding: 6px 4px;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
  }

  .nav-item span {
    width: 24px;
    height: 20px;
    border-radius: 5px;
    font-size: 10px;
  }

  .panel {
    box-shadow: 0 10px 26px rgba(31, 42, 55, 0.07);
  }

  .progress-row {
    grid-template-columns: 1fr;
  }

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

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

  .inline-actions,
  .player-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-controls .wide-btn {
    grid-column: span 2;
    order: -1;
  }

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

  .method-step,
  .favorite-row,
  .add-favorite-row {
    grid-template-columns: 1fr;
  }

  .method-step span {
    width: 42px;
    height: 42px;
  }

  .word-title h3,
  .repeat-card h3 {
    font-size: 38px;
    overflow-wrap: anywhere;
  }

  .phonetic-row,
  .tag-row {
    gap: 6px;
  }

  .chip,
  .pill {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .word-list {
    max-height: 56vh;
  }

  .word-popover {
    right: 10px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    left: 10px !important;
    top: auto !important;
    width: auto;
    max-height: 58vh;
    overflow: auto;
  }

  .toast {
    right: 10px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 390px) {
  .brand p {
    display: none;
  }

  .top-metrics {
    grid-template-columns: auto minmax(52px, 1fr) auto minmax(52px, 1fr);
  }

  .daily-panel,
  .method-panel,
  .today-panel,
  .word-panel,
  .list-panel,
  .repeat-panel,
  .feedback-panel,
  .context-panel,
  .dictation-panel,
  .dictation-list-panel,
  .favorites-panel,
  .import-panel {
    padding: 14px;
  }

  .word-title h3,
  .repeat-card h3 {
    font-size: 32px;
  }
}
