/* =========================================================
   SipUp — stylesheet

   A sidebar dashboard that collapses into a phone app:

     ≥ 1100px  sidebar + 3-column dashboard grid
     ≥  760px  sidebar + 2-column grid
     <  760px  sidebar becomes a drawer, a 5-item tab bar
               appears, the grid stacks

   Both themes are full designs, not an inversion: light is a pale
   blue paper with white cards; dark is deep navy water with raised
   slate cards and the same blue doing the same job.
   ========================================================= */

:root {
  /* ---- brand ---- */
  --blue-50:  #EAF5FE;
  --blue-100: #D3EBFD;
  --blue-200: #A9D8FA;
  --blue-300: #6FC0F6;
  --blue-400: #38A8F2;
  --blue-500: #1D9BF0;
  --blue-600: #0B84DC;
  --blue-700: #0A6CB4;
  --navy:     #103050;

  --flame:  #FF7A1A;
  --leaf:   #22B573;
  --sun:    #FBB024;
  --drop:   #38BDF8;
  --target: #0EA5E9;
  --gold:   #F5A623;

  /* ---- semantic: light ---- */
  --bg:          #EFF6FC;
  --bg-2:        #E4EFF9;
  --surface:     #FFFFFF;
  --surface-2:   #F5FAFE;
  --surface-3:   #EAF3FB;
  --side-bg:     #FFFFFF;
  --text:        var(--navy);
  --text-soft:   #4E7292;
  --text-faint:  #8AA8C2;
  --line:        #E4EEF7;
  --line-strong: #CFE2F2;

  --accent:      var(--blue-500);
  --accent-ink:  #FFFFFF;
  --accent-soft: var(--blue-50);
  --accent-deep: var(--blue-600);

  --good: #16A46A;  --good-soft: #DDF5EB;
  --warn: #C07C08;  --warn-soft: #FDF0D8;
  --bad:  #E0474C;  --bad-soft:  #FCE4E5;

  --shadow-xs: 0 1px 2px rgba(16, 48, 80, .05);
  --shadow-sm: 0 1px 2px rgba(16, 48, 80, .06), 0 2px 8px rgba(16, 48, 80, .05);
  --shadow:    0 1px 3px rgba(16, 48, 80, .05), 0 8px 24px rgba(16, 48, 80, .08);
  --shadow-lg: 0 8px 20px rgba(16, 48, 80, .12), 0 28px 64px rgba(16, 48, 80, .18);

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
          "Noto Sans Tamil", "Noto Sans Devanagari", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.22, .68, .32, 1);

  --side-w: 244px;
  --gap: 18px;
}

:root[data-theme="dark"] {
  --bg:          #071322;
  --bg-2:        #0A1B2C;
  --surface:     #0F2135;
  --surface-2:   #16304A;
  --surface-3:   #0C1B2C;
  --side-bg:     #0A1727;
  --text:        #E7F2FB;
  --text-soft:   #9FBDD8;
  --text-faint:  #6A8AA8;
  --line:        #1B3550;
  --line-strong: #27506F;

  --accent:      #2FA6F5;
  --accent-ink:  #04121F;
  --accent-soft: #123048;
  --accent-deep: #1B8FE0;

  --good: #2FCE8C;  --good-soft: #0D3323;
  --warn: #E8AC3C;  --warn-soft: #33270E;
  --bad:  #FF7276;  --bad-soft:  #3A1A1C;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.35);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.40);
  --shadow:    0 1px 3px rgba(0,0,0,.36), 0 10px 28px rgba(0,0,0,.44);
  --shadow-lg: 0 10px 24px rgba(0,0,0,.50), 0 32px 72px rgba(0,0,0,.60);
}

/* -------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -.015em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }

.muted { color: var(--text-soft); }
.small { font-size: .82rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* -------------------------------------------------- layout */
.shell { display: flex; min-height: 100%; }

.main {
  flex: 1;
  min-width: 0;
  padding: 0 24px calc(40px + env(safe-area-inset-bottom));
}

.page { display: none; animation: rise .28s var(--ease) both; }
.page.is-active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* The top bar already names the section, so the in-page heading would
   just say it twice. Keep it in the document for structure, out of sight. */
.page-title {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.page-sub { margin: 0 0 16px; font-size: .9rem; }

/* -------------------------------------------------- sidebar */
.sidebar {
  width: var(--side-w);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 14px 18px;
  background: var(--side-bg);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand { display: flex; align-items: flex-start; gap: 10px; padding: 2px 8px 18px; }
.side-brand img { border-radius: 11px; flex: none; box-shadow: var(--shadow-xs); }
.side-brand-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.1; }
.side-brand-text strong { font-size: 1.32rem; letter-spacing: -.035em; color: var(--accent); }
.side-brand-text strong em { font-style: normal; color: var(--text); }
:root[data-theme="dark"] .side-brand-text strong em { color: #fff; }
.side-brand-text small {
  font-size: .63rem; color: var(--text-soft); letter-spacing: .01em; line-height: 1.3;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

.side-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px;
  border: none; background: none; cursor: pointer;
  border-radius: var(--r-sm);
  font-size: .92rem; font-weight: 650;
  color: var(--text-soft);
  text-align: left;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 750; }
.nav-item .ni { width: 20px; height: 20px; flex: none; display: grid; place-items: center; }

.side-scrim { position: fixed; inset: 0; z-index: 59; background: rgba(8, 28, 48, .45); backdrop-filter: blur(3px); }

/* -------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 0;
  background: linear-gradient(180deg, var(--bg) 72%, transparent);
}


.topbar-title {
  font-size: 1.24rem; font-weight: 750; letter-spacing: -.02em;
  margin-right: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar-right { position: relative; display: flex; align-items: center; gap: 9px; margin-left: auto; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--text-soft);
  cursor: pointer; box-shadow: var(--shadow-xs);
  transition: color .15s var(--ease), transform .15s var(--ease), border-color .15s var(--ease);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
#themeBtn { color: #E09609; }
:root[data-theme="dark"] #themeBtn { color: #9FC2E4; }
.burger { display: none; }                     /* shown only on phones, below */
.bell-btn { position: relative; }
.bell-dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bad); border: 2px solid var(--surface);
}

.dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  z-index: 40; width: min(320px, 82vw);
  padding: 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.dropdown h3 { font-size: .96rem; margin-bottom: 10px; }
.dropdown li {
  display: flex; gap: 9px; padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: .86rem;
}
.dropdown li:last-child { border-bottom: none; }
.dropdown li time { margin-left: auto; color: var(--text-faint); font-size: .75rem; flex: none; }

/* -------------------------------------------------- hero */
.hero {
  position: relative;
  display: flex; align-items: center;
  min-height: 172px;
  padding: 26px 30px;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: linear-gradient(120deg, #BFE4FB 0%, #8FCDF4 45%, #6FC0F0 100%);
  isolation: isolate;
}
.hero.is-night { background: linear-gradient(120deg, #142B4A 0%, #1B3A63 48%, #16305A 100%); }
.hero-copy { text-shadow: 0 1px 2px rgba(255, 255, 255, .35); }
.hero.is-night .hero-copy,
.hero[data-scene="stormy"] .hero-copy,
.hero[data-scene="rainy"] .hero-copy { text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.hero-copy { position: relative; z-index: 2; max-width: 62%; }
.hero-copy h1 {
  font-size: clamp(1.22rem, 2.2vw, 1.76rem);
  color: #0B2A47; letter-spacing: -.03em;
  text-wrap: balance;
}
.hero-copy h1 .wave { display: inline-block; margin-left: 4px; }
.hero-copy p { margin-top: 5px; font-size: .96rem; color: #13446E; font-weight: 600; }

/* The scene is one of six paintings, chosen by weather and season.
   It is a background layer rather than an <img> so it can cover the
   banner at any aspect ratio without distorting. */
.hero-scene {
  position: absolute; inset: 0; z-index: 1;
  background-position: center right;
  background-size: cover;
  background-repeat: no-repeat;
  transition: opacity .4s var(--ease);
}

/* A wash over the left so the greeting always has something calm to sit
   on, whichever painting is showing. Tuned per scene: the bright ones
   need more cover, the dark ones almost none. */
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(100deg,
    rgba(238, 247, 255, .95) 0%,
    rgba(238, 247, 255, .80) 26%,
    rgba(238, 247, 255, .34) 48%,
    rgba(238, 247, 255, 0) 66%);
  pointer-events: none;
}
.hero[data-scene="autumn"]::after {
  background: linear-gradient(100deg,
    rgba(255, 244, 232, .95) 0%,
    rgba(255, 241, 226, .80) 26%,
    rgba(255, 238, 220, .32) 48%,
    rgba(255, 238, 220, 0) 66%);
}
.hero[data-scene="spring"]::after {
  background: linear-gradient(100deg,
    rgba(255, 244, 250, .95) 0%,
    rgba(253, 240, 247, .78) 26%,
    rgba(252, 238, 246, .30) 48%,
    rgba(252, 238, 246, 0) 66%);
}
.hero[data-scene="stormy"]::after,
.hero[data-scene="rainy"]::after {
  background: linear-gradient(100deg,
    rgba(12, 26, 44, .88) 0%,
    rgba(12, 26, 44, .70) 26%,
    rgba(12, 26, 44, .26) 48%,
    rgba(12, 26, 44, 0) 66%);
}

/* Night dims the painting instead of swapping it out. */
.hero.is-night .hero-scene { filter: brightness(.52) saturate(.82) hue-rotate(6deg); }
.hero.is-night::after {
  background: linear-gradient(100deg,
    rgba(7, 19, 34, .92) 0%,
    rgba(7, 19, 34, .76) 26%,
    rgba(7, 19, 34, .30) 48%,
    rgba(7, 19, 34, 0) 66%);
}

/* The greeting takes its colour from the painting underneath. */
.hero-copy h1 { color: #0B2A47; }
.hero-copy p  { color: #1B4A74; }
.hero[data-scene="stormy"] .hero-copy h1,
.hero[data-scene="rainy"]  .hero-copy h1,
.hero.is-night .hero-copy h1 { color: #F3F9FF; }
.hero[data-scene="stormy"] .hero-copy p,
.hero[data-scene="rainy"]  .hero-copy p,
.hero.is-night .hero-copy p  { color: #BCD6EF; }

/* -------------------------------------------------- icons */
.nav-item svg, .icon-btn svg, .tab svg, .round-btn svg,
.link-btn svg, .qa-ico svg, .ct-ico svg { display: block; }

/* the round tinted badge used on stat cards and rows */
.ibadge {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--accent);
}
.ibadge.tone-sun   { background: #FFF3DA; color: #E09609; }
.ibadge.tone-drop  { background: #E2F1FE; color: #1587DA; }
.ibadge.tone-fire  { background: #FFEBDE; color: #EF6C1C; }
.ibadge.tone-target{ background: #E4F2FE; color: #0E8FE8; }
.ibadge.tone-leaf  { background: #E1F6EC; color: #15A063; }
:root[data-theme="dark"] .ibadge.tone-sun   { background: #38290C; color: #F0B342; }
:root[data-theme="dark"] .ibadge.tone-drop  { background: #10293F; color: #48B4F5; }
:root[data-theme="dark"] .ibadge.tone-fire  { background: #38210F; color: #FF8C42; }
:root[data-theme="dark"] .ibadge.tone-target{ background: #0F2B42; color: #3FA9F5; }
:root[data-theme="dark"] .ibadge.tone-leaf  { background: #0E3123; color: #35C98A; }

.ct-ico { display: inline-grid; place-items: center; color: var(--accent); flex: none; }
.ct-ico.tone-bulb   { color: #E0A209; }
.ct-ico.tone-target { color: var(--accent); }
.ct-ico.tone-trophy { color: #D9971B; }

.link-btn.with-ico { display: inline-flex; align-items: center; gap: 5px; }

/* -------------------------------------------------- dashboard grid */
.dash-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; align-items: start; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-title { font-size: .98rem; display: flex; align-items: center; gap: 7px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sub-title { font-size: .84rem; font-weight: 750; color: var(--text-soft); margin: 16px 0 8px; }

.link-btn {
  border: none; background: none; cursor: pointer;
  color: var(--accent); font-weight: 700; font-size: .84rem;
  padding: 4px 8px; border-radius: 8px; white-space: nowrap;
}
.link-btn:hover { background: var(--accent-soft); }

.round-btn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface-2); color: var(--text-soft);
  cursor: pointer; font-size: 1rem; line-height: 1;
}
.round-btn:hover { color: var(--accent); border-color: var(--accent); }
.round-btn[disabled] { opacity: .4; pointer-events: none; }

/* -------------------------------------------------- tiles */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); align-items: stretch; }
.tile {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-sm);
  min-width: 0;
}

.tile-body { min-width: 0; }
.tile-n { font-size: 1.16rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile-n .unit { font-size: .82em; font-weight: 750; }
.tile-l {
  font-size: .73rem; color: var(--text-soft); line-height: 1.3;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.tile-l.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-bar { margin-top: 5px; height: 4px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.tile-bar span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--accent); transition: width .6s var(--ease); }

/* -------------------------------------------------- phone summary card
   On a phone the design folds the weather and the ring into one card and
   drops the separate progress panel, so the first screen is one glance. */
.sum-card { display: none; }

@media (max-width: 759px) {
  .sum-card {
    display: flex; align-items: center; gap: 14px;
    padding: 16px;
  }
  .sum-wx { flex: 1; min-width: 0; }
  .sum-wx .sw-top { display: flex; align-items: center; gap: 9px; }
  .sum-wx .sw-place { font-size: .84rem; font-weight: 700; }
  .sum-wx .sw-temp { font-size: 1.8rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.15; margin-top: 4px; }
  .sum-wx .sw-note { font-size: .78rem; color: var(--text-soft); line-height: 1.35; margin-top: 3px; }
  .sum-ring { position: relative; width: 124px; flex: none; }
  .sum-ring .donut { width: 100%; height: auto; transform: rotate(-90deg); display: block; }
  .sum-ring .donut-n { font-size: 1.14rem; }
  .sum-ring .donut-l { font-size: .64rem; }
  .sum-ring .donut-drop { display: none; }

  /* the standalone progress panel is redundant once the ring is up there */
  .prog-card { display: none; }

  /* the design's mobile order: greeting, summary, tiles, then the actions */
  .hero    { order: 1; }
  .sum-card{ order: 2; }
  .tiles   { order: 3; }
  .qa-col  { order: 4; }
  .ov-card { order: 5; }
  .ga-card { order: 6; }
}

/* -------------------------------------------------- today's progress */
.prog-body { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-wrap { position: relative; width: 156px; flex: none; }
.donut { width: 100%; height: auto; transform: rotate(-90deg); display: block; }
.donut-track { fill: none; stroke: var(--surface-3); stroke-width: 15; }
.donut-fill {
  fill: none; stroke: var(--accent); stroke-width: 15; stroke-linecap: round;
  stroke-dasharray: 414.7; stroke-dashoffset: 414.7;
  transition: stroke-dashoffset .8s var(--ease);
}
.donut-centre {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.donut-drop { display: grid; place-items: center; color: var(--accent); }
.donut-n { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.donut-l { font-size: .74rem; color: var(--text-soft); }

.hours { position: relative; display: grid; grid-auto-flow: column; gap: 7px; align-items: end; height: 132px; }
.hour-col { display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; min-width: 0; }
.hour-track { position: relative; justify-content: center; }
.hour-track { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.hour-val {
  width: 100%; max-width: 42px; margin: 0 auto;
  border-radius: 6px 6px 4px 4px;
  background: linear-gradient(180deg, var(--blue-300), var(--blue-500));
  min-height: 2px; transition: height .6s var(--ease);
}
.hour-val.is-empty { background: var(--surface-3); }
.hour-l { font-size: .62rem; color: var(--text-faint); font-weight: 650; white-space: nowrap; }

/* -------------------------------------------------- plots
   A chart is an axis column plus a plotting area with gridlines
   behind the bars, which is what gives the design's charts their
   "read the value off the line" feel. */
.plot { display: flex; gap: 10px; flex: 1; min-width: 0; }
.plot-axis {
  display: flex; flex-direction: column; justify-content: space-between;
  height: 132px; flex: none;
  font-size: .64rem; color: var(--text-faint); font-variant-numeric: tabular-nums;
  padding-bottom: 20px;      /* leave room for the x labels below the area */
  text-align: right;
}
.plot-area { position: relative; flex: 1; min-width: 0; }
.plot-grid {
  position: absolute; left: 0; right: 0; top: 0; height: 132px;
  display: flex; flex-direction: column; justify-content: space-between;
  pointer-events: none;
}
.plot-grid i { display: block; height: 1px; background: var(--line); }
.plot-sm .plot-axis, .plot-sm .plot-grid { height: 112px; }
.plot-sm .ov-chart { height: 112px; }

/* -------------------------------------------------- segmented + charts */
.seg { display: flex; gap: 3px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-3); margin-bottom: 14px; }
.seg button {
  flex: 1; border: none; background: none; cursor: pointer;
  padding: 8px 10px; border-radius: var(--r-pill);
  font-size: .83rem; font-weight: 700; color: var(--text-soft);
  transition: background .15s var(--ease), color .15s var(--ease);
  white-space: nowrap;
}
.seg button.is-on { background: var(--accent); color: #fff; box-shadow: var(--shadow-xs); }

.ov-chart, .stat-chart { position: relative; display: grid; grid-auto-flow: column; gap: 7px; align-items: end; height: 132px; margin-bottom: 0; }
.stat-chart { height: 172px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-track { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.bar-val {
  width: 100%; max-width: 42px; margin: 0 auto;
  border-radius: 6px 6px 4px 4px;
  background: linear-gradient(180deg, var(--blue-300), var(--blue-500));
  min-height: 2px; transition: height .6s var(--ease);
}
.bar-val.is-hit { background: linear-gradient(180deg, #43D99A, var(--good)); }
.bar-val.is-empty { background: var(--surface-3); }
.bar-l { font-size: .63rem; color: var(--text-faint); font-weight: 650; white-space: nowrap; }
.bar-col.is-today .bar-l { color: var(--accent); font-weight: 800; }

.ov-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ov-t { text-align: center; padding: 10px 4px; border-radius: var(--r-sm); background: var(--surface-2); }
.ov-t .i { display: grid; place-items: center; margin: 0 auto 2px; color: var(--accent); }
.ov-t .i.tone-drop  { color: #1587DA; }
.ov-t .i.tone-target{ color: #0E8FE8; }
.ov-t .i.tone-fire  { color: #EF6C1C; }
.ov-t .i.tone-leaf  { color: #15A063; }
:root[data-theme="dark"] .ov-t .i.tone-drop  { color: #48B4F5; }
:root[data-theme="dark"] .ov-t .i.tone-fire  { color: #FF8C42; }
:root[data-theme="dark"] .ov-t .i.tone-leaf  { color: #35C98A; }
.ov-t .n { display: block; font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ov-t .l { display: block; font-size: .68rem; color: var(--text-soft); }

.ov-note {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 12px 14px;
  border-radius: var(--r-md); background: var(--accent-soft);
}
.ov-note .i { font-size: 1.1rem; flex: none; }
.ov-note b { display: block; font-size: .88rem; }
.ov-note small { display: block; font-size: .78rem; color: var(--text-soft); }
.ov-note.is-behind { background: var(--warn-soft); }
.ov-note.is-done   { background: var(--good-soft); }

.date-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.date-nav span { font-size: .92rem; font-weight: 700; }

/* -------------------------------------------------- quick actions */
.qa-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.log-ico { display: grid; place-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px;
  border: none; border-radius: var(--r-md);
  font-weight: 750; font-size: .93rem; cursor: pointer;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), filter .14s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-wide { width: 100%; }
.btn-primary {
  background: linear-gradient(180deg, var(--blue-400), var(--blue-600));
  color: #fff; box-shadow: 0 6px 16px rgba(29, 155, 240, .32);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--bad-soft); color: var(--bad); border: 1px solid transparent; }
.btn-danger:hover { border-color: var(--bad); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .83rem; border-radius: var(--r-sm); }
.btn-log { min-height: 52px; border-radius: var(--r-md); font-size: 1rem; }

.qa-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qa-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 6px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
  font-size: .76rem; font-weight: 700; color: var(--text-soft);
  text-align: center; line-height: 1.25;
  transition: transform .14s var(--ease), border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.qa-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.qa-btn[disabled] { opacity: .45; pointer-events: none; }
.qa-drank:hover  { border-color: var(--good); }
.qa-skip:hover   { border-color: var(--bad); }
.qa-ico {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; color: #fff;
}
.qa-green { background: var(--good); }
.qa-grey  { background: var(--text-faint); }
.qa-red   { background: var(--bad); }

.next-rem {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.next-ico {
  grid-row: span 2;
  display: grid; place-items: center; align-self: start;
  width: 32px; height: 32px; flex: none;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent);
}
.next-txt { min-width: 0; display: flex; flex-direction: column; }
.next-txt b { font-size: .84rem; line-height: 1.25; }
.next-txt small { font-size: .78rem; color: var(--text-soft); line-height: 1.35; }
.next-rem .link-btn { grid-column: 2; justify-self: start; padding: 2px 0; }
.next-rem .link-btn:hover { background: none; text-decoration: underline; }

/* -------------------------------------------------- goals & achievements */
.ga-goal { font-size: 1.04rem; font-weight: 750; }
.ga-bar { margin-top: 12px; height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.ga-bar span { display: block; height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--blue-300), var(--blue-500)); transition: width .6s var(--ease); }
.ga-bar-label { margin-top: 6px; font-size: .78rem; color: var(--text-soft); text-align: right; }
.ga-ach-head { margin-top: 20px; }

.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 13px 6px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); text-align: center;
}
.badge .bi { font-size: 1.4rem; line-height: 1; }
.badge .bn { font-size: .7rem; font-weight: 700; line-height: 1.25; }
.badge.is-locked { opacity: .42; }
.badge.is-locked .bi { filter: grayscale(1); }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.badge-card {
  display: flex; align-items: center; gap: 12px;
  padding: 15px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.badge-card .bi {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--accent-soft); font-size: 1.3rem;
}
.badge-card .bn { font-size: .88rem; font-weight: 750; }
.badge-card .bd { font-size: .75rem; color: var(--text-soft); line-height: 1.35; }
.badge-card.is-locked { opacity: .55; }
.badge-card.is-locked .bi { filter: grayscale(1); background: var(--surface-3); }

/* -------------------------------------------------- stats extras */
.tiles-3 { grid-template-columns: repeat(3, 1fr); }
.week-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wd-ring {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2.5px solid var(--line-strong);
  font-size: .8rem;
}
.wd.is-hit .wd-ring { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.wd.is-part .wd-ring { border-color: var(--accent); border-right-color: var(--line-strong); border-bottom-color: var(--line-strong); }
.wd.is-today .wd-ring { box-shadow: 0 0 0 3px var(--accent-soft); }
.wd-l { font-size: .68rem; color: var(--text-faint); font-weight: 650; }

.heat { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.heat-cell { aspect-ratio: 1; border-radius: 6px; background: var(--surface-3); }
.heat-cell[data-lvl="1"] { background: color-mix(in srgb, var(--accent) 24%, var(--surface-3)); }
.heat-cell[data-lvl="2"] { background: color-mix(in srgb, var(--accent) 48%, var(--surface-3)); }
.heat-cell[data-lvl="3"] { background: color-mix(in srgb, var(--accent) 72%, var(--surface-3)); }
.heat-cell[data-lvl="4"] { background: var(--good); }
.heat-cell.is-today { box-shadow: 0 0 0 2px var(--accent); }

/* -------------------------------------------------- weather page */
.wx-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.wx-emoji { font-size: 3rem; line-height: 1; flex: none; }
.wx-temp { font-size: 2.3rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.wx-place { font-size: .92rem; font-weight: 650; }
.wx-desc { font-size: .85rem; color: var(--text-soft); text-transform: capitalize; }
.wx-rows li {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  font-size: .88rem;
}
.wx-rows li:last-child { border-bottom: none; }
.wx-rows .wi { font-size: 1rem; flex: none; }
.wx-rows b { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 750; }
.wx-verdict { margin-top: 14px; padding: 13px 15px; border-radius: var(--r-md); font-size: .88rem; font-weight: 650; background: var(--surface-2); }
.wx-verdict.up   { background: var(--warn-soft); color: var(--warn); }
.wx-verdict.down { background: var(--accent-soft); color: var(--accent); }

.city-list li { border-bottom: 1px solid var(--line); }
.city-list li:last-child { border-bottom: none; }
.city-btn { width: 100%; text-align: left; border: none; background: none; cursor: pointer; padding: 11px 8px; border-radius: var(--r-xs); font-size: .9rem; }
.city-btn:hover { background: var(--accent-soft); }
.city-btn small { display: block; color: var(--text-soft); font-size: .76rem; }
.city-current { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 13px; border-radius: var(--r-md); background: var(--accent-soft); font-size: .88rem; font-weight: 650; }

/* -------------------------------------------------- forms */
.two-col { display: grid; gap: var(--gap); grid-template-columns: 1fr; align-items: start; }

.group { display: flex; flex-direction: column; gap: 9px; }
.group-title { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-left: 4px; }
.group .card { padding: 6px 18px; }

.row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row-stack { flex-direction: column; align-items: stretch; gap: 10px; }
.row-label { flex: 1; min-width: 0; }
.row-label strong { display: block; font-size: .91rem; font-weight: 650; }
.row-label small { display: block; font-size: .77rem; color: var(--text-soft); margin-top: 2px; }
.row-ctrl { flex: none; }
.row-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); font-size: .95rem; }

input[type="text"], input[type="number"], input[type="time"], input[type="search"], select {
  font: inherit; padding: 10px 13px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text);
  min-height: 44px; width: 100%;
  -webkit-appearance: none; appearance: none;
}
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-soft) 50%),
                    linear-gradient(135deg, var(--text-soft) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 34px;
}
.row-ctrl input { width: 124px; }
.row-ctrl select { width: auto; min-width: 124px; max-width: 190px; }
.input-unit { display: flex; align-items: center; gap: 7px; }
.input-unit span { font-size: .83rem; color: var(--text-soft); flex: none; }

.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--line-strong); transition: background .2s var(--ease); }
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.28); transition: transform .2s var(--ease);
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }

/* theme picker cards, as in the design */
.theme-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-card {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 15px 8px;
  border: 2px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); cursor: pointer;
  font-size: .8rem; font-weight: 700; color: var(--text-soft);
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.theme-card .tci { font-size: 1.35rem; line-height: 1; }
.theme-card:hover { border-color: var(--accent); }
.theme-card.is-on { border-color: var(--accent); background: var(--accent); color: #fff; }

/* slider */
.slider-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.slider-row .sv { font-size: .82rem; font-weight: 700; color: var(--accent); }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; margin: 10px 0 2px;
  border-radius: var(--r-pill); background: var(--line-strong);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface); cursor: pointer;
}

.bd { margin-top: 10px; border-radius: var(--r-md); background: var(--surface-2); padding: 4px 14px; }
.bd-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: .85rem; border-bottom: 1px dashed var(--line); }
.bd-row:last-child { border-bottom: none; }
.bd-row b { font-variant-numeric: tabular-nums; }
.bd-row.is-total { font-weight: 800; font-size: .94rem; }
.bd-row .pos { color: var(--good); }
.bd-row .neg { color: var(--bad); }

.notice { padding: 11px 14px; border-radius: var(--r-md); font-size: .84rem; }
.notice.ok  { background: var(--good-soft); color: var(--good); }
.notice.bad { background: var(--bad-soft);  color: var(--bad); }
.notice.info{ background: var(--surface-2); color: var(--text-soft); }

.log-list li { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.log-list li:last-child { border-bottom: none; }
.log-ml { font-weight: 750; font-variant-numeric: tabular-nums; }
.log-time { margin-left: auto; font-size: .8rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.log-del { border: none; background: none; cursor: pointer; color: var(--text-faint); font-size: 1.05rem; padding: 4px 6px; border-radius: 8px; }
.log-del:hover { color: var(--bad); background: var(--bad-soft); }

/* -------------------------------------------------- mobile tab bar */
.tabbar {
  display: none;
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 40;
  width: calc(100% - 24px); max-width: 520px;
  padding: 6px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: var(--shadow-lg);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 2px; border: none; background: none; cursor: pointer;
  border-radius: var(--r-pill);
  font-size: .62rem; font-weight: 700; color: var(--text-faint);
  transition: background .16s var(--ease), color .16s var(--ease);
  min-width: 0;
}
.tab span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-ico { display: grid; place-items: center; opacity: .75; }
.tab.is-active { background: var(--accent-soft); color: var(--accent); }
.tab.is-active .tab-ico { opacity: 1; }

/* -------------------------------------------------- reminder overlay */
.rem-overlay {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center;
  padding: 24px;
  background: var(--bg);
  animation: fade .24s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.rem-close {
  position: absolute; top: 20px; right: 20px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--text-soft); cursor: pointer; font-size: .95rem;
}
.rem-close:hover { color: var(--bad); border-color: var(--bad); }
.rem-inner { width: 100%; max-width: 380px; text-align: center; }
.rem-art { color: var(--blue-300); margin-bottom: 18px; }
.rem-art .glass-body  { fill: var(--surface); stroke: var(--blue-300); stroke-width: 5; stroke-linejoin: round; }
.rem-art .glass-water { fill: var(--blue-400); }
.rem-art .glass-rim   { fill: var(--blue-300); }
.rem-inner h2 { font-size: 1.5rem; letter-spacing: -.03em; }
.rem-inner > p { margin-top: 8px; font-size: .92rem; color: var(--text-soft); }
.rem-actions { display: flex; flex-direction: column; gap: 11px; margin-top: 26px; }
.rem-btn {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  min-height: 56px; padding: 0 22px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font-size: 1rem; font-weight: 750; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .14s var(--ease), border-color .14s var(--ease);
}
.rem-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.rem-primary {
  background: linear-gradient(180deg, var(--blue-400), var(--blue-600));
  color: #fff; border-color: transparent;
  box-shadow: 0 8px 20px rgba(29, 155, 240, .34);
}
.rem-ico { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%;
  background: rgba(255,255,255,.22); }
.rem-btn:not(.rem-primary) .rem-ico { background: var(--surface-3); color: var(--text-soft); }
.rem-say { margin-top: 20px; font-size: .84rem; color: var(--text-soft); font-style: italic; }

/* -------------------------------------------------- welcome */
.welcome {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  overflow-y: auto;
}
.welcome-inner { width: 100%; max-width: 360px; text-align: center; padding: 20px 0; }
.welcome-logo { border-radius: 24px; box-shadow: var(--shadow); }
.welcome-word { margin-top: 14px; font-size: 2.4rem; letter-spacing: -.045em; color: var(--accent); }
.welcome-word em { font-style: normal; color: var(--text); }
.welcome-tag { margin-top: 2px; font-size: .88rem; color: var(--text-soft); font-weight: 650; }
.welcome-dots { display: flex; justify-content: center; gap: 7px; margin: 28px 0 18px; }
.welcome-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.welcome-dots i.is-on { width: 20px; border-radius: var(--r-pill); background: var(--accent); }
.welcome-step h2 { font-size: 1.3rem; }
.welcome-step p { margin-top: 6px; font-size: .88rem; color: var(--text-soft); }
.welcome-step .btn { margin-top: 18px; }
.welcome-step .form { margin-top: 16px; text-align: left; }
.welcome-skip {
  display: block; width: 100%; margin-top: 12px;
  border: none; background: none; cursor: pointer;
  font-size: .85rem; font-weight: 650; color: var(--text-soft);
  padding: 10px;
}
.welcome-skip:hover { color: var(--accent); }

/* -------------------------------------------------- sheet / toast / cheer */
.sheet-scrim { position: fixed; inset: 0; z-index: 64; background: rgba(8, 28, 48, .45); backdrop-filter: blur(3px); animation: fade .2s var(--ease) both; }
.sheet {
  position: fixed; z-index: 65;
  left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 440px; max-height: 86vh; overflow-y: auto;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface); box-shadow: var(--shadow-lg);
  animation: up .28s var(--ease) both;
}
@keyframes up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.sheet-grip { width: 40px; height: 4px; border-radius: var(--r-pill); background: var(--line-strong); margin: 0 auto 14px; }
.sheet-title { font-size: 1.12rem; margin-bottom: 14px; }
.sheet-body .btn { margin-top: 8px; }
.quick-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.quick-amounts button { padding: 12px 4px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; font-weight: 750; font-size: .86rem; }
.quick-amounts button:hover { border-color: var(--accent); color: var(--accent); }

.toast {
  position: fixed; z-index: 90; left: 50%; transform: translateX(-50%);
  bottom: 28px; max-width: calc(100% - 40px);
  padding: 12px 20px; border-radius: var(--r-pill);
  background: var(--navy); color: #fff;
  font-size: .88rem; font-weight: 650; box-shadow: var(--shadow-lg);
  animation: pop .24s var(--ease) both;
}
:root[data-theme="dark"] .toast { background: var(--surface-2); border: 1px solid var(--line-strong); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 12px) scale(.95); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

.cheer { position: fixed; inset: 0; z-index: 85; pointer-events: none; overflow: hidden; }
.drop {
  position: absolute; bottom: -40px; width: 13px; height: 13px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--accent); animation: fly 1.5s var(--ease) forwards;
}
@keyframes fly {
  0%   { opacity: 0; transform: translateY(0) rotate(-45deg) scale(.5); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-96vh) rotate(-45deg) scale(1.15); }
}

/* ==================================================
   Breakpoints
   ================================================== */

/* two dashboard columns */
@media (min-width: 760px) {
  .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles     { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
  .hero      { grid-column: 1 / -1; }
  .qa-col    { grid-column: 1 / -1; }
  .qa-col .qa-three { grid-template-columns: repeat(3, 1fr); }
  .prog-card { grid-column: 1 / -1; }
  .ov-card   { grid-column: 1 / -1; }
  .ga-card   { grid-column: 1 / -1; }
  .badges { grid-template-columns: repeat(3, 1fr); }
}

/* the design's own shape: hero beside the quick actions on the first row,
   four stat cards under it, then progress | overview | tips across three */
@media (min-width: 1160px) {
  .main { padding: 0 30px 40px; }

  /* Twelve tracks, so the row proportions can match the drawing:
     hero 9 / actions 3, then progress 5 | overview 3 | tips 4. */
  .dash-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }

  .hero      { grid-column: span 9; min-height: 196px; }
  .qa-col    { grid-column: span 3; }
  .tiles     { grid-column: 1 / -1; }
  .prog-card { grid-column: span 7; }
  .ov-card   { grid-column: span 5; }
  .ga-card   { grid-column: 1 / -1; }

  .ga-card .badges { grid-template-columns: repeat(6, 1fr); }
  .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1480px) {
  .main { padding: 0 40px 44px; }
}

/* phone */
@media (max-width: 759px) {
  :root { --gap: 14px; }

  .main { padding: 0 14px calc(92px + env(safe-area-inset-bottom)); }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: 264px; height: 100%;
    transform: translateX(-102%);
    transition: transform .28s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }

  .burger { display: inline-grid; }
  .tabbar { display: flex; }
  .topbar-title { font-size: 1.1rem; }

  .hero { min-height: 140px; padding: 18px 20px; border-radius: var(--r-lg); }
  .hero-copy { max-width: 80%; }

  /* The banner is much narrower here, so the greeting needs the wash to
     reach further across before the painting takes over. */
  .hero::after { background: linear-gradient(100deg,
    rgba(238, 247, 255, .97) 0%, rgba(238, 247, 255, .90) 40%,
    rgba(238, 247, 255, .52) 66%, rgba(238, 247, 255, 0) 88%); }
  .hero[data-scene="autumn"]::after { background: linear-gradient(100deg,
    rgba(255, 244, 232, .97) 0%, rgba(255, 242, 228, .90) 40%,
    rgba(255, 239, 222, .50) 66%, rgba(255, 239, 222, 0) 88%); }
  .hero[data-scene="spring"]::after { background: linear-gradient(100deg,
    rgba(255, 244, 250, .97) 0%, rgba(253, 240, 247, .88) 40%,
    rgba(252, 238, 246, .48) 66%, rgba(252, 238, 246, 0) 88%); }
  .hero[data-scene="stormy"]::after, .hero[data-scene="rainy"]::after {
    background: linear-gradient(100deg,
    rgba(12, 26, 44, .92) 0%, rgba(12, 26, 44, .82) 40%,
    rgba(12, 26, 44, .44) 66%, rgba(12, 26, 44, 0) 88%); }
  .hero.is-night::after { background: linear-gradient(100deg,
    rgba(7, 19, 34, .94) 0%, rgba(7, 19, 34, .84) 40%,
    rgba(7, 19, 34, .46) 66%, rgba(7, 19, 34, 0) 88%); }

  .prog-body { gap: 14px; }
  .donut-wrap { width: 150px; margin: 0 auto; }
  .plot { width: 100%; }
  .plot-axis, .plot-grid, .hours { height: 108px; }
  .plot-sm .plot-axis, .plot-sm .plot-grid, .plot-sm .ov-chart { height: 100px; }
  .qa-col .qa-three { grid-template-columns: repeat(3, 1fr); }
  .ov-tiles { grid-template-columns: repeat(4, 1fr); }
  .tiles-3 { grid-template-columns: repeat(3, 1fr); }
  .page-title { font-size: 1.24rem; }
  .card { padding: 15px; border-radius: var(--r-md); }
}

@media (max-width: 400px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .qa-three { gap: 7px; }
  .qa-btn { padding: 12px 3px; font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .cheer { display: none; }
}
