@font-face  {
  font-family: Vazirmatn;
  src: url('./fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face  {
  font-family: Vazirmatn;
  src: url('./fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face  {
  font-family: Vazirmatn;
  src: url('./fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url('./fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url('./fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}
/* Actions are pills, cards 22px, fields 12px. Cyan owns navigation. */
:root, :root[data-theme='dark'] {
  --bg: #060f1f;
  --bg-2: #08192d;
  --surface: #0d2742eb;
  --text: #eaf6ff;
  --muted: #8fb0c8;
  --accent: #4ebee4;
  --accent-fill: #4ebee4;
  --pink: #ff3ea5;
  --orange: #ff8a3d;
  --success: #3fe0b5;
  --on-accent: #060f1f;
  --line: #29465f;
  --hero: #08192d;
  --error: #ff8995;
  --shadow: inset 0 1px 0 #bfe9ff0a;
  --c-sky: #4ebee4;
  --c-blue: #76a9ff;
  --c-teal: #4ebee4;
  --c-green: #ff62b8;
  --c-coral: #ff788a;
  --c-pink: #ff62b8;
  --c-orange: #ff9a60;
  --c-navy: #8e9fff;
  --chrome: linear-gradient(180deg, #fff 10%, #bfe9ff 55%, #4ebee4 100%);
  --sunset: linear-gradient(125deg, #ff8a3d, #ff3ea5);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #eaf6fb;
  --bg-2: #e0f0f6;
  --surface: #fff7f9f5;
  --text: #0e2f52;
  --muted: #4d657c;
  --accent: #096789;
  --accent-fill: #4ebee4;
  --pink: #b9146d;
  --orange: #a54318;
  --success: #087b60;
  --line: #c4d9e3;
  --error: #ad2940;
  --chrome: linear-gradient(180deg, #0e2f52, #165f80);
  --c-sky: #096789;
  --c-blue: #275dac;
  --c-teal: #096789;
  --c-green: #b9146d;
  --c-coral: #b9324c;
  --c-pink: #b9146d;
  --c-orange: #a54318;
  --c-navy: #5157aa;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  color: var(--text);
  font-family: Vazirmatn, sans-serif;
  font-variant-numeric: tabular-nums;
}
body {
  margin: 0;
}
button, input, select, textarea {
  font: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button, a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
button:disabled {
  opacity: .45;
  cursor: default;
}
button:active:not(:disabled), a:active {
  transform: scale(.97);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.primary {
  background: var(--accent-fill);
  color: var(--on-accent);
  border-color: transparent;
  font-weight: 700;
}
.white {
  background: #fff;
  color: #0e2f52;
  border: 0;
  font-size: 12px;
}
.full {
  width: 100%;
}
.app-shell {
  max-width: 480px;
  min-height: 100dvh;
  margin-inline: auto;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(20px + env(safe-area-inset-top)) 20px 20px;
}
.brand, .greeting, .back-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand {
  font-size: 19px;
  gap: 6px;
}
.brand img {
  border-radius: 50%;
}
.greeting strong {
  display: block;
  font-size: 15px;
}
.greeting small {
  display: block;
  font-size: 11px;
  margin-top: 3px;
}
.avatar {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--accent);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
}
.back-heading h1 {
  font-size: 16px;
  margin: 0;
}
.back-heading button {
  width: 40px;
  min-height: 40px;
  padding: 8px;
}
main {
  padding: 0 20px calc(120px + env(safe-area-inset-bottom));
}
main:focus {
  outline: none;
}
h1, h2, h3, p {
  margin: 0;
}
h1 {
  font-size: 24px;
}
h2 {
  font-size: 16px;
}
h3 {
  font-size: 14px;
  margin-block: 8px;
}
p {
  line-height: 1.9;
}
small, .muted {
  color: var(--muted);
}
small {
  font-size: 11px;
}
.note {
  font-size: 12px;
}
.center {
  text-align: center;
}
.card {
  padding: 20px;
  margin-block: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card h2 {
  margin-bottom: 16px;
}
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--hero);
  color: #fff;
  border-radius: 20px;
  padding: 24px 20px;
}
.hero-kicker {
  font-size: 13px;
  opacity: .9;
}
.hero h1 {
  font-size: clamp(20px, 5.3vw, 25px);
  margin-top: 8px;
}
.hero p {
  font-size: 11px;
  margin: 4px 0 16px;
}
.ring {
  position: relative;
  width: 116px;
  flex-shrink: 0;
  aspect-ratio: 1;
}
.ring svg {
  width: 100%;
  display: block;
  transform: rotate(-90deg);
}
.ring circle {
  fill: none;
  stroke-width: 7;
}
.ring-track {
  stroke: #ffffff30;
}
.ring-value {
  stroke: var(--accent-fill);
  stroke-linecap: round;
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-center strong {
  font-size: 26px;
}
.hero .ring-center small {
  color: #e6f1f8;
  font-size: 10px;
}
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 20px 0;
}
.day-chip {
  border-radius: 16px;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  border: 1px solid transparent;
  font-size: 11px;
  color: var(--muted);
}
.day-chip strong {
  font-size: 16px;
  color: var(--text);
}
.day-chip.today {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow);
}
.day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}
.day-dot.filled {
  background: var(--accent);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.stat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.stat-tile strong {
  font-size: 18px;
  margin-top: 10px;
}
.stat-tile > span:last-child {
  color: var(--muted);
  font-size: 11px;
}
.icon-square {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--accent);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 24px 0 12px;
}
.section-heading a {
  display: flex;
  align-items: center;
  font-size: 11px;
  color: var(--accent);
}
.section-heading a .icon {
  width: 14px;
  transform: rotate(180deg);
}
.mini-tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.tool-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: right;
  min-height: 148px;
  border-radius: 18px;
  border: 0;
  padding: 18px;
  color: #fff;
  background: linear-gradient(140deg, var(--tile-light), var(--tile-dark));
}
.tool-tile > .icon {
  width: 30px;
  height: 30px;
  margin-bottom: 16px;
}
.tool-tile strong {
  font-size: 14px;
}
.tool-tile small {
  color: #fff;
  font-size: 10px;
  margin-top: 4px;
  line-height: 1.8;
}
.mini-tools .tool-tile {
  padding: 16px 12px;
  min-height: 126px;
}
.mini-tools .tool-tile strong {
  font-size: 12px;
}
.mini-tools .tool-tile small {
  font-size: 9px;
}
.hue-sky {
  --category: var(--c-sky);
  --tile-light: #127a9d;
  --tile-dark: #0b597c;
}
.hue-blue {
  --category: var(--c-blue);
  --tile-light: #296bc2;
  --tile-dark: #235295;
}
.hue-teal {
  --category: var(--c-teal);
  --tile-light: #087d6b;
  --tile-dark: #076354;
}
.hue-green {
  --category: var(--c-green);
  --tile-light: #287d35;
  --tile-dark: #21692d;
}
.hue-coral {
  --category: var(--c-coral);
  --tile-light: #ba4745;
  --tile-dark: #9b3533;
}
.hue-pink {
  --category: var(--c-pink);
  --tile-light: #bb3679;
  --tile-dark: #992a62;
}
.hue-orange {
  --category: var(--c-orange);
  --tile-light: #ae551e;
  --tile-dark: #8f4317;
}
.hue-navy {
  --category: var(--c-navy);
  --tile-light: #285e9e;
  --tile-dark: #1b4477;
}
.icon-square[class*='hue-'], .pedestal, .podium-avatar {
  background: var(--tile-light);
  color: white;
}
.color-sky {
  color: var(--c-sky);
}
.color-blue {
  color: var(--c-blue);
}
.color-teal {
  color: var(--c-teal);
}
.color-green {
  color: var(--c-green);
}
.color-coral {
  color: var(--c-coral);
}
.color-pink {
  color: var(--c-pink);
}
.color-orange {
  color: var(--c-orange);
}
.color-navy {
  color: var(--c-navy);
}
.soon-badge {
  position: absolute;
  top: 16px;
  left: 12px;
  background: #08192d40;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
}
.upcoming {
  display: flex;
  gap: 12px;
  align-items: center;
  background: transparent;
  box-shadow: none;
}
.upcoming .icon-square {
  background: var(--surface);
  color: var(--muted);
}
.upcoming h3 {
  margin: 0;
}
.upcoming p {
  color: var(--muted);
  font-size: 10px;
}
.badge {
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  font-size: 10px;
  padding: 4px 10px;
  white-space: nowrap;
  margin-inline-start: auto;
}
.group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 12px;
}
.group-heading .icon {
  width: 20px;
  color: var(--accent);
}
.page-intro {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
.segments {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin: 0 0 16px;
}
.segments > * {
  flex: 1;
  padding: 10px 8px;
  border: 0;
  border-radius: 999px;
  text-align: center;
  font-size: 13px;
  background: transparent;
}
.segments .active {
  background: var(--accent);
  color: var(--bg);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips button {
  font-size: 12px;
  padding: 8px 12px;
  min-height: 40px;
}
.chips .icon {
  width: 16px;
  height: 16px;
}
.chips .active {
  background: var(--accent);
  color: var(--bg);
  border-color: transparent;
}
.entry-card > .chips {
  margin-block: 12px;
}
label {
  display: block;
  font-size: 12px;
}
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--bg);
}
textarea {
  resize: vertical;
}
input[aria-invalid='true'] {
  border-color: var(--error);
}
input[type='date'] {
  direction: rtl;
}
.stack {
  display: grid;
  gap: 16px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
legend {
  font-size: 14px;
  margin-bottom: 12px;
}
.error, .field-error {
  color: var(--error);
  font-size: 12px;
}
.error:not(:empty) {
  margin-block: 12px;
}
.mode-picker {
  display: flex;
  justify-content: center;
}
.timer-ring {
  width: min(260px, 100%);
  margin: 24px auto;
  color: var(--accent);
}
.timer-ring .ring-track {
  stroke: var(--bg);
}
.timer-ring .ring-value {
  stroke: var(--accent);
  stroke-width: 6;
}
.timer-ring #clock {
  direction: ltr;
  font-size: clamp(30px, 9vw, 38px);
  margin-top: 8px;
  letter-spacing: normal;
}
.timer-ring small {
  font-size: 12px;
}
.timer-actions {
  display: flex;
  gap: 8px;
}
.timer-actions button {
  flex: 1;
}
.entry-card > .note {
  margin-top: 12px;
}
.entry-fields {
  display: grid;
  gap: 12px;
  margin: 24px 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.entry-fields > select {
  margin-top: -6px;
}
.entry-fields h3 {
  margin: 0;
}
.time-steppers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  direction: ltr;
  margin: 12px 0;
}
.time-steppers > div {
  display: grid;
  justify-items: center;
  width: 88px;
  background: var(--bg);
  border-radius: 16px;
  padding: 8px;
}
.time-steppers span {
  font-size: 12px;
  color: var(--muted);
}
.time-steppers button {
  min-height: 32px;
  padding: 2px 16px;
  background: transparent;
  border: 0;
}
.time-steppers input {
  margin: 0;
  background: transparent;
  border: 0;
  min-height: 36px;
  text-align: center;
  font-size: 20px;
  padding: 0;
}
.session {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.session:last-child {
  border-bottom: 0;
}
.subject-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--category);
}
.session-info {
  flex: 1;
  min-width: 0;
}
.session-info strong {
  font-size: 13px;
}
.session-info small {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.session button {
  border: 0;
  color: var(--muted);
  padding: 8px;
}
.empty-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 2;
}
.empty {
  text-align: center;
  padding: 24px 8px;
}
.empty > .icon {
  display: block;
  color: var(--accent);
  margin: 0 auto 16px;
  width: 40px;
  height: 40px;
}
.empty strong {
  display: block;
  font-size: 14px;
}
.empty p {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 16px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.summary-grid .stat-tile {
  padding: 12px 8px;
}
.summary-grid .stat-tile strong {
  font-size: 13px;
}
.bar-chart {
  display: block;
  width: 100%;
}
.bar-chart rect {
  fill: currentColor;
}
.bar-chart text {
  fill: var(--muted);
  font-size: 11px;
  font-family: Vazirmatn;
}
.baseline {
  stroke: var(--line);
  fill: none;
}
.card .section-heading {
  margin-top: 0;
}
.subject-chart {
  display: flex;
  align-items: center;
  gap: 20px;
}
.donut {
  position: relative;
  width: 150px;
  flex-shrink: 0;
}
.donut svg {
  width: 100%;
  display: block;
  transform: rotate(-90deg);
}
.donut-slice {
  fill: none;
  stroke: currentColor;
  stroke-width: 15;
}
.donut > div {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut strong {
  font-size: 24px;
}
.donut small {
  font-size: 10px;
}
.legend {
  flex: 1;
}
.legend > div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 11px;
}
.legend small {
  display: block;
  font-size: 9px;
  margin-top: 2px;
}
.type-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-top: 20px;
}
.type-row > .icon {
  color: var(--accent);
  width: 20px;
}
.type-track {
  grid-column: 2 / 4;
  background: var(--bg);
  height: 5px;
  border-radius: 99px;
  overflow: hidden;
}
.type-track span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.preview-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px dashed var(--accent);
  border-radius: 20px;
  margin-bottom: 20px;
}
.preview-note > .icon {
  color: var(--accent);
}
.preview-note strong {
  font-size: 14px;
}
.preview-note p {
  font-size: 11px;
}
.preview-note small {
  font-size: 10px;
}
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  padding: 44px 8px 0;
}
.podium-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
}
.podium-avatar {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border: 4px solid var(--surface);
}
.place-1 .podium-avatar {
  width: 68px;
  height: 68px;
}
.winner {
  position: absolute;
  top: -28px;
  color: var(--accent);
}
.podium-person strong {
  font-size: 12px;
}
.podium-person small {
  margin: 4px 0 12px;
}
.pedestal {
  width: 100%;
  border-radius: 14px 14px 0 0;
  height: 80px;
  padding-top: 16px;
  font-size: 28px;
  font-weight: 700;
}
.place-1 .pedestal {
  height: 112px;
}
.place-3 .pedestal {
  height: 64px;
}
.leaderboard {
  padding: 8px 12px;
  margin-top: 0;
}
.leader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 2px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.leader-row:last-child {
  border: 0;
}
.leader-row > :last-child {
  margin-inline-start: auto;
}
.leader-row small {
  display: block;
  font-size: 9px;
  margin-top: 4px;
}
.small-avatar {
  width: 34px;
  height: 34px;
  font-size: 16px;
}
.small-avatar .icon {
  width: 18px;
}
.position {
  color: var(--muted);
  min-width: 16px;
  text-align: center;
}
.own-row {
  background: var(--bg);
  border-radius: 14px;
  padding-inline: 8px;
  margin-top: 8px;
}
.profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.profile-cover {
  height: 106px;
  background: var(--hero);
  color: #fff;
  padding: 20px;
  font-size: 12px;
}
.profile-identity {
  text-align: center;
  margin-top: -36px;
}
.profile-avatar {
  width: 76px;
  height: 76px;
  border: 5px solid var(--surface);
  background: var(--accent-fill);
  color: var(--on-accent);
  font-size: 32px;
}
.profile-identity h1 {
  font-size: 20px;
  margin: 8px 0 4px;
}
.profile-identity p {
  color: var(--muted);
  font-size: 12px;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  padding: 20px 12px;
}
.profile-stats > div + div {
  border-right: 1px solid var(--line);
}
.profile-stats strong {
  font-size: 20px;
  display: block;
}
.profile-stats small {
  display: block;
  margin-top: 4px;
}
.danger {
  color: var(--error);
  margin-top: 16px;
  font-size: 12px;
}
.version {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 24px;
}
.lesson-list {
  display: grid;
  gap: 10px;
}
.lesson-card {
  display: grid;
  grid-template-columns: 1fr 156px;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.lesson-card .field-error {
  grid-column: 1 / -1;
}
.lesson-card label {
  font-size: 13px;
}
.percent {
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
}
.percent input {
  margin: 0;
  min-width: 0;
  text-align: center;
  padding-inline: 4px;
}
.percent > span {
  font-size: 12px;
  color: var(--muted);
}
.minus {
  padding: 8px;
  width: 40px;
  flex-shrink: 0;
  font-size: 20px;
}
.minus.negative {
  color: var(--error);
  border-color: var(--error);
}
.rank-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.rank-stats > div {
  padding: 16px 4px;
  border-radius: 16px;
  background: var(--tile-light);
  color: #fff;
  text-align: center;
}
.rank-stats small {
  color: #fff;
}
.rank-stats strong {
  display: block;
  font-size: 22px;
  margin-top: 6px;
}
.rank-card {
  padding: 24px 16px;
  margin-top: 16px;
  border-radius: 18px;
  background: var(--bg);
  text-align: center;
}
.rank-card > span {
  font-size: 13px;
}
.rank-card > strong {
  display: block;
  font-size: 36px;
  color: var(--accent);
  margin: 8px 0;
}
.range-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}
.range-label small {
  font-size: 10px;
}
.range-bar {
  background: var(--line);
  height: 6px;
  border-radius: 999px;
  margin-top: 12px;
}
.range-bar span {
  display: block;
  width: 60%;
  margin: auto;
  background: var(--accent);
  height: 100%;
  border-radius: inherit;
}
.result > p {
  margin-top: 16px;
}
#tabs {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(480px, 100%);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  z-index: 20;
}
#tabs > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 56px;
  font-size: 10px;
  color: var(--muted);
  position: relative;
}
#tabs > a.active {
  color: var(--accent);
  font-weight: 700;
}
#tabs > a.active:not(.center-tab)::after {
  content: '';
  position: absolute;
  bottom: -4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
#tabs .center-tab {
  justify-content: flex-end;
  padding-bottom: 4px;
}
.raised {
  position: absolute;
  bottom: 28px;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--on-accent);
  border: 5px solid var(--bg);
}
.raised > .icon:first-child {
  width: 18px;
  position: absolute;
  top: 7px;
  right: 5px;
}
.raised > .icon:last-child {
  width: 25px;
  margin: 7px 7px 0 0;
}
.icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
#toast {
  position: fixed;
  bottom: calc(104px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 8px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  max-width: calc(100% - 32px);
  text-align: center;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (prefers-reduced-motion: no-preference) {
  button, a {
    transition: transform 120ms var(--ease-out), background-color 120ms var(--ease-out), color 120ms var(--ease-out);
  }
  #toast {
    transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
  }
}
@media (max-width: 360px) {
  main {
    padding-inline: 12px;
  }
  .topbar {
    padding-inline: 12px;
  }
  .hero {
    padding: 20px 16px;
  }
  .hero .ring {
    width: 92px;
  }
  .subject-chart {
    gap: 10px;
  }
  .donut {
    width: 120px;
  }
  .lesson-card {
    grid-template-columns: 1fr 140px;
    padding: 12px;
  }
  .greeting small {
    font-size: 10px;
  }
  .brand {
    font-size: 16px;
  }
}

.greeting {
  min-width: 0;
}
.greeting > span:last-child {
  min-width: 0;
}
.greeting strong, .profile-identity h1 {
  overflow-wrap: anywhere;
}
.brand {
  flex-shrink: 0;
}

/* Weekly planning shares the existing surface, category and accent tokens. */
.mini-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chips button, .back-heading button { min-height: 44px; }
.back-heading button { min-width: 44px; }
.section-heading a { min-height: 44px; }
.plan-week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-week-nav strong { font-size: 13px; text-align: center; }
.plan-week-nav button { padding: 10px; min-width: 44px; }
.plan-week-nav button:last-child .icon { transform: rotate(180deg); }
.plan-strip { gap: 4px; }
.plan-strip .day-chip { background: transparent; padding: 8px 0; min-width: 0; }
.plan-strip .today { border-color: var(--accent); }
.plan-strip .selected { background: var(--accent); color: var(--bg); }
.plan-strip .selected strong { color: inherit; }
.plan-day-status { height: 16px; line-height: 16px; }
.plan-timeline { margin-block: 20px; }
.plan-row { display: grid; grid-template-columns: 1fr 54px; gap: 12px; margin-bottom: 12px; }
.plan-row > .plan-clock { grid-column: 2; grid-row: 1; text-align: center; padding-top: 14px; }
.plan-clock { direction: ltr; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-clock small { display: block; margin-top: 8px; }
.plan-card { grid-column: 1; grid-row: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 18px; padding: 12px; }
.plan-card.is-done { border-color: var(--accent); }
.plan-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-check { min-width: 44px; min-height: 44px; padding: 10px; border-radius: 50%; flex-shrink: 0; }
.plan-check.checked { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.plan-tag { display: inline-flex; font-size: 10px; color: var(--text); border: 1px solid var(--category); border-inline-start-width: 4px; border-radius: 8px; padding: 3px 7px; white-space: nowrap; }
.plan-edit { display: flex; flex-direction: column; align-items: start; text-align: right; gap: 6px; border: 0; background: transparent; border-radius: 12px; padding: 10px 0; width: 100%; overflow-wrap: anywhere; }
.plan-edit strong { font-size: 14px; }
.plan-edit span { font-size: 12px; }
.plan-timer { color: var(--accent); font-size: 11px; padding: 8px; background: transparent; border: 0; }
.plan-timer .icon { width: 18px; }
.plan-copy { margin-top: 12px; font-size: 12px; }
.today-plan-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-block: 8px; border-bottom: 1px solid var(--line); }
.today-plan-row:last-child { border: 0; }
.today-plan-row strong { font-size: 12px; flex: 1; }
.plan-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-block: 18px; text-align: center; }
.plan-bar { height: 92px; display: flex; align-items: end; justify-content: center; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.plan-bar > span { position: relative; display: block; width: 22px; border-radius: 6px 6px 0 0; background: color-mix(in srgb, var(--accent) 25%, var(--surface)); }
.plan-bar i { position: absolute; inset-inline: 0; bottom: 0; display: block; background: var(--accent); border-radius: inherit; }
.plan-sheet { position: fixed; inset: auto 0 0; width: min(480px, 100%); max-height: 90dvh; overflow: auto; margin: 0 auto; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 24px 24px 0 0; color: var(--text); background: var(--surface); overscroll-behavior: contain; }
.plan-sheet::backdrop { background: #08192d99; }
body:has(.plan-sheet[open]) { overflow: hidden; }
.plan-sheet .section-heading { margin: 0; }
.plan-sheet h2 { margin: 0; }
.plan-time-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.plan-repeat { flex-wrap: nowrap; gap: 4px; }
.plan-repeat button { flex: 1; padding: 8px 0; min-width: 0; }
.welcoming main { padding-top: env(safe-area-inset-top); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.welcome { min-height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 24px; }
.welcome-top { display: flex; justify-content: space-between; align-items: center; }
.welcome-top button, .welcome-previous { background: transparent; border: 0; color: var(--muted); }
.welcome-dots { display: flex; gap: 8px; }
.welcome-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.welcome-dots .active { background: var(--accent); width: 24px; border-radius: 9px; }
.welcome-intro { text-align: center; margin-block: auto; }
.welcome-intro img { border-radius: 28px; margin-bottom: 24px; }
.welcome h1 { margin-bottom: 12px; }
.welcome-intro p { font-size: 13px; }
.welcome-features { display: grid; gap: 16px; margin: 32px auto; max-width: 260px; text-align: right; }
.welcome-features > div { display: flex; align-items: center; gap: 16px; font-size: 14px; }
.welcome > .primary { margin-top: auto; }
.welcome-groups { display: grid; gap: 12px; }
.welcome-groups button { justify-content: start; border-radius: 18px; gap: 16px; padding: 16px; min-height: 76px; }
.welcome-groups button.active { border-color: var(--accent); background: var(--bg); }
.welcome-groups button > .icon { margin-inline-start: auto; color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .plan-sheet[open] { animation: plan-sheet-in 240ms var(--ease-drawer); }
  @keyframes plan-sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
}
.plan-strip { grid-template-columns: repeat(7, minmax(44px, 1fr)); gap: 2px; overflow-x: auto; }
.plan-repeat { overflow-x: auto; }
.plan-repeat button { min-width: 44px; }

/* repeat-day toggles: always fit in one row */
.chips.plan-repeat {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  flex-wrap: nowrap;
}
.chips.plan-repeat button {
  min-width: 0;
  min-height: 44px;
  padding: 0;
}

/* Neon Night: fixed artwork never depends on mobile background-attachment. */
body { isolation: isolate; background: transparent; }
.app-shell { position: relative; }
.topbar { padding-block: calc(24px + env(safe-area-inset-top)) 24px; }
.brand { font-size: 25px; gap: 10px; }
.brand img { border-radius: 11px; border: 1px solid #4ebee4; box-shadow: 0 0 0 3px #4ebee410, 0 0 14px #ff3ea518; }
.brand strong { position: relative; font-weight: 900; background: var(--chrome); background-clip: text; -webkit-background-clip: text; color: transparent; }
.brand strong::before { content: attr(data-text); position: absolute; inset: 0; color: transparent; text-shadow: 0 0 12px #4ebee455, 2px 1px 18px #ff3ea530; z-index: -1; }
h1, .back-heading h1, .ring-center strong, .stat-tile strong, .profile-stats strong, .rank-stats strong { font-weight: 900; }
h1, .ring-center strong, .stat-tile strong, .profile-stats strong { background: var(--chrome); background-clip: text; -webkit-background-clip: text; color: transparent; }
h2 { font-weight: 800; }
.greeting small { font-size: 11px; }
.avatar { background: var(--surface); border-color: #4ebee450; }
.card, .stat-tile, .profile-card, .plan-card, .lesson-card {
  border: 1px solid transparent;
  border-radius: 22px;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, #4ebee448, #ff3ea51c 65%, #4ebee420) border-box;
  box-shadow: inset 0 1px 0 #bfe9ff08;
}
.hero {
  position: relative; overflow: hidden; min-height: 262px; align-items: flex-end;
  margin-inline: -8px; padding: 32px 24px; border-radius: 26px;
  border: 1px solid #4ebee44d;
  background: linear-gradient(90deg, #060f1f30, #060f1fa3 60%, #060f1fed), url('./img/vc/hero-bg.webp') 58% center / cover, #08192d;
}
.hero > div:first-child { position: relative; z-index: 1; max-width: 65%; }
.hero h1 { font-size: clamp(25px, 6.5vw, 34px); line-height: 1.65; background-image: linear-gradient(#fff, #bfe9ff 65%, #4ebee4); }
.hero-kicker { color: #eaf6ff; opacity: 1; font-size: 14px; }
.hero p { color: #eaf6ff; font-size: 12px; margin-block: 5px 20px; }
.hero .white { background: var(--sunset); color: #060f1f; font-weight: 800; min-height: 46px; padding-inline: 20px; box-shadow: 0 0 22px #ff3ea52b; font-size: 13px; }
.hero .ring { width: 112px; align-self: flex-end; margin-bottom: 8px; }
.hero .ring-center strong { background-image: linear-gradient(#fff, #bfe9ff 65%, #4ebee4); }
.ring svg { overflow: visible; }
.ring-value { filter: drop-shadow(0 0 3px #4ebee466); }
.ring-track, .timer-ring .ring-track { stroke: #8fb0c829; }
.asset-icon { position: relative; display: inline-grid; place-items: center; width: var(--asset-size); height: var(--asset-size); flex-shrink: 0; vertical-align: middle; }
.asset-icon > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.asset-icon > .icon { width: 55%; height: 55%; color: var(--accent); visibility: hidden; }
.asset-icon.asset-failed > img { display: none; }
.asset-icon.asset-failed > .icon { visibility: visible; }
.stat-tile { min-width: 0; padding: 16px; gap: 6px; }
.stat-tile .icon-square { background: transparent; width: 40px; height: 40px; }
.stat-tile strong { font-size: 22px; margin-top: 0; overflow-wrap: anywhere; }
.stat-tile > span:last-child { font-size: 12px; }
.section-heading { margin-block: 28px 16px; }
.mini-tools, .tools-grid { gap: 18px 12px; }
.tool-tile, .mini-tools .tool-tile {
  min-height: 172px; padding: 80px 16px 18px; border-radius: 22px;
  color: var(--text); border: 1px solid color-mix(in srgb, var(--category) 42%, var(--line));
  background: radial-gradient(ellipse at 85% 0%, color-mix(in srgb, var(--category) 17%, transparent), transparent 75%), var(--surface);
  box-shadow: inset 0 1px 0 #bfe9ff0b;
}
.tool-tile > .asset-icon { position: absolute; top: -6px; inset-inline-start: 12px; }
.tool-tile strong, .mini-tools .tool-tile strong { font-size: 14px; font-weight: 800; }
.tool-tile small, .mini-tools .tool-tile small { color: var(--muted); font-size: 11px; }
.soon-badge, .badge { background: transparent; color: var(--pink); border: 1px solid var(--pink); font-size: 10px; }
.soon-badge { top: 14px; left: 10px; }
.upcoming .icon-square { background: #4ebee418; color: var(--accent); }
.day-chip.today { border-color: #4ebee480; box-shadow: inset 0 0 16px #4ebee40a; }
.chips button, .segments > *, input, select, textarea { min-height: 44px; }
.chips button { background: var(--surface); }
.chips .active, .segments .active, .welcome-groups button.active { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px #4ebee41a; }
.segments { background: var(--bg-2); border: 1px solid var(--line); }
input, select, textarea { background: var(--bg-2); border-radius: 12px; color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.primary { box-shadow: 0 0 18px #4ebee418; }
.timer-ring { width: min(280px, 100%); margin-block: 28px; }
.timer-ring #clock { font-size: clamp(30px, 8vw, 40px); font-weight: 900; direction: ltr; }
.timer-ring .ring-value { stroke-width: 5; }
.timer-ring::after { content: ''; position: absolute; inset: 5%; border: 1px solid #4ebee420; border-radius: 50%; pointer-events: none; }
.rank-stats > div { color: var(--text); background: var(--surface); border: 1px solid var(--line); padding: 14px 4px; }
.rank-stats small { display: block; color: var(--muted); }
.rank-stats strong { color: var(--accent); font-size: 22px; }
.range-bar { position: relative; background: linear-gradient(90deg, #4ebee42b, #ff3ea536); height: 8px; }
.range-bar span { background: linear-gradient(90deg, #4ebee4, #ff3ea5); }
.range-bar::after { content: ''; position: absolute; left: 50%; top: -4px; width: 4px; height: 16px; border-radius: 4px; background: var(--accent); box-shadow: 0 0 10px #4ebee480; }
.bar-chart rect { fill: url(#chart-neon); }
.plan-bar i, .type-track span { background: linear-gradient(0deg, #4ebee4, #ff3ea5); }
.donut-slice:active { filter: drop-shadow(0 0 3px currentColor); }
.podium { padding-top: 60px; }
.winner { top: -45px; }
.pedestal { color: var(--text); background: linear-gradient(0deg, #4ebee408, #4ebee420); border: 1px solid #4ebee480; border-bottom: 0; }
.place-1 .pedestal { background: linear-gradient(145deg, #4ebee430, #ff3ea525); border-color: #ff3ea580; }
.place-3 .pedestal { background: linear-gradient(0deg, #ff8a3d08, #ff8a3d20); border-color: #ff8a3d90; }
.profile-cover { background: linear-gradient(90deg, #060f1f99, #060f1fcc), url('./img/vc/hero-bg.webp') center 52% / cover, #08192d; }
.profile-avatar { border: 4px solid var(--bg); }
#tabs {
  bottom: calc(12px + env(safe-area-inset-bottom)); width: min(456px, calc(100% - 24px));
  padding: 10px 6px; border-radius: 26px; border: 1px solid #4ebee438;
  background: color-mix(in srgb, var(--bg-2) 94%, transparent); backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 #4ebee440;
}
#tabs > a { min-height: 56px; font-size: 10px; }
#tabs > a.active:not(.center-tab)::after { bottom: -3px; box-shadow: 0 0 8px var(--accent); }
#tabs a:active { transform: none; opacity: .75; }
.raised { width: 64px; height: 64px; bottom: 25px; background: var(--sunset); color: #fff; border: 4px solid var(--bg); box-shadow: 0 0 0 1px #ff3ea550, 0 0 24px #ff3ea530; }
.raised > .icon:first-child, .raised > .icon:last-child { position: static; width: 28px; height: 28px; margin: 0; }
.icon { stroke-width: 1.75; }
main { padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
#toast { bottom: calc(112px + env(safe-area-inset-bottom)); }
.plan-sheet { background: var(--surface); backdrop-filter: blur(8px); border-color: #4ebee450; }
.welcome-intro > .asset-icon { display: grid; margin: 0 auto 16px; max-width: 100%; }
.welcome-intro .asset-icon > img { margin: 0; border-radius: 0; filter: drop-shadow(0 0 18px #ff3ea51b); }
.welcome h1 { font-size: 28px; line-height: 1.6; }
.welcome-dots .active { box-shadow: 0 0 10px #4ebee450; }
[data-theme='light'] .card, [data-theme='light'] .stat-tile, [data-theme='light'] .plan-card, [data-theme='light'] .lesson-card, [data-theme='light'] .profile-card { border-color: var(--line); }
[data-theme='light'] .tool-tile { border-color: color-mix(in srgb, var(--category) 38%, var(--line)); }
[data-theme='light'] .pedestal { border-color: var(--accent); }
[data-theme='light'] .place-3 .pedestal { border-color: var(--orange); }
@media (hover: hover) and (pointer: fine) {
  .tool-tile:hover { border-color: var(--category); }
  .donut-slice:hover { filter: drop-shadow(0 0 3px currentColor); }
}
@media (prefers-reduced-motion: no-preference) {
  button, a { transition: transform 120ms var(--ease-out), color 120ms var(--ease-out), background-color 120ms var(--ease-out); }
  .tool-tile:active { box-shadow: inset 0 0 20px #4ebee418, 0 0 12px #4ebee418; }
  .neon-start .brand strong { animation: neon-on 650ms var(--ease-out) both; }
  body::after { animation: none; }
  .timer-ring.is-running::after { animation: timer-breathe 2s var(--ease-out) infinite alternate; box-shadow: 0 0 24px #4ebee438, inset 0 0 20px #ff3ea51a; }
}
@keyframes neon-on { 0% { opacity: .25; } 18% { opacity: 1; } 24% { opacity: .65; } 40%, 100% { opacity: 1; } }
@keyframes scan-drift { to { transform: translateY(4px); } }
@keyframes timer-breathe { from { opacity: .3; } to { opacity: .85; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:active:not(:disabled), a:active { transform: none; }
}
@media (max-width: 360px) {
  .hero { min-height: 248px; padding: 24px 16px; margin-inline: 0; }
  .hero h1 { font-size: 24px; }
  .hero .ring { width: 88px; }
  .hero .ring-center strong { font-size: 23px; }
  .brand { font-size: 21px; }
  .tool-tile, .mini-tools .tool-tile { padding-inline: 12px; }
  .stat-tile strong { font-size: 19px; }
}

/* Living Night: static light, moving silhouettes; no animated paint effects. */
.hero { min-height: 340px; background: linear-gradient(180deg, transparent 12%, #060f1f30 40%, #060f1fb3 100%), url('./img/vc/hero-bg.webp') 58% center / cover, #08192d; }
.hero .hero-copy { position: relative; z-index: 2; max-width: 72%; }
.hero h1 { color: #fff; background: none; font-size: clamp(23px, 5.7vw, 32px); line-height: 1.7; }
.hero .ring { position: relative; z-index: 2; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 55% 23%, #ff8a3d26, transparent 50%); pointer-events: none; animation: sun-breathe 9s ease-in-out infinite alternate; animation-play-state: paused; }
.tone { color: transparent; background: linear-gradient(110deg, #4ebee4 10%, #a8ddf0 35%, #ff3ea5 65%, #4ebee4 95%); background-size: 200% 100%; background-clip: text; -webkit-background-clip: text; }
.hero .tone { animation: text-sheen 12s ease-in-out infinite alternate; animation-play-state: paused; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.hero-kicker::before, .hero-kicker::after { content: ''; width: 22px; height: 1px; background: linear-gradient(90deg, transparent, #bfe9ff, transparent); animation: line-sheen 4s ease-in-out infinite alternate; animation-play-state: paused; }
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.star { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #d9f4ff; animation: star-twinkle 5s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.7s); animation-play-state: paused; }
.meteor { position: absolute; top: calc(5% + var(--i) * 13%); left: calc(10% + var(--i) * 28%); width: 86px; height: 1px; background: linear-gradient(90deg, transparent, #bfe9ff99); transform: rotate(38deg); opacity: 0; animation: meteor-pass 12s linear infinite; animation-delay: calc(var(--i) * -3.7s); animation-play-state: paused; }
.stage { --stage-color: var(--category, #4ebee4); position: relative; display: grid; place-items: center; height: 180px; width: 100%; isolation: isolate; }
.stage-decor { position: absolute; inset: 0; overflow: hidden; pointer-events: none; color: var(--stage-color); }
.stage-decor i { display: block; position: absolute; pointer-events: none; }
.stage-grid { inset: 45% -10% -30%; background: linear-gradient(transparent, color-mix(in srgb, var(--stage-color) 9%, transparent)), repeating-linear-gradient(90deg, transparent 0 31px, currentColor 32px 33px), repeating-linear-gradient(0deg, transparent 0 25px, currentColor 26px 27px); opacity: .10; transform: perspective(140px) rotateX(48deg); mask-image: linear-gradient(transparent, #000 80%); }
.stage-beam { inset: 0 20% 12%; background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--stage-color) 12%, transparent)); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); opacity: .7; }
.stage-disc { width: 46%; height: 22%; bottom: 10%; left: 27%; border: 1px solid color-mix(in srgb, var(--stage-color) 35%, transparent); border-radius: 50%; background: radial-gradient(ellipse, color-mix(in srgb, var(--stage-color) 24%, transparent), transparent 72%); }
.stage-ripple { width: 46%; height: 22%; left: 27%; bottom: 10%; border: 1px solid currentColor; border-radius: 50%; opacity: .12; animation: platform-ripple 5.8s ease-out infinite; animation-play-state: paused; }
.stage-orbit { inset: 35% 12% 19%; border: 1px solid currentColor; border-radius: 50%; opacity: .18; transform: rotate(-18deg); animation: orbit-turn 48s linear infinite; animation-play-state: paused; }
.stage-object { position: relative; z-index: 1; display: grid; place-items: center; animation: stage-float 5s ease-in-out infinite alternate; animation-play-state: paused; }
.stage-spark { width: 2px; height: 2px; border-radius: 50%; background: currentColor; left: calc(26% + var(--i) * 24%); bottom: 15%; opacity: 0; animation: spark-rise 4.8s ease-out infinite; animation-delay: calc(var(--i) * -1.6s); animation-play-state: paused; }
[data-living].is-live::before, .is-live .star, .is-live .meteor, .is-live .stage-object, .is-live .stage-ripple, .is-live .stage-orbit, .is-live .stage-spark, .hero .tone.is-live, .hero-kicker.is-live::before, .hero-kicker.is-live::after { animation-play-state: running; }
.tools-grid { grid-template-columns: 1fr; }
.tool-tile, .mini-tools .tool-tile { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 0 18px 20px; text-align: right; overflow: hidden; min-height: 0; }
.tool-tile .stage { width: calc(100% + 36px); margin-inline: -18px; margin-bottom: 6px; background: radial-gradient(ellipse at 50% 80%, color-mix(in srgb, var(--stage-color) 9%, transparent), transparent 70%); }
.room-link { display: block; margin-top: 14px; font-size: 12px; color: var(--accent); min-height: 24px; }
.mini-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mini-tools .stage { height: 120px; }
.mini-tools .stage-object .asset-icon { width: 68px; height: 68px; }
.mini-tools .room-link { display: none; }
.soon-badge { position: static; align-self: flex-start; order: 5; margin-top: 12px; padding: 5px 10px; }
/* Visibility gates every room independently, including its platform ripple. */
.timer-stage { height: 350px; margin-block: 12px; }
.timer-stage .stage-object { width: 100%; }
.timer-stage .timer-ring { margin: 0 auto 26px; }
.timer-stage .stage-orbit { inset: 47% 3% 8%; animation-duration: 70s; }
.timer-stage .stage-disc, .timer-stage .stage-ripple { bottom: 5%; }
.timer-stage.paused .stage-decor { opacity: .35; }
.timer-stage.paused .stage-object, .timer-stage.paused .stage-decor i { animation-play-state: paused; }
.timer-ring #clock { display: block; letter-spacing: -.02em; font-variant-numeric: tabular-nums; font-weight: 800; font-size: clamp(30px, 8vw, 40px); line-height: 1.4; white-space: nowrap; }
.timer-ring.is-running::after { animation: none; box-shadow: none; }
.welcome-intro { position: relative; isolation: isolate; }
.welcome-stage { height: 280px; }
.welcome-stage .stage-object { z-index: 1; }
.welcome-intro > .sky { z-index: -1; }
.welcome-intro .sky .meteor { animation-play-state: paused; }
.welcome-intro:has(.is-live) .sky .meteor, .welcome-intro:has(.is-live) .sky .star { animation-play-state: running; }
.numbered-row { position: relative; padding-inline-start: 35px; }
.numbered-row::before { content: attr(data-number); position: absolute; inset-inline-start: 0; top: 10px; color: var(--accent); font-size: 12px; font-weight: 800; }
.numbered-row::after { content: ''; position: absolute; inset-inline-start: 10px; top: 36px; bottom: -16px; width: 1px; background: var(--line); pointer-events: none; }
.numbered-row:last-child::after { display: none; }
#tabs > a.active:not(.center-tab) { background: #4ebee417; border-radius: 18px; color: var(--text); }
#tabs > a.active:not(.center-tab)::after { width: 18px; height: 3px; border-radius: 4px; bottom: 2px; background: var(--accent); box-shadow: 0 0 5px #4ebee466; }
.brand strong::before { opacity: .6; }
.ring-value { filter: drop-shadow(0 0 2px #4ebee43d); }
.hero .white { box-shadow: 0 0 12px #ff3ea51a; }
.reveal-pending { opacity: 0; transform: translateY(12px); }
.revealed { transition: opacity 360ms cubic-bezier(.23,1,.32,1), transform 360ms cubic-bezier(.23,1,.32,1); }
@keyframes sun-breathe { to { opacity: .35; transform: scale(1.06); } }
@keyframes text-sheen { to { background-position: 100% 0; } }
@keyframes line-sheen { from { opacity: .3; transform: scaleX(.65); } to { opacity: .9; transform: scaleX(1); } }
@keyframes star-twinkle { from { opacity: .2; } to { opacity: .85; } }
@keyframes meteor-pass { 0%, 82% { opacity: 0; transform: translate(-60px,-40px) rotate(38deg); } 85% { opacity: .6; } 96%, 100% { opacity: 0; transform: translate(190px,150px) rotate(38deg); } }
@keyframes stage-float { to { transform: translateY(-7px); } }
@keyframes platform-ripple { from { transform: scale(.85); opacity: .22; } to { transform: scale(1.8); opacity: 0; } }
@keyframes orbit-turn { to { transform: rotate(342deg); } }
@keyframes spark-rise { 0% { opacity: 0; transform: translateY(0); } 25% { opacity: .5; } 100% { opacity: 0; transform: translateY(-75px); } }
@keyframes living-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: no-preference) {
  .rise-sequence .hero-kicker, .rise-sequence h1, .rise-sequence p, .rise-sequence .white, .welcome-intro.rise-sequence .welcome-features { animation: living-rise 580ms cubic-bezier(.23,1,.32,1) both; }
  .rise-sequence h1 { animation-delay: 90ms; }
  .rise-sequence p { animation-delay: 180ms; }
  .rise-sequence .white, .welcome-intro.rise-sequence .welcome-features { animation-delay: 270ms; }
  .range-bar::before { content: ''; position: absolute; left: calc(50% - 8px); top: -4px; width: 16px; height: 16px; border: 1px solid var(--pink); border-radius: 50%; animation: platform-ripple 650ms ease-out both; pointer-events: none; }
}
[data-theme='light'] .stage { --stage-color: var(--category, #2583a2); background-color: #eaf4fa; border-radius: 16px; }
[data-theme='light'] .stage-beam { opacity: .35; }
[data-theme='light'] .meteor { display: none; }
[data-theme='light'] .tone { background-image: linear-gradient(110deg, #176a86, #a62068, #176a86); }
[data-theme='light'] .hero .tone { background-image: linear-gradient(110deg, #80d9f5, #ff94cf, #80d9f5); }
[data-theme='light'] .room-link, [data-theme='light'] .numbered-row::before { color: #176a86; }
@media (prefers-reduced-motion: reduce) {
  .stage *, .sky *, .hero::before, .hero .tone, .hero-kicker::before, .hero-kicker::after { animation: none !important; }
  .meteor { display: none; }
  .reveal-pending, .revealed { opacity: 1; transform: none; transition: none; }
}

.stage-beam { animation: beam-breathe 8s ease-in-out infinite alternate; animation-play-state: paused; }
.is-live .stage-beam { animation-play-state: running; }
.timer-stage.paused .stage-beam { animation-play-state: paused; }
.timer-stage.paused .stage-object { opacity: .78; }
@keyframes beam-breathe { to { opacity: .35; transform: scaleX(.9); } }
[data-theme='light'] .stage-grid { opacity: .07; }
[data-theme='light'] .stage-beam { animation: none; opacity: .25; }

.stage .orbit-outer { inset: 27% 6% 25%; animation-duration: 30s; animation-direction: reverse; opacity: .1; }
.timer-stage .orbit-outer { inset: 38% 0 16%; }
.screen-title { font-size: 26px; margin-block: 0 20px; color: var(--text); background: none; }

/* compact clock: one fixed cell per digit */
.timer-ring #clock { font-variant-numeric: normal; letter-spacing: 0; }
.timer-ring #clock .cd { display: inline-block; width: .56em; text-align: center; }
.timer-ring #clock .cc { display: inline-block; width: .3em; text-align: center; }

/* Shared beach: only this scene is fixed; all scenery stays inside its containment. */
.beach-scene {
  position: fixed; inset: 0; z-index: -1; contain: strict;
  overflow: hidden; pointer-events: none;
  --water: #4ebee4; --water-pink: #ff3ea5; --palm: #071926;
  background: linear-gradient(180deg, #060f1f 0%, #102639 46%, #69253f 69%, #123849 72%, #071926 100%);
}
.beach-haze { position: absolute; width: 110%; height: 55%; left: -25%; top: 23%; border-radius: 50%; background: radial-gradient(ellipse, #ff3ea52b, transparent 67%); animation: beach-drift 32s ease-in-out infinite alternate; }
.haze-two { left: 20%; top: 15%; background: radial-gradient(ellipse, #4ebee421, transparent 65%); animation-duration: 39s; animation-delay: -19s; animation-direction: alternate-reverse; }
.beach-stars { position: absolute; inset: 0 0 40%; }
.beach-stars i { position: absolute; width: 2px; height: 2px; background: #daf7ff; border-radius: 50%; animation: beach-twinkle 7s ease-in-out infinite alternate; }
.beach-stars i:nth-child(1) { left: 12%; top: 17%; }
.beach-stars i:nth-child(2) { left: 34%; top: 35%; animation-delay: -3s; }
.beach-stars i:nth-child(3) { left: 72%; top: 12%; animation-delay: -5s; }
.beach-stars i:nth-child(4) { left: 87%; top: 49%; animation-delay: -2s; }
.beach-stars i:nth-child(5) { left: 53%; top: 9%; animation-delay: -6s; }
.beach-stars i:nth-child(6) { left: 8%; top: 56%; animation-delay: -4s; }
.beach-sun { position: absolute; left: 57%; bottom: 27%; width: clamp(90px, 22vw, 190px); aspect-ratio: 1; border-radius: 50%; background: linear-gradient(#ff8a3d, #ff3ea5); mask-image: repeating-linear-gradient(to bottom, #000 0 12%, transparent 12% 15%); box-shadow: 0 0 65px #ff3ea533; opacity: .55; animation: beach-breathe 11s ease-in-out infinite alternate; }
[data-beach-home='true'] .beach-sun { opacity: .16; }
.beach-ocean { position: absolute; inset: 70% 0 0; background: linear-gradient(#143a4c99, #061b2e); overflow: hidden; }
.beach-wave { position: absolute; width: 200%; height: 65%; left: 0; top: 1%; fill: var(--water); opacity: .09; animation: beach-wave 30s linear infinite; will-change: transform; }
.wave-1 { top: 16%; opacity: .12; fill: var(--water-pink); animation-duration: 23s; animation-direction: reverse; }
.wave-2 { top: 34%; opacity: .17; animation-duration: 18s; animation-delay: -8s; }
.wave-3 { top: 53%; opacity: .2; animation-duration: 12s; animation-direction: reverse; }
.beach-reflection { position: absolute; left: 55%; top: 0; width: 24%; height: 100%; background: repeating-linear-gradient(180deg, #ff8a3d55 0 2px, transparent 2px 12px); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); animation: beach-shimmer 6s ease-in-out infinite alternate; }
.beach-reflection i { position: absolute; inset: 10% 0 0; background: repeating-linear-gradient(180deg, #ff3ea566 0 2px, transparent 2px 21px); animation: beach-shimmer 4s ease-in-out infinite alternate-reverse; }
.beach-reflection i:nth-child(2) { inset: 30% 10% 0; animation-delay: -2s; }
.beach-reflection i:nth-child(3) { inset: 60% -10% 0; animation-delay: -3s; }
.beach-palm { position: absolute; bottom: 7%; width: clamp(105px, 24vw, 290px); transform-origin: 59% 98%; animation: beach-sway 7s ease-in-out infinite alternate; }
.beach-palm svg { display: block; width: 100%; fill: var(--palm); stroke: #ff3ea536; stroke-width: .8; }
.palm-left { left: -3%; }
.palm-right { right: -4%; scale: -1 1; animation-duration: 9s; animation-delay: -4s; }
.beach-scrim { position: absolute; inset: 0; background: linear-gradient(90deg, #060f1f18, #060f1fbd 30% 70%, #060f1f18); }
.app-shell { background: #060f1f55; }
[data-theme='light'] .beach-scene { --water: #339fba; --water-pink: #efa5b5; --palm: #376d71; background: linear-gradient(#b6e5f6, #daedf3 44%, #f6c8bd 70%, #91d9dc 71%, #63b9cb); }
[data-theme='light'] .beach-haze { opacity: .45; }
[data-theme='light'] .beach-stars { display: none; }
[data-theme='light'] .beach-sun { background: linear-gradient(#fff0e5, #ffc2ac); }
[data-theme='light'] .beach-ocean { background: linear-gradient(#a1e2df, #6ebccc); }
[data-theme='light'] .beach-scrim { background: linear-gradient(90deg, #eaf6fb18, #eaf6fbd9 30% 70%, #eaf6fb18); }
[data-theme='light'] .app-shell { background: #eaf6fb66; }
@keyframes beach-drift { to { transform: translate(18%, -6%) scale(1.12); } }
@keyframes beach-twinkle { from { opacity: .2; } to { opacity: .8; } }
@keyframes beach-breathe { to { transform: scale(1.04); } }
@keyframes beach-wave { 0% { transform: translate(0, 0); } 50% { transform: translate(-25%, 5px); } 100% { transform: translate(-50%, 0); } }
@keyframes beach-shimmer { from { opacity: .35; transform: scaleX(.8); } to { opacity: .7; transform: scaleX(1.08); } }
@keyframes beach-sway { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }

/* Fake glass is the default: dense chip rows never allocate backdrop layers. */
:root { --glass-fill: #ffffff1c; --glass-tint: #ffffff05; --glass-edge: #ffffff66; }
[data-theme='light'] { --glass-fill: #ffffff8c; --glass-edge: #ffffffdd; }
button, .button, .raised {
  position: relative; isolation: isolate; overflow: hidden; min-height: 44px;
  border: 1px solid transparent; color: var(--text);
  background: linear-gradient(155deg, var(--glass-fill), var(--glass-tint)) padding-box,
    linear-gradient(135deg, var(--glass-edge), #ffffff0a 75%) border-box;
  box-shadow: inset 0 -8px 14px -12px var(--accent), 0 5px 12px #00000020;
  transition: transform 100ms var(--ease-out);
}
button::before, .button::before, .raised::before {
  content: ''; position: absolute; z-index: -1; inset: 1px 2px 52%; border-radius: inherit;
  background: linear-gradient(#ffffff2e, #ffffff02); pointer-events: none;
  transition: transform 100ms var(--ease-out), opacity 100ms var(--ease-out);
}
.primary, .hero .white, .raised {
  --glass-tint: #4ebee43d; --glass-fill: #4ebee452;
  color: #eaf6ff; font-weight: 800;
  background: linear-gradient(150deg, var(--glass-fill), var(--glass-tint)) padding-box,
    linear-gradient(135deg, #ffffffa3, #4ebee433 80%) border-box;
}
.hero .white, .raised { --glass-fill: #ff8a3dc9; --glass-tint: #ff3ea599; color: #060f1f; }
.raised { border-width: 1px; border-radius: 50%; }
[data-theme='light'] .primary { --glass-fill: #4ebee480; --glass-tint: #ffffff80; color: #0e2f52; }
.danger { --glass-fill: #ff89952b; --glass-tint: #ff899512; color: var(--error); }
.chips .active, .segments .active, .welcome-groups button.active { --glass-fill: #4ebee430; --glass-tint: #4ebee418; color: var(--accent); border-color: var(--accent); }
.back-heading button, .session button, .plan-week-nav button { border-radius: 50%; min-width: 44px; padding: 10px; }
#tabs { background: linear-gradient(140deg, #16394be8, #08192de8); border: 1px solid #ffffff40; box-shadow: inset 0 1px 0 #ffffff40, inset 0 -12px 24px -24px #4ebee4, 0 8px 24px #00000030; }
[data-theme='light'] #tabs { background: linear-gradient(140deg, #ffffffcc, #eaf6fbe6); }
@supports (backdrop-filter: blur(14px)) {
  /* Only the two main action locations, floating bar and sheets get real blur. */
  .hero .white, .timer-actions .primary, #log-form > .entry-card > .primary, #tabs, .plan-sheet {
    backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  }
}
.primary::after, .hero .white::after, .raised::after {
  content: ''; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, #ffffff24 48%, transparent 66%);
  transform: translateX(-150%); animation: glass-sheen 6s ease-in-out infinite;
}
@keyframes glass-sheen { 0%, 75% { transform: translateX(-150%); } 100% { transform: translateX(150%); } }
button:active:not(:disabled), .button:active, #tabs a:active .raised { transform: scale(.97); opacity: 1; }
button:active:not(:disabled)::before, .button:active::before { transform: translateY(3px); opacity: .8; }
button:disabled { opacity: .45; filter: saturate(0); }
button:disabled::before, button:disabled::after { display: none; }
button:focus-visible, .button:focus-visible, #tabs a:focus-visible { outline: 3px solid #4ebee4; outline-offset: 3px; }
/* Hide pauses every CSS animation, including existing hero/room decoration. */
[data-motion-paused='true'] *, [data-motion-paused='true'] *::before, [data-motion-paused='true'] *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .beach-scene *, .primary::after, .hero .white::after, .raised::after { animation: none !important; }
  button:active:not(:disabled), .button:active, #tabs a:active .raised { transform: none; }
}
/* Match component specificity so legacy solid fills cannot mask the material. */
.chips button, .segments > button, .welcome-groups button, .welcome-groups button.active,
.back-heading button, .session button, .time-steppers button, .plan-week-nav button,
.welcome-top button, .welcome-previous {
  background: linear-gradient(155deg, var(--glass-fill), var(--glass-tint)) padding-box,
    linear-gradient(135deg, var(--glass-edge), #ffffff0a 75%) border-box;
}
button.tool-tile {
  background: linear-gradient(155deg, #ffffff1c, #ffffff03) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--glass-edge), #ffffff0a 75%) border-box;
}
@media (prefers-reduced-motion: reduce) {
  button:active:not(:disabled)::before, .button:active::before { transform: none; }
}
/* round-6 fixes: the glass rule set .raised to position:relative, which dropped the center disc into the row */
#tabs .raised { position: absolute; bottom: 30px; color: #fff; }
.primary, .timer-actions .primary { --glass-fill: #6fd6f5d9; --glass-tint: #2a8fc2c2; color: #04121f; }
[data-theme='light'] .primary { --glass-fill: #6fd6f5e6; --glass-tint: #3aa6d6cc; color: #04121f; }

/* day/night toggle in the header */
.topbar { gap: 10px; }
.theme-toggle { order: 3; flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; color: var(--accent); }
[data-theme='light'] .theme-toggle { color: #e2622a; }
.theme-toggle svg { transition: transform 300ms var(--ease-out); }
.theme-toggle:active svg { transform: rotate(-30deg) scale(.92); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 260ms; }
/* day twin of the hero art (Miami Day) */
[data-theme='light'] .hero { background: linear-gradient(270deg, #0b3b5cc7 0%, #0b3b5c8c 42%, transparent 72%), linear-gradient(180deg, transparent 30%, #0b3b5c99 100%), url('./img/vc/hero-bg-day.webp') 58% center / cover, #8fd3f0; }
[data-theme='light'] .profile-cover { background: linear-gradient(90deg, #0b3b5c66, #0b3b5cb3), url('./img/vc/hero-bg-day.webp') center 52% / cover, #8fd3f0; }
[data-theme='light'] .hero h1, [data-theme='light'] .hero h2, [data-theme='light'] .hero p, [data-theme='light'] .hero small { text-shadow: 0 1px 8px #06223a8c; }
[data-theme='light'] .hero .star { display: none; }
