:root {
  color-scheme: light;
  --background: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --line: rgba(29, 29, 31, 0.08);
  --blue: #0071e3;
  --radius-large: 32px;
  --radius-medium: 24px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.95), transparent 34rem),
    linear-gradient(145deg, #fbfbfd 0%, var(--background) 58%, #ececf1 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.auth-pending .app-shell,
body.auth-required .app-shell {
  visibility: hidden;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  padding: 24px;
  place-items: center;
  background:
    radial-gradient(circle at 50% 12%, rgba(188, 204, 255, 0.55), transparent 34%),
    linear-gradient(145deg, #f7f8fb, #e9ebf2);
}

.login-screen[hidden] {
  display: none;
}

.login-card {
  width: min(100%, 480px);
  padding: clamp(36px, 7vw, 62px);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 35px 90px rgba(38, 45, 70, 0.16);
  text-align: center;
  backdrop-filter: blur(32px) saturate(1.2);
}

.login-logo {
  width: 78px;
  height: 78px;
  margin: 0 auto 28px;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 16px 35px rgba(90, 68, 190, 0.25);
}

.login-logo img {
  display: block;
  width: 100%;
  height: 100%;
}

.login-card h1 {
  margin: 10px 0 14px;
  font-size: clamp(38px, 7vw, 56px);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.login-description {
  max-width: 340px;
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.google-sign-in {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(60, 60, 67, 0.15);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
  color: #1d1d1f;
  font-weight: 620;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.google-sign-in:hover {
  transform: translateY(-2px);
  box-shadow: 0 13px 28px rgba(0, 0, 0, 0.1);
}

.google-sign-in[aria-disabled="true"] {
  opacity: 0.48;
  pointer-events: none;
}

.google-sign-in-mark {
  color: #4285f4;
  font-size: 20px;
  font-weight: 700;
}

.login-message {
  min-height: 20px;
  margin: 18px 0 0;
  color: #c9342c;
  font-size: 13px;
}

button {
  color: inherit;
  font: inherit;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(100%, 1600px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 64px) clamp(22px, 5vw, 80px) 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.nav-button {
  border: 0;
  cursor: pointer;
}

.brand {
  padding: 8px 0;
  background: transparent;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.navigation {
  position: fixed;
  top: clamp(24px, 4vw, 64px);
  right: max(clamp(22px, 5vw, 80px), calc((100vw - 1600px) / 2 + 80px));
  z-index: 100;
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(20px);
}

.nav-button {
  padding: 9px 17px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.nav-button:hover {
  color: var(--text);
}

.nav-button.active {
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.nav-icon,
.mobile-day-tabs {
  display: none;
}

.nav-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main {
  display: grid;
  align-items: center;
  padding: 50px 0 36px;
}

.page {
  grid-area: 1 / 1;
  width: 100%;
}

.page.active {
  animation: page-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (pointer: coarse), (max-width: 1180px) {
  .page.active.swipe-from-right {
    animation: page-swipe-from-right 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .page.active.swipe-from-left {
    animation: page-swipe-from-left 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@keyframes page-swipe-from-right {
  from {
    opacity: 0;
    transform: translateX(38px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes page-swipe-from-left {
  from {
    opacity: 0;
    transform: translateX(-38px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.home-hero {
  margin-bottom: clamp(38px, 5vh, 70px);
}

.eyebrow,
.widget-label,
.widget-detail,
.muted,
.project-card p,
.travel-feature p,
.next-trip p {
  margin: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: clamp(15px, 1.3vw, 19px);
  letter-spacing: -0.01em;
}

.clock {
  display: block;
  margin-top: 8px;
  font-size: clamp(76px, 10vw, 150px);
  font-weight: 300;
  letter-spacing: -0.075em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 24px 0 0;
  font-size: clamp(32px, 3.3vw, 52px);
  font-weight: 560;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.muted {
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 20px);
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 1.7vw, 24px);
}

.widget,
.memory-widget,
.project-card,
.stat,
.next-trip,
.travel-feature {
  border: 1px solid rgba(255, 255, 255, 0.84);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.widget {
  display: flex;
  min-width: 0;
  min-height: 180px;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  border-radius: var(--radius-medium);
  text-align: left;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.memory-widget {
  position: relative;
  display: block;
  grid-column: span 2;
  grid-row: span 2;
  min-height: 384px;
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius-large);
  color: white;
  cursor: pointer;
  text-align: left;
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.memory-widget::before {
  position: absolute;
  z-index: 0;
  content: "";
  opacity: 0;
  pointer-events: none;
}

.memory-widget:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.16);
}

.memory-widget > img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.memory-widget:hover > img {
  transform: scale(1.035);
}

.memory-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(5, 9, 15, 0.08) 34%, rgba(5, 9, 15, 0.82) 100%),
    linear-gradient(90deg, rgba(5, 9, 15, 0.3), transparent 58%);
}

.memory-copy {
  position: absolute;
  right: 32px;
  bottom: 30px;
  left: 32px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
}

.memory-label {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  letter-spacing: 0.01em;
}

.memory-copy strong {
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 570;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.memory-copy > span:last-child {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 15px;
}

.memory-arrow {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 3;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(15, 19, 25, 0.28);
  font-size: 18px;
  backdrop-filter: blur(18px);
}

@media (min-width: 901px) {
  .memory-widget.portrait-photo > img {
    object-fit: cover;
    object-position: center 42%;
  }
}

button.widget {
  width: 100%;
  cursor: pointer;
}

.widget:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.1);
}

.widget-label {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.01em;
}

.widget-value {
  margin: 14px 0 0;
  font-size: clamp(38px, 3.8vw, 58px);
  font-weight: 520;
  letter-spacing: -0.055em;
  line-height: 1;
}

.widget-value-small {
  font-size: clamp(29px, 2.6vw, 40px);
}

.widget-detail {
  color: var(--muted);
  font-size: 15px;
}

.weather-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.location-button {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 113, 227, 0.1);
  color: var(--blue);
  cursor: pointer;
  font-size: 17px;
  transition: background 180ms ease, transform 180ms ease;
}

.location-button:hover {
  background: rgba(0, 113, 227, 0.17);
  transform: scale(1.06);
}

.location-button.loading {
  animation: location-pulse 1.2s ease-in-out infinite;
  pointer-events: none;
}

.weather-widget {
  background: linear-gradient(145deg, rgba(218, 238, 255, 0.92), rgba(255, 255, 255, 0.86));
}

.music-widget {
  container-type: inline-size;
  overflow: hidden;
  justify-content: flex-start;
  gap: 16px;
  padding: 22px;
  background: linear-gradient(145deg, rgba(232, 225, 255, 0.9), rgba(255, 255, 255, 0.86));
}

.music-summary {
  display: grid;
  min-width: 0;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.music-artwork {
  position: relative;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(145deg, #1ed760, #0f9f45);
  color: white;
  font-size: 23px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.13);
}

.music-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-copy {
  min-width: 0;
}

.music-track-title {
  margin: 5px 0 0;
  overflow: hidden;
  font-size: clamp(20px, 1.8vw, 27px);
  font-weight: 600;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-artist-line {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-track-title.scrolling {
  animation: spotify-title-scroll 25s linear infinite;
  text-overflow: clip;
  will-change: transform;
}

@keyframes spotify-title-scroll {
  0%,
  40% {
    transform: translateX(0);
  }
  60% {
    transform: translateX(var(--spotify-scroll-distance));
  }
  60.01%,
  100% {
    transform: translateX(0);
  }
}

.music-footer {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-areas:
    "progress controls"
    "volume controls";
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-end;
  column-gap: 12px;
  row-gap: 7px;
  margin-top: auto;
}

.spotify-progress {
  grid-area: progress;
  min-width: 0;
}

.spotify-progress-times {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.spotify-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.12);
}

.spotify-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #1d1d1f;
  transition: width 220ms linear;
}

.spotify-volume {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 13px minmax(48px, 1fr) 28px;
  grid-area: volume;
  align-items: center;
  gap: 7px;
  margin-top: 0;
}

.spotify-volume[hidden] {
  display: none;
}

.spotify-volume svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.spotify-volume-slider-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 14px;
}

.spotify-volume-rail {
  position: absolute;
  top: 5px;
  right: 7px;
  bottom: 5px;
  left: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.13);
  pointer-events: none;
}

.spotify-volume-rail span {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: inherit;
  background: #1d1d1f;
}

.spotify-volume-thumb {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  transform: translateX(-50%);
}

.spotify-volume input {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  outline: 0;
  cursor: pointer;
  opacity: 0 !important;
}

.spotify-volume input:focus,
.spotify-volume input:focus-visible {
  border-color: transparent;
  outline: none;
  box-shadow: none;
}

.spotify-volume input:disabled {
  cursor: not-allowed;
}

.spotify-volume-slider-shell:has(input:disabled) {
  opacity: 0.45;
}

.spotify-volume output {
  display: block;
  min-width: 28px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@container (max-width: 340px) {
  .music-widget .music-footer {
    grid-template-areas:
      "progress"
      "volume"
      "controls";
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .music-widget .spotify-progress {
    width: 100%;
  }

  .music-widget .spotify-controls {
    justify-self: end;
  }
}

.spotify-controls {
  display: flex;
  grid-area: controls;
  flex: 0 0 auto;
  gap: 5px;
}

.spotify-controls button {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(12px);
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

.spotify-controls button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.spotify-controls button:hover {
  transform: scale(1.08);
  background: white;
}

.spotify-controls button:disabled {
  cursor: wait;
  opacity: 0.45;
}

.spotify-controls .spotify-play-button {
  background: #1ed760;
  color: #081c0f;
}

.spotify-search-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 32px;
  background: rgba(248, 248, 250, 0.97);
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.27);
  backdrop-filter: blur(30px);
}

.spotify-search-dialog::backdrop {
  background: rgba(30, 33, 40, 0.38);
  backdrop-filter: blur(12px);
}

.spotify-search-shell {
  padding: clamp(26px, 5vw, 42px);
}

.spotify-search-form {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  margin-top: 26px;
  padding: 7px 8px 7px 15px;
  border: 1px solid rgba(60, 60, 67, 0.09);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 30, 48, 0.06);
}

.spotify-search-form svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.spotify-search-form input {
  width: 100%;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.spotify-search-form button {
  padding: 10px 15px;
  border: 0;
  border-radius: 13px;
  background: #1d1d1f;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.spotify-search-form button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.spotify-search-message {
  min-height: 18px;
  margin: 15px 2px 9px;
  color: var(--muted);
  font-size: 12px;
}

.spotify-search-message.error {
  color: #c9342c;
}

.spotify-search-results {
  display: grid;
  max-height: min(410px, 52dvh);
  gap: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.spotify-search-result {
  display: grid;
  width: 100%;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 9px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 150ms ease, transform 150ms ease;
}

.spotify-search-result:hover {
  background: rgba(118, 118, 128, 0.1);
  transform: translateX(2px);
}

.spotify-search-result:disabled {
  cursor: wait;
  opacity: 0.5;
}

.spotify-search-result img,
.spotify-search-artwork-placeholder {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  object-fit: cover;
  border-radius: 11px;
  background: linear-gradient(145deg, #1ed760, #0f9f45);
  color: #fff;
}

.spotify-search-result-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.spotify-search-result-copy strong,
.spotify-search-result-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spotify-search-result-copy strong {
  font-size: 15px;
  font-weight: 620;
}

.spotify-search-result-copy span,
.spotify-search-duration {
  color: var(--muted);
  font-size: 12px;
}

.travel-widget {
  background: linear-gradient(145deg, rgba(224, 244, 231, 0.94), rgba(255, 255, 255, 0.86));
}

.page-heading {
  margin-bottom: 44px;
}

.page-heading h1 {
  margin-top: 8px;
  font-size: clamp(60px, 8vw, 116px);
  font-weight: 570;
}

/* FOCUS */

.focus-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.focus-add-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 46px;
}

.focus-add-button span {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.focus-overview {
  display: grid;
  grid-template-columns: 1.25fr repeat(2, 1fr);
  gap: 18px;
}

.focus-stat {
  min-height: 164px;
  padding: 27px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.focus-stat-primary {
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.45), transparent 30%),
    linear-gradient(145deg, #dbe8ff, #f7f8ff);
}

.focus-stat strong {
  display: block;
  margin: 18px 0 5px;
  font-size: 48px;
  font-weight: 540;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.focus-stat > span {
  color: var(--muted);
  font-size: 14px;
}

.focus-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 34px 0 15px;
}

.focus-filters {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(118, 118, 128, 0.1);
}

.focus-filter {
  min-height: 35px;
  padding: 0 15px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.focus-filter.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.focus-task-list {
  display: grid;
  gap: 10px;
}

.focus-task {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 17px 19px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 28px rgba(24, 30, 48, 0.06);
  backdrop-filter: blur(20px);
  transition: transform 180ms ease, opacity 180ms ease;
}

.focus-task::before {
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #8e8e93;
  content: "";
}

.focus-task.focus-priority-high::before {
  background: #ff3b30;
}

.focus-task.focus-priority-low::before {
  background: #34c759;
}

.focus-task:hover {
  transform: translateY(-2px);
}

.focus-task.completed {
  opacity: 0.62;
}

.focus-task-check {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  padding: 0;
  border: 1.5px solid rgba(60, 60, 67, 0.28);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.focus-task.completed .focus-task-check {
  border-color: #34c759;
  background: #34c759;
}

.focus-task-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.focus-task-copy strong {
  overflow: hidden;
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-task.completed .focus-task-copy strong {
  text-decoration: line-through;
}

.focus-task-meta,
.focus-task-detail {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-task-delete {
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: #c9342c;
  cursor: pointer;
  font-size: 12px;
}

.focus-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 30px;
  border: 1px dashed rgba(60, 60, 67, 0.16);
  border-radius: 26px;
  color: var(--muted);
  text-align: center;
}

.focus-empty strong {
  color: var(--text);
  font-size: 24px;
  letter-spacing: -0.035em;
}

.focus-empty .primary-button {
  margin-top: 14px;
}

.focus-task-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 32px;
  background: rgba(248, 248, 250, 0.97);
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(30px);
}

.focus-task-dialog::backdrop {
  background: rgba(30, 33, 40, 0.35);
  backdrop-filter: blur(10px);
}

.focus-task-dialog form {
  padding: clamp(26px, 5vw, 44px);
}

.focus-task-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.focus-task-form-grid label {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.focus-task-form-grid input,
.focus-task-form-grid select,
.focus-task-form-grid textarea {
  width: 100%;
}

.focus-task-form-wide {
  grid-column: 1 / -1;
}

.focus-load-error {
  padding: 22px;
  color: #c9342c;
}

/* PRACTICE LIBRARY */

.practice-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.practice-add-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 46px;
}

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

.practice-stat {
  min-height: 154px;
  padding: 25px 27px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
}

.practice-stat-learning {
  background: linear-gradient(145deg, rgba(255, 215, 233, 0.92), rgba(244, 231, 255, 0.92));
}

.practice-stat strong {
  display: block;
  margin: 17px 0 5px;
  font-size: 48px;
  font-weight: 540;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

.practice-stat > span {
  color: var(--muted);
  font-size: 14px;
}

.practice-list-heading {
  margin: 32px 0 15px;
}

.practice-filters {
  display: inline-flex;
  gap: 5px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(118, 118, 128, 0.1);
}

.practice-filter {
  min-height: 35px;
  padding: 0 15px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.practice-filter.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.practice-song-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 440px));
  justify-content: start;
  gap: 16px;
}

.practice-song {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 270px;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 32px rgba(24, 30, 48, 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.practice-song:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(24, 30, 48, 0.09);
}

.practice-song::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: #8e8e93;
  content: "";
}

.practice-song-learning::before { background: #af52de; }
.practice-song-learned::before { background: #34c759; }
.practice-song-want::before { background: #ff9f0a; }

.practice-song-heading {
  display: grid;
  min-width: 0;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.practice-song-artwork {
  width: 76px;
  height: 76px;
  border-radius: 17px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14);
}

.practice-song-artwork-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ede7ff, #d7ebff);
  color: #7657ca;
  font-size: 30px;
  font-weight: 500;
}

.practice-song-copy {
  min-width: 0;
}

.practice-stage {
  color: #8a4cad;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.practice-song-want .practice-stage { color: #b86b00; }
.practice-song-learning .practice-stage { color: #8a4cad; }
.practice-song-learned .practice-stage { color: #248a3d; }

.practice-song h2 {
  margin: 6px 0 3px;
  overflow: hidden;
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-song-copy p,
.practice-song-notes {
  margin: 0;
  color: var(--muted);
}

.practice-edit-button {
  align-self: start;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.1);
  color: var(--muted);
  cursor: pointer;
}

.practice-song-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.practice-song-meta span {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.09);
  color: var(--muted);
  font-size: 11px;
}

.practice-song-notes {
  margin-top: 15px;
  font-size: 13px;
  line-height: 1.45;
}

.practice-tabs {
  margin-top: 15px;
}

.practice-tabs summary {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.practice-tabs pre {
  max-height: 340px;
  margin: 12px 0 0;
  padding: 15px;
  overflow: auto;
  border-radius: 16px;
  background: #1d1d1f;
  color: #f5f5f7;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
}

.practice-song-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 19px;
}

.practice-song-actions a {
  text-decoration: none;
}

.practice-play-button {
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: #1ed760;
  color: #102516;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.practice-play-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.practice-pdf-button,
.practice-source-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
}

.practice-empty {
  display: grid;
  min-height: 250px;
  grid-column: 1 / -1;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 30px;
  border: 1px dashed rgba(60, 60, 67, 0.16);
  border-radius: 26px;
  color: var(--muted);
  text-align: center;
}

.practice-empty strong {
  color: var(--text);
  font-size: 24px;
}

.practice-empty .primary-button {
  margin-top: 14px;
}

.practice-song-dialog,
.practice-pdf-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 32px;
  background: rgba(248, 248, 250, 0.98);
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(30px);
}

.practice-song-dialog::backdrop,
.practice-pdf-dialog::backdrop {
  background: rgba(30, 33, 40, 0.38);
  backdrop-filter: blur(10px);
}

.practice-song-dialog form {
  padding: clamp(26px, 5vw, 44px);
  overflow: hidden;
}

.practice-catalog-search {
  min-width: 0;
  margin-top: 26px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(29, 29, 31, 0.06);
  border-radius: 20px;
  background: rgba(118, 118, 128, 0.065);
}

.practice-catalog-search-bar {
  display: grid;
  min-width: 0;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 4px 5px 4px 14px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.practice-catalog-search-bar:focus-within {
  border-color: rgba(0, 113, 227, 0.38);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.09), 0 5px 18px rgba(0, 0, 0, 0.06);
}

.practice-catalog-search-bar svg {
  width: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.practice-catalog-search-bar input {
  width: 100%;
  height: 42px;
  min-width: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  outline: 0 !important;
  background: transparent !important;
  color: var(--text);
  font: inherit;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.practice-catalog-search-bar input:focus,
.practice-catalog-search-bar input:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.practice-catalog-search-bar button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
}

.practice-catalog-message {
  margin: 9px 6px 1px;
  color: var(--muted);
  font-size: 12px;
}

.practice-catalog-results {
  display: grid;
  max-height: 250px;
  gap: 6px;
  margin-top: 10px;
  overflow-y: auto;
}

.practice-catalog-results[hidden] {
  display: none;
}

.practice-catalog-result {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 7px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.practice-catalog-result:hover {
  background: rgba(255, 255, 255, 0.86);
}

.practice-catalog-result img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

.practice-catalog-result > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.practice-catalog-result strong,
.practice-catalog-result span span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-catalog-result span span {
  color: var(--muted);
  font-size: 12px;
}

.practice-song-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.practice-song-form-grid label {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.practice-song-form-grid input,
.practice-song-form-grid select,
.practice-song-form-grid textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.practice-song-form-wide {
  grid-column: 1 / -1;
}

.practice-tab-editor {
  display: block;
  min-height: 240px;
  overflow-x: auto;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  tab-size: 4;
  white-space: pre;
}

.practice-import-row {
  display: grid;
  min-width: 0;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  margin-top: 16px;
  padding: 12px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(118, 118, 128, 0.07);
  color: var(--muted);
  font-size: 12px;
}

#practice-import-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-import-button {
  display: inline-flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  text-align: center;
}

.practice-import-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.practice-pdf-dialog {
  width: min(1100px, calc(100vw - 24px));
  height: min(880px, calc(100dvh - 24px));
  overflow: hidden;
}

.practice-pdf-heading {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
}

.practice-pdf-heading h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.practice-pdf-dialog iframe {
  display: block;
  width: 100%;
  height: calc(100% - 82px);
  border: 0;
  background: #d9d9dd;
}

.school-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.school-overview {
  display: grid;
  grid-template-columns: minmax(250px, 1.35fr) minmax(250px, 1.35fr) minmax(150px, 0.65fr) minmax(170px, 0.75fr);
  gap: 16px;
  margin: 32px 0 22px;
}

.school-overview-card {
  min-width: 0;
  padding: 22px 24px;
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.055);
}

.school-overview-primary {
  background: #1d1d1f;
  color: #fff;
}

.school-overview-primary .widget-label,
.school-overview-primary p {
  color: rgba(255, 255, 255, 0.62);
}

.school-overview-card h2 {
  overflow: hidden;
  margin: 16px 0 7px;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-overview-card > p:last-child {
  overflow: hidden;
  margin: 0;
  color: #86868b;
  font-size: 0.86rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-overview-compact h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.school-planner-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.school-add-button {
  white-space: nowrap;
}

.school-planner {
  margin-top: 34px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: var(--radius-large);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.school-planner-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.school-planner-heading h2 {
  margin: 7px 0 0;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.045em;
}

.planner-filters {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.055);
}

.planner-filter {
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.planner-filter.active {
  background: white;
  color: var(--text);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.school-item-list {
  display: grid;
  gap: 10px;
}

.planner-item {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
}

.planner-item.completed {
  opacity: 0.58;
}

.planner-item.completed h3 {
  text-decoration: line-through;
}

.planner-complete {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1.5px solid rgba(29, 29, 31, 0.2);
  border-radius: 50%;
  background: white;
  color: white;
  cursor: pointer;
  font-size: 13px;
}

.planner-item.completed .planner-complete {
  border-color: #34c759;
  background: #34c759;
}

.planner-event-marker {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  background: rgba(175, 82, 222, 0.11);
  color: #8e44ad;
  font-size: 10px;
}

.planner-item-calendar-event {
  border-color: rgba(175, 82, 222, 0.13);
  background: rgba(252, 248, 255, 0.92);
}

.planner-item-copy {
  min-width: 0;
}

.planner-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.planner-type {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.09);
  color: var(--blue);
}

.planner-item-test .planner-type {
  background: rgba(255, 59, 48, 0.1);
  color: #d92d20;
}

.planner-item-event .planner-type {
  background: rgba(175, 82, 222, 0.1);
  color: #8e44ad;
}

.planner-item-note .planner-type {
  background: rgba(255, 149, 0, 0.11);
  color: #b56700;
}

.planner-item h3 {
  margin: 7px 0 0;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-item-copy > p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-item-actions {
  display: flex;
  gap: 5px;
}

.planner-item-actions button {
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.055);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.planner-item-actions button:hover {
  background: rgba(29, 29, 31, 0.1);
  color: var(--text);
}

.planner-empty {
  margin: 0;
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
}

.school-dialog {
  width: min(92vw, 680px);
  max-height: 90vh;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 30px;
  background: rgba(250, 250, 252, 0.96);
  color: var(--text);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(30px);
}

.school-dialog::backdrop {
  background: rgba(20, 20, 24, 0.35);
  backdrop-filter: blur(6px);
}

.school-form {
  padding: 30px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.dialog-heading h2 {
  margin: 6px 0 0;
  font-size: 34px;
  letter-spacing: -0.045em;
}

.dialog-close {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(29, 29, 31, 0.07);
  cursor: pointer;
  font-size: 22px;
}

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

.form-grid label,
.time-fields label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 13px;
  outline: none;
  background: white;
  color: var(--text);
  font: inherit;
}

.school-form .select-field {
  position: relative;
}

.school-form .select-field::after {
  position: absolute;
  right: 15px;
  bottom: 17px;
  width: 8px;
  height: 8px;
  border-right: 1.7px solid #6e6e73;
  border-bottom: 1.7px solid #6e6e73;
  content: "";
  pointer-events: none;
  transform: rotate(45deg) translateY(-2px);
}

.school-form .select-field select {
  min-height: 49px;
  padding: 0 44px 0 15px;
  appearance: none;
  border-color: rgba(29, 29, 31, 0.1);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 248, 250, 0.98));
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.045);
  cursor: pointer;
  font-weight: 540;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.school-form .select-field select:hover {
  border-color: rgba(29, 29, 31, 0.2);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
}

.school-form .select-field select:focus {
  border-color: rgba(0, 113, 227, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.11), 0 8px 22px rgba(0, 0, 0, 0.06);
}

.school-form .select-field:focus-within::after {
  border-color: var(--blue);
}

.school-form select option {
  background: white;
  color: var(--text);
}

.school-form input[type="date"],
.school-form input[type="time"] {
  min-height: 49px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 248, 250, 0.98));
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.04);
}

.native-select-hidden,
.native-picker-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.school-form .select-field.has-custom-select::after {
  display: none;
}

.atlas-select,
.atlas-picker {
  position: relative;
  width: 100%;
}

.atlas-select-button,
.atlas-picker-button {
  display: flex;
  width: 100%;
  min-height: 49px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 15px;
  border: 1px solid rgba(29, 29, 31, 0.1);
  border-radius: 15px;
  outline: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 248, 250, 0.99));
  color: var(--text);
  cursor: pointer;
  font-weight: 540;
  text-align: left;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.045);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.atlas-select-button:hover,
.atlas-picker-button:hover,
.atlas-select-button[aria-expanded="true"],
.atlas-picker-button[aria-expanded="true"] {
  border-color: rgba(0, 113, 227, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.09), 0 8px 22px rgba(0, 0, 0, 0.07);
}

.atlas-select-button.placeholder,
.atlas-picker-button.placeholder {
  color: var(--muted);
  font-weight: 450;
}

.atlas-select-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  color: var(--muted);
  transform: rotate(45deg) translate(-2px, 2px);
  transition: transform 160ms ease;
}

.atlas-select-button[aria-expanded="true"] .atlas-select-chevron {
  color: var(--blue);
  transform: rotate(225deg) translate(-2px, 2px);
}

.atlas-select-menu,
.atlas-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 80;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(24px);
}

.atlas-select-menu[hidden],
.atlas-picker-popover[hidden] {
  display: none !important;
}

.atlas-select-menu {
  display: grid;
  max-height: 245px;
  gap: 3px;
  padding: 6px;
  overflow: auto;
}

.atlas-select-option {
  width: 100%;
  min-height: 39px;
  padding: 8px 11px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.atlas-select-option:hover {
  background: rgba(0, 113, 227, 0.07);
}

.atlas-select-option[aria-selected="true"] {
  background: var(--blue);
  color: white;
  font-weight: 600;
}

.atlas-picker-icon {
  position: relative;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--muted);
}

.calendar-icon {
  border: 1.5px solid currentColor;
  border-radius: 4px;
}

.calendar-icon::before {
  position: absolute;
  top: 3px;
  right: 0;
  left: 0;
  border-top: 1.5px solid currentColor;
  content: "";
}

.clock-icon {
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.clock-icon::before,
.clock-icon::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.5px;
  height: 5px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  transform-origin: 50% 0;
}

.clock-icon::before {
  transform: translate(-50%, 0) rotate(180deg);
}

.clock-icon::after {
  transform: translate(0, 0) rotate(125deg);
}

.atlas-calendar-popover {
  width: min(310px, 82vw);
  padding: 13px;
}

.atlas-calendar-header {
  display: grid;
  grid-template-columns: 35px 1fr 35px;
  align-items: center;
  margin-bottom: 10px;
}

.atlas-calendar-header strong {
  text-align: center;
}

.atlas-calendar-header button {
  width: 35px;
  height: 35px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 25px;
}

.atlas-calendar-header button:hover {
  background: rgba(29, 29, 31, 0.06);
}

.atlas-calendar-weekdays,
.atlas-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.atlas-calendar-weekdays span {
  padding: 5px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

.atlas-calendar-day {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}

.atlas-calendar-day:hover {
  background: rgba(0, 113, 227, 0.08);
}

.atlas-calendar-day.outside {
  color: var(--faint);
}

.atlas-calendar-day.today {
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.35);
  color: var(--blue);
}

.atlas-calendar-day.selected {
  background: var(--blue);
  color: white;
  box-shadow: none;
  font-weight: 650;
}

.atlas-time-popover {
  top: auto;
  right: 0;
  bottom: calc(100% + 8px);
  left: auto;
  width: min(380px, 86vw);
  padding: 16px;
}

.atlas-time-popover > strong {
  display: block;
  margin: 1px 3px 10px;
  font-size: 14px;
}

.atlas-time-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 11px;
  padding: 11px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(0, 113, 227, 0.1), rgba(90, 200, 250, 0.07));
  color: var(--blue);
  font-size: 34px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.5px;
}

.atlas-time-preview i {
  margin: 0 4px;
  opacity: 0.55;
  font-style: normal;
}

.atlas-time-quick {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.atlas-time-quick::-webkit-scrollbar {
  display: none;
}

.atlas-time-quick button {
  flex: 0 0 auto;
  min-height: 31px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.055);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.atlas-time-quick button:hover,
.atlas-time-quick button.selected {
  background: rgba(0, 113, 227, 0.1);
  color: var(--blue);
}

.atlas-time-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}

.atlas-time-column {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 29px 4px 4px;
  border-radius: 12px;
  background: rgba(29, 29, 31, 0.045);
}

.atlas-time-column::before {
  position: absolute;
  top: 8px;
  left: 10px;
  color: var(--muted);
  content: attr(data-label);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.atlas-time-column button {
  min-height: 31px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.school-dialog {
  overflow: visible;
}

.atlas-time-column button:hover {
  background: rgba(0, 113, 227, 0.08);
}

.atlas-time-column button.selected {
  background: var(--blue);
  color: white;
  font-weight: 650;
}

.atlas-time-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-top: 10px;
}

.atlas-time-actions button {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: rgba(29, 29, 31, 0.06);
  cursor: pointer;
}

.atlas-time-actions .time-done {
  background: var(--blue);
  color: white;
  font-weight: 600;
}

.form-grid textarea {
  resize: vertical;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.form-field-wide {
  grid-column: 1 / -1;
}

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

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

.replace-lessons-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 15px;
  border-radius: 16px;
  background: rgba(175, 82, 222, 0.08);
  cursor: pointer;
}

.replace-lessons-option[hidden] {
  display: none;
}

.replace-lessons-option input {
  margin-top: 3px;
  accent-color: #af52de;
}

.replace-lessons-option span {
  display: grid;
  gap: 3px;
}

.replace-lessons-option small {
  color: var(--muted);
  line-height: 1.4;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.school-event-local {
  background: rgba(255, 149, 0, 0.07);
}

.school-event-replacement {
  background: rgba(175, 82, 222, 0.08);
}

.school-day-due {
  display: grid;
  gap: 5px;
  margin-top: 9px;
}

.school-due-chip {
  overflow: hidden;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(0, 113, 227, 0.08);
  color: #0065ca;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-due-test {
  background: rgba(255, 59, 48, 0.09);
  color: #c52c22;
}

.school-due-note {
  background: rgba(255, 149, 0, 0.1);
  color: #a65f00;
}

.subject-manager-card > h2 {
  margin: 10px 0 8px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.subject-manager-card > p:not(.widget-label):not(.form-message) {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.subject-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  margin-top: 22px;
}

.subject-add-form input,
.subject-manager-row input {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid rgba(29, 29, 31, 0.11);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
}

.subject-add-form input:focus,
.subject-manager-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.subject-manager-list {
  display: grid;
  gap: 7px;
  max-height: 310px;
  margin-top: 12px;
  overflow: auto;
}

.subject-manager-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
}

.subject-manager-row button {
  padding: 9px 11px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}

.subject-row-save {
  background: rgba(0, 113, 227, 0.1);
  color: var(--blue);
}

.subject-row-delete {
  background: rgba(255, 59, 48, 0.09);
  color: #c52c22;
}

.subject-manager-empty {
  margin: 0;
  padding: 20px 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.atlas-confirm-dialog {
  width: min(90vw, 430px);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: rgba(250, 250, 252, 0.97);
  color: var(--text);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.24);
  text-align: center;
  backdrop-filter: blur(30px);
}

.atlas-confirm-dialog::backdrop {
  background: rgba(20, 20, 24, 0.34);
  backdrop-filter: blur(7px);
}

.confirm-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 59, 48, 0.1);
  color: #d92d20;
  font-size: 25px;
  font-weight: 650;
}

.atlas-confirm-dialog h2 {
  margin: 8px 0 10px;
  font-size: 29px;
  letter-spacing: -0.045em;
}

.atlas-confirm-dialog > p:not(.widget-label) {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 25px;
}

.danger-button {
  padding: 11px 16px;
  border: 0;
  border-radius: 999px;
  background: #ff3b30;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

.danger-button:hover {
  background: #e53229;
}

.school-event-interactive {
  cursor: pointer;
  outline: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.school-event-interactive:hover,
.school-event-interactive:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.school-event-interactive:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15), 0 8px 20px rgba(0, 0, 0, 0.08);
}

.lesson-detail-dialog {
  width: min(92vw, 590px);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  background: rgba(250, 250, 252, 0.97);
  color: var(--text);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(30px);
}

.lesson-detail-dialog::backdrop {
  background: rgba(20, 20, 24, 0.34);
  backdrop-filter: blur(7px);
}

.lesson-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.lesson-detail-heading h2 {
  margin: 7px 0 6px;
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: -0.05em;
}

.lesson-detail-heading p:last-child,
.lesson-detail-info {
  color: var(--muted);
}

.lesson-detail-info {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 15px;
  background: rgba(29, 29, 31, 0.055);
  line-height: 1.5;
}

.lesson-note-field {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
}

.lesson-note-field textarea {
  width: 100%;
  padding: 14px;
  resize: vertical;
  border: 1px solid rgba(29, 29, 31, 0.12);
  border-radius: 15px;
  outline: none;
  background: white;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}

.lesson-note-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.week-navigation {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 48px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(20px);
}

.week-button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  transition: background 180ms ease, color 180ms ease;
}

.week-button:hover:not(:disabled) {
  background: white;
  color: var(--text);
}

.week-button:disabled {
  cursor: default;
  opacity: 0.36;
}

.week-button.current {
  background: white;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.week-arrow {
  width: 36px;
  padding: 0;
  font-size: 17px;
}

.select-label {
  color: var(--muted);
  font-size: 13px;
}

select,
input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

select {
  max-width: 230px;
  padding: 0 36px 0 13px;
}

input {
  width: 100%;
  padding: 0 14px;
}

select:focus,
input:focus {
  border-color: rgba(0, 113, 227, 0.5);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.calendar-connect {
  background: linear-gradient(145deg, rgba(223, 235, 255, 0.94), rgba(255, 255, 255, 0.9));
}

.spotify-connect {
  background: linear-gradient(145deg, rgba(220, 247, 228, 0.94), rgba(255, 255, 255, 0.9));
}

.calendar-connect h2 {
  margin: 5px 0 6px;
}

.settings-card-heading p:last-child {
  color: var(--muted);
}

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

.account-card {
  grid-column: 1 / -1;
  background:
    radial-gradient(circle at 90% 0%, rgba(172, 139, 255, 0.22), transparent 34%),
    rgba(255, 255, 255, 0.88);
}

.account-card .settings-card-heading {
  margin-bottom: 22px;
}

.account-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: linear-gradient(145deg, #7a5cff, #ff4f91);
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(75, 55, 150, 0.2);
}

.account-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.profile-name-form {
  display: grid;
  gap: 8px;
  margin-top: 23px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.profile-name-form > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.profile-name-form > div {
  display: flex;
  gap: 9px;
  max-width: 520px;
}

.profile-name-form input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  background: var(--surface-solid);
  color: var(--text);
  font: inherit;
}

.profile-name-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent);
}

.profile-name-form .form-message {
  min-height: 16px;
  margin: 0;
}

@media (max-width: 560px) {
  .profile-name-form > div {
    display: grid;
  }
}

.account-role {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.09);
  color: #0066cc;
  font-size: 12px;
  font-weight: 650;
}

html[data-atlas-role="member"] .admin-app-config {
  display: none !important;
}

html[data-atlas-role="member"] .admin-user-management {
  display: none !important;
}

.user-management {
  display: grid;
  gap: 14px;
  margin-top: 28px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.user-management-copy {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.invite-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.account-user-list {
  display: grid;
  gap: 8px;
}

.account-user-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.64);
}

.account-user-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 113, 227, 0.1);
  color: #0066cc;
  object-fit: cover;
  font-size: 14px;
  font-weight: 700;
}

.account-user-row > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.account-user-row strong,
.account-user-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-user-row span {
  color: var(--muted);
  font-size: 12px;
}

.invite-remove {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #c9342c;
  cursor: pointer;
  font-size: 12px;
}

@media (max-width: 600px) {
  .invite-form {
    grid-template-columns: 1fr;
  }

  .invite-form .primary-button {
    width: 100%;
  }

  .focus-heading {
    display: block;
  }

  .focus-heading .page-heading {
    margin-bottom: 20px;
  }

  .focus-add-button {
    width: 100%;
    justify-content: center;
    margin-bottom: 22px;
  }

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

  .focus-stat {
    min-height: 120px;
    padding: 18px;
    border-radius: 22px;
  }

  .focus-stat-primary {
    grid-column: 1 / -1;
  }

  .focus-stat strong {
    margin-top: 13px;
    font-size: 38px;
  }

  .focus-filters {
    width: 100%;
    overflow-x: auto;
  }

  .focus-filter {
    min-width: max-content;
    flex: 1;
  }

  .focus-task {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 15px 16px;
  }

  .focus-task-delete {
    grid-column: 2;
    justify-self: start;
    padding: 4px 0;
  }

  .focus-task-form-grid {
    grid-template-columns: 1fr;
  }

  .focus-task-form-wide {
    grid-column: auto;
  }
}

.settings-card {
  padding: clamp(28px, 4vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: var(--radius-large);
  background-color: var(--surface);
  box-shadow: var(--shadow);
}

.settings-card-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
}

.settings-card h2 {
  font-size: clamp(25px, 2.5vw, 36px);
  letter-spacing: -0.04em;
}

.service-icon {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 17px;
  background: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  font-size: 24px;
  font-weight: 650;
}

.google-icon {
  color: #4285f4;
}

.spotify-icon {
  background: #1ed760;
  color: #081c0f;
}

.setup-guide {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.setup-guide summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  list-style-position: inside;
}

.setup-guide ol {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding-left: 22px;
  line-height: 1.4;
}

.setup-guide code {
  display: block;
  overflow-x: auto;
  padding: 12px 14px;
  border: 1px solid rgba(29, 29, 31, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.connect-form {
  display: grid;
  gap: 10px;
}

.calendar-settings {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.calendar-settings > div {
  display: grid;
  flex: 1;
  gap: 8px;
}

.calendar-settings select {
  width: 100%;
  max-width: none;
}

.settings-info-card {
  background: rgba(255, 255, 255, 0.68);
}

.settings-info-card h2 {
  margin: 18px 0 12px;
}

.settings-info-card > p:last-child {
  color: var(--muted);
  line-height: 1.55;
}

.timetable-settings-card {
  grid-column: 1 / -1;
}

.timetable-settings-card > h2 {
  margin: 18px 0 8px;
}

.timetable-settings-card > p:not(.widget-label) {
  margin: 0;
  color: var(--muted);
}

.layout-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.layout-option {
  display: grid;
  grid-template-columns: 76px 1fr;
  grid-template-rows: auto auto;
  column-gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.layout-option:hover {
  background: white;
}

.layout-option.active {
  border-color: rgba(0, 113, 227, 0.35);
  background: rgba(223, 235, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.07);
}

.layout-option strong {
  align-self: end;
  font-size: 15px;
}

.layout-option small {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
}

.layout-preview {
  display: grid;
  grid-row: 1 / 3;
  width: 76px;
  height: 48px;
  gap: 3px;
  padding: 6px;
  border-radius: 9px;
  background: white;
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.08);
}

.layout-preview-across {
  grid-template-columns: repeat(5, 1fr);
}

.layout-preview-stacked {
  grid-template-rows: repeat(3, 1fr);
}

.layout-preview i {
  border-radius: 3px;
  background: #c7d9f4;
}

.connect-form label {
  color: var(--muted);
  font-size: 13px;
}

.primary-button,
.secondary-button,
.spotify-button {
  min-height: 42px;
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 560;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.primary-button {
  padding: 0 18px;
  background: var(--blue);
  color: white;
}

.spotify-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  background: #1ed760;
  color: #081c0f;
  cursor: pointer;
  font-weight: 650;
}

.secondary-button {
  padding: 0 15px;
  background: rgba(29, 29, 31, 0.07);
}

.primary-button:hover,
.secondary-button:hover,
.spotify-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.spotify-button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.form-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-message.error {
  color: #b42318;
}

.timetable {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 18px;
}

.timetable.layout-stacked {
  grid-template-columns: 1fr;
}

.timetable.layout-stacked .school-day {
  display: grid;
  grid-template-columns: minmax(90px, 0.15fr) 1fr;
  gap: 22px;
}

.timetable.layout-stacked .school-day-header {
  align-content: start;
  align-items: flex-start;
  flex-direction: column;
  justify-content: flex-start;
  margin-bottom: 0;
}

.timetable.layout-stacked .school-events {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  align-items: start;
}

.timetable-empty {
  display: grid;
  grid-column: 1 / -1;
  min-height: 210px;
  place-content: center;
  border: 1px dashed rgba(29, 29, 31, 0.16);
  border-radius: var(--radius-large);
  color: var(--muted);
  text-align: center;
}

.timetable-empty span {
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 13px;
}

.empty-action {
  justify-self: center;
  margin-top: 18px;
}

.school-day {
  min-width: 150px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: var(--radius-medium);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.045);
  backdrop-filter: blur(20px);
}

.school-day.today {
  background: rgba(223, 235, 255, 0.78);
  box-shadow: 0 14px 38px rgba(0, 113, 227, 0.09);
}

.school-day-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.school-day-header strong {
  font-size: 16px;
  font-weight: 620;
}

.school-day-header span {
  color: var(--muted);
  font-size: 13px;
}

.school-events {
  display: grid;
  gap: 10px;
}

.school-event {
  padding: 13px;
  border-left: 3px solid var(--event-color, var(--blue));
  border-radius: 4px 13px 13px 4px;
  background: rgba(255, 255, 255, 0.86);
}

.school-event-time {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.school-event-title {
  display: block;
  font-size: 14px;
  font-weight: 610;
  line-height: 1.25;
}

.school-event-location {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.no-classes {
  color: var(--faint);
  font-size: 13px;
}

.travel-layout {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 22px;
}

.travel-feature {
  display: flex;
  min-height: 290px;
  align-items: flex-end;
  justify-content: space-between;
  padding: clamp(28px, 4vw, 52px);
  border-radius: var(--radius-large);
  background:
    linear-gradient(120deg, rgba(15, 20, 28, 0.18), rgba(15, 20, 28, 0.7)),
    linear-gradient(145deg, #9eabb8, #33404d);
  color: white;
}

.travel-feature h2 {
  margin: 8px 0 6px;
  font-size: clamp(42px, 5vw, 76px);
  letter-spacing: -0.055em;
}

.travel-feature p {
  color: rgba(255, 255, 255, 0.76);
}

.travel-feature .year {
  color: white;
  font-size: 18px;
}

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

.stat {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border-radius: var(--radius-medium);
}

.stat strong {
  font-size: clamp(32px, 3vw, 48px);
  font-weight: 500;
  letter-spacing: -0.055em;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.next-trip {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 34px;
  border-radius: var(--radius-medium);
}

.next-trip h2,
.project-card h2 {
  margin: 9px 0 0;
  font-size: clamp(25px, 2.5vw, 38px);
  letter-spacing: -0.04em;
}

.status-pill {
  padding: 8px 13px;
  border-radius: 999px;
  background: #e8f7ec;
  color: #237a3b;
  font-size: 13px;
}

.trip-archive-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.travel-add-button {
  flex: 0 0 auto;
}

.trip-archive-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.trip-archive-actions p {
  margin: 0;
  color: var(--muted);
}

.trip-view-toggle {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, 38px);
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(29, 29, 31, 0.06);
}

.trip-view-toggle button {
  display: grid;
  width: 38px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.trip-view-toggle button.active {
  background: white;
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}

.trip-view-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.travel-feature {
  background-position: center;
  background-size: cover;
}

.next-trip > div > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.trip-archive {
  margin-top: clamp(42px, 6vw, 80px);
}

.trip-archive-heading h2 {
  margin: 7px 0 0;
  font-size: clamp(31px, 3vw, 46px);
  letter-spacing: -0.045em;
}

.trip-archive-heading > p {
  margin: 0 0 6px;
  color: var(--muted);
}

.trip-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.trip-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.trip-list.view-list {
  grid-template-columns: 1fr;
}

.trip-list.view-list .trip-card {
  display: grid;
  min-height: 156px;
  grid-template-columns: minmax(160px, 24%) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
}

.trip-list.view-list .trip-album {
  height: 100%;
  min-height: 156px;
  grid-row: 1 / 3;
}

.trip-list.view-list .trip-album img {
  display: none;
}

.trip-list.view-list .trip-album img:first-child {
  display: block;
  grid-area: 1 / 1 / 3 / 5;
}

.trip-list.view-list .trip-card-body {
  align-self: center;
  padding: 16px 21px 7px;
}

.trip-list.view-list .trip-card-footer {
  grid-column: 2;
  padding: 0 21px 14px;
}

.trip-list.view-list .trip-card h3 {
  margin: 6px 0 4px;
  font-size: 24px;
}

.trip-list.view-list .trip-card-description {
  margin-top: 8px;
  -webkit-line-clamp: 1;
}

.trip-album {
  display: grid;
  height: 300px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 3px;
  overflow: hidden;
  background: #e5e5ea;
}

.trip-album img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
}

.trip-album-1 img:first-child {
  grid-area: 1 / 1 / 3 / 5;
}

.trip-album-2 img {
  grid-row: 1 / 3;
  grid-column: span 2;
}

.trip-album-3 img:first-child,
.trip-album-5 img:first-child {
  grid-row: 1 / 3;
  grid-column: span 2;
}

.trip-album-3 img:not(:first-child) {
  grid-column: span 2;
}

.trip-album-4 img {
  grid-column: span 2;
}

.trip-album.empty {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #eef0f4, #dfe3ea);
  color: var(--muted);
  font-size: 14px;
}

.trip-card-body {
  padding: 23px 24px 15px;
}

.trip-card-meta,
.trip-card-places,
.trip-card-description {
  margin: 0;
  color: var(--muted);
}

.trip-card-meta {
  font-size: 12px;
}

.country-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.country-flag {
  width: 24px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
}

.country-flag-fallback {
  flex: 0 0 auto;
  font-family: "Segoe UI Emoji", sans-serif;
  font-size: 18px;
  line-height: 1;
}

.travel-feature h2 .country-flag {
  width: 34px;
  height: 24px;
  border-radius: 6px;
}

.memory-copy .country-flag {
  width: 20px;
  height: 14px;
  border-radius: 3px;
}

.trip-card h3 {
  margin: 8px 0 6px;
  font-size: 29px;
  letter-spacing: -0.04em;
}

.trip-card-places {
  font-size: 14px;
}

.trip-card-description {
  display: -webkit-box;
  margin-top: 15px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.trip-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px 22px;
  color: var(--muted);
  font-size: 13px;
}

.trip-card-footer > div {
  display: flex;
  gap: 7px;
}

.trip-card-footer button {
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.06);
  cursor: pointer;
}

.trip-empty {
  display: flex;
  grid-column: 1 / -1;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 30px;
  border: 1px dashed rgba(29, 29, 31, 0.16);
  border-radius: 28px;
  color: var(--muted);
  text-align: center;
}

.trip-empty strong {
  color: var(--text);
  font-size: 22px;
}

.trip-empty .primary-button {
  margin-top: 12px;
}

.trip-dialog {
  width: min(92vw, 760px);
  max-height: 92vh;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 30px;
  background: rgba(250, 250, 252, 0.97);
  color: var(--text);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(30px);
}

.trip-dialog::backdrop {
  background: rgba(20, 20, 24, 0.35);
  backdrop-filter: blur(6px);
}

.trip-form {
  padding: 30px;
}

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

.trip-form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.trip-form-wide {
  grid-column: 1 / -1;
}

.trip-form-grid input,
.trip-form-grid textarea,
.trip-photo-fields input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(29, 29, 31, 0.11);
  border-radius: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
}

.trip-form-grid input:focus,
.trip-form-grid textarea:focus,
.trip-photo-fields input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.trip-photo-section {
  margin-top: 22px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(29, 29, 31, 0.035);
}

.trip-photo-section > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.trip-photo-section > div:first-child span {
  color: var(--muted);
  font-size: 12px;
}

.trip-photo-picker {
  position: relative;
  display: inline-flex;
  overflow: hidden;
  margin-top: 13px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.trip-photo-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.trip-photo-picker.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.trip-photo-preview {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.trip-photo-editor-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 11px;
  padding: 9px;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.75);
}

.trip-photo-item {
  position: relative;
  height: 86px;
  overflow: hidden;
  border-radius: 12px;
}

.trip-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trip-photo-item button {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 25px;
  height: 25px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 20, 24, 0.72);
  color: white;
  cursor: pointer;
  font-size: 17px;
  backdrop-filter: blur(8px);
}

.trip-photo-fields {
  display: grid;
  align-content: center;
  gap: 7px;
}

.trip-photo-fields input {
  padding: 9px 11px;
  border-radius: 11px;
  font-size: 13px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.project-card {
  min-height: 210px;
  padding: clamp(28px, 3vw, 42px);
  border-radius: var(--radius-large);
}

.project-card-wide {
  grid-column: 1 / -1;
  min-height: 250px;
  background: linear-gradient(145deg, rgba(223, 235, 255, 0.92), rgba(255, 255, 255, 0.86));
}

.project-card > p:last-of-type {
  margin-top: 14px;
  color: var(--muted);
}

.progress {
  height: 7px;
  margin-top: 48px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.1);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  color: var(--faint);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.1);
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes location-pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.92);
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  main {
    display: block;
    padding-top: 56px;
  }

  .widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .memory-widget {
    grid-column: span 2;
    grid-row: auto;
    min-height: 340px;
  }

  .travel-layout {
    grid-template-columns: 1fr;
  }

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

  .school-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .school-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .week-navigation {
    margin: 0;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .navigation {
    width: 100%;
  }

  .nav-button {
    flex: 1;
  }

  .widget-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .memory-widget {
    grid-column: auto;
    min-height: 300px;
  }

  .project-card-wide {
    grid-column: auto;
  }

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

  .school-overview {
    grid-template-columns: 1fr;
  }

  .school-planner-actions,
  .school-planner-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .school-add-button {
    width: 100%;
  }

  .week-navigation,
  .planner-filters {
    width: 100%;
  }

  .week-navigation button,
  .planner-filter {
    flex: 1;
  }

  .planner-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .planner-item-actions {
    grid-column: 2;
  }

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

  .form-field-wide {
    grid-column: auto;
  }

  .travel-feature {
    min-height: 240px;
  }

  .calendar-settings {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-settings select {
    width: 100%;
    max-width: none;
  }

  .layout-picker {
    grid-template-columns: 1fr;
  }

  .timetable.layout-stacked .school-day {
    grid-template-columns: 1fr;
  }

  .timetable.layout-stacked .school-day-header {
    align-items: baseline;
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Tablet layout: use the available aspect ratio instead of a tall web-page flow. */
@media (min-width: 600px) and (max-width: 1180px),
  (any-pointer: coarse) and (min-width: 600px) and (max-width: 1400px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .navigation {
    top: 20px;
    right: 28px;
  }

  .app-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    padding: 20px 28px 14px;
    overflow: hidden;
  }

  main {
    display: grid;
    min-height: 0;
    padding: 18px 0 10px;
    overflow: hidden;
  }

  .page.active {
    height: 100%;
    min-height: 0;
    padding-right: 4px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  #home.page.active {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding-right: 0;
    overflow: hidden;
  }

  .home-hero {
    margin-bottom: 18px;
  }

  .clock {
    margin-top: 4px;
    font-size: clamp(64px, 10vh, 104px);
  }

  .home-hero h1 {
    margin-top: 12px;
    font-size: clamp(27px, 4vw, 42px);
  }

  .home-hero .muted {
    margin-top: 6px;
    font-size: 15px;
  }

  .widget-grid {
    min-height: 0;
    grid-auto-rows: minmax(0, 1fr);
    gap: 14px;
  }

  .widget {
    min-height: 0;
    padding: 18px;
  }

  .memory-widget {
    min-height: 0;
  }

  .memory-copy {
    right: 22px;
    bottom: 20px;
    left: 22px;
  }

  .memory-copy strong {
    font-size: clamp(25px, 3.5vw, 38px);
  }

  .music-widget {
    padding: 16px;
  }

  .music-summary {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
  }

  .music-artwork {
    width: 44px;
    height: 44px;
    border-radius: 11px;
  }

  .spotify-controls button {
    width: 27px;
    height: 27px;
  }

  .page-heading {
    margin-bottom: 24px;
  }

  .page-heading h1 {
    font-size: clamp(52px, 8vw, 82px);
  }

  .school-overview {
    gap: 10px;
    margin: 20px 0 16px;
  }

  .school-overview-card {
    padding: 16px 18px;
    border-radius: 19px;
  }

  .school-overview-card h2 {
    margin-top: 10px;
  }

  .school-day {
    min-width: 135px;
    padding: 13px;
  }

  .school-event {
    padding: 10px;
  }

  .school-planner {
    margin-top: 22px;
    padding: 22px;
  }

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

  .settings-card {
    padding: 22px;
  }

  .timetable-settings-card {
    grid-column: 1 / -1;
  }

  .footer {
    min-height: 18px;
  }
}

@media (min-width: 600px) and (max-width: 900px) and (orientation: portrait) {
  .widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(190px, 1.25fr) repeat(2, minmax(112px, 0.75fr));
  }

  .memory-widget {
    grid-column: span 2;
    grid-row: auto;
  }

  .widget-value {
    margin-top: 8px;
    font-size: 34px;
  }

  .widget-value-small {
    font-size: 27px;
  }
}

/* Phone app mode */
@media (max-width: 599px), (any-pointer: coarse) and (max-width: 900px) {
  :root {
    --background: #f2f2f7;
    --surface: rgba(255, 255, 255, 0.92);
    --line: rgba(60, 60, 67, 0.12);
    --shadow: 0 5px 18px rgba(0, 0, 0, 0.045);
  }

  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    background: var(--background);
  }

  .app-shell {
    display: block;
    width: 100%;
    height: 100vh;
    height: 100svh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .topbar {
    display: contents;
  }

  .brand {
    display: none;
  }

  .navigation {
    position: fixed !important;
    top: auto !important;
    right: 10px;
    bottom: 8px !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    left: 10px;
    z-index: 100;
    display: grid !important;
    width: auto !important;
    height: auto !important;
    flex-direction: row !important;
    grid-template-columns: repeat(var(--visible-nav-items, 6), minmax(0, 1fr));
    gap: 0;
    padding: 7px 6px 6px;
    border: 0.5px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    background: rgba(249, 249, 251, 0.82);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
    -webkit-backdrop-filter: saturate(180%) blur(28px);
    backdrop-filter: saturate(180%) blur(28px);
  }

  .nav-button {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-direction: column;
    gap: 4px;
    min-height: 49px;
    padding: 3px 2px 2px;
    border-radius: 17px;
    font-size: 9.5px;
    font-weight: 520;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-button.active {
    background: transparent;
    color: var(--blue);
    box-shadow: none;
  }

  .nav-icon {
    display: block;
    width: 21px;
    height: 21px;
    stroke-width: 1.8;
  }

  main {
    position: fixed;
    top: env(safe-area-inset-top);
    right: 0;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 0;
    display: grid;
    height: auto;
    min-height: 0;
    padding: 0 15px;
    overflow: hidden;
  }

  .page.active {
    height: 100%;
    min-height: 0;
    padding: 18px 1px 30px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .page.active::-webkit-scrollbar,
  .school-dialog::-webkit-scrollbar,
  .trip-dialog::-webkit-scrollbar {
    display: none;
  }

  .footer {
    display: none;
  }

  .home-hero {
    margin-bottom: 24px;
  }

  .eyebrow {
    font-size: 13px;
  }

  .clock {
    margin-top: 4px;
    font-size: clamp(62px, 20vw, 80px);
    font-weight: 320;
    letter-spacing: -0.065em;
  }

  .home-hero h1 {
    margin-top: 12px;
    font-size: 28px;
    font-weight: 620;
  }

  .home-hero .muted {
    margin-top: 6px;
    font-size: 14px;
  }

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

  .widget {
    min-height: 128px;
    padding: 17px;
    border: 0.5px solid rgba(60, 60, 67, 0.08);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.04);
    backdrop-filter: none;
  }

  .memory-widget {
    grid-column: 1 / -1;
    min-height: 205px;
    border-radius: 26px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.09);
  }

  .memory-copy {
    right: 20px;
    bottom: 18px;
    left: 20px;
  }

  .memory-copy strong {
    font-size: 27px;
  }

  .memory-arrow {
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
  }

  .widget-value {
    margin-top: 9px;
    font-size: 36px;
  }

  .widget-value-small {
    font-size: 27px;
  }

  .widget-detail {
    font-size: 12px;
  }

  .music-widget {
    grid-column: 1 / -1;
    min-height: 148px;
    padding: 17px;
  }

  .music-widget:has(.spotify-volume:not([hidden])) {
    min-height: 188px;
  }

  .music-summary {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .music-artwork {
    width: 48px;
    height: 48px;
  }

  .page-heading,
  .school-toolbar {
    margin-bottom: 22px;
  }

  .page-heading h1,
  .school-toolbar h1 {
    margin-top: 5px;
    font-size: 39px;
    font-weight: 650;
  }

  .school-overview-card,
  .school-day,
  .school-planner,
  .settings-card,
  .project-card,
  .next-trip,
  .stat {
    border: 0.5px solid rgba(60, 60, 67, 0.08);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.04);
    backdrop-filter: none;
  }

  .school-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
  }

  .week-navigation {
    display: grid;
    width: 100%;
    grid-template-columns: 44px 1fr 44px;
    margin: 0;
  }

  .school-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 0 0 16px;
  }

  .school-overview-card {
    min-height: 112px;
    padding: 15px;
    border-radius: 18px;
  }

  .school-overview-card h2,
  .school-overview-compact h2 {
    margin-top: 9px;
    font-size: 21px;
  }

  .school-overview-card > p:last-child {
    font-size: 11px;
  }

  .mobile-day-tabs {
    position: sticky;
    top: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin: 0 -1px 12px;
    padding: 7px;
    border: 0.5px solid rgba(60, 60, 67, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.035);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
  }

  .mobile-day-tabs button {
    display: grid;
    gap: 2px;
    min-height: 48px;
    place-items: center;
    padding: 5px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
  }

  .mobile-day-tabs strong {
    color: var(--text);
    font-size: 15px;
  }

  .mobile-day-tabs button.active {
    background: var(--blue);
    color: white;
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.24);
  }

  .mobile-day-tabs button.active strong {
    color: white;
  }

  .timetable,
  .timetable.layout-stacked {
    display: block;
    padding: 0;
    overflow: visible;
  }

  .timetable .school-day.mobile-hidden {
    display: none;
  }

  .timetable.layout-stacked .school-day,
  .school-day {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 17px;
    border-radius: 21px;
  }

  .school-day-header {
    margin-bottom: 14px;
  }

  .school-events {
    gap: 8px;
  }

  .school-event {
    padding: 12px;
  }

  .school-planner {
    margin-top: 18px;
    padding: 17px;
    border-radius: 23px;
  }

  .school-planner-heading,
  .school-planner-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .school-planner-heading h2 {
    font-size: 27px;
  }

  .planner-filters {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .planner-filter {
    flex: 0 0 auto;
  }

  .school-add-button {
    width: 100%;
  }

  .planner-item {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 13px;
  }

  .planner-item-actions {
    grid-column: 2;
  }

  .travel-layout,
  .settings-grid,
  .project-grid,
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .trip-archive-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .trip-archive-actions {
    align-items: center;
    flex-flow: row wrap;
    gap: 10px;
  }

  .trip-archive-actions p {
    width: 100%;
  }

  .trip-view-toggle {
    flex: 0 0 auto;
  }

  .trip-archive-actions .travel-add-button {
    min-height: 40px;
    flex: 1 1 auto;
    width: auto;
    margin: 0;
  }

  .travel-feature {
    min-height: 220px;
    padding: 25px;
    border-radius: 24px;
  }

  .travel-feature h2 {
    font-size: 47px;
  }

  .next-trip,
  .settings-card,
  .project-card,
  .stat {
    padding: 20px;
    border-radius: 22px;
  }

  .trip-archive {
    margin-top: 34px;
  }

  .trip-archive-heading > p {
    margin: 0;
  }

  .trip-list {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 16px;
  }

  .trip-card {
    border-radius: 24px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.045);
  }

  .trip-album {
    height: 225px;
  }

  .trip-card-body {
    padding: 19px 19px 13px;
  }

  .trip-card h3 {
    font-size: 26px;
  }

  .trip-card-footer {
    padding: 0 19px 18px;
  }

  .trip-list.view-list .trip-card {
    min-height: 116px;
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .trip-list.view-list .trip-album {
    min-height: 116px;
  }

  .trip-list.view-list .trip-card-body {
    padding: 12px 13px 5px;
  }

  .trip-list.view-list .trip-card h3 {
    margin: 3px 0;
    font-size: 19px;
  }

  .trip-list.view-list .trip-card-description {
    display: none;
  }

  .trip-list.view-list .trip-card-footer {
    grid-column: 2;
    padding: 0 13px 10px;
  }

  .trip-list.view-list .trip-card-footer > span {
    display: none;
  }

  .timetable-settings-card {
    grid-column: auto;
  }

  .layout-picker {
    grid-template-columns: 1fr;
  }

  .calendar-settings {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-settings select {
    width: 100%;
    max-width: none;
  }

  .subject-manager-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .subject-row-delete {
    grid-column: 2;
  }

  .school-dialog,
  .trip-dialog,
  .practice-song-dialog,
  .lesson-detail-dialog,
  .atlas-confirm-dialog {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    max-height: 92svh;
    margin: auto 0 0;
    overflow: auto;
    border-radius: 28px 28px 0 0;
    scrollbar-width: none;
  }

  .school-form,
  .trip-form,
  .practice-song-dialog form,
  .lesson-detail-dialog,
  .atlas-confirm-dialog {
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  }

  .dialog-heading h2 {
    font-size: 31px;
  }

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

  .trip-form-grid {
    grid-template-columns: 1fr;
  }

  .practice-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .practice-add-button {
    width: 100%;
    justify-content: center;
    margin: -5px 0 18px;
  }

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

  .practice-stat {
    min-height: 106px;
    padding: 14px;
    border-radius: 19px;
  }

  .practice-stat strong {
    margin-top: 13px;
    font-size: 32px;
  }

  .practice-stat > span {
    font-size: 10px;
  }

  .practice-filters {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .practice-filter {
    flex: 0 0 auto;
  }

  .practice-song-list,
  .practice-song-form-grid {
    grid-template-columns: 1fr;
  }

  .practice-song-form-wide {
    grid-column: auto;
  }

  .practice-import-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .practice-import-button,
  .practice-import-row > button {
    justify-content: center;
    width: 100%;
  }

  #practice-import-name {
    white-space: normal;
  }

  .practice-catalog-search-bar {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .practice-catalog-search-bar button {
    grid-column: 1 / -1;
  }

  .practice-pdf-dialog {
    width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }

  .trip-form-wide {
    grid-column: auto;
  }

  .trip-photo-section {
    padding: 14px;
  }

  .trip-photo-editor-item {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .trip-photo-item {
    height: 82px;
  }

  .form-field-wide {
    grid-column: auto;
  }

  .time-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .atlas-select-menu,
  .atlas-calendar-popover,
  .atlas-time-popover {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    max-height: 62svh;
    z-index: 200;
  }

  .atlas-select-menu {
    padding: 9px;
  }

  .atlas-select-option {
    min-height: 46px;
  }

  .atlas-time-columns {
    grid-template-columns: 2fr 1fr;
  }
}

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

/* APPEARANCE & NAVIGATION SETTINGS */

.nav-button[hidden] {
  display: none !important;
}

.theme-settings-card,
.navigation-settings-card {
  grid-column: 1 / -1;
}

.settings-card-description {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.theme-option {
  display: grid;
  min-width: 0;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.theme-option:hover {
  transform: translateY(-2px);
}

.theme-option.active {
  border-color: color-mix(in srgb, var(--blue) 45%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 10%, transparent);
}

.theme-option > span:last-child {
  display: grid;
  gap: 3px;
}

.theme-option strong {
  font-size: 15px;
}

.theme-option small {
  color: var(--muted);
  font-size: 12px;
}

.theme-preview {
  position: relative;
  display: grid;
  height: 92px;
  grid-template-columns: 1.3fr 0.7fr;
  grid-template-rows: 1fr 1fr;
  gap: 7px;
  padding: 12px;
  overflow: hidden;
  border-radius: 16px;
}

.theme-preview i {
  display: block;
  border-radius: 7px;
}

.theme-preview i:first-child {
  grid-row: 1 / -1;
}

.theme-preview-light { background: linear-gradient(145deg, #fff, #e9eaf0); }
.theme-preview-light i { background: rgba(255, 255, 255, 0.95); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.theme-preview-light i:first-child { background: linear-gradient(145deg, #222, #72727a); }
.theme-preview-dark { background: linear-gradient(145deg, #090a0d, #20232b); }
.theme-preview-dark i { background: #2b2e36; }
.theme-preview-dark i:first-child { background: linear-gradient(145deg, #694dff, #db4f92); }
.theme-preview-forest { background: #e8dfca; }
.theme-preview-forest i { border: 1px solid #b7aa8b; border-radius: 3px; background: #f7f0df; }
.theme-preview-forest i:first-child { background: linear-gradient(145deg, #294b38, #6c7a4d); }

.theme-automation {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.theme-automation-heading > div {
  display: grid;
  gap: 4px;
}

.theme-automation-heading strong {
  font-size: 15px;
}

.theme-automation-heading span {
  color: var(--muted);
  font-size: 13px;
}

.theme-mode-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 650px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
}

.theme-mode-option {
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.theme-mode-option.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.09);
}

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

.theme-schedule[hidden] {
  display: none;
}

.theme-schedule label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.theme-schedule input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

/* SHARED SPOTIFY PLAYLISTS */

.spotify-playlists {
  display: grid;
  gap: 18px;
  margin: 34px 0 30px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.07);
}

.spotify-playlists-heading,
.spotify-playlist-manager-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.spotify-playlists-heading h2 {
  margin: 4px 0 3px;
  font-size: clamp(23px, 2vw, 31px);
}

.spotify-playlists-heading p,
.spotify-playlist-manager-heading p {
  margin: 0;
}

.spotify-playlists-message {
  margin: 0;
  color: var(--muted);
}

.spotify-playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 13px;
}

.spotify-playlist-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 68px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 13px 15px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-solid) 84%, transparent);
  transition: transform 180ms ease, border-color 180ms ease;
}

.spotify-playlist-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, #1ed760 45%, var(--line));
}

.spotify-playlist-card > img,
.spotify-playlist-placeholder {
  width: 68px;
  height: 68px;
  grid-row: 1 / -1;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

.spotify-playlist-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1ed760, #096d31);
  color: white;
  font-size: 28px;
}

.spotify-playlist-copy {
  min-width: 0;
}

.spotify-playlist-copy h3,
.spotify-playlist-copy p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spotify-playlist-copy h3 {
  font-size: 15px;
}

.spotify-playlist-copy p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.spotify-playlist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.spotify-playlist-actions button,
.spotify-playlist-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 7px 11px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.spotify-playlist-play {
  background: #1ed760;
  color: #07170d;
}

.spotify-playlist-hide {
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  color: var(--muted);
}

.spotify-playlist-open {
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--blue);
}

.spotify-playlist-error {
  border-color: color-mix(in srgb, #ff453a 55%, transparent);
}

.spotify-playlist-manager {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.spotify-playlist-manager[hidden] {
  display: none;
}

.spotify-hidden-playlists {
  display: grid;
  gap: 8px;
}

.spotify-hidden-playlist {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 6px 7px 6px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.spotify-shared-playlist-manager {
  display: grid;
  gap: 14px;
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.spotify-shared-playlist-manager[hidden] {
  display: none;
}

.spotify-shared-playlist-manager h3 {
  margin: 4px 0;
  font-size: 18px;
}

.spotify-shared-playlist-manager p {
  margin: 0;
}

.spotify-shared-playlist-list {
  display: grid;
  gap: 8px;
}

.spotify-shared-playlist-row {
  display: grid;
  min-height: 62px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-solid) 75%, transparent);
}

.spotify-shared-playlist-row > img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
}

.spotify-shared-playlist-row > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.spotify-shared-playlist-row strong,
.spotify-shared-playlist-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spotify-shared-playlist-row small {
  color: var(--muted);
  font-size: 11px;
}

.spotify-shared-playlist-row.excluded {
  opacity: 0.72;
}

/* FIRST-RUN ONBOARDING */

.onboarding-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(900px, calc(100dvh - 32px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.28);
}

.onboarding-dialog::backdrop {
  background: rgba(15, 16, 20, 0.5);
  backdrop-filter: blur(18px) saturate(0.8);
}

.onboarding-dialog form {
  display: grid;
  gap: 25px;
  padding: clamp(24px, 5vw, 48px);
}

.onboarding-intro {
  display: grid;
  justify-items: center;
  text-align: center;
}

.onboarding-mark {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  margin-bottom: 17px;
  border-radius: 21px;
  background: linear-gradient(145deg, #ff375f, #af52de 54%, #0a84ff);
  box-shadow: 0 14px 35px rgba(105, 72, 214, 0.28);
}

.onboarding-mark img {
  width: 40px;
  height: 40px;
  filter: brightness(0) invert(1);
}

.onboarding-intro h1 {
  margin: 8px 0 7px;
  font-size: clamp(35px, 6vw, 55px);
  letter-spacing: -0.045em;
}

.onboarding-intro > p:last-child {
  max-width: 510px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.onboarding-section {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.onboarding-section h2 {
  margin: 3px 0 0;
  font-size: 20px;
}

.onboarding-step {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.onboarding-name {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.onboarding-name input {
  width: 100%;
  min-height: 56px;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 17px;
  outline: 0;
  background: var(--surface-solid);
  color: var(--text);
  font: inherit;
  font-size: 18px;
}

.onboarding-name input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 13%, transparent);
}

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

.onboarding-theme-grid label,
.onboarding-mode-grid label,
.onboarding-navigation-grid label {
  position: relative;
  cursor: pointer;
}

.onboarding-theme-grid input,
.onboarding-mode-grid input,
.onboarding-navigation-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.onboarding-theme-grid label {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.onboarding-theme-grid label:has(input:checked),
.onboarding-mode-grid label:has(input:checked),
.onboarding-navigation-grid label:has(input:checked) {
  border-color: color-mix(in srgb, var(--blue) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 11%, transparent);
}

.onboarding-theme-grid .theme-preview {
  height: 70px;
}

.onboarding-theme-grid strong {
  padding: 0 5px 4px;
  font-size: 13px;
}

.onboarding-mode-grid label {
  display: grid;
  min-height: 68px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.onboarding-mode-grid span,
.onboarding-navigation-grid span {
  display: grid;
  gap: 3px;
}

.onboarding-mode-grid strong,
.onboarding-navigation-grid strong {
  font-size: 13px;
}

.onboarding-mode-grid small,
.onboarding-navigation-grid small {
  color: var(--muted);
  font-size: 10px;
}

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

.onboarding-navigation-grid label {
  display: grid;
  min-height: 62px;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.onboarding-submit {
  min-height: 56px;
  border: 0;
  border-radius: 18px;
  background: var(--blue);
  color: white;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--blue) 27%, transparent);
}

.onboarding-submit:disabled {
  opacity: 0.58;
}

.navigation-section-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.navigation-section-option {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 11px;
  align-items: center;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.navigation-section-option input {
  width: 20px;
  height: 20px;
  grid-row: 1 / -1;
  margin: 0;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  appearance: none;
}

.navigation-section-option input:checked {
  border-color: var(--blue);
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 10 3 3 7-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}

.navigation-section-option span {
  font-size: 14px;
  font-weight: 650;
}

.navigation-section-option small {
  color: var(--muted);
  font-size: 11px;
}

.navigation-section-option.fixed {
  cursor: default;
  opacity: 0.62;
}

@media (max-width: 720px) {
  .theme-picker,
  .navigation-section-picker {
    grid-template-columns: 1fr;
  }

  .theme-option {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
  }

  .theme-preview {
    height: 72px;
  }

  .theme-mode-picker {
    grid-template-columns: 1fr;
  }

  .theme-schedule {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spotify-playlists {
    margin-top: 24px;
    padding: 18px;
    border-radius: 24px;
  }

  .spotify-playlists-heading,
  .spotify-playlist-manager-heading {
    align-items: flex-start;
  }

  .spotify-playlist-grid {
    grid-template-columns: 1fr;
  }

  .onboarding-dialog {
    width: 100vw;
    max-width: none;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .onboarding-dialog form {
    gap: 17px;
    padding: max(22px, env(safe-area-inset-top)) 17px max(24px, env(safe-area-inset-bottom));
  }

  .onboarding-section {
    padding: 16px;
  }

  .onboarding-mode-grid {
    grid-template-columns: 1fr;
  }
}

/* DARK THEME */

html[data-theme="dark"] {
  color-scheme: dark;
  --background: #0b0c0f;
  --surface: rgba(29, 31, 37, 0.88);
  --surface-solid: #24262d;
  --text: #f5f5f7;
  --muted: #a8a8b0;
  --faint: #777982;
  --line: rgba(255, 255, 255, 0.1);
  --blue: #5ba7ff;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] body {
  background: radial-gradient(circle at 15% -10%, rgba(75, 90, 145, 0.2), transparent 34rem), #0b0c0f;
}

html[data-theme="dark"] :is(.navigation, .widget, .school-overview-card, .school-day, .travel-feature, .stat, .next-trip, .trip-card, .practice-stat, .practice-song, .focus-stat, .focus-task, .settings-card, .layout-option, .theme-option, .navigation-section-option) {
  border-color: rgba(255, 255, 255, 0.08);
  background: var(--surface);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] :is(.focus-task-dialog, .practice-song-dialog, .practice-pdf-dialog, .trip-dialog, .school-dialog, .spotify-search-dialog, .atlas-confirm-dialog, .lesson-detail-dialog, .atlas-select-menu, .atlas-picker-popover) {
  background: #1b1d22;
  color: var(--text);
}

html[data-theme="dark"] :is(input, textarea, select, .atlas-select-button, .atlas-picker-button, .practice-catalog-search-bar, .spotify-search-form) {
  border-color: rgba(255, 255, 255, 0.1);
  background-color: #292b32;
  color: var(--text);
}

html[data-theme="dark"] :is(.secondary-button, .practice-filter, .trip-view-toggle, .layout-option, .theme-option, .navigation-section-option) {
  background-color: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

html[data-theme="dark"] :is(.nav-button.active, .practice-filter.active, .trip-view-toggle button.active) {
  background: #343741;
  color: #fff;
}

html[data-theme="dark"] .calendar-connect { background: linear-gradient(145deg, rgba(34, 63, 98, 0.9), var(--surface)); }
html[data-theme="dark"] .spotify-connect { background: linear-gradient(145deg, rgba(29, 78, 48, 0.86), var(--surface)); }
html[data-theme="dark"] .practice-stat-learning { background: linear-gradient(145deg, rgba(91, 48, 106, 0.85), var(--surface)); }
html[data-theme="dark"] .focus-stat-primary { background: linear-gradient(145deg, rgba(42, 68, 112, 0.9), var(--surface)); }
html[data-theme="dark"] .account-card { background: radial-gradient(circle at 90% 0%, rgba(125, 91, 255, 0.22), transparent 38%), var(--surface); }
html[data-theme="dark"] .service-icon { background: #30323a; }

/* FOREST THEME */

html[data-theme="forest"] {
  color-scheme: light;
  --background: #e9e0cc;
  --surface: rgba(247, 240, 223, 0.94);
  --surface-solid: #f8f1e1;
  --text: #26352a;
  --muted: #6e6655;
  --faint: #958a73;
  --line: rgba(82, 65, 39, 0.18);
  --blue: #315d43;
  --radius-large: 16px;
  --radius-medium: 12px;
  --shadow: 0 12px 0 rgba(92, 72, 42, 0.055), 0 18px 38px rgba(70, 54, 31, 0.08);
}

html[data-theme="forest"] body {
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 250, 233, 0.9), transparent 30rem),
    repeating-linear-gradient(0deg, rgba(87, 68, 38, 0.018) 0 1px, transparent 1px 5px),
    #e9e0cc;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

html[data-theme="forest"] :is(h1, h2, .clock, .widget-value, .practice-stat strong, .focus-stat strong, .stat strong) {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.035em;
}

html[data-theme="forest"] :is(.widget, .school-overview-card, .school-day, .travel-feature, .stat, .next-trip, .trip-card, .practice-stat, .practice-song, .focus-stat, .focus-task, .settings-card, .layout-option, .theme-option, .navigation-section-option) {
  border: 1px solid rgba(92, 72, 42, 0.2);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

html[data-theme="forest"] .navigation {
  border: 1px solid rgba(33, 61, 43, 0.45);
  border-radius: 14px;
  background: #294735;
  box-shadow: 0 12px 28px rgba(40, 53, 38, 0.18);
}

html[data-theme="forest"] .nav-button {
  border-radius: 9px;
  color: #d7ddce;
}

html[data-theme="forest"] .nav-button:hover { color: #fff9e9; }
html[data-theme="forest"] .nav-button.active { background: #eee3c9; color: #294735; box-shadow: none; }
html[data-theme="forest"] .weather-widget { background: #dfe8d6; }
html[data-theme="forest"] .travel-widget { background: #eadbc3; }
html[data-theme="forest"] .music-widget { background: #f3e8d4; }
html[data-theme="forest"] .school-overview-primary { background: #d8e3d2; }
html[data-theme="forest"] .practice-stat-learning { background: #dccfb8; }
html[data-theme="forest"] .focus-stat-primary { background: #ceddc9; }
html[data-theme="forest"] .calendar-connect { background: #dbe5d6; }
html[data-theme="forest"] .spotify-connect { background: #d2dfc8; }
html[data-theme="forest"] .account-card { background: #e7d9c0; }

html[data-theme="forest"] :is(.primary-button, .spotify-button) {
  border-radius: 9px;
  background: #315d43;
}

html[data-theme="forest"] :is(.secondary-button, .practice-filter, .trip-view-toggle, .layout-option) {
  border-radius: 9px;
  background: rgba(91, 72, 43, 0.1);
  color: var(--text);
}

html[data-theme="forest"] :is(input, textarea, select, .atlas-select-button, .atlas-picker-button, .practice-catalog-search-bar, .spotify-search-form) {
  border-color: rgba(82, 65, 39, 0.2);
  border-radius: 9px;
  background-color: #fbf5e8;
  color: var(--text);
}

html[data-theme="forest"] :is(.focus-task-dialog, .practice-song-dialog, .practice-pdf-dialog, .trip-dialog, .school-dialog, .spotify-search-dialog, .atlas-confirm-dialog, .lesson-detail-dialog, .atlas-select-menu, .atlas-picker-popover) {
  border: 1px solid rgba(82, 65, 39, 0.22);
  border-radius: 16px;
  background: #eee4d0;
  color: var(--text);
}

@media (max-width: 599px), (any-pointer: coarse) and (max-width: 900px) {
  html[data-theme="dark"] .navigation { background: rgba(28, 30, 36, 0.9); border-color: rgba(255, 255, 255, 0.1); }
  html[data-theme="forest"] .navigation { background: rgba(41, 71, 53, 0.96); border-color: rgba(23, 47, 32, 0.5); border-radius: 16px; }
  html[data-theme="forest"] main { background: transparent; }
}

/* THEME CONTRAST PASS */

html[data-theme="dark"] {
  --surface: rgba(27, 29, 35, 0.96);
  --muted: #b3b4bc;
  --faint: #8b8d97;
  --line: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] :is(.eyebrow, .widget-label) {
  color: #bfc1ca;
}

html[data-theme="dark"] .school-overview-primary {
  border-color: rgba(102, 155, 255, 0.32);
  background: linear-gradient(145deg, #243a61, #202a42);
}

html[data-theme="dark"] .school-overview-primary :is(.widget-label, p, h2) {
  color: #f5f8ff;
}

html[data-theme="dark"] .school-planner {
  border-color: rgba(255, 255, 255, 0.12);
  background: #191b21;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .planner-filters,
html[data-theme="dark"] .focus-filters {
  background: #292c34;
}

html[data-theme="dark"] :is(.planner-filter, .focus-filter) {
  color: #b7b9c2;
}

html[data-theme="dark"] :is(.planner-filter.active, .focus-filter.active) {
  background: #f1f2f5;
  color: #17191e;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .planner-item {
  border-color: rgba(255, 255, 255, 0.11);
  background: #24272e;
}

html[data-theme="dark"] .planner-item-calendar-event {
  border-color: rgba(194, 112, 235, 0.28);
  background: #2c2532;
}

html[data-theme="dark"] .planner-complete {
  border-color: #747783;
  background: #181a1f;
}

html[data-theme="dark"] .planner-item-actions button {
  background: rgba(255, 255, 255, 0.09);
  color: #c5c7cf;
}

html[data-theme="dark"] .planner-empty,
html[data-theme="dark"] :is(.practice-empty, .focus-empty, .trip-empty, .timetable-empty, .subject-manager-empty) {
  color: #aeb0b9;
}

html[data-theme="dark"] .week-navigation {
  border-color: rgba(255, 255, 255, 0.14);
  background: #202229;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .week-button {
  color: #c4c6cf;
}

html[data-theme="dark"] .week-button:hover:not(:disabled),
html[data-theme="dark"] .week-button.current {
  background: #393c45;
  color: #fff;
}

html[data-theme="dark"] .week-button:disabled {
  color: #8f929c;
  opacity: 0.72;
}

html[data-theme="dark"] .school-day.today {
  border-color: rgba(91, 167, 255, 0.28);
  background: #202c40;
}

html[data-theme="dark"] .school-event {
  background: #2b2e36;
}

html[data-theme="dark"] :is(.account-user-row, .subject-manager-row, .trip-photo-editor-item, .practice-import-row, .trip-photo-section) {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #272a31;
}

html[data-theme="dark"] .account-user-row strong,
html[data-theme="dark"] .account-user-row > div > span:first-of-type {
  color: #f5f5f7;
}

html[data-theme="dark"] .account-user-row span {
  color: #aeb0b9;
}

html[data-theme="dark"] :is(.atlas-select-option:hover, .practice-catalog-result:hover, .spotify-search-result:hover) {
  background: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .navigation-section-option input:checked {
  border-color: #5ba7ff;
  background-color: #267fdc;
}

html[data-theme="dark"] .login-screen {
  background: radial-gradient(circle at 50% 8%, rgba(70, 86, 148, 0.28), transparent 36rem), #0b0c0f;
}

html[data-theme="dark"] .login-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(27, 29, 35, 0.94);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] .google-sign-in {
  border-color: rgba(255, 255, 255, 0.15);
  background: #f5f5f7;
  color: #1d1d1f;
}

html[data-theme="dark"] :is(.spotify-controls button, .location-button) {
  background: rgba(255, 255, 255, 0.09);
  color: #f5f5f7;
}

html[data-theme="dark"] .spotify-controls button:hover {
  background: rgba(255, 255, 255, 0.17);
}

html[data-theme="dark"] :is(.setup-guide code, .calendar-settings, .user-management) {
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .setup-guide code {
  background: #24272e;
}

html[data-theme="dark"] select option {
  background: #292b32;
  color: #f5f5f7;
}

html[data-theme="dark"] .planner-item-event .planner-type,
html[data-theme="dark"] .planner-event-marker {
  background: rgba(205, 132, 239, 0.16);
  color: #dda5f5;
}

html[data-theme="dark"] .planner-item-note .planner-type {
  background: rgba(255, 174, 65, 0.15);
  color: #ffc272;
}

html[data-theme="dark"] .planner-item-test .planner-type {
  background: rgba(255, 105, 97, 0.15);
  color: #ff918b;
}

html[data-theme="dark"] :is(.trip-form-grid input, .trip-form-grid textarea, .trip-photo-fields input, .lesson-note-field textarea, .subject-manager-row input) {
  border-color: rgba(255, 255, 255, 0.13);
  background: #292b32;
  color: #f5f5f7;
}

html[data-theme="forest"] {
  --background: #ddd1b6;
  --surface: #f7eed9;
  --surface-solid: #fff8e8;
  --text: #203629;
  --muted: #625b4c;
  --faint: #7b725f;
  --line: rgba(75, 57, 32, 0.28);
  --shadow: 0 10px 0 rgba(85, 64, 34, 0.07), 0 20px 42px rgba(65, 48, 24, 0.12);
}

html[data-theme="forest"] body {
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 249, 229, 0.8), transparent 29rem),
    repeating-linear-gradient(0deg, rgba(70, 50, 25, 0.025) 0 1px, transparent 1px 5px),
    #ddd1b6;
}

html[data-theme="forest"] :is(.eyebrow, .widget-label) {
  color: #665237;
  font-weight: 700;
}

html[data-theme="forest"] :is(.widget, .school-overview-card, .school-day, .travel-feature, .stat, .next-trip, .trip-card, .practice-stat, .practice-song, .focus-stat, .focus-task, .settings-card) {
  border-color: rgba(75, 57, 32, 0.3);
  background-color: #f7eed9;
}

html[data-theme="forest"] :is(.theme-option, .navigation-section-option, .layout-option, .account-user-row, .subject-manager-row, .planner-item, .school-event, .trip-photo-editor-item) {
  border-color: rgba(75, 57, 32, 0.25);
  background: #fff8e8;
  box-shadow: 0 6px 16px rgba(74, 53, 26, 0.07);
}

html[data-theme="forest"] .school-planner {
  border: 1px solid rgba(75, 57, 32, 0.3);
  background: #efe3c9;
}

html[data-theme="forest"] :is(.planner-filters, .focus-filters) {
  background: rgba(66, 87, 57, 0.14);
}

html[data-theme="forest"] :is(.planner-filter.active, .focus-filter.active, .practice-filter.active) {
  background: #315d43;
  color: #fffbed;
  box-shadow: none;
}

html[data-theme="forest"] .week-navigation {
  border-color: rgba(45, 76, 53, 0.35);
  background: #e9ddc4;
}

html[data-theme="forest"] .week-button {
  color: #435746;
}

html[data-theme="forest"] :is(.week-button:hover:not(:disabled), .week-button.current) {
  background: #315d43;
  color: #fffbed;
}

html[data-theme="forest"] .week-button:disabled {
  color: #706957;
  opacity: 0.7;
}

html[data-theme="forest"] .navigation-section-option input {
  border-color: #6d765d;
  background-color: #fff8e8;
}

html[data-theme="forest"] .navigation-section-option input:checked {
  border-color: #315d43;
  background-color: #315d43;
}

html[data-theme="forest"] .navigation-section-option.fixed {
  opacity: 0.78;
}

html[data-theme="forest"] :is(.trip-photo-section, .practice-import-row, .practice-catalog-search) {
  border: 1px solid rgba(75, 57, 32, 0.2);
  background: #eadfc7;
}

html[data-theme="forest"] .school-overview-primary {
  border-color: #6f8662;
  background: linear-gradient(145deg, #b8c9ac, #d8e2cf);
}

html[data-theme="forest"] .school-day.today {
  border-color: #78906b;
  background: #dce6d3;
}

html[data-theme="forest"] .account-user-row span,
html[data-theme="forest"] .planner-empty {
  color: #685f4f;
}

html[data-theme="forest"] .login-screen {
  background: radial-gradient(circle at 50% 8%, rgba(93, 122, 81, 0.22), transparent 34rem), #ddd1b6;
}

html[data-theme="forest"] .login-card {
  border-color: rgba(75, 57, 32, 0.28);
  border-radius: 18px;
  background: #f7eed9;
  box-shadow: var(--shadow);
}

html[data-theme="forest"] .google-sign-in {
  border-color: rgba(45, 76, 53, 0.32);
  border-radius: 9px;
  background: #315d43;
  color: #fffbed;
}

html[data-theme="forest"] :is(.spotify-controls button, .location-button) {
  background: rgba(49, 93, 67, 0.12);
  color: #294b38;
}

html[data-theme="forest"] .spotify-controls button:hover {
  background: rgba(49, 93, 67, 0.2);
}

html[data-theme="forest"] :is(.trip-view-toggle button.active, .atlas-select-option[aria-selected="true"], .atlas-calendar-day.selected) {
  background: #315d43;
  color: #fffbed;
}

html[data-theme="forest"] .setup-guide code {
  border-color: rgba(75, 57, 32, 0.22);
  background: #fff8e8;
}

html[data-theme="forest"] select option {
  background: #fff8e8;
  color: #203629;
}

html[data-theme="forest"] .planner-item-event .planner-type,
html[data-theme="forest"] .planner-event-marker {
  background: #e6d2e8;
  color: #663777;
}

html[data-theme="forest"] .planner-item-test .planner-type {
  background: #f1d4cb;
  color: #8d342b;
}

html[data-theme="forest"] .planner-item-note .planner-type {
  background: #ebddba;
  color: #76510e;
}
