@font-face {
  font-family: "Craftwork Grotesk";
  src: url("/static/fonts/CraftworkGrotesk-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Craftwork Grotesk";
  src: url("/static/fonts/CraftworkGrotesk-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Craftwork Grotesk";
  src: url("/static/fonts/CraftworkGrotesk-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Craftwork Grotesk";
  src: url("/static/fonts/CraftworkGrotesk-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fbfbfb;
  --bg-soft: #f7f8f4;
  --surface: #fdfdfc;
  --surface-elev: #ffffff;
  --surface-soft: #f4f7f1;
  --surface-border: rgba(255, 255, 255, 0.8);
  --primary: #485935;
  --primary-soft: #93a267;
  --accent-soft: #cadbb7;
  --text: #1f2220;
  --text-muted: #5f665d;
  --line: #dde4d8;
  --danger: #a5403f;
  --radius-2xl: 28px;
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-pill: 999px;
  --shadow-soft: 12px 12px 28px rgba(185, 190, 183, 0.2), -9px -9px 20px rgba(255, 255, 255, 0.97);
  --shadow-card: 8px 8px 18px rgba(191, 197, 188, 0.19), -6px -6px 14px rgba(255, 255, 255, 0.95);
  --shadow-inset: inset 3px 3px 8px rgba(180, 186, 178, 0.18), inset -3px -3px 8px rgba(255, 255, 255, 0.95);
  --wave-transition: 0.5s cubic-bezier(0.2, 0.72, 0.24, 1);
  --bg-drift: 0px;
  --pull-distance: 0px;
}

:root[data-theme="dark"] {
  --bg: #070b10;
  --bg-soft: #05090d;
  --surface: #292e32;
  --surface-elev: #30363a;
  --surface-soft: #262b2f;
  --surface-border: rgba(180, 190, 184, 0.12);
  --primary: #c5d6df;
  --primary-soft: #8ea4b2;
  --accent-soft: #33424b;
  --text: #edf1ef;
  --text-muted: #b5bfba;
  --line: #3f4844;
  --danger: #e29999;
  --shadow-soft: 16px 16px 36px rgba(9, 11, 12, 0.44), -9px -9px 24px rgba(65, 73, 71, 0.16);
  --shadow-card: 10px 10px 22px rgba(9, 11, 12, 0.34), -6px -6px 16px rgba(66, 75, 72, 0.14);
  --shadow-inset: inset 3px 3px 9px rgba(9, 11, 12, 0.42), inset -2px -2px 8px rgba(62, 70, 68, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(1400px 900px at 88% -4%, rgba(94, 198, 215, 0.2) 0%, rgba(17, 49, 66, 0.11) 38%, rgba(7, 11, 16, 0) 66%),
    radial-gradient(1100px 760px at 62% 36%, rgba(59, 165, 189, 0.14) 0%, rgba(12, 43, 59, 0.08) 40%, rgba(7, 11, 16, 0) 72%),
    radial-gradient(980px 680px at 26% 78%, rgba(47, 141, 170, 0.11) 0%, rgba(9, 32, 44, 0.06) 36%, rgba(7, 11, 16, 0) 68%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  background-attachment: fixed;
}

:root[data-theme="dark"] body::before,
:root[data-theme="dark"] body::after {
  content: "";
  position: fixed;
  inset: -24vh -18vw;
  pointer-events: none;
  z-index: -1;
  will-change: transform;
}

:root[data-theme="dark"] body::before {
  background:
    radial-gradient(1120px 720px at 86% 8%, rgba(126, 222, 238, 0.22) 0%, rgba(30, 91, 118, 0.12) 37%, rgba(7, 11, 16, 0) 72%),
    radial-gradient(900px 620px at 54% 46%, rgba(86, 195, 216, 0.12) 0%, rgba(15, 56, 74, 0.08) 42%, rgba(7, 11, 16, 0) 76%);
  transform: translate3d(0, calc(var(--bg-drift) * 0.26), 0);
  opacity: 0.9;
}

:root[data-theme="dark"] body::after {
  background:
    radial-gradient(1020px 700px at 32% 74%, rgba(64, 167, 193, 0.14) 0%, rgba(13, 45, 61, 0.07) 39%, rgba(7, 11, 16, 0) 74%),
    radial-gradient(860px 540px at 66% 24%, rgba(88, 185, 209, 0.08) 0%, rgba(10, 37, 51, 0.04) 40%, rgba(7, 11, 16, 0) 74%);
  transform: translate3d(0, calc(var(--bg-drift) * -0.16), 0);
  opacity: 0.85;
}

body {
  margin: 0;
  font-family: "Craftwork Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

:root:not([data-theme="dark"]) body::before,
:root:not([data-theme="dark"]) body::after {
  content: "";
  position: fixed;
  inset: -20vh -16vw;
  pointer-events: none;
  z-index: -1;
  display: none;
  will-change: transform;
}

:root:not([data-theme="dark"]) body::before {
  background:
    radial-gradient(1120px 760px at 22% 34%, rgba(166, 227, 176, 0.24) 0%, rgba(203, 239, 209, 0.15) 34%, rgba(242, 250, 243, 0) 70%),
    radial-gradient(980px 660px at 72% 22%, rgba(218, 242, 177, 0.17) 0%, rgba(233, 247, 208, 0.1) 32%, rgba(244, 251, 244, 0) 70%);
  transform: translate3d(0, calc(var(--bg-drift) * 0.12), 0);
  opacity: 0.9;
}

:root:not([data-theme="dark"]) body::after {
  background:
    radial-gradient(1000px 700px at 78% 74%, rgba(168, 223, 178, 0.2) 0%, rgba(207, 238, 214, 0.11) 36%, rgba(244, 251, 245, 0) 72%),
    radial-gradient(860px 560px at 38% 86%, rgba(205, 236, 159, 0.15) 0%, rgba(225, 244, 189, 0.09) 32%, rgba(244, 251, 244, 0) 70%);
  transform: translate3d(0, calc(var(--bg-drift) * -0.08), 0);
  opacity: 0.82;
}

.app-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 12px 98px;
  transform: translateY(var(--pull-distance));
  transition: transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.js .app-shell {
  opacity: 0;
  transform: translateY(calc(var(--pull-distance) + 8px));
  transition: opacity 320ms ease, transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.js.app-ready .app-shell {
  opacity: 1;
  transform: translateY(var(--pull-distance));
}

.js.is-page-leaving .app-shell {
  opacity: 0;
  transform: translateY(calc(var(--pull-distance) + 6px));
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.4, 0, 1, 1);
}

.js.is-page-leaving .bottom-nav {
  opacity: 1;
  transform: translateY(var(--pull-distance));
}

.js.is-pulling .app-shell,
.js.is-pulling .bottom-nav {
  transition: none !important;
}

.page {
  display: grid;
  gap: 10px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Craftwork Grotesk", "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(1.3rem, 3.4vw, 1.9rem);
  line-height: 1.15;
}

h3 {
  font-size: 0.98rem;
}

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

.tiny {
  font-size: 0.85rem;
}

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

.hero-card,
.soft-card,
.lesson-card,
.empty-card,
.welcome-shell {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-soft);
  padding: 13px;
}

.hero-card--gradient,
.welcome-shell {
  background: linear-gradient(154deg, var(--surface-elev) 0%, var(--surface-soft) 100%);
}

.lesson-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  background: var(--surface-elev);
}

.empty-card {
  text-align: center;
  color: var(--text-muted);
}

.stack {
  display: grid;
  gap: 9px;
}

.stack.small {
  gap: 6px;
}

.grid {
  display: grid;
  gap: 9px;
}

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

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

.btn,
.tab,
.chip-btn,
.list-item,
.link-card {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #ffffff;
  color: var(--text);
  padding: 9px 13px;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: "Craftwork Grotesk", sans-serif;
  box-shadow: var(--shadow-card);
  transition: transform var(--wave-transition), box-shadow var(--wave-transition), background-color var(--wave-transition),
    color var(--wave-transition), border-color var(--wave-transition);
}

:root[data-theme="dark"] .btn,
:root[data-theme="dark"] .tab,
:root[data-theme="dark"] .chip-btn,
:root[data-theme="dark"] .list-item,
:root[data-theme="dark"] .link-card {
  background: #34393d;
  border-color: #4b5359;
}

.btn:hover,
.tab:hover,
.chip-btn:hover,
.list-item:hover,
.link-card:hover {
  transform: translateY(-1px);
}

.btn:active,
.tab:active,
.chip-btn:active,
.list-item:active,
.link-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-inset);
}

.btn:focus-visible,
.tab:focus-visible,
.chip-btn:focus-visible,
.list-item:focus-visible,
.input:focus-visible,
.bottom-nav__item:focus-visible {
  outline: 2px solid var(--primary-soft);
  outline-offset: 2px;
}

.btn-primary,
.btn-accent,
.tab.is-active,
.chip-btn.is-active {
  color: #233127;
  border-color: #d4ddd4;
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .btn-accent,
:root[data-theme="dark"] .tab.is-active,
:root[data-theme="dark"] .chip-btn.is-active {
  color: #eaf1f4;
  border-color: #59626a;
  background: #3a4045;
}

.btn-milk {
  background: var(--surface-elev);
  border-color: var(--line);
}

:root[data-theme="dark"] .btn-milk {
  background: linear-gradient(180deg, rgba(39, 49, 58, 0.84) 0%, rgba(32, 42, 50, 0.82) 100%);
  border-color: rgba(150, 169, 181, 0.24);
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.actions-pill .btn {
  min-width: 126px;
  text-align: center;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.segmented {
  margin-top: 8px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-inset);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.segmented.is-pill-track {
  position: relative;
  overflow: hidden;
}

.segmented--wide .segmented__item {
  flex: 1 1 31%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  text-align: center;
  line-height: 1.2;
}

.segmented--mode .segmented__item {
  flex: 1 1 45%;
}

.segmented__item {
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 7px 10px;
  text-decoration: none;
  text-align: center;
  transition: transform var(--wave-transition), background-color var(--wave-transition), color var(--wave-transition),
    box-shadow var(--wave-transition);
}

.segmented.is-pill-track .segmented__item {
  position: relative;
  z-index: 2;
}

.segmented__active-pill {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: 0;
  border-radius: 999px;
  background: var(--surface-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  opacity: 0;
  z-index: 1;
  transition: transform 230ms cubic-bezier(0.22, 0.8, 0.2, 1), width 230ms cubic-bezier(0.22, 0.8, 0.2, 1),
    opacity 170ms ease;
}

.segmented__item:hover {
  transform: translateY(-1px);
  color: #374132;
}

.segmented__item.is-active {
  color: var(--primary);
  background: var(--surface-elev);
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}

.segmented.is-pill-track .segmented__item.is-active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.group-selector {
  margin-top: 8px;
  display: grid;
  gap: 7px;
  position: relative;
}

.group-main-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.group-main-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-elev);
  min-height: 38px;
  padding: 0 12px;
  box-shadow: var(--shadow-card);
  font-weight: 600;
}

.tracked-inline-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tracked-inline-pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  padding: 5px 9px;
}

.tracked-inline-pill.is-active {
  color: var(--text);
  border-color: var(--primary-soft);
  background: color-mix(in oklab, var(--surface-elev) 72%, var(--primary-soft) 28%);
}

.group-plus-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-elev);
  color: var(--primary);
  font-size: 1.2rem;
  line-height: 1;
  box-shadow: var(--shadow-card);
  font-family: inherit;
}

.group-plus-btn.is-open {
  box-shadow: var(--shadow-inset);
}

.schedule-hero {
  text-align: center;
  justify-items: center;
  gap: 7px;
  padding-top: 15px;
  padding-bottom: 12px;
}

.schedule-hero__day {
  font-size: 0.95rem;
}

.schedule-hero__meta {
  font-size: 0.84rem;
}

.week-switcher {
  margin-top: 4px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  align-items: center;
}

.week-switcher__item {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-elev) 0%, var(--surface-soft) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, var(--shadow-card);
  color: var(--text-muted);
  text-decoration: none;
  text-align: center;
  font-size: 0.76rem;
  padding: 6px 9px;
}

.week-switcher__item.is-active {
  color: var(--text);
  border-color: var(--primary-soft);
  background: color-mix(in oklab, var(--surface-elev) 76%, var(--primary-soft) 24%);
}

.week-switcher__item.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.segmented--groups-inline .segmented__item {
  flex: 1 1 30%;
}

.pin-mark {
  font-size: 0.72rem;
  color: #7d8d66;
  margin-left: 6px;
}

.group-selector__actions {
  display: grid;
  gap: 6px;
}

.groups-panel {
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  padding: 9px;
  display: grid;
  gap: 6px;
  transform: translateY(-2px);
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
  overflow: visible;
}

.groups-panel[hidden],
.link-pending[hidden] {
  display: none !important;
}

.groups-panel.is-open {
  transform: translateY(0);
  opacity: 1;
}

.group-add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.group-input-wrap {
  position: relative;
}

.group-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  display: grid;
  gap: 4px;
  padding: 6px;
  border-radius: 12px;
  background: var(--surface-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  margin-top: 0;
}

.group-suggest[hidden] {
  display: none !important;
}

.group-suggest {
  max-height: 300px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.group-suggest__item {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  padding: 7px 10px;
  font-family: "Craftwork Grotesk", sans-serif;
  font-size: 0.86rem;
  cursor: pointer;
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.group-suggest__item:hover {
  transform: translateY(-1px);
  background: #f8fafd;
}

.group-suggest__item.is-active {
  background: #f2f5f8;
  border-color: #ccd4db;
}

:root[data-theme="dark"] .group-suggest__item,
:root[data-theme="dark"] .group-suggest,
:root[data-theme="dark"] .groups-panel,
:root[data-theme="dark"] .day-accordion {
  background: #2b3135;
  border-color: #47514c;
}

:root[data-theme="dark"] .group-suggest__item {
  background: #30373a;
}

:root[data-theme="dark"] .group-suggest__item:hover {
  background: #373f43;
}

:root[data-theme="dark"] .group-suggest__item.is-active {
  background: #3d464a;
  border-color: #5d6e64;
}

.group-action-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  border-radius: 10px;
  padding: 4px 4px 4px 6px;
  background: color-mix(in oklab, var(--surface-elev) 86%, var(--surface-soft) 14%);
}

.group-action-buttons {
  display: flex;
  gap: 5px;
}

.group-action-link {
  color: var(--text-muted);
  text-decoration: none;
}

.group-action-link.is-active {
  color: var(--text);
  font-weight: 600;
}

.group-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn-mini {
  padding: 6px 10px;
  font-size: 0.76rem;
}

.week-day-block {
  display: grid;
  gap: 7px;
}

.empty-day-sports-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: #356fbc;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.empty-day-sports-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

:root[data-theme="dark"] .empty-day-sports-link {
  color: #82b8ff;
}

.btn-next {
  width: 100%;
  justify-content: center;
  text-align: center;
  display: inline-flex;
}

.section-card {
  display: grid;
  gap: 7px;
}

.section-day {
  display: grid;
  gap: 6px;
}

.section-slots {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.section-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text);
  padding: 9px 11px;
  border-radius: 13px;
  border: 1px solid #dce5d4;
  background: #f8fbf5;
  box-shadow: var(--shadow-card);
  transition: transform var(--wave-transition), box-shadow var(--wave-transition), background-color var(--wave-transition);
}

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

.section-slot:active {
  box-shadow: var(--shadow-inset);
}

.section-slot.is-active {
  background: #eef6e6;
  border-color: #c8dcb8;
}

.section-slot__name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.sports-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sports-name__icon {
  width: 1.35em;
  height: 1.35em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in oklab, var(--text-muted) 58%, var(--primary) 42%);
  flex: 0 0 1.35em;
  line-height: 1;
}

.sport-emoji {
  display: inline-block;
  line-height: 1;
  font-size: 1em;
}

.emoji-gray {
  display: inline-block;
  font-size: 0.95em;
  line-height: 1;
  filter: grayscale(1) saturate(0.55);
  opacity: 0.78;
}

:root[data-theme="dark"] .emoji-gray {
  filter: grayscale(1) saturate(0.45) brightness(1.06);
  opacity: 0.72;
}

:root[data-theme="dark"] .sports-name__icon {
  color: color-mix(in oklab, #b4c5cf 66%, #d5e5ec 34%);
}

.sports-name__icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.section-slot__count {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.section-detail {
  scroll-margin-top: 14px;
}

.sports-module {
  display: grid;
  gap: 10px;
  transition: opacity 0.14s ease;
}

.sports-module.is-loading {
  opacity: 0.72;
}

.sports-content {
  animation: sportsFadeIn 0.14s ease;
}

@keyframes sportsFadeIn {
  from {
    opacity: 0;
    transform: translateY(1px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.profile-avatar-wrap {
  width: 72px;
  height: 72px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-card);
  background: #f2f5ef;
  border: 1px solid #dce4d6;
  display: grid;
  place-items: center;
}

.profile-avatar--fallback {
  color: #3f4e30;
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(145deg, #edf5e4, #dcebcf);
}

.profile-identity {
  display: grid;
  gap: 4px;
}

.profile-group {
  font-size: 1.08rem;
  font-weight: 600;
  margin-top: 4px;
}

.profile-row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.profile-badge {
  display: inline-flex;
  width: fit-content;
  font-size: 0.74rem;
  color: #4b5f39;
  border: 1px solid #d6e4c8;
  background: #f3f9eb;
  border-radius: 999px;
  padding: 4px 8px;
}

:root[data-theme="dark"] .profile-badge {
  color: #c5dbab;
  border-color: #4b5c43;
  background: #2c3729;
}

.profile-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.profile-switch-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.profile-switch-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.profile-switch-row span {
  display: grid;
  gap: 2px;
}

.profile-notif-form h4 {
  margin: 0;
  font-size: 0.92rem;
}

.notif-time-wrap {
  min-width: 0;
}

.notif-time-input {
  width: min(220px, 100%);
  min-width: 0;
  max-width: 100%;
  -webkit-appearance: none;
}

.profile-row-title--small {
  margin-bottom: 4px;
}

.notif-block {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.notif-block.is-disabled {
  opacity: 0.6;
}

.weekday-pills {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.weekday-pill {
  position: relative;
}

.weekday-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-pill span {
  display: block;
  text-align: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 0;
  font-size: 0.78rem;
  background: var(--surface-elev);
  color: var(--text-muted);
}

.weekday-pill span,
.group-main-pill,
.group-plus-btn,
.service-doc-row {
  overflow: hidden;
}

.weekday-pill input:checked + span {
  background: color-mix(in oklab, var(--surface-elev) 74%, var(--primary-soft) 26%);
  border-color: var(--primary-soft);
  color: var(--text);
}

.profile-checkbox input {
  width: 16px;
  height: 16px;
}

.profile-logout-wrap {
  text-align: center;
  padding: 6px 0 0;
}

.profile-logout-link {
  text-decoration: none;
  color: #b14747;
  font-size: 0.96rem;
}

.profile-logout-link:hover {
  color: #932f2f;
}

.segmented--groups {
  margin-top: 6px;
}

.segmented--groups .segmented__item {
  flex: 1 1 46%;
  font-size: 0.82rem;
}

.day-accordion {
  overflow: hidden;
}

.day-accordion > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
}

.day-accordion__day {
  flex: 1 1 auto;
}

.day-accordion__count {
  min-width: 96px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.day-accordion > summary::after {
  content: "+";
  color: var(--text-muted);
  font-weight: 600;
}

.day-accordion[open] > summary::after {
  content: "-";
}

.day-accordion > summary::-webkit-details-marker {
  display: none;
}

.day-accordion-body {
  margin-top: 8px;
  transform-origin: top;
}

.tabs-soft .tab-soft {
  background: #f6f8f2;
}

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

.chip {
  background: #eff5e8;
  border: 1px solid #d8e4cd;
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  font-size: 0.72rem;
  color: #4f6153;
}

.lesson-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.lesson-time {
  font-weight: 700;
  color: var(--text);
}

.meta {
  margin-top: 4px;
  font-size: 0.86rem;
}

.meta-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.meta-icon {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex: 0 0 15px;
}

.meta-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.hero-next {
  margin-top: 8px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface-elev) 0%, color-mix(in oklab, var(--surface-elev) 86%, #d8e0d2 14%) 100%);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 8px 14px rgba(120, 128, 118, 0.14);
  padding: 8px 10px;
  display: grid;
  gap: 4px;
}

:root[data-theme="dark"] .hero-next {
  background: linear-gradient(180deg, #343b40 0%, #2d3438 100%);
  border-color: #4d5752;
  box-shadow: 0 1px 0 rgba(222, 234, 225, 0.08) inset, 0 8px 14px rgba(0, 0, 0, 0.34);
}

.link-pending {
  margin-top: 8px;
  border-radius: 12px;
  padding: 8px 10px;
  background: color-mix(in oklab, var(--surface-elev) 88%, var(--primary-soft) 12%);
  border: 1px solid var(--line);
  display: grid;
  gap: 2px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.stat-pill {
  border-radius: 18px;
  background: #f8faf6;
  box-shadow: var(--shadow-inset);
  padding: 10px;
  display: grid;
  gap: 3px;
  text-align: center;
}

.stat-pill span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.input,
select.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  background: var(--surface-elev);
  color: var(--text);
  font-family: "Craftwork Grotesk", sans-serif;
  box-shadow: var(--shadow-inset);
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.inline-form {
  margin: 0;
}

.list-item {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-md);
  display: grid;
  gap: 4px;
}

.day-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.error {
  color: var(--danger);
  margin-top: 8px;
}

.soft-warning {
  border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--surface-elev) 84%, #7a6448 16%);
  border: 1px solid color-mix(in oklab, var(--line) 80%, #7a6448 20%);
  color: #6a5540;
  padding: 10px;
  margin: 8px 0;
}

.welcome-shell {
  min-height: calc(100vh - 140px);
  text-align: center;
  display: grid;
  align-content: center;
  gap: 10px;
}

.welcome-logo {
  width: clamp(128px, 32vw, 196px);
  height: auto;
  display: block;
  margin: 0 auto 0;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(72, 89, 53, 0.12));
}

.welcome-logo--small {
  width: clamp(72px, 16vw, 98px);
  margin: 0 0 10px;
}

.welcome-question {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.72, 0.24, 1);
}

.welcome-cta .actions {
  justify-content: center;
  align-items: center;
}

.page-landing {
  min-height: calc(100vh - 120px);
}

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

.service-tile {
  display: grid;
  gap: 4px;
}

.service-doc {
  border-radius: 14px;
  padding: 10px;
}

.service-os-tabs {
  margin-top: 6px;
}

.service-install {
  margin-top: 10px;
}

.service-steps {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  display: grid;
  gap: 5px;
  font-size: 0.86rem;
}

.service-docs-accordion {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 10px;
  margin-top: 8px;
}

.service-docs-root {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  padding: 10px;
}

.service-docs-root > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
}

.service-docs-root > summary::-webkit-details-marker {
  display: none;
}

.service-docs-root-body {
  margin-top: 8px;
}

.service-docs-accordion > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
}

.service-docs-accordion > summary::-webkit-details-marker {
  display: none;
}

.service-docs-list {
  margin-top: 10px;
}

.service-doc-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-elev);
  padding: 9px 10px;
  display: grid;
  gap: 2px;
}

.service-hero {
  gap: 9px;
  padding-top: 16px;
  padding-bottom: 14px;
}

.service-hero h1 {
  margin-top: 3px;
  line-height: 1.12;
}

.service-hero .eyebrow {
  margin-bottom: 1px;
}

.service-hero .muted {
  line-height: 1.45;
}

.service-page > .soft-card:first-of-type {
  margin-top: 2px;
}

.link-card {
  display: block;
  border-radius: var(--radius-lg);
  font-size: 1rem;
}

.pull-refresh {
  position: fixed;
  left: 50%;
  top: 8px;
  transform: translate(-50%, -14px);
  display: grid;
  justify-items: center;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  z-index: 40;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.pull-refresh.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pull-refresh__logo {
  width: 24px;
  height: 24px;
  position: relative;
  -webkit-mask-image: url("/static/brand/logo.png");
  mask-image: url("/static/brand/logo.png");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  background: rgba(108, 124, 94, 0.32);
}

.pull-refresh__logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #b9d598 0%, #8cb166 100%);
  transform: scaleY(var(--pull-progress, 0));
  transform-origin: bottom center;
  transition: transform 120ms linear;
}

.pull-refresh__hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 192px;
  text-align: center;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 200ms ease, transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1), color 180ms ease;
}

.pull-refresh__hint.is-swapping {
  opacity: 0.25;
  transform: translateY(1px);
}

.pull-refresh.is-visible .pull-refresh__hint {
  opacity: 1;
  transform: translateY(0);
}

.pull-refresh.is-refreshing .pull-refresh__hint {
  color: var(--text);
}

:root[data-theme="dark"] .pull-refresh {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .pull-refresh__logo {
  background: rgba(168, 185, 198, 0.34);
}

:root[data-theme="dark"] .pull-refresh__hint {
  color: #b8c3cb;
}

.bottom-nav {
  transform: translateY(var(--pull-distance));
  transition: transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1), color 120ms ease;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 640px;
  margin: 0 auto;
  gap: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(251, 252, 249, 0.52) 0%, rgba(242, 245, 238, 0.46) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
  border: 1px solid rgba(221, 228, 216, 0.74);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(154, 164, 149, 0.18), 0 1px 0 rgba(255, 255, 255, 0.56) inset;
  overflow: hidden;
}

:root[data-theme="dark"] .bottom-nav {
  background: linear-gradient(180deg, rgba(35, 42, 48, 0.52) 0%, rgba(30, 37, 43, 0.46) 100%);
  border-color: rgba(136, 154, 166, 0.34);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34), 0 1px 0 rgba(196, 208, 198, 0.06) inset;
}

.bottom-nav__item {
  display: grid;
  place-items: center;
  gap: 0;
  text-decoration: none;
  color: #687062;
  font-size: 0;
  border-radius: var(--radius-pill);
  padding: 12px 4px;
  transition: color 360ms ease;
  position: relative;
  z-index: 4;
}

:root[data-theme="dark"] .bottom-nav__item {
  color: #bac5bf;
}

.bottom-nav__active-segment {
  position: absolute;
  top: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #d9e6cd 0%, #c8d8ba 100%);
  border: 1px solid #b9c9ab;
  box-shadow: 0 1px 0 rgba(248, 252, 244, 0.72) inset, 0 7px 14px rgba(123, 137, 111, 0.2);
  transition: transform 380ms cubic-bezier(0.22, 0.61, 0.36, 1), width 380ms cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 260ms ease;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
}

:root[data-theme="dark"] .bottom-nav__active-segment {
  background: linear-gradient(180deg, #4f5f54 0%, #445248 100%);
  border-color: #637468;
  box-shadow: 0 1px 0 rgba(224, 236, 220, 0.1) inset, 0 7px 14px rgba(0, 0, 0, 0.34);
}

.bottom-nav__icon {
  width: 21px;
  height: 21px;
  line-height: 1;
  transition: transform 380ms cubic-bezier(0.22, 0.61, 0.36, 1), color 360ms ease;
}

.bottom-nav__icon svg {
  width: 21px;
  height: 21px;
  display: block;
}

.bottom-nav__item.is-active {
  color: #2f3d2a;
  transform: none;
}

:root[data-theme="dark"] .bottom-nav__item.is-active {
  color: #e8f3f6;
}

.bottom-nav__item:not(.is-active):hover {
  color: #4f5848;
  transform: none;
}

.bottom-nav__item.is-active .bottom-nav__icon {
  transform: scale(1.04);
}

.bottom-nav__item.is-active .bottom-nav__label {
  font-weight: 600;
}

.bottom-nav__label {
  transition: color 320ms ease;
}

:root[data-theme="dark"] .hero-card,
:root[data-theme="dark"] .soft-card,
:root[data-theme="dark"] .lesson-card,
:root[data-theme="dark"] .empty-card,
:root[data-theme="dark"] .welcome-shell,
:root[data-theme="dark"] .service-doc-row,
:root[data-theme="dark"] .service-docs-root,
:root[data-theme="dark"] .service-docs-accordion,
:root[data-theme="dark"] .notif-block,
:root[data-theme="dark"] .groups-panel,
:root[data-theme="dark"] .day-accordion {
  background: linear-gradient(180deg, rgba(48, 56, 61, 0.58) 0%, rgba(40, 47, 52, 0.54) 100%);
  backdrop-filter: blur(16px) saturate(115%);
  border-color: rgba(163, 182, 196, 0.2);
}

:root[data-theme="dark"] .segmented,
:root[data-theme="dark"] .week-switcher__item,
:root[data-theme="dark"] .group-main-pill,
:root[data-theme="dark"] .group-plus-btn,
:root[data-theme="dark"] .tracked-inline-pill {
  background: linear-gradient(180deg, rgba(50, 58, 63, 0.62) 0%, rgba(41, 48, 53, 0.58) 100%);
  border-color: rgba(162, 182, 194, 0.24);
  backdrop-filter: blur(14px) saturate(112%);
}

:root[data-theme="dark"] .segmented__active-pill {
  background: linear-gradient(180deg, rgba(84, 98, 106, 0.7) 0%, rgba(72, 84, 92, 0.68) 100%);
  border-color: rgba(165, 188, 202, 0.3);
  box-shadow: 0 1px 0 rgba(214, 229, 235, 0.14) inset, 0 8px 18px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] .segmented__item {
  color: #b9c7cf;
}

:root[data-theme="dark"] .segmented__item.is-active {
  color: #e8f2f6;
}

:root[data-theme="dark"] .input,
:root[data-theme="dark"] select.input,
:root[data-theme="dark"] .group-suggest {
  background: linear-gradient(180deg, rgba(48, 55, 60, 0.68) 0%, rgba(42, 48, 53, 0.64) 100%);
  border-color: rgba(161, 180, 192, 0.24);
  color: var(--text);
  backdrop-filter: blur(13px) saturate(110%);
}

:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .stat-pill,
:root[data-theme="dark"] .section-slot,
:root[data-theme="dark"] .link-pending {
  background: linear-gradient(180deg, rgba(50, 58, 63, 0.58) 0%, rgba(41, 48, 53, 0.55) 100%);
  border-color: rgba(157, 177, 190, 0.22);
  color: #c6d2d8;
}

:root[data-theme="dark"] .section-slot.is-active,
:root[data-theme="dark"] .week-switcher__item.is-active,
:root[data-theme="dark"] .tracked-inline-pill.is-active,
:root[data-theme="dark"] .weekday-pill input:checked + span {
  background: linear-gradient(180deg, rgba(86, 100, 109, 0.68) 0%, rgba(74, 88, 96, 0.66) 100%);
  border-color: rgba(165, 189, 202, 0.33);
  color: #ecf5f9;
}

:root[data-theme="dark"] .profile-avatar {
  background: #343b40;
  border-color: #4e595f;
}

:root[data-theme="dark"] .profile-avatar--fallback {
  color: #d9e7eb;
  background: linear-gradient(145deg, #4b5960, #425057);
}

:root[data-theme="dark"] .profile-badge {
  color: #d2e4ea;
  border-color: rgba(157, 181, 194, 0.34);
  background: rgba(75, 89, 96, 0.58);
}

:root[data-theme="dark"] .soft-warning {
  background: rgba(86, 74, 62, 0.34);
  border-color: rgba(146, 126, 108, 0.46);
  color: #d8cabd;
}

:root[data-theme="dark"] .bottom-nav__item {
  color: #b7c3cc;
}

:root[data-theme="dark"] .bottom-nav__active-segment {
  background: linear-gradient(180deg, rgba(88, 101, 109, 0.82) 0%, rgba(75, 88, 96, 0.8) 100%);
  border-color: rgba(163, 186, 198, 0.36);
  box-shadow: 0 1px 0 rgba(224, 236, 220, 0.12) inset, 0 8px 16px rgba(0, 0, 0, 0.38);
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 760px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .page-landing {
    min-height: calc(100vh - 104px);
  }

  .welcome-shell {
    min-height: calc(100vh - 116px);
  }

  .weekday-pills {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .service-hero {
    gap: 10px;
  }

  .service-install {
    margin-top: 11px;
  }
}
