body {
  background: #111f2c;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #08131e20, #08131e88 38%, #08131ed6 100%),
    url("mountain-sunrise.webp") 60% top / cover no-repeat;
}
body.light::before { display: none; }
header { padding: 22px 16px 24px; }
.brand svg { width: clamp(58px, 9vw, 145px); height: auto; }
.brand b { font-size: clamp(32px, 5vw, 80px); line-height: .95; }
.brand em { font-size: clamp(16px, 2.7vw, 42px); }
header small { font-size: clamp(9px, 1vw, 14px); letter-spacing: .26em; color: #fff; }
header p { font-style: italic; font-size: clamp(13px, 1.5vw, 24px); }
.feature, .metric, .sports, #history p, #checks label, nav {
  background: linear-gradient(145deg, #253847c9, #09131deb);
  border: 1px solid #c4d4e33b;
  backdrop-filter: blur(14px);
}
.feature { padding: 15px; }
.homehead h2 { font-size: clamp(21px, 2.25vw, 36px); }
button.quick, #record .actions #start, .sports button.selected {
  background: linear-gradient(#ff9e2b, #ff710d);
  color: #15100b;
}
nav button.selected { background: linear-gradient(90deg, #a74b0b54, #ff851b12); }
.home-route { display: block; width: 100%; height: 120px; color: #ff922a; }
.home-route[hidden] { display: none; }
#routeMessage { min-height: 95px; display: grid; place-items: center; text-align: center; color: #b8c7d4; }
#routeMessage[hidden] { display: none; }
.light #routeMessage { color: #526477; }
#breakdown { padding-left: 0; list-style: none; }
#breakdown li { padding: 10px 0; border-top: 1px solid #8195a83b; }
#monthMetrics { margin-top: 12px; }
#monthChart { display: flex; align-items: end; gap: 5px; height: 85px; padding-top: 8px; }
#monthChart i { flex: 1; min-width: 0; background: linear-gradient(#ffac41, #ff7410); border-radius: 4px 4px 0 0; }
.progress-note { margin-top: 8px; }
@media (min-width: 700px) {
  .shell { display: grid; grid-template-columns: 128px minmax(0,1fr); gap: 20px; max-width: 1780px; padding: 0 24px 32px; margin: auto; align-items: start; }
  header { max-width: 1780px; margin: auto; text-align: left; padding: 32px 24px 52px; }
  .brand { justify-content: flex-start; }
  header small, header p { display: block; margin-left: clamp(66px, 9.5vw, 155px); }
  main { width: 100%; max-width: none; min-width: 0; padding: 0; }
  nav { position: sticky; inset: auto; top: 18px; width: 100%; margin: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 23px; }
  nav button { display: flex; align-items: center; gap: 9px; font-size: 14px; text-align: left; padding: 10px; }
  nav .uiicon { margin: 0; flex: none; }
  .home-actions, .home-insights, .home-planning { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; align-items: stretch; }
  .home-actions { grid-template-columns: minmax(0,2fr) minmax(120px,1fr); align-items: center; }
  .home-actions .sports { margin: 0; }
  .home-route { height: 160px; }
  #record .grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  #trail, #map { height: clamp(320px,47dvh,520px); }
  .bars { height: 116px; }
  .bars button { min-height: 100px; }
}
@media (min-width: 1120px) {
  .shell { grid-template-columns: clamp(150px,13vw,214px) minmax(0,1fr); gap: 28px; }
  #home { display: grid; grid-template-columns: minmax(0,2fr) minmax(285px,1fr); gap: 18px; }
  #home[hidden] { display: none; }
  .home-summary { padding-top: 44px; }
}
body { isolation: isolate; }
@media (prefers-reduced-transparency: reduce) {
  .feature, .metric, .sports, #history p, #checks label, nav {
    background: #142330;
    backdrop-filter: none;
  }
}
.light .feature, .light .metric, .light .sports, .light #history p, .light #checks label, .light nav {
  background: #fff;
}
@media (min-width: 700px) {
  .shell { grid-template-areas: "navigation content"; }
  .shell > nav { grid-area: navigation; max-width: none; }
  .shell > main { grid-area: content; }
}
.today-activity { grid-template-columns: repeat(2,minmax(0,1fr)); }
@media (min-width: 440px) {
  .today-activity { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
.light header {
  background: linear-gradient(90deg, #0a1829aa, #0a182947),
    url("mountain-sunrise.webp") 61% 8% / cover no-repeat;
  color: #fff;
}
.light header .brand b, .light header small { color: #fff; }
.light header .brand svg path:nth-child(2) { fill: #fff; }
[data-card][hidden], .empty-cards { display: none !important; }
body.no-sunrise::before { background-image: linear-gradient(#263c4e, #09131e); }
body.light.no-sunrise header { background: #172d40; }
.setting-toggle, #cardPreferences label, #checks label { display: flex; align-items: center; gap: 10px; }
.setting-toggle input, #cardPreferences input, #checks input { width: auto; margin: 0; }
#cardPreferences, #checklistEditor { border: 1px solid #8195a880; border-radius: 14px; margin: 14px 0; padding: 12px; }
#editableTasks form { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
#editableTasks label { flex: 1 1 130px; margin: 0; }
#weeklyGoalStatus { display: block; margin-top: 8px; }
body.text-large { --text-boost: 2px; }
body.text-extra { --text-boost: 4px; }
body:is(.text-large,.text-extra) { font-size: calc(16px + var(--text-boost)); }
body:is(.text-large,.text-extra) main small,
body:is(.text-large,.text-extra) .metric,
body:is(.text-large,.text-extra) nav button,
body:is(.text-large,.text-extra) #record label,
body:is(.text-large,.text-extra) .sports button span { font-size: calc(12px + var(--text-boost)); }
body:is(.text-large,.text-extra) .metric strong { font-size: calc(21px + var(--text-boost)); overflow-wrap: anywhere; }
body:is(.text-large,.text-extra) .homehead h2 { font-size: calc(clamp(21px, 2.25vw, 36px) + var(--text-boost)); }
@media(max-width:439px) {
  body.text-extra .sports button span, body.text-extra nav button { font-size: 13px; }
}
@media(min-width:1120px) {
  #home.without-summary { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 699px) {
  body:not(.light):not(.no-sunrise)::before {
    bottom: auto;
    aspect-ratio: 1672 / 941;
    background:
      linear-gradient(180deg, #08131e26 0%, #08131e50 58%, #111f2c 100%),
      url("mountain-sunrise.webp") center top / 100% auto no-repeat;
  }
}
