/* ============================================================
   UniHub — Dynamic Home (role-aware productivity surface)
   Widget primitives for the productivity home. Built on tokens.css
   + redesign.css (rd-* primitives). No new palette, Avenir only.
   These compose into the Copilot (B) and Briefing (A) home layouts.
   Ported from the Claude Design handoff (UniHub Home Concepts).
   ============================================================ */

.mk { font-size: var(--pt-body); color: var(--rd-ink); }

/* ---------- App switcher in the header (replaces big app grid) ----------
   The launcher is no longer the home — it's a button that opens a drawer. */
.home-appsbtn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: var(--fw-demi); color: var(--rd-ink-2);
  background: var(--rd-surface); border: 1px solid var(--rd-line-strong);
  border-radius: var(--rd-radius-s); padding: 7px 12px; cursor: pointer;
}
.home-appsbtn:hover { border-color: var(--blue-light); color: var(--rd-ink); }
.home-appsbtn .grid { display: grid; grid-template-columns: repeat(3,3px); grid-template-rows: repeat(3,3px); gap: 2px; }
.home-appsbtn .grid i { display: block; width: 3px; height: 3px; border-radius: 1px; background: var(--rd-ink-3); }

/* Header Chat / Cowork shortcuts — always-visible entry points to the AI
   workspaces so they're never buried inside the Copilot Ask box. */
/* Filled blue — matches the Ask UNIIQ submit button (.ask-box .go) so "Open
   UNIIQ" reads as the same primary action wherever it appears. */
.home-aibtn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: var(--fw-demi); color: #fff;
  background: var(--blue); border: 1px solid var(--blue);
  border-radius: var(--rd-radius-s); padding: 7px 12px; cursor: pointer;
}
.home-aibtn:hover { background: var(--blue-semi-dark); border-color: var(--blue-semi-dark); }
.home-aibtn svg { display: block; color: #fff; }

/* Copilot home — explicit "Open Chat / Open Cowork" choice cards under the Ask box. */
.home-ai-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: var(--d-5, 16px); }
.home-ai-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--rd-surface); border: 1px solid var(--rd-line); border-radius: var(--rd-radius-m, 12px);
  padding: 14px 16px; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.home-ai-card:hover { border-color: var(--blue-light); transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.home-ai-card .ic { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 17px; color: #fff; }
.home-ai-card .ic.chat { background: var(--blue); }
.home-ai-card .ic.cowork { background: var(--blue); }
.home-ai-card .tx { display: flex; flex-direction: column; min-width: 0; }
.home-ai-card .tx b { font-size: 14px; color: var(--rd-ink); }
.home-ai-card .tx i { font-style: normal; font-size: 12px; color: var(--rd-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .home-ai-actions { grid-template-columns: 1fr; } }

/* Apps drawer — compact tiles so the launcher reads as a tidy index, not a
   second full home grid. Smaller columns + clamped text, no cut-off/overlap. */
.home-apps-drawer .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.home-apps-drawer .tile.tile-compact { padding: 12px; gap: 8px; border-radius: 12px; }
.tile-compact .tile-name { font-size: 13.5px; line-height: 1.3; white-space: normal; word-break: break-word; }
.tile-compact .tile-cat { font-size: 10px; }
.tile-compact .tile-desc {
  font-size: 12px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile-compact .tile-foot { font-size: 11px; gap: 6px; min-width: 0; }
.tile-compact .tile-foot .tile-last,
.tile-compact .tile-foot .tile-open { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-compact .tile-request { font-size: 11px; padding: 5px 9px; white-space: nowrap; }
.tile-compact .tile-pending-msg { font-size: 10.5px; line-height: 1.35; }

/* role switcher (demo control only) */
.role-seg { display: inline-flex; background: var(--rd-sunken); border-radius: var(--rd-radius-s); padding: 3px; gap: 2px; }
.role-seg .r { font-size: 12px; font-weight: var(--fw-demi); color: var(--rd-ink-2); padding: 6px 12px; border-radius: 6px; }
.role-seg .r.on { background: var(--rd-surface); color: var(--rd-ink); box-shadow: var(--shadow-xs); }

/* ---------- Greeting block (compact, one line of meta) ---------- */
.home-greet { margin-bottom: var(--d-6); }
.home-greet .eye { font-size: 11px; font-weight: var(--fw-demi); letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue); margin-bottom: 10px; }
.home-greet h1 { font-size: var(--pt-page); letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.home-greet .meta { font-size: 14px; color: var(--rd-ink-2); margin-top: 8px; }
.home-greet .meta b { color: var(--rd-ink); font-weight: var(--fw-demi); }

/* ---------- Layout grids ---------- */
.home-page { padding: var(--d-7) var(--screen-pad) var(--d-8); max-width: var(--container-wide, 1440px); margin: 0 auto; }
.home-grid { display: grid; grid-template-columns: 1fr 340px; gap: var(--d-6); align-items: start; }
.home-split { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--d-6); align-items: start; }
.home-col { min-width: 0; display: grid; gap: var(--d-6); }
/* The support ball-in-court board renders several .rd-panel bands inside one column
   slot; give them the same vertical rhythm as the column's other panels (they'd
   otherwise butt up against each other with no gap). */
.hs-bands { display: grid; gap: var(--d-6); min-width: 0; }
.hs-bands > .rd-panel { min-width: 0; } /* grid item: allow the panel to shrink so rows truncate, not overflow (#37) */
/* Board freshness bar — one line above the bands: "Updated Xm ago · ↻". */
.hs-fresh { display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  margin: -2px 2px 0; font-size: 12px; color: var(--text-muted, #888); }
.hs-fresh-label { font-variant-numeric: tabular-nums; }
/* Transient toast (claim-on-click feedback). Fixed bottom-center, click to dismiss. */
.hs-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  max-width: 520px; padding: 10px 16px; border-radius: 8px; cursor: pointer;
  /* Fixed dark surface (not var(--text)) so it stays readable in BOTH themes. */
  background: #1f2430; color: #fff; font-size: 13px; line-height: 1.4;
  box-shadow: 0 6px 24px rgba(0,0,0,.22); }
.hs-toast.warn { background: #B54708; }
/* Glance tiles scroll a band to the top of the viewport (block:'start'); the
   margin keeps its heading clear of any sticky chrome above. */
.hs-bands > .rd-panel { scroll-margin-top: var(--d-6, 16px); }
/* "Show N more / Show less" control under a capped band. */
.band-more { display: block; margin: 4px 16px 12px; font-size: 12px; }

/* ---------- Section header inside home ---------- */
.hw-head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--d-4); }
.hw-head h3 { font-size: var(--pt-section); letter-spacing: -0.01em; margin: 0; }
.hw-head .src { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: var(--fw-demi); color: var(--rd-ink-3); }
.hw-head .src .logo { width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; color: #fff; font-size: 9px; font-weight: var(--fw-demi); }
.hw-head .link { margin-left: auto; font-size: 12px; font-weight: var(--fw-demi); color: var(--blue-semi-dark); cursor: pointer; }
.hw-head .count { font-size: 12px; color: var(--rd-ink-3); font-weight: var(--fw-demi); }

/* ============================================================
   GLANCE strip — "your day" smart chips
   ============================================================ */
.glance { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--d-3); margin-bottom: var(--d-6); }
.glance .g {
  background: var(--rd-surface); border: 1px solid var(--rd-line); border-radius: var(--rd-radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
  cursor: pointer;
}
.glance .g[role="button"] { cursor: pointer; }
.glance .g:hover { border-color: var(--blue-light); box-shadow: var(--rd-shadow-hover); }
.glance .g .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.glance .g .n { font-size: 22px; font-weight: var(--fw-demi); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.glance .g .l { font-size: 12px; color: var(--rd-ink-3); margin-top: 3px; }
.glance .g .n.warn { color: var(--danger); }

/* ============================================================
   YOUR DAY AT A GLANCE — prioritized, one-click focus items
   ============================================================ */
.day-glance {
  background: var(--rd-surface); border: 1px solid var(--rd-line);
  border-radius: var(--rd-radius); padding: 14px 16px; margin-bottom: var(--d-6);
}
.day-glance-head {
  font-size: 12px; font-weight: var(--fw-demi); letter-spacing: .04em;
  text-transform: uppercase; color: var(--rd-ink-3); margin-bottom: 8px;
}
.day-glance-narrative { margin: 0; font-size: 14px; line-height: 1.6; color: var(--rd-ink-1); }
.day-glance-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.day-glance-item > button {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: none; background: none; cursor: pointer; padding: 8px 6px; border-radius: var(--rd-radius-s);
  font-size: 14px; color: var(--rd-ink-1);
  transition: background var(--dur-fast) var(--ease-out);
}
.day-glance-item > button:hover { background: var(--rd-tint, rgba(50,137,231,0.06)); }
.day-glance-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }
.day-glance-item.urgent .dot { background: var(--danger); }
.day-glance-item.urgent > button { color: var(--danger); font-weight: var(--fw-demi); }
.day-glance-item .txt { flex: 1; min-width: 0; }
.day-glance-item .arr { color: var(--rd-ink-3); opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.day-glance-item > button:hover .arr { opacity: 1; }

/* ============================================================
   TICKET QUEUE (Freshdesk) — priority-sorted rows
   ============================================================ */
/* grid-template-columns: minmax(0,1fr) is load-bearing: a default grid column is
   min-width:auto (min-content), which lets the rows size to the FULL untruncated
   title and blocks the flex-shrink chain from reaching .tk-main — so the action
   cluster (Escalate → / Nudge →) clipped off the card edge no matter what flex the
   title column had. minmax(0,1fr) (+ .tk-row min-width:0) lets the row shrink so the
   title truncates and the actions always stay on-card. THIS is the real #37 fix. */
.tk { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.tk-row {
  display: flex; align-items: center; gap: 14px; min-width: 0; /* grid item must allow shrink (#37) */
  padding: 13px 16px; border-top: 1px solid var(--rd-line-soft); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.tk-row:first-child { border-top: none; }
.tk-row:hover { background: var(--rd-tint); }
/* flex layout: optional checkbox + fixed priority bar + growing main + right SLA.
   tk-main grows; everyone else holds size. min-width:0 lets the subject ellipsis.
   flex-BASIS:0 (not auto) is load-bearing: with basis:auto a long no-wrap title sizes
   this column to its CONTENT and shoves the flex-shrink:0 action cluster (FD ↗ / Draft →
   / Escalate →) off the right edge on a wide panel — the title showed full and "Escalate"
   got clipped. basis:0 grows the column from zero into the space LEFT OVER after the
   cluster claims its width, so the title always truncates and the actions always show. */
.tk-main { flex: 1 1 0; min-width: 0; overflow: hidden; }
.tk-pri { flex: 0 0 4px; width: 4px; height: 36px; border-radius: var(--radius-pill); }
.tk-pri.urgent { background: var(--danger); }
.tk-pri.high   { background: var(--yellow-semi-dark); }
.tk-pri.normal { background: var(--blue-light); }
.tk-main .sub { font-size: 14px; font-weight: var(--fw-demi); color: var(--rd-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* #37 — the meta line must SHRINK, not hold the title column wide. Without min-width:0
   + nowrap its content set a min-content width that pushed the (flex-shrink:0) action
   cluster into the right padding, clipping the Nudge arrow on long waiting-customer
   rows. min-width:0 lets it shrink; nowrap + the parent's overflow:hidden clip the
   trailing meta items instead of shoving the actions off the edge. */
.tk-main .meta { font-size: 12px; color: var(--rd-ink-3); margin-top: 3px; display: flex; gap: 8px; align-items: center; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.tk-main .meta .id { font-family: var(--font-mono); }
.tk-main .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--rd-ink-3); }
.tk-main .meta .co { font-weight: var(--fw-demi); color: var(--rd-ink-2); } /* customer name on a row (QA-055) */
.tk-sla { text-align: right; flex-shrink: 0; }
.tk-sla .pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: var(--fw-demi); padding: 4px 9px; border-radius: var(--radius-pill);
}
.tk-sla .pill.over { background: rgba(216,0,39,0.10); color: var(--danger); }
.tk-sla .pill.soon { background: var(--yellow-ultra-light); color: #8a5a00; }
.tk-sla .pill.ok   { background: var(--rd-sunken); color: var(--rd-ink-2); }
/* QA-017 — customer-wait: neutral blue, never the red breach treatment. */
.tk-sla .pill.wait { background: rgba(50,137,231,0.10); color: var(--blue-semi-dark, #1357a0); }
.tk-sla .who { font-size: 11px; color: var(--rd-ink-3); margin-top: 5px; }
/* Ball-in-court board (Phase 2) — the row's right side is ONE right-aligned cluster:
   pills on top, then a single no-wrap actions line, so every row lines up. Scoped to
   `.tk-sla.band` so the other queues (flat ticket queue, customer-waiting) are
   untouched. */
/* flex-shrink:1 + max-width let the cluster give room (the base .tk-sla is shrink:0),
   so a long subject never pushes the pills/actions off the panel edge (overflow:hidden
   was clipping them). Labels are also kept short (see hsBandPills / FD ↗ / Draft →). */
/* Deploy note: the #29/#30 band-row fix below merged in 3716c2e but its frontend
   pipeline was auto-cancelled by rapid pushes, so it never deployed. This touch
   forces a clean build:frontend + deploy:frontend (both gated on frontend-paths). */
/* #29/#30 — the cluster must NOT shrink: a long subject should truncate (the .sub
   ellipsis), not shove or clip the actions. flex-shrink:0 keeps the badge+action
   column at its natural width and consistent across rows; pills stay on ONE line
   (nowrap) so every row stacks identically (pills line + actions line), not ragged. */
.tk-sla.band { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.tk-sla.band .tk-pills { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.tk-sla.band .tk-actions { display: flex; gap: 14px; align-items: center; white-space: nowrap; }
.tk-sla.band .tk-fd { font-size: 12px; color: var(--rd-ink-3); font-weight: var(--fw-demi); } /* muted, secondary */
.tk-sla.band .tk-fd:hover { color: var(--rd-ink-2); }
.tk-sla.band .tk-action { font-size: 12px; font-weight: var(--fw-demi); color: var(--blue); background: none; border: none; padding: 0; cursor: pointer; } /* primary */
.tk-sla.band .tk-action:hover { text-decoration: underline; }
.tk-sla.band .tk-action-ghost { color: var(--text-muted, #888); } /* secondary (Escalate) */
/* QA-022 — per-day check-off control on queue/issue rows. */
.hw-check {
  flex-shrink: 0; width: 20px; height: 20px; margin-right: 2px; align-self: center;
  border: 1.5px solid var(--rd-line-strong, #c7ccd1); border-radius: 6px; background: var(--rd-card, #fff);
  color: #fff; font-size: 12px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s ease, border-color .12s ease;
}
.hw-check:hover { border-color: var(--success, #25c16f); }
.hw-check.on { background: var(--success, #25c16f); border-color: var(--success, #25c16f); }
.tk-row.done { opacity: .55; }
.tk-row.done .sub { text-decoration: line-through; }
/* QA-045 — "Today's focus" rows reuse the ticket-queue row, but lead with a
   ranked number badge instead of a priority bar. */
.focus-rank {
  flex: 0 0 22px; width: 22px; height: 22px; align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--blue-ultra-light, #e8f1fd);
  color: var(--blue-semi-dark, #1357a0); font-size: 12px; font-weight: var(--fw-demi);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   DEAL / PIPELINE (HubSpot)
   ============================================================ */
.deal-row {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-top: 1px solid var(--rd-line-soft); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.deal-row:first-child { border-top: none; }
.deal-row:hover { background: var(--rd-tint); }
.deal-co { font-size: 14px; font-weight: var(--fw-demi); color: var(--rd-ink); }
.deal-meta { font-size: 12px; color: var(--rd-ink-3); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.deal-stage { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: var(--fw-demi); color: var(--rd-ink-2); }
.deal-stage .d { width: 7px; height: 7px; border-radius: 50%; }
.deal-amt { text-align: right; font-size: 15px; font-weight: var(--fw-demi); color: var(--rd-ink); font-variant-numeric: tabular-nums; }
.deal-amt .next { font-size: 11px; color: var(--yellow-semi-dark); font-weight: var(--fw-demi); margin-top: 4px; }
.deal-amt .next.cold { color: var(--rd-ink-3); }

/* stage funnel mini */
.funnel { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; padding: 16px; }
.funnel .stage { text-align: center; }
.funnel .stage .bar { height: 5px; border-radius: var(--radius-pill); background: var(--blue); margin-bottom: 8px; }
.funnel .stage .v { font-size: 18px; font-weight: var(--fw-demi); letter-spacing: -0.01em; }
.funnel .stage .k { font-size: 10px; color: var(--rd-ink-3); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

/* ============================================================
   SCHEDULE (Zoom / Teams / Outlook calendar)
   ============================================================ */
.sched { display: grid; gap: 0; }
.sched-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rd-line-soft); }
.sched-row:first-child { border-top: none; }
.sched-time { font-size: 12px; font-weight: var(--fw-demi); color: var(--rd-ink-2); font-variant-numeric: tabular-nums; line-height: 1.3; }
.sched-time .dur { display: block; font-size: 10px; color: var(--rd-ink-3); font-weight: var(--fw-regular); }
.sched-body { min-width: 0; }
.sched-body .t { font-size: 13px; font-weight: var(--fw-demi); color: var(--rd-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-body .w { font-size: 12px; color: var(--rd-ink-3); display: flex; align-items: center; gap: 6px; margin-top: 2px; min-width: 0; }
.sched-body .w .wlbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-plat { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; color: #fff; font-size: 9px; font-weight: var(--fw-demi); flex-shrink: 0; }
.sched-join { font-size: 11px; font-weight: var(--fw-demi); color: var(--blue); border: 1px solid var(--blue-light); border-radius: var(--radius-pill); padding: 4px 11px; text-decoration: none; }
.sched-join:hover { background: var(--blue-ultra-light); }
.sched-actions { display: flex; align-items: center; gap: 6px; }
.sched-prep { font-size: 11px; font-weight: var(--fw-demi); color: var(--rd-ink-2); background: none; border: 1px solid var(--rd-line-strong); border-radius: var(--radius-pill); padding: 4px 10px; cursor: pointer; }
.sched-prep:hover { border-color: var(--blue-light); color: var(--blue-semi-dark); }
.sched-co { margin-left: 8px; font-size: 10px; font-weight: var(--fw-demi); letter-spacing: 0.02em; color: var(--blue-semi-dark); background: var(--blue-ultra-light); border-radius: var(--radius-pill, 999px); padding: 1px 8px; vertical-align: middle; }

/* Briefing greeting row + "Plan my morning" launcher */
.home-brief-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.home-brief-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.home-brief-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  font-size: 13px; font-weight: var(--fw-demi); color: #fff; cursor: pointer;
  background: var(--blue); border: none; border-radius: var(--rd-radius-s); padding: 9px 16px;
  box-shadow: var(--rd-shadow-hover);
}
.home-brief-btn:hover { background: var(--blue-semi-dark); }
@media (max-width: 600px) { .home-brief-top { flex-direction: column; } }
.sched-row.now { margin: 0 -12px; padding: 12px; background: var(--rd-tint); border-radius: var(--rd-radius-s); border-top: none; }
.sched-row.now + .sched-row { border-top: none; }
.sched-now-lbl { font-size: 9px; font-weight: var(--fw-demi); letter-spacing: 0.1em; color: var(--blue-semi-dark); }

/* ============================================================
   MESSAGES — Teams DMs + Outlook (needs attention)
   ============================================================ */
.msg-row { display: grid; grid-template-columns: 32px 1fr; gap: 11px; padding: 11px 0; border-top: 1px solid var(--rd-line-soft); cursor: pointer; }
.msg-row:first-child { border-top: none; }
.msg-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: var(--fw-demi); position: relative; }
.msg-av .badge { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--rd-surface); display: grid; place-items: center; font-size: 7px; color: #fff; }
.msg-body { min-width: 0; }
.msg-body .top { display: flex; align-items: baseline; gap: 6px; }
.msg-body .from { font-size: 13px; font-weight: var(--fw-demi); color: var(--rd-ink); }
.msg-body .time { margin-left: auto; font-size: 11px; color: var(--rd-ink-3); flex-shrink: 0; }
.msg-reason { font-size: 10px; font-weight: var(--fw-demi); letter-spacing: 0.02em; padding: 1px 7px; border-radius: var(--radius-pill, 999px); white-space: nowrap; }
.msg-reason.over { background: rgba(224,49,49,0.12); color: var(--danger, #e03131); }
.msg-reason.flag { background: rgba(249,172,6,0.16); color: #8a5a00; }
.msg-reason.mention { background: rgba(50,137,231,0.12); color: var(--blue-semi-dark, #1357a0); }
.msg-reason.imp { background: rgba(123,91,245,0.12); color: #5b3bd1; }
.msg-reason.alert { background: rgba(224,49,49,0.16); color: var(--danger, #e03131); }
.msg-body .snip { font-size: 12.5px; color: var(--rd-ink-2); line-height: 1.4; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg-body .snip.unread { color: var(--rd-ink); font-weight: var(--fw-medium); }

/* ============================================================
   ASK launcher — the AI composer surfaced on home
   ============================================================ */
.ask {
  background: var(--rd-surface); border: 1px solid var(--rd-line-strong); border-radius: var(--rd-radius);
  box-shadow: var(--rd-shadow-hover); padding: var(--card-pad);
}
.ask.dark {
  background:
    radial-gradient(700px 360px at 85% 10%, rgba(50,137,231,0.30), transparent 60%),
    linear-gradient(180deg, #0A1B2E 0%, #071324 100%);
  border-color: rgba(255,255,255,0.10); color: #fff;
}
.ask .eye { font-size: 11px; font-weight: var(--fw-demi); letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-semi-dark); }
.ask.dark .eye { color: var(--yellow); }
.ask h2 { font-size: 24px; letter-spacing: -0.02em; margin: 8px 0 0; }
.ask.dark h2 { color: #fff; }
.ask p { font-size: 13px; color: var(--rd-ink-2); margin: 8px 0 0; max-width: 56ch; line-height: 1.5; }
.ask.dark p { color: rgba(255,255,255,0.66); }
.ask-box {
  margin-top: 18px; display: flex; align-items: center; gap: 12px;
  background: var(--rd-sunken); border: 1px solid transparent; border-radius: var(--rd-radius-s);
  padding: 13px 14px; cursor: text;
}
.ask-box:focus-within { border-color: var(--blue-light); }
/* Slim command bar (QA-054) — the support dashboard's compact AI input, replacing
   the hero "Ask UNIIQ" panel so the day's WORK leads. One line, light, no title. */
.home-brief-ask { margin: 10px 0 16px; }
.ask.ask-slim { padding: 8px 10px; box-shadow: var(--shadow-xs); }
.ask.ask-slim .ask-box { margin-top: 0; background: var(--rd-surface); border: 1px solid var(--rd-line); }
.ask.ask-slim .ask-box:focus-within { border-color: var(--blue-light); }
/* The dark "Ask UNIIQ" hero's input box reads BLUE on the navy panel (blue-tinted
   fill + border), pairing with the solid-blue submit (.go) below. */
.ask.dark .ask-box { background: rgba(50,137,231,0.20); border-color: rgba(50,137,231,0.45); }
.ask.dark .ask-box:focus-within { border-color: var(--blue-light); background: rgba(50,137,231,0.28); }
.ask-box input.ph { flex: 1; font-size: 14px; color: var(--rd-ink); background: none; border: none; outline: none; font-family: inherit; }
.ask-box input.ph::placeholder { color: var(--rd-ink-3); }
.ask-box .ph { flex: 1; font-size: 14px; color: var(--rd-ink-3); }
.ask.dark .ask-box input.ph { color: #fff; }
.ask.dark .ask-box input.ph::placeholder { color: rgba(255,255,255,0.5); }
.ask.dark .ask-box .ph { color: rgba(255,255,255,0.5); }
.ask-box .go { width: 32px; height: 32px; border-radius: 8px; background: var(--blue); color: #fff; display: grid; place-items: center; flex-shrink: 0; border: none; cursor: pointer; }
.ask-box .go:hover { background: var(--blue-semi-dark); }
.ask-sg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.ask-sg .s {
  font-size: 12.5px; font-weight: var(--fw-medium); color: var(--rd-ink-2);
  background: var(--rd-surface); border: 1px solid var(--rd-line-strong);
  border-radius: var(--radius-pill); padding: 7px 13px; cursor: pointer;
}
.ask-sg .s:hover { border-color: var(--blue-light); color: var(--rd-ink); }
.ask.dark .ask-sg .s { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.82); }

/* "Open UnilogIQ" rides in the suggestion row as the trailing pill
   (it carries the .s chip base too), styled blue-tinted so it reads as the
   primary "enter the full workspace" action while matching the chips' height. */
.ask-sg .ask-open {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-weight: var(--fw-demi, 600); color: var(--blue-semi-dark);
  background: rgba(50,137,231,0.08); border-color: var(--blue-light);
  transition: background .12s, border-color .12s, transform .12s;
}
.ask-sg .ask-open:hover { background: rgba(50,137,231,0.15); border-color: var(--blue); color: var(--blue-semi-dark); transform: translateY(-1px); }
.ask-sg .ask-open:disabled { opacity: .5; cursor: default; transform: none; }
.ask-open .ic { color: var(--blue); font-size: 12px; line-height: 1; }
.ask-open .arr { color: var(--blue-semi-dark); font-weight: 400; transition: transform .12s; }
.ask-sg .ask-open:hover .arr { transform: translateX(2px); }
.ask.dark .ask-sg .ask-open { background: rgba(50,137,231,0.22); border-color: rgba(50,137,231,0.55); color: #d6e8ff; }
.ask.dark .ask-sg .ask-open:hover { background: rgba(50,137,231,0.30); border-color: rgba(50,137,231,0.7); color: #eaf3ff; }
.ask.dark .ask-open .ic { color: #7db8ff; }
.ask.dark .ask-open .arr { color: #d6e8ff; }

.ask-box .ask-lead {
  color: var(--rd-ink-3); line-height: 1; flex-shrink: 0;
  background: none; border: none; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ask-box .ask-lead:hover { color: var(--blue); }
.ask-box .ask-lead svg { display: block; }
.ask.dark .ask-box .ask-lead { color: rgba(255,255,255,0.5); }
.ask.dark .ask-box .ask-lead:hover { color: #fff; }

/* ---------- Copilot home — calm, centered, Claude-style canvas ---------- */
.home-copilot { max-width: 880px; }
.copilot-hero { text-align: center; padding-top: clamp(24px, 7vh, 80px); margin-bottom: var(--d-6, 28px); }
.copilot-spark { color: var(--blue); display: flex; justify-content: center; margin-bottom: 14px; }
.copilot-hero h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -0.025em; line-height: 1.08; margin: 0; }
.copilot-sub { font-size: 14px; color: var(--rd-ink-2); margin-top: 10px; }
.copilot-sub b { color: var(--rd-ink); font-weight: var(--fw-demi); }
.copilot-stage { max-width: 720px; margin: 0 auto; }

/* The hero composer — bigger, rounder; the page's focal point. */
.ask.ask-hero { box-shadow: 0 8px 30px rgba(9,26,50,0.08); border-radius: 20px; padding: 8px; border-color: var(--rd-line); }
/* Dark hero (Copilot): keep the navy panel cohesive — darker shadow, faint hairline. */
.ask.dark.ask-hero { border-color: rgba(255,255,255,0.10); box-shadow: 0 10px 34px rgba(7,19,36,0.5); }
.ask.ask-hero .ask-box { margin-top: 0; background: transparent; border: none; padding: 12px 14px; }
.ask.ask-hero .ask-box input.ph { font-size: 16px; }
.ask.ask-hero .ask-box .ask-lead {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--rd-line-strong); color: var(--rd-ink-2); font-size: 18px; flex-shrink: 0;
}
.ask.ask-hero .ask-box .go { width: 34px; height: 34px; border-radius: 10px; }
/* Suggestion chips centered under the hero composer. */
.ask.ask-hero .ask-sg { justify-content: center; margin-top: 16px; }
.home-copilot .home-copilot-grid { display: grid; grid-template-columns: 1fr 300px; gap: var(--d-5, 16px); margin-top: var(--d-7, 36px); }

/* recents under the ask */
.recents { display: grid; gap: 0; }
.recent-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid var(--rd-line-soft); cursor: pointer; }
.recent-row:first-child { border-top: none; }
.recent-row .ic { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0; background: var(--rd-sunken); color: var(--rd-ink-2); }
.recent-row .t { font-size: 13px; font-weight: var(--fw-medium); color: var(--rd-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-row .when { margin-left: auto; font-size: 11px; color: var(--rd-ink-3); flex-shrink: 0; }
.recent-row .kind { font-size: 10px; font-weight: var(--fw-demi); letter-spacing: 0.06em; text-transform: uppercase; color: var(--rd-ink-3); }

/* favorites mini strip */
.fav-mini { display: flex; flex-wrap: wrap; gap: 8px; }
.fav-mini .f { display: inline-flex; align-items: center; gap: 8px; background: var(--rd-surface); border: 1px solid var(--rd-line); border-radius: var(--radius-pill); padding: 6px 13px 6px 6px; font-size: 13px; font-weight: var(--fw-demi); color: var(--rd-ink); cursor: pointer; }
.fav-mini .f:hover { border-color: var(--blue-light); }
.fav-mini .f .ai { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: var(--fw-demi); }

/* small source logos used inline */
.src-fd { background: #25C16F; }
.src-hs { background: #FF7A59; }
.src-jira { background: #2684FF; }
.src-teams { background: #5B5BD6; }
.src-zoom { background: #2D8CFF; }
.src-outlook { background: #0F6CBD; }

/* ---------- Apps drawer (the demoted launcher) ---------- */
.home-apps-drawer-backdrop { position: fixed; inset: 0; background: rgba(9,26,50,0.32); z-index: 80; display: flex; justify-content: flex-end; }
.home-apps-drawer { width: min(560px, 92vw); height: 100%; background: var(--rd-canvas, #f6f7f9); box-shadow: -8px 0 40px rgba(9,26,50,0.18); display: flex; flex-direction: column; animation: home-drawer-in var(--dur-base, 200ms) var(--ease-out); }
@keyframes home-drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.home-apps-drawer .hd-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--rd-line); background: var(--rd-surface); }
.home-apps-drawer .hd-top h2 { font-size: var(--pt-section); margin: 0; }
.home-apps-drawer .hd-body { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }

/* panel header "ask UnilogIQ" action (replaces the old external link) */
.hw-ask-link {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: 12px; font-weight: var(--fw-demi); color: var(--blue-semi-dark);
}
.hw-ask-link:hover { color: var(--blue); text-decoration: underline; }

/* widget loading / empty / error states */
.hw-state { padding: 18px 16px; font-size: 13px; color: var(--rd-ink-3); }

/* Day-loop panels — the wrap-up carry-forward, "where you left off", and
   "today's focus" rendered as readable cards instead of a gray text wall. */
.day-panel {
  margin-top: 12px;
  background: var(--rd-surface);
  border: 1px solid var(--rd-line);
  border-left: 3px solid var(--blue);
  border-radius: var(--rd-radius-m, 12px);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}
.day-panel.muted { border-left-color: var(--rd-line-strong, #c7ccd1); background: var(--rd-surface-2); }
.day-panel-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: var(--fw-demi); color: var(--rd-ink);
  margin-bottom: 8px;
}
.day-panel-head .ic { font-size: 15px; line-height: 1; }
.day-panel-head .sub { margin-left: auto; font-weight: 400; font-size: 11.5px; color: var(--rd-ink-3); }
.day-panel-body { font-size: 13.5px; line-height: 1.6; color: var(--rd-ink-2); }
.day-panel-body ol { margin: 4px 0 0; padding-left: 20px; }
.day-panel-body ol li { margin-bottom: 5px; }
.day-panel-note {
  margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--rd-line);
  font-size: 12px; color: var(--rd-ink-3);
}
.hw-skel { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--rd-sunken) 25%, var(--rd-tint) 37%, var(--rd-sunken) 63%); background-size: 400% 100%; animation: hw-shimmer 1.2s ease-in-out infinite; margin: 10px 16px; }
@keyframes hw-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

@media (max-width: 960px) {
  .home-grid, .home-split, .home-copilot-grid { grid-template-columns: 1fr !important; }
  .glance { grid-template-columns: 1fr 1fr; }
}
