/* page-desk.css: shared desk styles (Growth desk and Match desk). Loads after mwp.css, uses only mwp tokens.
   Desk pages are light surfaces with a dark hero band. No animation beyond mwp's button hover. */

/* ---------- Hero ---------- */
.desk-hero { padding-block: var(--space-6) var(--space-7); }
.desk-hero h1 { font-size: var(--step-3); color: #fff; margin-block-end: var(--space-3); }
.agent-status {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-5);
  max-width: none; color: var(--on-dark-muted); font-weight: 600;
}
.agent-status .icon { color: var(--lime); width: 1.25rem; height: 1.25rem; }
.desk-hero .callout { max-width: 46rem; box-shadow: var(--shadow-2); }
.desk-hero .callout p { font-weight: 600; }
.nojs { font-weight: 700; padding: var(--space-4); background: var(--warn-bg); color: var(--warn-text); border-radius: var(--radius); max-width: none; }

/* ---------- Tab bar ---------- */
.desk-main { padding-block: var(--space-6) var(--section-y); }
.desk-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); margin-block-end: var(--space-6); }
.desk-bar .tabs { margin: 0; background: #fff; box-shadow: var(--shadow-1); }
.reset-box { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

/* ---------- Panels ---------- */
.desk-panel > h2 { font-size: var(--step-3); margin-block: 0 var(--space-2); }
.desk-panel > h2:focus { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: .25rem; }
.panel-intro { max-width: 52rem; color: var(--muted); font-size: var(--step-0); margin-block-end: var(--space-5); }
.desk-panel h3 { margin-block: 0 var(--space-3); }
.note-line {
  display: inline-flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-4); padding: .375rem var(--space-3);
  background: var(--accent-soft); color: var(--accent-soft-text); border-radius: var(--pill); font-weight: 700; max-width: none;
}
.status-line {
  margin: 0 0 var(--space-5); padding: .625rem var(--space-4); background: #fff; border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent); border-radius: var(--radius); font-weight: 600; max-width: none;
}
.status-line:empty { display: none; }
.copied { margin-block: var(--space-2); }
/* An empty status region stays rendered (so assistive tech keeps watching it) but takes no visible room. */
.copied:empty {
  display: inline-flex; width: 1px; height: 1px; padding: 0; border: 0; margin: 0; overflow: hidden; clip-path: inset(50%);
}
.copied:empty::before { content: none; }
.empty-note { color: var(--muted); font-weight: 600; margin: var(--space-3) 0 0; }
.empty-note[hidden] { display: none; }
.mini-label { margin: 0 0 var(--space-1); font-size: var(--step--1); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Stat tiles ---------- */
.stat-grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); list-style: none; margin: 0 0 var(--space-5); padding: 0; }
.stat-grid > li { max-width: none; margin: 0; }
.stat-grid-3 { grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); }
.desk-panel .stat { box-shadow: var(--shadow-1); padding: var(--space-3) var(--space-4); }
.desk-panel .stat-num { font-size: var(--step-2); }
.stat-total { background: var(--dark); color: #fff; border-color: var(--dark); }
.stat-total .stat-label { color: var(--on-dark-muted); }

/* ---------- Two columns: review list and side lists ---------- */
.desk-cols { display: grid; gap: var(--space-6); align-items: start; }
.col-main, .side-stack { min-width: 0; }
.side-stack { display: grid; gap: var(--space-5); }
.desk-cols h3:focus, .side-card h3:focus, .draft-card h4:focus, .ready-list h4:focus {
  outline: 3px solid var(--focus); outline-offset: 4px; border-radius: .25rem;
}
@media (min-width: 64rem) {
  .desk-cols { grid-template-columns: minmax(0, 1fr) 23rem; }
}

/* ---------- Draft cards ---------- */
.draft-list, .seg-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-5); }
.draft-list > li, .seg-grid > li { max-width: none; margin: 0; min-width: 0; }
.draft-card { display: grid; gap: var(--space-4); border-inline-start: 6px solid var(--accent); }
.draft-card > * { min-width: 0; margin: 0; }
.draft-head { display: flex; gap: var(--space-3); align-items: center; }
.draft-title { min-width: 0; flex: 1; }
.draft-title h3, .draft-title h4 { margin: 0 0 var(--space-2); font-size: var(--step-1); overflow-wrap: anywhere; }
.draft-title > p { margin: 0; }
.draft-head .icon-tile { width: 56px; height: 56px; }
.fit { margin: 0; }
.facts { display: grid; gap: var(--space-1) var(--space-5); grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); font-size: var(--step--1); }
.facts > div { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.facts dt { color: var(--muted); font-weight: 700; }
.facts dt::after { content: ":"; content: ":" / ""; }
.facts dd { margin: 0; font-weight: 600; max-width: none; }
.seg-count { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.pill-line { margin: 0; }
.draft-card .actions { margin: 0; }

/* ---------- Email preview ---------- */
.email { border: 1px solid var(--border-strong); border-radius: var(--radius); background: #fff; }
.email-head { display: grid; gap: .25rem; margin: 0; padding: var(--space-3) var(--space-4); background: var(--surface); border-block-end: 1px solid var(--border-strong); border-radius: var(--radius) var(--radius) 0 0; }
.email-head-solo { border: 1px solid var(--border-strong); border-radius: var(--radius); }
.email-head > div { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr); gap: var(--space-2); align-items: baseline; }
.email-head dt { color: var(--muted); font-size: var(--step--1); font-weight: 700; }
.email-head dd { margin: 0; max-width: none; overflow-wrap: anywhere; }
.email-subject { font-weight: 800; }
.email-body {
  margin: 0; padding: var(--space-4); max-width: none; white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 1rem; line-height: 1.65;
}
.placeholder { padding: 0 .25em; border-radius: .25rem; background: var(--warn-bg); color: var(--warn-text); font-weight: 700; }
.editor { display: grid; gap: var(--space-2); }
.editor label { display: block; }
.editor textarea { display: block; width: 100%; max-width: 100%; min-height: 16rem; font: inherit; font-size: 1rem; line-height: 1.6; resize: vertical; }

/* ---------- Side lists ---------- */
.side-card { padding: var(--space-5); }
.side-card h3 { font-size: var(--step-1); }
.side-note { margin: 0 0 var(--space-3); color: var(--muted); font-size: var(--step--1); }
.ready-list { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-4); }
.ready-list > li { max-width: none; margin: 0; padding-block-start: var(--space-4); border-block-start: 1px solid var(--border); min-width: 0; }
.ready-list h4 { margin: 0 0 var(--space-1); font-size: var(--step-0); overflow-wrap: anywhere; }
.ready-meta { margin: 0 0 var(--space-2); color: var(--muted); font-size: var(--step--1); overflow-wrap: anywhere; }
.skipped-name { margin: 0 0 var(--space-2); font-weight: 700; overflow-wrap: anywhere; }
.ready-list .actions { margin-block: var(--space-2) 0; }
.mini-details > summary, .skipped-box > summary {
  display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--accent);
}
.skipped-box > summary { font-size: var(--step-1); color: var(--text); font-weight: 800; justify-content: space-between; list-style: none; }
.skipped-box > summary::-webkit-details-marker { display: none; }
.skipped-box > summary::after { content: "+"; content: "+" / ""; font-size: 1.75rem; line-height: 1; }
.skipped-box[open] > summary::after { content: "\2212"; content: "\2212" / ""; }
.mini-details .email { margin-block: var(--space-2); }
.mini-details .email-body { font-size: var(--step--1); }

/* ---------- Waitlist ---------- */
.seg-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); align-items: start; }

/* ---------- This week ---------- */
.week-grid { display: grid; gap: var(--space-5); }
.week-card { min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-block-end: var(--space-4); }
.card-head h3 { margin: 0; }
.area-big { margin: 0 0 var(--space-3); font-size: var(--step-3); font-weight: 800; letter-spacing: var(--head-tracking); line-height: 1.1; }
.week-note { margin: var(--space-3) 0 0; color: var(--muted); font-weight: 600; }
.action-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-5); }
.action-list > li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-3); max-width: none; margin: 0; }
.action-list .step-num { width: 40px; height: 40px; font-size: var(--step-0); }
.action-text { margin: 0 0 var(--space-2); font-weight: 600; }
.action-link { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; font-weight: 700; }
.action-link .icon { width: 1.125rem; height: 1.125rem; }
@media (min-width: 56rem) {
  .week-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .week-wide { grid-column: 1 / -1; }
}

/* ---------- Small screens ---------- */
@media (max-width: 29.99rem) {
  .desk-main { padding-block-start: var(--space-5); }
  .draft-card { padding: var(--space-4); }
  .draft-card .actions .btn, .ready-list .actions .btn { width: 100%; }
  .email-head > div { grid-template-columns: 1fr; gap: 0; }
  .reset-box .btn { width: 100%; }
}

/* ---------- Motion and forced colours ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
@media (forced-colors: active) {
  .email, .email-head, .status-line, .placeholder, .note-line { border: 1px solid CanvasText; }
  .draft-card { border-inline-start: 6px solid CanvasText; }
  .tabs [aria-current]:focus-visible { outline: 3px solid CanvasText; outline-offset: 3px; }
}
