/* Week Agenda panel skin. Extends shared components (`.modal-overlay`/`.modal-card` in CSS/components.css;
   `.a-card`, `.a-chip`, `.a-btn` in alt-components.css/alt-shell.css); every class here is an `a-wa-*`
   name applied alongside one of those. The <details> behaviour is copied from `.a-okr-imp-g`
   (okr-import.css, not loaded here); see week-agenda-architecture.md §5d. */

/* ---------- the dialog shell — sized from the window by weekAgendaSizeToViewport() ----------
   Owner 2026-10-15: ~590px wide on a ~2000px screen. sizeSettingsDialog() asserts the real width
   and height (94% of the window, capped at 1600px); this ceiling matches it so the stylesheet
   never clamps the JS below that, and is the fallback where modal-size.js is not loaded. */
.a-wa-card{
  width:100%;
  max-width:min(1600px, 100%);
}
.a-wa-body{
  gap:var(--a-3);
  flex-direction:column;
  overflow-y:auto;
}
/* The body is a grid: range line, action row, notices and glance card span every column; sections flow into
   auto-fill columns (track floor min(480px, 100%)), so no breakpoint is needed. Specificity matches the
   components.css `.modal-card.panes > .modal-pane.active` flex rule it replaces, plus one class. */
.modal-card.panes > .modal-pane.active.a-wa-body{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(min(480px, 100%), 1fr));
  align-items:start;
  align-content:start;
  /* Row height comes from content, not a scroll container's automatic minimum. `.a-wa-sec` is overflow:hidden
     and #waBody is a fixed-height scroller, so without this implicit rows collapse to ~2px and sections
     overlap (only visible in a real browser). */
  grid-auto-rows:max-content;
}
.a-wa-body > :not(.a-wa-sec){
  grid-column:1 / -1;
}
.a-wa-body > .a-wa-sec + .a-wa-sec{
  margin-top:0;
}
/* A section is not flexible — exactly as tall as its content, open or shut, with the BODY doing
   the scrolling (§12's one-scroll-region-per-detail-surface). Without `flex:0 0 auto`, the
   default flex-shrink:1 crushed every closed section to its 17px header height once the body
   hit its viewport ceiling, slicing titles in half with `overflow:hidden` hiding the evidence. */
.a-wa-body > .a-wa-sec{
  flex:0 0 auto;
}

/* ---------- the week range line, above every state ---------- */
.a-wa-range{
  margin:0 0 var(--a-3);
  font-size:var(--a-fs-12);
  font-weight:600;
  letter-spacing:.02em;
  color:var(--a-dim);
}

/* ---------- the action row: Generate / Regenerate / the processing status ---------- */
.a-wa-meta{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:var(--a-3);
  margin:0 0 var(--a-3);
  min-width:0;
}
.a-wa-when{
  font-size:var(--a-fs-12);
  color:var(--a-faint);
}
/* The freshness chip: the words say "changed" or "Up to date", so colour only underlines them (§18).
   The warn chip is a button (opens the list); the ok chip is plain text with a tick. */
.a-wa-pastweek{
  font-size:var(--a-fs-11);
  font-weight:600;
  color:var(--a-dim);
  border:1px solid var(--a-line-soft);
  border-radius:var(--a-r-pill);
  padding:2px 8px;
}
.a-wa-fresh{
  display:inline-flex;
  align-items:center;
  gap:4px;
  min-height:22px;
  padding:0 9px;
  border-radius:var(--a-r-pill);
  border:1px solid var(--a-line-soft);
  font:inherit;
  font-size:var(--a-fs-11);
  font-weight:600;
  white-space:nowrap;
}
.a-wa-fresh.ok{ color:var(--a-green); background:var(--a-green-soft); border-color:var(--a-green); }
.a-wa-fresh.warn{ color:var(--a-amber); background:var(--a-amber-soft); border-color:var(--a-amber); cursor:pointer; }
.a-wa-fresh.warn:hover{ border-color:var(--a-line-strong); }
.a-wa-fresh.warn:focus-visible{ outline:2px solid var(--a-ring); outline-offset:1px; }
.a-wa-fresh-car{ font-size:var(--a-fs-11); }
.a-wa-fresh.warn[aria-expanded="true"] .a-wa-fresh-car{ transform:rotate(180deg); }
#waChanges:empty{ display:none; }
.a-wa-changes{
  margin:0 0 var(--a-3);
  padding:var(--a-3);
  border:1px solid var(--a-line-soft);
  border-radius:var(--a-r);
  background:var(--a-raised);
  display:flex;
  flex-direction:column;
  gap:var(--a-3);
  min-width:0;
}
.a-wa-chg-grp{ min-width:0; }
.a-wa-chg-kind{ font-size:var(--a-fs-12); font-weight:600; color:var(--a-text); }
.a-wa-chg-n{ color:var(--a-dim); font-variant-numeric:tabular-nums; }
.a-wa-chg-list{ list-style:none; margin:4px 0 0; padding:0; display:flex; flex-direction:column; gap:2px; }
.a-wa-chg-row{ font-size:var(--a-fs-12); color:var(--a-dim); overflow-wrap:anywhere; }
.a-wa-chg-detail{ color:var(--a-faint); }
.a-wa-chg-actions{ display:flex; flex-wrap:wrap; gap:var(--a-3); }
/* A row of the agenda whose task changed since it was written. */
.a-wa-item.a-wa-changed{
  border-left:3px solid var(--a-amber);
  padding-left:var(--a-3);
}
.a-wa-genstat{
  display:inline-flex;
  min-width:0;
}

/* ================= THIS WEEK AT A GLANCE =================
   One bordered card with two sub-cards (Workload by Day, Recommended Focus), an insight strip and four tiles;
   markup in weekAgendaGlanceHtml(). `.a-wa-tiles`/`.a-wa-tile`/`.a-wa-tilen`/`.a-wa-tilel` are located by name
   in open-tiles-on-hold.test.js. */
.a-wa-glance{
  padding:var(--a-4);
  display:flex;
  flex-direction:column;
  gap:var(--a-4);
}
.a-wa-glance-h{
  margin:0;
  font:700 var(--a-fs-14)/var(--a-lh-tight) var(--a-body);
  color:var(--a-text);
}

/* ---------- the two sub-cards: Workload by Day, Recommended Focus ---------- */
.a-wa-glance-cards{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:var(--a-3);
}
.a-wa-glance-card{
  min-width:0;
  padding:var(--a-3);
  border:1px solid var(--a-line-soft);
  border-radius:var(--a-r);
  background:var(--a-raised);
  display:flex;
  flex-direction:column;
  gap:var(--a-2);
}
.a-wa-glance-ch{
  display:flex;
  flex-direction:column;
  gap:1px;
  min-width:0;
}
.a-wa-glance-ct{
  font:700 var(--a-fs-12)/var(--a-lh-tight) var(--a-body);
  color:var(--a-text);
}
.a-wa-glance-cs{
  font-size:var(--a-fs-11);
  color:var(--a-dim);
  /* `title` carries the full sentence on hover; weekAgendaWorkloadHtml() still prints a short
     hint below rather than resting on hover text alone. */
  cursor:default;
}

/* ---------- Workload by Day — bars built in HTML (storage-charts.js's own bar technique,
   reused), axis and gridlines decorative and aria-hidden ---------- */
.a-wa-wl-plot{
  position:relative;
  margin-top:var(--a-1);
}
/* The axis and gridlines measure `.a-wa-wl-track` itself, and only that: both are offset by
   `.a-wa-wl-col`'s own padding-top and stand exactly as tall as the track (74px) — one number
   pair to keep in sync, not the three an earlier build measured against instead. */
.a-wa-wl-axis, .a-wa-wl-gridlines{
  position:absolute;
  top:38px;
  height:74px;
  pointer-events:none;
}
.a-wa-wl-axis{
  left:0;
  width:18px;
}
.a-wa-wl-gridlines{
  left:22px;
  right:0;
}
.a-wa-wl-gridn{
  position:absolute;
  right:2px;
  transform:translateY(50%);
  font-size:var(--a-fs-11);
  font-variant-numeric:tabular-nums;
  /* `--a-dim` on the 11px floor (design-system.md §18) — these were 9px "fine print" until
     2026-10-10, when the Suite's no-text-under-11px rule withdrew that allowance. */
  color:var(--a-dim);
}
.a-wa-wl-gridline{
  position:absolute;
  left:0;
  right:0;
  border-top:1px dashed var(--a-line-soft);
}
.a-wa-wl-bars{
  display:flex;
  align-items:flex-end;
  gap:6px;
  margin-left:26px;
}
.a-wa-wl-col{
  flex:1 1 0;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  position:relative;
  /* Reserved room above the track for the tallest bar's count plus, on the heaviest day, its
     badge stacked above that — held open on every column so the axis starts at a fixed offset. */
  padding-top:38px;
  background:none;
  border:none;
  border-radius:var(--a-r-sm);
  font-family:var(--a-body);
  cursor:pointer;
}
div.a-wa-wl-col{
  cursor:default; /* a zero day renders as a <div>, not a <button> — "not a door" */
}
button.a-wa-wl-col:hover{
  background:var(--a-float);
}
/* The track is the one positioning context for the fill, count and badge — all three read the
   same `pct` the JS computed for this bar, so they ride up and down together. `overflow` is
   never `hidden`: a tall bar's count/badge legitimately rises into the padding reserved above. */
.a-wa-wl-track{
  position:relative;
  width:100%;
  max-width:26px;
  height:74px;
}
.a-wa-wl-fill{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  min-height:2px; /* the flat hairline a zero day draws; wins over inline height:0% by cascade */
  border-radius:var(--a-r-sm) var(--a-r-sm) 0 0;
  background:var(--a-blue);
}
.a-wa-wl-col.heaviest .a-wa-wl-fill{
  background:var(--a-red);
}
.a-wa-wl-col.mid .a-wa-wl-fill{
  background:var(--a-amber);
}
.a-wa-wl-col.zero .a-wa-wl-fill{
  background:var(--a-line-strong);
}
.a-wa-wl-n{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  white-space:nowrap;
  font-size:var(--a-fs-11);
  font-weight:700;
  color:var(--a-text);
  font-variant-numeric:tabular-nums;
}
.a-wa-wl-badge{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  white-space:nowrap;
  font:700 var(--a-fs-11)/var(--a-lh-tight) var(--a-body);
  letter-spacing:.04em;
  color:var(--a-red);
  background:var(--a-red-soft);
  border-radius:var(--a-r-pill);
  padding:1px 5px;
}
.a-wa-wl-lab{
  height:14px;
  font-size:var(--a-fs-11);
  font-weight:600;
  letter-spacing:.04em;
  text-transform:uppercase;
  line-height:var(--a-lh-tight);
  color:var(--a-dim);
}

/* ---------- Recommended Focus — a donut (decorative, aria-hidden) plus a legend, both real
   doors alongside it (weekAgendaDonutHitsHtml()/weekAgendaLegendHtml()) ---------- */
.a-wa-focus-body{
  display:flex;
  align-items:center;
  gap:var(--a-3);
  min-width:0;
}
/* 140 -> 156px against the design image, where the ring is the dominant element beside a
   smaller legend text block. The SVG's own viewBox scales every inner font-size/radius with it
   for free. */
.a-wa-donut{
  position:relative;
  flex:0 0 auto;
  width:156px;
  height:156px;
}
.a-wa-donut-svg{
  display:block;
  width:100%;
  height:100%;
}
.a-wa-donut-track{
  fill:none;
  stroke:var(--a-line-soft);
  stroke-width:14;
}
.a-wa-donut-slice{
  fill:none;
  stroke-width:14;
}
.a-wa-donut-val{
  font:700 var(--wa-val-fs, 20px)/var(--a-lh-ctl) var(--a-body);
  fill:var(--a-text);
}
/* The ring caption overlapped the hole (57.6 vs 50.2 viewBox units). Smaller font, tighter letter-spacing and
   a higher y make it fit; `textLength` pins it to 50 units in any face. */
.a-wa-donut-cap{
  font:700 var(--wa-cap-fs, 6px)/var(--a-lh-ctl) var(--a-body);
  letter-spacing:.05em;
  fill:var(--a-dim);
}
/* The per-arc number, drawn on the wedge itself, beside the legend row. White fill with a soft
   dark outline (`paint-order:stroke fill`, so the stroke sits under the fill) rather than a flat
   colour, because plain white reads poorly against the amber segment in light theme. */
.a-wa-donut-seg-n{
  font:700 var(--wa-seg-fs, 9px)/var(--a-lh-ctl) var(--a-body);
  fill:var(--a-on-fill);
  paint-order:stroke fill;
  stroke:rgba(0,0,0,.45);
  stroke-width:2px;
  stroke-linejoin:round;
}
/* The hit layer, stacked on the decorative SVG — see weekAgendaDonutHitsHtml() for why a click
   handler isn't on the arc itself. Each button's own `--wa-seg-soft` washes the exact wedge it
   jumps from on hover. */
.a-wa-donut-hit{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  background:none;
  border:none;
  padding:0;
  cursor:pointer;
}
.a-wa-donut-hit:hover{
  background:var(--wa-seg-soft, var(--a-blue-soft));
}
.a-wa-legend{
  list-style:none;
  margin:0;
  padding:0;
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.a-wa-legend-row{
  width:100%;
  display:flex;
  align-items:center;
  gap:var(--a-2);
  min-width:0;
  padding:4px 2px;
  border-radius:var(--a-r-sm);
  background:none;
  border:none;
  font:600 var(--a-fs-12)/var(--a-lh-tight) var(--a-body);
  color:var(--a-text);
  text-align:left;
  cursor:pointer;
}
button.a-wa-legend-row:hover{
  background:var(--a-float);
}
.a-wa-legend-row.is-zero{
  cursor:default;
  color:var(--a-dim);
}
.a-wa-legend-dot{
  flex:0 0 auto;
  width:10px;
  height:10px;
  border-radius:50%;
}
.a-wa-legend-n{
  flex:0 0 auto;
  min-width:16px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}
.a-wa-legend-l{
  flex:1 1 auto;
  min-width:0;
  color:var(--a-dim);
  font-weight:500;
}

/* ---------- the three-up insight strip — icon, headline, sub-line, separated by thin rules ---------- */
.a-wa-insights{
  display:flex;
  border-top:1px solid var(--a-line-soft);
  border-bottom:1px solid var(--a-line-soft);
}
.a-wa-insight{
  flex:1 1 0;
  min-width:0;
  display:flex;
  align-items:flex-start;
  gap:var(--a-2);
  padding:var(--a-3);
  border-right:1px solid var(--a-line-soft);
  background:none;
  border-left:none; border-top:none; border-bottom:none;
  font-family:var(--a-body);
  text-align:left;
}
.a-wa-insight:last-child{
  border-right:none;
}
div.a-wa-insight{
  cursor:default; /* an insight with nothing to point at — "zero count is not a door" */
}
button.a-wa-insight{
  cursor:pointer;
}
button.a-wa-insight:hover{
  background:var(--a-float);
}
.a-wa-insight-ic{
  flex:0 0 auto;
  margin-top:1px;
  color:var(--a-dim);
}
.a-wa-insight-txt{
  display:flex;
  flex-direction:column;
  gap:1px;
  min-width:0;
}
.a-wa-insight-txt b{
  font-size:var(--a-fs-12);
  font-weight:700;
  color:var(--a-text);
}
.a-wa-insight-txt span{
  font-size:var(--a-fs-11);
  color:var(--a-dim);
}

/* ---------- the four deterministic tiles — Open / Done this week / Starred / No due date ---------- */
.a-wa-tiles{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:var(--a-2);
}
.a-wa-tile{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  padding:var(--a-2) var(--a-3);
  min-width:0;
}
.a-wa-tilen{
  font-size:var(--a-fs-21);
  font-weight:700;
  line-height:var(--a-lh-tight);
  font-variant-numeric:tabular-nums;
  color:var(--a-text);
}
.a-wa-tilel{
  font-size:var(--a-fs-11);
  color:var(--a-dim);
}

/* ---------- the collapsible sections — native <details>, chevron on the left, rotating ---------- */
.a-wa-sec{
  min-width:0;
  overflow:hidden;
}
.a-wa-sec + .a-wa-sec{
  margin-top:var(--a-2);
}
.a-wa-sech{
  display:flex;
  align-items:center;
  gap:var(--a-2);
  min-width:0;
  padding:var(--a-2) var(--a-3);
  cursor:pointer;
  font:600 var(--a-fs-13)/var(--a-lh-ui) var(--a-body);
  color:var(--a-text);
  list-style:none;
}
.a-wa-sech::-webkit-details-marker{
  display:none;
}
.a-wa-sech::before{
  content:'';
  flex:0 0 auto;
  width:0;
  height:0;
  border-left:5px solid var(--a-faint);
  border-top:4px solid transparent;
  border-bottom:4px solid transparent;
  transition:transform var(--a-quick) var(--a-ease);
}
.a-wa-sec[open] > .a-wa-sech::before{
  transform:rotate(90deg);
}
@media (prefers-reduced-motion: reduce){
  .a-wa-sech::before{ transition:none; }
}
.a-wa-sech:hover{
  background:var(--a-raised);
}
/* The count stays visible while folded (design-system.md §6 rule 3) — it lives in the summary
   row itself, never inside the disclosed body. */
.a-wa-sect{
  flex:1 1 auto;
  min-width:0;
}
.a-wa-secn{
  flex:0 0 auto;
  font-size:var(--a-fs-12);
  font-weight:600;
  font-variant-numeric:tabular-nums;
  color:var(--a-faint);
}
.a-wa-secb{
  padding:0 var(--a-3) var(--a-3);
  min-width:0;
}

/* ---------- section content: the executive summary paragraph ---------- */
.a-wa-summary{
  margin:0;
  font-size:var(--a-fs-13);
  line-height:var(--a-lh-body);
  color:var(--a-text);
}

/* ---------- section content: the item lists (priorities, themes, close-out, move-next, suggestions) ---------- */
.a-wa-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:var(--a-3);
}
.a-wa-item{
  min-width:0;
  border-top:1px solid var(--a-line-soft);
  padding-top:var(--a-3);
}
.a-wa-item:first-child{
  border-top:none;
  padding-top:0;
}
.a-wa-itemhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:var(--a-2);
  min-width:0;
}
/* A real button, underlined — a link that could lose its colour still reads as one (§18). */
.a-wa-tlink{
  background:none;
  border:none;
  padding:0;
  min-height:24px;
  font:600 var(--a-fs-13)/var(--a-lh-ui) var(--a-body);
  color:var(--a-blue-text);
  text-align:left;
  text-decoration:underline;
  text-underline-offset:2px;
  cursor:pointer;
}
.a-wa-tlink:hover{
  color:var(--a-text);
}
.a-wa-tt{
  font-weight:600;
  color:var(--a-text);
}
.a-wa-when-tag{
  flex:0 0 auto;
  font-size:var(--a-fs-11);
  color:var(--a-dim);
  white-space:nowrap;
}
.a-wa-reason{
  margin:4px 0 0;
  font-size:var(--a-fs-12);
  line-height:var(--a-lh-body);
  color:var(--a-dim);
}
.a-wa-themetitle{
  display:block;
  font-size:var(--a-fs-13);
  font-weight:600;
  color:var(--a-text);
}
.a-wa-chips{
  display:flex;
  flex-wrap:wrap;
  gap:var(--a-1);
  margin-top:6px;
}

/* ---------- responsive: the tiles fold before anything else does ---------- */
@media (max-width:639px){
  .a-wa-tiles{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

/* ---------- responsive: the glance card at a phone-width panel (~400px viewport, per
   sizeModalToViewport()'s own 86% ratio) ---------- */
@media (max-width:559px){
  /* Workload by Day above Recommended Focus — two charts sharing one row below ~280px each is
     illegible. */
  .a-wa-glance-cards{
    grid-template-columns:minmax(0, 1fr);
  }
  /* Donut above its own legend, centred, rather than squeezed into a slim leftover column. */
  .a-wa-focus-body{
    flex-direction:column;
    align-items:center;
  }
  .a-wa-legend{
    width:100%;
  }
  .a-wa-donut{
    width:128px; /* kept in proportion with the 140->156 growth above */
    height:128px;
  }
  /* Same "too narrow to be legible" fix as the two sub-cards above: stacked, with a horizontal
     rule standing in for the vertical one the wide layout draws. */
  .a-wa-insights{
    flex-direction:column;
  }
  .a-wa-insight{
    border-right:none;
    border-bottom:1px solid var(--a-line-soft);
  }
  .a-wa-insight:last-child{
    border-bottom:none;
  }
  /* Measured on the real panel: seven 3-letter uppercase labels with letter-spacing were tight
     enough to touch their neighbour at ~400px. Tightening the gap and dropping letter-spacing
     here (never at wider widths) is cheaper than a second, narrower label vocabulary. */
  .a-wa-wl-bars{
    gap:3px;
  }
  .a-wa-wl-lab{
    font-size:var(--a-fs-11);
    letter-spacing:0;
  }
}
