/* ============ Orbit ============ */
:root {
  --bg: #0e0b1f;
  --bg-2: #151130;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-solid: #1a1638;
  --panel-hover: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eeeaff;
  --muted: #9d97c2;
  --faint: #6c6693;
  --accent: #8b6cff;
  --accent-2: #ff6b8b;
  --accent-3: #1fc8a9;
  --good: #34d399;
  --warn: #ffb020;
  --bad: #ff5d73;
  --critical: #ff5d73;
  --high: #ff9f43;
  --steady: #8b6cff;
  --chill: #1fc8a9;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #f5f3ff;
  --bg-2: #ebe7ff;
  --panel: rgba(255, 255, 255, 0.75);
  --panel-solid: #ffffff;
  --panel-hover: rgba(124, 92, 255, 0.07);
  --line: rgba(40, 20, 120, 0.1);
  --text: #1c1640;
  --muted: #625c8a;
  --faint: #9a95ba;
  --accent: #6d4dff;
  --shadow: 0 10px 30px rgba(60, 40, 160, 0.12);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']):not([data-theme='light']) {
    --bg: #f5f3ff;
    --bg-2: #ebe7ff;
    --panel: rgba(255, 255, 255, 0.75);
    --panel-solid: #ffffff;
    --panel-hover: rgba(124, 92, 255, 0.07);
    --line: rgba(40, 20, 120, 0.1);
    --text: #1c1640;
    --muted: #625c8a;
    --faint: #9a95ba;
    --accent: #6d4dff;
    --shadow: 0 10px 30px rgba(60, 40, 160, 0.12);
    color-scheme: light;
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  background: radial-gradient(1200px 600px at 85% -10%, rgba(139, 108, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255, 107, 139, 0.12), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: var(--accent);
}
h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.small {
  font-size: 0.85em;
}
.hidden {
  display: none !important;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row.wrap {
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--panel-hover);
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 20px rgba(139, 108, 255, 0.35);
}
.btn.danger {
  color: var(--bad);
  border-color: rgba(255, 93, 115, 0.35);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.sm {
  padding: 5px 11px;
  font-size: 0.85em;
}
.btn.icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field > span {
  font-size: 0.82em;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.input,
input[type='text'],
input[type='password'],
input[type='number'],
input[type='datetime-local'],
input[type='time'],
input[type='search'],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-2);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 108, 255, 0.2);
}
textarea {
  resize: vertical;
  min-height: 70px;
}
input[type='color'] {
  width: 44px;
  height: 36px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.check {
  appearance: none;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--faint);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
  background: transparent;
}
.check:hover {
  border-color: var(--accent);
}
.check:checked {
  background: var(--grad);
  border-color: transparent;
}
.check:checked::after {
  content: '✓';
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.check.sq {
  border-radius: 6px;
  width: 18px;
  height: 18px;
}
.check.sq:checked::after {
  font-size: 11px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--panel-hover);
  color: var(--muted);
  white-space: nowrap;
}
.chip.critical,
.chip.overdue {
  background: rgba(255, 93, 115, 0.15);
  color: color-mix(in srgb, var(--critical) 50%, var(--text));
}
.chip.high {
  background: rgba(255, 159, 67, 0.15);
  color: color-mix(in srgb, var(--high) 45%, var(--text));
}
.chip.steady {
  background: rgba(139, 108, 255, 0.15);
  color: color-mix(in srgb, var(--steady) 60%, var(--text));
}
.chip.chill {
  background: rgba(31, 200, 169, 0.15);
  color: color-mix(in srgb, var(--chill) 45%, var(--text));
}
.chip.cls {
  color: #fff;
}
.seg {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.seg {
  max-width: 100%;
  overflow-x: auto;
}
.seg button {
  white-space: nowrap;
  border: 0;
  background: transparent;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88em;
  color: var(--muted);
}
.seg button.on {
  background: var(--grad);
  color: #fff;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card h3 {
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.empty {
  text-align: center;
  padding: 26px 10px;
  color: var(--muted);
}
.empty .big {
  font-size: 2em;
  margin-bottom: 6px;
}

/* ---------- auth ---------- */
.auth {
  display: grid;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 30px 28px;
  box-shadow: var(--shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand .logo {
  width: 42px;
  height: 42px;
  flex: none;
}
.brand h1 {
  font-size: 1.7em;
  letter-spacing: -0.02em;
}
.orbit-hero {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 4px auto 18px;
}
.orbit-hero .core {
  position: absolute;
  inset: 55px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 40px rgba(139, 108, 255, 0.6);
}
.orbit-hero .ring {
  position: absolute;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  animation: spin linear infinite;
}
.orbit-hero .ring::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  top: -5px;
  left: calc(50% - 5px);
  background: var(--accent-3);
  box-shadow: 0 0 12px var(--accent-3);
}
.orbit-hero .r1 {
  inset: 30px;
  animation-duration: 6s;
}
.orbit-hero .r2 {
  inset: 10px;
  animation-duration: 11s;
  animation-direction: reverse;
}
.orbit-hero .r2::after {
  background: var(--accent-2);
  box-shadow: 0 0 12px var(--accent-2);
}
.orbit-hero .r3 {
  inset: -8px;
  animation-duration: 19s;
}
.orbit-hero .r3::after {
  background: var(--warn);
  box-shadow: 0 0 12px var(--warn);
  width: 7px;
  height: 7px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
.tabs {
  display: flex;
  gap: 4px;
  margin: 18px 0;
}
.tabs button {
  flex: 1;
}
.error {
  color: var(--bad);
  font-size: 0.88em;
  min-height: 1.2em;
}
.meter {
  height: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.meter > div {
  height: 100%;
  border-radius: 99px;
  transition: width 0.25s, background 0.25s;
}
.account-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.account-chips button {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 0.85em;
}
.security-note {
  display: flex;
  gap: 10px;
  font-size: 0.8em;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 6px;
}
.recovery-code {
  font: 700 1.25em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px dashed var(--accent);
  user-select: all;
  word-break: break-all;
}

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.08);
}
.sidebar .brand {
  padding: 0 8px 20px;
}
.sidebar .brand .brand-name {
  font-size: 1.35em;
  font-weight: 800;
  line-height: 1.2;
}
.sidebar .brand .logo {
  width: 34px;
  height: 34px;
}
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  width: 100%;
}
.nav-btn .ico {
  width: 22px;
  text-align: center;
  font-size: 1.05em;
}
.nav-btn .kbd {
  margin-left: auto;
  font-size: 0.7em;
  opacity: 0.5;
}
.nav-btn:hover {
  background: var(--panel-hover);
  color: var(--text);
}
.nav-btn.on {
  background: var(--panel-hover);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}
.sidebar .foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  font-size: 0.8em;
}
.save-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
}
.save-state .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good);
}
.save-state.saving .dot {
  background: var(--warn);
}

.main {
  padding: 22px 28px 60px;
  min-width: 0;
}
.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}
.quick {
  flex: 1;
  position: relative;
}
.quick input {
  padding: 12px 14px 12px 42px;
  border-radius: 14px;
  background: var(--panel);
  font-size: 1em;
}
.quick .plus {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.3em;
}
.quick-preview {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.88em;
}
.quick-preview .hint {
  width: 100%;
  color: var(--faint);
  font-size: 0.9em;
}
.page-title {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-title h2 {
  font-size: 1.7em;
  letter-spacing: -0.02em;
}

.mobile-nav {
  display: none;
}

/* ---------- launchpad ---------- */
.hero {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.hero h2 {
  font-size: 2em;
  letter-spacing: -0.03em;
}
.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.stat {
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  min-width: 96px;
}
.stat b {
  display: block;
  font-size: 1.45em;
  letter-spacing: -0.02em;
}
.stat span {
  font-size: 0.75em;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dash {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
}
.dash .wide {
  grid-column: 1 / -1;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: background 0.12s;
}
.item-row:hover {
  background: var(--panel-hover);
}
.item-row .bar {
  width: 4px;
  align-self: stretch;
  border-radius: 4px;
  flex: none;
}
.item-row .body {
  flex: 1;
  min-width: 0;
}
.item-row .title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-row.done .title {
  text-decoration: line-through;
  color: var(--faint);
}
.item-row .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.8em;
  color: var(--muted);
  margin-top: 2px;
}
.item-row .right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.8em;
  color: var(--muted);
  flex: none;
}
.progress {
  height: 4px;
  width: 60px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.progress > div {
  height: 100%;
  background: var(--grad);
}

.mission {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mission-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s;
}
.mission-item:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}
.mission-item .rank {
  font-size: 1.6em;
  font-weight: 800;
  width: 28px;
  text-align: center;
}
.mission-item .body {
  flex: 1;
  min-width: 0;
}
.mission-item .title {
  font-weight: 700;
}

.timeline {
  position: relative;
  padding-left: 18px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}
.tl-item {
  position: relative;
  padding: 7px 0 7px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--tl-color, var(--accent));
  box-shadow: 0 0 0 3px var(--bg);
}
.tl-item .time {
  font-size: 0.8em;
  color: var(--muted);
  width: 62px;
  flex: none;
  font-variant-numeric: tabular-nums;
}
.tl-item .what {
  flex: 1;
  min-width: 0;
}
.tl-item .what b {
  font-weight: 600;
}
.tl-item.now::before {
  background: var(--accent-2);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 3px var(--bg), 0 0 0 7px rgba(255, 107, 139, 0.25);
  }
}

/* load forecast */
.forecast {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 6px;
  align-items: end;
  height: 150px;
}
.fc-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  cursor: pointer;
}
.fc-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 8px 8px 4px 4px;
  min-height: 4px;
  position: relative;
  transition: height 0.4s;
}
.fc-bar .dl {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--accent-2);
}
.fc-lbl {
  font-size: 0.68em;
  color: var(--muted);
  text-align: center;
  line-height: 1.15;
}
.fc-lbl.today {
  color: var(--text);
  font-weight: 700;
}
.fc-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.78em;
  color: var(--muted);
  margin-top: 12px;
}
.fc-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}

.streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

/* ---------- horizon ---------- */
.horizon {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}
.hz-grid {
  display: grid;
  min-width: max-content;
}
.hz-head,
.hz-cell,
.hz-lane {
  border-bottom: 1px solid var(--line);
}
.hz-lane {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--panel-solid);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88em;
  border-right: 1px solid var(--line);
  min-height: 64px;
}
.hz-lane .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}
.hz-head {
  padding: 8px 4px;
  text-align: center;
  font-size: 0.75em;
  color: var(--muted);
  position: sticky;
  top: 0;
}
.hz-head b {
  display: block;
  font-size: 1.35em;
  color: var(--text);
}
.hz-head.today b {
  background: var(--grad);
  color: #fff;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  line-height: 30px;
  margin: 0 auto;
}
.hz-head.weekend,
.hz-cell.weekend {
  background: rgba(0, 0, 0, 0.08);
}
.hz-cell {
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px dashed var(--line);
  min-height: 64px;
}
.hz-pill {
  font-size: 0.72em;
  line-height: 1.2;
  padding: 5px 6px;
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 600;
}
.hz-pill.done {
  opacity: 0.4;
  text-decoration: line-through;
}
.hz-pill.session {
  background: transparent !important;
  border: 1.5px dashed currentColor;
  font-weight: 500;
}
.hz-load {
  height: 6px;
  margin: 0 6px 6px;
  border-radius: 99px;
}

/* ---------- month ---------- */
.month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.month .dow {
  text-align: center;
  font-size: 0.75em;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 4px;
}
.mday {
  min-height: 104px;
  border-radius: 12px;
  padding: 7px;
  border: 1px solid var(--line);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
}
.mday:hover {
  border-color: var(--accent);
}
.mday.out {
  opacity: 0.35;
}
.mday.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(139, 108, 255, 0.35);
}
.mday .n {
  font-weight: 700;
  font-size: 0.9em;
}
.mday.today .n {
  background: var(--grad);
  color: #fff;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
}
.mday .ev {
  font-size: 0.7em;
  padding: 2px 5px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  font-weight: 600;
}
.mday .ev.done {
  opacity: 0.4;
  text-decoration: line-through;
}
.mday .more {
  font-size: 0.7em;
  color: var(--muted);
}
.mday .heat {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.month-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

/* ---------- tasks ---------- */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.filters select,
.filters input {
  width: auto;
  min-width: 140px;
  padding: 7px 10px;
}
.group-h {
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 16px 12px 4px;
  font-weight: 700;
}

/* ---------- classes ---------- */
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.class-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s;
}
.class-card:hover {
  transform: translateY(-2px);
}
.class-card .band {
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
}
.class-card .code {
  font-size: 0.75em;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.class-card h4,
.class-card h3.class-name {
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  display: block;
  font-size: 1.2em;
  margin: 2px 0 8px;
}
.grade-ring {
  width: 64px;
  height: 64px;
  flex: none;
}
.grade-ring text {
  font-weight: 800;
  fill: var(--text);
}
.week-sched {
  display: grid;
  grid-template-columns: 50px repeat(5, 1fr);
  position: relative;
  font-size: 0.75em;
}
.ws-col {
  position: relative;
  border-left: 1px solid var(--line);
  height: 480px;
}
.ws-hours {
  position: relative;
  height: 480px;
}
.ws-hours span {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  color: var(--faint);
}
.ws-block {
  position: absolute;
  left: 3px;
  right: 3px;
  border-radius: 7px;
  padding: 4px 6px;
  color: #fff;
  font-weight: 600;
  overflow: hidden;
  cursor: pointer;
}
.ws-head {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  padding-bottom: 6px;
}
.meeting-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

/* ---------- focus ---------- */
.focus-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}
.focus-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 30px 18px;
}
.timer {
  position: relative;
  width: min(320px, 78vw);
  aspect-ratio: 1;
}
.timer svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.timer .track {
  stroke: var(--line);
}
.timer .prog {
  transition: stroke-dashoffset 0.9s linear;
}
.timer .readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.timer .readout b {
  font-size: clamp(2.6em, 11vw, 4.2em);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.timer .satellite {
  position: absolute;
  inset: 6.25%;
  animation: spin 60s linear infinite;
  animation-play-state: paused;
}
.timer.running .satellite {
  animation-play-state: running;
}
.timer .satellite::after {
  content: '';
  position: absolute;
  top: -6px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 16px var(--accent-3);
}
.pips {
  display: flex;
  gap: 6px;
}
.pips i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}
.pips i.on {
  background: var(--grad);
}

/* ---------- modal ---------- */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(8, 5, 20, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  animation: fade 0.15s;
}
.modal-back.center {
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.modal {
  background: var(--panel-solid);
  width: min(520px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: slide 0.2s ease-out;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-back.center .modal {
  height: auto;
  max-height: 90vh;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  animation: pop 0.18s ease-out;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-head h3 {
  font-size: 1.25em;
  flex: 1;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes slide {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}
@keyframes pop {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
}
.section-h {
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 700;
  margin-top: 6px;
}
.subtask {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 0;
}
.subtask input[type='text'] {
  padding: 6px 8px;
  background: transparent;
  border-color: transparent;
}
.subtask input[type='text']:focus {
  background: var(--bg-2);
}
.subtask.done input[type='text'] {
  text-decoration: line-through;
  color: var(--faint);
}
.session-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--bg-2);
}
.session-row input[type='date'] {
  flex: 1;
  min-width: 0;
}
.session-row.done {
  opacity: 0.55;
}

/* ---------- screenshots ---------- */
.gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: var(--radius-sm);
  transition: box-shadow 0.15s;
}
.gallery.drag {
  box-shadow: 0 0 0 2px var(--accent);
}
.dropzone {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.gallery.drag .dropzone {
  border-color: var(--accent);
}
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.shots.compact {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.shots-empty {
  grid-column: 1 / -1;
}
.shot {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s, border-color 0.15s;
}
.shot:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.shot-img {
  aspect-ratio: 4 / 3;
  background: var(--bg-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.shot-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.shot-missing {
  color: var(--faint);
  font-size: 1.4em;
}
.shot-cap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 0.75em;
  font-weight: 600;
  min-width: 0;
}
.shots.compact .shot-cap {
  display: none;
}
.shot-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}
.modal.wide {
  width: min(980px, 100%);
}
.viewer-frame {
  display: grid;
  place-items: center;
  min-height: 200px;
  max-height: 62vh;
  overflow: auto;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
}
.viewer-img {
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
  cursor: zoom-in;
  display: block;
}
.viewer-img.zoom {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

/* ============ study ============ */
.nav-group {
  font-size: 0.68em;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  font-weight: 800;
  padding: 14px 12px 4px;
}
.nav-group:first-of-type {
  padding-top: 0;
}
.nav-badge {
  margin-left: auto;
  background: var(--grad);
  color: #fff;
  font-size: 0.72em;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 999px;
}
.planner-tabs {
  margin-bottom: 18px;
}
.orbit-bar {
  display: flex;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--line);
  gap: 2px;
}
.orbit-bar.tall {
  height: 14px;
}
.orbit-bar > div {
  min-width: 4px;
}
.ring text {
  fill: var(--text);
}
.review-cta {
  background: linear-gradient(135deg, rgba(139, 108, 255, 0.16), rgba(255, 107, 139, 0.1)), var(--panel);
}
.exam-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.exam-row:last-child {
  border-bottom: 0;
}
.exam-days {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 2px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: none;
  line-height: 1;
}
.exam-days b {
  font-size: 1.4em;
}
.exam-days span {
  font-size: 0.65em;
  color: var(--muted);
  text-transform: uppercase;
}
.create-drop,
.pdf-drop {
  text-align: center;
  border: 2px dashed var(--line);
  transition: border-color 0.15s, background 0.15s;
}
.create-drop.drag,
.pdf-drop.drag {
  border-color: var(--accent);
  background: rgba(139, 108, 255, 0.08);
}
.create-drop .big,
.pdf-drop .big {
  font-size: 2.2em;
}
.pdf-drop {
  padding: 28px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.file-chip {
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--bg-2);
}
.set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.set-grid.big {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.set-tile {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.12s, border-color 0.15s;
}
.set-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.set-tile .band {
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
}
.set-title {
  font-weight: 800;
  font-size: 1.08em;
  line-height: 1.25;
}
.set-header {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
}
.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.mode-tile {
  position: relative;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
}
.mode-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(139, 108, 255, 0.18);
}
.mode-icon {
  font-size: 1.8em;
}
.orbit-legend {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.orbit-count {
  display: flex;
  align-items: center;
  gap: 6px;
}
.orbit-explain {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.card-row.editing {
  flex-direction: column;
  align-items: stretch;
}
.card-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.card-term {
  font-weight: 700;
}
.card-def {
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.orbit-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.btn.starred {
  color: var(--warn);
}
.key-points {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.5;
}
.doc-text {
  white-space: pre-wrap;
  font-size: 0.9em;
  line-height: 1.6;
  max-height: 65vh;
  overflow: auto;
  background: var(--bg-2);
  padding: 16px;
  border-radius: var(--radius-sm);
}
.gen-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 48vh;
  overflow: auto;
  padding-right: 4px;
}
.gen-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
  background: var(--bg-2);
}
.gen-row.off {
  opacity: 0.45;
}
.gen-row textarea {
  min-height: 44px;
  font-size: 0.9em;
}
.week-strip {
  display: flex;
  gap: 6px;
}
.ws-day {
  width: 38px;
  padding: 4px 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.72em;
  color: var(--muted);
}
.ws-day.on {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

.study-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(139, 108, 255, 0.08);
}

/* AP courses */
.res-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.res-row:last-child {
  border-bottom: 0;
}
.course-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}
.course-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  cursor: pointer;
  text-align: left;
  font-weight: 600;
}
.course-opt span:nth-child(2) {
  flex: 1;
}
.course-opt:hover:not(:disabled) {
  border-color: var(--accent);
}
.course-opt:disabled {
  opacity: 0.5;
  cursor: default;
}
.unit-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-2);
  max-height: 40vh;
  overflow: auto;
}
.unit-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}
.unit-num {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  border: 2px solid;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1em;
}
.fmt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}
.fmt-table th {
  text-align: left;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.fmt-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.weight-bar {
  width: 160px;
  height: 8px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.weight-bar > div {
  height: 100%;
  border-radius: 99px;
}
.tips {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  line-height: 1.5;
}
.frq-mini {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-2);
}
.frq-mini > div {
  flex: 1;
}
.bank-q {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.q-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.q-dot {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1.5px dashed var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 0.8em;
  font-weight: 700;
  color: var(--muted);
  position: relative;
}
.q-dot.done {
  border-style: solid;
  background: var(--panel-hover);
  color: var(--text);
}
.q-dot.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(139, 108, 255, 0.3);
}
.q-dot.flag::after {
  content: '⚑';
  position: absolute;
  top: -8px;
  right: -5px;
  font-size: 11px;
  color: var(--high);
}
.choices.one-col {
  grid-template-columns: 1fr;
}
.frq-prompt {
  white-space: pre-wrap;
  line-height: 1.55;
  font-weight: 500;
}
.frq-answer {
  min-height: 260px;
  line-height: 1.55;
}
.frq-box {
  white-space: pre-wrap;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-2);
  font-size: 0.92em;
  line-height: 1.5;
  min-height: 80px;
  max-height: 320px;
  overflow: auto;
}
.frq-box.model {
  background: rgba(52, 211, 153, 0.08);
}
.exam-clock.low {
  color: var(--bad);
}
.ap-score {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ap-score span {
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}
.ap-score b {
  font-size: 5em;
  line-height: 1;
  font-weight: 800;
}

.explain {
  font-size: 0.88em;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(58, 160, 255, 0.08);
  color: var(--muted);
}
.resume-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(255, 176, 32, 0.12);
  border: 1px solid rgba(255, 176, 32, 0.4);
}
.focus-next {
  background: linear-gradient(135deg, rgba(139, 108, 255, 0.12), rgba(31, 200, 169, 0.08)), var(--panel);
}
.trend {
  width: 100%;
  max-width: 560px;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}
.verbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.verb {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-2);
}

.unit-wrap {
  border-radius: var(--radius);
}
.unit-wrap .unit-row {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.topic-panel {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 6px 16px 8px 74px;
  background: var(--panel);
}
.topic-toggle {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
  padding: 2px 0;
}
.topic-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 4px 16px;
  margin-top: 6px;
}
.topic {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.86em;
  padding: 3px 0;
  cursor: pointer;
}
.topic b {
  width: 38px;
  flex: none;
  color: var(--muted);
}
.topic.done span {
  color: var(--faint);
  text-decoration: line-through;
}
@media (max-width: 760px) {
  .unit-row {
    flex-wrap: wrap;
    gap: 10px 14px;
  }
  .unit-row > .row {
    width: 100%;
    justify-content: flex-end;
  }
  .topic-panel {
    padding-left: 16px;
  }
}

/* study session */
.main.focus-mode {
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}
.study-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.study-title {
  font-size: 1.05em;
  font-weight: 400;
  margin: 0;
  letter-spacing: 0;
}
.study-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 780px;
  margin: 0 auto;
}
.study-body.wide {
  max-width: 980px;
}
.study-progress {
  height: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.study-progress > div {
  height: 100%;
  background: var(--grad);
  transition: width 0.3s;
}
.flip {
  perspective: 1600px;
  height: 360px;
  cursor: pointer;
}
.flip-inner {
  position: relative;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.3, 1);
  transform-style: preserve-3d;
}
.flip.flipped .flip-inner {
  transform: rotateX(180deg);
}
.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}
.face.back {
  transform: rotateX(180deg);
  background: linear-gradient(135deg, rgba(139, 108, 255, 0.12), rgba(255, 107, 139, 0.08)), var(--panel-solid);
}
.face-label {
  position: absolute;
  top: 16px;
  left: 20px;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  font-weight: 700;
}
.face-text {
  font-size: 1.6em;
  font-weight: 600;
  line-height: 1.35;
  max-height: 100%;
  overflow: auto;
}
.btn.big-btn {
  padding: 13px 26px;
  font-size: 1.02em;
}
.btn.learning {
  color: var(--high);
  border-color: rgba(255, 159, 67, 0.4);
}
.btn.know {
  color: var(--good);
  border-color: rgba(52, 211, 153, 0.4);
}
.learn-stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stage {
  text-align: center;
  padding: 8px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.stage b {
  font-size: 1.4em;
}
.card.question {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.q-text {
  font-size: 1.45em;
  font-weight: 600;
  line-height: 1.4;
}
.q-text.small-q {
  font-size: 1.15em;
}
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.choice {
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--bg-2);
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.4;
  transition: border-color 0.12s, background 0.12s;
}
.choice:hover:not(:disabled) {
  border-color: var(--accent);
}
.choice .key {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.75em;
  color: var(--muted);
}
.choice.picked {
  border-color: var(--accent);
  background: rgba(139, 108, 255, 0.12);
}
.choice.right {
  border-color: var(--good);
  background: rgba(52, 211, 153, 0.12);
}
.choice.wrong {
  border-color: var(--bad);
  background: rgba(255, 93, 115, 0.12);
}
.choice.tf {
  flex: 1;
  justify-content: center;
  font-weight: 700;
}
.answer-input {
  font-size: 1.15em;
  padding: 14px 16px !important;
}
.feedback {
  border-radius: 14px;
  padding: 16px 18px;
  border: 1.5px solid;
}
.feedback.ok {
  border-color: var(--good);
  background: rgba(52, 211, 153, 0.1);
}
.feedback.bad {
  border-color: var(--bad);
  background: rgba(255, 93, 115, 0.08);
}
.fb-head {
  font-weight: 800;
  font-size: 1.1em;
  margin-bottom: 8px;
}
.feedback.ok .fb-head {
  color: var(--good);
}
.feedback.bad .fb-head {
  color: var(--bad);
}
.fb-line {
  margin-top: 6px;
}
.strike {
  text-decoration: line-through;
  color: var(--muted);
}
.answer-reveal {
  border-top: 1px dashed var(--line);
  padding-top: 16px;
}
.a-text {
  font-size: 1.25em;
  font-weight: 600;
  margin-top: 4px;
}
.rate-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.rate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-size: 0.9em;
}
.rate span {
  color: var(--muted);
  font-size: 0.85em;
}
.rate kbd {
  margin-top: 4px;
}
.rate.again {
  border-color: rgba(255, 93, 115, 0.5);
}
.rate.hard {
  border-color: rgba(255, 159, 67, 0.5);
}
.rate.good {
  border-color: rgba(52, 211, 153, 0.5);
}
.rate.easy {
  border-color: rgba(58, 160, 255, 0.5);
}
.rate:hover {
  background: var(--panel-hover);
}
.match-clock {
  font-size: 1.3em;
  font-variant-numeric: tabular-nums;
}
.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.match-tile {
  min-height: 120px;
  padding: 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--panel-solid);
  cursor: pointer;
  font-size: 0.92em;
  line-height: 1.35;
  transition: transform 0.12s, opacity 0.3s, border-color 0.12s;
}
.match-tile:hover {
  border-color: var(--accent);
}
.match-tile.picked {
  border-color: var(--accent);
  background: rgba(139, 108, 255, 0.14);
  transform: scale(1.03);
}
.match-tile.wrong {
  border-color: var(--bad);
  background: rgba(255, 93, 115, 0.14);
  animation: shake 0.35s;
}
.match-tile.gone {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
.test-q {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.test-q.right {
  border-color: rgba(52, 211, 153, 0.5);
}
.test-q.wrong {
  border-color: rgba(255, 93, 115, 0.5);
}
.tf-shown {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-2);
  font-weight: 600;
}
.card.summary {
  text-align: center;
  padding: 36px 24px;
}
.card.summary .big {
  font-size: 2.6em;
}
.summary-big {
  font-size: 3.6em;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* ---------- toast + confetti ---------- */
#toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: pop 0.2s;
  pointer-events: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.92em;
}
.toast button {
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}
.confetti {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 300;
  animation: burst 0.9s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}
@keyframes burst {
  to {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
    opacity: 0;
  }
}
kbd {
  font: 600 0.8em ui-monospace, monospace;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .mode-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .dash,
  .focus-wrap,
  .month-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .main {
    padding: 14px 14px 96px;
  }
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--panel-solid);
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .mobile-nav button {
    border: 0;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.66em;
    color: var(--muted);
    padding: 6px 4px;
    cursor: pointer;
    flex: 1;
  }
  .mobile-nav button .ico {
    font-size: 1.5em;
  }
  .mobile-nav button.on {
    color: var(--text);
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .mday {
    min-height: 58px;
    padding: 4px;
  }
  .mday .ev {
    font-size: 0;
    height: 5px;
    padding: 0;
  }
  .month {
    gap: 3px;
  }
  .forecast {
    gap: 3px;
  }
  .hero h2 {
    font-size: 1.5em;
  }
  .item-row .right .chip {
    display: none;
  }
  .mission-item .btn {
    display: none;
  }
  .mission-item {
    padding: 12px;
  }
  .topbar .btn.lock-label span {
    display: none;
  }
}

/* ---------- focus & ADHD support ---------- */
.stat b .freeze {
  font-size: 0.6em;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}
.xp-bar {
  height: 5px;
  margin-top: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.xp-bar > div,
.sprint-bar > div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: width 0.5s linear;
}
.next-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 16%, var(--panel)), var(--panel));
}
.next-icon {
  font-size: 2.2em;
  line-height: 1;
}
.next-label {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.next-title {
  font-size: 1.25em;
  font-weight: 700;
  margin: 2px 0;
  overflow-wrap: anywhere;
}
.big-btn {
  padding: 12px 20px;
  font-size: 1.05em;
}
.park-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.park-row:first-of-type {
  border-top: 0;
}
.session-clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.sprint-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
  margin: 8px 0 14px;
}
.btn.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}
.speak {
  font-size: 0.95em;
}
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.toggle-row .check {
  margin-top: 2px;
  flex: none;
}
/* Focus mode: only the study session on screen. */
.shell.focus {
  grid-template-columns: 1fr;
}
.shell.focus .sidebar,
.shell.focus .topbar {
  display: none;
}
.shell.focus .main {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
}
/* Comfort display */
html[data-text='large'] body {
  font-size: 17px;
}
html[data-text='xl'] body {
  font-size: 19px;
}
html[data-spacing='relaxed'] body {
  line-height: 1.75;
  letter-spacing: 0.02em;
  word-spacing: 0.08em;
}
html[data-calm='on'] *,
html[data-calm='on'] *::before,
html[data-calm='on'] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  .xp-bar > div,
  .sprint-bar > div {
    transition: none;
  }
}

/* ---------- games: Blitz, Boss battle, quests, loot ---------- */
.mode-new {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.65em;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 7px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
}
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.game-intro p {
  max-width: 520px;
  margin: 8px auto;
}
.game-q {
  text-align: center;
  padding: 26px 22px;
  transition: box-shadow 0.2s;
}
.game-q .face-text {
  font-size: 1.35em;
  font-weight: 700;
}
.game-q.glow {
  box-shadow: 0 0 0 2px var(--accent-3), 0 0 28px color-mix(in srgb, var(--accent-3) 45%, transparent);
}
.game-q.shake,
.boss-arena.shake {
  animation: shake 0.3s;
  box-shadow: 0 0 0 2px var(--critical);
}
.miss-note {
  margin-top: 10px;
  color: color-mix(in srgb, var(--critical) 55%, var(--text));
}
.blitz-time {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.2em;
  min-width: 64px;
  text-align: right;
}
.blitz-bar,
.hp-bar,
.fuse,
.quest-bar {
  height: 10px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.blitz-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-3), var(--accent));
  transition: width 0.1s linear;
}
.blitz-hud {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.blitz-score {
  font-size: 2.6em;
  font-weight: 900;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.blitz-score.bump {
  animation: pop 0.25s;
}
.combo-badge {
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--panel);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.combo-badge.m2 {
  border-color: #ffb020;
}
.combo-badge.m3 {
  border-color: #ff6b8b;
  background: color-mix(in srgb, #ff6b8b 14%, var(--panel));
}
.combo-badge.m4 {
  border-color: #ff6b8b;
  background: linear-gradient(90deg, #ffb020, #ff6b8b);
  color: #1c1640;
}
.combo-pop {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translateX(-50%);
  font-size: 1.5em;
  font-weight: 900;
  color: #ff6b8b;
  animation: floatup 0.9s forwards;
  pointer-events: none;
}
@keyframes floatup {
  from {
    opacity: 1;
    transform: translate(-50%, 0) scale(0.9);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -40px) scale(1.2);
  }
}
.blitz.fever .game-q {
  background: linear-gradient(120deg, color-mix(in srgb, #ffb020 18%, var(--panel)), color-mix(in srgb, #ff6b8b 18%, var(--panel)));
  animation: pulse 1.2s infinite;
}
.game-stats {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.game-stats div {
  display: flex;
  flex-direction: column;
}
.game-stats b {
  font-size: 1.4em;
}
.game-stats span {
  font-size: 0.75em;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.boss-arena {
  display: flex;
  align-items: center;
  gap: 20px;
}
.boss-arena.enraged {
  border-color: var(--critical);
  background: linear-gradient(120deg, color-mix(in srgb, var(--critical) 12%, var(--panel)), var(--panel));
}
.boss-emoji {
  font-size: 4em;
  line-height: 1;
}
.boss-emoji.hit {
  animation: shake 0.3s;
  filter: brightness(1.6);
}
.boss-name {
  font-weight: 800;
  font-size: 1.2em;
  margin-bottom: 6px;
}
.hp-bar {
  height: 14px;
}
.hp-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #ff5d73, #ffb020);
  transition: width 0.35s ease-out;
}
.hearts {
  font-size: 1.1em;
  letter-spacing: 2px;
}
.battle-log {
  min-height: 3.2em;
  padding: 0 4px;
}
.power-tag {
  font-weight: 800;
  font-size: 0.8em;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  color: color-mix(in srgb, #ff6b8b 60%, var(--text));
}
.game-q.power {
  border-color: #ff6b8b;
}
.fuse {
  height: 6px;
  margin-top: 14px;
}
.fuse > div {
  height: 100%;
  background: var(--critical);
}
.quests .quest {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.quest-icon {
  font-size: 1.4em;
}
.quest-name {
  font-weight: 600;
  margin-bottom: 5px;
}
.quest-bar {
  height: 7px;
}
.quest-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
}
.quest.done .quest-bar > div {
  background: var(--accent-3);
}
.quest-claimed {
  color: var(--accent-3);
  font-weight: 900;
  font-size: 1.2em;
}
.chest-btn {
  width: 100%;
  margin-top: 6px;
  animation: pulse 1.6s infinite;
}
.loot {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  text-align: left;
  animation: pop 0.4s;
}
.loot-icon {
  font-size: 1.8em;
}
.loot-rare {
  border-color: #3aa0ff;
  background: color-mix(in srgb, #3aa0ff 12%, var(--panel));
}
.loot-epic {
  border-color: #ffb020;
  background: linear-gradient(120deg, color-mix(in srgb, #ffb020 18%, var(--panel)), color-mix(in srgb, #ff6b8b 14%, var(--panel)));
}

@media (max-width: 1100px) {
  .mode-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
a.btn {
  text-decoration: none;
}

/* ======================================================================
   iPhone / touch support
   ====================================================================== */
.tab-badge {
  position: absolute;
  top: -4px;
  right: -10px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--accent-2);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}
.more-sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.more-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.more-item .ico {
  font-size: 1.7em;
}
.more-item.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
}
.more-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.ios-hint {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  border-color: color-mix(in srgb, var(--accent-3) 50%, var(--line));
}
.ios-hint .big {
  font-size: 1.8em;
  line-height: 1;
}

/* Touch screens: no hover, fat fingers, and iOS zooms into inputs under 16px. */
@media (pointer: coarse) {
  input:not([type='checkbox']):not([type='radio']):not([type='range']),
  select,
  textarea {
    font-size: 16px !important;
  }
  .btn {
    min-height: 44px;
  }
  .btn.sm {
    min-height: 40px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .btn.icon {
    min-width: 44px;
  }
  .seg button {
    min-height: 40px;
  }
  input.check,
  input.check.sq {
    width: 24px;
    height: 24px;
  }
  .kbd-hint,
  .kbd,
  .choice .key {
    display: none !important;
  }
  .mode-tile:hover,
  .pick:hover {
    transform: none;
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }
  .shell {
    min-height: 100dvh;
  }
  .main {
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) calc(92px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }
  .mobile-nav button {
    position: relative;
    min-height: 50px;
    font-size: 0.7em;
    font-weight: 600;
  }
  .mobile-nav button .ico {
    position: relative;
  }
  /* While studying in focus mode there's an Exit button, so the tab bar can go. */
  .shell.focus .mobile-nav {
    display: none;
  }
  .shell.focus .main {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  /* Modals become bottom sheets. */
  .modal-back,
  .modal-back.center {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0;
  }
  .modal,
  .modal-back.center .modal,
  .modal.wide {
    width: 100%;
    height: auto;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    border: 1px solid var(--line);
    border-bottom: 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    animation: sheet-up 0.22s ease-out;
  }
  @keyframes sheet-up {
    from {
      transform: translateY(40px);
      opacity: 0;
    }
  }
  .modal-head h3 {
    font-size: 1.1em;
  }

  /* Page headers + generic layout */
  .page-title,
  .set-header,
  .hero {
    flex-wrap: wrap;
    gap: 10px;
  }
  .page-title h2 {
    font-size: 1.45em;
  }
  .row {
    flex-wrap: wrap;
  }
  .stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 8px;
  }
  .stat {
    min-width: 0;
    padding: 10px 12px;
  }
  .stat b {
    font-size: 1.25em;
  }
  .card {
    padding: 16px;
  }
  .topbar {
    flex-wrap: wrap;
    margin-bottom: 14px;
  }
  .planner-tabs .seg,
  .seg {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .seg button {
    white-space: nowrap;
  }

  /* Home */
  .next-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .next-card .next-icon {
    display: none;
  }
  .next-card .row {
    flex-wrap: wrap;
  }
  .next-card .row .btn {
    flex: 1 1 auto;
  }
  .review-cta {
    flex-wrap: wrap;
  }

  /* Study */
  .mode-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .mode-tile {
    padding: 12px;
  }
  .study-top {
    flex-wrap: wrap;
    gap: 8px;
  }
  .study-title {
    flex: 1 1 100%;
    order: -1;
    font-size: 0.95em;
  }
  .choices,
  .choice-grid {
    grid-template-columns: 1fr;
  }
  .choice {
    min-height: 52px;
    align-items: center;
  }
  .flip {
    min-height: 300px;
  }
  .face-text {
    font-size: 1.2em;
  }
  .blitz-score {
    font-size: 2em;
  }
  .boss-emoji {
    font-size: 2.8em;
  }
  .game-q .face-text {
    font-size: 1.15em;
  }
  .summary-big {
    font-size: 2.2em;
  }
  .learn-stages {
    gap: 6px;
  }
}

@media (max-width: 760px) {
  #toasts {
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: calc(100% - 32px);
    align-items: center;
  }
  body:has(.shell.focus) #toasts,
  body:has(.modal-back) #toasts {
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .topbar .lock-label {
    display: none;
  }
  .topbar .quick {
    flex: 1 1 100%;
    order: 2;
  }
  .topbar {
    justify-content: flex-end;
  }
  .planner-tabs .seg {
    display: flex;
    width: 100%;
  }
  .planner-tabs .seg button {
    flex: 1;
    padding-left: 6px;
    padding-right: 6px;
    font-size: 0.85em;
  }
  .set-header {
    display: grid;
    grid-template-columns: 1fr auto;
  }
  .set-header > :first-child {
    grid-column: 1 / -1;
  }
  .set-header > .stack {
    flex-direction: row;
    align-self: center;
  }
  .set-header h2 {
    font-size: 1.5em !important;
  }
  .set-header .ring {
    width: 70px;
    height: 70px;
  }
  .match-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .match-tile {
    min-height: 82px;
    padding: 8px;
    font-size: 0.9em;
  }
  .btn {
    max-width: 100%;
  }
  a.btn,
  .row.wrap .btn {
    white-space: normal;
    text-align: center;
  }
  .btn.learning,
  .btn.know {
    flex: 1 1 0;
    padding-left: 10px;
    padding-right: 10px;
  }
  .flip + .row {
    flex-wrap: nowrap;
    gap: 8px !important;
  }
}
.auth {
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
@media (pointer: coarse) {
  .auth a {
    display: inline-block;
    padding: 10px 4px;
  }
}
@media (max-width: 760px) {
  .ios-hint {
    flex-wrap: wrap;
  }
  .ios-hint .btn {
    margin-left: auto;
  }
}
/* iOS: no grey tap flash, no double-tap zoom delay on controls, no background scroll behind sheets. */
button,
a,
.choice,
.mode-tile,
.match-tile,
.flip {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
body:has(.modal-back) {
  overflow: hidden;
}
.mobile-nav {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
@media (pointer: coarse) {
  .topic-toggle {
    min-height: 40px;
    padding: 8px 6px;
  }
}

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

/* ---------- O'Connor course catalog ---------- */
.catalog-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 12%, var(--panel)), var(--panel));
}
.catalog-cta .big {
  font-size: 2.2em;
  line-height: 1;
}
.catalog-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.catalog-bar input[type='search'] {
  flex: 1;
  min-width: 0;
}
.catalog-bar select {
  width: auto;
}
.craving-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chip-btn {
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.86em;
}
.chip-btn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cat-group {
  margin-bottom: 14px;
  padding: 12px 14px;
}
.cat-group h3 {
  margin-bottom: 6px;
}
.cat-row {
  border-top: 1px solid var(--line);
}
.cat-row:first-of-type {
  border-top: 0;
}
.cat-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.cat-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 4px 0;
}
.cat-name {
  font-weight: 700;
}
.cat-meta {
  font-size: 0.8em;
  color: var(--muted);
}
.cat-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cat-row.added .cat-name {
  color: var(--muted);
}
.cat-detail {
  padding: 0 0 12px 34px;
}
.cat-detail p {
  margin: 0 0 6px;
}
.cat-units ol {
  margin: 4px 0 0;
  padding-left: 20px;
}
.cat-units li {
  margin: 2px 0;
}
.chip.ap-chip {
  background: color-mix(in srgb, #ff6b8b 16%, transparent);
  color: color-mix(in srgb, #ff6b8b 50%, var(--text));
}
.chip.src-dvusd {
  background: color-mix(in srgb, var(--accent-3) 16%, transparent);
  color: color-mix(in srgb, var(--accent-3) 45%, var(--text));
}
.chip.src-orbit {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: color-mix(in srgb, var(--accent) 55%, var(--text));
}
.chip.src-standards {
  background: color-mix(in srgb, var(--accent-2) 16%, transparent);
  color: color-mix(in srgb, var(--accent-2) 50%, var(--text));
}
.chip.added-chip {
  background: color-mix(in srgb, var(--accent-3) 22%, transparent);
  color: var(--text);
}
.cat-cart {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--accent);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}
.cat-cart > span:first-child {
  margin-right: auto;
  font-weight: 700;
}
.src-note {
  margin-bottom: 14px;
}
.src-note.src-dvusd {
  border-color: color-mix(in srgb, var(--accent-3) 45%, var(--line));
}
.src-note.src-standards {
  border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line));
}
.src-note .btn {
  white-space: normal;
  text-align: left;
  height: auto;
}
@media (max-width: 760px) {
  .cat-main {
    flex-wrap: wrap;
  }
  .cat-badges {
    width: 100%;
    justify-content: flex-start;
    padding-left: 34px;
  }
  .cat-detail {
    padding-left: 0;
  }
  .cat-cart {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .catalog-cta {
    flex-wrap: wrap;
  }
}

/* ======================================================================
   Bluebook-style practice exam (always light, like the real testing app)
   ====================================================================== */
.shell.exam {
  grid-template-columns: 1fr;
}
.shell.exam .sidebar,
.shell.exam .topbar,
.shell.exam .mobile-nav {
  display: none !important;
}
.shell.exam .main {
  padding: 0 !important;
}
.bb {
  --bb-ink: #1e1e1e;
  --bb-muted: #5a5a5a;
  --bb-line: #c7c7c7;
  --bb-soft: #f2f2f2;
  --bb-blue: #324dc7;
  --bb-blue-ink: #ffffff;
  --bb-yellow: #fde68a;
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto 4px 1fr 4px auto;
  background: #ffffff;
  color: var(--bb-ink);
  font: 16px/1.5 'Noto Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  letter-spacing: normal;
  word-spacing: normal;
}
.bb button {
  font: inherit;
  color: inherit;
}
.bb :focus-visible {
  outline: 3px solid var(--bb-blue);
  outline-offset: 2px;
}
.bb-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 24px 8px;
  background: #fff;
}
.bb-sec {
  font-size: 1.05em;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0;
}
.bb-link {
  border: 0;
  background: none;
  padding: 2px 0;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bb-hc {
  text-align: center;
}
.bb-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}
.bb-time {
  font-size: 1.35em;
  font-weight: 700;
}
.bb-time-hidden {
  font-size: 1.2em;
}
.bb-timer.low .bb-time {
  color: #b42318;
}
.bb-hide {
  border: 1px solid var(--bb-ink);
  background: #fff;
  border-radius: 99px;
  padding: 0 14px;
  font-size: 0.8em;
  font-weight: 600;
  cursor: pointer;
  min-height: 26px;
}
.bb-hr {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.bb-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: 0;
  background: none;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  min-width: 64px;
}
.bb-tool:hover,
.bb-tool.on {
  background: var(--bb-soft);
}
.bb-tool:disabled {
  opacity: 0.4;
  cursor: default;
}
.bb-ticon {
  font-size: 1.25em;
  line-height: 1;
}
.bb-tlabel {
  font-size: 0.72em;
  font-weight: 600;
}
.bb-rule {
  background: repeating-linear-gradient(90deg, #2b3a8f 0 18px, transparent 18px 24px, #f2b53a 24px 34px, transparent 34px 40px);
  height: 3px;
  align-self: center;
}
.bb-main {
  position: relative;
  overflow: auto;
  background: #fff;
}
.bb-qwrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 24px 40px;
}
.bb-qbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bb-soft);
  border-bottom: 2px dashed var(--bb-line);
  padding: 0 10px 0 0;
  margin-bottom: 18px;
}
.bb-num {
  background: var(--bb-ink);
  color: #fff;
  font-weight: 700;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}
.bb-markrev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 0.92em;
  padding: 6px 4px;
}
.bb-bookmark {
  width: 12px;
  height: 16px;
  border: 2px solid var(--bb-ink);
  border-bottom: 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
  display: inline-block;
}
.bb-markrev.on .bb-bookmark {
  background: #c8102e;
  border-color: #c8102e;
}
.bb-markrev.on {
  font-weight: 700;
}
.bb-abc {
  border: 1px solid var(--bb-ink);
  border-radius: 6px;
  background: #fff;
  padding: 2px 8px;
  font-weight: 700;
  font-size: 0.8em;
  cursor: pointer;
}
.bb-abc.on {
  background: var(--bb-blue);
  border-color: var(--bb-blue);
  color: #fff;
}
.bb-stem {
  font-family: 'Noto Serif', Georgia, 'Times New Roman', serif;
  font-size: 1.08em;
  line-height: 1.65;
  margin-bottom: 20px;
  white-space: pre-wrap;
}
.bb-mark-hl {
  background: var(--bb-yellow);
  color: inherit;
  cursor: pointer;
  border-bottom: 2px solid #e0a800;
}
.bb-note {
  font-size: 0.7em;
  margin-left: 1px;
}
.bb-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bb-crow {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bb-choice {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  border: 1px solid var(--bb-ink);
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
  min-height: 52px;
  font-family: 'Noto Serif', Georgia, serif;
  transition: none;
}
.bb-choice:hover:not(:disabled) {
  background: #fafafa;
}
.bb-choice.sel {
  border: 3px solid var(--bb-blue);
  padding: 10px 12px;
}
.bb-letter {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--bb-ink);
  display: grid;
  place-items: center;
  font-family: 'Noto Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.85em;
}
.bb-choice.sel .bb-letter {
  background: var(--bb-blue);
  border-color: var(--bb-blue);
  color: #fff;
}
.bb-crow.out .bb-choice {
  opacity: 0.5;
  cursor: default;
}
.bb-crow.out .bb-ctext,
.bb-crow.out .bb-letter {
  text-decoration: line-through;
}
.bb-x {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--bb-ink);
  background: #fff;
  cursor: pointer;
  position: relative;
  font-size: 0.75em;
  font-weight: 700;
}
.bb-x::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 50%;
  border-top: 1.5px solid var(--bb-ink);
}
.bb-undo {
  flex: none;
  border: 0;
  background: none;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  min-width: 44px;
}
.bb-foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 24px max(10px, env(safe-area-inset-bottom));
  background: #fff;
}
.bb-user {
  font-weight: 600;
}
.bb-fc {
  display: flex;
  justify-content: center;
}
.bb-qbtn {
  background: var(--bb-ink);
  color: #fff !important;
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
}
.bb-fr {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.bb-btn {
  border: 1px solid var(--bb-ink);
  background: #fff;
  border-radius: 99px;
  padding: 8px 24px;
  font-weight: 700;
  cursor: pointer;
  min-height: 42px;
}
.bb-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.bb-btn.primary {
  background: var(--bb-blue);
  border-color: var(--bb-blue);
  color: var(--bb-blue-ink) !important;
}
.bb-btn.outline {
  border-color: var(--bb-blue);
  color: var(--bb-blue) !important;
}
.bb-btn.big {
  padding: 12px 32px;
  font-size: 1.05em;
}
/* popovers & panels */
.bb-pop {
  position: fixed;
  z-index: 60;
  background: #fff;
  color: var(--bb-ink);
  border: 1px solid var(--bb-line);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  padding: 14px 16px;
}
.bb-pophead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.bb-close {
  border: 0;
  background: none;
  font-size: 1.1em;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
}
.bb-navpop {
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}
.bb-navpop .bb-btn {
  align-self: center;
}
.bb-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.85em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bb-line);
}
.bb-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 10px;
  max-height: 46vh;
  overflow: auto;
  padding: 4px;
}
.bb-cell {
  position: relative;
  height: 40px;
  border: 1px dashed var(--bb-ink);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  color: var(--bb-blue) !important;
}
.bb-cell.done {
  border-style: solid;
  background: var(--bb-blue);
  color: #fff !important;
  border-color: var(--bb-blue);
}
.bb-cell.mini {
  display: inline-block;
  width: 18px;
  height: 18px;
  cursor: default;
}
.bb-pin {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.9em;
  color: var(--bb-ink);
}
.bb-legend .bb-pin {
  position: static;
  transform: none;
}
.bb-flag {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 10px;
  height: 13px;
  background: #c8102e;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}
.bb-flag.static {
  position: static;
  display: inline-block;
}
.bb-panel {
  top: 84px;
  right: 16px;
  width: min(380px, calc(100% - 24px));
  max-height: calc(100% - 180px);
  overflow: auto;
}
.bb-dir {
  left: 16px;
  right: auto;
  width: min(560px, calc(100% - 24px));
}
.bb-dirtext p {
  margin: 0 0 10px;
}
.bb-more {
  top: 84px;
  right: 16px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 200px;
}
.bb-menuitem {
  border: 0;
  background: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.bb-menuitem:hover {
  background: var(--bb-soft);
}
.bb-hint {
  color: var(--bb-muted);
  font-size: 0.9em;
}
/* calculator */
.bb-calc-in {
  width: 100%;
  font: 600 1.1em ui-monospace, Menlo, Consolas, monospace !important;
  border: 1px solid var(--bb-line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--bb-ink);
}
.bb-calc-out {
  min-height: 1.8em;
  text-align: right;
  font: 700 1.3em ui-monospace, Menlo, Consolas, monospace;
  padding: 4px 2px;
}
.bb-calc-hist {
  font: 0.82em ui-monospace, Menlo, Consolas, monospace;
  color: var(--bb-muted);
  text-align: right;
  min-height: 1em;
}
.bb-calc-pad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 6px 0 8px;
}
.bb-key {
  border: 1px solid var(--bb-line);
  background: var(--bb-soft);
  border-radius: 8px;
  min-height: 40px;
  cursor: pointer;
  font-weight: 600;
}
.bb-key.num {
  background: #fff;
}
.bb-key.eq {
  background: var(--bb-blue);
  border-color: var(--bb-blue);
  color: #fff !important;
}
.bb-refbox ul {
  margin: 4px 0 10px;
  padding-left: 18px;
}
.bb-refbox li {
  font-family: 'Noto Serif', Georgia, serif;
  margin: 2px 0;
}
.bb-refh {
  font-weight: 700;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* free response split screen */
.bb-split {
  display: grid;
  height: 100%;
  min-height: 0;
}
.bb-pane {
  overflow: auto;
  padding: 24px;
  min-width: 0;
}
.bb-divider {
  background: var(--bb-soft);
  border-left: 1px solid var(--bb-line);
  border-right: 1px solid var(--bb-line);
  cursor: col-resize;
  display: grid;
  place-items: center;
  color: var(--bb-muted);
  touch-action: none;
}
.bb-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bb-edbar {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--bb-line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 4px 8px;
  background: var(--bb-soft);
}
.bb-edbtn {
  border: 0;
  background: none;
  font-size: 1.1em;
  min-width: 36px;
  min-height: 32px;
  cursor: pointer;
}
.bb-wc {
  font-size: 0.82em;
  color: var(--bb-muted);
}
.bb-editor {
  flex: 1;
  min-height: 260px;
  margin-top: -8px;
  border: 1px solid var(--bb-line) !important;
  border-radius: 0 0 8px 8px !important;
  background: #fff !important;
  color: var(--bb-ink) !important;
  font: 1em/1.6 'Noto Serif', Georgia, serif !important;
  padding: 12px !important;
  resize: none;
}
/* review page */
.bb-review {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px;
  text-align: center;
}
.bb-review h2 {
  font-size: 1.8em;
  margin-bottom: 8px;
}
.bb-card {
  text-align: left;
  border: 1px solid var(--bb-line);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}
/* break screen */
.bb-break {
  grid-template-rows: none;
  grid-template-columns: minmax(260px, 2fr) 3fr;
}
.bb-break-l {
  background: #1e1e1e;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
}
.bb-break-label {
  font-size: 1.1em;
}
.bb-break-time {
  font: 700 4em/1 'Noto Sans', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
.bb-break-l .bb-btn.primary {
  background: #f2b53a;
  border-color: #f2b53a;
  color: #1e1e1e !important;
}
.bb-break-r {
  padding: 48px 40px;
  overflow: auto;
}
.bb-break-r h2 {
  font-size: 1.8em;
  margin-bottom: 12px;
}
/* line reader */
.bb-reader {
  --y: 120px;
  position: absolute;
  inset: 0;
  pointer-events: none;
  min-height: 100%;
}
.bb-reader-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--y);
  background: rgba(0, 0, 0, 0.55);
}
.bb-reader-win {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--y);
  height: 72px;
  outline: 3px solid var(--bb-blue);
}
.bb-reader-bot {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--y) + 72px);
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
}
/* phones / narrow windows */
@media (max-width: 760px) {
  .bb-head {
    grid-template-columns: 1fr auto;
    padding: max(8px, env(safe-area-inset-top)) 12px 6px;
  }
  .bb-hl {
    grid-column: 1 / -1;
  }
  .bb-hc {
    justify-self: start;
  }
  .bb-timer {
    flex-direction: row;
    gap: 8px;
  }
  .bb-tool {
    min-width: 44px;
    padding: 4px;
  }
  .bb-tlabel {
    display: none;
  }
  .bb-qwrap {
    padding: 16px 14px 28px;
  }
  .bb-foot {
    grid-template-columns: auto 1fr;
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  }
  .bb-fl {
    display: none;
  }
  .bb-fc {
    justify-content: flex-start;
  }
  .bb-btn {
    padding: 8px 16px;
  }
  .bb-split {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto;
    height: auto;
  }
  .bb-divider {
    display: none;
  }
  .bb-pane {
    padding: 14px;
  }
  .bb-break {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .bb-break-r {
    padding: 24px 16px;
  }
  .bb-break-time {
    font-size: 3em;
  }
  .bb-panel,
  .bb-dir {
    left: 12px;
    right: 12px;
    width: auto;
    top: 72px;
  }
  .bb-navpop {
    bottom: calc(66px + env(safe-area-inset-bottom));
  }
}
body:has(.shell .bb) #toasts,
body:has(.shell.focus .bb) #toasts {
  bottom: calc(86px + env(safe-area-inset-bottom));
}
.bb-key.wide3 {
  grid-column: span 3;
}
.bb-key.wide2 {
  grid-column: span 2;
}

/* Road to a 5 */
.road-verdict {
  padding: 12px 16px;
}
.road-carry {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  border-left: 4px solid #ffb020;
}
.road-trend {
  width: 100%;
  max-width: 320px;
  height: 80px;
  display: block;
}
.road-trend .target {
  stroke: var(--muted);
  stroke-dasharray: 4 4;
}
.road-trend .score {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}
.road-trend .pt {
  fill: var(--accent);
}
.road-trend .hit {
  fill: #22b07d;
}
.road-warn {
  margin: 6px 0;
  padding: 6px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, #ffb020 16%, transparent);
}
.road-head h3,
.road-week h3 {
  text-transform: none;
  letter-spacing: 0;
}
.road-bar {
  display: flex;
  gap: 2px;
  margin: 12px 0 10px;
  height: 12px;
}
.road-bar span {
  flex: 1;
  border-radius: 3px;
  opacity: 0.45;
}
.road-bar span.past {
  opacity: 0.2;
}
.road-bar span.now {
  opacity: 1;
  outline: 2px solid var(--text);
  outline-offset: 1px;
}
.road-phases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 10px;
  margin-top: 8px;
}
.road-phase {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--pc);
  background: var(--bg-2);
}
.road-phase.on {
  border-color: var(--pc);
  background: color-mix(in srgb, var(--pc) 10%, var(--panel));
}
.road-task {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}
.road-task-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.road-task-main .check {
  margin-top: 2px;
  flex: none;
}
.road-ic {
  width: 22px;
  flex: none;
  text-align: center;
}
.road-task-text {
  flex: 1;
  min-width: 0;
}
.road-task.done .road-task-text > div:first-child {
  color: var(--faint);
  text-decoration: line-through;
}
.road-est {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.road-est-n {
  font-size: 2.2em;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.road-checks {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: grid;
  gap: 4px;
  font-size: 0.9em;
}
.road-checks li.ok {
  color: var(--muted);
}
.road-month {
  border-top: 1px solid var(--line);
}
.road-month-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  width: 100%;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  padding: 10px 0;
  text-align: left;
  font: inherit;
  font-weight: 700;
}
.road-dots {
  display: inline-flex;
  gap: 3px;
}
.road-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.road-wk {
  padding: 6px 0 6px 14px;
  border-left: 3px solid var(--line);
  margin: 0 0 8px 4px;
}
.road-wk.now {
  border-left-color: var(--accent);
}
.road-wk .road-task {
  padding: 4px 0;
  font-size: 0.9em;
}
.video-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
}
.road-task .video-list,
.road-topics {
  margin-left: 32px;
}
.road-topics {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}
.road-videos select,
.road-settings select {
  width: 100%;
  margin: 8px 0 0;
}
@media (max-width: 760px) {
  .road-task-main {
    flex-wrap: wrap;
  }
  .road-task-main > .row {
    width: 100%;
    justify-content: flex-end;
  }
  .road-task .video-list,
  .road-topics {
    margin-left: 0;
  }
  .road-head .road-phase > div:last-child {
    display: none;
  }
  .road-head .road-phases {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
}
