.title-lg {
  font-size: var(--font-size-5);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.title-md {
  font-size: var(--font-size-4);
  font-weight: 750;
}

.title-sm {
  font-size: var(--font-size-3);
  font-weight: 700;
}

.text-soft {
  color: var(--text-soft);
}

.text-muted {
  color: var(--text-muted);
}

.card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.compact-card {
  box-shadow: none;
}

.card-padding {
  padding: 16px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.stack-md {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
}

.row-between--top {
  align-items: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #ffd8ef;
  border: 1px solid rgba(216, 61, 156, 0.22);
  font-size: var(--font-size-1);
  font-weight: 700;
}

.badge-soft {
  background: rgba(255,255,255,0.04);
  color: var(--text-soft);
  border-color: var(--border);
}

.badge.success {
  background: rgba(24, 146, 91, 0.12);
  color: #b7ebcb;
  border-color: rgba(24, 146, 91, 0.22);
}

.badge.danger {
  background: rgba(207, 75, 97, 0.12);
  color: #f9ccd5;
  border-color: rgba(207, 75, 97, 0.22);
}

.month-chip {
  background: rgba(216, 61, 156, 0.14);
  color: #ffe4f4;
  border-color: rgba(216, 61, 156, 0.22);
  padding: 6px 12px;
}

.button,
.answer-button,
.nav-button,
.icon-button,
.segmented__button {
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  transition: transform 80ms ease, background 80ms ease, border-color 80ms ease;
}

.button:active,
.answer-button:active,
.nav-button:active,
.icon-button:active,
.segmented__button:active {
  transform: scale(0.96);
}

.button {
  width: 100%;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.button.secondary {
  background: rgba(216, 61, 156, 0.14);
  color: #ffd9ef;
  border: 1px solid rgba(216, 61, 156, 0.22);
}

.button.danger {
  background: rgba(207, 75, 97, 0.14);
  color: #ffd3dc;
  border: 1px solid rgba(207, 75, 97, 0.24);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}

.button-inline {
  width: auto;
  min-height: 40px;
  padding: 0 14px;
}

.button-inline--full {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.icon-button {
  width: var(--tap);
  min-width: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text);
}

.icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Bottom nav */
.nav-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px 10px;
  background: transparent;
  border: none;
  border-top: 2px solid var(--border);
  border-radius: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 750;
}

.nav-button.is-active {
  border-top-color: var(--accent);
  color: var(--accent);
}

.module-card {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.module-card__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.module-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented {
  display: flex;
  gap: 8px;
}

.segmented--wrap {
  flex-wrap: wrap;
}

.segmented--three .segmented__button {
  flex: 1;
}

.segmented--sticky {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 2px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: -4px;
}

.segmented__button {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-weight: 700;
}

.segmented__button.is-active {
  background: rgba(216, 61, 156, 0.18);
  border-color: rgba(216, 61, 156, 0.24);
  color: #fff0fa;
}

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

.answers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  height: 100%;
  align-content: stretch;
}

.answers-grid--days {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.answers-grid--days .answer-button:last-child:nth-child(7) {
  grid-column: 2;
}

.answer-button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 56px;
  max-height: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
}

.answer-button.is-correct {
  background: rgba(24, 146, 91, 0.55);
  border-color: rgba(24, 146, 91, 0.75);
  color: #dff7e7;
}

.answer-button.is-wrong {
  background: rgba(207, 75, 97, 0.55);
  border-color: rgba(207, 75, 97, 0.75);
  color: #ffd3dc;
}

.answer-button.is-disabled {
  opacity: 0.8;
}

.answers-grid:not(.answers-grid--days) .answer-button {
  font-size: 2rem;
}

.practice-stimulus {
  padding: 14px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

/* Trigger de hint imagen dentro del estímulo (number-to-day) */
.stimulus-hint-wrap {
  position: relative;
  min-height: 0;
  height: 100%;
}

.stimulus-hint-wrap > .practice-stimulus {
  height: 100%;
}

.hint-corner-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stimulus-hero {
  font-size: clamp(5rem, 13vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.96;
  word-break: break-word;
}

.stimulus-hero--text {
  font-size: clamp(2.8rem, 8vw, 4.5rem);
}

.stimulus-hero--date {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
}

.stimulus-sub {
  font-size: 0.92rem;
  color: var(--text-soft);
}

.anchor-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.anchor-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 800;
}

.anchor-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(216, 61, 156, 0.14);
  border: 1px solid rgba(216, 61, 156, 0.22);
  color: #ffe3f5;
  font-weight: 800;
}

.anchor-pill--prominent {
  min-height: 44px;
  padding: 0 18px;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.anchor-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.stimulus-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 8px;
}

.practice-stimulus.image-stimulus {
  padding: 0;
  overflow: hidden;
  align-items: stretch;
}

.practice-stimulus.image-stimulus .stimulus-image {
  flex: 1;
  min-height: 0;
  width: 100%;
  aspect-ratio: unset;
  object-fit: cover;
  border-radius: 0;
  border: none;
  padding: 0;
}

.hint-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.hint-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hint-pill {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(216, 61, 156, 0.1);
  border: 1px solid rgba(216, 61, 156, 0.2);
  color: #ffe1f2;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hint-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 8px;
  align-items: stretch;
}

.hint-pager__main {
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  overflow: visible;
  padding: 8px 12px;
}

.hint-pager__main--with-nav {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  padding: 8px 4px;
}

.hint-pager__main.is-active {
  background: rgba(216, 61, 156, 0.1);
  border-color: rgba(216, 61, 156, 0.2);
}

.hint-pager__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-soft);
  min-height: auto;
  width: 36px;
  padding: 0;
  border-radius: 0;
}

.hint-pager__nav.is-hidden {
  visibility: hidden;
}

.hint-pager__content-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hint-pager__placeholder {
  width: 100%;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
}

.hint-pager__single-line {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: #ffe7f5;
  white-space: normal;
  word-break: break-word;
}

.hint-pager__plus {
  min-height: 56px;
  border-radius: 16px;
  background: rgba(216, 61, 156, 0.16);
  border: 1px solid rgba(216, 61, 156, 0.24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.hint-pager__plus.is-done {
  opacity: 0.35;
  cursor: default;
}

.practice-stats-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0 2px 2px;
}

.progress-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.kpi-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-card__value {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-row {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}

.setting-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.setting-control {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Preset buttons for settings */
.preset-row {
  display: flex;
  gap: 8px;
}

.preset-btn {
  flex: 1;
  min-height: 40px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
}

.preset-btn.is-active {
  background: rgba(216, 61, 156, 0.18);
  border-color: rgba(216, 61, 156, 0.32);
  color: #fff0fa;
}

/* Stepper for session size */
.stepper-row {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  align-self: flex-start;
}

.stepper-btn {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
}

.stepper-value {
  min-width: 52px;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  padding: 0 4px;
}

.switch {
  position: relative;
  width: 54px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--border);
}

.switch::after {
  content: "";
  position: absolute;
  inset: 3px auto 3px 3px;
  width: 24px;
  border-radius: 999px;
  background: white;
  transition: transform 140ms ease;
}

.switch.is-on {
  background: rgba(216, 61, 156, 0.34);
  border-color: rgba(216, 61, 156, 0.4);
}

.switch.is-on::after {
  transform: translateX(22px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 3, 8, 0.82);
  backdrop-filter: blur(12px);
  z-index: 40;
  padding: max(14px, env(safe-area-inset-top, 0px)) 14px max(18px, env(safe-area-inset-bottom, 0px)) 14px;
  display: flex;
  justify-content: center;
}

.modal-backdrop--confirm {
  z-index: 50;
  align-items: center;
}

.modal-sheet {
  width: 100%;
  max-width: var(--content-max);
  background: linear-gradient(180deg, rgba(25,23,38,0.98), rgba(9,8,14,0.98));
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.modal-sheet--confirm {
  max-width: 360px;
  overflow: hidden;
}

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

.number-input {
  width: 82px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  text-align: center;
}

.inline-image {
  width: 100%;
  max-width: 120px;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  padding: 8px;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-row--months {
  gap: 10px;
}

.topbar-center {
  min-width: 0;
}

.topbar-title-center {
  text-align: center;
}

/* Progress view */
.module-stat-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.accuracy-bar-track {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}

.accuracy-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 300ms ease;
}

.module-stat-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
}

.progress-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-group-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 2px;
}

.text-danger-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 0;
  opacity: 0.7;
  min-height: auto;
  width: auto;
}

@media (max-height: 760px) {
  .answer-button {
    font-size: 1.1rem;
  }

  .practice-stimulus {
    padding: 12px;
    gap: 8px;
  }

  .practice-stats-inline {
    font-size: 0.7rem;
  }

  .hint-pill {
    min-height: 36px;
    padding: 8px 10px;
  }

  .hint-pager__main,
  .hint-pager__plus {
    min-height: 52px;
  }

  .hint-pager__single-line {
    font-size: 0.82rem;
  }
}

.study-card--number {
  gap: 14px;
}

.study-number-hero {
  font-size: clamp(2.1rem, 9vw, 3.2rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: #fff;
}

.study-card--tens,
.study-card--rule {
  gap: 10px;
}

.study-mapping-line {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.study-rule-line {
  color: var(--text-soft);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
}

@media (max-width: 360px) {
  .study-rule-line {
    font-size: 0.9rem;
  }
}


@media (max-width: 420px) {
  .grid-2--stack-mobile {
    grid-template-columns: 1fr;
  }
}


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

.study-day-title {
  text-align: center;
}

.study-number-top {
  align-items: flex-start;
}

.study-number-corner {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.study-mapping-line--center {
  text-align: center;
}

.study-rule-line--light {
  color: #d7d5e5;
}

.image-modal {
  width: 100%;
  max-width: var(--content-max);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop--image {
  z-index: 55;
  align-items: center;
  padding: 0;
  background: rgba(4, 3, 8, 0.94);
}

.image-modal__img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.image-modal__close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 10, 18, 0.78);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  z-index: 2;
}
