:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1ff;
  --text: #111827;
  --text-2: #344054;
  --sub: #667085;
  --muted: #98a2b3;
  --line: #dfe5ed;
  --line-soft: #e9edf3;
  --right: #15803d;
  --right-soft: #f0fdf4;
  --wrong: #b42318;
  --wrong-soft: #fff1f0;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --radius: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: .55;
}

[hidden] {
  display: none !important;
}

#app {
  display: flex;
  width: 100%;
  max-width: 560px;
  min-height: 100dvh;
  margin: 0 auto;
  flex-direction: column;
  padding-top: var(--safe-top);
  background: #f7f8fa;
}

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

.header-copy {
  min-width: 0;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .02em;
}

.app-header h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.app-header p {
  margin: 5px 0 0;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.45;
}

.icon-btn {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

main {
  display: flex;
  flex: 1;
  padding: 0 18px 94px;
}

.page {
  display: none;
  width: 100%;
}

.page.active {
  display: block;
}

.card {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(15, 23, 42, .035);
}

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

.section-title {
  font-size: 14px;
  font-weight: 760;
}

.section-sub {
  margin-top: 4px;
  color: var(--sub);
  font-size: 11px;
}

.hint {
  margin-top: 9px;
  color: var(--sub);
  font-size: 12px;
  line-height: 1.6;
}

.hint.compact {
  margin-top: 8px;
  font-size: 11px;
}

.text-btn {
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 680;
}

.primary,
.secondary,
.danger-btn {
  min-height: 46px;
  border-radius: var(--radius);
  padding: 0 16px;
  font-size: 14px;
  font-weight: 720;
}

.primary {
  border: 0;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 7px 16px rgba(37, 99, 235, .18);
}

.primary:active {
  background: var(--primary-dark);
}

.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
}

.danger-btn {
  width: 100%;
  margin-top: 12px;
  border: 1px solid #f3c9c5;
  background: var(--wrong-soft);
  color: var(--wrong);
}

.danger-text {
  color: var(--wrong);
}

/* Review home */
.hero {
  padding: 22px;
  border: 1px solid #d9e2ef;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}

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

.hero-date {
  color: var(--primary);
  font-size: 12px;
  font-weight: 740;
}

.hero h2 {
  margin: 9px 0 0;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -.035em;
}

.hero p {
  margin: 8px 0 0;
  color: var(--sub);
  font-size: 12px;
}

.progress-ring {
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0 var(--progress, 0%), #e7edf5 var(--progress, 0%) 100%);
}

.progress-ring::before {
  content: attr(data-label);
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 760;
}

.bucket-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 22px;
}

.bucket {
  min-width: 0;
  padding: 10px 4px;
  border-radius: 7px;
  background: var(--surface-soft);
  text-align: center;
}

.bucket strong {
  display: block;
  font-size: 16px;
  line-height: 1;
}

.bucket span {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--sub);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-bar {
  display: flex;
  gap: 7px;
  margin: 14px 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.scope-bar::-webkit-scrollbar {
  display: none;
}

.scope-bar button {
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--sub);
  font-size: 12px;
  font-weight: 650;
}

.scope-bar button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.start-panel {
  position: sticky;
  bottom: 78px;
  z-index: 5;
  padding-top: 4px;
}

.start-panel .primary {
  width: 100%;
  height: 50px;
  font-size: 15px;
}

.empty-state {
  padding: 52px 22px;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.empty-icon svg {
  width: 27px;
  height: 27px;
}

.empty-state h2 {
  margin: 0;
  font-size: 20px;
}

.empty-state p {
  margin: 9px auto 20px;
  max-width: 320px;
  color: var(--sub);
  font-size: 13px;
  line-height: 1.65;
}

/* Quiz */
.quiz-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  margin-bottom: 11px;
}

.back-btn {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 680;
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

.quiz-progress {
  color: var(--sub);
  font-size: 12px;
  font-weight: 680;
}

.mode-pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 730;
}

.progress-line {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e9f1;
}

.progress-line i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .2s ease;
}

.word-card {
  margin-top: 17px;
  padding: 27px 18px 23px;
  border: 1px solid #dbe3ed;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  box-shadow: 0 7px 22px rgba(15, 23, 42, .045);
}

.word-card h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 39px;
  line-height: 1.1;
  letter-spacing: -.035em;
}

.phonetic {
  margin-top: 8px;
  color: var(--sub);
  font-size: 13px;
}

.speak-btn {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 15px auto 0;
  place-items: center;
  border: 1px solid #dbe3ed;
  border-radius: 50%;
  background: #f8fafc;
  color: var(--primary);
}

.speak-btn svg {
  width: 18px;
  height: 18px;
}

.quiz-prompt {
  margin: 19px 2px 10px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}

.options {
  display: grid;
  gap: 9px;
}

.option {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border: 1px solid #dde4ed;
  border-radius: var(--radius);
  background: var(--surface);
  color: #1d2939;
  font-size: 13px;
  font-weight: 620;
  line-height: 1.45;
  text-align: left;
}

.option .key {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: #f1f4f8;
  color: var(--sub);
  font-size: 11px;
  font-weight: 800;
}

.option.right {
  border-color: #a9d9b8;
  background: var(--right-soft);
  color: var(--right);
  box-shadow: inset 0 0 0 1px #a9d9b8;
}

.option.right .key {
  background: var(--right);
  color: #fff;
}

.option.wrong {
  border-color: #efb7b1;
  background: var(--wrong-soft);
  color: var(--wrong);
  box-shadow: inset 0 0 0 1px #efb7b1;
}

.option.wrong .key {
  background: var(--wrong);
  color: #fff;
}

.option.dim {
  opacity: .55;
}

.feedback-card {
  margin-top: 12px;
  padding: 13px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.feedback-card.correct {
  background: var(--right-soft);
}

.feedback-card.incorrect {
  background: var(--wrong-soft);
}

.feedback-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 760;
}

.feedback-card.correct .feedback-title {
  color: var(--right);
}

.feedback-card.incorrect .feedback-title {
  color: var(--wrong);
}

.feedback-title svg {
  width: 16px;
  height: 16px;
}

.feedback-meaning {
  margin-top: 7px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.detail-tag {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, .72);
  color: var(--text-2);
  font-size: 10px;
}

.mastery-note {
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid #f1d59b;
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: #92400e;
  font-size: 11px;
  line-height: 1.5;
}

.quiz-action {
  position: sticky;
  bottom: 78px;
  z-index: 5;
  padding-top: 12px;
  background: #f7f8fa;
}

.quiz-action .primary {
  width: 100%;
  height: 50px;
}

.summary {
  padding: 52px 22px;
  text-align: center;
}

.summary-score {
  display: grid;
  width: 112px;
  height: 112px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 27px;
  font-weight: 780;
}

.summary h2 {
  margin: 0;
  font-size: 23px;
}

.summary p {
  margin: 9px 0 22px;
  color: var(--sub);
  font-size: 13px;
}

/* Add words */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 9px;
  background: #e9edf3;
}

.seg button {
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--sub);
  font-size: 13px;
  font-weight: 680;
}

.seg button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}

#bulk,
#single-input,
.field input,
.field textarea,
.search-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  color: var(--text);
  font-size: 15px;
  outline: none;
}

#bulk {
  min-height: 148px;
  padding: 12px;
  resize: vertical;
  line-height: 1.6;
}

#single-input {
  height: 48px;
  padding: 0 12px;
}

#bulk:focus,
#single-input:focus,
.field input:focus,
.field textarea:focus,
.search-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .09);
}

#page-add > .primary {
  width: 100%;
}

.add-result {
  min-height: 20px;
  margin: 8px 2px 12px;
  color: var(--primary);
  font-size: 12px;
  line-height: 1.5;
}

.add-result .warn {
  color: var(--warning);
}

.word-bank-card {
  padding-bottom: 8px;
}

.search-field {
  display: flex;
  height: 40px;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  color: var(--muted);
}

.search-field svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.search-field input {
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  box-shadow: none !important;
}

.wordlist {
  margin-top: 4px;
}

.word-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.word-item:last-child {
  border-bottom: 0;
}

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

.word-heading {
  display: flex;
  align-items: center;
  gap: 7px;
}

.word-heading strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 9px;
  font-weight: 740;
}

.badge.mastered {
  background: #e8f7ed;
  color: var(--right);
}

.badge.learning {
  background: #fff4df;
  color: var(--warning);
}

.word-meaning {
  margin-top: 5px;
  overflow: hidden;
  color: var(--sub);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.mini-icon-btn {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sub);
}

.mini-icon-btn svg {
  width: 15px;
  height: 15px;
}

.mini-icon-btn.delete {
  color: var(--wrong);
}

.load-more {
  display: block;
  margin: 10px auto 2px;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 680;
}

.empty-list {
  padding: 28px 10px 22px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Statistics */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}

.stat-cell {
  min-width: 0;
  padding: 14px 4px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.stat-cell .num {
  color: var(--primary);
  font-size: 20px;
  font-weight: 780;
}

.stat-cell .lab {
  margin-top: 5px;
  color: var(--sub);
  font-size: 9px;
  white-space: nowrap;
}

.week-total {
  color: var(--primary);
  font-size: 12px;
  font-weight: 740;
}

.weekly-chart {
  display: grid;
  height: 132px;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  margin-top: 18px;
}

.day-column {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.day-bar-wrap {
  display: flex;
  width: 100%;
  flex: 1;
  align-items: flex-end;
}

.day-bar {
  width: 100%;
  min-height: 3px;
  border-radius: 5px 5px 2px 2px;
  background: #dbe6ff;
}

.day-bar.has-value {
  background: var(--primary);
}

.day-count {
  color: var(--muted);
  font-size: 9px;
}

.day-label {
  color: var(--sub);
  font-size: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--sub);
  font-size: 11px;
}

.bar-row strong {
  color: var(--text-2);
  font-size: 11px;
  text-align: right;
}

.bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ecf3;
}

.bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--right);
  transition: width .25s ease;
}

.bar-fill.learning {
  background: #d97706;
}

.bar-fill.new {
  background: var(--primary);
}

.difficult-list {
  margin-top: 8px;
}

.difficult-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

.difficult-item:last-child {
  border-bottom: 0;
}

.difficult-item strong {
  font-size: 14px;
}

.difficult-item span {
  color: var(--sub);
  font-size: 10px;
  text-align: right;
}

/* Settings */
.setting-row {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
}

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

.setting-row.setting-stack {
  align-items: stretch;
  flex-direction: column;
  padding: 13px 0;
}

.setting-label {
  font-size: 13px;
  font-weight: 690;
}

.setting-note {
  margin-top: 4px;
  color: var(--sub);
  font-size: 10px;
}

.stepper {
  display: flex;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.stepper button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 18px;
}

.stepper strong {
  min-width: 54px;
  font-size: 12px;
  text-align: center;
}

.choice-group {
  display: grid;
  gap: 7px;
}

.choice-group button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 650;
  text-align: left;
  padding: 0 11px;
}

.choice-group button.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.switch {
  position: relative;
  width: 46px;
  height: 27px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: #d5dbe4;
  transition: background .2s ease;
}

.switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .22);
  transition: transform .2s ease;
}

.switch.active {
  background: var(--primary);
}

.switch.active span {
  transform: translateX(19px);
}

.status-pill {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f1f4f8;
  color: var(--sub);
  font-size: 9px;
  font-weight: 720;
}

.status-pill.connected {
  background: #e8f7ed;
  color: var(--right);
}

.cloud-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}

.cloud-actions .primary,
.cloud-actions .secondary {
  width: 100%;
}

.cloud-recovery-link {
  display: block;
  margin: 12px auto 0;
}

.cloud-mode-tabs {
  margin-bottom: 16px;
}

.cloud-submit {
  width: 100%;
  margin-top: 5px;
}

.form-error {
  margin: 0 0 12px;
  padding: 10px 11px;
  border: 1px solid #f3c9c5;
  border-radius: var(--radius);
  background: var(--wrong-soft);
  color: var(--wrong);
  font-size: 11px;
  line-height: 1.5;
}

.recovery-panel {
  display: grid;
  gap: 10px;
}

.recovery-panel code {
  display: block;
  overflow-wrap: anywhere;
  padding: 14px;
  border: 1px solid #bfd0ee;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.5;
  text-align: center;
}

.backup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 13px;
}

.backup-row button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 680;
}

.storage-line {
  margin-top: 11px;
  color: var(--muted);
  font-size: 10px;
}

.danger-zone {
  border-color: #f2d5d2;
}

/* Bottom navigation */
.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  width: 100%;
  max-width: 560px;
  height: calc(70px + var(--safe-bottom));
  grid-template-columns: repeat(4, 1fr);
  margin: 0 auto;
  padding: 7px 10px calc(9px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
}

.tabbar button {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.tabbar button.active {
  color: var(--primary);
}

.tabbar svg {
  width: 19px;
  height: 19px;
}

/* Edit sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, .42);
}

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 91dvh;
  overflow-y: auto;
  padding: 9px 18px calc(20px + var(--safe-bottom));
  border-radius: 18px 18px 0 0;
  background: var(--surface);
  box-shadow: 0 -16px 40px rgba(15, 23, 42, .18);
  animation: sheet-in .2s ease-out;
}

@keyframes sheet-in {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-grabber {
  width: 38px;
  height: 4px;
  margin: 0 auto 13px;
  border-radius: 999px;
  background: #d0d5dd;
}

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

.sheet-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -.02em;
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field > span {
  display: block;
  margin: 0 0 6px 2px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 690;
}

.field input,
.field textarea {
  min-height: 44px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

.sheet-actions {
  display: grid;
  grid-template-columns: auto auto minmax(110px, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.sheet-actions .secondary {
  padding: 0 12px;
  font-size: 12px;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + var(--safe-bottom));
  z-index: 100;
  max-width: 82vw;
  padding: 10px 17px;
  border-radius: 999px;
  background: rgba(17, 24, 39, .93);
  color: #fff;
  font-size: 12px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .2s ease, transform .2s ease;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 620px) {
  body {
    padding: 22px 0;
  }

  #app {
    min-height: calc(100dvh - 44px);
    overflow: hidden;
    border: 1px solid #d8e0ea;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .12);
  }

  .tabbar {
    bottom: 22px;
    border-radius: 0 0 22px 22px;
  }

  .start-panel,
  .quiz-action {
    bottom: 78px;
  }
}

@media (max-width: 370px) {
  .app-header,
  main {
    padding-right: 14px;
    padding-left: 14px;
  }

  .word-card h2 {
    font-size: 34px;
  }

  .bucket span,
  .stat-cell .lab {
    font-size: 8px;
  }
}
