/* ════════════════════════════════════════════════════════════════════════
   P360-3 (HO-3517) — the Action Center on the house design system.

   One look wherever the center is embedded (Customer / CS 360, Lead 360,
   Broker 360, the request and ticket action centers, the follow-up
   slide-over): the shell (shared/unified-action-center), the proposals
   panel (CustomerRecommendationsPanel, prefix csrec-), the work panel
   (CrmActionPanel, prefix crm-ac-) and their partials. PO ruling 06/10:
   the DESIGN changes now, every text, button, state and flow stays as on
   main — the markup only swapped its inline styles for these classes
   (proved state by state: same texts, same behavioural attributes).

   Every colour is a --lm-d-* token (resources/css/tokens.css), so the
   center follows the app's light/dark theme. The panels' old --eac-*
   palette followed the OPERATING SYSTEM's dark mode instead — a dark card
   inside a light page on a dark-mode machine. Shapes follow mockup v18
   (task card = pf-task, proposal = pf-rec, chips = p3-chip, buttons =
   p3-btn). Hand-written; zero hex (StylesheetHexRatchetTest).
   ════════════════════════════════════════════════════════════════════════ */

/* ── the shell ── */
.uac, .crm-ac-shell { max-width: 34rem; }
.uac-sum { cursor: pointer; list-style: none; padding: 8px 22px; font-size: 13px; font-weight: 700; color: var(--lm-d-muted); display: flex; align-items: center; gap: 6px; }
.uac-sum-caret { margin-inline-start: auto; font-size: 12px; }
.uac-handoff { border-block-start: 1px solid var(--lm-d-divider); margin-block-start: 14px; padding-block-start: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--lm-d-muted); }
.uac-handoff.is-muted { display: block; }
.csrec input[type="date"], .csrec input[type="datetime-local"], .crm-ac-shell input[type="datetime-local"] { cursor: pointer; }

/* ── shared controls (inputs, buttons, chips) ── */
.crm-ac-input, .csrec-input, .csrec-form :is(input, select, textarea) {
    min-block-size: 36px; padding: 6px 10px; border: 1px solid var(--lm-d-control-edge); border-radius: 10px;
    background: var(--lm-d-surface); color: var(--lm-d-ink); font: inherit; font-size: 13px; }
.crm-ac-input:focus, .csrec-input:focus, .csrec-form :is(input, select, textarea):focus { outline: 0; border-color: var(--lm-d-accent); box-shadow: 0 0 0 3px var(--lm-d-accent-soft); }
.crm-ac-input.is-grow, .csrec-input.is-grow { flex: 1 1 10rem; min-inline-size: 10rem; }
.crm-ac-input.is-warn { border-color: var(--lm-d-warn); }
.crm-ac-textarea { min-block-size: 6rem; resize: vertical; line-height: 1.6; font-size: 14px; }
/* LEAD-NOTE-1 (PO 18/10 «المساحة صغيرة»): the comment boxes own a full line and start taller. */
.crm-ac-textarea.is-note { inline-size: 100%; min-block-size: 9rem; box-sizing: border-box; }
.crm-ac-inline.is-note { flex-wrap: wrap; align-items: flex-start; }
.crm-ac-inline.is-note .crm-ac-textarea { flex: 1 1 100%; }

.crm-ac-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-block-size: 34px; padding-inline: 14px; border-radius: 10px;
    border: 1px solid var(--lm-d-control-edge); background: var(--lm-d-surface); color: var(--lm-d-ink); font: inherit; font-size: 13px; font-weight: 700;
    white-space: nowrap; text-decoration: none; cursor: pointer; }
.crm-ac-btn:hover { background: var(--lm-d-hover); }
.crm-ac-btn.is-primary { background: var(--lm-d-accent); border-color: var(--lm-d-accent); color: var(--lm-d-on-accent); }
.crm-ac-btn.is-danger { background: var(--lm-d-danger); border-color: var(--lm-d-danger); color: var(--lm-d-on-accent); }
.crm-ac-btn.is-ok { background: var(--lm-d-ok); border-color: var(--lm-d-ok); color: var(--lm-d-on-accent); }
.crm-ac-btn.is-warn { background: var(--lm-d-warn); border-color: var(--lm-d-warn); color: var(--lm-d-on-accent); }
.crm-ac-btn.is-warn-line { color: var(--lm-d-warn); border-color: var(--lm-d-warn); }
.crm-ac-btn.is-ghost { color: var(--lm-d-muted); }
.crm-ac-btn:is(.is-primary, .is-danger, .is-ok, .is-warn):hover { filter: brightness(.96); }

.crm-ac-chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap;
    background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
.crm-ac-chip.is-planned, .crm-ac-chip.is-link { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.crm-ac-chip.is-in_progress { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.crm-ac-chip.is-done { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.crm-ac-chip:is(.is-step, .is-suggested) { background: var(--lm-d-ai-bg); color: var(--lm-d-ai); border: 1px solid var(--lm-d-border); }
.crm-ac-chip.is-suggested { margin-inline-start: 6px; }
.crm-ac-chip.is-needs { background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); border: 1px solid var(--lm-d-accent-line); }

.crm-ac-row { display: flex; gap: 8px; }
.crm-ac-row.is-wrap { flex-wrap: wrap; align-items: center; }
.crm-ac-row.is-gap { margin-block-start: 8px; }
.crm-ac-col { display: flex; flex-direction: column; gap: 8px; min-inline-size: 0; }

/* ── the work panel (CrmActionPanel) ── */
.crm-ac-body { margin-block-start: 4px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--lm-d-ink); }
.crm-ac-heading { font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--lm-d-muted); }
.crm-ac-label { font-size: 13px; font-weight: 700; color: var(--lm-d-ink); margin-block-end: 4px; }
.crm-ac-muted, .crm-ac-soft { color: var(--lm-d-muted); }
.crm-ac-msg { border-radius: 10px; padding: 8px 12px; font-size: 12.5px; }
.crm-ac-msg.is-danger { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); border: 1px solid var(--lm-d-gap-edge); }
.crm-ac-msg.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.crm-ac-gap { border: 1.5px dashed var(--lm-d-gap-edge); border-radius: 12px; padding: 12px; color: var(--lm-d-danger); font-size: 12.5px; }
.crm-ac-empty { border: 1.5px dashed var(--lm-d-border); border-radius: 12px; padding: 12px; text-align: center; color: var(--lm-d-muted); }
.crm-ac-empty-sub { font-size: 12px; }

/* the current task — mockup v18 «المهمة الحالية» (pf-task) */
.crm-ac-card { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; padding: 12px 14px; border: 1px solid var(--lm-d-border);
    border-inline-start: 4px solid var(--lm-d-accent); border-radius: 12px; background: var(--lm-d-surface); }
.crm-ac-card.is-late { border-inline-start-color: var(--lm-d-danger); }
/* LATE-DONE-8: its hour gone by today — today's work, not late */
.crm-ac-card.is-passed { border-inline-start-color: var(--lm-d-warn); }
.crm-ac-main { flex: 1 1 320px; min-inline-size: 0; display: flex; flex-direction: column; gap: 8px; }
.crm-ac-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.crm-ac-type { font-size: 15.5px; font-weight: 700; line-height: 1.45; color: var(--lm-d-ink); }
.crm-ac-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 8px 10px; padding-block: 8px; border-block: 1px solid var(--lm-d-divider); }
.crm-ac-stat { display: flex; min-inline-size: 0; }
.crm-ac-stat-ic { display: none; }
.crm-ac-stat-txt { display: flex; flex-direction: column; min-inline-size: 0; }
.crm-ac-stat-lbl { font-size: 12px; color: var(--lm-d-muted); }
.crm-ac-stat-val { font-size: 13.5px; font-weight: 700; color: var(--lm-d-ink); overflow-wrap: anywhere; }
.crm-ac-stat-lbl.is-danger, .crm-ac-stat-val.is-danger, .crm-ac-stat-late { color: var(--lm-d-danger); }
.crm-ac-stat-lbl.is-warn, .crm-ac-stat-val.is-warn { color: var(--lm-d-warn); }
.crm-ac-stat-late { font-size: 12px; font-weight: 700; }
.crm-ac-stat-val.is-ch { color: var(--lm-d-ok); }
.crm-ac-stat-val.is-prio-critical { color: var(--lm-d-danger); }
.crm-ac-stat-val.is-prio-urgent { color: var(--lm-d-accent-ink); }
.crm-ac-stat-val.is-prio-high { color: var(--lm-d-warn); }
.crm-ac-stat-val.is-prio-normal { color: var(--lm-d-info); }
.crm-ac-stat-val.is-prio-low { color: var(--lm-d-muted); }
.crm-ac-stat-val.is-prio-not_set { color: var(--lm-d-subtle); font-weight: 600; }
.crm-ac-comment { background: var(--lm-d-page); border-radius: 10px; padding: 8px 10px; font-size: 13px; color: var(--lm-d-ink); }
.crm-ac-comment small { display: block; color: var(--lm-d-muted); font-size: 12px; }
/* LEAD-LAST-CONTACT-1 (PO 18/10): «آخر تواصل» — day, hour, result and the note, then the attempts before it. */
/* TSK-0627 (Eman's review 20/10): the recorded comment is read, not skimmed — a bigger, darker line with room. */
.crm-ac-last { display: grid; gap: 6px; background: var(--lm-d-page); border: 1px solid var(--lm-d-border); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--lm-d-ink); }
.crm-ac-last-h { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crm-ac-last-label { font-weight: 700; }
.crm-ac-last-note { white-space: pre-line; font-size: 15px; line-height: 1.7; font-weight: 500; color: var(--lm-d-ink); }
.crm-ac-last-note small { color: var(--lm-d-muted); font-size: 12px; font-weight: 400; }
.crm-ac-last-note.is-earlier { font-size: 14px; }
.crm-ac-last-earlier { display: grid; gap: 6px; color: var(--lm-d-muted); font-size: 13px; border-top: 1px dashed var(--lm-d-border); padding-top: 6px; }
.crm-ac-last-earlier-row { display: grid; gap: 2px; }
.crm-ac-due { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crm-ac-due > input[type="date"] { flex: 1 1 140px; }
.crm-ac-due-time { display: inline-flex; gap: 4px; align-items: center; }
.crm-ac-due-time .crm-ac-input { width: auto; min-width: 3.6rem; }
.crm-ac-chip.is-missed { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.crm-ac-links { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crm-ac-restricted { color: var(--lm-d-muted); font-size: 12px; }
.crm-ac-bottomrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* one primary per area (mockup «إكمال المهمة») — the channel names the button, not a colour */
.crm-ac-hero { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-block-size: 40px; padding-inline: 16px; border: 1px solid var(--lm-d-accent);
    border-radius: 10px; background: var(--lm-d-accent); color: var(--lm-d-on-accent); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.crm-ac-hero:hover { filter: brightness(.96); }
.crm-ac-bottomrow .crm-ac-hero { flex: 1 1 auto; }
.crm-ac-tile { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.crm-ac-hero-xl { inline-size: 100%; min-block-size: 46px; font-size: 15px; margin-block-start: 6px; }
.crm-ac-sec { display: inline-flex; align-items: center; justify-content: center; inline-size: 40px; min-block-size: 40px; border-radius: 10px;
    border: 1px solid var(--lm-d-control-edge); background: var(--lm-d-surface); color: var(--lm-d-ink); font: inherit; font-size: 14px; cursor: pointer; }
.crm-ac-sec:hover { background: var(--lm-d-hover); }
.crm-ac-sec.is-edit { color: var(--lm-d-info); }
.crm-ac-sec.is-danger { color: var(--lm-d-danger); border-color: var(--lm-d-gap-edge); }
/* AC-FLOW-1: the secondary controls say what they do */
.crm-ac-sec.has-label { inline-size: auto; gap: 6px; padding-inline: 10px; font-weight: 600; }
.crm-ac-complete-actions { align-items: stretch; flex-wrap: wrap; margin-block-start: 4px; }
.crm-ac-complete-actions .crm-ac-hero { flex: 1 1 14rem; }
.crm-ac-edit-h { flex-basis: 100%; font-size: 13px; }
.crm-ac-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crm-ac-inline.is-top { flex-wrap: nowrap; align-items: flex-start; }

/* the AI script column + «لماذا هذا الإجراء؟» / «التسلسل الكامل» */
.crm-ac-aside { flex: 1 1 300px; min-inline-size: 0; display: flex; }
.crm-ac-aside-in { inline-size: 100%; }
.crm-ac-metalinks { margin-block-start: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.crm-ac-metalink { display: inline-flex; flex-direction: column; }
.crm-ac-metalink[open] { flex: 1 1 100%; }
.crm-ac-metalink-pill { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 5px; min-block-size: 30px; padding-inline: 10px;
    border: 1px solid var(--lm-d-border); border-radius: 999px; background: var(--lm-d-page); color: var(--lm-d-muted); font: inherit; font-size: 12.5px; font-weight: 600; }
.crm-ac-metalink-pill::-webkit-details-marker { display: none; }
.crm-ac-metalink-pill:hover, .crm-ac-metalink[open] > .crm-ac-metalink-pill { background: var(--lm-d-chip-bg); color: var(--lm-d-ink); }
.crm-ac-metalink-pill.is-plain { border-color: transparent; }
.crm-ac-why { margin-block-start: 6px; font-size: 12.5px; color: var(--lm-d-ink); line-height: 1.5; }
.crm-ac-why-rule { margin-block-start: 4px; font-size: 12px; color: var(--lm-d-subtle); }
.crm-ac-why-line { margin-block-start: 4px; }

/* completion flow */
.crm-ac-complete { border: 1px solid var(--lm-d-border); border-inline-start: 4px solid var(--lm-d-ok); background: var(--lm-d-surface); border-radius: 12px;
    padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; max-inline-size: 46rem; }
.crm-ac-complete-t { font-size: 15px; font-weight: 700; color: var(--lm-d-ink); }
.crm-ac-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 12px; align-items: start; }
.crm-ac-step { display: flex; gap: 8px; align-items: flex-start; }
.crm-ac-step-num { flex: none; inline-size: 22px; block-size: 22px; border-radius: 999px; background: var(--lm-d-ok); color: var(--lm-d-on-accent); font-size: 12px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; }
.crm-ac-step-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-inline-size: 0; }
.crm-ac-step-label { font-weight: 700; font-size: 13.5px; color: var(--lm-d-ink); }
.crm-ac-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.crm-ac-seg label { display: inline-flex; align-items: center; gap: 6px; min-block-size: 34px; padding-inline: 12px; border: 1px solid var(--lm-d-border); border-radius: 10px;
    background: var(--lm-d-page); color: var(--lm-d-ink); font-size: 13px; cursor: pointer; }
.crm-ac-seg label:has(input:checked) { background: var(--lm-d-info-soft); border-color: var(--lm-d-info-soft); color: var(--lm-d-info); }

/* outside the unified center (standalone mode) */
.crm-ac-box { border: 1px solid var(--lm-d-border); border-radius: 12px; padding: 8px 12px; color: var(--lm-d-ink); }
.crm-ac-box-sub { color: var(--lm-d-muted); font-size: 12px; margin-block-start: 4px; }
.crm-ac-new { display: inline-flex; align-items: center; gap: 6px; margin-block-start: 4px; min-block-size: 34px; padding-inline: 14px; border-radius: 10px;
    border: 1px solid var(--lm-d-control-edge); background: var(--lm-d-surface); color: var(--lm-d-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.crm-ac-new:hover { background: var(--lm-d-hover); }
.crm-ac-hist { display: flex; flex-direction: column; gap: 6px; }
.crm-ac-hist-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; border: 1px solid var(--lm-d-divider); border-radius: 10px; padding: 6px 10px; }
.crm-ac-hist-meta { color: var(--lm-d-muted); font-size: 12px; }

/* the draft (create / next) form */
.crm-ac-draft { border: 1px solid var(--lm-d-border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px;
    background: var(--lm-d-surface); max-inline-size: 34rem; }
.crm-ac-draft-t { font-size: 15px; font-weight: 700; color: var(--lm-d-ink); }
.crm-ac-via { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-radius: 10px; padding: 6px 10px; background: var(--lm-d-info-soft); }
.crm-ac-via-l { font-size: 12.5px; font-weight: 700; color: var(--lm-d-info); }

/* the governed conflict choice (draft form) and the page-level conflict screen */
.crm-ac-conflict { border: 1px solid var(--lm-d-warn); background: var(--lm-d-warn-soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; color: var(--lm-d-ink); }
.crm-ac-conflict.is-page { display: block; padding: 16px; margin-block-start: 16px; }
.crm-ac-conflict-t { font-weight: 700; color: var(--lm-d-warn); margin-block-end: 6px; }
.crm-ac-conflict-x { font-size: 12.5px; color: var(--lm-d-ink); }
.crm-ac-conflict-x.is-p { margin: 0; }
.crm-ac-conflict-x.is-lead { font-size: 13.5px; margin-block-end: 12px; }
.crm-ac-conflict-err { color: var(--lm-d-danger); font-size: 13.5px; margin-block-end: 8px; }
.crm-ac-conflict .mkt360-field { display: flex; flex-direction: column; gap: 4px; margin-block: 8px; }
.crm-ac-conflict .mkt360-field :is(input, select, textarea) { min-block-size: 36px; padding: 6px 10px; border: 1px solid var(--lm-d-control-edge); border-radius: 10px;
    background: var(--lm-d-surface); color: var(--lm-d-ink); font: inherit; font-size: 13px; }
.crm-ac-conflict :is(.mkt360-btn-primary, .mkt360-btn-secondary) { display: inline-flex; align-items: center; min-block-size: 34px; padding-inline: 14px; border-radius: 10px;
    border: 1px solid var(--lm-d-control-edge); background: var(--lm-d-surface); color: var(--lm-d-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.crm-ac-conflict .mkt360-btn-primary { background: var(--lm-d-accent); border-color: var(--lm-d-accent); color: var(--lm-d-on-accent); }

/* one action's timeline fold */
.crm-ac-tl { display: flex; flex-direction: column; gap: 4px; margin-block-start: 6px; border-inline-start: 2px solid var(--lm-d-divider); padding-inline-start: 10px; }
.crm-ac-tl-item { font-size: 12.5px; color: var(--lm-d-ink); line-height: 1.5; }
.crm-ac-tl-src { display: inline-block; font-size: var(--ho-text-xs); font-weight: 700; border-radius: 999px; padding: 0 7px; background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
.crm-ac-tl-src.is-action { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.crm-ac-tl-src.is-recommendation { background: var(--lm-d-ai-bg); color: var(--lm-d-ai); }
.crm-ac-tl-src.is-ai { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.crm-ac-tl-due { color: var(--lm-d-info); }
.crm-ac-tl-ch { color: var(--lm-d-ok); }
.crm-ac-tl-note { color: var(--lm-d-muted); }
.crm-ac-tl-at, .crm-ac-tl-none { color: var(--lm-d-subtle); }
.crm-ac-tl-none { font-size: 12.5px; }

/* ── the proposals panel (CustomerRecommendationsPanel) ── */
.csrec { display: flex; flex-direction: column; gap: 10px; margin-block-end: 8px; color: var(--lm-d-ink); }
.csrec-xs { font-size: 12.5px; }
.csrec-inherit { color: inherit; }
.csrec-muted { font-size: 12.5px; color: var(--lm-d-muted); }
.csrec-rel { position: relative; }
.csrec-pane { display: flex; flex-direction: column; gap: 10px; }
.csrec-pane.is-rec { order: 20; }
.csrec-pane.is-review { order: 30; }
.csrec-pane.is-history { order: 40; gap: 8px; }
.csrec-active-list { display: flex; flex-direction: column; gap: 8px; }
.csrec-active-list.is-active { order: 10; }
@media (min-width: 1400px) {
    .csrec-full-width .csrec-active-list { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; gap: 10px; }
}

/* the filter row — mockup «الكل · مهمة نشطة · مقترَح · مراجعة يدوية · السجل» (p3-chip) */
.csrec-tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.csrec-tab { display: inline-flex; align-items: center; gap: 5px; min-block-size: 30px; padding-inline: 10px; border: 1px solid var(--lm-d-border); border-radius: 10px;
    background: var(--lm-d-page); color: var(--lm-d-muted); font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.csrec-tab:hover { background: var(--lm-d-chip-bg); }
.csrec-tab[data-on] { background: var(--lm-d-info-soft); border-color: var(--lm-d-info-soft); color: var(--lm-d-info); font-weight: 700; }
.csrec-tab:focus-visible, .csrec-btn:focus-visible, .csrec-count:focus-visible { outline: 2px solid var(--lm-d-info); outline-offset: 2px; }
.csrec-attn-badge, .csrec-attn-chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12px; font-weight: 700;
    background: var(--lm-d-warn-soft); color: var(--lm-d-warn); border: 1px solid var(--lm-d-warn-soft); white-space: nowrap; }
.csrec-attn-badge { cursor: pointer; align-self: center; min-block-size: 30px; }
.csrec-attn-summary-pop { position: absolute; z-index: 30; margin-block-start: 6px; min-inline-size: 220px; background: var(--lm-d-surface); border: 1px solid var(--lm-d-border);
    border-radius: 12px; padding: 10px 12px; box-shadow: 0 8px 24px var(--lm-d-sheet-shadow); display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.csrec-attn-summary-row { display: flex; justify-content: space-between; gap: 12px; color: var(--lm-d-ink); }
.csrec-counters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.csrec-count { min-block-size: 30px; padding-inline: 10px; border: 1px solid var(--lm-d-border); border-radius: 10px; background: var(--lm-d-page); color: var(--lm-d-muted);
    font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.csrec-count[data-on] { background: var(--lm-d-info-soft); border-color: var(--lm-d-info-soft); color: var(--lm-d-info); }

/* strips (top priority, my top action, follow-up closed) */
.csrec-strip { border-radius: 12px; padding: 10px 12px; border: 1px solid var(--lm-d-border); background: var(--lm-d-page); display: flex; gap: 8px; align-items: baseline;
    flex-wrap: wrap; font-size: 13px; }
.csrec-strip.is-block { display: block; }
.csrec-strip.is-col { flex-direction: column; align-items: flex-start; gap: 6px; }
.csrec-strip.is-warn { background: var(--lm-d-warn-soft); border-color: var(--lm-d-warn-soft); }
.csrec-warn-txt { font-size: 12.5px; color: var(--lm-d-warn); }
.csrec-sum { font-size: 13px; }

/* chips — soft, never a rainbow of solid fills */
.csrec-chip, .csrec-chip-soft, .csrec-chip-gap { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600;
    white-space: nowrap; background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
.csrec-chip-soft { background: transparent; border: 1px solid var(--lm-d-border); }
.csrec-chip-soft.is-start { align-self: flex-start; }
.csrec-chip-gap, .csrec-chip:is(.is-danger, .is-prio-critical) { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.csrec-chip.is-prio-urgent, .csrec-chip.is-mine { background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); }
.csrec-chip:is(.is-prio-high, .is-warn, .is-st-in_progress, .is-st-superseded) { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.csrec-chip:is(.is-prio-normal, .is-st-planned) { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.csrec-chip:is(.is-prio-low, .is-st-done, .is-st-accepted) { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.csrec-chip:is(.is-st-dismissed, .is-st-stale, .is-st-cancelled) { background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
.csrec-chip[class*="is-fam-"] { background: var(--lm-d-ai-bg); color: var(--lm-d-ai); border: 1px solid var(--lm-d-border); }
.csrec :is(.csrec-btn, .csrec-chip-soft).is-end { margin-inline-start: auto; }

/* identity heads + cards (mockup: proposal = pf-rec, committed work = pf-task) */
.csrec-idhead { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--lm-d-muted); }
.csrec-idhead-rec { color: var(--lm-d-ai); }
.csrec-idhead-review { color: var(--lm-d-warn); }
.csrec-idhead-active { color: var(--lm-d-info); }
.csrec-card { border: 1px dashed var(--lm-d-control-edge); border-radius: 12px; padding: 12px 14px; background: var(--lm-d-surface); display: flex; flex-direction: column; gap: 8px; }
.csrec-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; border: 1px solid var(--lm-d-border);
    border-inline-start: 4px solid var(--lm-d-accent); border-radius: 12px; padding: 10px 12px; font-size: 13px; background: var(--lm-d-surface); }
.csrec-row--split { align-items: stretch; }
.csrec-hist { border: 1px solid var(--lm-d-divider); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; background: var(--lm-d-surface); }
.csrec-bg-rec { background: var(--lm-d-surface); }
.csrec-bg-active { background: var(--lm-d-surface); }
.csrec-bg-hist { background: var(--lm-d-page); }
.csrec-bg-critical { background: var(--lm-d-danger-soft); border-color: var(--lm-d-gap-edge); }
.csrec-bg-urgent { background: var(--lm-d-accent-soft); border-color: var(--lm-d-accent-line); }
.csrec-bg-review { background: var(--lm-d-warn-soft); border: 1px solid var(--lm-d-warn-soft); border-radius: 12px; padding: 12px 14px; }
.csrec-acc { border-inline-start-width: 4px; border-inline-start-style: solid; }
.csrec-acc-critical { border-inline-start-color: var(--lm-d-danger); }
.csrec-acc-urgent { border-inline-start-color: var(--lm-d-accent); }
.csrec-acc-high { border-inline-start-color: var(--lm-d-warn); }
.csrec-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.csrec-what { font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--lm-d-ink); }
.csrec-what-critical { color: var(--lm-d-danger); }
.csrec-what-urgent { color: var(--lm-d-accent-ink); }
.csrec-why, .csrec-guide, .csrec-evidence { font-size: 12.5px; color: var(--lm-d-muted); line-height: 1.55; }
.csrec-why.is-gap { margin-block-start: 6px; }
.csrec-guide { border-inline-start: 3px solid var(--lm-d-divider); padding-inline-start: 8px; }
.csrec-meta, .csrec-row-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--lm-d-muted); }
.csrec-line { margin-block-start: 4px; }
.csrec-line.is-muted { color: var(--lm-d-muted); }
.csrec-line.is-rule { font-size: 12px; color: var(--lm-d-subtle); }
.csrec-note { font-size: 12.5px; color: var(--lm-d-danger); }
.csrec-note.is-ok { color: var(--lm-d-ok); }
.csrec-empty { font-size: 12.5px; color: var(--lm-d-muted); border: 1px dashed var(--lm-d-border); border-radius: 12px; padding: 10px 12px; }
.csrec-details summary, .csrec-toggle > summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--lm-d-info); }
.csrec-toggle > summary { list-style: none; display: flex; align-items: center; gap: 6px; }
.csrec-toggle > summary::-webkit-details-marker { display: none; }
.csrec-toggle > summary::before { content: '▸'; display: inline-block; transition: transform .18s ease; }
.csrec-toggle[open] > summary::before { transform: rotate(90deg); }
.csrec-toggle-body { display: flex; flex-direction: column; gap: 6px; margin-block-start: 8px; }

/* the register row (committed work beside the hero) */
.csrec-active-main { flex: 1 1 320px; min-inline-size: 0; display: flex; flex-direction: column; gap: 6px; }
.csrec-active-aside { flex: 1 1 300px; min-inline-size: 0; display: flex; }
.csrec-active-aside > * { inline-size: 100%; }
@media (max-width: 720px) { .csrec-active-main, .csrec-active-aside { flex-basis: 100%; } }
.csrec-stats { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.csrec-stat { display: inline-flex; align-items: center; gap: 6px; }
.csrec-stat-ic { display: none; }
.csrec-stat-txt { display: flex; flex-direction: column; line-height: 1.25; }
.csrec-stat-lbl { font-size: 12px; color: var(--lm-d-muted); }
.csrec-stat-val { font-size: 13px; font-weight: 700; color: var(--lm-d-ink); white-space: nowrap; }
.csrec-stat-val-late { color: var(--lm-d-danger); }
.csrec-stat-val-ch { color: var(--lm-d-ok); }
.csrec-comment { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--lm-d-ink); background: var(--lm-d-page); border-radius: 10px; padding: 8px 10px; }
.csrec-comment small { color: var(--lm-d-muted); font-size: 12px; }
.csrec-hist-link { border-inline-start: 3px solid var(--lm-d-divider); padding-inline-start: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--lm-d-muted); font-size: 12.5px; }
.csrec-why-action { margin-block-start: 2px; }
.csrec-why-summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--lm-d-info); list-style: none; }
.csrec-why-summary::-webkit-details-marker { display: none; }
.csrec-why-action[open] > .csrec-why-summary { color: var(--lm-d-muted); }
.csrec-why-summary.is-btn { background: none; border: 0; padding: 0; text-align: start; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--lm-d-muted); }
.csrec-subactions { list-style: none; margin: 8px 0 0; padding: 6px 0 0; border-block-start: 1px dashed var(--lm-d-border); display: grid; gap: 5px; }
.csrec-subaction { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; padding-inline-start: 4px; }
.csrec-subaction-dot { color: var(--lm-d-subtle); }
.csrec-subaction-txt { flex: 1 1 auto; min-inline-size: 12rem; }
.csrec-subaction.is-late .csrec-subaction-txt { color: var(--lm-d-danger); }
.csrec-subactions-head { font-size: 12.5px; color: var(--lm-d-muted); margin-block-start: 6px; }

/* buttons + forms */
.csrec-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.csrec-btns.is-end { align-self: end; }
.csrec-btns.is-center { align-items: center; }
.csrec-btns.is-full, .csrec-full { grid-column: 1 / -1; }
.csrec-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-block-size: 32px; padding-inline: 12px; border-radius: 10px;
    border: 1px solid var(--lm-d-control-edge); background: var(--lm-d-surface); color: var(--lm-d-ink); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.csrec-btn:hover { background: var(--lm-d-hover); }
.csrec-btn-main { background: var(--lm-d-accent); border-color: var(--lm-d-accent); color: var(--lm-d-on-accent); }
.csrec-btn-main:hover { background: var(--lm-d-accent); filter: brightness(.96); }
.csrec-btn-main.is-warn, .csrec-btn.csrec-btn-review { background: var(--lm-d-warn); border-color: var(--lm-d-warn); color: var(--lm-d-on-accent); }
.csrec-btn-main.is-danger { background: var(--lm-d-danger); border-color: var(--lm-d-danger); color: var(--lm-d-on-accent); }
.csrec-btn.is-ok { color: var(--lm-d-ok); }
.csrec-btn.is-edit { color: var(--lm-d-info); }
.csrec-btn.is-danger { color: var(--lm-d-danger); border-color: var(--lm-d-gap-edge); }
.csrec-mini { border-style: dashed; color: var(--lm-d-muted); font-size: 12px; min-block-size: 30px; padding-inline: 8px; }
.csrec-form { border-block-start: 1px dashed var(--lm-d-border); padding-block-start: 10px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); font-size: 12.5px; }
.csrec-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; color: var(--lm-d-muted); }
.csrec-required { color: var(--lm-d-accent-ink); font-weight: 700; }
select.csrec-required { border-color: var(--lm-d-accent-line); }
.csrec-more-menu { position: relative; }
.csrec-more-menu > summary { list-style: none; min-inline-size: 2rem; text-align: center; cursor: pointer; }
.csrec-more-menu > summary::-webkit-details-marker { display: none; }
.csrec-more-pop { position: absolute; z-index: 20; inset-inline-start: 0; inset-block-start: calc(100% + 6px); display: flex; flex-direction: column; gap: 5px; padding: 8px;
    border: 1px solid var(--lm-d-border); border-radius: 12px; background: var(--lm-d-surface); box-shadow: 0 8px 24px var(--lm-d-sheet-shadow); min-inline-size: 12rem; }

/* a recommendation's own sections (risk / outcome / evidence) and its script */
.csrec-sc { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.csrec-sc-risk { color: var(--lm-d-warn); }
.csrec-sc-outcome { color: var(--lm-d-ok); }
.csrec-sc-ev { color: var(--lm-d-subtle); }
.csrec-sc-code { margin-inline-end: 6px; }
.csrec-script { border: 1px dashed var(--lm-d-control-edge); border-inline-start: 3px solid var(--lm-d-ai); border-radius: 10px; padding: 8px 10px; background: var(--lm-d-ai-bg);
    display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--lm-d-ai-ink); }
.csrec-script-t { font-weight: 700; color: var(--lm-d-ai); }
.csrec-script-warn { color: var(--lm-d-warn); }
.csrec-script-warn.is-strong { font-weight: 700; }
.csrec-script-l { display: flex; flex-direction: column; gap: 4px; font-weight: 600; color: var(--lm-d-muted); }
.csrec-script-regen { border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--lm-d-ai); cursor: pointer; }
.csrec-script-gen { align-self: flex-start; border: 0; border-radius: 10px; min-block-size: 32px; padding-inline: 12px; font: inherit; font-size: 12.5px; font-weight: 700;
    background: var(--lm-d-ai); color: var(--lm-d-on-accent); cursor: pointer; }
.csrec-script-regen.is-off, .csrec-script-gen.is-off { color: var(--lm-d-muted); cursor: not-allowed; }
.csrec-script-gen.is-off { background: var(--lm-d-quiet-bg); }

/* attention motion — calm, and off for reduced motion */
.csrec-card, .csrec-row, .csrec-hist { transition: box-shadow .18s ease, border-color .18s ease; }
.csrec-card:hover, .csrec-row:hover, .csrec-hist:hover { box-shadow: 0 4px 14px var(--lm-d-sheet-shadow); }
@keyframes csrecPulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lm-d-danger) 45%, transparent); } 60% { box-shadow: 0 0 0 6px transparent; } }
.csrec-pulse { animation: csrecPulse 1.8s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .csrec-pulse { animation: none; } .csrec-card, .csrec-row, .csrec-hist { transition: none; } }
@media (max-width: 640px) { .csrec-btn, .csrec-tab { min-block-size: 30px; } }

/* ── TSK-0602 HUB-TASK-1 S3 — «ردّ» / «مردّش» inside the Daily Hub: two buttons, then the confirm
      strip. Sticky at the foot of the task's scroll, so the close is on screen at 1366×768. ── */
.crm-ac-quick { position: sticky; inset-block-end: 0; z-index: 2; display: grid; gap: 8px; padding: 10px; margin-block: 6px;
    background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-radius: 12px; box-shadow: 0 -4px 14px var(--lm-d-sheet-shadow); }
.crm-ac-qbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.crm-ac-qbtns.is-three { grid-template-columns: 1fr 1fr 1fr; }
.crm-ac-qbtn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-block-size: 48px; padding: 6px 12px;
    border-radius: 10px; border: 1px solid var(--lm-d-control-edge); background: var(--lm-d-surface); color: var(--lm-d-ink);
    font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.crm-ac-qbtn small { font-size: 12px; font-weight: 600; color: var(--lm-d-muted); }
.crm-ac-qbtn:hover { background: var(--lm-d-hover); }
.crm-ac-qbtn.is-ok { background: var(--lm-d-ok-soft); border-color: var(--lm-d-ok); color: var(--lm-d-ok); }
.crm-ac-qbtn.is-ok:hover { filter: brightness(.97); }
.crm-ac-qform { display: grid; gap: 10px; }
.crm-ac-qsec { display: grid; gap: 6px; }
.crm-ac-qchips { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-ac-qchip { min-block-size: 32px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--lm-d-control-edge); background: var(--lm-d-surface);
    color: var(--lm-d-ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.crm-ac-qchip:hover { background: var(--lm-d-hover); }
.crm-ac-qchip.is-on { background: var(--lm-d-accent-soft); border-color: var(--lm-d-accent); color: var(--lm-d-accent-ink); }
.crm-ac-qchip.is-ghost { border-style: dashed; color: var(--lm-d-muted); }
.crm-ac-qchip:focus-visible, .crm-ac-qbtn:focus-visible { outline: 2px solid var(--lm-d-accent); outline-offset: 2px; }
.crm-ac-qhint { color: var(--lm-d-muted); font-size: 12px; }
.crm-ac-qnote { inline-size: 100%; min-block-size: 5rem; box-sizing: border-box; }
/* the decision stays on screen while the «ردّ» form is taller than the panel */
.crm-ac-qfoot { position: sticky; inset-block-end: 0; display: grid; gap: 6px; border-block-start: 1px solid var(--lm-d-divider);
    padding-block: 8px 2px; background: var(--lm-d-surface); }
.crm-ac-qsum { font-size: 13px; color: var(--lm-d-ink); }
.crm-ac-qrow { display: flex; gap: 8px; flex-wrap: wrap; }
.crm-ac-qrow .crm-ac-btn.is-primary { flex: 1 1 auto; }
.crm-ac-qrow .crm-ac-btn:disabled { opacity: .55; cursor: not-allowed; }
/* S4 — the line that says what this close is (a legacy review's call, a meeting waiting for its result, a request's form) */
.crm-ac-qlead { font-size: 13px; font-weight: 700; color: var(--lm-d-ink); }
.crm-ac-qlead.is-wait { color: var(--lm-d-warn); }
.crm-ac-qalt { padding: 8px 10px; border: 1px dashed var(--lm-d-border); border-radius: 10px; }
/* S8 — the customer's recommendations as tips inside the task, and «💡» among the next steps */
.crm-ac-tips { display: grid; gap: 6px; }
.crm-ac-tip { display: grid; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--lm-d-ai-bg); border: 1px solid var(--lm-d-border); }
.crm-ac-tip-what { font-size: 13px; font-weight: 700; color: var(--lm-d-ai-ink); }
.crm-ac-qchip.is-tip { border-color: var(--lm-d-ai); color: var(--lm-d-ai-ink); background: var(--lm-d-ai-bg); }
.crm-ac-qchip.is-tip.is-on { border-color: var(--lm-d-accent); }

/* ── TSK-0602 S10 (flow review 20/10) — the open strip scrolls with the task (it was sticky at the foot, so on a
      1366×768 laptop the next step sat under «تأكيد»); «تأكيد» itself stays sticky inside it. ── */
.crm-ac-quick.is-open, .crm-ac-quick.is-static { position: static; box-shadow: none; }
.crm-ac-qnote { min-block-size: 3.5rem; }
.crm-ac-qhint.is-warn { color: var(--lm-d-warn); font-weight: 600; }
.crm-ac-qbtn small { line-height: 1.3; }
/* a tip is one line under the buttons; its reason opens on demand */
.crm-ac-tip > summary { cursor: pointer; list-style: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-ac-tip > summary::-webkit-details-marker { display: none; }
.crm-ac-tip[open] > summary { white-space: normal; }
/* a phone: the manager's three long buttons stack (side by side they wrapped to five lines each) */
@media (max-width: 480px) { [data-crm-hub-manager] .crm-ac-qbtns.is-three { grid-template-columns: 1fr; } }
