.section-stack {
  display: grid;
  gap: 16px;
}

.hero-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 139, 126, 0.98), rgba(84, 87, 255, 0.82) 58%, rgba(11, 18, 32, 0.96)),
    var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  margin: 0;
  font-size: 1.52rem;
  letter-spacing: 0;
}

.hero-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.48;
}

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

.hero-metric {
  padding: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
}

.hero-metric strong {
  display: block;
  font-size: 1.1rem;
}

.hero-metric span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.76rem;
}

.hero-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  margin-bottom: 10px;
  color: #dffcf7;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.hero-cta {
  width: 100%;
  color: var(--ink) !important;
  background: #fff !important;
}

.focus-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-color: rgba(255, 122, 26, 0.28);
  background: linear-gradient(135deg, #fff, #fff8f2);
}

.focus-panel h2 {
  margin: 6px 0 4px;
  font-size: 1.12rem;
}

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

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 0;
}

.section-title h2 {
  margin: 0;
  font-size: 1.08rem;
}

.section-title a {
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 800;
}

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

.mobile-home .module-grid {
  display: flex;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding: 0 2px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.mobile-home .module-grid::-webkit-scrollbar {
  display: none;
}

.mobile-home .module-card {
  min-width: min(300px, 88%);
  scroll-snap-align: start;
}

.directory-layout {
  display: grid;
  gap: 14px;
}

.detail-layout {
  display: grid;
  gap: 14px;
}

.detail-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  touch-action: pan-y;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-header h2 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.25;
}

.jp-title {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0;
}

.reading {
  color: var(--primary-strong);
  font-size: 0.95rem;
  font-weight: 700;
}

.definition-block {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.definition-block h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.definition-block p,
.definition-block li {
  font-size: 1.03rem;
  line-height: 1.72;
}

.example-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.example-list li {
  padding: 12px;
  background: linear-gradient(135deg, var(--surface-strong), #f5f7ff);
  border-radius: var(--radius);
}

.example-list strong {
  display: block;
  margin-bottom: 4px;
}

ruby {
  ruby-position: over;
}

rt {
  color: var(--muted);
  font-size: 0.58em;
  font-weight: 700;
  line-height: 1;
}

.jp-line {
  font-size: 1.14rem;
  line-height: 2.08;
  letter-spacing: 0;
}

.source-panel p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

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

.form-example {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(135deg, var(--surface-strong), #f8fbff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form-example.compact {
  background: var(--surface-strong);
}

.form-example-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.form-example code {
  white-space: normal;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
}

.form-example strong {
  display: block;
  font-size: 1.1rem;
}

.form-example span:last-child {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.62;
}

.memory-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.memory-panel.inline {
  margin-top: 16px;
  box-shadow: none;
}

.memory-panel h3 {
  margin: 8px 0 4px;
  font-size: 1.05rem;
}

.memory-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.review-shell {
  max-width: 760px;
  margin: 0 auto;
}

.review-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  touch-action: pan-y;
}

.review-card > h2 {
  margin: 8px 0;
  font-size: 1.35rem;
}

.review-card > p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.55;
}

.review-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.review-top h2 {
  margin: 4px 0 0;
  font-size: 1.48rem;
  line-height: 1.28;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

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

.option-button {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.option-button.selected {
  color: var(--primary-strong);
  background: var(--surface-strong);
  border-color: var(--primary);
}

.option-button.correct {
  color: #166534;
  background: #dcfce7;
  border-color: #16a34a;
}

.option-button.wrong {
  color: #991b1b;
  background: #fee2e2;
  border-color: #dc2626;
}

.audio-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-soft), #eef2ff);
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
}

.audio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.exam-shell {
  display: grid;
  gap: 14px;
}

.exam-top {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.question-number {
  color: var(--primary);
  font-weight: 900;
}

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

.answer-dot {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 800;
}

.answer-dot.done {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state img {
  width: 160px;
}

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

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.setting-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
