/* ============================================================
   amor fati — design system
   Self-contained. System font stack renders SF Pro on Apple devices.
   ============================================================ */

/* ============================================================
   "Midnight Performance" — dark cockpit (WHOOP / Athlytic / Ultrahuman)
   Dark-only: the same palette is set on :root and on BOTH theme
   selectors so the theme toggle can never flip it back to light.
   ============================================================ */
:root,
:root[data-theme="dark"],
:root[data-theme="light"] {
  --bg: #0A0B0D;
  --bg-grad-1: #101216;
  --bg-grad-2: #0A0B0D;
  --card: #16181D;
  --card-2: #1E2127;
  --raised: #1E2127;
  --card-border: #26282F;
  --hairline: #26282F;
  --text: #F4F6F8;
  --text-2: #9AA0AB;
  --text-3: #5E6470;

  /* accent = business azure (the personal hub uses green; this portal is its blue sibling) */
  --accent: #3B9EFF;
  --accent-2: #3B9EFF;
  --accent-soft: rgba(59,158,255,.14);
  --on-accent: #04223D;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.5);
  --shadow-hover: 0 2px 8px rgba(0,0,0,.5), 0 18px 44px rgba(0,0,0,.6);
  --shadow-c: rgba(0,0,0,.6);
  --ring-track: #26282F;
  --blob: rgba(59,158,255,.05);
  --sq-border: #26282F;

  /* semantic data palette */
  --c-green:  #16E0A3;
  --c-blue:   #37B8FF;
  --c-violet: #8A7CFF;
  --c-indigo: #8A7CFF;
  --c-yellow: #FFD15C;
  --c-red:    #FF5C6A;
  --c-pink:   #FF5C6A;
  --c-orange: #FFD15C;
  --c-teal:   #37B8FF;
  --c-purple: #8A7CFF;

  --r-lg: 20px;
  --r-md: 16px;
  --r-sm: 12px;
  --sb-w: 252px;
  --sq-sm: 16px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* native-app feel on iOS: no rubber-band overscroll, no tap-flash, no accidental text selection / callout, no double-tap zoom */
html { overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
/* keep real text inputs selectable/usable */
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(120% 70% at 50% -10%, var(--bg-grad-1) 0%, var(--bg) 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
  min-height: 100vh;
}
/* tabular figures everywhere numbers matter */
.hl-mini .hlm-val, .hm-val, .wk-val, .sf-gauge-c b, .donut-center b,
.metric-big, .head-stat b, .ds-day, .rec-val, .micro .mi-val, .macro-legend .m-val,
.cax, .wh-val { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
h1,h2,h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  width: var(--sb-w); flex: none; position: sticky; top: 0; align-self: flex-start;
  height: 100vh; padding: 26px 16px; display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; overscroll-behavior: contain;
  border-right: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--card) 55%, transparent);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 12px 18px; }
.brand-mark { font-size: 20px; color: var(--accent);
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--accent) 55%, transparent)); }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: -0.03em; }
.brand-name-2 { color: var(--text-3); font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 3px; }

/* grouped, collapsible nav sections */
.nav-group { display: flex; flex-direction: column; margin-top: 6px; }
.nav-group-header { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 9px 13px; border-radius: 12px; color: var(--text-3);
  font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  transition: background .18s ease, color .18s ease; }
.nav-group-header:hover { color: var(--text-2); background: var(--accent-soft); }
.nav-group-header > span { flex: 1; }
.nav-group-header .ico { width: 18px; height: 18px; }
.nav-chev { width: 15px !important; height: 15px !important; color: var(--text-3); transition: transform .22s ease; }
.nav-group.collapsed .nav-chev { transform: rotate(-90deg); }
.nav-group-list { display: flex; flex-direction: column; gap: 2px;
  margin: 2px 0 2px 19px; padding-left: 9px; border-left: 1px solid var(--hairline); }
.nav-group.collapsed .nav-group-list { display: none; }
.nav-group-list .nav-item { font-size: 14px; padding: 8px 12px; gap: 11px; }
.nav-group-list .nav-item .ico { width: 18px; height: 18px; }
.nav-item {
  display: flex; align-items: center; gap: 13px; padding: 10px 13px; border-radius: 12px;
  color: var(--text-2); font-size: 14.5px; font-weight: 500; width: 100%; text-align: left;
  transition: background .18s ease, color .18s ease, transform .12s ease;
}
.nav-item .ico { width: 20px; height: 20px; }
.nav-item:hover { background: var(--accent-soft); color: var(--text); }
.nav-item:active { transform: scale(.98); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.nav-item.is-active .ico { color: var(--accent); }
.sidebar-foot { margin-top: auto; }
.theme-toggle { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 13px;
  border-radius: 12px; color: var(--text-2); font-size: 14px; font-weight: 500;
  border: 1px solid var(--hairline); transition: background .18s, color .18s; }
.theme-toggle:hover { color: var(--text); background: var(--accent-soft); }
/* dark-only: always show the moon, never the sun */
.ico-sun { display: none !important; }
.ico-moon { display: block; }

/* ---------- content ---------- */
.content { flex: 1; min-width: 0; padding: 32px clamp(20px, 3vw, 32px) 90px;
  max-width: 1320px; margin: 0 auto; width: 100%; }

/* view switching + entrance motion */
.view { display: none; animation: viewIn .5s cubic-bezier(.22,.7,.25,1) both; }
.view.is-active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- hero (overview) ---------- */
.hero { padding: 18px 4px 30px; }
.hero-eyebrow { color: var(--accent); font-weight: 600; font-size: 13px; text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 12px; }
.hero-title { font-size: clamp(34px, 5vw, 52px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.04; }
.hero-quote { margin-top: 18px; max-width: 620px; color: var(--text-2); font-size: 17px;
  line-height: 1.5; font-style: italic; }

/* ---------- grids ---------- */
.grid { display: grid; gap: 18px; }
.grid-tiles { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-apps  { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-health { grid-template-columns: repeat(4, minmax(0,1fr)); }
.span-2 { grid-column: span 2; }
.span-full { grid-column: 1 / -1; }

/* ---------- tiles (overview links) ---------- */
.tile { display: flex; align-items: center; gap: 16px; padding: 20px; text-align: left;
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-lg);
  box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease; position: relative; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.tile:active { transform: translateY(-1px) scale(.995); }
.tile-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  color: #fff; flex: none; }
.tile-ico .ico { width: 24px; height: 24px; stroke-width: 1.9; }
.tile-ico-health { background: linear-gradient(145deg, #ff5d6c, #ff375f); }
.tile-ico-apps { background: linear-gradient(145deg, #7d7bff, #5e5ce6); }
.tile-ico-standards { background: linear-gradient(145deg, #ffb443, #ff9500); }
.tile-ico-focus { background: linear-gradient(145deg, #3ad6e6, #30c8d6); }
.tile-ico-rel { background: linear-gradient(145deg, #ff7ab8, #ff375f); }
.tile-ico-mind { background: linear-gradient(145deg, #c977ff, #bf5af2); }
.tile-body { flex: 1; min-width: 0; }
.tile-body h3 { font-size: 17px; }
.tile-body p { color: var(--text-2); font-size: 13.5px; margin-top: 3px; }
.tile-go { color: var(--text-3); font-size: 20px; transition: transform .16s, color .16s; }
.tile:hover .tile-go { transform: translateX(4px); color: var(--accent); }
.tile-soon { font-size: 11px; font-weight: 600; color: var(--text-3); border: 1px solid var(--hairline);
  padding: 4px 9px; border-radius: 999px; }

/* ---------- cards ---------- */
/* True-squircle tiles: the shape (fill + light border) is painted as an SVG superellipse into
   --sqbg by JS and drawn in ::before; drop-shadow on ::before follows the squircle silhouette.
   The element itself is transparent so the curved border isn't cut (a CSS border would be). */
.card { background: transparent; border: 0; padding: 20px; position: relative; isolation: isolate; }
.card::before, .tile::before, .app-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: var(--sqbg); background-size: 100% 100%; background-repeat: no-repeat;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.3)) drop-shadow(0 6px 20px var(--shadow-c));
}
/* faint top inner sheen so cards feel lit from above */
.card::after {
  content: ''; position: absolute; inset: 1px 1px auto 1px; height: 48%; z-index: -1;
  border-radius: 18px 18px 40% 40% / 16px 16px 100% 100%;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0));
  pointer-events: none;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-head h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.card-sub { font-size: 11px; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }

/* ---------- view head ---------- */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin-bottom: 26px; flex-wrap: wrap; }
.eyebrow { color: var(--text-3); font-weight: 600; font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 8px; }
.view-title { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; letter-spacing: -0.03em; }
.head-stats { display: flex; gap: 10px; align-items: center; }
.head-stat { text-align: right; }
.head-stat b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.head-stat span { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- metric rows ---------- */
.metric-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.metric-big { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; display: flex; align-items: baseline; gap: 4px; }
.metric-big small { font-size: 16px; color: var(--text-3); font-weight: 500; }
.metric-meta { text-align: right; font-size: 13px; color: var(--text-2); line-height: 1.45; }
.metric-meta b { color: var(--text); }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill-up { color: var(--c-green); background: color-mix(in srgb, var(--c-green) 14%, transparent); }
.pill-down { color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 14%, transparent); }

/* ---------- rings ---------- */
.rings-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.rings { width: 184px; height: 184px; flex: none; }
.rings svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rings .track { fill: none; stroke: var(--ring-track); }
.rings .prog { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.3,.8,.3,1); }
.rings-legend { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 150px; }
.rings-legend li { display: flex; align-items: center; gap: 10px; }
.rings-legend .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.rings-legend .rl-name { font-size: 13.5px; color: var(--text-2); flex: 1; }
.rings-legend .rl-val { font-size: 13.5px; font-weight: 600; }
.rings-legend .rl-val small { color: var(--text-3); font-weight: 500; }

/* ---------- line chart ---------- */
.chart { width: 100%; height: 116px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot-last { stroke: var(--card); stroke-width: 2.5; }

/* ---------- bars ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 116px; padding-top: 6px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; height: 100%; }
.bar .b-fill { width: 100%; border-radius: 7px 7px 4px 4px; min-height: 4px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  transition: height 1s cubic-bezier(.3,.8,.3,1); }
.bar.over .b-fill { background: linear-gradient(180deg, #ffb04d, var(--c-orange)); }
.bar .b-day { font-size: 10.5px; color: var(--text-3); font-weight: 600; letter-spacing: .02em; }
.bar.today .b-day { color: var(--accent); }

/* ---------- donut (macros) ---------- */
.macros-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 138px; height: 138px; flex: none; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .seg { fill: none; stroke-width: 16; stroke-linecap: butt; transition: stroke-dashoffset 1s cubic-bezier(.3,.8,.3,1); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.donut-center span { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.macro-legend { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 13px; }
.macro-legend li { display: grid; grid-template-columns: 12px 1fr auto 44px; align-items: center; gap: 10px; }
.macro-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.macro-legend .m-name { font-size: 13px; color: var(--text-2); }
.macro-legend .m-val { font-size: 14px; font-weight: 600; text-align: right; }
.macro-legend .m-pct { font-size: 12px; color: var(--text-3); text-align: right; }

/* ---------- micronutrients ---------- */
.micros { display: flex; flex-direction: column; gap: 16px; }
.micro { display: grid; grid-template-columns: 1fr auto; gap: 7px 10px; }
.micro .mi-name { font-size: 13px; color: var(--text-2); }
.micro .mi-val { font-size: 13px; font-weight: 600; }
.micro .mi-val small { color: var(--text-3); font-weight: 500; }
.micro .mi-track { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--ring-track); overflow: hidden; }
.micro .mi-fill { display: block; height: 100%; border-radius: 999px; width: 0; transition: width 1.1s cubic-bezier(.3,.8,.3,1); }
.micro .mi-fill[style*="100%"] { box-shadow: 0 0 8px currentColor; }

/* ---------- saturated-fat callout (% of daily calories, target <10%) ---------- */
.satfat { margin: 2px 0 18px; padding: 13px 15px; border-radius: 14px; border: 1px solid var(--hairline); background: var(--card-2, var(--accent-soft)); }
.satfat.good { border-color: color-mix(in srgb, #34c759 45%, transparent); background: color-mix(in srgb, #34c759 10%, transparent); }
.satfat.over { border-color: color-mix(in srgb, #ff453a 45%, transparent); background: color-mix(in srgb, #ff453a 10%, transparent); }
.sf-top { display: flex; align-items: baseline; justify-content: space-between; }
.sf-label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.sf-label small { font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; font-size: 10px; }
.satfat.good .sf-pct { color: #34c759; }
.satfat.over .sf-pct { color: #ff453a; }
.sf-pct { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.sf-track { position: relative; height: 8px; border-radius: 999px; background: var(--ring-track); overflow: hidden; margin: 9px 0 6px; }
.sf-fill { display: block; height: 100%; border-radius: 999px; transition: width 1.1s cubic-bezier(.3,.8,.3,1); }
.satfat.good .sf-fill { background: #34c759; }
.satfat.over .sf-fill { background: #ff453a; }
.sf-target { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--text-2); opacity: .55; }
.sf-sub { font-size: 11.5px; color: var(--text-3); }

/* ---------- health header: sync button ---------- */
.h-sync { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--hairline); background: var(--card); color: var(--text-2); opacity: .65; transition: opacity .15s, background .15s, transform .5s; }
.h-sync:hover { opacity: 1; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.h-sync svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.h-sync.spinning { opacity: 1; }
.h-sync.spinning svg { animation: hsync-spin .9s linear infinite; }
@keyframes hsync-spin { to { transform: rotate(360deg); } }

/* ---------- Connect WHOOP button ---------- */
.h-connect { padding: 0 15px; height: 36px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; letter-spacing: .01em; box-shadow: var(--shadow); transition: filter .15s, opacity .15s; }
.h-connect:hover { filter: brightness(1.06); }
.h-connect:disabled { opacity: .6; }

/* ---------- Day / Trend toggle ---------- */
.hv-toggle { display: inline-flex; gap: 3px; padding: 3px; margin: 0 0 18px; border-radius: 12px; background: var(--ring-track); }
.hv-toggle button { padding: 7px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-2); transition: background .15s, color .15s, box-shadow .15s; }
.hv-toggle button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---------- date strip ---------- */
.ds-wrap { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 12px; margin-bottom: 16px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.ds-wrap::-webkit-scrollbar { height: 5px; }
.ds-wrap::-webkit-scrollbar-thumb { background: var(--ring-track); border-radius: 999px; }
.ds-track { display: inline-flex; align-items: flex-end; gap: 7px; }
.ds-month { align-self: stretch; display: flex; align-items: center; padding: 0 8px 0 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); white-space: nowrap; }
.ds-chip { flex: none; width: 50px; padding: 9px 0 8px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--card); display: flex; flex-direction: column; align-items: center; gap: 3px; transition: background .15s, border-color .15s, transform .1s; }
.ds-chip:active { transform: scale(.95); }
.ds-chip .ds-dow { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); }
.ds-chip .ds-day { font-size: 17px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.ds-chip .ds-dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.ds-chip.has .ds-dot { background: var(--accent); box-shadow: 0 0 5px var(--accent); }
.ds-chip:hover:not(.future) { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.ds-chip.today { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.ds-chip.today .ds-dow { color: var(--accent); }
.ds-chip.sel { background: var(--accent); border-color: var(--accent); }
.ds-chip.sel .ds-dow, .ds-chip.sel .ds-day { color: var(--on-accent); }
.ds-chip.sel .ds-dot { background: var(--on-accent); opacity:.8; }
.ds-chip.future { opacity: .32; cursor: default; }

/* ---------- day-view banner + headline cards ---------- */
.day-banner { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 16px; letter-spacing: -.01em; }
.day-banner .db-live { display: inline-flex; align-items: center; gap: 5px; color: var(--c-green); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.day-banner .db-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c-green); box-shadow: 0 0 8px var(--c-green); animation: db-pulse 1.6s ease-in-out infinite; }
@keyframes db-pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- day top: hero recovery ring + metric tiles ---------- */
.day-top { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: stretch; margin-bottom: 16px; }
.rec-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 20px; }
.rec-hero-ring { position: relative; width: 100%; max-width: 220px; aspect-ratio: 1; }
.rec-ring { width: 100%; height: 100%; display: block; }
.rec-ring-track { fill: none; stroke: var(--ring-track); stroke-width: 12; }
.rec-ring-arc { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray 1.1s cubic-bezier(.3,.8,.3,1); }
.rec-hero-c { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; }
.rec-hero-c b { font-size: 64px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.rec-hero-c i { font-style: normal; font-size: 22px; font-weight: 600; color: var(--text-3); margin-left: 2px; }
.rec-hero.good .rec-hero-c b { color: var(--c-green); }
.rec-hero.mid  .rec-hero-c b { color: var(--c-yellow); }
.rec-hero.low  .rec-hero-c b { color: var(--c-red); }
.rec-hero.none .rec-hero-c b { color: var(--text-3); }
.rec-hero-meta { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.rec-hero-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.rec-hero-state { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.rec-hero.good .rec-hero-state { color: var(--c-green); }
.rec-hero.mid  .rec-hero-state { color: var(--c-yellow); }
.rec-hero.low  .rec-hero-state { color: var(--c-red); }
.rec-hero .src-tag { position: static; margin-top: 4px; opacity: .5; }

/* nutrition + nutrients side-by-side, equal height */
/* macro row: Nutrition 40% · Nutrients 40% · Sat fat 20%, equal height */
.day-macros { display: grid; grid-template-columns: 2fr 2fr 1fr; gap: 18px; margin: 18px 0; align-items: stretch; }
.day-macros > .card { grid-column: auto; padding-bottom: 30px; }
/* saturated-fat box — radial gauge filling the pill */
.sf-box .sf-col { display: flex; flex-direction: column; height: 100%; width: 100%; }
.sf-gauge { position: relative; flex: 1; display: grid; place-items: center; margin: 10px 0; }
.sf-ring { width: 100%; max-width: 132px; aspect-ratio: 1; }
.sf-ring-track { fill: none; stroke: var(--ring-track); stroke-width: 10; }
.sf-ring-arc { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray 1.1s cubic-bezier(.3,.8,.3,1); }
.sf-gauge-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sf-gauge-c b { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.sf-box.good .sf-gauge-c b { color: var(--c-green); }
.sf-box.over .sf-gauge-c b { color: var(--c-red); }
.sf-gauge-c i { font-style: normal; font-size: 13px; font-weight: 600; color: var(--text-3); margin-top: 2px; }
.sf-gauge-c span { font-size: 9.5px; color: var(--text-3); margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
.sf-box .sf-note { text-align: center; font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }

/* WHOOP hero pair (Recovery + Day strain) */
.day-whoop { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; margin: 6px 0 18px; width: 72%; }
.day-whoop > .card { grid-column: auto; padding-bottom: 30px; }
.wh-hero .wh-val { font-size: 36px; font-weight: 700; letter-spacing: -.02em; margin-top: 8px; }
.wh-hero .wh-val small { font-size: 15px; color: var(--text-3); font-weight: 500; margin-left: 4px; }
.wh-ring { height: 8px; border-radius: 999px; background: var(--ring-track); overflow: hidden; margin-top: 14px; }
.wh-ring span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 1.1s cubic-bezier(.3,.8,.3,1); }
.rec.good .wh-val { color: var(--c-green); }   .rec.good .wh-ring span { background: var(--c-green); }
.rec.mid .wh-val { color: #d99a00; }            .rec.mid .wh-ring span { background: #e0a400; }
.rec.low .wh-val { color: var(--c-red); }       .rec.low .wh-ring span { background: var(--c-red); }
.strain .wh-ring span { background: var(--c-blue); }
/* the quick metric tiles, packed tight to the right of the hero ring */
.day-headlines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 12px; }
.hl-mini .hlm-val.tone-good { color: var(--c-green); }
.hl-mini .hlm-val.tone-mid { color: var(--c-yellow); }
.hl-mini .hlm-val.tone-low { color: var(--c-red); }
/* section headers (This Week, Trends) flow directly below the day section */
.trends-head, .week-head { margin: 32px 0 16px; padding-top: 24px; border-top: 1px solid var(--hairline); }
.trends-head h2, .week-head h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.trends-head span, .week-head span { display: block; color: var(--text-3); font-size: 12px; margin-top: 5px; opacity: .8; }

/* This Week — goal stat cards */
.week-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.wk-stat { display: flex; flex-direction: column; gap: 10px; min-height: 96px; }
.wk-stat .wk-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.wk-stat .wk-val { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.wk-stat .wk-val small { font-size: 12px; color: var(--text-3); font-weight: 500; margin-left: 3px; }
.wk-stat .wk-bar { margin-top: auto; height: 6px; border-radius: 999px; background: var(--ring-track); overflow: hidden; }
.wk-stat .wk-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 1.1s cubic-bezier(.3,.8,.3,1); }
.wk-stat.met .wk-val { color: var(--c-green); }
.wk-stat.met .wk-bar span { background: var(--c-green); box-shadow: 0 0 8px var(--accent); }
.hl-mini { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 14px 16px; text-align: left; min-height: 0; border-radius: var(--sq-sm); }
.hl-mini .hlm-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.hl-mini .hlm-val { font-size: 28px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; line-height: 1; }
.hl-mini .hlm-val small { font-size: 13px; color: var(--text-3); font-weight: 500; margin-left: 3px; }
.hl-mini .hlm-val.none { color: var(--text-3); }

/* discreet per-card source + last-updated stamp (bottom-right, near-transparent) */
.hm-card, .day-macros > .card { position: relative; }
.src-tag { position: absolute; right: 16px; bottom: 12px; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; font-size: 9px; font-weight: 500; color: var(--text-3); opacity: .3; letter-spacing: .02em; white-space: nowrap; pointer-events: none; text-transform: uppercase; }
/* on the small metric tiles the stamp flows inside the card (centered) so it never spills past the squircle */
.hl-mini .src-tag { display: none; }

/* ---------- recovery (sleep) ---------- */
.recovery { display: flex; flex-direction: column; gap: 4px; }
.rec { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--hairline); }
.rec:last-child { border-bottom: 0; }
.rec-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff; }
.rec-ico .ico { width: 20px; height: 20px; }
.rec-main { flex: 1; min-width: 0; }
.rec-main .rec-name { font-size: 12.5px; color: var(--text-3); }
.rec-main .rec-val { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.rec-main .rec-val small { font-size: 12px; color: var(--text-3); font-weight: 500; }
.rec-spark { width: 92px; height: 34px; flex: none; }
.rec-spark svg { width: 100%; height: 100%; overflow: visible; }
.rec-spark .line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- workout calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { font-size: 11px; font-weight: 600; color: var(--text-3); text-align: center; text-transform: uppercase;
  letter-spacing: .04em; padding-bottom: 4px; }
.cal-cell { min-height: 60px; border-radius: 12px; background: var(--card-2);
  border: 1px solid var(--hairline); display: flex; flex-direction: column; padding: 8px 9px;
  position: relative; transition: transform .12s ease, box-shadow .12s ease; }
@media (min-width: 861px) { .cal-cell { min-height: 74px; } }
.cal-cell.empty { background: transparent; border: 0; }
.cal-cell .c-num { font-size: 12px; color: var(--text-3); font-weight: 600; }
.cal-cell.has::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 8px; height: 5px;
  border-radius: 999px; background: var(--c-dot, var(--accent)); }
.cal-cell.has { cursor: pointer; }
.cal-cell.has:hover { transform: translateY(-2px) scale(1.03); box-shadow: var(--shadow-hover); z-index: 2; }
.cal-cell.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell.today .c-num { color: var(--accent); }
.cal-cell.rest .c-num { color: var(--text-3); opacity: .6; }
.cal-key { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.cal-key li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.cal-key .dot { width: 9px; height: 9px; border-radius: 50%; }

/* ---------- tooltip ---------- */
.tooltip { position: fixed; z-index: 100; pointer-events: none; opacity: 0; transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease; background: var(--text); color: var(--bg);
  padding: 9px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.4; max-width: 230px;
  box-shadow: 0 12px 30px rgba(0,0,0,.3); }
.tooltip.show { opacity: 1; transform: translateY(0); }
.tooltip b { display: block; font-size: 13px; margin-bottom: 2px; }
.tooltip .tt-sub { opacity: .7; }
.tooltip .tt-h { display: block; font-size: 13px; margin-bottom: 4px; }
.tooltip .tt-rows { display: flex; flex-direction: column; gap: 2px; opacity: .9; font-size: 11.5px; }
.tooltip .tt-rows b { display: inline; font-size: inherit; margin: 0; font-weight: 700; }
.tooltip .tt-div { display: block; height: 1px; background: color-mix(in srgb, var(--bg) 35%, transparent); margin: 7px 0; }

/* ---------- apps ---------- */
.app-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow); text-align: left; display: flex; flex-direction: column;
  gap: 8px; position: relative; min-height: 168px; transition: transform .16s, box-shadow .16s; }
.app-card.is-live { cursor: pointer; }
.app-card.is-live:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.app-ico { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; color: #fff; margin-bottom: 6px; }
.app-ico .ico { width: 26px; height: 26px; stroke-width: 1.9; }
.app-ico-health { background: linear-gradient(145deg, #ff5d6c, #ff375f); }
.app-ico-standards { background: linear-gradient(145deg, #ffb443, #ff9500); }
.app-ico-focus { background: linear-gradient(145deg, #3ad6e6, #30c8d6); }
.app-ico-rel { background: linear-gradient(145deg, #ff7ab8, #ff375f); }
.app-ico-new { background: var(--accent-soft); color: var(--accent); font-size: 28px; font-weight: 300; }
.app-card h3 { font-size: 16.5px; }
.app-card p { font-size: 13.5px; color: var(--text-2); line-height: 1.45; flex: 1; }
.app-card-new { border-style: dashed; box-shadow: none; background: transparent; }
.badge { align-self: flex-start; font-size: 11.5px; font-weight: 600; color: var(--text-3);
  border: 1px solid var(--hairline); padding: 4px 10px; border-radius: 999px; }
.badge-live { color: var(--c-green); border-color: color-mix(in srgb, var(--c-green) 30%, transparent);
  background: color-mix(in srgb, var(--c-green) 12%, transparent); }
.badge-ghost { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------- coming soon ---------- */
.soon { display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(40px, 9vh, 110px) 20px; }
.soon-ico { width: 80px; height: 80px; border-radius: 22px; display: grid; place-items: center; color: #fff;
  margin-bottom: 26px; box-shadow: var(--shadow-hover); }
.soon-ico .ico { width: 40px; height: 40px; stroke-width: 1.7; }
.soon h2 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; }
.soon .soon-tag { color: var(--accent); font-weight: 600; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 14px; }
.soon p { color: var(--text-2); font-size: 17px; line-height: 1.55; max-width: 540px; margin-top: 16px; }
.soon-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 30px; }
.soon-chips span { font-size: 13px; color: var(--text-2); background: var(--card); border: 1px solid var(--card-border);
  padding: 9px 15px; border-radius: 999px; box-shadow: var(--shadow); }

/* ---------- mobile bottom tabbar ---------- */
.tabbar { display: none; }

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 1100px) {
  .grid-health { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-tiles, .grid-apps { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .span-2 { grid-column: span 2; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .content { padding: 20px 20px 96px; }
  .grid-health, .grid-tiles, .grid-apps { grid-template-columns: 1fr; }
  .span-2, .span-full { grid-column: 1 / -1; }
  .head-stats { gap: 18px; }
  .day-macros { grid-template-columns: 2fr 1fr; gap: 12px; max-width: none; }
  .day-macros > .card:first-child { grid-column: 1 / -1; }  /* nutrition full width; nutrients + sat fat share the row below */
  .day-top { grid-template-columns: 1fr; gap: 12px; }
  .rec-hero { flex-direction: row; justify-content: flex-start; gap: 22px; padding: 18px 22px; }
  .rec-hero-ring { width: 120px; flex: none; }
  .rec-hero-meta { align-items: flex-start; }
  .rec-hero-c b { font-size: 44px; }
  .rec-hero-c i { font-size: 16px; }
  .day-headlines { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hl-mini { padding: 12px 12px; gap: 6px; }
  .hl-mini .hlm-label { font-size: 9.5px; letter-spacing: .04em; }
  .hl-mini .hlm-val { font-size: 22px; }
  .hl-mini .hlm-val small { font-size: 10px; margin-left: 1px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 2px;
    background: color-mix(in srgb, var(--card) 80%, transparent);
    backdrop-filter: saturate(160%) blur(22px); -webkit-backdrop-filter: saturate(160%) blur(22px);
    border-top: 1px solid var(--hairline); overflow-x: auto; scrollbar-width: none;
  }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar button { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 12px; border-radius: 12px; color: var(--text-3); font-size: 10.5px; font-weight: 600; }
  .tabbar button .ico { width: 22px; height: 22px; }
  .tabbar button.is-active { color: var(--accent); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   Workbench
   ============================================================ */
.wb-lockbtn { font-size: 16px; border: 1px solid var(--hairline); border-radius: 10px;
  padding: 8px 12px; background: var(--card); }
.wb-lockbtn:hover { background: var(--accent-soft); }
.wb-muted { color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.wb-btn { background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: 12px; transition: transform .12s, filter .15s; }
.wb-btn:hover { filter: brightness(1.08); }
.wb-btn:active { transform: scale(.97); }
.wb-btn.ghost { background: transparent; color: var(--text-2); border: 1px solid var(--hairline); }
.wb-btn.danger { color: var(--c-red); border-color: color-mix(in srgb, var(--c-red) 30%, transparent); }
.wb-btn.danger:hover { background: color-mix(in srgb, var(--c-red) 12%, transparent); filter: none; }
/* Accept-w-changes: dim until you've left a comment, then it illuminates */
.wb-btn[disabled] { opacity: .35; cursor: not-allowed; filter: none; box-shadow: none; }
.wb-btn[disabled]:hover { filter: none; }
.wb-btn[disabled]:active { transform: none; }
.wb-btn.accept-changes:not([disabled]) { animation: wbGlow 1.9s ease-in-out infinite; }
@keyframes wbGlow {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), 0 2px 10px var(--accent-soft); }
  50%      { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 80%, transparent), 0 5px 24px color-mix(in srgb, var(--accent) 34%, transparent); }
}
.wb-input, .wb-area { width: 100%; background: var(--card-2); border: 1px solid var(--hairline);
  border-radius: 12px; padding: 12px 14px; color: var(--text); font: inherit; font-size: 14.5px;
  outline: none; transition: border-color .15s, box-shadow .15s; }
.wb-input:focus, .wb-area:focus { border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }
.wb-area { resize: vertical; line-height: 1.5; font-family: inherit; }

/* gate */
.wb-gate { max-width: 460px; margin: 8vh auto; text-align: center; background: var(--card);
  border: 1px solid var(--card-border); border-radius: var(--r-lg); padding: 40px 32px; box-shadow: var(--shadow); }
.wb-gate-ico { font-size: 34px; margin-bottom: 12px; }
.wb-gate h3 { font-size: 19px; margin-bottom: 8px; }
.wb-gate-row { display: flex; gap: 10px; margin-top: 22px; }
.wb-gate-row .wb-input { flex: 1; }

/* compose */
.wb-compose { margin-bottom: 22px; }
.wb-compose h3 { font-size: 16px; }
.wb-compose .wb-muted { margin: 4px 0 14px; }
.wb-compose .wb-input { margin-bottom: 10px; }
.wb-compose-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px; }
.wb-note { color: var(--text-2); font-size: 13px; margin-right: auto; }

/* board */
.wb-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.wb-col { background: var(--card-2); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 14px; }
.wb-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
  font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.wb-count { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.wb-list { display: flex; flex-direction: column; gap: 10px; }
.wb-empty { color: var(--text-3); font-size: 13px; padding: 8px 2px; }
.wb-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 14px;
  padding: 13px 14px; cursor: pointer; transition: transform .12s, box-shadow .12s; box-shadow: var(--shadow); }
.wb-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.wb-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.wb-card-title { font-size: 14.5px; font-weight: 600; }
.wb-open { font-size: 12px; color: var(--accent); font-weight: 600; white-space: nowrap; text-decoration: none; }
.wb-card-sum { color: var(--text-2); font-size: 12.5px; line-height: 1.45; margin-top: 5px; }
.wb-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.wb-edit { font-size: 12px; color: var(--text-3); }
.wb-card:hover .wb-edit { color: var(--accent); }
.wb-badge { font-size: 11px; font-weight: 600; color: var(--text-3); border: 1px solid var(--hairline);
  padding: 3px 8px; border-radius: 999px; }
.wb-badge.live { color: var(--c-green); border-color: color-mix(in srgb, var(--c-green) 30%, transparent); }
.wb-badge.fail { color: var(--c-orange); border-color: color-mix(in srgb, var(--c-orange) 30%, transparent); }
.wb-badge.build { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.wb-badge.needsyou { color: var(--c-orange); border-color: color-mix(in srgb, var(--c-orange) 35%, transparent); }

/* Needs You — shipped but not fully delivered; needs Matthew */
.wb-needsyou { border: 1px solid color-mix(in srgb, var(--c-orange) 40%, var(--card-border));
  background: color-mix(in srgb, var(--c-orange) 6%, var(--card)); margin-bottom: 18px; }
.ny-banner-head { display: flex; align-items: center; gap: 9px; }
.ny-flag { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--c-orange); }
.ny-count { font-size: 12px; font-weight: 600; color: var(--c-orange);
  border: 1px solid color-mix(in srgb, var(--c-orange) 35%, transparent); border-radius: 999px; padding: 1px 8px; }
.ny-card { border: 1px solid var(--hairline); border-radius: 12px; padding: 14px 16px; margin-top: 12px;
  background: var(--card); cursor: pointer; transition: border-color .15s; }
.ny-card:hover { border-color: color-mix(in srgb, var(--c-orange) 45%, transparent); }
.ny-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ny-title { font-weight: 650; font-size: 15px; }
.ny-sum { color: var(--text-2); font-size: 13.5px; line-height: 1.55; margin: 8px 0 0; }
.ny-block { margin-top: 11px; }
.ny-lbl { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }
.ny-block ul { margin: 6px 0 0; padding-left: 18px; }
.ny-block li { font-size: 13.5px; line-height: 1.5; color: var(--text-2); margin: 4px 0; }
.ny-muted { color: var(--text-3); font-weight: 400; }
.ny-tag { font-size: 10.5px; font-weight: 600; color: var(--accent); white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.ny-foot { margin-top: 11px; }

/* editor modal */
.wb-modal { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.5);
  display: grid; place-items: center; padding: 20px; backdrop-filter: blur(4px); animation: viewIn .2s ease; }
.wb-modal-card { width: min(680px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow-hover); }
.wb-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.wb-modal-head h3 { font-size: 16px; word-break: break-all; }
.wb-x { font-size: 16px; color: var(--text-3); width: 32px; height: 32px; border-radius: 9px; }
.wb-x:hover { background: var(--accent-soft); color: var(--text); }
.wb-modal-area { flex: 1; min-height: 220px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; }
.wb-modal-foot { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.wb-modal-foot .wb-note { margin: 0 auto 0 0; }
.wb-modal-foot .wb-btn:last-child { margin-left: auto; }
.wb-modal-foot .danger { margin-right: 0; }

@media (max-width: 980px) { .wb-board { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .wb-board { grid-template-columns: 1fr; } }

/* ---------- work history ---------- */
.wh-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; align-items: start; }
.wh-run { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-md);
  padding: 18px 20px; box-shadow: var(--shadow); }
.wh-run-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.wh-date { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.wh-spend { font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--card-2);
  border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 10px; }
.wh-spend.capped { color: var(--c-orange); border-color: color-mix(in srgb, var(--c-orange) 30%, transparent); }
.wh-stat { font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.wh-block { margin-top: 10px; font-size: 13.5px; }
.wh-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.wh-block ul { margin: 6px 0 0; padding-left: 2px; display: flex; flex-direction: column; gap: 5px; }
.wh-block li { font-size: 13.5px; color: var(--text); list-style: none; line-height: 1.45; }
.wh-block li a { color: var(--accent); text-decoration: none; font-weight: 600; }
.wh-block li a:hover { text-decoration: underline; }
.wh-muted { color: var(--text-3); }
.wh-foot { margin-top: 18px; color: var(--text-3); font-size: 13px; text-align: center; }
@media (max-width: 760px) { .wh-list { grid-template-columns: 1fr; } }

/* ---------- workbench: chips, types, tags ---------- */
.wb-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 2px; }
.wb-type { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .02em; }
.wb-type.new { color: var(--accent); background: var(--accent-soft); }
.wb-type.upd { color: var(--c-teal); background: color-mix(in srgb, var(--c-teal) 14%, transparent); }
.wb-tag { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.wb-tag.review { color: var(--c-orange); background: color-mix(in srgb, var(--c-orange) 15%, transparent); }
.wb-tag.draft { color: var(--accent); background: var(--accent-soft); }
.wb-tag.setup { color: var(--text-2); background: var(--card-2); border: 1px solid var(--hairline); }
.wb-meta { font-size: 11.5px; color: var(--text-3); }
.wb-card.generated { border-style: dashed; border-color: color-mix(in srgb, var(--c-orange) 45%, var(--card-border)); }
.wb-card.needsreview { border-color: color-mix(in srgb, var(--c-orange) 35%, var(--card-border)); }
.wb-actions { display: flex; gap: 6px; margin-top: 10px; }
.wb-mini { font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: 9px; border: 1px solid var(--hairline); color: var(--text-2); }
.wb-mini:hover { background: var(--accent-soft); color: var(--text); }
.wb-mini.accept { color: var(--on-accent); background: var(--accent); border-color: transparent; }
.wb-mini.accept:hover { filter: brightness(1.08); }
.wb-mini.danger { color: var(--c-red); }
.wb-mini.danger:hover { background: color-mix(in srgb, var(--c-red) 12%, transparent); }

/* composer type selector */
.wb-typerow { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.wb-seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--hairline); border-radius: 11px; padding: 3px; }
.seg-btn { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 7px 14px; border-radius: 8px; }
.seg-btn.active { background: var(--accent); color: var(--on-accent); }
.wb-select { background: var(--card-2); border: 1px solid var(--hairline); border-radius: 10px; padding: 8px 12px; color: var(--text); font: inherit; font-size: 13.5px; }

/* spec reader */
.wb-spec { max-height: 42vh; overflow: auto; padding: 16px 18px; background: var(--card-2);
  border: 1px solid var(--hairline); border-radius: 14px; font-size: 14px; line-height: 1.55; }
.wb-spec h3 { font-size: 17px; margin: 4px 0 8px; }
.wb-spec h4 { font-size: 14.5px; margin: 14px 0 6px; }
.wb-spec h5 { font-size: 13px; margin: 12px 0 4px; color: var(--text-2); }
.wb-spec p { margin: 8px 0; color: var(--text); }
.wb-spec ul { margin: 6px 0 6px 2px; padding-left: 18px; display: block; }
.wb-spec li { list-style: disc; margin: 4px 0; color: var(--text); }

/* comments */
.wb-cmt-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 18px 0 8px; }
.wb-cmts { display: flex; flex-direction: column; gap: 8px; max-height: 26vh; overflow: auto; }
.wb-cmt { border: 1px solid var(--hairline); border-radius: 12px; padding: 10px 12px; }
.wb-cmt p { font-size: 13.5px; line-height: 1.45; }
.wb-cmt-head { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.wb-cmt.draft { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.wb-cmt.draft .wb-mini.accept { margin-top: 8px; }
.wb-cmt.note { background: var(--card-2); }
.wb-cmt.note p { color: var(--text-2); font-style: italic; }
.wb-cmt.done { opacity: .6; }
.wb-addcmt { display: flex; gap: 10px; margin-top: 10px; }
.wb-addcmt .wb-input { flex: 1; }

/* drag & drop reorder */
.wb-hint { font-size: 10.5px; color: var(--text-3); font-weight: 500; text-transform: none; letter-spacing: 0; }
.wb-list[data-col="ideas"] .wb-card, .wb-list[data-col="specs"] .wb-card { cursor: grab; }
.wb-card.dragging { opacity: .45; cursor: grabbing; box-shadow: var(--shadow-hover); }

/* attachments */
.wb-att-section { margin-top: 12px; }
.wb-att-add { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2);
  border: 1px dashed var(--hairline); border-radius: 10px; padding: 9px 14px; cursor: pointer; }
.wb-att-add:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.wb-att-note { display: inline-block; margin-left: 10px; font-size: 12.5px; }
.wb-atts { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; }
.wb-att { position: relative; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--card-2); }
.wb-att-thumb { width: 100%; height: 56px; object-fit: cover; border-radius: 8px; background: var(--card); }
.wb-att-ico { width: 100%; height: 56px; display: grid; place-items: center; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .03em; }
.wb-att-name { font-size: 11px; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-att-x { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; background: var(--text);
  color: var(--bg); font-size: 13px; line-height: 1; display: grid; place-items: center; box-shadow: var(--shadow); }
.wb-att-x:hover { background: var(--c-red); color: #fff; }
.wb-att-chip { display: inline-block; font-size: 12px; color: var(--text-2); background: var(--card-2);
  border: 1px solid var(--hairline); border-radius: 999px; padding: 4px 10px; margin: 2px 4px 2px 0; }

/* live health dashboard */
.hm-card { display: flex; flex-direction: column; }
.hm-card .card-head { margin-bottom: 6px; }
.hm-val { font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.hm-val small { font-size: 13px; color: var(--text-3); font-weight: 500; margin-left: 3px; }
.hm-spark { height: 40px; margin: 12px 0 8px; }
.hm-spark svg { width: 100%; height: 100%; overflow: visible; }
.hm-spark .line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hm-meta { font-size: 11.5px; color: var(--text-3); }
.hm-delta { font-size: 12.5px; font-weight: 600; }
.hm-delta.dn { color: var(--c-blue); }
.hm-delta.up { color: var(--c-green); }
.hm-nodata { color: var(--text-3); font-size: 13.5px; padding: 8px 0; }
.hm-loading { color: var(--text-3); padding: 20px 2px; }
.hm-section { font-size: 13px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; padding: 6px 2px 0; }
/* trend charts with axis + hover points */
.hm-chart { margin: 12px 0 4px; }
.cchart { width: 100%; height: auto; display: block; overflow: visible; }
.cline { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cpt { pointer-events: none; transition: r .08s ease; }
.cpt-last { pointer-events: none; }
.cpt-hit { fill: transparent; pointer-events: none; }
.cguide { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; pointer-events: none; transition: opacity .1s; }
.cscrub { fill: transparent; pointer-events: all; touch-action: pan-y; cursor: crosshair; }
.cax { fill: var(--text-3); font-size: 8.5px; font-weight: 500; }
/* clickable last-updated + coverage table */
.h-updated { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; padding: 6px 13px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--card); cursor: pointer; }
.h-updated:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.h-updated b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.h-updated span { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.cov { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cov th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; padding: 6px 10px; border-bottom: 1px solid var(--hairline); }
.cov td { padding: 8px 10px; border-bottom: 1px solid var(--hairline); }
.cov td:first-child { color: var(--text-2); }
.cov tr:last-child td { border-bottom: 0; }
.cov-none { color: var(--text-3); }


/* ============================================================
   Atoms treatment: borderless soft-shadow tiles + organic background blobs
   ============================================================ */
.tile, .app-card { border: 0; box-shadow: none; background: transparent; position: relative; isolation: isolate; }
.tile:hover::before, .app-card.is-live:hover::before {
  filter: drop-shadow(0 2px 5px rgba(74,62,40,.07)) drop-shadow(0 16px 38px var(--shadow-c)); }

/* faint organic blobs drifting behind the content (Atoms-style) */
.bg-blobs { display: none; }
.bg-blobs-off { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs i { position: absolute; display: block; background: var(--blob); filter: blur(8px); }
.bg-blobs i:nth-child(1) { width: 48vw; height: 48vw; left: -14vw; top: -12vw; border-radius: 42% 58% 60% 40% / 50% 44% 56% 50%; }
.bg-blobs i:nth-child(2) { width: 40vw; height: 40vw; right: -12vw; top: 16vh; border-radius: 58% 42% 45% 55% / 40% 56% 44% 60%; }
.bg-blobs i:nth-child(3) { width: 34vw; height: 34vw; left: 18vw; bottom: -16vw; border-radius: 50% 50% 56% 44% / 56% 47% 53% 44%; }
.bg-blobs i:nth-child(4) { width: 26vw; height: 26vw; right: 16vw; bottom: 8vh; border-radius: 48% 52% 42% 58% / 56% 42% 58% 44%; }

/* ===================== V2 Midnight — adjustments ===================== */
/* center recovery + sat-fat numbers in their rings (baseline number+unit as one centered group) */
.rec-hero-c { display: grid; place-items: center; }
.rec-hero-c .rec-num { display: inline-flex; align-items: baseline; }
.sf-gauge-c { display: grid; place-items: center; }
.sf-gauge-c .sf-num { display: inline-flex; align-items: baseline; }
.sf-gauge-c .sf-num b { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.sf-gauge-c .sf-num i { font-style: normal; font-size: 15px; font-weight: 600; color: var(--text-3); margin-left: 1px; }
.sf-box.good .sf-gauge-c .sf-num b { color: var(--c-green); }
.sf-box.over .sf-gauge-c .sf-num b { color: var(--c-red); }
/* sat-fat title fits the narrow card */
.sf-title { font-size: 12px; line-height: 1.25; text-transform: none; letter-spacing: 0; }
.sf-title span { display: block; font-size: 10px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* nutrition donut + nutrient bars: midnight glow (colors retained) */
.donut .seg { filter: drop-shadow(0 0 5px var(--c)); }

/* ---- compact borderless workouts calendar (workout=green, recovery=blue, both=gradient) ---- */
.workouts-card .mc { display: grid; grid-template-columns: repeat(7, 38px); gap: 11px 13px; justify-content: start; margin-top: 6px; }
.mc-dow { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.mc-cell { width: 38px; height: 38px; display: grid; place-items: center; font-size: 13.5px; font-weight: 600; color: var(--text-2); border-radius: 50%; font-variant-numeric: tabular-nums; }
.mc-cell.empty { visibility: hidden; }
.mc-cell.today { box-shadow: inset 0 0 0 1.5px var(--text-3); }
.mc-cell.wo, .mc-cell.rec, .mc-cell.both { color: var(--bg); font-weight: 700; }
.mc-cell.wo { background: var(--c-green); box-shadow: 0 0 9px color-mix(in srgb, var(--c-green) 60%, transparent); }
.mc-cell.rec { background: var(--c-blue); box-shadow: 0 0 9px color-mix(in srgb, var(--c-blue) 55%, transparent); }
.mc-cell.both { background: linear-gradient(135deg, var(--c-green), var(--c-blue)); box-shadow: 0 0 10px color-mix(in srgb, var(--c-blue) 50%, transparent); }
.mc-cell.wo.today, .mc-cell.rec.today, .mc-cell.both.today { box-shadow: inset 0 0 0 1.6px var(--bg); }
.mc-cell.act { cursor: pointer; transition: transform .12s ease; }
.mc-cell.act:hover { transform: scale(1.12); }
.mc-key { display: flex; gap: 20px; margin-top: 16px; }
.mc-key li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.mc-kdot { width: 11px; height: 11px; border-radius: 50%; }
.mc-kdot.wo { background: var(--c-green); }
.mc-kdot.rec { background: var(--c-blue); }

/* ===================== V2 Midnight — fix pass ===================== */
/* #1 nutrition donut glow no longer clipped to a square */
.donut, .donut svg { overflow: visible; }
/* #2 nudge saturated-fat ring up toward optical center */
.sf-gauge { margin: -10px 0 0; }
/* #3 + #7 workouts is a regular 1-col block; equal-size responsive circles */
.workouts-card .mc { grid-template-columns: repeat(7, 1fr); gap: 6px; justify-content: stretch; }
.workouts-card .mc-cell { width: auto; height: auto; aspect-ratio: 1; font-size: 12.5px; }
.workouts-card .mc-dow { font-size: 9.5px; }
/* #6 distinct recovery blue (higher contrast vs green) + clearer two-tone gradient */
.mc-cell.wo   { box-shadow: 0 0 8px color-mix(in srgb, var(--c-green) 55%, transparent); }
.mc-cell.rec  { background: #3E7BFF; box-shadow: 0 0 8px color-mix(in srgb, #3E7BFF 55%, transparent); }
.mc-cell.both { background: linear-gradient(135deg, var(--c-green) 0%, var(--c-green) 36%, #3E7BFF 64%, #3E7BFF 100%); box-shadow: 0 0 9px color-mix(in srgb, #3E7BFF 45%, transparent); }
.mc-kdot.rec { background: #3E7BFF; }
/* #5 legend dots/items don't stretch */
.mc-key li { flex: none; }
.mc-kdot { flex: none; }
/* no-activity days get no circle; today shown by a brighter number only */
.mc-cell.today { box-shadow: none; }
.mc-cell.today:not(.wo):not(.rec):not(.both) { color: var(--text); font-weight: 700; }
.mc-cell.wo.today, .mc-cell.rec.today, .mc-cell.both.today { box-shadow: inset 0 0 0 1.6px var(--bg); }
/* keep row heights tidy now that workouts is inline */
.grid-health { align-items: start; }
/* #8/#11 goal chip top-right in the chart's colour */
.hm-card .card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hm-goal { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
/* #9 hidden hover dots for bar charts (enable the scrub pill) */
.cpt-hidden { opacity: 0; }
/* #12 date strip: no scrollbar, arrow buttons scroll the panel */
.ds-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.ds-wrap { margin-bottom: 0; padding-bottom: 2px; scrollbar-width: none; scroll-behavior: smooth; }
.ds-wrap::-webkit-scrollbar { display: none; width: 0; height: 0; }
.ds-arrow { flex: none; width: 32px; height: 52px; border-radius: 12px; border: 1px solid var(--card-border); background: var(--card); color: var(--text-2); font-size: 20px; line-height: 1; display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; }
.ds-arrow:hover { background: var(--card-2); color: var(--text); }
/* #5 fix: keep legend dots perfectly round (no flex stretch) */
.mc-key { align-items: center; }
.mc-key .mc-kdot { width: 11px !important; height: 11px !important; aspect-ratio: 1 !important; min-width: 11px; border-radius: 50%; flex: none; align-self: center; }
/* #5 final: neutralize the stray .rec row style leaking onto the legend dot */
.mc-key .mc-kdot { display: inline-block !important; padding: 0 !important; border: 0 !important; width: 11px !important; height: 11px !important; border-radius: 50%; flex: none; align-self: center; }

/* ===================== V2 Midnight — fix round 2 ===================== */
/* #1 calendar cells must NOT inherit the stray .rec row (padding/border) — keeps the grid identical for every day-type combo */
.workouts-card .mc-cell { padding: 0 !important; border: 0 !important; box-sizing: border-box; }
/* #2 equal-height blocks across both rows; content fills each block */
.grid-health { grid-auto-rows: 1fr; align-items: stretch; }
.hm-card { display: flex; flex-direction: column; }
.hm-card .hm-chart { flex: 1 1 auto; display: flex; align-items: center; min-height: 92px; }
.hm-card .hm-chart .cchart { width: 100%; }
.hm-card .hm-meta { margin-top: 8px; }
.workouts-card { display: flex; flex-direction: column; }
.workouts-card .mc { flex: 1 1 auto; align-content: center; }
.workouts-card .mc-key { margin-top: 12px; }
/* #4 chart hover popup: value big & bold on top, date secondary centered below */
.tooltip { text-align: center; padding: 10px 14px; }
.tooltip .tt-num { display: block; font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.tooltip .tt-date { display: block; font-size: 11.5px; opacity: .6; margin-top: 3px; font-weight: 500; }
.tooltip .tt-rows { text-align: left; }

/* ===================== V2 Midnight — fix round 3 ===================== */
/* #1 long-term heading is now a standalone block (out of the equal-height grid) — give it clean spacing */
.hm-section { display: block; margin: 30px 0 16px; padding: 0 2px; }
/* #3 zone badges behind the headings in the workout popup (light tooltip bg) */
.tt-rows .zb { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: .02em; margin-right: 7px; }
.tt-rows .zb0  { background: #E2E4E8; color: #5E6470; }
.tt-rows .zb13 { background: #D6E9FF; color: #1E6FC0; }
.tt-rows .zb45 { background: #FFD9DD; color: #C0303D; }

/* ============================================================
   STATUS CHECK — landing dashboard (combined Overview A + B)
   ============================================================ */
.status-hero { margin-bottom: 22px; }
.sc-hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sc-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2);
  background: var(--card); border: 1px solid var(--card-border); border-radius: 100px; padding: 7px 13px; white-space: nowrap; }
.sc-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 7px var(--accent); }
.sc-chip-dot.off { background: var(--text-3); box-shadow: none; }

.status-dash { display: flex; flex-direction: column; gap: 26px; }
.sc-area-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sc-area-head h2 { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin: 0; }
.sc-area-sub { font-size: 12px; color: var(--text-3); }
.sc-muted { color: var(--text-2); font-size: 14px; line-height: 1.55; }

/* ---- Signals strip ---- */
.sc-signals { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 1100px) { .sc-signals { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px)  { .sc-signals { grid-template-columns: repeat(2, 1fr); } }
.sc-sig { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-md);
  padding: 14px 14px 12px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.sc-sig::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2.5px; background: var(--text-3); opacity: .5; }
.sc-sig.tone-pos::before { background: var(--c-green); opacity: 1; }
.sc-sig.tone-neg::before { background: var(--c-red); opacity: 1; }
.sc-sig-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.sc-sig-label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.sc-sig-delta { font-size: 11px; font-weight: 700; color: var(--text-2); }
.sc-sig-delta.pos { color: var(--c-green); }
.sc-sig-delta.neg { color: var(--c-red); }
.sc-sig-val { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: var(--text); line-height: 1; }
.sc-sig-val small { font-size: 12px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.sc-sig-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; height: 26px; }
.sc-sig-spark { color: var(--accent); display: block; flex: 1; min-width: 0; }
.sc-spark { width: 100%; height: 26px; display: block; }
.sc-sig-goal { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.sc-sig-nodata { font-size: 13px; color: var(--text-3); padding: 6px 0 10px; }
.sc-sig-empty::before { opacity: .25; }

/* ---- two-column body ---- */
.sc-cols { display: grid; grid-template-columns: 1.65fr 1fr; gap: 26px; align-items: start; }
@media (max-width: 860px) { .sc-cols { grid-template-columns: 1fr; } }

/* ---- The read on today ---- */
.sc-brief { padding: 20px 22px; }
.sc-brief-date { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.sc-brief-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sc-brief-list li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.sc-brief-list li::before { content: ''; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.sc-brief-list b { color: var(--text); font-weight: 700; }
.sc-note { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--card-border); position: relative; }
.sc-note-input { width: 100%; resize: none; background: transparent; border: none; outline: none; color: var(--text);
  font: inherit; font-size: 14.5px; line-height: 1.5; padding: 0; }
.sc-note-input::placeholder { color: var(--text-3); }
.sc-save { position: absolute; right: 0; bottom: -2px; font-size: 11px; color: var(--text-3); }

/* ---- If you do one thing ---- */
.sc-onething { padding: 20px 22px; display: flex; gap: 14px; justify-content: space-between; align-items: flex-start;
  background: linear-gradient(150deg, var(--accent-soft), transparent 70%), var(--card); }
.sc-onething.is-done { opacity: .62; }
.sc-onething.is-done .sc-ot-title { text-decoration: line-through; }
.sc-ot-title { font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--text); letter-spacing: -.01em; }
.sc-ot-detail { font-size: 14px; color: var(--text-2); line-height: 1.5; margin-top: 8px; }
.sc-ot-tag { display: inline-block; margin-top: 12px; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 3px 9px; }
.sc-ot-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.sc-ot-check { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--card-border); background: transparent;
  color: var(--text-3); font-size: 16px; cursor: pointer; transition: all .18s ease; }
.sc-ot-check.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sc-ot-edit, .sc-btn-ghost { background: transparent; border: none; color: var(--text-3); font-size: 12.5px; cursor: pointer; padding: 2px 4px; }
.sc-ot-edit:hover, .sc-btn-ghost:hover { color: var(--text); }
.sc-add-big { width: 100%; background: transparent; border: 1.5px dashed var(--card-border); border-radius: var(--r-sm);
  color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; padding: 18px; cursor: pointer; transition: all .18s ease; }
.sc-add-big:hover { border-color: var(--accent); color: var(--text); }

/* ---- shared form bits ---- */
.sc-form { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.sc-inp { width: 100%; background: var(--bg); border: 1px solid var(--card-border); border-radius: var(--r-sm);
  color: var(--text); font: inherit; font-size: 14.5px; padding: 10px 12px; outline: none; resize: vertical; }
.sc-inp:focus { border-color: var(--accent); }
.sc-inp::placeholder { color: var(--text-3); }
.sc-inp-sm { max-width: 220px; }
.sc-form-row { display: flex; gap: 10px; align-items: center; }
.sc-btn { background: var(--accent); color: var(--on-accent); border: none; border-radius: var(--r-sm);
  font: inherit; font-weight: 700; font-size: 14px; padding: 9px 18px; cursor: pointer; }
.sc-btn:hover { filter: brightness(1.06); }

/* ---- Open threads ---- */
.sc-threads { padding: 14px 18px 18px; }
.sc-thread-list { display: flex; flex-direction: column; }
.sc-thread { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--card-border); }
.sc-thread:last-child { border-bottom: none; }
.sc-thread.is-done .sc-thread-title { text-decoration: line-through; color: var(--text-3); }
.sc-thread-check { width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; border: 1.5px solid var(--card-border);
  background: transparent; color: transparent; font-size: 13px; cursor: pointer; transition: all .16s ease; }
.sc-thread-check.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sc-thread-title { flex: 1; font-size: 15px; color: var(--text); }
.sc-thread-del { background: transparent; border: none; color: var(--text-3); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.sc-thread-del:hover { color: var(--c-red); }
.sc-thread-add { display: flex; gap: 10px; margin-top: 14px; }
.sc-thread-add .sc-inp { flex: 1; }

/* ---- footer stats ---- */
.sc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 560px) { .sc-stats { grid-template-columns: repeat(2, 1fr); } }
.sc-stat { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-md); padding: 16px; text-align: center; }
.sc-stat-val { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.sc-stat-label { font-size: 11px; color: var(--text-3); margin-top: 4px; letter-spacing: .04em; }

/* ---- lock state ---- */
.sc-lock { display: grid; place-items: center; padding: 6vh 0; }
.sc-lock-card { text-align: center; max-width: 380px; background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--r-md); padding: 34px 28px; box-shadow: var(--shadow); }
.sc-lock-ico { font-size: 34px; margin-bottom: 12px; }
.sc-lock-card h3 { margin: 0 0 8px; font-size: 18px; color: var(--text); }
.sc-lock-row { display: flex; gap: 10px; margin-top: 18px; }
.sc-lock-row .sc-inp, #scPw { flex: 1; background: var(--bg); border: 1px solid var(--card-border); border-radius: var(--r-sm);
  color: var(--text); font: inherit; font-size: 15px; padding: 10px 12px; outline: none; }
#scPw:focus { border-color: var(--accent); }

/* ===== Status Check — morning briefing additions ===== */
.sc-banner { display: flex; align-items: center; gap: 14px; background: var(--accent-soft);
  border: 1px solid var(--card-border); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 26px; }
.sc-banner-ico { color: var(--accent); font-size: 18px; flex-shrink: 0; }
.sc-banner-text { font-size: 13px; color: var(--text-2); line-height: 1.5; flex: 1; }
.sc-banner-text b { color: var(--text); font-weight: 700; }

.sc-by { font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.sc-by-ai { color: var(--accent); }
.sc-by-live { color: var(--c-green); }
.sc-by-data { color: var(--text-3); }
.sc-area-head { align-items: center; }

/* the morning read */
.sc-read-lead { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 10px; letter-spacing: -.01em; }
.sc-read-p { font-size: 15px; line-height: 1.65; color: var(--text-2); }
.sc-read-p + .sc-read-p { margin-top: 11px; }
.sc-read-take { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--card-border); font-size: 14px; color: var(--text-2); line-height: 1.5; }
.sc-read-take b { color: var(--accent); }

/* generic list cards (top3 / people / adventures) */
.sc-list { padding: 6px 18px; }
.sc-li { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--card-border); }
.sc-li:last-child { border-bottom: none; }
.sc-li-num { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 800; display: grid; place-items: center; margin-top: 1px; }
.sc-li-body { flex: 1; min-width: 0; }
.sc-li-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.sc-li-why { font-size: 13px; color: var(--text-2); line-height: 1.45; margin-top: 3px; }
.sc-li-tag { flex-shrink: 0; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-3); background: var(--bg); border: 1px solid var(--card-border); border-radius: 6px; padding: 3px 8px; margin-top: 1px; }
.sc-when { font-size: 12px; font-weight: 600; color: var(--text-3); }
.sc-dot { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); margin-top: 6px; }
.sc-dot.overdue { background: var(--c-red); }
.sc-dot.drifting { background: var(--c-yellow); }
.sc-dot.healthy { background: var(--c-green); }

/* standards lens */
.sc-standards { padding: 20px 22px; }
.sc-std-pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border-radius: 100px; padding: 5px 13px; margin-bottom: 12px; }
.sc-std-take { font-size: 15px; line-height: 1.6; color: var(--text-2); }

/* streaks */
.sc-streaks { padding: 18px 22px; }
.sc-streak-hi { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }

/* personal note */
.sc-notecard { padding: 16px 18px; position: relative; }

/* streaks moved into Signals as plain data pills */
.sc-streak-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.sc-streak-lead { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-right: 2px; }
.sc-streak-pill { display: inline-flex; align-items: center; gap: 7px; background: var(--card); border: 1px solid var(--card-border); border-radius: 100px; padding: 6px 13px; }
.sc-streak-days { font-size: 14px; font-weight: 800; color: var(--accent); }
.sc-streak-nm { font-size: 13px; color: var(--text-2); }

/* ============================================================
   Ported tabs — Standards / Relationships / Streaks / Adventures
   ============================================================ */
.tab-intro { color: var(--text-2); font-size: 14.5px; line-height: 1.55; margin-bottom: 20px; max-width: 640px; }
.tab-add { margin-top: 18px; }
.tab-add-row { display: flex; gap: 10px; margin-top: 12px; }
.tab-add-row .tab-inp { flex: 1; }
.tab-rowacts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tab-mini { background: transparent; border: 1px solid var(--card-border); color: var(--text-2); border-radius: 8px;
  font: inherit; font-size: 12.5px; padding: 5px 11px; cursor: pointer; transition: all .15s ease; }
.tab-mini:hover { color: var(--text); border-color: var(--text-3); }
.tab-mini.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tab-mini.accent:hover { background: var(--accent-soft); }
.tab-mini.danger:hover { color: var(--c-red); border-color: color-mix(in srgb, var(--c-red) 40%, transparent); }

/* Standards */
.std-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.std-card { padding: 18px 20px; }
.std-pillar { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.std-stmt { font-size: 15px; line-height: 1.55; color: var(--text-2); margin-bottom: 14px; }

/* Relationships */
.rel-list { display: flex; flex-direction: column; gap: 10px; }
.rel-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.rel-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--text-3); }
.rel-dot.overdue { background: var(--c-red); } .rel-dot.drifting { background: var(--c-yellow); } .rel-dot.healthy { background: var(--c-green); }
.rel-main { flex: 1; min-width: 0; }
.rel-name { font-size: 16px; font-weight: 600; color: var(--text); }
.rel-sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }

/* Streaks */
.streak-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.streak-card { padding: 20px; text-align: center; }
.streak-emoji { font-size: 30px; }
.streak-num { font-size: 40px; font-weight: 800; letter-spacing: -.03em; color: var(--accent); line-height: 1.1; margin-top: 6px; }
.streak-num small { font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.streak-name { font-size: 16px; font-weight: 600; color: var(--text); margin-top: 4px; }
.streak-since { font-size: 12px; color: var(--text-3); margin: 6px 0 14px; }
.streak-card .tab-rowacts { justify-content: center; }

/* Adventures */
.adv-list { display: flex; flex-direction: column; gap: 10px; }
.adv-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.adv-main { flex: 1; min-width: 0; }
.adv-title { font-size: 16px; font-weight: 600; color: var(--text); }
.adv-type { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3);
  background: var(--bg); border: 1px solid var(--card-border); border-radius: 6px; padding: 2px 7px; margin-left: 6px; vertical-align: middle; }
.adv-when { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.buck-list { display: flex; flex-direction: column; }
.buck-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--card-border); }
.buck-row:last-child { border-bottom: none; }
.buck-row.done .buck-text { text-decoration: line-through; color: var(--text-3); }
.buck-check { width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; border: 1.5px solid var(--card-border);
  background: transparent; color: transparent; font-size: 13px; cursor: pointer; }
.buck-check.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.buck-text { flex: 1; font-size: 15px; color: var(--text); }
.buck-del { background: transparent; border: none; color: var(--text-3); font-size: 20px; cursor: pointer; padding: 0 4px; }
.buck-del:hover { color: var(--c-red); }

/* modal + fields + toast (shared) */
.tab-modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 100; padding: 20px; }
.tab-modal-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-md); padding: 24px; width: 100%; max-width: 420px; box-shadow: var(--shadow-hover); }
.tab-modal-card h3 { margin: 0 0 16px; font-size: 18px; color: var(--text); }
.tab-f { display: block; margin-bottom: 14px; }
.tab-f > span { display: block; font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 6px; letter-spacing: .03em; }
.tab-hint { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.4; color: var(--text-3); font-weight: 400; letter-spacing: 0; }
.tab-inp { width: 100%; background: var(--bg); border: 1px solid var(--card-border); border-radius: var(--r-sm);
  color: var(--text); font: inherit; font-size: 15px; padding: 10px 12px; outline: none; }
.tab-inp:focus { border-color: var(--accent); }
.tab-modal-acts { display: flex; gap: 10px; margin-top: 20px; }
.tab-toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 14px; padding: 10px 20px; border-radius: 100px; opacity: 0; transition: all .2s ease; z-index: 200; pointer-events: none; }
.tab-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* settings modal */
.set-hint { margin: 2px 0 14px; font-size: 12.5px; line-height: 1.5; color: var(--text-3); }
.set-msg { margin: 12px 0 0; font-size: 13px; color: var(--text-3); min-height: 18px; }
.tab-modal-card select.tab-inp { appearance: none; -webkit-appearance: none; cursor: pointer; }

/* ============================================================
   Collapsible sidebar + embedded Adventures app (added 2026-05-31)
   ============================================================ */
.sidebar { transition: margin-left .32s cubic-bezier(.4,0,.2,1), opacity .26s ease; }
.app.sb-collapsed .sidebar { margin-left: calc(-1 * var(--sb-w)); opacity: 0; pointer-events: none; }

.sb-collapse { margin-left: auto; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; color: var(--text-3);
  transition: background .18s ease, color .18s ease; flex: none; }
.sb-collapse:hover { background: var(--accent-soft); color: var(--text); }
.sb-collapse .ico { width: 18px; height: 18px; }

.sb-open { position: fixed; top: 16px; left: 16px; z-index: 60; width: 40px; height: 40px;
  border-radius: 12px; display: none; place-items: center; color: var(--text);
  background: color-mix(in srgb, var(--card) 82%, transparent);
  border: 1px solid var(--hairline); box-shadow: var(--shadow);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  transition: background .18s ease, transform .12s ease; }
.sb-open .ico { width: 20px; height: 20px; }
.sb-open:hover { background: var(--accent-soft); }
.sb-open:active { transform: scale(.94); }
.app.sb-collapsed .sb-open { display: grid; }

/* embedded Adventures app — full-bleed iframe inside its tab */
.view-flush { margin-bottom: -90px; }
.adv-frame-wrap { margin-top: -8px; }
.adv-frame { width: 100%; height: calc(100vh - 64px); border: 0; border-radius: 18px;
  background: var(--card); box-shadow: var(--shadow); display: block; }

@media (max-width: 768px) {
  .sb-open, .sb-collapse { display: none !important; }
  .view-flush { margin-bottom: -96px; }
  .adv-frame { height: calc(100vh - 110px); border-radius: 12px; }
}

/* ============================================================
   Standards — Personal Operating System (architectural, #sys-1 inspired)
   ============================================================ */
.os-diagram { padding: 0; overflow: hidden; margin-bottom: 28px; }
.os-d-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--hairline); background: var(--card-2); }
.os-d-title { font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--text-2); }
.os-d-meta { font-size: 11px; color: var(--text-3); }
.os-temple { padding: 28px 22px 22px; }

/* pillars rising */
.os-pillars { display: flex; gap: 12px; align-items: stretch; justify-content: center; flex-wrap: wrap; }
.os-pcol { flex: 1 1 0; min-width: 132px; max-width: 230px; display: flex; flex-direction: column; }
.os-pcol-cap { height: 11px; border-radius: 7px 7px 2px 2px; margin: 0 -3px;
  background: color-mix(in srgb, var(--accent) 60%, transparent); }
.os-pcol-shaft { flex: 1; min-height: 118px; padding: 14px 13px;
  border-left: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  background: linear-gradient(180deg, var(--accent-soft), color-mix(in srgb, var(--card-2) 70%, transparent)); }
.os-pcol-name { font-size: 13.5px; font-weight: 700; color: var(--text); letter-spacing: -.01em; line-height: 1.25; margin-bottom: 11px; }
.os-pcol-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.os-pcol-list li { font-size: 11.5px; color: var(--text-2); display: flex; gap: 7px; align-items: flex-start; line-height: 1.4; }
.os-pcol-list li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: .5em; }
.os-pcol-hint { font-size: 11.5px; color: var(--text-3); font-style: italic; line-height: 1.45; }
.os-pcol-base { height: 10px; border-radius: 2px 2px 6px 6px; margin: 0 -3px;
  background: color-mix(in srgb, var(--accent) 40%, transparent); }

/* foundation base */
.os-foundation-label { font-size: 9.5px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase;
  color: var(--text-3); text-align: center; margin: 18px 0 9px; }
.os-fblocks { display: flex; gap: 10px; }
.os-fblock { flex: 1; background: var(--card-2); border: 1px solid var(--card-border); border-radius: 11px; padding: 13px 16px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent) 10%, transparent); }
.os-fblock-name { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .02em; margin-bottom: 3px; }
.os-fblock-stmt { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.os-fblock-empty { color: var(--text-3); font-size: 12.5px; font-style: italic; text-align: center; }
.os-pillars-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 24px; }

/* detail tiers */
.os-tier { margin-bottom: 26px; }
.os-tier-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 13px; flex-wrap: wrap; }
.os-tier-kicker { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.os-tier-sub { font-size: 13px; color: var(--text-3); }
.os-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.os-card { padding: 18px 20px; }
.os-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.os-card-name { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.os-card-stmt { font-size: 14px; line-height: 1.55; color: var(--text-2); margin-bottom: 16px; }
.os-practices-label { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 9px; }
.os-practice-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.os-practice { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 100px; padding: 4px 6px 4px 12px; }
.os-practice-x { background: none; border: none; color: var(--text-3); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 3px; }
.os-practice-x:hover { color: var(--c-red); }
.os-practice-add-wrap { display: inline-flex; align-items: center; gap: 5px; }
.os-practice-inp { width: 138px; background: var(--bg); border: 1px solid var(--card-border); border-radius: 100px;
  color: var(--text); font: inherit; font-size: 12px; padding: 6px 13px; outline: none; }
.os-practice-inp:focus { border-color: var(--accent); }
.os-practice-add { width: 27px; height: 27px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--card-border);
  background: transparent; color: var(--text-2); font-size: 16px; line-height: 1; cursor: pointer; transition: all .15s; }
.os-practice-add:hover { border-color: var(--accent); color: var(--accent); }

/* tier picker in the edit modal */
.os-tier-pick { display: flex; flex-direction: column; gap: 8px; }
.os-tier-opt { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--text-2);
  padding: 10px 12px; border: 1px solid var(--card-border); border-radius: var(--r-sm); cursor: pointer; }
.os-tier-opt:hover { border-color: var(--text-3); }
.os-tier-opt strong { color: var(--text); font-weight: 600; }
.os-tier-opt input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }

@media (max-width: 760px) {
  .os-temple { padding: 22px 14px 16px; }
  .os-pillars { gap: 8px; }
  .os-pcol { min-width: 0; flex: 1 1 calc(50% - 4px); }
  .os-fblocks { flex-direction: column; }
  .os-cards { grid-template-columns: 1fr; }
}

/* ---------- Standards OS v2: pillar groups + linkable item cards ---------- */
.os-pgroups { display: flex; gap: 24px; justify-content: center; align-items: flex-end; flex-wrap: wrap; margin-bottom: 4px; }
.os-pgroup { flex: 1 1 0; min-width: 240px; }
.os-pgroup-label { font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--text-3); text-align: center; margin-bottom: 12px; }
.os-pgroup .os-pillars { gap: 8px; }
.os-pgroup .os-pcol { min-width: 92px; }

.os-items { display: flex; flex-direction: column; gap: 7px; margin-top: 2px; }
.os-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 11px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--card-border); }
.os-item-ic { font-size: 12.5px; line-height: 1.55; flex-shrink: 0; width: 15px; text-align: center; color: var(--text-3); }
.os-item.k-heroic  .os-item-ic { color: var(--accent); }
.os-item.k-video   .os-item-ic { color: var(--c-red); }
.os-item.k-audio   .os-item-ic { color: var(--c-violet); }
.os-item.k-article .os-item-ic { color: var(--c-blue); }
.os-item-body { flex: 1; min-width: 0; }
.os-item-text { font-size: 13px; color: var(--text); line-height: 1.45; }
.os-item-src { display: block; font-size: 11px; color: var(--text-3); margin-top: 3px; }
.os-item-link { flex-shrink: 0; align-self: center; font-size: 11px; font-weight: 700; color: var(--accent); white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent); border-radius: 100px; padding: 3px 10px; transition: background .15s; }
.os-item-link:hover { background: var(--accent-soft); }
.os-item-x { flex-shrink: 0; align-self: center; background: none; border: none; color: var(--text-3); font-size: 16px; line-height: 1;
  cursor: pointer; padding: 0 2px; opacity: 0; transition: opacity .15s, color .15s; }
.os-item:hover .os-item-x { opacity: 1; }
.os-item-x:hover { color: var(--c-red); }
.os-item-add { margin-top: 3px; width: 100%; text-align: left; background: transparent; border: 1px dashed var(--card-border);
  color: var(--text-2); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 12.5px; cursor: pointer; transition: all .15s; }
.os-item-add:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 760px) {
  .os-pgroups { gap: 14px; }
  .os-pgroup { min-width: 0; flex-basis: 100%; }
}

/* ============================================================
   Standards — "My Standards" framework (architecture + domains + spine)
   ============================================================ */
/* architecture diagram */
.std-arch { padding: 26px 22px 20px; margin-bottom: 30px; }
.arch-crown { max-width: 380px; margin: 0 auto; text-align: center; padding: 14px 24px; border-radius: 14px;
  background: linear-gradient(180deg, var(--accent-soft), transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.arch-crown-k { font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.arch-crown-t { font-size: 15.5px; font-weight: 600; color: var(--text); margin-top: 4px; font-style: italic; }
.arch-stem { width: 2px; height: 20px; background: var(--card-border); margin: 0 auto; }
.arch-rule { height: 2px; background: var(--card-border); border-radius: 2px; margin: 0 12% 18px; }
.arch-domains { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.arch-dom { border: 1px solid var(--card-border); border-top: 3px solid var(--dc); border-radius: 12px; padding: 13px 13px 14px; background: var(--card-2); }
.arch-dom-name { font-size: 13.5px; font-weight: 800; letter-spacing: .01em; color: var(--dc); }
.arch-dom-sub { font-size: 11px; color: var(--text-3); margin: 2px 0 11px; }
.arch-dom-stds { display: flex; flex-direction: column; gap: 6px; }
.arch-chip { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text); line-height: 1.25;
  background: var(--bg); border: 1px solid var(--card-border); border-radius: 8px; padding: 6px 9px; }
.arch-chip-n { flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; background: color-mix(in srgb, var(--dc) 22%, transparent);
  color: var(--dc); font-weight: 800; font-size: 10px; display: grid; place-items: center; }
.arch-base { margin-top: 18px; text-align: center; font-size: 11.5px; color: var(--text-3); border-top: 1px dashed var(--card-border); padding-top: 15px; }

/* domain sections */
.std-domain { margin-top: 32px; }
.std-domain-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; padding-left: 13px; border-left: 3px solid var(--dc); flex-wrap: wrap; }
.std-domain-name { font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.std-domain-sub { font-size: 13px; color: var(--text-3); font-style: italic; }
.std-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(392px, 1fr)); gap: 16px; align-items: start; }

.std-card2 { padding: 20px 22px; border-top: 3px solid var(--dc); }
.std-c-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 13px; }
.std-c-num { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--dc) 18%, transparent);
  color: var(--dc); font-weight: 800; font-size: 15px; display: grid; place-items: center; }
.std-c-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--text); flex: 1; line-height: 1.25; }
.std-c-quote { font-size: 13.5px; line-height: 1.6; color: var(--text-2); font-style: italic;
  border-left: 2px solid color-mix(in srgb, var(--dc) 45%, transparent); padding-left: 13px; margin-bottom: 18px; }
.std-layer { margin-bottom: 17px; }
.std-layer:last-child { margin-bottom: 0; }
.std-layer-h { font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--dc); margin-bottom: 10px; }
.std-mantras { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.std-mantras li { position: relative; display: flex; gap: 8px; align-items: flex-start; padding-left: 14px; font-size: 13px; line-height: 1.5; color: var(--text); }
.std-mantras li::before { content: ''; position: absolute; left: 0; top: .58em; width: 5px; height: 5px; border-radius: 50%; background: var(--dc); }
.std-m-text { flex: 1; min-width: 0; }
.std-m-by { color: var(--text-3); font-size: 11.5px; font-style: italic; }
.std-x { flex-shrink: 0; opacity: 0; background: none; border: none; color: var(--text-3); font-size: 14px; line-height: 1; cursor: pointer; padding: 0 2px; transition: opacity .15s, color .15s; }
.std-mantras li:hover .std-x, .std-virtue:hover .std-x { opacity: 1; }
.std-x:hover { color: var(--c-red); }
.std-virtues { display: flex; flex-wrap: wrap; gap: 6px; }
.std-virtue { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--dc);
  background: color-mix(in srgb, var(--dc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--dc) 26%, transparent);
  border-radius: 100px; padding: 4px 7px 4px 11px; }
.std-link-group { font-size: 11px; font-weight: 700; color: var(--text-3); margin: 10px 0 6px; }
.std-link-group:first-child { margin-top: 0; }
.std-card2 .os-item { margin-bottom: 6px; }
.std-card2 .os-item-link { color: var(--dc); border-color: color-mix(in srgb, var(--dc) 32%, transparent); }
.std-card2 .os-item-link:hover { background: color-mix(in srgb, var(--dc) 12%, transparent); }
.std-addrow { display: flex; gap: 6px; margin-top: 9px; }
.std-addm-inp, .std-addv-inp { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--card-border); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 12.5px; padding: 6px 11px; outline: none; }
.std-addm-inp:focus, .std-addv-inp:focus { border-color: var(--dc); }
.std-addbtn { flex-shrink: 0; width: 30px; border: 1px solid var(--card-border); border-radius: 8px; background: transparent;
  color: var(--text-2); font-size: 15px; line-height: 1; cursor: pointer; transition: all .15s; }
.std-addbtn:hover { border-color: var(--dc); color: var(--dc); }
.std-addlink { margin-top: 9px; width: 100%; text-align: left; background: transparent; border: 1px dashed var(--card-border);
  color: var(--text-2); border-radius: 9px; padding: 7px 11px; font: inherit; font-size: 12px; cursor: pointer; transition: all .15s; }
.std-addlink:hover { border-color: var(--dc); color: var(--dc); }

/* character spine */
.std-spine { margin-top: 36px; border-top: 1px solid var(--hairline); padding-top: 26px; }
.std-spine-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.std-spine-table { display: flex; flex-direction: column; gap: 8px; }
.spine-row { display: grid; grid-template-columns: 210px 1fr; gap: 16px; align-items: start; padding: 13px 16px;
  border: 1px solid var(--card-border); border-left: 3px solid var(--dc); border-radius: 11px; background: var(--card); }
.spine-std { display: flex; gap: 9px; align-items: center; font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.3; }
.spine-num { flex-shrink: 0; width: 21px; height: 21px; border-radius: 6px; background: color-mix(in srgb, var(--dc) 18%, transparent);
  color: var(--dc); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.spine-virtues { display: flex; flex-wrap: wrap; gap: 6px; }
.spine-v { font-size: 11.5px; color: var(--text-2); background: var(--card-2); border: 1px solid var(--card-border); border-radius: 100px; padding: 3px 11px; }
.std-sources { font-size: 11.5px; color: var(--text-3); font-style: italic; text-align: center; margin-top: 24px; line-height: 1.6; max-width: 760px; margin-left: auto; margin-right: auto; }

@media (max-width: 760px) {
  .arch-domains { grid-template-columns: repeat(2, 1fr); }
  .std-cards { grid-template-columns: 1fr; }
  .spine-row { grid-template-columns: 1fr; gap: 9px; }
}

/* Philosophy: per-virtue intro paragraph */
.std-domain-intro { font-size: 14px; line-height: 1.62; color: var(--text-2); max-width: 74ch;
  margin: 2px 0 18px; padding: 10px 0 0 14px; border-left: 3px solid color-mix(in srgb, var(--dc) 32%, transparent); }

/* ============================================================
   Philosophy v2 (Beta) — North Star · Foundations · Pillars
   ============================================================ */
.p2-hero { padding: 8px 0 30px; }
.p2-hero-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 10px; }
.p2-beta { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 100px; padding: 2px 8px; }
.p2-northlabel { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin: 20px 0 8px; }
.p2-north { font-size: clamp(28px, 4.4vw, 44px); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; color: var(--text); max-width: 20ch; }
.p2-northsub { font-size: 15px; color: var(--text-2); margin-top: 14px; max-width: 60ch; font-style: italic; line-height: 1.55; }

/* architecture / temple diagram */
.p2-arch { padding: 0; overflow: hidden; margin-bottom: 34px; }
.p2-arch-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--hairline); background: var(--card-2); }
.p2-arch-title { font-size: 11px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--text-2); }
.p2-arch-meta { font-size: 11px; color: var(--text-3); }
.p2-temple { padding: 30px 22px 22px; }
.p2-apex { max-width: 460px; margin: 0 auto; text-align: center; padding: 16px 24px; border-radius: 16px;
  background: radial-gradient(120% 140% at 50% 0%, var(--accent-soft), transparent 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent); }
.p2-apex-mark { display: block; font-size: 18px; color: var(--accent); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 60%, transparent)); }
.p2-apex-t { display: block; font-size: 15.5px; font-weight: 700; color: var(--text); margin-top: 6px; letter-spacing: -.01em; line-height: 1.3; }
.p2-rays { width: 2px; height: 22px; margin: 0 auto; background: linear-gradient(var(--accent), var(--card-border)); }
.p2-pillars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: end; }
.p2-pcol { display: flex; flex-direction: column; min-width: 0; }
.p2-pcol-cap { height: 9px; border-radius: 6px 6px 2px 2px; margin: 0 -2px; background: color-mix(in srgb, var(--dc) 60%, transparent); }
.p2-pcol-shaft { min-height: 78px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border-left: 1px solid color-mix(in srgb, var(--dc) 28%, transparent); border-right: 1px solid color-mix(in srgb, var(--dc) 28%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--dc) 14%, transparent), color-mix(in srgb, var(--card-2) 70%, transparent)); }
.p2-pcol-glyph { font-size: 12px; color: var(--dc); }
.p2-pcol-name { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.2; }
.p2-pcol-base { height: 9px; border-radius: 2px 2px 6px 6px; margin: 0 -2px; background: color-mix(in srgb, var(--dc) 42%, transparent); }
.p2-course-label { font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); text-align: center; margin: 6px 0 9px; }
.p2-course { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.p2-fblock { text-align: center; font-size: 11.5px; font-weight: 700; color: #d9bd92; line-height: 1.25;
  background: color-mix(in srgb, #C8A06A 14%, var(--card-2)); border: 1px solid color-mix(in srgb, #C8A06A 30%, transparent); border-radius: 9px; padding: 12px 8px; }
.p2-legend { font-size: 12.5px; color: var(--text-3); text-align: center; padding: 14px 18px 16px; border-top: 1px dashed var(--card-border); margin: 4px 0 0; }

/* section headers */
.p2-section-h { display: flex; align-items: baseline; gap: 12px; margin: 30px 0 16px; flex-wrap: wrap; }
.p2-kicker { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.p2-kicker-sub { font-size: 13px; color: var(--text-3); }
.p2-items { display: flex; flex-direction: column; gap: 16px; }

/* item cards */
.p2-item { padding: 22px 24px; border-left: 3px solid var(--dc); }
.p2-item-hd { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.p2-glyph { flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 15px;
  color: var(--dc); background: color-mix(in srgb, var(--dc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--dc) 30%, transparent); }
.p2-item-name { font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: var(--text); line-height: 1.2; }
.p2-item-note { font-size: 12px; color: var(--text-3); font-style: italic; margin-top: 2px; }
.p2-meaning { font-size: 14.5px; line-height: 1.62; color: var(--text-2); max-width: 80ch; margin-bottom: 18px; }
.p2-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 4px; }
.p2-block { margin-bottom: 16px; }
.p2-block-h { font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--dc); margin-bottom: 10px; }
.p2-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.p2-tag { font-size: 12px; font-weight: 500; color: var(--text); background: color-mix(in srgb, var(--dc) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--dc) 24%, transparent); border-radius: 100px; padding: 4px 11px; }
.p2-tag-tool { background: transparent; color: var(--text-2); border-color: var(--card-border); }
.p2-mgroup { font-size: 11px; font-weight: 700; color: var(--text-3); margin: 12px 0 7px; }
.p2-mgroup:first-child { margin-top: 0; }
.p2-mantra { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; line-height: 1.55; color: var(--text); margin-bottom: 7px; }
.p2-mantra-dot { flex-shrink: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--dc); margin-top: .55em; }
.p2-mantra-t { flex: 1; min-width: 0; }
.p2-by { color: var(--text-3); font-size: 12px; font-style: italic; }
.p2-item .os-item { margin-bottom: 6px; }
.p2-item .os-item-link { color: var(--dc); border-color: color-mix(in srgb, var(--dc) 32%, transparent); }
.p2-item .os-item-link:hover { background: color-mix(in srgb, var(--dc) 12%, transparent); }
.p2-sources { font-size: 11.5px; color: var(--text-3); font-style: italic; text-align: center; margin-top: 26px; line-height: 1.6; max-width: 760px; margin-left: auto; margin-right: auto; }

@media (max-width: 760px) {
  .p2-pillars { grid-template-columns: repeat(5, 1fr); gap: 5px; }
  .p2-pcol-name { font-size: 10px; }
  .p2-course { grid-template-columns: repeat(2, 1fr); }
  .p2-cols { grid-template-columns: 1fr; gap: 0; }
}

/* ============================================================
   Daily Tracking + Habits & Streaks
   ============================================================ */
/* Daily Tracking */
.trk-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 22px; align-items: start; }
.trk-count { font-size: 13px; font-weight: 700; color: var(--accent); }
.trk-list { display: flex; flex-direction: column; gap: 8px; }
.trk-row { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--card-border); transition: border-color .15s, background .15s; }
.trk-row.done { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.trk-check { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--card-border);
  background: transparent; color: transparent; font-size: 15px; cursor: pointer; transition: all .15s; }
.trk-check.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.trk-emoji { font-size: 20px; flex-shrink: 0; }
.trk-main { flex: 1; min-width: 0; }
.trk-name { font-size: 15.5px; font-weight: 600; color: var(--text); }
.trk-row.done .trk-name { color: var(--text-2); }
.trk-meta { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.trk-sub { font-size: 12.5px; color: var(--text-3); margin: -2px 0 12px; }
.trk-auto { font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c-blue);
  background: color-mix(in srgb, var(--c-blue) 14%, transparent); border-radius: 100px; padding: 2px 7px; margin-left: 8px; vertical-align: middle; }
.trk-health { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.trk-hi { background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 14px 16px; }
.trk-hi.has { border-color: color-mix(in srgb, var(--c-blue) 28%, transparent); }
.trk-hi-v { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.trk-hi:not(.has) .trk-hi-v { color: var(--text-3); }
.trk-hi-l { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.trk-jump { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; }
.trk-jump:hover { text-decoration: underline; }

/* Habits & Streaks */
.hb-setup { display: flex; flex-direction: column; gap: 8px; }
.hb-setup-row { display: flex; align-items: center; gap: 12px; padding: 11px 15px; border-radius: 12px; background: var(--card); border: 1px solid var(--card-border); }
.hb-setup-main { flex: 1; min-width: 0; }
.hb-setup-name { font-size: 15px; font-weight: 600; color: var(--text); }
.hb-setup-sched { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.hb-emoji { font-size: 20px; flex-shrink: 0; }
.hb-add { align-self: flex-start; margin-top: 4px; }
.hb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.hb-card { padding: 18px 20px; border-top: 3px solid var(--dc); }
.hb-card-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hb-card-t { flex: 1; min-width: 0; }
.hb-card-name { font-size: 16px; font-weight: 700; color: var(--text); }
.hb-card-sched { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.hb-today { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3);
  border: 1px solid var(--card-border); border-radius: 100px; padding: 3px 9px; white-space: nowrap; }
.hb-today.done { color: var(--dc); border-color: color-mix(in srgb, var(--dc) 40%, transparent); background: color-mix(in srgb, var(--dc) 12%, transparent); }
.hb-stat-row { display: flex; gap: 8px; margin-bottom: 16px; }
.hb-stat { flex: 1; text-align: center; background: var(--card-2); border: 1px solid var(--card-border); border-radius: 12px; padding: 11px 6px; }
.hb-stat-n { font-size: 24px; font-weight: 800; letter-spacing: -.03em; color: var(--dc); line-height: 1; }
.hb-stat-l { font-size: 10.5px; color: var(--text-3); margin-top: 4px; letter-spacing: .02em; }
.hb-grid-wrap { overflow-x: auto; padding-bottom: 2px; }
.hb-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; width: max-content; }
.hb-cell { width: 11px; height: 11px; border-radius: 3px; background: var(--card-2); }
.hb-cell.done { background: var(--dc); }
.hb-cell.miss { background: color-mix(in srgb, var(--c-red) 55%, transparent); }
.hb-cell.off { background: var(--card-border); opacity: .5; }
.hb-cell.today-open { background: transparent; box-shadow: inset 0 0 0 1.5px var(--dc); }
.hb-cell.pad { background: transparent; }
.hb-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 11px; color: var(--text-3); }
.hb-legend span { display: inline-flex; align-items: center; gap: 5px; }
.hb-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.hb-dot.done { background: var(--accent); } .hb-dot.miss { background: color-mix(in srgb, var(--c-red) 55%, transparent); } .hb-dot.off { background: var(--card-border); }

/* schedule day-picker in the habit modal */
.f-days { display: flex; gap: 5px; }
.f-day { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--card-border); background: transparent; color: var(--text-2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s; }
.f-day.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Active / Passive mode picker in the habit modal */
.f-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.f-mode-opt { text-align: left; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--card-border);
  background: transparent; color: var(--text-2); font: inherit; cursor: pointer; transition: all .15s; }
.f-mode-opt strong { display: block; font-size: 13.5px; color: var(--text); margin-bottom: 3px; }
.f-mode-opt span { display: block; font-size: 11.5px; line-height: 1.35; color: var(--text-3); }
.f-mode-opt:hover { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.f-mode-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.f-mode-opt.on strong { color: var(--accent); }

/* Active / Passive chip on rows + cards */
.hb-mode { display: inline-block; vertical-align: middle; margin-left: 8px; font-size: 9.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 100px; border: 1px solid var(--card-border); color: var(--text-3); }
.hb-mode.active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.hb-mode.passive { color: #d8a23a; border-color: color-mix(in srgb, #d8a23a 38%, transparent); background: color-mix(in srgb, #d8a23a 12%, transparent); }
.hb-today.miss { color: var(--c-red); border-color: color-mix(in srgb, var(--c-red) 40%, transparent); background: color-mix(in srgb, var(--c-red) 12%, transparent); }

/* Passive habit row in Daily Tracking — kept by default, tap to report a miss */
.trk-row.passive .trk-check.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.trk-row.passive.missed { border-color: color-mix(in srgb, var(--c-red) 40%, transparent); background: color-mix(in srgb, var(--c-red) 7%, var(--card)); }
.trk-check.passive.missed { background: var(--c-red); border-color: var(--c-red); color: #fff; }
.trk-row.passive.missed .trk-name { color: var(--text-2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--c-red) 60%, transparent); }

@media (max-width: 760px) { .trk-grid { grid-template-columns: 1fr; gap: 18px; } .hb-cards { grid-template-columns: 1fr; } }

/* ---- Status Check: header refresh button + async refresh screen ---- */
.sc-hero-actions { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.sc-updated { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.sc-refresh-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 50%; border: 1px solid var(--card-border); background: var(--card); color: var(--text-2);
  cursor: pointer; transition: color .15s, border-color .15s, background .15s, transform .15s; flex: none; }
.sc-refresh-btn svg { width: 18px; height: 18px; }
.sc-refresh-btn:hover { color: var(--accent); border-color: var(--accent); }
.sc-refresh-btn:active { transform: scale(.94); }
.sc-refresh-btn:disabled { cursor: default; opacity: .85; }
.sc-refresh-btn.spinning svg { animation: scSpin 1s linear infinite; }
.sc-refresh-btn.spinning { color: var(--accent); border-color: var(--accent); }
.sc-refresh-btn.flash-ok { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
@keyframes scSpin { to { transform: rotate(360deg); } }

.sc-refresh-screen { display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 64px 24px 72px; min-height: 360px; justify-content: center; }
.sc-refresh-orb { width: 76px; height: 76px; border-radius: 50%; margin-bottom: 26px; position: relative;
  background: radial-gradient(circle at 50% 50%, var(--accent-soft), transparent 70%); }
.sc-refresh-orb::before, .sc-refresh-orb::after { content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--accent); animation: scSpin 1.1s linear infinite; }
.sc-refresh-orb::after { inset: 12px; border-top-color: var(--accent); opacity: .5; animation-duration: 1.7s; animation-direction: reverse; }
.sc-refresh-title { font-size: 21px; font-weight: 650; margin: 0 0 8px; color: var(--text); }
.sc-refresh-msg { font-size: 15px; color: var(--text); margin: 0 0 20px; max-width: 460px; }
.sc-refresh-elapsed { font-size: 12.5px; color: var(--text-3); margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.sc-refresh-note { font-size: 13px; color: var(--text-2); margin: 22px 0 0; max-width: 440px; line-height: 1.5; }
.sc-refresh-steps { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 4px 0; }
.sc-step { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); }
.sc-step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); transition: background .2s, box-shadow .2s; }
.sc-step.active { color: var(--text); } .sc-step.active .sc-step-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: scPulse 1.2s ease-in-out infinite; }
.sc-step.done { color: var(--text-2); } .sc-step.done .sc-step-dot { background: var(--accent); }
.sc-step-sep { color: var(--text-3); font-size: 12px; }
@keyframes scPulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.sc-refresh-emoji { font-size: 38px; margin-bottom: 12px; }
.sc-refresh-actions { display: inline-flex; gap: 12px; align-items: center; margin-top: 22px; }
@media (max-width: 760px) { .sc-hero-actions { width: 100%; justify-content: flex-start; margin-top: 10px; } }

/* ============================================================
   Business Portal additions — nested nav sub-groups, portal
   switcher button, and the brand sub-label. Everything else is
   inherited verbatim from the personal hub's design system.
   ============================================================ */

/* second-level nav (e.g. Monitoring › Proactive Research › General/Competitive) */
.nav-subgroup { display: flex; flex-direction: column; margin-top: 3px; }
.nav-subgroup-header { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 7px 12px; border-radius: 10px; color: var(--text-3);
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  transition: background .18s ease, color .18s ease; }
.nav-subgroup-header:hover { color: var(--text-2); background: var(--accent-soft); }
.nav-subgroup-header > span { flex: 1; }
.nav-subgroup-header .nav-chev { width: 13px !important; height: 13px !important; }
.nav-subgroup.collapsed .nav-chev { transform: rotate(-90deg); }
.nav-subgroup-list { display: flex; flex-direction: column; gap: 2px;
  margin: 2px 0 2px 6px; padding-left: 9px; border-left: 1px solid var(--hairline); }
.nav-subgroup.collapsed .nav-subgroup-list { display: none; }
.nav-subgroup-list .nav-item { font-size: 13.5px; padding: 7px 11px; gap: 10px; }

/* brand sub-label so the portal reads "amor fati · Business" */
.brand-sub { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  background: var(--accent-soft); border-radius: 100px; padding: 2px 8px; margin-left: 2px; }

/* the nondescript portal-switch button (briefcase ↔ lifestyle) */
.portal-switch-row { display: flex; align-items: center; margin-top: 12px; }
.portal-switch { display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 11px; border: 1px solid var(--hairline); background: var(--card);
  color: var(--text-2); font-size: 17px; line-height: 1; cursor: pointer; text-decoration: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease; }
.portal-switch:hover { background: var(--accent-soft); color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent); transform: translateY(-1px); }
.portal-switch:active { transform: scale(.95); }

/* section sub-heads inside monitoring pages */
.bp-section { margin-top: 30px; }
.bp-section:first-of-type { margin-top: 8px; }
.bp-placeholder { color: var(--text-3); font-size: 14px; line-height: 1.6; }

/* ============================================================
   Monitoring UI — stat cards, channel pills, listening feed,
   review rollups & location lists. Built on the shared tokens.
   ============================================================ */
.bp-statgrid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.bp-stat { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-md);
  padding: 16px 16px 15px; box-shadow: var(--shadow); }
.bp-stat-n { font-size: 30px; font-weight: 800; letter-spacing: -.03em; color: var(--accent); line-height: 1; }
.bp-stat-n.sm { font-size: 17px; color: var(--text); }
.bp-stat-l { font-size: 11.5px; color: var(--text-3); margin-top: 6px; letter-spacing: .02em; }
.bp-sentbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--card-2); }
.bp-sentbar span { display: block; height: 100%; }
.bp-sentbar .pos { background: var(--c-green); } .bp-sentbar .neu { background: var(--text-3); }
.bp-sentbar .neg { background: var(--c-red); } .bp-sentbar .unr { background: var(--card-border); }
.bp-sentkey { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--text-2); }
.bp-sentkey span { display: inline-flex; align-items: center; gap: 5px; }

.sent-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.sent-dot.pos { background: var(--c-green); } .sent-dot.neg { background: var(--c-red); }
.sent-dot.neu { background: var(--text-3); } .sent-dot.unr { background: var(--card-border); }

.bp-chans { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.bp-chan { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2);
  border: 1px solid var(--card-border); border-radius: 100px; padding: 5px 11px; background: var(--card); }
.bp-chan i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.bp-chan em { font-style: normal; font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.bp-chan.live i { background: var(--c-green); box-shadow: 0 0 6px var(--c-green); } .bp-chan.live em { color: var(--c-green); }
.bp-chan.pending i { background: var(--c-yellow); } .bp-chan.pending em { color: var(--c-yellow); }
.bp-chan.err i { background: var(--c-red); } .bp-chan.err em { color: var(--c-red); }

.bp-brandlist { margin-top: 16px; border: 1px solid var(--card-border); border-radius: var(--r-md); overflow: hidden; }
.bp-brandrow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border-top: 1px solid var(--hairline); }
.bp-brandrow:first-child { border-top: 0; }
.bp-bdot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.bp-bname { flex: 1; font-weight: 600; font-size: 14.5px; }
.bp-bk { font-size: 13px; color: var(--text-2); width: 70px; text-align: right; } .bp-bk small { color: var(--text-3); }

.bp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.bp-chips.sub { margin-bottom: 16px; }
.bp-chip { font-size: 13px; padding: 6px 13px; border-radius: 100px; border: 1px solid var(--card-border);
  background: transparent; color: var(--text-2); cursor: pointer; transition: all .15s; }
.bp-chip:hover { color: var(--text); border-color: var(--text-3); }
.bp-chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

.bp-feed { display: flex; flex-direction: column; gap: 10px; }
.bp-mention { display: block; padding: 14px 16px; border-radius: var(--r-md); background: var(--card);
  border: 1px solid var(--card-border); text-decoration: none; color: inherit; transition: border-color .15s, transform .12s; }
.bp-mention:hover { border-color: color-mix(in srgb, var(--accent) 35%, transparent); transform: translateY(-1px); }
.bp-m-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 6px; }
.bp-m-brand { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft);
  border-radius: 6px; padding: 2px 7px; }
.bp-m-chan { font-size: 12px; color: var(--text-2); font-weight: 600; }
.bp-m-src { font-size: 12px; color: var(--text-3); } .bp-m-time { font-size: 12px; color: var(--text-3); margin-left: auto; }
.bp-m-title { font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--text); }
.bp-m-snip { font-size: 13px; color: var(--text-2); margin-top: 5px; line-height: 1.45; }

.bp-note { padding: 14px 16px; border-radius: var(--r-md); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text-2);
  font-size: 13.5px; line-height: 1.55; margin-bottom: 16px; }
.bp-note b { color: var(--text); } .bp-note code { font-size: 12.5px; background: var(--card-2); padding: 1px 6px; border-radius: 5px; color: var(--accent); }
.bp-note.err { background: color-mix(in srgb, var(--c-red) 10%, transparent); border-color: color-mix(in srgb, var(--c-red) 35%, transparent); }

.bp-revgrid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.bp-revb { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow); }
.bp-revb-name { font-size: 14px; font-weight: 700; }
.bp-revb-rate { font-size: 26px; font-weight: 800; color: var(--accent); margin: 6px 0 2px; display: flex; align-items: baseline; gap: 8px; }
.bp-revb-rate .na { color: var(--text-3); font-size: 22px; }
.bp-stars { color: var(--c-yellow); font-size: 14px; letter-spacing: 1px; }
.bp-revb-sub { font-size: 12px; color: var(--text-3); }

.bp-locgroup { margin-bottom: 18px; }
.bp-locgroup-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 8px; }
.bp-locgroup-h span { color: var(--accent); margin-left: 4px; }
.bp-loc { display: flex; align-items: center; gap: 14px; padding: 11px 15px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--card-border); margin-bottom: 6px; }
.bp-loc-main { flex: 1; min-width: 0; }
.bp-loc-name { font-weight: 600; font-size: 14px; }
.bp-loc-addr { font-size: 12px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-loc-rate { display: flex; align-items: center; gap: 10px; flex: none; }
.bp-rate { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.bp-rate b { color: var(--accent); font-size: 15px; } .bp-rate.na { color: var(--text-3); font-size: 13px; }
.bp-rate.na small { color: var(--text-3); }
.bp-loc-cnt { font-size: 12px; color: var(--text-3); min-width: 38px; text-align: right; }

.bp-review { padding: 13px 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--card-border); margin-bottom: 8px; }
.bp-rv-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 5px; }
.bp-rv-loc { font-size: 12.5px; color: var(--text-2); } .bp-rv-stars { color: var(--c-yellow); font-size: 13px; }
.bp-rv-auth { font-size: 12px; color: var(--text-3); margin-top: 4px; }

@media (max-width: 900px) { .bp-statgrid, .bp-revgrid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .bp-statgrid, .bp-revgrid { grid-template-columns: 1fr; } .bp-m-time { margin-left: 0; } }
