:root {
  color-scheme: light;
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  background: #fafafa;
  color: #181818;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
}

.setting-row.native-setting-row {
  display: none;
}

html[data-native-platform] .native-setting-row {
  display: flex;
}

body.app-loading {
  overflow: hidden;
}

body.app-loading > :not(.loading-screen) {
  visibility: hidden;
}

html[data-splash-shown="true"] body.app-loading {
  overflow: auto;
}

html[data-splash-shown="true"] body.app-loading > :not(.loading-screen) {
  visibility: visible;
}

html[data-splash-shown="true"] .loading-screen {
  display: none;
}

.loading-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: #fafafa;
  opacity: 1;
  transition: opacity 220ms ease;
}

.loading-screen.is-hiding {
  pointer-events: none;
  opacity: 0;
}

.loading-logo {
  display: block;
  width: clamp(16rem, 68vw, 32rem);
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  .loading-screen {
    transition: none;
  }
}

.profile-menu-container {
  position: fixed;
  top: calc(1.5rem + env(safe-area-inset-top));
  right: calc(1.5rem + env(safe-area-inset-right));
  z-index: 20;
}

.profile-menu-button {
  display: flex;
  min-width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.85rem;
  border: 1px solid #d7d7d7;
  border-radius: 1.5rem;
  background: #fff;
  color: #4a4a4a;
  cursor: pointer;
}

.profile-menu-button svg {
  width: 1.15rem;
  height: 1.15rem;
}

.profile-menu-button span {
  font-size: 0.84rem;
  font-weight: 600;
}

.profile-menu-button:hover,
.profile-menu-button[aria-expanded="true"] {
  border-color: #a9a9a9;
  background: #f1f1f1;
  color: #181818;
}

.profile-menu-button:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 3px;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  display: grid;
  width: 11rem;
  padding: 0.35rem;
  border: 1px solid #dedede;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
}

.profile-menu[hidden] {
  display: none;
}

.profile-menu-item {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #252525;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  line-height: normal;
  text-decoration: none;
  text-align: left;
}

.profile-menu-item:hover,
.profile-menu-item:focus-visible {
  background: #f1f1f1;
  outline: 0;
}

.profile-menu-heading {
  display: block;
  padding: 0.45rem 0.75rem 0.25rem;
  color: #777;
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-menu-study-item {
  position: relative;
  padding-right: 2rem;
}

.profile-menu-study-item[aria-current="page"] {
  background: #f1f1f1;
  color: #181818;
  font-weight: 600;
}

.profile-menu-study-item[aria-current="page"]::after {
  content: "✓";
  position: absolute;
  right: 0.75rem;
}

.profile-menu-separator {
  display: block;
  height: 1px;
  margin: 0.35rem 0.5rem;
  background: #e5e5e5;
}

.app-dialog {
  width: min(30rem, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: auto;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 48px rgb(0 0 0 / 18%);
  color: #181818;
}

.app-dialog::backdrop {
  background: rgb(0 0 0 / 24%);
}

.dialog-header {
  display: flex;
  min-height: 3.75rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem 0.75rem 1.25rem;
  border-bottom: 1px solid #e5e5e5;
}

.dialog-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.dialog-close-button {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #4a4a4a;
  cursor: pointer;
}

.dialog-close-button svg {
  width: 1.15rem;
  height: 1.15rem;
}

.dialog-close-button:hover {
  background: #f1f1f1;
  color: #181818;
}

.dialog-close-button:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 2px;
}

.settings-list {
  padding: 0 1.25rem;
}

.setting-row {
  display: flex;
  min-height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid #ededed;
  font-size: 0.92rem;
}

.setting-row:first-child {
  border-top: 0;
}

.setting-label {
  display: block;
  min-width: 0;
}

.setting-label small {
  display: block;
  margin-top: 0.18rem;
  color: #777;
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.35;
}

.setting-text-input {
  width: min(14rem, 52%);
  min-width: 0;
  min-height: 2.25rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;
  color: #181818;
  font: inherit;
  font-size: 0.82rem;
}

.setting-time-input {
  min-height: 2.25rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;
  color: #181818;
  font: inherit;
}

.setting-time-input:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 2px;
}

.setting-time-input:disabled {
  opacity: 0.5;
}

.setting-text-input:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 2px;
}

.setting-row.is-disabled .setting-label,
.setting-row.is-disabled > label,
.setting-control input:disabled ~ .setting-state {
  opacity: 0.55;
}

.setting-row select {
  min-width: 7rem;
  min-height: 2.25rem;
  padding: 0.35rem 1.75rem 0.35rem 0.6rem;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;
  color: #181818;
  font: inherit;
}

.setting-row select:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 2px;
}

.setting-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.45rem;
}

.setting-action-button {
  min-height: 2.25rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid #c5c5c5;
  border-radius: 4px;
  background: #fff;
  color: #252525;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
}

.setting-action-button:hover {
  border-color: #8d8d8d;
  background: #f4f4f4;
}

.setting-action-button:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 2px;
}

.setting-action-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.setting-action-danger {
  border-color: #c7a19a;
  color: #7a3026;
}

.settings-status {
  min-height: 2.5rem;
  margin: 0;
  padding: 0.65rem 0 0.85rem;
  border-top: 1px solid #ededed;
  color: #5d5d5d;
  font-size: 0.72rem;
  line-height: 1.4;
}

.settings-status:empty {
  min-height: 0;
  padding: 0;
  border-top: 0;
}

.settings-status.is-error {
  color: #87392f;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.setting-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.setting-switch {
  position: relative;
  width: 2.4rem;
  height: 1.35rem;
  flex: 0 0 auto;
  border: 1px solid #a9a9a9;
  border-radius: 0.7rem;
  background: #d9d9d9;
  transition: background-color 140ms ease-out;
}

.setting-switch::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
  transition: transform 140ms ease-out;
}

.setting-control input:checked + .setting-switch {
  border-color: #181818;
  background: #181818;
}

.setting-control input:checked + .setting-switch::after {
  transform: translateX(1.05rem);
}

.setting-control input:focus-visible + .setting-switch {
  outline: 2px solid #181818;
  outline-offset: 3px;
}

.setting-control input:disabled + .setting-switch {
  opacity: 0.45;
  cursor: not-allowed;
}

.setting-state {
  width: 2.25rem;
  color: #555;
  font-size: 0.75rem;
  font-weight: 600;
}

.activity-dialog {
  width: min(46rem, calc(100% - 2rem));
  overflow: hidden;
}

.activity-dialog[open] {
  display: flex;
  flex-direction: column;
}

.activity-body {
  flex: 1 1 auto;
  min-height: 20rem;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.25rem;
}

.activity-panel[hidden] {
  display: none;
}

.stat-kind-control {
  display: flex;
  width: 100%;
  padding: 0.15rem;
  border: 1px solid #d7d7d7;
  border-radius: 6px;
  background: #f5f5f5;
}

.stat-kind-control button {
  display: flex;
  min-width: 0;
  min-height: 2rem;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.25rem 0.75rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #555;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}

.stat-kind-icon {
  display: grid;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 1.15rem;
  place-items: center;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.stat-kind-label {
  min-width: 0;
}

.stat-kind-control button[aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
  color: #181818;
  font-weight: 600;
}

.stat-kind-control button:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 1px;
}

.statistics-content {
  margin-top: 1rem;
}

.statistics-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0.75rem 0;
  border-top: 1px solid #e7e7e7;
  border-bottom: 1px solid #e7e7e7;
}

.statistics-summary-item {
  min-width: 0;
  padding: 0 0.75rem;
  border-left: 1px solid #ededed;
}

.statistics-summary-item:first-child {
  padding-left: 0;
  border-left: 0;
}

.statistics-summary-item:last-child {
  padding-right: 0;
}

.statistics-summary dt {
  color: #666;
  font-size: 0.7rem;
  font-weight: 600;
}

.statistics-summary dd {
  margin: 0.28rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.statistics-summary dd span {
  display: block;
  margin-top: 0.2rem;
  color: #707070;
  font-size: 0.66rem;
  font-weight: 400;
  line-height: 1.35;
}

.statistics-section {
  margin-top: 1.5rem;
}

.statistics-section h3 {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 650;
}

.statistics-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.review-chart-legend {
  display: flex;
  gap: 0.85rem;
  color: #666;
  font-size: 0.68rem;
}

.review-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.review-chart-legend span::before {
  width: 0.45rem;
  height: 0.45rem;
  flex: 0 0 auto;
  border-radius: 2px;
  content: "";
}

.review-chart-legend .review-chart-success::before,
.review-chart-segment.review-chart-success {
  background: #68a273;
}

.review-chart-legend .review-chart-failure::before,
.review-chart-segment.review-chart-failure {
  background: #c8786a;
}

.review-chart {
  display: grid;
  height: 8.75rem;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 0.3rem;
  margin-top: 0.7rem;
}

.review-chart-column {
  display: grid;
  min-width: 0;
  grid-template-rows: minmax(0, 1fr) 1rem;
  gap: 0.2rem;
}

.review-chart-meter {
  display: flex;
  min-height: 0;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid #d9d9d9;
}

.review-chart-stack {
  display: flex;
  width: min(0.9rem, 70%);
  min-height: 0;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 2px 2px 0 0;
}

.review-chart-segment {
  min-height: 0;
}

.review-chart-label {
  color: #777;
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.attention-list {
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
}

.attention-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 3.7rem;
  padding: 0.55rem 0;
  border-top: 1px solid #ededed;
}

.attention-details,
.grammar-statistic-details,
.exposure-statistic-details {
  display: flex;
  align-items: flex-end;
  color: #666;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.attention-details {
  flex-direction: column;
  gap: 0.35rem;
}

.grammar-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 0.18rem 0.4rem;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background: #f5f5f5;
  color: #555;
  font-size: 0.66rem;
  font-weight: 650;
  line-height: 1.2;
}

.grammar-status[data-status="due"],
.grammar-status[data-status="learning"] {
  border-color: #caa568;
  background: #fff0ce;
  color: #6b4c17;
}

.grammar-status[data-status="failed"],
.grammar-status[data-status="relearning"] {
  border-color: #c58b80;
  background: #f8e3de;
  color: #743b31;
}

.grammar-status[data-status="review"] {
  border-color: #83a989;
  background: #e1f0e3;
  color: #315d39;
}

.grammar-status[data-status="mature"] {
  border-color: #68a273;
  background: #dcecdf;
  color: #315d39;
}

.grammar-status[data-status="mastered"] {
  border-color: #4d8260;
  background: #cce2d0;
  color: #23472a;
}

.grammar-result-counts {
  display: inline-flex;
  gap: 0.55rem;
  white-space: nowrap;
}

.grammar-result-success {
  color: #376c40;
}

.grammar-result-failure {
  color: #87473d;
}

.statistics-inline-empty {
  margin: 0.65rem 0 0;
  padding: 0.8rem 0;
  border-top: 1px solid #ededed;
  color: #666;
  font-size: 0.8rem;
  line-height: 1.5;
}

.statistics-coverage {
  padding: 0.1rem 0 1rem;
  border-bottom: 1px solid #e7e7e7;
}

.statistics-coverage-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.86rem;
}

.statistics-coverage-line span {
  color: #444;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.statistics-progress {
  display: flex;
  width: 100%;
  height: 0.45rem;
  margin-top: 0.55rem;
  overflow: hidden;
  border-radius: 3px;
  background: #e7e7e7;
}

.statistics-progress-segment {
  min-width: 0;
  flex: var(--progress-count) 0 0;
}

.statistics-progress-segment[data-progress-state="mastered"] {
  background: #315d39;
}

.statistics-progress-segment[data-progress-state="mature"] {
  background: #68a273;
}

.statistics-progress-segment[data-progress-state="learning-due"] {
  background: #d9aa45;
}

.statistics-progress-segment[data-progress-state="encountered"] {
  background: rgb(77 130 96 / 30%);
}

.statistics-progress-segment[data-progress-state="new"] {
  background: #e7e7e7;
}

.statistics-progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 0.5rem 0 0;
  padding: 0;
  color: #666;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  list-style: none;
}

.statistics-progress-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.statistics-progress-legend li::before {
  width: 0.48rem;
  height: 0.48rem;
  flex: 0 0 auto;
  border-radius: 2px;
  background: #e7e7e7;
  content: "";
}

.statistics-progress-legend li[data-progress-state="mastered"]::before {
  background: #315d39;
}

.statistics-progress-legend li[data-progress-state="mature"]::before {
  background: #68a273;
}

.statistics-progress-legend li[data-progress-state="learning-due"]::before {
  background: #d9aa45;
}

.statistics-progress-legend li[data-progress-state="encountered"]::before {
  background: rgb(77 130 96 / 30%);
}

.statistics-coverage p {
  margin: 0.4rem 0 0;
  color: #777;
  font-size: 0.7rem;
}

.statistics-filter-control {
  display: inline-flex;
  flex-wrap: wrap;
  margin-top: 0.8rem;
  padding: 0.15rem;
  border: 1px solid #dedede;
  border-radius: 6px;
  background: #f5f5f5;
}

.statistics-filter-control button {
  min-height: 1.8rem;
  padding: 0.2rem 0.65rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #5d5d5d;
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
}

.statistics-filter-control button[aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
  color: #181818;
  font-weight: 600;
}

.statistics-filter-control button:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 1px;
}

.activity-empty {
  margin: 5rem 0;
  color: #777;
  font-size: 0.9rem;
  text-align: center;
}

.statistics-list,
.history-attempts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.statistics-list {
  margin-top: 0.75rem;
}

.statistic-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10rem;
  gap: 1rem;
  align-items: center;
  min-height: 4rem;
  padding: 0.65rem 0;
  border-top: 1px solid #ededed;
}

.statistic-description,
.statistic-primary,
.statistic-secondary {
  display: block;
}

.statistic-description {
  min-width: 0;
}

.statistic-primary {
  font-size: 0.92rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.statistic-item[data-stat-kind="kanji"] .statistic-primary {
  font-size: 1.35rem;
}

.statistic-secondary {
  margin-top: 0.15rem;
  color: #666;
  font-size: 0.78rem;
  line-height: 1.4;
}

.statistic-count {
  color: #444;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.grammar-statistic-details {
  flex-direction: column;
  gap: 0.24rem;
  text-align: right;
}

.grammar-schedule {
  color: #444;
  font-weight: 600;
}

.grammar-last-review {
  color: #777;
  font-size: 0.68rem;
}

.exposure-statistic-details {
  flex-direction: column;
  gap: 0.2rem;
  text-align: right;
}

.exposure-statistic-details strong {
  color: #444;
  font-size: 0.76rem;
}

.exposure-statistic-details span {
  color: #777;
  font-size: 0.68rem;
}

.history-day + .history-day {
  margin-top: 1.5rem;
}

.history-day h3 {
  margin: 0 0 0.35rem;
  color: #555;
  font-size: 0.78rem;
  font-weight: 600;
}

.history-attempt {
  position: relative;
  padding: 0.8rem 0 0.9rem 4.75rem;
  border-top: 1px solid #ededed;
}

.history-attempt time {
  position: absolute;
  top: 0.9rem;
  left: 0;
  color: #777;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.history-sentence,
.history-answer {
  margin: 0;
}

.history-sentence {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.6;
}

.history-answer {
  margin-top: 0.3rem;
  color: #444;
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.history-answer span {
  display: block;
  color: #777;
  font-size: 0.7rem;
  font-weight: 600;
}

.history-grammar-ratings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
}

.history-grammar-tag {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.25rem;
  padding: 0.22rem 0.45rem;
  border: 1px solid;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.history-grammar-tag[data-outcome="again"] {
  border-color: #c58b80;
  background: #f8e3de;
  color: #743b31;
}

.history-grammar-tag[data-outcome="good"] {
  border-color: #83a989;
  background: #e1f0e3;
  color: #315d39;
}

.history-grammar-tag-mark {
  flex: 0 0 auto;
  font-size: 0.8rem;
  line-height: 1;
}

main {
  display: grid;
  width: 100%;
  min-height: 100vh;
  place-items: center;
  padding:
    calc(2rem + env(safe-area-inset-top))
    calc(2rem + env(safe-area-inset-right))
    calc(2rem + env(safe-area-inset-bottom))
    calc(2rem + env(safe-area-inset-left));
}

.policy-page main {
  place-items: start center;
}

.policy-content {
  width: min(100%, 44rem);
  padding: 3rem 0;
  font-size: 1rem;
  line-height: 1.7;
}

.policy-content h1 {
  margin: 1.25rem 0 0.35rem;
  font-size: clamp(1.8rem, 6vw, 2.7rem);
  line-height: 1.2;
}

.policy-content h2 {
  margin: 2rem 0 0.45rem;
  font-size: 1.2rem;
}

.policy-content p {
  margin: 0.5rem 0;
}

.policy-content a {
  color: #28653b;
}

.policy-back-link {
  font-weight: 600;
  text-decoration: none;
}

.lesson {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
}

.lesson-control {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.35rem) scale(0.97);
  transition:
    opacity 220ms ease-out,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 220ms;
}

.lesson.controls-visible .lesson-control {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.lesson-stage {
  display: flex;
  width: 100%;
  min-height: 9rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  opacity: 1;
  transition: opacity 180ms ease-out;
}

.lesson-stage.is-leaving {
  opacity: 0;
}

.lesson-sentence {
  max-width: 48rem;
  margin: 0;
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1.9;
  text-align: center;
}

.lesson-sentence[lang="en"] {
  font-size: 1.85rem;
  line-height: 1.55;
}

.lesson-sentence.is-single-kana {
  font-size: 4rem;
  line-height: 1.5;
}

.exercise-kind-label {
  margin: 0 0 -0.55rem;
  color: #777;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.exercise-kind-label[hidden] {
  display: none;
}

.kana-guidance,
.vocabulary-guidance {
  display: flex;
  visibility: hidden;
  max-width: min(32rem, 100%);
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  opacity: 0;
  color: #666;
  font-size: 0.86rem;
  line-height: 1.4;
  transform: translateY(0.25rem);
  transition:
    opacity 220ms ease-out,
    transform 220ms ease-out,
    visibility 0s linear 220ms;
}

.kana-guidance[hidden],
.vocabulary-guidance[hidden] {
  display: none;
}

.lesson.controls-visible .kana-guidance:not([hidden]),
.lesson.controls-visible .vocabulary-guidance:not([hidden]) {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

.kana-written-form {
  color: #333;
  font-size: 1rem;
  font-weight: 600;
}

.kana-guidance-divider,
.vocabulary-guidance-divider {
  color: #aaa;
}

.vocabulary-reading {
  color: #333;
  font-size: 1rem;
  font-weight: 600;
}

.katakana-meaning-hint {
  display: inline-flex;
  max-width: min(24rem, 80vw);
  min-height: 1.85rem;
  align-items: center;
  appearance: none;
  padding: 0.28rem 0.58rem;
  border: 1px solid #d8d3c8;
  border-radius: 999px;
  background: #faf8f3;
  color: #625e55;
  cursor: help;
  font: inherit;
  font-size: 0.76rem;
  line-height: 1.2;
  transition:
    border-color 160ms ease-out,
    background-color 160ms ease-out,
    box-shadow 160ms ease-out;
}

.katakana-meaning-hint[hidden] {
  display: none;
}

.katakana-meaning-hint-label {
  flex: 0 0 auto;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.katakana-meaning-hint-content {
  overflow: hidden;
  max-width: 0;
  border-left: 0 solid transparent;
  margin-left: 0;
  opacity: 0;
  padding-left: 0;
  text-align: left;
  white-space: nowrap;
  transition:
    max-width 220ms ease-out,
    margin-left 220ms ease-out,
    opacity 140ms ease-out,
    padding-left 220ms ease-out;
}

.katakana-meaning-hint:hover,
.katakana-meaning-hint:focus,
.katakana-meaning-hint.is-expanded {
  border-color: #bdb5a5;
  background: #fffdf8;
  box-shadow: 0 0.3rem 0.9rem rgb(56 48 36 / 8%);
  outline: none;
}

.katakana-meaning-hint:focus-visible {
  box-shadow:
    0 0 0 3px rgb(95 86 69 / 14%),
    0 0.3rem 0.9rem rgb(56 48 36 / 8%);
}

.katakana-meaning-hint:hover .katakana-meaning-hint-content,
.katakana-meaning-hint:focus .katakana-meaning-hint-content,
.katakana-meaning-hint.is-expanded .katakana-meaning-hint-content {
  max-width: 20rem;
  border-left-width: 1px;
  border-left-color: #d8d3c8;
  margin-left: 0.48rem;
  opacity: 1;
  padding-left: 0.48rem;
}

.production-guidance {
  display: flex;
  visibility: hidden;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  opacity: 0;
  transform: translateY(0.25rem);
  transition:
    opacity 220ms ease-out,
    transform 220ms ease-out,
    visibility 0s linear 220ms;
}

.production-guidance[hidden] {
  display: none;
}

.lesson.controls-visible .production-guidance:not([hidden]) {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

.production-guidance-label {
  color: #777;
  font-size: 0.78rem;
}

.production-grammar-targets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.production-grammar-target {
  max-width: 100%;
  padding: 0.2rem 0.4rem;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
  background: #fafafa;
  font-size: 0.8rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.speak-button {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1.5rem;
  padding: 0;
  place-items: center;
  border: 1px solid #d7d7d7;
  border-radius: 50%;
  background: transparent;
  color: #4a4a4a;
  cursor: pointer;
}

.speak-button[hidden] {
  display: none;
}

.speak-button svg {
  width: 1.25rem;
  height: 1.25rem;
}

.speak-button:hover:not(:disabled) {
  border-color: #a9a9a9;
  background: #f1f1f1;
  color: #181818;
}

.speak-button:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 3px;
}

.speak-button:active:not(:disabled) {
  transform: scale(0.96);
}

.speak-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.speak-button.no-audio {
  border-color: #dedede;
  color: #aaa;
  opacity: 1;
}

.speak-button.is-loading svg {
  animation: audio-loading 800ms ease-in-out infinite alternate;
}

.speak-button.has-error {
  border-color: #c97c7c;
  color: #9a2f2f;
}

.action-button {
  min-height: 2.75rem;
  margin-top: 1.5rem;
  padding: 0.6rem 1.25rem;
  border: 1px solid #181818;
  border-radius: 4px;
  background: #181818;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
}

.action-button:hover:not(:disabled) {
  background: #333;
}

.action-button:focus-visible {
  outline: 2px solid #181818;
  outline-offset: 3px;
}

.action-button:active:not(:disabled) {
  transform: translateY(1px);
}

.action-button:disabled {
  border-color: #cfcfcf;
  background: #e6e6e6;
  color: #777;
  cursor: default;
}

.translation-input {
  visibility: hidden;
  box-sizing: border-box;
  width: min(48rem, 100%);
  min-height: 2.75rem;
  padding: 0.4rem 0.25rem;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid #b8b8b8;
  border-radius: 0;
  opacity: 0;
  outline: 0;
  pointer-events: none;
  transform: translateY(0.35rem) scale(0.99);
  background: transparent;
  color: #181818;
  caret-color: #181818;
  font: inherit;
  font-size: 1.125rem;
  line-height: 1.5;
  resize: none;
  text-align: center;
  transition:
    opacity 220ms ease-out,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 220ms;
}

.lesson.controls-visible .translation-input:not([hidden]) {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.translation-input:focus {
  border-bottom-color: #181818;
}

.solution {
  width: min(32rem, 100%);
  max-height: 0;
  margin: 0;
  padding: 0 1rem;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 6px;
  opacity: 0;
  background: #fff3cd;
  color: #594819;
  font-size: 1rem;
  line-height: 1.55;
  text-align: center;
  transition:
    max-height 360ms ease,
    margin-top 360ms ease,
    padding 360ms ease,
    border-color 240ms ease,
    opacity 280ms ease;
}

.solution.is-visible {
  max-height: min(60vh, 32rem);
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  overflow-y: auto;
  border-color: #e6ca78;
  opacity: 1;
  scrollbar-color: #c7a94f transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.solution-answer {
  margin: 0;
  font-weight: 500;
}

.solution-answer rt {
  opacity: 1;
  animation: none;
}

.solution-answer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.solution-speak-button {
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  margin: 0;
  border-color: rgb(140 107 25 / 35%);
  color: #6c5519;
}

.solution-speak-button svg {
  width: 1rem;
  height: 1rem;
}

.solution-speak-button:hover:not(:disabled) {
  border-color: rgb(140 107 25 / 65%);
  background: rgb(255 255 255 / 35%);
  color: #4f3d12;
}

.solution-grammar {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgb(166 125 22 / 28%);
}

.solution-autocorrect-status {
  margin: 0;
  color: #6c5926;
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: left;
}

.solution-autocorrect-status[data-state="success"] {
  color: #315d39;
}

.solution-autocorrect-status[data-state="error"] {
  color: #743b31;
}

.solution-grammar-list {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}

.solution-grammar-item {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr);
  gap: 0.25rem 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgb(166 125 22 / 18%);
  text-align: left;
}

.solution-grammar-item:first-child {
  border-top: 0;
}

.solution-grammar-pattern {
  align-self: start;
  grid-row: 1 / span 2;
  color: #493b16;
  font-size: 0.86rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.solution-grammar-description {
  min-width: 0;
}

.solution-grammar-name,
.solution-grammar-meaning {
  display: block;
}

.solution-grammar-rating {
  display: grid;
  width: min(15rem, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-column: 2;
  margin-top: 0.4rem;
}

.solution-grammar-rating button {
  min-height: 2rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid rgb(108 85 25 / 42%);
  border-radius: 0 4px 4px 0;
  background: rgb(255 255 255 / 40%);
  color: #594819;
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
}

.solution-grammar-rating button:first-child {
  border-radius: 4px 0 0 4px;
}

.solution-grammar-rating button + button {
  margin-left: -1px;
}

.solution-grammar-rating button:hover {
  background: rgb(255 255 255 / 70%);
}

.solution-grammar-rating button:focus-visible {
  position: relative;
  outline: 2px solid #6c5519;
  outline-offset: 2px;
}

.solution-grammar-rating button[data-grammar-rating="again"][aria-pressed="true"] {
  border-color: #a95f52;
  background: #f4d4cc;
  color: #6f3026;
}

.solution-grammar-rating button[data-grammar-rating="good"][aria-pressed="true"] {
  border-color: #58815f;
  background: #d5ead7;
  color: #295331;
}

.solution-grammar-name {
  color: #493b16;
  font-size: 0.84rem;
  font-weight: 600;
}

.solution-grammar-meaning {
  margin-top: 0.12rem;
  color: #6c5926;
  font-size: 0.8rem;
  line-height: 1.4;
}

.solution-kana {
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgb(166 125 22 / 28%);
}

.solution-kana-summary {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 650;
  text-align: left;
}

.solution-kana-summary[data-outcome="good"] {
  color: #315d39;
}

.solution-kana-summary[data-outcome="again"] {
  color: #743b31;
}

.solution-kana-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
}

.solution-kana-item {
  display: grid;
  min-width: 3.5rem;
  grid-template-columns: auto 1fr;
  gap: 0 0.3rem;
  align-items: center;
  padding: 0.38rem 0.5rem;
  border: 1px solid;
  border-radius: 4px;
  text-align: left;
}

.solution-kana-item[data-outcome="good"] {
  border-color: #83a989;
  background: #e1f0e3;
  color: #315d39;
}

.solution-kana-item[data-outcome="again"] {
  border-color: #c58b80;
  background: #f8e3de;
  color: #743b31;
}

.solution-kana-item strong {
  font-size: 1rem;
  line-height: 1.1;
}

.solution-kana-item > span:last-child {
  grid-column: 2;
  font-size: 0.66rem;
  line-height: 1.2;
}

.solution-kana-mark {
  grid-row: 1 / span 2;
  font-size: 0.75rem;
  font-weight: 700;
}

.solution-vocabulary-summary {
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgb(166 125 22 / 28%);
}

.vocabulary-solution-reading {
  display: block;
  margin-top: 0.18rem;
  color: #6b6048;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
}

.phrase {
  display: inline-block;
}

.token {
  border-radius: 0.14em;
  background: transparent;
  box-decoration-break: clone;
  pointer-events: none;
  animation: enable-token 1ms step-end forwards;
  animation-delay: var(--token-delay);
  transition: background-color 120ms ease-out;
  -webkit-box-decoration-break: clone;
}

.token[data-category] {
  cursor: pointer;
}

.token[data-new-grammar] {
  animation-name: enable-token, reveal-new-grammar;
  animation-duration: 1ms, 160ms;
  animation-timing-function: step-end, ease-out;
  animation-delay: var(--token-delay), var(--token-delay);
  animation-fill-mode: forwards, forwards;
}

:is(
  html[data-translation-tooltips="true"] .token[data-gloss],
  .token[data-new-grammar][data-gloss]
) {
  display: inline-block;
  position: relative;
}

:is(
  html[data-translation-tooltips="true"] .token[data-gloss],
  .token[data-new-grammar][data-gloss]
)::before,
:is(
  html[data-translation-tooltips="true"] .token[data-gloss],
  .token[data-new-grammar][data-gloss]
)::after {
  display: none;
  position: absolute;
  left: 50%;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 140ms ease-out,
    transform 140ms ease-out;
}

:is(
  html[data-translation-tooltips="true"] .token[data-gloss],
  .token[data-new-grammar][data-gloss]
)::before {
  content: "";
  bottom: calc(100% + 0.55rem - 9px);
  z-index: 9;
  border: 5px solid transparent;
  border-top-color: #252525;
  transform: translate(-50%, 0.2rem);
}

:is(
  html[data-translation-tooltips="true"] .token[data-gloss],
  .token[data-new-grammar][data-gloss]
)::after {
  content: attr(data-gloss);
  bottom: calc(100% + 0.55rem);
  z-index: 10;
  padding: 0.38rem 0.55rem;
  border-radius: 4px;
  background: #252525;
  box-shadow: 0 3px 12px rgb(0 0 0 / 16%);
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  transform: translate(-50%, 0.2rem);
}

.token[data-new-grammar][data-gloss]::after {
  width: max-content;
  max-width: min(28rem, 80vw);
  text-align: left;
  white-space: pre-line;
}

:is(
  html[data-translation-tooltips="true"] .token[data-gloss],
  .token[data-new-grammar][data-gloss]
).is-touch-active::before,
:is(
  html[data-translation-tooltips="true"] .token[data-gloss],
  .token[data-new-grammar][data-gloss]
).is-touch-active::after {
  display: block;
  opacity: 1;
  transform: translate(-50%, 0);
}

html[data-token-coloring="true"] .token[data-category="particle"].is-touch-active {
  background: #ffe28a;
}

html[data-token-coloring="true"] .token[data-category="verb"].is-touch-active {
  background: #bce4c7;
}

html[data-token-coloring="true"] .token[data-category="noun"].is-touch-active {
  background: #b9daf5;
}

html[data-token-coloring="true"] .token[data-category="adjective"].is-touch-active {
  background: #efc4db;
}

html[data-token-coloring="true"] .token[data-category="interjection"].is-touch-active {
  background: #d8ccf0;
}

html[data-token-coloring="true"] .token[data-category="auxiliary"].is-touch-active {
  background: #f5c7a9;
}

@media (hover: hover) {
  :is(
    html[data-translation-tooltips="true"] .token[data-gloss],
    .token[data-new-grammar][data-gloss]
  ) {
    cursor: help;
  }

  :is(
    html[data-translation-tooltips="true"] .token[data-gloss],
    .token[data-new-grammar][data-gloss]
  ):hover::before,
  :is(
    html[data-translation-tooltips="true"] .token[data-gloss],
    .token[data-new-grammar][data-gloss]
  ):hover::after {
    display: block;
    opacity: 1;
    transform: translate(-50%, 0);
  }

  html[data-token-coloring="true"] .token[data-category="particle"]:hover {
    background: #ffe28a;
  }

  html[data-token-coloring="true"] .token[data-category="verb"]:hover {
    background: #bce4c7;
  }

  html[data-token-coloring="true"] .token[data-category="noun"]:hover {
    background: #b9daf5;
  }

  html[data-token-coloring="true"] .token[data-category="adjective"]:hover {
    background: #efc4db;
  }

  html[data-token-coloring="true"] .token[data-category="interjection"]:hover {
    background: #d8ccf0;
  }

  html[data-token-coloring="true"] .token[data-category="auxiliary"]:hover {
    background: #f5c7a9;
  }
}

@media (hover: none), (pointer: coarse) {
  :is(
    html[data-translation-tooltips="true"] .token[data-gloss],
    .token[data-new-grammar][data-gloss]
  )::after {
    width: max-content;
    max-width: min(24rem, 80vw);
    text-align: left;
    white-space: normal;
  }
}

.character {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.18em);
  animation: reveal 280ms ease-out forwards;
  animation-delay: var(--delay);
}

rt {
  opacity: 0;
  font-size: 0.38em;
  font-weight: 400;
  line-height: 1;
  animation: reveal-furigana 160ms ease-out forwards;
  animation-delay: var(--delay);
}

html[data-furigana="false"] rt {
  display: none;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal-furigana {
  to {
    opacity: 1;
  }
}

@keyframes enable-token {
  to {
    pointer-events: auto;
  }
}

@keyframes reveal-new-grammar {
  to {
    background-color: #ffe5a0;
  }
}

@keyframes audio-loading {
  to {
    opacity: 0.45;
    transform: scale(0.9);
  }
}

@media (max-width: 32rem) {
  .app-dialog {
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .settings-list {
    padding-right: max(1rem, env(safe-area-inset-right));
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: max(1rem, env(safe-area-inset-left));
  }

  .dialog-header {
    padding-top: calc(0.75rem + env(safe-area-inset-top));
    padding-right: max(0.9rem, env(safe-area-inset-right));
    padding-left: max(1.25rem, env(safe-area-inset-left));
  }

  .profile-menu-container {
    top: calc(1rem + env(safe-area-inset-top));
    right: calc(1rem + env(safe-area-inset-right));
  }

  main {
    padding:
      calc(1.5rem + env(safe-area-inset-top))
      calc(1.5rem + env(safe-area-inset-right))
      calc(1.5rem + env(safe-area-inset-bottom))
      calc(1.5rem + env(safe-area-inset-left));
  }

  .setting-row-progress {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 0.8rem 0;
  }

  .setting-row-progress .setting-actions {
    width: 100%;
  }

  .setting-row-progress .setting-action-button {
    flex: 1 1 0;
  }

  .lesson-sentence {
    font-size: 1.625rem;
  }

  .solution-grammar-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .solution-grammar-pattern {
    grid-row: auto;
  }

  .solution-grammar-rating {
    grid-column: 1;
  }

  .activity-body {
    min-height: 0;
    padding:
      0.75rem
      max(0.75rem, env(safe-area-inset-right))
      calc(0.75rem + env(safe-area-inset-bottom))
      max(0.75rem, env(safe-area-inset-left));
  }

  .stat-kind-control button {
    min-height: 2.75rem;
    padding: 0.25rem;
  }

  .stat-kind-icon {
    width: 1.3rem;
    height: 1.3rem;
    flex-basis: 1.3rem;
    font-size: 1.15rem;
  }

  .stat-kind-label {
    display: none;
  }

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

  .statistics-summary-item:nth-child(2) {
    padding-right: 0;
  }

  .statistics-summary-item:nth-child(3),
  .statistics-summary-item:nth-child(4),
  .statistics-summary-item:nth-child(5) {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #ededed;
  }

  .statistics-summary-item:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .statistics-summary-item:nth-child(4) {
    padding-right: 0;
  }

  .statistics-summary-item:nth-child(5) {
    grid-column: 1 / -1;
    padding-right: 0;
    padding-left: 0;
    border-left: 0;
  }

  .review-chart {
    gap: 0.15rem;
  }

  .statistics-filter-control {
    display: flex;
    width: 100%;
  }

  .statistics-filter-control button {
    min-width: 0;
    flex: 1 1 0;
    padding-right: 0.3rem;
    padding-left: 0.3rem;
  }

  .statistic-item {
    grid-template-columns: minmax(0, 1fr) 7rem;
    gap: 0.6rem;
  }

  .history-attempt {
    padding-left: 0;
  }

  .history-attempt time {
    position: static;
    display: block;
    margin-bottom: 0.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lesson-control,
  .translation-input,
  .production-guidance,
  .kana-guidance,
  .vocabulary-guidance,
  .katakana-meaning-hint,
  .katakana-meaning-hint-content {
    transform: none;
    transition: none;
  }

  .lesson-stage {
    transition: none;
  }

  .solution {
    transition: none;
  }

  .character {
    opacity: 1;
    transform: none;
    animation: none;
  }

  rt {
    opacity: 1;
    animation: none;
  }

  .token {
    pointer-events: auto;
    animation: none;
  }

  .token[data-new-grammar] {
    background-color: #ffe5a0;
  }

  .speak-button.is-loading svg {
    animation: none;
  }

  .setting-switch,
  .setting-switch::after {
    transition: none;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    background: #101412;
    color: #edf3ee;
  }

  .loading-screen {
    background: #101412;
  }

  .loading-logo {
    filter: brightness(1.55) saturate(0.85);
  }

  .profile-menu-button,
  .profile-menu,
  .app-dialog {
    border-color: #39423c;
    background: #181d1a;
    color: #edf3ee;
  }

  .profile-menu-button,
  .dialog-close-button,
  .speak-button {
    color: #b8c2ba;
  }

  .profile-menu-button:hover,
  .profile-menu-button[aria-expanded="true"],
  .profile-menu-item:hover,
  .profile-menu-item:focus-visible,
  .profile-menu-study-item[aria-current="page"],
  .dialog-close-button:hover,
  .setting-action-button:hover,
  .speak-button:hover:not(:disabled) {
    border-color: #667269;
    background: #252c27;
    color: #f5f8f6;
  }

  .profile-menu-item {
    color: #e1e7e2;
  }

  .profile-menu-heading,
  .setting-label small,
  .settings-status,
  .statistics-summary dt,
  .statistics-summary dd span,
  .review-chart-legend,
  .review-chart-label,
  .attention-details,
  .grammar-statistic-details,
  .exposure-statistic-details,
  .statistics-inline-empty,
  .statistics-progress-legend,
  .statistics-coverage p,
  .activity-empty,
  .statistic-secondary,
  .grammar-last-review,
  .exposure-statistic-details span,
  .history-attempt time,
  .history-answer span,
  .exercise-kind-label,
  .production-guidance-label {
    color: #929d95;
  }

  .profile-menu-separator {
    background: #303832;
  }

  .dialog-header,
  .setting-row,
  .settings-status,
  .statistics-summary,
  .statistics-summary-item,
  .attention-item,
  .statistics-inline-empty,
  .statistics-coverage,
  .statistic-item,
  .history-attempt {
    border-color: #2e3731;
  }

  .statistics-summary-item:nth-child(3),
  .statistics-summary-item:nth-child(4),
  .statistics-summary-item:nth-child(5) {
    border-top-color: #2e3731;
  }

  .app-dialog::backdrop {
    background: rgb(0 0 0 / 58%);
  }

  .setting-text-input,
  .setting-time-input,
  .setting-row select,
  .setting-action-button {
    border-color: #465149;
    background: #202622;
    color: #e8eee9;
  }

  .setting-action-danger {
    border-color: #905f58;
    color: #f0b0a6;
  }

  .settings-status.is-error {
    color: #eeaaa0;
  }

  .setting-switch {
    border-color: #59645c;
    background: #3b443e;
  }

  .setting-switch::after {
    background: #dce4de;
  }

  .setting-control input:checked + .setting-switch {
    border-color: #76b983;
    background: #76b983;
  }

  .setting-state,
  .stat-kind-control button,
  .statistics-filter-control button,
  .history-day h3 {
    color: #aab5ad;
  }

  .stat-kind-control,
  .statistics-filter-control {
    border-color: #39423c;
    background: #121714;
  }

  .stat-kind-control button[aria-pressed="true"],
  .statistics-filter-control button[aria-pressed="true"] {
    background: #29312b;
    box-shadow: 0 1px 3px rgb(0 0 0 / 35%);
    color: #f2f6f3;
  }

  .profile-menu-button:focus-visible,
  .dialog-close-button:focus-visible,
  .setting-text-input:focus-visible,
  .setting-time-input:focus-visible,
  .setting-row select:focus-visible,
  .setting-action-button:focus-visible,
  .setting-control input:focus-visible + .setting-switch,
  .stat-kind-control button:focus-visible,
  .statistics-filter-control button:focus-visible,
  .speak-button:focus-visible,
  .action-button:focus-visible {
    outline-color: #8dca98;
  }

  .review-chart-meter {
    border-bottom-color: #3a443d;
  }

  .review-chart-legend .review-chart-success::before,
  .review-chart-segment.review-chart-success {
    background: #75b982;
  }

  .review-chart-legend .review-chart-failure::before,
  .review-chart-segment.review-chart-failure {
    background: #d18478;
  }

  .grammar-status {
    border-color: #48534b;
    background: #242b26;
    color: #bdc7bf;
  }

  .grammar-status[data-status="due"],
  .grammar-status[data-status="learning"] {
    border-color: #8a7134;
    background: #3b321d;
    color: #f0cf78;
  }

  .grammar-status[data-status="failed"],
  .grammar-status[data-status="relearning"],
  .history-grammar-tag[data-outcome="again"],
  .solution-kana-item[data-outcome="again"] {
    border-color: #8d574e;
    background: #3b2723;
    color: #f0b2a7;
  }

  .grammar-status[data-status="review"],
  .history-grammar-tag[data-outcome="good"],
  .solution-kana-item[data-outcome="good"] {
    border-color: #4e8058;
    background: #213a28;
    color: #b9dfc1;
  }

  .grammar-status[data-status="mature"] {
    border-color: #62a06e;
    background: #203d28;
    color: #c2e7c9;
  }

  .grammar-status[data-status="mastered"] {
    border-color: #75b982;
    background: #23452d;
    color: #d0efd5;
  }

  .grammar-result-success,
  .solution-autocorrect-status[data-state="success"],
  .solution-kana-summary[data-outcome="good"] {
    color: #8fd09b;
  }

  .grammar-result-failure,
  .solution-autocorrect-status[data-state="error"],
  .solution-kana-summary[data-outcome="again"] {
    color: #e5a298;
  }

  .statistics-coverage-line span,
  .statistic-count,
  .grammar-schedule,
  .exposure-statistic-details strong,
  .history-answer {
    color: #bdc7bf;
  }

  .statistics-progress,
  .statistics-progress-segment[data-progress-state="new"],
  .statistics-progress-legend li::before {
    background: #303933;
  }

  .statistics-progress-segment[data-progress-state="mastered"],
  .statistics-progress-legend li[data-progress-state="mastered"]::before {
    background: #4f9360;
  }

  .statistics-progress-segment[data-progress-state="mature"],
  .statistics-progress-legend li[data-progress-state="mature"]::before {
    background: #75b982;
  }

  .statistics-progress-segment[data-progress-state="learning-due"],
  .statistics-progress-legend li[data-progress-state="learning-due"]::before {
    background: #d9aa45;
  }

  .statistics-progress-segment[data-progress-state="encountered"],
  .statistics-progress-legend li[data-progress-state="encountered"]::before {
    background: rgb(105 174 119 / 32%);
  }

  .policy-content a {
    color: #8fd09b;
  }

  .kana-guidance,
  .vocabulary-guidance {
    color: #aeb9b1;
  }

  .kana-written-form,
  .vocabulary-reading {
    color: #e3e9e4;
  }

  .kana-guidance-divider,
  .vocabulary-guidance-divider {
    color: #69746c;
  }

  .katakana-meaning-hint {
    border-color: #514f47;
    background: #22241f;
    color: #d3d0c5;
  }

  .katakana-meaning-hint:hover,
  .katakana-meaning-hint:focus,
  .katakana-meaning-hint.is-expanded {
    border-color: #716d60;
    background: #2b2d27;
    box-shadow: 0 0.3rem 0.9rem rgb(0 0 0 / 24%);
  }

  .katakana-meaning-hint:focus-visible {
    box-shadow:
      0 0 0 3px rgb(151 166 154 / 20%),
      0 0.3rem 0.9rem rgb(0 0 0 / 24%);
  }

  .katakana-meaning-hint:hover .katakana-meaning-hint-content,
  .katakana-meaning-hint:focus .katakana-meaning-hint-content,
  .katakana-meaning-hint.is-expanded .katakana-meaning-hint-content {
    border-left-color: #514f47;
  }

  .production-grammar-target {
    border-color: #414b44;
    background: #1a201c;
  }

  .speak-button {
    border-color: #465149;
  }

  .speak-button.no-audio {
    border-color: #343c36;
    color: #6f7a72;
  }

  .speak-button.has-error {
    border-color: #995f57;
    color: #e9a298;
  }

  .action-button {
    border-color: #82c48e;
    background: #82c48e;
    color: #101412;
  }

  .action-button:hover:not(:disabled) {
    background: #96d3a0;
  }

  .action-button:disabled {
    border-color: #374039;
    background: #292f2b;
    color: #737e76;
  }

  .translation-input {
    border-bottom-color: #59645c;
    color: #edf3ee;
    caret-color: #9bd4a5;
  }

  .translation-input:focus {
    border-bottom-color: #9bd4a5;
  }

  .solution {
    background: #302914;
    color: #ecd78f;
  }

  .solution.is-visible {
    border-color: #786326;
    scrollbar-color: #9a7d31 transparent;
  }

  .solution-speak-button {
    border-color: rgb(225 190 93 / 40%);
    color: #dfc372;
  }

  .solution-speak-button:hover:not(:disabled) {
    border-color: rgb(225 190 93 / 68%);
    background: rgb(255 255 255 / 8%);
    color: #f1d98f;
  }

  .solution-grammar,
  .solution-kana,
  .solution-vocabulary-summary {
    border-color: rgb(220 180 68 / 32%);
  }

  .solution-grammar-item {
    border-top-color: rgb(220 180 68 / 20%);
  }

  .solution-autocorrect-status,
  .solution-grammar-meaning {
    color: #cbb976;
  }

  .solution-grammar-pattern,
  .solution-grammar-name {
    color: #ead68e;
  }

  .solution-grammar-rating button {
    border-color: rgb(220 190 102 / 42%);
    background: rgb(255 255 255 / 6%);
    color: #e3cf89;
  }

  .solution-grammar-rating button:hover {
    background: rgb(255 255 255 / 12%);
  }

  .solution-grammar-rating button:focus-visible {
    outline-color: #e0c56f;
  }

  .solution-grammar-rating button[data-grammar-rating="again"][aria-pressed="true"] {
    border-color: #a66459;
    background: #482c27;
    color: #f1b5aa;
  }

  .solution-grammar-rating button[data-grammar-rating="good"][aria-pressed="true"] {
    border-color: #5b9065;
    background: #263f2c;
    color: #bde2c4;
  }

  .vocabulary-solution-reading {
    color: #bdb58f;
  }

  :is(
    html[data-translation-tooltips="true"] .token[data-gloss],
    .token[data-new-grammar][data-gloss]
  )::before {
    border-top-color: #e5ece7;
  }

  :is(
    html[data-translation-tooltips="true"] .token[data-gloss],
    .token[data-new-grammar][data-gloss]
  )::after {
    background: #e5ece7;
    box-shadow: 0 3px 14px rgb(0 0 0 / 42%);
    color: #151a17;
  }

  html[data-token-coloring="true"] .token[data-category="particle"].is-touch-active {
    background: #5b4817;
  }

  html[data-token-coloring="true"] .token[data-category="verb"].is-touch-active {
    background: #234b2e;
  }

  html[data-token-coloring="true"] .token[data-category="noun"].is-touch-active {
    background: #214158;
  }

  html[data-token-coloring="true"] .token[data-category="adjective"].is-touch-active {
    background: #553143;
  }

  html[data-token-coloring="true"] .token[data-category="interjection"].is-touch-active {
    background: #403256;
  }

  html[data-token-coloring="true"] .token[data-category="auxiliary"].is-touch-active {
    background: #59381f;
  }

  @media (hover: hover) {
    html[data-token-coloring="true"] .token[data-category="particle"]:hover {
      background: #5b4817;
    }

    html[data-token-coloring="true"] .token[data-category="verb"]:hover {
      background: #234b2e;
    }

    html[data-token-coloring="true"] .token[data-category="noun"]:hover {
      background: #214158;
    }

    html[data-token-coloring="true"] .token[data-category="adjective"]:hover {
      background: #553143;
    }

    html[data-token-coloring="true"] .token[data-category="interjection"]:hover {
      background: #403256;
    }

    html[data-token-coloring="true"] .token[data-category="auxiliary"]:hover {
      background: #59381f;
    }
  }

  @keyframes reveal-new-grammar {
    to {
      background-color: #5c4c19;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .token[data-new-grammar] {
      background-color: #5c4c19;
    }
  }
}
