/* Calm Instrument Slice 3: Your week and Customers, the two lists a partner works from. Tokens only (tokens.css).

   Structure carries the hierarchy, colour only reinforces it: Needs attention is the one card stack, with the
   tier named once by its section (gold glyph), never repeated on each card; Worth reviewing and Follow up are
   lighter rows; Steady and Quiet a closing line. Customers is a decision list: alignment, spacing and hairlines,
   not boxed cells; Customer and Attention lead, Commercial is compact and subordinate, the score is secondary
   and never tinted. */

/* ================================== Your week ================================== */
.wk-sum { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s7); list-style: none; margin: 0 0 var(--s7); padding: 0 0 var(--s5);
    border-bottom: 1px solid var(--line); font-size: var(--fs-control); }
.wk-sum li { display: inline-flex; align-items: baseline; gap: 6px; }
.wk-sum .dx-tier, .cu-att .dx-tier { font-size: var(--fs-sm); letter-spacing: 0; text-transform: none; font-weight: var(--fw-strong); }
.wk-sum b { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }

.wk-sec { margin: 0 0 var(--s8); }
.wk-sechead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s3); margin: 0 0 var(--s3); padding: 0 0 var(--s3);
    border-bottom: 1px solid var(--line); }
.wk-sechead h2 { margin: 0; font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.wk-sechead h2 .n { margin-left: 4px; color: var(--muted); font-weight: 600; }
.wk-sechead .sub { margin: 0; font-size: var(--fs-sm); color: var(--muted); }
.wk-glyph { display: inline-block; margin-right: var(--s2); font-size: var(--fs-sm); vertical-align: 2px; }
.wk-glyph-na, .wk-glyph-WorthReviewing { color: var(--attention); }
.wk-glyph-FollowUp { color: var(--workflow); }
summary.wk-sechead { cursor: pointer; list-style: none; }
summary.wk-sechead::-webkit-details-marker { display: none; }
summary.wk-sechead::after { content: ""; width: 7px; height: 7px; margin-left: auto; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted);
    transform: rotate(45deg); align-self: center; }
details:not([open]) > summary.wk-sechead::after { transform: rotate(-45deg); }
summary.wk-sechead:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: var(--r-sm); }

/* Needs attention: the cards. */
.wk-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wk-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3) var(--s6); padding: var(--s5) 22px;
    border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.wk-card h3 { margin: 0; font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
.portal-main .wk-card h3 a, .portal-main .wk-row .wk-nm { color: var(--text); text-decoration: none; }
.portal-main .wk-card h3 a:hover, .portal-main .wk-row .wk-nm:hover { text-decoration: underline; text-decoration-color: var(--muted); }
.wk-why { margin: 6px 0 0; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text); }
.wk-facts { display: flex; flex-wrap: wrap; gap: 4px var(--s6); margin: 10px 0 0; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.wk-facts div { display: flex; gap: 6px; }
.wk-facts dt { color: var(--muted); }
.wk-facts dd { margin: 0; color: var(--text-2); }
.wk-facts dd b { color: var(--text); font-weight: var(--fw-strong); }
.wk-act { align-self: start; }
.wk-more { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s2) var(--s4); margin-top: var(--s3);
    font-size: var(--fs-meta); color: var(--muted); }

/* Worth reviewing and Follow up: lighter rows. */
.wk-rows { list-style: none; margin: 0; padding: 0; }
.wk-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2.4fr) auto; gap: 4px var(--s6); align-items: baseline;
    padding: var(--s4) 4px; border-bottom: 1px solid var(--line); }
.wk-nm { font-weight: var(--fw-strong); overflow-wrap: anywhere; }
.wk-what { font-size: var(--fs-control); color: var(--text-2); }
.wk-wf { color: var(--workflow); font-size: var(--fs-sm); font-weight: var(--fw-strong); }
.wk-wfg { margin-right: 6px; }
/* Importance reads as a word in a sentence here, not as a shouted label: Immediate keeps its own colour. */
.wk-facts .dx-imp, .cu-top .oi-imp { font-size: inherit; font-weight: var(--fw-strong); letter-spacing: 0; text-transform: none; }
.wk-sep { margin: 0 var(--s2); color: var(--muted); }
.wk-nx { display: block; margin-top: 2px; font-size: var(--fs-sm); color: var(--muted); }
.portal-main .wk-open { color: var(--text); font-weight: var(--fw-strong); font-size: var(--fs-control); text-decoration: underline;
    text-decoration-color: var(--line-strong); text-underline-offset: 3px; white-space: nowrap; }
.portal-main .wk-open:hover { text-decoration-color: var(--text-2); }
.wk-rest { margin: 0; font-size: var(--fs-control); color: var(--muted); }
.wk-rest b { color: var(--text-2); font-weight: var(--fw-strong); }

/* The calm states: no customers, and a quiet week. A sentence, not a dashboard of zeros. */
.wk-calm { margin: 0 0 var(--s8); padding: var(--s3) 0 0; }
.wk-calm h2 { margin: 0 0 6px; font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: 800; color: var(--text); }
.wk-calm p { margin: 0; max-width: 70ch; color: var(--text-2); }

@media (max-width: 600px) {
    .wk-sum { gap: var(--s2) var(--s5); }
    .wk-card { grid-template-columns: minmax(0, 1fr); padding: var(--s4); }
    .wk-facts { flex-direction: column; gap: 2px; }
    .wk-act .ci-btn { width: 100%; min-height: var(--h-touch); }
    .wk-more .ci-btn { min-height: var(--h-touch); }
    .wk-row { grid-template-columns: minmax(0, 1fr) auto; padding: var(--s3) 0; }
    .wk-row .wk-what { grid-column: 1 / -1; grid-row: 2; }
    .portal-main .wk-open { display: inline-flex; align-items: center; min-height: var(--h-touch); }
    summary.wk-sechead { min-height: var(--h-touch); }
}

/* ================================== Customers ================================== */
.cu-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 var(--s3); }
.cu-order { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r-md); }
.cu-order button { min-height: 34px; padding: 4px var(--s4); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2);
    font: 600 var(--fs-control)/1.2 var(--font); cursor: pointer; }
.cu-order button:hover { color: var(--text); background: var(--fill-1); }
.cu-order button[aria-checked="true"] { color: var(--text); background: var(--raised); font-weight: 800; box-shadow: inset 0 0 0 1px var(--line-strong); }

.cu-menu { position: relative; }
.cu-trigger, .cu-fbtn { display: inline-flex; align-items: center; gap: 6px; min-height: var(--h-control); padding: 0 10px 0 14px;
    border: 1px solid var(--line-strong); border-radius: var(--r-md); background: transparent; color: var(--text);
    font: var(--fw-strong) var(--fs-control)/1.2 var(--font); cursor: pointer; }
.cu-trigger:hover, .cu-fbtn:hover, .cu-trigger[aria-expanded="true"], .cu-fbtn[aria-expanded="true"] { border-color: var(--control); background: var(--fill-1); }
.cu-on { min-width: 20px; padding: 0 6px; border-radius: var(--r-full); background: var(--fill-3); font-size: var(--fs-meta); text-align: center; }
.cu-caret { width: 14px; height: 14px; color: var(--muted); }
.cu-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 270px; padding: var(--s2); border: 1px solid var(--line-strong);
    border-radius: var(--r-lg); background: var(--overlay); box-shadow: var(--shadow-overlay); }
.cu-pop[hidden], .cu-sheet[hidden] { display: none; }
.cu-pop-h, .cu-sub { margin: 4px var(--s2) 6px; font-size: var(--fs-label); line-height: var(--lh-label); font-weight: var(--fw-strong); letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted); }
/* Capability and Copilot sit inside the Opportunity menu as their own groups, ruled off, so they never read as opportunity states. */
.cu-sub { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line-strong); }
.cu-opt { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); width: 100%; min-height: 40px; padding: 6px 10px;
    border: 0; border-radius: var(--r-md); background: transparent; color: var(--text); font: 600 var(--fs-control)/1.3 var(--font); text-align: left; cursor: pointer; }
.cu-opt:hover { background: var(--fill-2); }
.cu-opt[aria-pressed="true"] { background: var(--fill-2); font-weight: 800; }
.cu-opt[aria-pressed="true"] span:first-child::before { content: "✓"; margin-right: var(--s2); }
.cu-n { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.cu-backdrop { position: fixed; inset: 0; z-index: 10; }
.cu-fbtn, .cu-sheet { display: none; }

.cu-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); list-style: none; margin: 0 0 var(--s4); padding: 0; }
.cu-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 8px 2px 12px; border: 1px solid var(--line-strong);
    border-radius: var(--r-full); background: var(--fill-1); color: var(--text); font: 600 var(--fs-sm)/1.2 var(--font); cursor: pointer; }
.cu-chip:hover { border-color: var(--control); }
.cu-chip .ci-icon { width: 12px; height: 12px; color: var(--muted); }
.cu-clear { min-height: 32px; padding: 0 4px; border: 0; background: transparent; color: var(--text); font: var(--fw-strong) var(--fs-sm)/1.2 var(--font);
    text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; cursor: pointer; }

.cu-none { padding: var(--s6) 0; }
.cu-none p { margin: 0 0 var(--s3); max-width: 70ch; color: var(--text-2); }
.cu-none p b { color: var(--text); }

/* The decision list: a grid of aligned columns on a wide enough box; one compact card per customer otherwise. */
.cu-wrap { container-type: inline-size; }
.cu-head, .cu-row { display: grid; gap: 0 var(--s5);
    grid-template-columns: minmax(170px, 1.15fr) minmax(150px, 1fr) minmax(200px, 1.5fr) minmax(130px, .95fr) 92px minmax(130px, .95fr); }
.cu-head.cu-noco, .cu-row.cu-noco { grid-template-columns: minmax(170px, 1.2fr) minmax(150px, 1fr) minmax(220px, 1.7fr) 92px minmax(130px, 1fr); }
.cu-head { padding: 0 4px 10px; border-bottom: 1px solid var(--line-strong); font-size: var(--fs-meta); font-weight: 600; color: var(--muted); }
.cu-head .r, .cu-score { text-align: right; }
.cu-list { list-style: none; margin: 0; padding: 0; }
.cu-row { align-items: start; padding: var(--s4) 4px; border-bottom: 1px solid var(--line); }
.cu-row > div { min-width: 0; }
.portal-main .cu-name .nm { display: block; color: var(--text); font-size: var(--fs-body); font-weight: 800; text-decoration: none; overflow-wrap: anywhere; }
.portal-main .cu-name .nm:hover { text-decoration: underline; text-decoration-color: var(--muted); }
.cu-dt { display: block; margin-top: 2px; font-size: var(--fs-meta); color: var(--muted); white-space: nowrap; }
.cu-reason { display: block; margin-top: 4px; font-size: var(--fs-sm); color: var(--text-2); }
.cu-top, .cu-co, .cu-chg { font-size: var(--fs-sm); }
/* Commercial is subordinate to Attention: compact, lighter weight, one state per line. */
.cu-co .co-cell { flex-direction: column; gap: 2px; }
.cu-co .co-st { font-weight: 600; letter-spacing: 0; }
.cu-chg .cm { font-weight: 600; }
.cu-score b { display: block; font-size: var(--fs-heading); line-height: var(--lh-heading); font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.cu-band { display: block; font-size: var(--fs-meta); color: var(--muted); }
.cu-q { color: var(--muted); }
/* UF-UM-RP2-3: partial coverage marker, a word and a border (not colour alone); wraps, never widens the grid. */
.cu-partial { display: inline-block; max-width: 100%; margin-top: 2px; padding: 0 6px; border: 1px solid var(--muted); border-radius: var(--r-sm); font-size: var(--fs-meta); font-weight: 600; color: var(--text-2); white-space: normal; overflow-wrap: anywhere; }

@container (max-width: 899px) {
    .cu-head { display: none; }
    .cu-row, .cu-row.cu-noco { grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--s4); padding: var(--s4) 0; }
    .cu-name { grid-column: 1; grid-row: 1; }
    .cu-score { grid-column: 2; grid-row: 1; }
    .cu-att, .cu-top, .cu-co, .cu-chg { grid-column: 1 / -1; }
}

/* Phones: one "Filters (n)" control in place of the four menus; the sheet lists every group. */
@media (max-width: 640px) {
    .cu-order { display: flex; flex: 1 1 100%; }
    .cu-order button { flex: 1 1 auto; min-height: var(--h-touch); }
    .cu-menu { display: none; }
    .cu-fbtn { display: inline-flex; min-height: var(--h-touch); }
    /* Above the click-outside backdrop, as the desktop menus are: otherwise the sheet cannot be used. */
    .cu-sheet:not([hidden]) { position: relative; z-index: 20; display: block; flex: 1 1 100%; padding: var(--s2); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
    .cu-opt { min-height: var(--h-touch); }
    .cu-done { width: 100%; min-height: var(--h-touch); margin-top: var(--s2); }
    .cu-chip, .cu-clear { min-height: var(--h-touch); }
}
