/* ==========================================================================
   Home: the Monthly File workspace (docs/design-system/home.md)
   Tokens only (styles/tokens.css). Loaded after theme.css and toolbar.css,
   scoped to #page-home / .hm / .mf, so nothing here reaches another page.
   The folder keeps its burgundy and the paper its parchment in both themes:
   paper elements carry data-theme="light" (tokens re-scope there) and the
   folder colours are the --mf-* values below.
   ========================================================================== */

/* ---- Layout: a 12-column grid with an intentional max width ---- */
#page-home .hm-shell { max-width: 1440px; padding-top: 4px; padding-bottom: 56px; }
.hm-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.hm-area-file    { grid-column: 1 / span 8; min-width: 0; }
.hm-area-side    { grid-column: 9 / span 4; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hm-area-week    { grid-column: 1 / -1; min-width: 0; }
.hm-area-metrics { grid-column: 1 / -1; min-width: 0; }
.hm-area-ai      { grid-column: 1 / span 8; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hm-area-status  { grid-column: 9 / span 4; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 1180px) {
  .hm-area-file, .hm-area-ai, .hm-area-status { grid-column: 1 / -1; }
  .hm-area-side {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: start;
  }
}
@media (max-width: 768px) {
  .hm-grid { gap: 16px; }
  .hm-area-side { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  #page-home .hm-shell { padding-bottom: 32px; }
}

/* ---- Shared pieces ---- */
.hm-card {
  background: var(--surface-raised);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-raised);
  padding: var(--card-padding);
  color: var(--text-primary);
}
.hm-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.hm-card__title { margin: 0; font-size: 16px; font-weight: var(--font-weight-bold); line-height: var(--line-height-title); letter-spacing: var(--tracking-title); color: var(--text-primary); }
.hm-kicker { margin: 0 0 4px; font-size: 11.5px; font-weight: 800; line-height: 1.3; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.hm-section-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 20px; margin-bottom: 16px; }
.hm-section-title { margin: 0; font-size: 18px; font-weight: var(--font-weight-heavy); line-height: 1.2; letter-spacing: var(--tracking-title); color: var(--text-primary); }
.hm-section-sub { margin: 4px 0 0; max-width: var(--measure); font-size: 13.5px; line-height: 1.5; color: var(--text-muted); }
.hm-textlink {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0; border: 0; background: none;
  font: 700 13.5px/1.2 var(--font-sans); color: var(--accent-text); text-decoration: none; cursor: pointer;
}
.hm-textlink:hover { text-decoration: underline; text-underline-offset: 4px; }
.hm-textlink svg { transition: translate var(--duration-base) var(--ease-standard); }
.hm-textlink:hover svg { translate: 3px 0; }
.hm-icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0;
  border: 1px solid var(--border-default); border-radius: var(--radius-pill); background: transparent;
  color: var(--text-secondary); cursor: pointer; transition: var(--transition-control);
}
.hm-icon-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.hm-count {
  min-width: 24px; height: 24px; padding: 0 8px; display: inline-grid; place-items: center;
  border-radius: var(--radius-pill); background: var(--accent-subtle); color: var(--accent-text);
  font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums;
}
#page-home :focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: var(--focus-ring-offset); }

/* Loading and error */
.hm-skel { border-radius: var(--radius-modal); }
.hm-skel--file { height: 460px; }
.hm-skel--side { height: 460px; border-radius: var(--radius-card); }
.hm-skel--week { height: 200px; border-radius: var(--radius-card); }
.hm-empty {
  padding: 32px; border: 1px dashed var(--border-strong); border-radius: var(--radius-card);
  background: var(--surface-raised); text-align: left;
}
.hm-empty--file { min-height: 280px; display: flex; flex-direction: column; justify-content: center; }
.hm-empty__title { margin: 0; font-size: 20px; font-weight: var(--font-weight-heavy); letter-spacing: var(--tracking-title); }
.hm-empty__text { margin: 8px 0 0; max-width: 46ch; color: var(--text-secondary); line-height: 1.5; }
.hm-empty__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 18px; }

/* ==========================================================================
   The Monthly File (ui/monthlyFile.js): folder, index tabs, brief, clip,
   stamp, pocket of index cards, pulled-out panel.
   ========================================================================== */
.mf {
  --mf-hi: #8C2727;
  --mf-mid: #7A1F1F;
  --mf-lo: #5E1616;
  --mf-deep: #451111;
  --mf-paper: #FBF8F1;
  --mf-paper-top: #FFFDF9;
  --mf-paper-lo: #F3EBDD;
  --mf-kraft: #D9CCB0;
  --mf-clip: #8E877D;
  --mf-tab-text: rgba(243, 238, 227, 0.74);
  position: relative;
  padding-top: 36px;
}
html.dark .mf {
  --mf-hi: #7A2224;
  --mf-mid: #661B1D;
  --mf-lo: #4C1315;
  --mf-deep: #330D0F;
  --mf-paper: #ECE4D3;
  --mf-paper-top: #F3EDE1;
  --mf-paper-lo: #E0D6C2;
  --mf-kraft: #CBBD9C;
  --mf-clip: #A79F94;
}

/* Index tabs = the planning periods */
.mf-tabs { position: absolute; top: 0; left: 0; z-index: 1; display: flex; gap: 4px; }
.mf-tab {
  height: 40px; padding: 0 20px; border: 0; border-radius: 12px 12px 0 0;
  background: var(--mf-deep); color: var(--mf-tab-text);
  font: 800 12px/1 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
  cursor: pointer; translate: 0 5px;
  transition: translate var(--duration-base) var(--ease-enter), background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.mf-tab.is-on { background: var(--mf-hi); color: #F3EEE3; translate: 0 0; cursor: default; }
.mf-tab:not(.is-on):hover { translate: 0 2px; color: #FFFFFF; background: var(--mf-lo); }
.mf .mf-tab:focus-visible { outline-offset: -4px; outline-color: #F3EEE3; }

.mf-folder {
  position: relative;
  padding: 24px 24px 0;
  border-radius: 0 var(--radius-modal) var(--radius-modal) var(--radius-modal);
  background: linear-gradient(160deg, var(--mf-hi), var(--mf-lo));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 22px 40px -22px rgba(69, 17, 17, 0.6), 0 3px 6px rgba(69, 17, 17, 0.22);
}
html.dark .mf-folder { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 22px 44px -18px rgba(0, 0, 0, 0.8); }

/* The brief: parchment, clipped, slightly askew; lifts on hover/focus */
.mf-sheet {
  position: relative; z-index: 1;
  margin: 0 8px -30px;
  padding: 26px 30px 56px;
  border-radius: 4px;
  background: linear-gradient(178deg, var(--mf-paper-top), var(--mf-paper) 55%, var(--mf-paper-lo));
  color: var(--text-primary);
  rotate: -0.5deg;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.04), 0 14px 26px rgba(30, 10, 10, 0.28);
  transition: translate 0.45s var(--ease-enter), rotate 0.45s var(--ease-enter), box-shadow 0.45s var(--ease-enter);
}
@media (hover: hover) {
  .mf:not(.is-open) .mf-sheet:hover { translate: 0 -6px; rotate: -1deg; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.04), 0 26px 36px -6px rgba(30, 10, 10, 0.34); }
}
.mf:not(.is-open) .mf-sheet:focus-within { translate: 0 -4px; rotate: -0.8deg; }
.mf-clip {
  position: absolute; z-index: 2; left: 14px; top: -20px; width: 26px; height: 64px;
  color: var(--mf-clip); filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.25)); pointer-events: none;
}
.mf-fields {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px;
  padding: 0 0 12px 24px; border-bottom: 1px solid var(--border-strong);
  font-size: 13px; line-height: 1.3; color: var(--text-muted);
}
.mf-fields b { color: var(--text-primary); font-weight: var(--font-weight-bold); letter-spacing: 0.02em; }
.mf-lead { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 13px; font-weight: var(--font-weight-bold); line-height: 1.3; color: var(--accent-text); }
.mf-headline {
  margin: 8px 0 0; max-width: 22em;
  font-family: var(--font-display); font-size: clamp(26px, 2.5vw, 36px); font-weight: var(--font-weight-heavy);
  line-height: 1.06; letter-spacing: -0.035em; text-wrap: balance; color: var(--text-primary);
}
.mf-sub { margin: 10px 0 0; max-width: 38em; font-size: 15.5px; line-height: 1.5; color: var(--text-secondary); text-wrap: pretty; }
.mf-progress { display: grid; gap: 6px; max-width: 440px; margin-top: 18px; }
.mf-progress__track { height: 8px; overflow: hidden; border-radius: var(--radius-pill); background: var(--surface-inset); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06); }
.mf-progress__track span { display: block; height: 100%; border-radius: inherit; background: var(--accent-fill); transition: width 0.6s var(--ease-enter); }
.mf[data-state="complete"] .mf-progress__track span { background: var(--success-solid); }
.mf-progress__label { font-size: 13px; font-weight: var(--font-weight-semibold); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.mf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.mf-chips__label { margin-right: 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.mf-none, .mf-more { font-size: 13px; color: var(--text-muted); }
.mf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 22px; }
.mf-actions .mf-cta { min-height: 44px; padding: 0 20px; font-size: 15px; }
.mf-textlink {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0; border: 0; background: none;
  font: 700 14.5px/1.2 var(--font-sans); color: var(--text-primary); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px;
}
.mf-textlink:hover { color: var(--accent-text); }

/* The stamp: only when every planned post is on the calendar. Lands once. */
.mf-stamp {
  position: absolute; right: 26px; bottom: 50px; z-index: 2;
  padding: 8px 14px 7px; border: 3px solid var(--success-text); border-radius: 6px;
  color: var(--success-text); font-size: 18px; font-weight: 900; line-height: 1; letter-spacing: 0.14em; text-transform: uppercase;
  rotate: -9deg; opacity: 0.88; mix-blend-mode: multiply; pointer-events: none;
}
.mf-stamp small { display: block; margin-top: 4px; font-size: 10px; font-weight: 800; letter-spacing: 0.24em; text-align: center; }
.mf-stamp.is-landing { animation: mf-stamp 0.5s 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.25) backwards; }
.mf-stamp.is-landing::after { content: ""; position: absolute; inset: -7px; border: 2px solid var(--success-text); border-radius: 9px; opacity: 0; animation: mf-ink 0.55s 0.55s ease-out; }

/* The pocket and the index cards */
.mf-pocket {
  position: relative; z-index: 2;
  margin: 0 -24px; padding: 54px 20px 20px;
  border-radius: 0 0 var(--radius-modal) var(--radius-modal);
  background: linear-gradient(180deg, var(--mf-hi), var(--mf-mid) 40%, var(--mf-lo));
  box-shadow: 0 -10px 22px rgba(40, 8, 8, 0.35), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
  clip-path: polygon(0 32px, 30% 0, 100% 0, 100% 100%, 0 100%);
}
.mf-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; background: none; }
.mf-cards > li { display: flex; min-width: 0; }
.mf-card {
  --y: 0px; --r: 0deg; --lift: 0px;
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  width: 100%; min-height: 136px; margin: 0; padding: 13px 14px 12px;
  border: 0; border-radius: var(--radius-control);
  background: var(--mf-paper); color: var(--text-primary);
  font: inherit; text-align: left; cursor: pointer;
  translate: 0 calc(var(--y) + var(--lift)); rotate: var(--r);
  box-shadow: 0 8px 16px rgba(30, 8, 8, 0.28);
  transition: translate 0.4s var(--ease-enter), rotate 0.4s var(--ease-enter), box-shadow 0.4s var(--ease-enter);
}
.mf-cards > li:nth-child(2) .mf-card { --y: -5px; --r: 0.7deg; }
.mf-cards > li:nth-child(3) .mf-card { background: var(--mf-kraft); }
.mf-cards > li:nth-child(4) .mf-card { --y: -3px; --r: -0.7deg; }
@media (hover: hover) {
  .mf-card:hover { --lift: -10px; box-shadow: 0 22px 30px -8px rgba(30, 8, 8, 0.45); }
  .mf-card:hover .mf-card__cue { color: var(--accent-text); rotate: 90deg; }
}
.mf-card:focus-visible { --lift: -10px; box-shadow: 0 22px 30px -8px rgba(30, 8, 8, 0.45); }
.mf .mf-card:focus-visible { outline-color: #F3EEE3; outline-offset: 3px; }
.mf-card[aria-expanded="true"] { --lift: -14px; }
.mf-card__kicker { font-size: 10.5px; font-weight: 800; line-height: 1.3; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.mf-card__title { padding-right: 20px; font-size: 16px; font-weight: var(--font-weight-heavy); line-height: 1.15; letter-spacing: -0.02em; }
.mf-card__text { font-size: 13px; line-height: 1.4; color: var(--text-secondary); }
.mf-card__foot { margin-top: auto; padding-top: 6px; font-size: 10.5px; font-weight: 800; line-height: 1.3; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.mf-cards > li:nth-child(3) .mf-card__foot { color: #4F483B; }
.mf-card__cue { position: absolute; top: 11px; right: 11px; color: var(--text-muted); transition: color var(--duration-fast) var(--ease-standard), rotate 0.4s var(--ease-enter); }

/* Mini month inside the calendar card */
.mf-cal--mini { display: grid; grid-template-columns: repeat(7, 7px); gap: 3px; margin: 4px 0 0; padding: 0; list-style: none; }
.mf-cal--mini .mf-dow { display: none; }
.mf-cal--mini .mf-day { width: 7px; height: 7px; min-height: 0; padding: 0; border: 0; border-radius: 2px; background: rgba(20, 20, 20, 0.1); }
.mf-cal--mini .mf-day i { display: none; }
.mf-cal--mini .mf-day.is-blank { background: transparent; }
.mf-cal--mini .mf-dot { display: block; width: 100%; height: 100%; border-radius: 2px; }
.mf-dot--s { background: var(--accent-fill); }
.mf-dot--p { background: var(--success-solid); }
.mf-dot--f { background: var(--danger-solid); }

/* The pulled-out panel */
.mf-scrim {
  position: absolute; inset: 0; z-index: 5;
  border-radius: 0 var(--radius-modal) var(--radius-modal) var(--radius-modal);
  background: rgba(20, 20, 20, 0.28); cursor: pointer;
}
.mf-scrim[hidden], .mf-panel[hidden] { display: none !important; }
.mf.is-open .mf-sheet { translate: none; }
.mf-panel {
  position: absolute; z-index: 6; top: 12px; left: 3%; right: 3%;
  max-height: calc(100% - 24px);
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px 24px 20px; overflow: auto; overscroll-behavior: contain;
  border-radius: var(--radius-card); background: var(--surface-raised); color: var(--text-primary);
  box-shadow: 0 30px 60px rgba(40, 10, 10, 0.38), 0 8px 18px rgba(40, 10, 10, 0.22);
  opacity: 0; translate: 0 14px;
  transition: opacity 0.25s linear, translate 0.4s var(--ease-enter);
}
.mf-panel.is-open { opacity: 1; translate: 0 0; }
.mf-panel__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: start; }
.mf-kicker { margin: 0; font-size: 11.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.mf-panel h3 { grid-column: 1; margin: 0; font-size: 22px; font-weight: var(--font-weight-heavy); line-height: 1.12; letter-spacing: -0.03em; }
.mf-panel h3:focus { outline: none; }
.mf-panel__close {
  grid-column: 2; grid-row: 1 / span 2; display: grid; place-items: center; width: 40px; height: 40px; margin: -6px -8px 0 0;
  border: 1px solid var(--border-default); border-radius: var(--radius-pill); background: transparent; color: var(--text-secondary); cursor: pointer;
}
.mf-panel__close:hover { background: var(--surface-hover); color: var(--text-primary); }
.mf-panel__body { display: grid; gap: 12px; }
.mf-panel__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 16px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.mf-facts { display: grid; margin: 0; padding: 0; list-style: none; }
.mf-facts li { display: grid; grid-template-columns: minmax(110px, 30%) minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); font-size: 14px; line-height: 1.45; }
.mf-facts li:last-child { border-bottom: 0; }
.mf-facts b { font-weight: var(--font-weight-bold); font-variant-numeric: tabular-nums; }
.mf-facts span { color: var(--text-secondary); overflow-wrap: anywhere; }
.mf-note { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text-muted); }
.mf-next { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 2px; border: 0; background: none; color: var(--accent-text); font: 700 14px/1.2 var(--font-sans); text-decoration: none; cursor: pointer; }
.mf-next:hover { text-decoration: underline; text-underline-offset: 4px; }
.mf-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.mf-dow { padding-bottom: 2px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-align: center; color: var(--text-muted); }
.mf-day { display: flex; flex-direction: column; gap: 3px; min-height: 46px; padding: 5px 6px; border: 1px solid var(--border-subtle); border-radius: 6px; background: var(--surface-overlay); }
.mf-day i { font-size: 11px; font-style: normal; font-weight: 700; line-height: 1.2; color: var(--text-muted); }
.mf-day.is-today { border-color: var(--accent-border); box-shadow: inset 0 0 0 1px var(--accent-border); }
.mf-day.is-today i { color: var(--accent-text); }
.mf-day.is-blank { border-color: transparent; background: transparent; }
.mf-bar { display: block; height: 5px; width: calc(var(--n, 1) * 25%); border-radius: 3px; }
.mf-bar--s { background: var(--accent-fill); }
.mf-bar--p { background: var(--success-solid); }
.mf-bar--f { background: var(--danger-solid); }
.mf-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-secondary); }
.mf-legend li::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; background: var(--c); }
.mf-legend__s { --c: var(--accent-fill); }
.mf-legend__p { --c: var(--success-solid); }
.mf-legend__f { --c: var(--danger-solid); }

/* Changing month: the new brief slides in from that side */
.mf.is-entering-next .mf-sheet { animation: mf-in-next 0.38s var(--ease-enter); }
.mf.is-entering-prev .mf-sheet { animation: mf-in-prev 0.38s var(--ease-enter); }
.mf.is-entering-next .mf-card, .mf.is-entering-prev .mf-card { animation: mf-fade 0.3s 0.08s linear backwards; }

@keyframes mf-in-next { from { opacity: 0; translate: 28px 0; rotate: 0.4deg; } }
@keyframes mf-in-prev { from { opacity: 0; translate: -28px 0; rotate: -1.4deg; } }
@keyframes mf-fade { from { opacity: 0; } }
@keyframes mf-stamp { 0% { opacity: 0; scale: 1.8; rotate: -20deg; } 62% { opacity: 1; scale: 0.93; } 100% { scale: 1; } }
@keyframes mf-ink { 0% { opacity: 0.5; scale: 0.92; } 100% { opacity: 0; scale: 1.4; } }

@media (max-width: 900px) {
  .mf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mf-card { min-height: 120px; }
}
@media (max-width: 560px) {
  .mf { padding-top: 34px; }
  .mf-tab { height: 38px; padding: 0 14px; font-size: 11.5px; }
  .mf-folder { padding: 16px 12px 0; }
  .mf-sheet { margin: 0 2px -28px; padding: 22px 18px 50px; rotate: -0.3deg; }
  .mf-fields { padding-left: 30px; }
  .mf-fields__brand { display: none; }
  .mf-actions { flex-direction: column; align-items: stretch; }
  .mf-actions .mf-cta { justify-content: center; }
  .mf-actions .mf-textlink { align-self: flex-start; }
  .mf-stamp { right: 14px; bottom: 40px; font-size: 14px; }
  .mf-pocket { margin: 0 -12px; padding: 46px 12px 12px; }
  .mf-cards { gap: 8px; }
  .mf-card { padding: 11px 12px 10px; }
  .mf-card__title { font-size: 15px; }
  .mf-panel { left: 2%; right: 2%; padding: 18px 16px 16px; }
  .mf-facts li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .mf-day { min-height: 38px; padding: 3px 4px; }
}

/* ==========================================================================
   First-month guide (data-testid onboarding-banner)
   ========================================================================== */
#page-home .hm-guide { margin: 0; padding: 20px; }
.hm-guide__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
#page-home .hm-guide .gs-firstrun__title { margin: 0; font-size: 18px; color: var(--text-primary); }
.hm-guide__meter { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.hm-guide__meter .getting-started-track { flex: 1; height: 6px; border-radius: var(--radius-pill); background: var(--surface-inset); overflow: hidden; }
.hm-guide__meter .getting-started-fill { height: 100%; border-radius: inherit; background: var(--accent-fill); }
.hm-guide__meter .getting-started-progress { font-size: 12.5px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
#page-home .hm-guide__list { grid-template-columns: minmax(0, 1fr); gap: 2px; }
#page-home .hm-guide .gs-row { padding: 7px 8px; }
#page-home .hm-guide .gs-row__label { color: var(--text-primary); font-size: 14px; }
#page-home .hm-guide .gs-row--done .gs-row__label { color: var(--text-muted); }
#page-home .hm-guide .gs-row--done .gs-row__mark { background: var(--success-solid); color: #FFFFFF; }
#page-home .hm-guide .gs-row--next { border-color: var(--accent-border); background: var(--accent-subtle); }
#page-home .hm-guide .gs-row__desc { color: var(--text-secondary); }
#page-home .hm-guide .gs-firstrun__next { margin-top: 14px; }
#page-home .hm-guide .gs-firstrun__next .btn { width: 100%; justify-content: center; }

/* ==========================================================================
   Attention center: clipped notes, one per actionable issue
   ========================================================================== */
.hm-attention.is-compact .hm-allclear { margin-bottom: 0; }
.hm-allclear { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 4px; font-size: 14px; line-height: 1.45; color: var(--text-secondary); }
.hm-allclear svg { flex: none; margin-top: 1px; color: var(--success-text); }
.hm-notes { display: grid; gap: 10px; margin: 0 0 10px; padding: 0; list-style: none; }
.hm-note {
  --tone: var(--neutral-solid);
  position: relative; padding: 12px 14px 12px 16px;
  border: 1px solid var(--border-subtle); border-left: 3px solid var(--tone); border-radius: 8px;
  background: var(--surface-overlay);
}
.hm-note[data-tone="danger"]  { --tone: var(--danger-solid); }
.hm-note[data-tone="warning"] { --tone: var(--warning-solid); }
.hm-note[data-tone="accent"]  { --tone: var(--accent); }
.hm-note[data-tone="info"]    { --tone: var(--info-solid); }
.hm-note__title { margin: 0; font-size: 14px; font-weight: var(--font-weight-bold); line-height: 1.4; color: var(--text-primary); text-wrap: pretty; }
.hm-note__text { margin: 4px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--text-secondary); }
.hm-note__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.hm-note__more {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; margin-left: auto; padding: 0 4px;
  border: 0; background: none; color: var(--text-muted); font: 600 12.5px/1 var(--font-sans); cursor: pointer;
}
.hm-note__more:hover { color: var(--text-primary); }
.hm-note__more svg { transition: rotate var(--duration-base) var(--ease-standard); }
.hm-note__more[aria-expanded="true"] svg { rotate: 180deg; }
.hm-note__detail { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-default); }
.hm-note__detail:not([hidden]) { animation: mf-fade 0.2s linear; }
.hm-note__meta { margin: 0 0 6px; font-size: 12.5px; color: var(--text-muted); }
.hm-note__posts { display: grid; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.hm-note__posts li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; }
.hm-note__posts span:not(.lib-plat):not(.lib-plat span) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.hm-note__posts time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.hm-history { margin: 10px 0 0; padding-top: 10px; border-top: 1px dashed var(--border-default); font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }
.hm-history .hm-textlink { min-height: 0; font-size: 12.5px; }

/* ==========================================================================
   The week ahead (data-testid dashboard-upcoming)
   ========================================================================== */
.hm-week .hm-section-head { margin-bottom: 14px; }
.hm-week__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.hm-day { min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 8px; background: var(--surface-inset); }
.hm-day__head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin: 0; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.hm-day__head small { font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.hm-day.is-today .hm-day__head span { color: var(--accent-text); }
.hm-day__posts { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.hm-day__none { margin: 0; font-size: 13px; color: var(--text-disabled); }
.hm-post {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; min-width: 0;
  padding: 8px 9px; border: 1px solid var(--border-subtle); border-radius: 7px;
  background: var(--surface-overlay); color: var(--text-primary); font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 1px 1px rgba(30, 10, 10, 0.05);
  transition: translate var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.hm-post:hover { translate: 0 -2px; border-color: var(--border-control); box-shadow: var(--shadow-raised); }
.hm-post.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.hm-post.is-flagged { border-left: 3px solid var(--danger-solid); }
.hm-post__top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.hm-post__top time { font-size: 12px; font-weight: var(--font-weight-bold); font-variant-numeric: tabular-nums; }
.hm-post__top .lib-plat span { display: none; }
.hm-post__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.hm-post__flag { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--danger-text); }
.hm-post__camp { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--text-muted); }
.hm-week__empty { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 24px; align-items: center; }
.hm-week__art { width: 120px; height: 64px; color: var(--border-control); }
.hm-week__empty-title { margin: 0; font-size: 16px; font-weight: var(--font-weight-bold); }
.hm-week__empty-text { margin: 4px 0 0; max-width: 56ch; font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.hm-week__empty-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; }
.hm-later { grid-column: 1 / -1; padding-top: 12px; border-top: 1px dashed var(--border-default); }
.hm-later__title { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.hm-later ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.hm-later__row { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 4px 8px; border: 0; border-radius: 6px; background: none; color: var(--text-primary); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.hm-later__row:hover { background: var(--surface-hover); }
.hm-later__row time { font-weight: var(--font-weight-bold); white-space: nowrap; }
.hm-later__row span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }

@media (max-width: 1023px) {
  .hm-week__days { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .hm-day { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: start; gap: 8px 12px; padding: 8px 10px; }
  .hm-day__head { flex-direction: column; align-items: flex-start; gap: 2px; padding-top: 6px; }
  .hm-day__posts { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .hm-day.is-quiet { padding-top: 4px; padding-bottom: 4px; }
  .hm-day.is-quiet .hm-day__head { flex-direction: row; gap: 8px; padding-top: 0; }
  .hm-day__none { padding-top: 2px; }
}
@media (max-width: 560px) {
  .hm-day { grid-template-columns: minmax(0, 1fr); }
  .hm-day__head { flex-direction: row; padding-top: 0; }
  .hm-day__posts { grid-template-columns: minmax(0, 1fr); }
  .hm-week__empty { grid-template-columns: minmax(0, 1fr); }
  .hm-week__art { display: none; }
  .hm-day.is-quiet { display: flex; align-items: center; justify-content: space-between; }
  .hm-day.is-quiet .hm-day__head { gap: 8px; }
  .hm-day.is-quiet .hm-day__none { padding: 0; }
}

/* ==========================================================================
   Metrics: secondary, each with its definition and date range
   ========================================================================== */
.hm-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.hm-metrics > li { display: flex; min-width: 0; }
.hm-metric {
  --tone: transparent;
  display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 14px 16px;
  border: 1px solid var(--border-subtle); border-top: 3px solid var(--tone); border-radius: var(--radius-card);
  background: var(--surface-raised); color: var(--text-primary); text-decoration: none;
  transition: translate var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.hm-metric:hover { translate: 0 -2px; border-color: var(--border-control); border-top-color: var(--tone); box-shadow: var(--shadow-raised); }
.hm-metric[data-tone="danger"] { --tone: var(--danger-solid); }
.hm-metric[data-tone="success"] { --tone: var(--success-solid); }
.hm-metric[data-tone="accent"] { --tone: var(--accent); }
.hm-metric__label { font-size: 12.5px; font-weight: var(--font-weight-bold); color: var(--text-secondary); }
.hm-metric__value { font-size: 30px; font-weight: var(--font-weight-heavy); line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hm-metric[data-tone="danger"] .hm-metric__value { color: var(--danger-text); }
.hm-metric__def { font-size: 12.5px; line-height: 1.35; color: var(--text-secondary); }
.hm-metric__foot { margin-top: auto; padding-top: 6px; font-size: 12px; line-height: 1.35; color: var(--text-muted); }
@media (max-width: 1180px) { .hm-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .hm-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hm-metric { padding: 12px; }
  .hm-metric__value { font-size: 26px; }
}

/* ==========================================================================
   Work with your AI: copyable prompts (MCP) or Studio actions (own key)
   ========================================================================== */
.hm-ai__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.hm-ai__actions .btn svg { margin-right: 6px; }
.hm-ai__note { margin: -6px 0 14px; padding: 10px 12px; border-radius: 8px; background: var(--warning-subtle); font-size: 13px; color: var(--text-secondary); }
.hm-prompts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.hm-prompts > li { display: flex; min-width: 0; }
.hm-prompt {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%;
  padding: 14px 16px; border: 1px solid var(--border-subtle); border-radius: 8px;
  background: var(--surface-overlay); color: var(--text-primary); font: inherit; text-align: left; text-decoration: none;
}
.hm-prompt--link { cursor: pointer; transition: border-color var(--duration-fast) var(--ease-standard), translate var(--duration-fast) var(--ease-standard); }
.hm-prompt--link:hover { border-color: var(--border-control); translate: 0 -2px; }
.hm-prompt__title { padding-right: 20px; font-size: 14.5px; font-weight: var(--font-weight-bold); line-height: 1.3; }
.hm-prompt__why { font-size: 13px; line-height: 1.4; color: var(--text-muted); }
.hm-prompt__go { position: absolute; top: 14px; right: 14px; color: var(--accent-text); }
.hm-prompt__text { width: 100%; margin-top: 4px; font-size: 12.5px; }
.hm-prompt__text summary { display: inline-flex; min-height: 28px; align-items: center; color: var(--text-secondary); font-weight: 600; cursor: pointer; }
.hm-prompt__text p { margin: 6px 0 0; padding: 10px 12px; border-radius: 6px; background: var(--surface-inset); line-height: 1.5; color: var(--text-secondary); }
.hm-prompt__copy { margin-top: 8px; }
.hm-prompt__copy svg { margin-right: 6px; }
@media (max-width: 640px) { .hm-prompts { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Workspace status (data-testid dashboard-checklist) and quick actions
   ========================================================================== */
.hm-status { padding-bottom: 12px; }
.hm-status__details > summary { list-style: none; cursor: pointer; margin-bottom: 4px; }
.hm-status__details > summary::-webkit-details-marker { display: none; }
.hm-status__details:not([open]) > summary { margin-bottom: 0; }
.hm-status__chev { display: grid; place-items: center; color: var(--text-muted); transition: rotate var(--duration-base) var(--ease-standard); }
.hm-status__details[open] .hm-status__chev { rotate: 180deg; }
.hm-status__list { margin: 0; padding: 0; list-style: none; }
.hm-stat { --tone: var(--neutral-solid); }
.hm-stat[data-tone="ok"] { --tone: var(--success-solid); }
.hm-stat[data-tone="attention"] { --tone: var(--warning-solid); }
.hm-stat[data-tone="accent"] { --tone: var(--accent); }
.hm-stat[data-tone="danger"] { --tone: var(--danger-solid); }
.hm-stat__link {
  display: grid; grid-template-columns: 8px auto minmax(0, 1fr); align-items: baseline; gap: 2px 10px;
  padding: 8px 4px; border-bottom: 1px solid var(--border-subtle); border-radius: 4px;
  color: var(--text-primary); text-decoration: none;
}
.hm-status__list li:last-child .hm-stat__link { border-bottom: 0; }
.hm-stat__link:hover { background: var(--surface-hover); }
.hm-stat__dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--tone); translate: 0 -1px; }
.hm-stat__label { font-size: 13.5px; font-weight: var(--font-weight-semibold); white-space: nowrap; }
.hm-stat__value { font-size: 13px; font-weight: var(--font-weight-bold); text-align: right; color: var(--text-secondary); }
.hm-stat__note { grid-column: 2 / -1; font-size: 12px; line-height: 1.4; color: var(--text-muted); }
.hm-quick .hm-card__title { margin-bottom: 10px; }
.hm-quick__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.hm-quick__item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-control);
  background: var(--surface-overlay); color: var(--text-primary); font: 600 13.5px/1.25 var(--font-sans); text-align: left; text-decoration: none; cursor: pointer;
  transition: var(--transition-control);
}
.hm-quick__item svg { flex: none; color: var(--accent-text); }
.hm-quick__item:hover { border-color: var(--border-control); background: var(--surface-hover); }

/* ---- Reduced motion: no movement, nothing waits on an animation ---- */
@media (prefers-reduced-motion: reduce) {
  #page-home *, #page-home *::before, #page-home *::after { animation: none !important; transition: none !important; }
  .mf-sheet, .mf:not(.is-open) .mf-sheet:hover, .mf:not(.is-open) .mf-sheet:focus-within { translate: none !important; rotate: -0.5deg !important; }
  .mf-card, .mf-card:hover, .mf-card:focus-visible, .mf-card[aria-expanded="true"] { --lift: 0px !important; }
  .hm-post:hover, .hm-metric:hover, .hm-prompt--link:hover { translate: none; }
}
