.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.card--padded {
  padding: 20px;
}

.eyebrow {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.73rem;
  color: var(--muted);
}

.hero-title,
.section-title {
  margin: 0;
  font-family: var(--font-title);
}

.hero-title {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.02;
}

.section-title {
  font-size: 1.18rem;
}

.hero-subtitle,
.section-copy,
.meta-copy,
.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.toolbar,
.tab-row,
.button-row,
.list-header,
.panel-header,
.revision-header,
.stats-grid,
.detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.revision-program-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.revision-program-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.revision-program-card--today {
  border-color: rgba(154, 52, 18, 0.3);
  box-shadow: 0 14px 30px rgba(121, 74, 43, 0.14);
}

.revision-program-card h4 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.05rem;
}

.revision-program-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.revision-program-list li {
  line-height: 1.5;
  color: var(--text);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.revision-program-task__button {
  width: 100%;
  text-align: left;
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
}

.revision-program-task__button:hover {
  color: var(--accent);
}

.revision-program-task__check-button {
  padding: 0;
  background: transparent;
  border: 0;
}

.revision-program-task__check-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.revision-program-task__check {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 251, 247, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-weight: 700;
  line-height: 1;
}

.revision-program-task__check.is-done {
  background: rgba(22, 101, 52, 0.14);
  border-color: rgba(22, 101, 52, 0.28);
  color: var(--success);
}

.revision-program-task--done {
  color: var(--text);
}

.revision-program-nav {
  align-items: center;
  justify-content: space-between;
}

.revision-program-nav__label {
  justify-content: center;
  min-width: 120px;
}

.stat-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 247, 240, 0.95), rgba(241, 223, 203, 0.7));
  border: 1px solid var(--line);
}

.stat-card strong {
  display: block;
  font-size: 1.9rem;
  font-family: var(--font-title);
  margin-top: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button:disabled:hover {
  transform: none;
}

.button--primary {
  background: var(--accent);
  color: #fff8f2;
}

.button--secondary {
  background: var(--surface-strong);
  border-color: var(--line);
}

.button--ghost {
  background: rgba(255, 250, 244, 0.6);
  border-color: var(--line);
}

.button--danger {
  background: #fbe4df;
  border-color: rgba(153, 27, 27, 0.2);
  color: var(--danger);
}

.button-row--end {
  margin-left: auto;
  justify-content: flex-end;
}

.button--pill-icon {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  font-size: 1rem;
}

.button--pill-icon-add {
  background: rgba(22, 101, 52, 0.16);
  border-color: rgba(22, 101, 52, 0.24);
  color: var(--success);
}

.button--pill-icon-delete {
  background: rgba(153, 27, 27, 0.14);
  border-color: rgba(153, 27, 27, 0.24);
  color: var(--danger);
}

.button--pill-icon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button--pill-icon:disabled:hover {
  transform: none;
}

.button--mode {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.88rem;
}

.button--mode-edit {
  background: rgba(255, 250, 244, 0.72);
  border-color: var(--line);
  color: var(--text);
}

.button--mode-save {
  background: rgba(22, 101, 52, 0.14);
  border-color: rgba(22, 101, 52, 0.24);
  color: var(--success);
}

.button--tab.is-active {
  background: var(--text);
  color: #fff8f2;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.8);
  border: 1px solid var(--line);
  color: var(--muted);
}

.pill--account-active {
  background: rgba(234, 246, 237, 0.92);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--success);
}

.status-dot--account-active {
  background: var(--success);
}

.status-dot--account-idle {
  background: #a8a29e;
}

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

.section-divider {
  height: 1px;
  background: var(--line);
}

.list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.list-item {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.78);
  display: grid;
  gap: 4px;
}

.list-item.is-active {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(250, 221, 200, 0.7), rgba(255, 249, 242, 0.9));
}

.list-item__title {
  font-weight: 700;
}

.list-item__meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.home-page,
.home-page__hero,
.home-page__grid,
.home-page__metrics {
  display: grid;
}

.home-page {
  gap: 22px;
}

.home-page__hero {
  gap: 18px;
  padding: 8px;
}

.home-page__title {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
  max-width: 14ch;
}

.home-page__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.home-card {
  text-align: left;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(245, 233, 218, 0.88));
  display: grid;
  gap: 10px;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.home-card strong {
  font-size: 1.2rem;
  font-family: var(--font-title);
}

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

.home-card--account {
  background: linear-gradient(180deg, rgba(250, 247, 255, 0.98), rgba(232, 228, 241, 0.86));
}

.home-card--revision-plan {
  background: linear-gradient(180deg, rgba(255, 247, 228, 0.98), rgba(244, 225, 198, 0.9));
  border-color: rgba(154, 52, 18, 0.22);
}

.home-card:hover {
  transform: translateY(-2px);
  border-color: rgba(154, 52, 18, 0.24);
  box-shadow: 0 12px 30px rgba(121, 74, 43, 0.1);
}

.home-page__metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-metric {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.82);
  display: grid;
  gap: 8px;
}

.home-metric strong {
  font-size: 1.9rem;
  font-family: var(--font-title);
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

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

.field-details {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.field-details > textarea {
  width: 100%;
}

.field-details__summary {
  list-style: none;
  cursor: pointer;
}

.field-details__summary::-webkit-details-marker {
  display: none;
}

.field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.field--full {
  grid-column: 1 / -1;
}

.field--title input {
  min-height: 58px;
  font-size: 1.15rem;
  font-weight: 700;
}

.field label {
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 251, 247, 0.98);
  padding: 12px 14px;
  min-height: 46px;
}

.field textarea {
  min-height: 108px;
}

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.72);
}

.toggle-field__copy {
  display: grid;
  gap: 4px;
}

.toggle-field__title {
  font-weight: 700;
  color: var(--text);
}

.toggle-field__hint {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.toggle-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle-switch__track {
  width: 56px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(121, 74, 43, 0.2);
  background: rgba(203, 213, 225, 0.64);
  box-shadow: inset 0 1px 2px rgba(45, 31, 20, 0.14);
  transition: background 140ms ease, border-color 140ms ease;
  position: relative;
}

.toggle-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 8px rgba(45, 31, 20, 0.18);
  transition: transform 140ms ease;
}

.toggle-switch input:checked + .toggle-switch__track {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.92), rgba(194, 65, 12, 0.92));
  border-color: rgba(154, 52, 18, 0.38);
}

.toggle-switch input:checked + .toggle-switch__track::after {
  transform: translateX(24px);
}

.toggle-switch input:focus-visible + .toggle-switch__track {
  box-shadow:
    inset 0 1px 2px rgba(45, 31, 20, 0.14),
    0 0 0 3px rgba(154, 52, 18, 0.12);
}

.field-textarea--precision {
  min-height: 180px;
}

.rich-field {
  gap: 10px;
}

.rich-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.button--format,
.button--inline {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.button--format-icon {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.toolbar-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1ch;
  font-weight: 700;
}

.toolbar-symbol--underline {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.16em;
}

.button--theme-part {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border-width: 1px;
  border-style: solid;
  font-weight: 700;
  color: var(--text) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.42),
    0 1px 2px rgba(45, 31, 20, 0.14);
}

.button--theme-part-1 {
  background-color: #e5f0e8;
  border-color: #4f8a6b;
  color: #4f8a6b !important;
}

.button--theme-part-2 {
  background-color: #f6e8dd;
  border-color: #bc6e2d;
  color: #bc6e2d !important;
}

.button--theme-part-3 {
  background-color: #e3edf8;
  border-color: #4d7fb0;
  color: #4d7fb0 !important;
}

.button--theme-part-4 {
  background-color: #e9edf2;
  border-color: #7a8495;
  color: #7a8495 !important;
}

.rich-input {
  min-height: 150px;
  font-family: var(--font-ui);
  line-height: 1.6;
  resize: vertical;
}

.rich-editor__content {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 251, 247, 0.98);
  padding: 12px 14px;
  min-height: 46px;
  overflow-y: auto;
  white-space: pre-wrap;
  outline: none;
  caret-color: var(--ink);
}

.rich-editor__content:focus {
  border-color: rgba(118, 67, 28, 0.42);
  box-shadow: 0 0 0 3px rgba(118, 67, 28, 0.08);
}

.rich-editor__content:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.rich-input--reading {
  min-height: 0;
  height: max(560px, calc(100vh - 250px));
  font-size: 1rem;
  line-height: 1.75;
}

.reading-page {
  min-height: calc(100vh - 84px);
  display: flex;
  flex-direction: column;
}

.reading-page__body {
  flex: 1;
  min-height: 0;
}

.reading-page .rich-field {
  flex: 1;
  min-height: 0;
}

.reading-page .field {
  min-height: 0;
}

.reading-page .field-header {
  align-items: flex-start;
}

.reading-page .rich-editor__content {
  flex: 1;
  min-height: 0;
}

.rich-preview {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.56);
}

.formatted-text {
  line-height: 1.75;
}

.formatted-text strong,
.formatted-text b {
  font-weight: 700;
}

.formatted-text theme-part-1,
.formatted-text theme-part-2,
.formatted-text theme-part-3,
.formatted-text theme-part-4,
.formatted-text .theme-part-1,
.formatted-text .theme-part-2,
.formatted-text .theme-part-3,
.formatted-text .theme-part-4 {
  font-weight: 600;
}

.formatted-text theme-part-1,
.formatted-text .theme-part-1 {
  color: var(--part-theme-1);
}

.formatted-text theme-part-2,
.formatted-text .theme-part-2 {
  color: var(--part-theme-2);
}

.formatted-text theme-part-3,
.formatted-text .theme-part-3 {
  color: var(--part-theme-3);
}

.formatted-text theme-part-4,
.formatted-text .theme-part-4 {
  color: var(--part-theme-4);
}

.formatted-text u {
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.muted-note {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.module-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 251, 247, 0.86);
  display: grid;
  gap: 12px;
}

.account-summary {
  display: grid;
  gap: 6px;
}

.account-summary strong {
  word-break: break-word;
}

.account-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 248, 241, 0.9);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.account-status--ok {
  background: rgba(234, 246, 237, 0.92);
  border-color: rgba(22, 101, 52, 0.2);
  color: var(--success);
}

.stats-card {
  min-width: 200px;
  flex: 1 1 220px;
}

.stats-card--button {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.stats-card--button:hover {
  transform: translateY(-2px);
  border-color: rgba(154, 52, 18, 0.24);
  box-shadow: 0 12px 30px rgba(121, 74, 43, 0.1);
}

.stats-card--button:disabled {
  cursor: default;
  opacity: 0.78;
}

.stats-card--button:disabled:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.stats-card__header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stats-card__icon {
  font-size: 1.1rem;
  line-height: 1;
}

.stats-progress-card {
  gap: 16px;
}

.stats-progress-card__top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.stats-progress-card__title,
.stats-progress-card__points {
  margin: 0;
}

.stats-progress-card__title {
  font-family: var(--font-title);
  font-size: 1.3rem;
}

.stats-progress-card__points {
  font-weight: 700;
  font-size: 1.05rem;
}

.stats-progress {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(154, 52, 18, 0.12);
}

.stats-progress__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d97706, #ea580c, #f59e0b);
}

.stats-text-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.stats-text-card {
  height: 100%;
  align-content: start;
}

.stats-text-card__title {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.module-card--accent {
  background: linear-gradient(180deg, rgba(252, 233, 219, 0.7), rgba(255, 250, 244, 0.92));
}

.module-card--part {
  --tone-ink: var(--text);
  --tone-border: var(--line);
  --tone-border-strong: var(--line-strong);
  --tone-surface: rgba(255, 251, 247, 0.9);
  --tone-panel: rgba(255, 255, 255, 0.72);
  --tone-input: rgba(255, 255, 255, 0.78);
  --tone-tag: var(--accent-soft);
  border-width: 2px;
  border-color: var(--tone-border);
  background: var(--tone-surface);
}

.module-card--tone-forest {
  --tone-ink: #224734;
  --tone-border: rgba(34, 71, 52, 0.3);
  --tone-border-strong: rgba(34, 71, 52, 0.42);
  --tone-surface: linear-gradient(180deg, rgba(228, 239, 232, 0.96), rgba(249, 252, 250, 0.94));
  --tone-panel: rgba(245, 250, 247, 0.82);
  --tone-input: rgba(241, 248, 244, 0.92);
  --tone-tag: rgba(196, 221, 204, 0.95);
}

.module-card--tone-amber {
  --tone-ink: #7a4210;
  --tone-border: rgba(163, 86, 18, 0.32);
  --tone-border-strong: rgba(163, 86, 18, 0.44);
  --tone-surface: linear-gradient(180deg, rgba(250, 232, 210, 0.96), rgba(253, 248, 242, 0.94));
  --tone-panel: rgba(255, 247, 237, 0.82);
  --tone-input: rgba(255, 245, 232, 0.92);
  --tone-tag: rgba(245, 214, 182, 0.95);
}

.module-card--tone-ocean {
  --tone-ink: #1f4b73;
  --tone-border: rgba(31, 75, 115, 0.3);
  --tone-border-strong: rgba(31, 75, 115, 0.42);
  --tone-surface: linear-gradient(180deg, rgba(224, 237, 248, 0.96), rgba(248, 251, 254, 0.94));
  --tone-panel: rgba(243, 249, 254, 0.84);
  --tone-input: rgba(238, 246, 252, 0.94);
  --tone-tag: rgba(201, 222, 240, 0.95);
}

.module-card--tone-slate {
  --tone-ink: #424a57;
  --tone-border: rgba(66, 74, 87, 0.28);
  --tone-border-strong: rgba(66, 74, 87, 0.4);
  --tone-surface: linear-gradient(180deg, rgba(231, 235, 241, 0.96), rgba(250, 251, 253, 0.94));
  --tone-panel: rgba(246, 248, 251, 0.84);
  --tone-input: rgba(241, 244, 248, 0.94);
  --tone-tag: rgba(211, 217, 226, 0.95);
}

.module-card--part .panel-header h4,
.module-card--part .field label,
.module-card--part .formatted-text,
.module-card--part .analysis-item {
  color: var(--tone-ink);
}

.module-card--part .field textarea,
.module-card--part .field input,
.module-card--part .field select,
.module-card--part .rich-preview {
  border-color: var(--tone-border);
  background: var(--tone-input);
}

.module-card--part .rich-preview {
  border-style: dashed;
}

.module-card--part .analysis-item {
  border-color: var(--tone-border);
  background: var(--tone-panel);
}

.module-card--part .tag {
  background: var(--tone-tag);
  color: var(--tone-ink);
}

.analysis-list {
  display: grid;
  gap: 12px;
}

.analysis-item {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.revision-layout {
  display: grid;
  gap: 18px;
}

.revision-section {
  --tone-ink: var(--text);
  --tone-border: var(--line);
  --tone-border-strong: var(--line-strong);
  --tone-surface: rgba(255, 250, 244, 0.86);
  --tone-panel: rgba(255, 255, 255, 0.52);
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--tone-surface);
  display: grid;
  gap: 12px;
}

.revision-section--tone-forest {
  --tone-ink: #224734;
  --tone-border: rgba(34, 71, 52, 0.28);
  --tone-border-strong: rgba(34, 71, 52, 0.42);
  --tone-surface: linear-gradient(180deg, rgba(231, 241, 235, 0.96), rgba(249, 252, 250, 0.92));
  --tone-panel: rgba(245, 250, 247, 0.78);
}

.revision-section--tone-amber {
  --tone-ink: #7a4210;
  --tone-border: rgba(163, 86, 18, 0.3);
  --tone-border-strong: rgba(163, 86, 18, 0.44);
  --tone-surface: linear-gradient(180deg, rgba(250, 236, 218, 0.96), rgba(253, 248, 242, 0.92));
  --tone-panel: rgba(255, 247, 237, 0.8);
}

.revision-section--tone-ocean {
  --tone-ink: #1f4b73;
  --tone-border: rgba(31, 75, 115, 0.28);
  --tone-border-strong: rgba(31, 75, 115, 0.42);
  --tone-surface: linear-gradient(180deg, rgba(229, 240, 249, 0.96), rgba(248, 251, 254, 0.92));
  --tone-panel: rgba(242, 248, 253, 0.8);
}

.revision-section--tone-slate {
  --tone-ink: #424a57;
  --tone-border: rgba(66, 74, 87, 0.26);
  --tone-border-strong: rgba(66, 74, 87, 0.38);
  --tone-surface: linear-gradient(180deg, rgba(236, 240, 245, 0.96), rgba(250, 251, 253, 0.92));
  --tone-panel: rgba(246, 248, 251, 0.8);
}

.revision-section[class*="revision-section--tone-"] {
  border-color: var(--tone-border);
  color: var(--tone-ink);
}

.revision-passage {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--tone-border-strong);
  background: var(--tone-panel);
}

.revision-passage--full {
  margin-top: 4px;
}

.revision-section h3,
.revision-section h4,
.revision-section h5 {
  margin: 0;
  font-family: var(--font-title);
}

.revision-section p,
.revision-section li {
  margin: 0;
  line-height: 1.6;
}

.revision-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
}

.revision-section ul,
.revision-section ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.revision-analysis {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--tone-border);
  background: var(--tone-panel);
  list-style-position: inside;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #6c2d12;
  font-size: 0.88rem;
  font-weight: 600;
}

.hidden-input {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 31, 20, 0.38);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
}

.modal-card {
  width: min(100%, 520px);
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 250, 244, 0.98);
  box-shadow: var(--shadow);
}

.auth-modal {
  width: min(100%, 560px);
}

.revision-reminder-modal {
  width: min(100%, 620px);
}

.revision-reminder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.revision-reminder-card {
  min-width: 0;
}

.revision-reminder-objectives {
  display: grid;
  gap: 12px;
}

.revision-reminder-card strong {
  font-size: 1.4rem;
  font-family: var(--font-title);
}

.modal-overlay--celebration {
  z-index: 60;
  background:
    radial-gradient(circle at top, rgba(255, 222, 173, 0.34), transparent 36%),
    rgba(45, 31, 20, 0.56);
  backdrop-filter: blur(8px);
}

.level-up-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 560px);
  padding: 28px;
  border-radius: 26px;
  border-color: rgba(154, 52, 18, 0.22);
  background:
    radial-gradient(circle at top, rgba(255, 244, 214, 0.95), transparent 42%),
    linear-gradient(165deg, rgba(255, 251, 244, 0.98), rgba(249, 233, 210, 0.94) 55%, rgba(243, 214, 188, 0.92));
  box-shadow:
    0 28px 90px rgba(59, 29, 12, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.38) inset;
  animation: level-up-card-enter 420ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.level-up-card__glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85), transparent 62%);
  opacity: 0.72;
  filter: blur(16px);
  pointer-events: none;
}

.level-up-card__content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 18px;
  justify-items: center;
  text-align: center;
}

.level-up-card__burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.level-up-badge {
  position: relative;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: 162px;
  padding: 20px 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(157, 52, 18, 0.96), rgba(108, 38, 18, 0.96));
  color: #fff9f2;
  box-shadow:
    0 18px 32px rgba(109, 45, 18, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transform-origin: center;
  animation: level-up-badge-pop 720ms cubic-bezier(0.15, 1, 0.25, 1);
}

.level-up-badge span {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.82;
}

.level-up-badge strong {
  font-family: var(--font-title);
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1;
}

.level-up-pill {
  background: rgba(255, 248, 236, 0.92);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(121, 74, 43, 0.1);
}

.level-up-burst {
  position: absolute;
  top: 46%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 999px;
  opacity: 0;
  transform:
    rotate(var(--burst-angle))
    translateY(calc(var(--burst-distance) * -1))
    scale(0.4);
  animation: level-up-burst 1400ms cubic-bezier(0.18, 0.84, 0.24, 1) infinite;
  animation-delay: var(--burst-delay);
}

.level-up-burst--1 {
  background: #f59e0b;
}

.level-up-burst--2 {
  background: #ea580c;
}

.level-up-burst--3 {
  background: #facc15;
}

.level-up-burst--4 {
  background: #fb7185;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@keyframes level-up-card-enter {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes level-up-badge-pop {
  0% {
    transform: scale(0.74) rotate(-10deg);
  }

  55% {
    transform: scale(1.08) rotate(2deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes level-up-burst {
  0% {
    opacity: 0;
    transform:
      rotate(var(--burst-angle))
      translateY(calc(var(--burst-distance) * -0.18))
      scale(0.3);
  }

  24% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform:
      rotate(var(--burst-angle))
      translateY(calc(var(--burst-distance) * -1))
      scale(1.1);
  }
}

@media (max-width: 720px) {
  .home-page__grid,
  .home-page__metrics,
  .stats-grid,
  .form-grid--two {
    grid-template-columns: 1fr;
  }

  .field-header,
  .revision-action-row {
    align-items: flex-start;
  }

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

  .revision-reminder-grid {
    grid-template-columns: 1fr;
  }

  .level-up-card {
    padding: 22px 18px;
  }

  .level-up-badge {
    min-width: 144px;
    padding: 18px 22px;
  }
}
