/* Home (#/): screen-only styles (D88, spec §4.1).
   Tokens only (no raw colour values), every selector under .scr-home, and the
   shared components in style.css are reused wherever they fit. Phone = 640px. */

/* ------------------------------------------------------------------ rhythm */
/* the page is built from regions that repaint on their own; spacing lives here */
.scr-home > .hm-region:empty { display: none; }
.scr-home > .hm-region:not(:empty) ~ .hm-region:not(:empty) { margin-top: var(--s7); }
.scr-home .page-head { margin-bottom: 0; }
.scr-home .hm-region > .section { margin-top: 0; }
@media (max-width: 640px) {
  .scr-home > .hm-region:not(:empty) ~ .hm-region:not(:empty) { margin-top: var(--s6); }
}

/* ------------------------------------------------------------------ head */
.scr-home .hm-batch { margin: 0 0 var(--s4); }
.scr-home .hm-batch + .answer { margin-top: 0; }
.scr-home .answer .up, .scr-home .answer .down { font-variant-numeric: lining-nums; }
.scr-home .answer a { color: var(--crowd); }

/* the stopped state: the answer sentence IS the banner (spec §4.1) */
.scr-home .hm-stop {
  display: flex; align-items: center; gap: var(--s4); padding: var(--s5) var(--s5);
  border-radius: var(--r-panel); border: 1px solid color-mix(in srgb, var(--attention) 45%, transparent);
  background: color-mix(in srgb, var(--attention) 10%, var(--surface));
}
.scr-home .hm-stop-ico { display: inline-flex; flex: none; color: var(--attention); align-self: flex-start; margin-top: 4px; }
.scr-home .hm-stop .hm-stop-text { flex: 1; min-width: 0; max-width: none; font-size: 26px; line-height: 1.25; }
.scr-home .hm-stop-btn { flex: none; }
.scr-home .hm-stop + .figures { margin-top: var(--s6); }
@media (max-width: 640px) {
  .scr-home .hm-stop { flex-wrap: wrap; gap: var(--s3); padding: var(--s4); }
  .scr-home .hm-stop .hm-stop-text { flex-basis: calc(100% - 40px); font-size: 22px; }
  .scr-home .hm-stop-btn { width: 100%; }
}

/* ------------------------------------------------------------------ needs your attention */
.scr-home .hm-attn-list { border-color: color-mix(in srgb, var(--attention) 40%, var(--line)); }
.scr-home .hm-attn-list .row { min-height: 52px; }
.scr-home .hm-attn-ico { display: inline-flex; color: var(--attention); }
.scr-home .hm-attn-list .row-title { font-weight: 400; }
.scr-home .hm-attn-sub { display: block; margin-top: 2px; color: var(--text-2); font-size: var(--fs-small); }
.scr-home .hm-fig-q { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.scr-home .hm-attn-list .row-key { font-weight: 500; }
.scr-home .hm-attn-go { display: inline-flex; align-items: center; gap: 2px; color: var(--text-2); font-size: var(--fs-small); }
.scr-home .hm-attn-list a.row:hover .hm-attn-go { color: var(--text); }
@media (max-width: 640px) {
  .scr-home .hm-attn-list .row { grid-template-columns: max-content minmax(0, 1fr) auto;
    grid-template-areas: "meta title key"; column-gap: var(--s3); align-items: start; }
  .scr-home .hm-attn-list .row-meta { padding-top: 2px; }
  .scr-home .hm-attn-go { font-size: var(--fs-micro); }
}

/* ------------------------------------------------------------------ today: the timeline */
/* dot geometry: the line runs through every dot's centre */
.scr-home .tl { --dot: 20px; --lbl: 20px; --pad: 6px;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none;
  margin: calc(-1 * var(--s2)) 0 0; }
.scr-home .tl::-webkit-scrollbar { display: none; }
.scr-home .tl-in { position: relative; display: grid; grid-template-columns: repeat(var(--n, 12), minmax(52px, 1fr));
  padding-top: var(--lbl); }
.scr-home .tl-line { position: absolute; height: 2px; background: var(--line-2); border-radius: 1px;
  top: calc(var(--lbl) + var(--pad) + var(--dot) / 2 - 1px);
  left: calc(50% / var(--n, 12)); right: calc(50% / var(--n, 12)); }
.scr-home .tl-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--pad) 2px var(--s2); margin: 0 2px; border: 0; border-radius: var(--r-nested); background: none;
  color: var(--text-2); font: inherit; cursor: pointer; text-decoration: none; min-width: 0; }
.scr-home .tl-slot:hover { text-decoration: none; background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.scr-home .tl-slot.is-sel { background: var(--surface-2); }
.scr-home .tl-slot:focus-visible { outline-offset: 0; }
.scr-home .tl-dot { position: relative; z-index: 1; width: var(--dot); height: var(--dot); border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center; color: var(--bg);
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--text-3), 0 0 0 3px var(--surface); }
.scr-home .tl-slot.is-sel .tl-dot { box-shadow: inset 0 0 0 1.5px var(--text-3), 0 0 0 3px var(--surface-2); }
.scr-home .tl-dot svg { display: block; }
.scr-home .tl-time { font-size: var(--fs-small); line-height: 1.2; color: var(--text-2); white-space: nowrap; }
.scr-home .tl-day { font-size: var(--fs-micro); line-height: 1; color: var(--text-3); min-height: 12px; white-space: nowrap; }
.scr-home .tl-slot.is-sel .tl-time, .scr-home .tl-slot.is-now .tl-time { color: var(--text); font-weight: 600; }
.scr-home .tl-now { position: absolute; top: calc(-1 * var(--lbl) + 2px); left: 50%; transform: translateX(-50%);
  font-size: var(--fs-micro); line-height: 1; color: var(--crowd); font-weight: 600; white-space: nowrap; }
.scr-home .tl-slot.is-held .tl-now { color: var(--attention); }

/* states (spec §4.1 table). Filled dots carry a glyph, hollow ones a ring. */
.scr-home .st-bought > .tl-dot, .scr-home .tl-mini.st-bought { background: var(--up); }
.scr-home .st-waiting > .tl-dot, .scr-home .tl-mini.st-waiting { background: var(--market); }
.scr-home .st-passed > .tl-dot, .scr-home .tl-mini.st-passed { background: var(--text-3); }
.scr-home .st-error > .tl-dot, .scr-home .tl-mini.st-error { background: var(--down); }
.scr-home .st-skipped > .tl-dot, .scr-home .tl-mini.st-skipped { background: var(--attention); }
.scr-home .st-running > .tl-dot, .scr-home .tl-mini.st-running { background: var(--crowd); }
.scr-home .st-bought > .tl-dot, .scr-home .st-waiting > .tl-dot, .scr-home .st-passed > .tl-dot,
.scr-home .st-error > .tl-dot, .scr-home .st-skipped > .tl-dot, .scr-home .st-running > .tl-dot {
  box-shadow: 0 0 0 3px var(--surface); }
.scr-home .tl-slot.is-sel.st-bought > .tl-dot, .scr-home .tl-slot.is-sel.st-waiting > .tl-dot,
.scr-home .tl-slot.is-sel.st-passed > .tl-dot, .scr-home .tl-slot.is-sel.st-error > .tl-dot,
.scr-home .tl-slot.is-sel.st-skipped > .tl-dot, .scr-home .tl-slot.is-sel.st-running > .tl-dot {
  box-shadow: 0 0 0 3px var(--surface-2); }
.scr-home .st-running > .tl-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%;
  animation: sdot-pulse 1.6s ease-in-out infinite; }
.scr-home .st-open > .tl-dot { background: var(--surface); box-shadow: inset 0 0 0 2px var(--crowd), 0 0 0 3px var(--surface); }
.scr-home .tl-slot.is-sel.st-open > .tl-dot { box-shadow: inset 0 0 0 2px var(--crowd), 0 0 0 3px var(--surface-2); }
.scr-home .st-open.is-held > .tl-dot { box-shadow: inset 0 0 0 2px var(--attention), 0 0 0 3px var(--surface); }
.scr-home .tl-slot.is-sel.st-open.is-held > .tl-dot { box-shadow: inset 0 0 0 2px var(--attention), 0 0 0 3px var(--surface-2); }
.scr-home .st-idle > .tl-dot { background: var(--text-3); box-shadow: 0 0 0 7px var(--surface); transform: scale(.4); }
.scr-home .tl-slot.is-sel.st-idle > .tl-dot { box-shadow: 0 0 0 7px var(--surface-2); }
/* before this batch: 40% (spec §4.1) */
.scr-home .tl-slot.is-pre > .tl-dot, .scr-home .tl-slot.is-pre > .tl-time, .scr-home .tl-slot.is-pre > .tl-day { opacity: .4; }

/* the selected slot's story */
.scr-home .tl-detail { margin-top: var(--s3); padding: var(--s4); border-radius: var(--r-nested); background: var(--surface-2);
  min-height: 84px; }
.scr-home .tl-d-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.scr-home .tl-d-when { font-weight: 600; color: var(--text); }
.scr-home .tl-d-state { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text); }
.scr-home .tl-d-meta { color: var(--text-2); font-size: var(--fs-small); }
.scr-home .tl-d-body { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-top: 6px; }
.scr-home .tl-d-q { min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.scr-home a.tl-d-q:hover { color: var(--crowd); }
.scr-home .tl-d-q.t2 { color: var(--text-2); }
.scr-home .tl-d-gap { flex: none; }
.scr-home .tl-d-gap .gap-sm .gap-dot { box-shadow: 0 0 0 1.5px var(--surface-2); }
.scr-home .tl-d-why { margin: 4px 0 0; color: var(--text-2); font-size: var(--fs-small); }

/* one compact legend line */
.scr-home .tl-legend { display: flex; flex-wrap: wrap; gap: 6px var(--s4); margin-top: var(--s3);
  font-size: var(--fs-micro); color: var(--text-2); }
.scr-home .tl-lg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.scr-home .tl-mini { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 14px; height: 14px; border-radius: 50%; color: var(--bg); background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-3); }
.scr-home .tl-mini svg { width: 10px; height: 10px; }
.scr-home .tl-mini.st-bought, .scr-home .tl-mini.st-waiting, .scr-home .tl-mini.st-passed, .scr-home .tl-mini.st-error,
.scr-home .tl-mini.st-skipped, .scr-home .tl-mini.st-running { box-shadow: none; }
.scr-home .tl-mini.st-open { box-shadow: inset 0 0 0 2px var(--crowd); }
.scr-home .tl-mini.st-idle { background: var(--text-3); box-shadow: none; transform: scale(.45); }
.scr-home .tl-lg-pre .tl-mini { opacity: .4; }

@media (max-width: 640px) {
  .scr-home .tl { margin-left: calc(-1 * var(--s4)); margin-right: calc(-1 * var(--s4)); padding: 0 var(--s2);
    -webkit-mask-image: linear-gradient(90deg, transparent, var(--bg) 16px, var(--bg) calc(100% - 16px), transparent);
            mask-image: linear-gradient(90deg, transparent, var(--bg) 16px, var(--bg) calc(100% - 16px), transparent); }
  .scr-home .tl-in { grid-template-columns: repeat(var(--n, 12), 56px); width: max-content; }
  .scr-home .tl-slot { padding-bottom: var(--s2); min-height: 40px; }
  .scr-home .tl-detail { padding: var(--s3); min-height: 0; }
  .scr-home .tl-d-body { flex-direction: column; align-items: flex-start; gap: var(--s2); }
}

/* ------------------------------------------------------------------ latest decisions */
.scr-home .hm-feat { padding-bottom: var(--s5); }
.scr-home .hm-feat-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s4); flex-wrap: wrap; }
.scr-home .hm-feat-q { flex: 1 1 26rem; min-width: 0; font-size: var(--fs-title); font-weight: 600; line-height: 1.35;
  color: var(--text); overflow-wrap: anywhere; }
.scr-home .hm-feat-q:hover { color: var(--crowd); text-decoration: none; }
.scr-home .hm-feat-when { flex: none; color: var(--text-2); font-size: var(--fs-small); white-space: nowrap; }
.scr-home .hm-feat .gap-lg { margin-top: var(--s3); }
.scr-home .hm-feat-say { margin: var(--s2) 0 0; font-size: 16px; color: var(--text); max-width: 78ch; }
.scr-home .hm-feat-why { margin: 4px 0 0; color: var(--text-2); font-size: var(--fs-small); max-width: 60ch; }
.scr-home .hm-feat-links { margin-top: var(--s4); }
.scr-home .hm-feat + .hm-dec-list { border-top: 1px solid var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
.scr-home .hm-dec-list .row-lead { min-width: 6.5rem; }
.scr-home .hm-dec-list .row-key { font-weight: 500; }
.scr-home .hm-dec-list .row-key.t2 { color: var(--text-2); }
.scr-home .hm-dec-list .row-title .tag, .scr-home .hm-feat-top .tag { margin-left: 6px; vertical-align: 1px; }
@media (max-width: 640px) {
  .scr-home .hm-feat { padding-bottom: var(--s4); }
  .scr-home .hm-feat-q { font-size: 16px; flex-basis: 100%; }
  .scr-home .hm-feat-say { font-size: var(--fs-body); }
  .scr-home .hm-feat-links .btn { flex: 1 1 auto; }
  .scr-home .hm-dec-list .row-lead { min-width: 0; }
  /* the wrapped section action lines up with the title, not the button's padding */
  .scr-home .section-action > .btn.ghost { margin-left: -14px; }
}
