:root {
  color-scheme: light;
  --canvas: oklch(0.975 0.008 84);
  --surface: oklch(0.995 0.004 84);
  --surface-muted: oklch(0.955 0.012 286);
  --surface-strong: oklch(0.925 0.022 286);
  --ink: oklch(0.25 0.03 286);
  --ink-soft: oklch(0.4 0.025 286);
  --muted: oklch(0.52 0.025 286);
  --faint: oklch(0.68 0.02 286);
  --border: oklch(0.89 0.018 286);
  --border-strong: oklch(0.81 0.03 286);
  --primary: oklch(0.49 0.19 286);
  --primary-hover: oklch(0.43 0.19 286);
  --primary-soft: oklch(0.93 0.045 286);
  --current: oklch(0.69 0.16 38);
  --current-soft: oklch(0.95 0.035 38);
  --success: oklch(0.62 0.13 155);
  --success-soft: oklch(0.95 0.035 155);
  --danger: oklch(0.58 0.18 25);
  --shadow: 0 18px 50px oklch(0.28 0.035 286 / 0.08);
  --shadow-small: 0 8px 24px oklch(0.28 0.035 286 / 0.07);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --sidebar-width: 232px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid oklch(0.68 0.15 286 / 0.48);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 30px 18px 22px;
  border-right: 1px solid var(--border);
  background: oklch(0.985 0.009 286);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 30px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -0.045em;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  color: oklch(0.98 0.01 286);
  background: var(--primary);
  transform: rotate(-4deg);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
  stroke-width: 2.2;
}

.brand-dot {
  color: var(--current);
}

.main-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 600;
  text-align: left;
  transition: color 180ms var(--ease), background-color 180ms var(--ease), transform 180ms var(--ease);
}

.nav-item:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.nav-item:active {
  transform: scale(0.985);
}

.nav-item.is-active {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-item svg {
  width: 19px;
  height: 19px;
}

.sidebar-note {
  margin: auto 4px 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.note-icon {
  display: grid;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 10px;
  color: var(--current);
  background: var(--current-soft);
}

.note-icon svg {
  width: 17px;
  height: 17px;
}

.sidebar-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.sidebar-note strong {
  color: var(--ink);
  font-size: 13px;
}

.sidebar-settings {
  width: 100%;
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  display: flex;
  height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 54px);
  border-bottom: 1px solid var(--border);
  background: oklch(0.975 0.008 84 / 0.94);
}

.today-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.profile {
  display: flex;
  align-items: center;
  gap: 11px;
}

.profile-copy {
  display: grid;
  text-align: right;
}

.profile-copy strong {
  font-size: 13px;
}

.profile-copy span {
  color: var(--muted);
  font-size: 11px;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 750;
}

.mobile-menu {
  display: none;
}

.view {
  display: none;
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 42px clamp(24px, 4vw, 54px) 64px;
}

.view.is-visible {
  display: block;
  animation: view-in 220ms var(--ease) both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.page-heading h1 {
  max-width: 680px;
  margin: 4px 0 7px;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.page-heading p:not(.eyebrow) {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.cycle-picker {
  flex: 0 0 236px;
}

.cycle-picker label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  min-height: 44px;
  padding: 0 42px 0 14px;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: 0;
  background: var(--surface);
  font-weight: 650;
}

.select-wrap svg {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

.select-wrap select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(0.68 0.15 286 / 0.19);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(285px, .8fr);
  gap: 26px;
  align-items: start;
}

.study-column,
.progress-column {
  display: grid;
  gap: 26px;
}

.focus-panel,
.week-panel {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.focus-panel {
  overflow: hidden;
}

.focus-topline {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}

.status-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.status-label > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--current);
  box-shadow: 0 0 0 4px var(--current-soft);
}

.text-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.text-button:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.text-button svg {
  width: 15px;
  height: 15px;
}

.focus-content {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  min-height: 274px;
  padding: 30px 34px 28px;
}

.timer-wrap {
  position: relative;
  width: 168px;
  height: 168px;
  margin-inline: auto;
}

.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring circle {
  fill: none;
  stroke-width: 8;
}

.timer-track {
  stroke: var(--surface-strong);
}

.timer-progress {
  stroke: var(--primary);
  stroke-dasharray: 383.27;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 500ms linear;
}

.timer-time {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.timer-time strong {
  font-size: 31px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.timer-time span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.subject-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.subject-kicker > span {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--subject-color, var(--current));
}

.session-copy h2 {
  margin: 0 0 5px;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.session-copy > p {
  margin: 0;
  color: var(--muted);
}

.timer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
}

.session-progress-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
}

.session-progress-note > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.session-progress-note > span.has-progress {
  color: var(--success);
  font-weight: 650;
}

.session-progress-note svg {
  width: 14px;
  height: 14px;
}

.time-correction-panel {
  margin-top: 13px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-muted);
}

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

.time-correction-panel > div:first-child {
  display: grid;
  gap: 2px;
}

.time-correction-panel strong {
  font-size: 12px;
}

.time-correction-panel span {
  color: var(--muted);
  font-size: 10px;
}

.correction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.correction-actions .button {
  min-height: 38px;
  padding-inline: 11px;
  font-size: 11px;
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.button {
  gap: 8px;
  padding: 0 16px;
}

.button svg {
  width: 17px;
  height: 17px;
}

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

.button:disabled,
.icon-button:disabled {
  color: var(--faint);
  border-color: var(--border);
  background: var(--surface-muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.button:active,
.icon-button:active {
  transform: translateY(0) scale(.98);
}

.button-primary {
  color: oklch(0.98 0.008 286);
  background: var(--primary);
  box-shadow: 0 7px 17px oklch(0.49 0.19 286 / .2);
}

.button-primary:hover {
  background: var(--primary-hover);
}

.button-secondary {
  border: 1px solid var(--border);
  background: var(--surface);
}

.button-secondary:hover,
.button-ghost:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.button-ghost {
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
}

.icon-button {
  width: 44px;
  padding: 0;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
}

.button-play {
  min-width: 158px;
}

.button-play.is-running {
  color: var(--primary);
  border: 1px solid oklch(0.78 0.07 286);
  background: var(--primary-soft);
  box-shadow: none;
}

.focus-footer {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 30px;
  padding: 0 24px;
  border-top: 1px solid var(--border);
  background: oklch(0.975 0.008 84);
  color: var(--muted);
  font-size: 11px;
}

.focus-footer > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.focus-footer svg {
  width: 15px;
  height: 15px;
}

.queue-section {
  padding: 4px 2px 0;
}

.section-heading,
.section-heading > div {
  display: flex;
  align-items: center;
}

.section-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}

.section-heading > div {
  gap: 11px;
}

.section-heading h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.section-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.section-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--primary);
  background: var(--surface);
  font-size: 10px;
  font-weight: 800;
}

.queue-count {
  color: var(--muted);
  font-size: 11px;
}

.subject-queue {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
}

.queue-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto 34px;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  transition: background-color 160ms var(--ease);
}

.queue-row:last-child {
  border-bottom: 0;
}

.queue-row:hover {
  background: oklch(0.98 0.009 286);
}

.queue-order {
  color: var(--faint);
  font-size: 11px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.queue-subject {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.subject-color {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--row-color, var(--primary));
}

.queue-subject div {
  min-width: 0;
}

.queue-subject strong,
.queue-subject span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-subject strong {
  font-size: 13px;
}

.queue-subject span,
.queue-meta {
  color: var(--muted);
  font-size: 11px;
}

.queue-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.queue-meta svg {
  width: 14px;
  height: 14px;
}

.queue-row .icon-button {
  width: 32px;
  min-height: 32px;
  border: 0;
  background: transparent;
}

.queue-row .icon-button svg {
  width: 16px;
  height: 16px;
}

.week-panel {
  padding: 22px;
}

.section-heading.compact {
  margin-bottom: 22px;
}

.progress-percent {
  color: var(--primary);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.week-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-strong);
}

.week-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 500ms var(--ease);
}

.progress-caption {
  margin: 9px 0 22px;
  color: var(--muted);
  font-size: 11px;
}

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.week-day {
  appearance: none;
  display: grid;
  gap: 7px;
  justify-items: center;
  min-width: 0;
  min-height: 52px;
  padding: 4px 0 5px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--faint);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
  transition: color 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}

.week-day:hover {
  color: var(--ink-soft);
  background: var(--surface-muted);
}

.week-day:active {
  transform: translateY(1px);
}

.week-day:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.week-day span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 10px;
}

.week-day span svg {
  width: 14px;
  height: 14px;
}

.week-day.is-complete span {
  color: oklch(0.98 0.01 155);
  background: var(--success);
}

.week-day.is-today span {
  color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  background: var(--primary-soft);
}

.week-day.is-selected {
  border-color: var(--border);
  background: var(--surface);
}

.week-day.is-complete.is-selected {
  border-color: oklch(0.79 0.06 155);
  background: var(--success-soft);
}

.week-day.is-complete.is-today span {
  color: oklch(0.98 0.01 155);
  outline-color: var(--primary);
  background: var(--success);
}

.day-study-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.day-study-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.day-study-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: capitalize;
}

.day-study-heading strong {
  color: var(--success);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.day-study-breakdown {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.day-study-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  color: var(--ink-soft);
  font-size: 11px;
}

.day-study-row strong {
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.day-study-subject {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.day-study-subject > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--subject-color);
}

.day-study-note,
.day-study-empty {
  margin: 0;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 10px;
  line-height: 1.45;
}

.day-study-note {
  color: oklch(0.4 0.065 155);
  background: var(--success-soft);
}

.week-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 24px 0 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.week-facts > div {
  display: grid;
  gap: 2px;
  padding: 17px 6px;
}

.week-facts > div + div {
  border-left: 1px solid var(--border);
  padding-left: 18px;
}

.week-facts strong {
  font-size: 17px;
}

.week-facts span {
  color: var(--muted);
  font-size: 10px;
}

.encouragement {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  color: var(--ink-soft);
  background: var(--current-soft);
  font-size: 11px;
}

.encouragement svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--current);
}

.new-cycle-cta {
  display: grid;
  grid-template-columns: 42px 1fr 20px;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 17px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease), transform 180ms var(--ease);
}

.new-cycle-cta:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.new-cycle-cta > span:first-child {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: var(--primary);
  background: var(--surface);
}

.new-cycle-cta strong,
.new-cycle-cta small {
  display: block;
}

.new-cycle-cta strong {
  font-size: 13px;
}

.new-cycle-cta small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.new-cycle-cta .cta-chevron {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.manage-heading {
  align-items: center;
}

.cycles-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.cycle-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto auto;
  gap: 16px;
  align-items: center;
  min-height: 86px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.cycle-row:last-child {
  border-bottom: 0;
}

.cycle-row-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  color: var(--primary);
  background: var(--primary-soft);
}

.cycle-row-mark svg {
  width: 20px;
  height: 20px;
}

.cycle-row-copy strong,
.cycle-row-copy span {
  display: block;
}

.cycle-row-copy strong {
  font-size: 15px;
}

.cycle-row-copy span,
.cycle-row-stat span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.cycle-row-stat {
  display: grid;
  min-width: 84px;
}

.cycle-row-stat strong {
  font-size: 13px;
}

.active-badge {
  padding: 6px 9px;
  border-radius: 9px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.row-actions .icon-button {
  width: 38px;
  min-height: 38px;
}

.empty-cycles {
  padding: 70px 20px;
  text-align: center;
}

.empty-cycles p {
  color: var(--muted);
}

.editor-shell {
  max-width: 980px;
  margin: 0 auto;
}

.editor-heading {
  align-items: center;
}

#cycle-form {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-section {
  padding: 30px;
  border-bottom: 1px solid var(--border);
}

.form-section-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}

.form-section-title > span {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 10px;
  font-weight: 800;
}

.form-section-title h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.form-section-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

.field > span {
  font-size: 12px;
  font-weight: 700;
}

.field em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
}

.field input,
.subject-form-row input,
.subject-form-row select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: 0;
  background: var(--surface);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.field input {
  padding: 0 13px;
}

input::placeholder {
  color: var(--faint);
}

.field input:focus,
.subject-form-row input:focus,
.subject-form-row select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(0.68 0.15 286 / .18);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 11px;
}

.day-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.day-presets button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
}

.day-presets button:hover {
  color: var(--primary);
  border-color: oklch(0.78 0.07 286);
  background: var(--primary-soft);
}

.day-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(68px, 1fr));
  gap: 8px;
}

.day-chip {
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
}

.day-chip:hover {
  border-color: var(--border-strong);
}

.day-chip[aria-pressed="true"] {
  color: var(--primary);
  border-color: oklch(0.78 0.07 286);
  background: var(--primary-soft);
}

.subjects-title {
  align-items: center;
}

.subjects-title > div {
  flex: 1;
}

.subject-table-head,
.subject-form-row {
  display: grid;
  grid-template-columns: 72px minmax(180px, 1fr) 122px 150px 42px;
  gap: 10px;
  align-items: center;
}

.subject-table-head {
  padding: 0 8px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.subject-form-list {
  display: grid;
  gap: 8px;
}

.subject-form-row {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: oklch(0.99 0.005 84);
}

.subject-order-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}

.subject-order-controls > span {
  width: 24px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.mini-control {
  display: grid;
  width: 24px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
}

.mini-control:hover:not(:disabled) {
  color: var(--primary);
  background: var(--primary-soft);
}

.mini-control:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.mini-control svg {
  width: 14px;
  height: 14px;
}

.subject-name-input {
  position: relative;
}

.subject-name-input span {
  position: absolute;
  top: 18px;
  left: 12px;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--input-color);
}

.subject-name-input input {
  padding: 0 10px 0 30px;
}

.subject-form-row select {
  padding: 0 32px 0 10px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 20px, calc(100% - 12px) 20px;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
  font-size: 12px;
}

.frequency-control {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  height: 46px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
}

.frequency-control button {
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 17px;
}

.frequency-control button:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.frequency-control span {
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.remove-subject {
  width: 38px;
  min-height: 38px;
  border: 0;
  color: var(--muted);
  background: transparent;
}

.remove-subject:hover {
  color: var(--danger);
  background: oklch(0.95 0.035 25);
}

.form-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 30px;
  background: oklch(0.965 0.013 286);
}

.form-summary > div,
.form-summary p {
  display: flex;
  align-items: center;
}

.form-summary > div {
  gap: 11px;
}

.form-summary p {
  margin: 0;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.form-summary p strong {
  font-size: 13px;
}

.form-summary p span {
  color: var(--muted);
  font-size: 11px;
}

.summary-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: var(--primary);
  background: var(--surface);
}

.summary-mark svg {
  width: 18px;
  height: 18px;
}

.empty-feature {
  display: grid;
  max-width: 560px;
  min-height: 540px;
  margin: 0 auto;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.empty-feature > span {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 18px;
  color: var(--primary);
  background: var(--primary-soft);
}

.empty-feature > span svg {
  width: 28px;
  height: 28px;
}

.empty-feature h1 {
  margin: 7px 0;
  font-size: 28px;
  letter-spacing: -.035em;
}

.empty-feature > p:not(.eyebrow) {
  max-width: 54ch;
  margin: 0 0 22px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(360px, calc(100vw - 32px));
  min-height: 48px;
  padding: 10px 15px;
  border: 1px solid oklch(0.81 0.05 155);
  border-radius: 13px;
  color: oklch(0.37 0.09 155);
  background: var(--success-soft);
  box-shadow: var(--shadow-small);
  font-size: 12px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast svg {
  width: 17px;
  height: 17px;
}

@media (max-width: 1050px) {
  .focus-content {
    grid-template-columns: 155px minmax(0, 1fr);
    padding-inline: 24px;
  }

  .timer-wrap {
    width: 145px;
    height: 145px;
  }

  .timer-time strong {
    font-size: 27px;
  }

  .queue-row {
    grid-template-columns: 30px minmax(0, 1fr) auto 32px;
  }

  .queue-row .queue-frequency {
    display: none;
  }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 78px; }

  .sidebar {
    align-items: center;
    padding-inline: 12px;
  }

  .brand {
    padding-inline: 0;
  }

  .brand > span:last-child,
  .nav-item span,
  .sidebar-note,
  .sidebar-settings span {
    display: none;
  }

  .main-nav,
  .sidebar-settings {
    width: 100%;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .progress-column {
    grid-template-columns: minmax(0, 1fr) minmax(240px, .65fr);
  }

  .subject-table-head,
  .subject-form-row {
    grid-template-columns: 64px minmax(170px, 1fr) 112px 140px 42px;
  }

  .subjects-form-section {
    overflow-x: auto;
  }

  .subject-table-head,
  .subject-form-list {
    min-width: 700px;
  }
}

@media (max-width: 680px) {
  body {
    padding-bottom: 70px;
  }

  .sidebar {
    inset: auto 0 0;
    z-index: 40;
    width: auto;
    height: 68px;
    flex-direction: row;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    border-right: 0;
    background: oklch(0.99 0.006 286 / .97);
  }

  .brand,
  .sidebar-settings {
    display: none;
  }

  .main-nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .nav-item {
    min-width: 72px;
    height: 50px;
    min-height: 50px;
    flex-direction: column;
    gap: 2px;
    border-radius: 11px;
    font-size: 9px;
  }

  .nav-item span {
    display: inline;
  }

  .nav-item svg {
    width: 17px;
    height: 17px;
  }

  .main-content {
    margin-left: 0;
  }

  .topbar {
    height: 62px;
    padding: 0 17px;
  }

  .today-label {
    font-size: 10px;
  }

  .profile-copy,
  .mobile-menu {
    display: none;
  }

  .avatar {
    width: 34px;
    height: 34px;
  }

  .view {
    padding: 28px 16px 46px;
  }

  .page-heading,
  .dashboard-heading,
  .manage-heading,
  .editor-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 25px;
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .cycle-picker {
    flex-basis: auto;
  }

  .focus-content {
    grid-template-columns: 1fr;
    gap: 17px;
    padding: 24px 20px 26px;
    text-align: center;
  }

  .timer-wrap {
    width: 154px;
    height: 154px;
  }

  .subject-kicker,
  .timer-actions {
    justify-content: center;
  }

  .session-copy h2 {
    font-size: 25px;
  }

  .timer-actions .button-play {
    flex: 1 1 100%;
  }

  .timer-actions .button-secondary {
    flex: 1;
  }

  .session-progress-note {
    align-items: stretch;
    flex-direction: column;
  }

  .session-progress-note > span,
  .session-progress-note .text-button {
    justify-content: center;
  }

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

  .correction-actions .button {
    width: 100%;
  }

  .focus-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    padding: 13px 20px;
  }

  .progress-column {
    grid-template-columns: 1fr;
  }

  .queue-row {
    grid-template-columns: 26px minmax(0, 1fr) auto 32px;
    gap: 8px;
    padding-inline: 11px;
  }

  .queue-duration {
    display: none;
  }

  .two-columns {
    grid-template-columns: 1fr;
  }

  .form-section {
    padding: 24px 18px;
  }

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

  .subjects-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .subjects-title .button {
    width: 100%;
    margin-top: 4px;
  }

  .form-summary {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .form-summary .button {
    width: 100%;
  }

  .cycle-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
    padding-inline: 13px;
  }

  .cycle-row-stat,
  .active-badge {
    display: none;
  }

  .focus-topline {
    padding-inline: 17px;
  }

  .toast {
    right: 16px;
    bottom: 84px;
  }
}

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