/* ==========================================================================
   Design system (docs/DESIGN.md). Everything new uses these tokens; older rules move to them over time.
   ========================================================================== */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-sm: 12px; --r-md: 18px; --r-lg: 24px;
  --shadow-1: 0 1px 2px rgba(34, 28, 41, 0.05), 0 6px 18px rgba(34, 28, 41, 0.06);
  --shadow-2: 0 2px 4px rgba(34, 28, 41, 0.06), 0 16px 40px rgba(34, 28, 41, 0.12);
  --t-title: 28px; --t-h2: 20px; --t-body: 16px; --t-small: 14px; --t-caption: 12px;
  /* Colour jobs: one meaning each, the same everywhere. */
  --job-hot: var(--rose);     /* today, urgent */
  --job-warm: var(--amber);   /* soon, gold rank, streaks */
  --job-calm: var(--teal);    /* done, saved, in order */
  --job-new: var(--violet);   /* new, to discover */
  --job-sky: var(--sky);      /* reading, information */
}
@media (prefers-color-scheme: dark) {
  :root { --shadow-1: 0 0 0 1px rgba(255, 255, 255, 0.05); --shadow-2: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 16px 40px rgba(0, 0, 0, 0.35); }
}
.tone-hot { --tone: var(--job-hot); }
.tone-warm { --tone: var(--job-warm); }
.tone-calm { --tone: var(--job-calm); }
.tone-new { --tone: var(--job-new); }
.tone-sky { --tone: var(--job-sky); }
.tone-neutral { --tone: var(--muted); }

.i { display: block; flex: none; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--job-new); outline-offset: 2px; }

/* Header: the letter in the corner opens Me */
.me-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(145deg, color-mix(in srgb, var(--job-new) 80%, #fff), var(--job-new));
  color: #fff; font-weight: 800; font-size: 16px; text-decoration: none; box-shadow: var(--shadow-1);
}
.me-btn:active { transform: scale(0.94); }

/* Tab bar with line icons */
.tab-icon { filter: none; opacity: 1; line-height: 0; font-size: 0; height: 24px; display: grid; place-items: center; }
.tab .i { width: 22px; height: 22px; stroke-width: 1.8; }
.tab.is-active { background: color-mix(in srgb, var(--job-new) 12%, var(--surface)); color: color-mix(in srgb, var(--job-new) 75%, var(--text)); }
.tab.is-active .i { stroke-width: 2.3; }
.tab:active { transform: scale(0.95); }

/* Today: the one "what now?" card */
.now-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1);
  padding: var(--s5) var(--s5) var(--s5); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--tone) 16%, var(--surface)), var(--surface) 62%);
}
.now-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: var(--s3); border-radius: var(--r-md); background: color-mix(in srgb, var(--tone) 16%, var(--surface)); color: color-mix(in srgb, var(--tone) 80%, var(--text)); }
.now-card .eyebrow { color: color-mix(in srgb, var(--tone) 70%, var(--text)); }
.now-title { font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.now-cta { margin-top: var(--s4); min-height: 52px; padding: 0 var(--s5); font-size: 16px; }

.glance-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s2); }
.glance-tile {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: var(--s3) var(--s2) var(--s3) var(--s3);
  border: none; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1);
  color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer; transition: transform 0.12s;
}
.glance-tile:active { transform: scale(0.96); }
.glance-top { display: flex; align-items: center; gap: 5px; color: color-mix(in srgb, var(--tone) 80%, var(--text)); }
.glance-top b { font-size: 17px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glance-top b small { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 1px; }
.glance-label { font-size: var(--t-caption); font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-more .energy { box-shadow: none; padding: var(--s2) 0 0; background: transparent; }

/* Area pages: tiles that open the screens of an area */
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.hub-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; align-items: center; }
.hub-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); min-width: 0;
  padding: var(--s4); border: none; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1);
  color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer; transition: transform 0.12s;
}
.hub-tile:active { transform: scale(0.97); }
.hub-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--r-sm); background: color-mix(in srgb, var(--tone, var(--muted)) 13%, var(--surface)); color: color-mix(in srgb, var(--tone, var(--muted)) 85%, var(--text)); }
.hub-tile.tone-neutral .hub-icon { background: var(--surface-2); color: var(--text); }
.hub-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hub-text strong { font-size: 15px; }
.hub-text .small { font-size: 13px; line-height: 1.3; }
.hub-count { position: absolute; top: var(--s3); right: var(--s3); min-width: 26px; height: 26px; padding: 0 8px; display: grid; place-items: center; border-radius: 99px; background: var(--tone); color: #fff; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hub-tile.tone-neutral .hub-count { background: var(--surface-2); color: var(--text); }
.hub-feature { display: flex; align-items: center; gap: var(--s4); padding: var(--s4); text-decoration: none; color: var(--text); background: linear-gradient(120deg, color-mix(in srgb, var(--job-new) 9%, var(--surface)), color-mix(in srgb, var(--job-warm) 10%, var(--surface))); }
.hub-feature .chevron { color: var(--muted); }
.hub-feature-fan { position: relative; width: 48px; height: 50px; flex: none; }
.hub-feature-fan i { position: absolute; left: 13px; top: 5px; width: 24px; height: 34px; border-radius: 6px; box-shadow: 0 2px 6px rgba(34, 28, 41, 0.18); transform-origin: 50% 110%; }
.hub-feature-fan i:nth-child(1) { background: var(--job-hot); transform: rotate(-18deg); }
.hub-feature-fan i:nth-child(2) { background: var(--job-warm); }
.hub-feature-fan i:nth-child(3) { background: var(--job-new); transform: rotate(18deg); }

/* Pressed states everywhere */
.card[href]:active, a.card:active, button.card:active { transform: scale(0.985); }

/* Older screens on the design system: inline icons next to text, toned counters, section headings */
.inline-ic { display: inline-flex; align-items: center; gap: 5px; }
.hub-icon.tone-hot { --tone: var(--job-hot); }
.hub-icon.tone-warm { --tone: var(--job-warm); }
.hub-icon.tone-calm { --tone: var(--job-calm); }
.hub-icon.tone-new { --tone: var(--job-new); }
.hub-icon.tone-sky { --tone: var(--job-sky); }
.sheet-head .hub-icon { width: 44px; height: 44px; }
.goal .bar { --tone: var(--job-calm); }
.tl-icon .i, .ov-icon .i { stroke-width: 1.8; }
.sec-head .section-title { margin: 0; }
.sec-link { display: inline-flex; align-items: center; gap: 2px; }

/* ==========================================================================
   The bell: what home is telling her (C157). Beside the Me letter, never on the tabs; its number is
   violet ("new"), not rose - news from home, not an alarm.
   ========================================================================== */
.bell-btn {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); color: var(--muted); box-shadow: var(--shadow-1); text-decoration: none;
  transition: transform 0.12s;
}
.bell-btn.has-some { color: color-mix(in srgb, var(--job-new) 80%, var(--text)); }
.bell-btn:active { transform: scale(0.94); }
.bell-count {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center; background: var(--job-new); color: #fff; box-shadow: 0 0 0 2px var(--surface);
  font-size: 11px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
}

.notices { display: flex; flex-direction: column; gap: var(--s2); }
.notices-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin: 0 2px; }
.notice { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); }
.notice-head { display: flex; align-items: center; gap: var(--s3); }
.notice-head strong { line-height: 1.25; }
.notice-body { margin: 0; white-space: pre-line; font-size: var(--t-small); line-height: 1.45; }
.notice-open {
  display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 0; border: none; background: none;
  color: color-mix(in srgb, var(--job-new) 80%, var(--text)); font: inherit; font-size: var(--t-small); font-weight: 700; cursor: pointer;
}
.notice-open:active { transform: scale(0.97); }
.notice-buttons { display: flex; flex-wrap: wrap; gap: var(--s2); }
.notice-reply { display: flex; gap: var(--s2); }
.notice-reply input {
  flex: 1; min-width: 0; min-height: 40px; padding: 0 var(--s3); border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: var(--t-small);
}
.notice-reply input:focus { outline: none; border-color: var(--job-new); }
.notice-hint { margin-top: var(--s2); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1); }

.from-home { display: flex; flex-direction: column; gap: var(--s2); }
.from-home p { margin: 0; line-height: 1.5; }
.note-tick { display: flex; align-items: center; gap: var(--s2); list-style: none; }
.note-tick .i { color: var(--muted); }
.note-tick.is-done { color: var(--muted); text-decoration: line-through; }
.note-tick.is-done .i { color: var(--job-calm); }

@media (prefers-reduced-motion: reduce) {
  .bell-btn, .notice-open { transition: none; }
  .bell-btn:active, .notice-open:active { transform: none; }
}

