:root {
  color-scheme: dark;
  --bg: #080d0c;
  --surface: #101715;
  --surface-2: #151f1c;
  --surface-3: #18231f;
  --ink: #edf6f2;
  --muted: #9aaba5;
  --line: rgba(219, 245, 236, 0.12);
  --accent: #64d8c2;
  --accent-deep: #89e6d4;
  --accent-ink: #07100e;
  --soft-accent: rgba(100, 216, 194, 0.12);
  --warn: #f2b45f;
  --danger: #ff7b75;
  --blue-soft: #162538;
  --green-soft: #13291f;
  --red-soft: #321b1a;
  --amber-soft: #332717;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(107, 224, 199, 0.12), transparent 360px),
    radial-gradient(circle at bottom right, rgba(89, 126, 115, 0.08), transparent 420px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 320px),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

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

.app-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px 16px 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 12px;
}

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

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 8vw, 54px);
  line-height: 1.05;
  letter-spacing: 0;
  text-wrap: balance;
}

h2 {
  margin-bottom: 16px;
  font-size: 20px;
  line-height: 1.25;
}

.header-copy {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.25;
}

.days-card {
  flex: 0 0 auto;
  width: 82px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f4faf7);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.days-card span {
  display: block;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.days-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.focus-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin: 8px 0 12px;
  padding: 22px;
  border: 1px solid rgba(11, 111, 95, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(11, 111, 95, 0.11), rgba(255, 255, 255, 0.72)),
    var(--surface);
  box-shadow: var(--shadow);
}

.focus-strip h2 {
  margin: 6px 0 8px;
  font-size: clamp(24px, 5vw, 36px);
}

.focus-strip p {
  max-width: 58ch;
  margin: 0;
  color: #43524d;
  line-height: 1.6;
}

.micro-label {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 850;
}

.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0 12px;
  background: rgba(247, 248, 248, 0.92);
  backdrop-filter: blur(10px);
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 12px;
  min-width: 58px;
  white-space: nowrap;
  scroll-snap-align: start;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.tab.is-active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.panel {
  display: none;
  padding-top: 8px;
  min-height: calc(100dvh + 160px);
}

.panel.is-active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.metric,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric {
  padding: 14px;
  min-height: 112px;
  box-shadow: 0 10px 28px rgba(15, 44, 38, 0.05);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin: 12px 0 6px;
  font-size: clamp(22px, 7vw, 34px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric small {
  color: var(--muted);
  font-size: 12px;
}

.warning-metric {
  border-color: #efd99e;
  background: linear-gradient(180deg, #fffaf0, #fffdf8);
}

.warning-metric .metric-label,
.warning-metric strong {
  color: #8a4b0f;
}

.card {
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 12px 34px rgba(15, 44, 38, 0.055);
}

.form-card {
  display: grid;
  gap: 15px;
}

.daily-course {
  margin-bottom: 14px;
  border: 1px solid rgba(107, 224, 199, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(107, 224, 199, 0.055), rgba(255, 255, 255, 0.018)),
    var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.daily-course-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.daily-course h2 {
  margin: 6px 0 8px;
  font-size: clamp(24px, 5.5vw, 38px);
  letter-spacing: 0;
}

.daily-course p {
  margin: 0;
  color: #43524d;
  line-height: 1.6;
}

.course-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.course-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: unset;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.026);
  padding: 12px;
}

.course-block span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(107, 224, 199, 0.12);
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.course-block strong {
  display: block;
  margin-bottom: 2px;
  font-size: 17px;
}

.course-block .inline-action {
  align-self: center;
  justify-self: end;
  width: max-content;
  margin-top: 0;
  white-space: nowrap;
}

.lesson-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.lesson-unit {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  padding: 16px;
}

.lesson-highlight {
  border-color: rgba(29, 78, 137, 0.22);
  background: #f6fbff;
}

.lesson-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.lesson-head > span {
  flex: 0 0 auto;
  min-width: 58px;
  border: 1px solid rgba(11, 111, 95, 0.24);
  border-radius: 8px;
  background: var(--soft-accent);
  color: var(--accent-deep);
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.lesson-head h3 {
  margin: 0 0 4px;
  font-size: 22px;
}

.lesson-head p {
  margin: 0;
  max-width: 68ch;
}

.mini-vocab-list,
.grammar-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-vocab,
.grammar-chip {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

.mini-vocab > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.mini-vocab strong,
.grammar-chip strong {
  color: #17221f;
  font-size: 22px;
}

.mini-vocab small {
  color: var(--muted);
  font-weight: 750;
}

.progress-details {
  margin-top: 14px;
}

.progress-details > summary {
  border-style: dashed;
}

.form-title h2 {
  margin-bottom: 6px;
}

.form-title p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.task-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.task-step {
  min-height: 126px;
  display: grid;
  gap: 8px;
  align-content: start;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(15, 44, 38, 0.05);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.task-step span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.task-step strong {
  font-size: 18px;
}

.task-step small {
  color: var(--muted);
  line-height: 1.45;
}

.task-step.is-done {
  border-color: rgba(11, 111, 95, 0.35);
  background: var(--soft-accent);
}

.task-step.is-done span {
  background: var(--accent-deep);
  color: #fff;
}

.task-step.is-current {
  border-color: rgba(11, 111, 95, 0.58);
  box-shadow: 0 0 0 3px rgba(11, 111, 95, 0.1);
}

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

.score-grid {
  grid-template-columns: repeat(3, 1fr);
}

.compact-score {
  grid-template-columns: repeat(4, 1fr);
}

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

label {
  color: #33414c;
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  padding: 12px 12px;
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  transition:
    border-color 180ms ease,
    background 180ms ease;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.primary {
  border: 0;
  border-radius: 8px;
  background: var(--accent-deep);
  color: var(--accent-ink);
  padding: 13px 16px;
  font-weight: 800;
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.primary:hover {
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(9, 77, 68, 0.18);
}

.secondary-action {
  border: 1px solid rgba(9, 77, 68, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-deep);
  padding: 10px 12px;
  font-weight: 800;
  white-space: nowrap;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.secondary-action:hover,
.task-step:hover,
.tab:hover {
  border-color: rgba(11, 111, 95, 0.42);
  background: #f8fcfb;
}

.primary:active,
.tab:active,
.secondary-action:active,
.task-step:active {
  transform: translateY(1px);
}

.plain-list {
  margin: 0;
  padding-left: 22px;
  color: #344450;
  line-height: 1.65;
}

.stack {
  display: grid;
  gap: 10px;
}

.entry {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15, 44, 38, 0.04);
}

.entry-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.entry p {
  margin: 6px 0 0;
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge.green {
  background: var(--green-soft);
  color: #166534;
}

.badge.blue {
  background: var(--blue-soft);
  color: #1d4e89;
}

.badge.red {
  background: var(--red-soft);
  color: var(--danger);
}

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

.resource-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.resource-item strong {
  display: block;
  margin-bottom: 4px;
  line-height: 1.35;
}

.resource-item small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.study-intro h2 {
  margin: 6px 0 8px;
  font-size: clamp(26px, 6vw, 38px);
}

.study-intro p {
  margin-bottom: 16px;
  color: #43524d;
  line-height: 1.6;
}

.study-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.study-filter {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-deep);
  padding: 9px 13px;
  font-weight: 800;
  white-space: nowrap;
}

.study-filter.is-active {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff;
}

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

.study-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(15, 44, 38, 0.05);
}

.study-card.type-listening {
  border-left: 4px solid #1d4e89;
}

.study-card.type-grammar {
  border-left: 4px solid var(--accent-deep);
}

.study-card.type-reading {
  border-left: 4px solid #8a4b0f;
}

.study-card.type-vocab {
  border-left: 4px solid #0b6f5f;
}

.study-card h3 {
  margin-bottom: 12px;
  font-size: 22px;
}

.jp-text {
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: #1d2a31;
}

.choice-list {
  margin: 8px 0 0;
  padding-left: 24px;
  color: #344450;
  line-height: 1.7;
}

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

.answer-box {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.answer-box summary {
  cursor: pointer;
  color: var(--accent-deep);
  font-weight: 850;
}

.answer-box p {
  margin: 10px 0 0;
  color: #344450;
  line-height: 1.6;
}

.vocab-deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.vocab-stage {
  display: grid;
  gap: 12px;
}

.vocab-progress {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.vocab-progress strong {
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

.deck-controls {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.deck-controls .inline-action {
  flex: 1;
  margin-top: 0;
}

.memory-method-card {
  grid-column: 1 / -1;
  border: 1px solid rgba(11, 111, 95, 0.18);
  border-radius: 12px;
  background: #fbfdfc;
  padding: 18px;
}

.memory-method-card h2 {
  margin: 6px 0 14px;
  font-size: clamp(26px, 6vw, 38px);
}

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

.method-grid div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.method-grid strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-deep);
}

.method-grid small {
  color: #43524d;
  line-height: 1.5;
}

.vocab-summary {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(11, 111, 95, 0.24);
  border-radius: 10px;
  background: var(--soft-accent);
  padding: 14px 16px;
  color: var(--accent-deep);
}

.vocab-summary small {
  color: #43524d;
}

.vocab-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-deep);
  border-radius: 10px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(15, 44, 38, 0.05);
}

.vocab-word {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  font-size: clamp(30px, 8vw, 44px);
}

.vocab-word small {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.recall-panel {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  border: 1px solid rgba(11, 111, 95, 0.18);
  border-radius: 10px;
  background: #f8fcfb;
  padding: 12px;
}

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

.recall-actions.compact {
  margin-top: 10px;
}

.recall-action {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #1d2a31;
  padding: 10px 8px;
  text-align: center;
  touch-action: manipulation;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.recall-action strong {
  display: block;
  font-size: 17px;
  line-height: 1.15;
}

.recall-action small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.recall-action:active {
  transform: scale(0.98);
}

.recall-action.again {
  border-color: rgba(180, 35, 24, 0.24);
  background: #fff8f7;
  color: var(--danger);
}

.recall-action.hard {
  border-color: rgba(138, 75, 15, 0.26);
  background: #fffaf0;
  color: #8a4b0f;
}

.recall-action.good {
  border-color: rgba(11, 111, 95, 0.24);
  background: #f8fcfb;
  color: var(--accent-deep);
}

.recall-action.easy {
  border-color: rgba(22, 101, 52, 0.22);
  background: #f4fbf6;
  color: #166534;
}

.due-label {
  color: var(--muted);
  font-weight: 750;
}

.danger-action {
  border-color: rgba(180, 35, 24, 0.24);
  color: var(--danger);
}

.listen-drill {
  margin-bottom: 14px;
  border: 1px solid rgba(29, 78, 137, 0.2);
  border-left: 4px solid #1d4e89;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(29, 78, 137, 0.08), rgba(255, 255, 255, 0.88)),
    var(--surface);
  padding: 20px;
  box-shadow: 0 14px 38px rgba(15, 44, 38, 0.06);
}

.drill-kicker {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.listen-drill h2 {
  margin-bottom: 8px;
  font-size: clamp(26px, 7vw, 42px);
}

.drill-guide {
  margin-bottom: 14px;
  color: #43524d;
  line-height: 1.6;
}

.jp-listen-box,
.question-box {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.jp-listen-box .primary {
  margin-top: 12px;
  width: 100%;
}

.question-box strong {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
}

.record-details {
  margin-bottom: 14px;
}

.record-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px 16px;
  color: var(--accent-deep);
  font-weight: 850;
  box-shadow: 0 8px 24px rgba(15, 44, 38, 0.04);
}

.record-details > summary::after {
  content: "展開";
  color: var(--muted);
  font-size: 12px;
}

.record-details[open] > summary {
  margin-bottom: 10px;
  border-color: rgba(11, 111, 95, 0.34);
  background: var(--soft-accent);
}

.record-details[open] > summary::after {
  content: "收合";
}

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

.muted-copy {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.phrase-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.phrase-box p {
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.65;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

.voice-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(15, 44, 38, 0.05);
  padding: 16px;
}

.voice-card p {
  min-height: 66px;
  margin-bottom: 14px;
  color: #344450;
  line-height: 1.55;
}

.voice-card audio {
  width: 100%;
  display: block;
}

.recommendation-card {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid rgba(11, 111, 95, 0.24);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(11, 111, 95, 0.12), rgba(255, 255, 255, 0.75)),
    var(--surface);
}

.recommendation-card strong {
  display: block;
  margin: 6px 0;
  font-size: 22px;
}

.recommendation-card p {
  margin: 0;
  color: #43524d;
  line-height: 1.55;
}

.audio-placeholder {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.method-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.method-strip div {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "num title"
    "num body";
  column-gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.method-strip span {
  grid-area: num;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-deep);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.method-strip strong {
  grid-area: title;
}

.method-strip small {
  grid-area: body;
  color: var(--muted);
}

.empty-state {
  padding: 18px;
  border: 1px dashed #c8d5d0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.inline-action {
  margin-top: 12px;
  border: 1px solid rgba(9, 77, 68, 0.24);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-deep);
  padding: 9px 12px;
  font-weight: 800;
}

.save-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 50;
  min-width: 180px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border: 1px solid rgba(9, 77, 68, 0.16);
  border-radius: 999px;
  background: rgba(9, 77, 68, 0.94);
  color: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  box-shadow: 0 16px 34px rgba(9, 77, 68, 0.22);
}

.save-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  background: var(--accent-deep);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
}

.skip-link:focus {
  position: fixed;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
}

.days-card,
.focus-strip,
.metric,
.card,
.daily-course,
.course-block,
.lesson-unit,
.mini-vocab,
.grammar-chip,
.task-step,
.study-card,
.vocab-card,
.listen-drill,
.jp-listen-box,
.question-box,
.record-details > summary,
.phrase-box,
.voice-card,
.recommendation-card,
.method-strip div,
.empty-state,
.field input,
.field textarea,
.field select {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.tabs {
  background: rgba(11, 16, 15, 0.9);
}

.tab,
.inline-action,
.secondary-action {
  background: var(--surface-3);
  border-color: var(--line);
  color: var(--ink);
}

.tab.is-active,
.primary,
.lesson-head > span,
.task-step.is-done span,
.method-strip span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.focus-strip p,
.daily-course p,
.method-grid small,
.vocab-summary small,
.drill-guide,
.choice-list,
.answer-box p,
.voice-card p,
.recommendation-card p,
.jp-text {
  color: var(--muted);
}

.micro-label,
.eyebrow,
.answer-box summary,
.record-details > summary,
.mini-vocab strong,
.grammar-chip strong,
.vocab-summary,
.inline-action {
  color: var(--accent-deep);
}

.warning-metric,
.lesson-highlight,
.recall-panel,
.question-box,
.jp-listen-box,
.phrase-box {
  background: var(--surface-2);
}

.warning-metric .metric-label,
.warning-metric strong {
  color: var(--warn);
}

.daily-course,
.focus-strip,
.recommendation-card,
.listen-drill {
  background:
    linear-gradient(135deg, rgba(107, 224, 199, 0.08), rgba(255, 255, 255, 0.025)),
    var(--surface);
}

.vocab-summary {
  grid-column: 1 / -1;
  background: var(--soft-accent);
  border-color: rgba(107, 224, 199, 0.28);
}

.compact-summary {
  padding: 10px 12px;
}

.flip-card {
  padding: 0;
  perspective: 1200px;
  background: transparent;
  border: 0;
  box-shadow: none;
  scroll-margin-top: 88px;
}

.flip-card-inner {
  display: grid;
  min-height: 430px;
  transform-style: preserve-3d;
  transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.vocab-card-single .flip-card-inner {
  min-height: min(560px, calc(100dvh - 180px));
}

.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card.is-flipped .flip-front {
  pointer-events: none;
}

.flip-card:not(.is-flipped) .flip-back {
  pointer-events: none;
}

.flip-face {
  grid-area: 1 / 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 12px;
  backface-visibility: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid rgba(107, 224, 199, 0.72);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.flip-back {
  transform: rotateY(180deg);
  border-left-color: rgba(242, 180, 95, 0.8);
  background:
    linear-gradient(135deg, rgba(242, 180, 95, 0.08), transparent),
    var(--surface);
}

.card-actions {
  margin-top: auto;
}

.flip-answer {
  flex: 0 0 auto;
  min-height: 48px;
}

.answer-word {
  margin: 8px 0 0;
  font-size: clamp(30px, 8vw, 46px);
  line-height: 1.16;
}

.memory-hook {
  min-height: 72px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.flip-back-button {
  width: max-content;
}

.recall-panel {
  border-color: rgba(107, 224, 199, 0.2);
}

.flip-back .recall-panel {
  margin-top: auto;
}

.recall-action {
  background: var(--surface-3);
  border-color: var(--line);
  color: var(--ink);
}

.recall-action.again {
  background: #281918;
  border-color: rgba(255, 123, 117, 0.34);
  color: #ffaaa6;
}

.recall-action.hard {
  background: #2b2116;
  border-color: rgba(242, 180, 95, 0.34);
  color: #f4c47f;
}

.recall-action.good {
  background: #122820;
  border-color: rgba(107, 224, 199, 0.34);
  color: var(--accent-deep);
}

.recall-action.easy {
  background: #162719;
  border-color: rgba(128, 214, 152, 0.34);
  color: #9be7af;
}

.primary:hover,
.secondary-action:hover,
.inline-action:hover,
.tab:hover,
.recall-action:hover {
  transform: translateY(-1px);
}

.primary:active,
.secondary-action:active,
.inline-action:active,
.tab:active,
.recall-action:active {
  transform: scale(0.98);
}

.field input,
.field textarea,
.field select {
  color: var(--ink);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #65756f;
}

@media (max-width: 720px) {
  .app-shell {
    padding-inline: 12px;
  }

  .topbar {
    align-items: flex-start;
  }

  .header-copy {
    font-size: 14px;
  }

  .days-card {
    width: 70px;
    min-height: 70px;
  }

  .metric-grid,
  .grid-2,
  .score-grid,
  .compact-score,
  .voice-grid,
  .study-deck,
  .method-grid,
  .mini-vocab-list,
  .grammar-strip,
  .task-flow,
  .method-strip,
  .focus-strip {
    grid-template-columns: 1fr;
  }

  .daily-course-head,
  .lesson-head,
  .vocab-summary {
    display: grid;
  }

  .metric {
    min-height: auto;
  }

  #today .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #today .metric:first-child {
    grid-column: 1 / -1;
  }

  #today .metric:not(:first-child) strong {
    font-size: 24px;
  }

  #today .metric:not(:first-child) {
    padding: 12px;
  }

  .tabs {
    margin-inline: -12px;
    padding-inline: 12px;
  }

  .card {
    padding: 16px;
  }

  .focus-strip {
    padding: 18px;
  }

  .quick-actions {
    justify-content: stretch;
  }

  .secondary-action {
    flex: 1 1 auto;
  }

  .course-block {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .course-block .inline-action {
    grid-column: 2;
    justify-self: start;
  }

  .card-actions {
    flex-direction: column;
  }

  .card-actions .inline-action,
  .card-actions .primary {
    width: 100%;
  }

  .flip-answer {
    flex: none;
    min-height: 54px;
  }

  .section-head {
    display: grid;
  }

  .voice-card p {
    min-height: auto;
  }

  .vocab-word {
    font-size: clamp(42px, 14vw, 62px);
  }

  .answer-word {
    font-size: clamp(28px, 8vw, 36px);
  }

  .memory-hook {
    min-height: auto;
    font-size: 16px;
  }

  .recall-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .recall-action {
    min-height: 48px;
    padding: 8px 4px;
    border-radius: 8px;
  }

  .recall-action strong {
    font-size: 16px;
  }

  .recall-action small {
    display: none;
  }

  .flip-face {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
