/* ═══════════════════════════════════════════════════════════════════
   GLASS design system — one sheet, two skins.
   The client portal (/app) and the staff admin (/admin) share every
   component; the admin flips the sidebar dark via [data-theme="admin"].
   Keep it token-driven and DRY — see docs/15-GLASS.md.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #98a2b3;
  --line: #e4e9f2;

  --accent: #2643e9;
  --accent-dark: #1d34bd;
  --accent-soft: #eef1fe;
  --green: #0e9f6e;
  --green-soft: #e7f8f1;
  --amber: #d97706;
  --amber-soft: #fdf3e3;
  --red: #dc2626;
  --red-soft: #fdecec;
  --violet: #7c3aed;
  --violet-soft: #f3eefe;

  --nav-bg: #ffffff;
  --nav-ink: #475467;
  --nav-ink-dim: #98a2b3;
  --nav-active-bg: #eef1fe;
  --nav-active-ink: #2643e9;
  --nav-line: #e4e9f2;

  --gold: #c9a227;
  --gold-soft: #faf3dd;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px -6px rgba(16, 24, 40, .08);
  /* Ares Projects brand typography: Poppins text, Cinzel display headings. */
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Cinzel", "Georgia", serif;
}

[data-theme="admin"] {
  --nav-bg: #0e1526;
  --nav-ink: #9daac6;
  --nav-ink-dim: #5b6880;
  --nav-active-bg: #1d2a4a;
  --nav-active-ink: #ffffff;
  --nav-line: #1c2540;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: .015em; }
h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

/* ───────── shell: sidebar + main ───────── */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 18px 12px;
}
.sidebar .wordmark {
  display: flex; align-items: baseline; gap: 7px;
  padding: 4px 10px 18px;
}
.wordmark .glyph {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700; letter-spacing: .14em;
  color: var(--nav-active-ink);
}
[data-theme="admin"] .wordmark .glyph { color: #fff; }
.wordmark .by { font-size: 10.5px; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--nav-ink); font-weight: 500;
  transition: background .12s ease;
}
.nav-item:hover { background: var(--nav-active-bg); text-decoration: none; }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-active-ink); font-weight: 600; }
.nav-item.nav-child { padding-left: 28px; font-size: 13.5px; }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.nav-item .count {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px;
}
.nav-section { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--nav-ink-dim); padding: 16px 12px 5px; }
.sidebar .spacer { flex: 1; }
.sidebar .whoami { padding: 10px 12px; font-size: 12px; color: var(--nav-ink-dim); border-top: 1px solid var(--nav-line); }
.sidebar .whoami b { color: var(--nav-ink); display: block; font-size: 12.5px; }

.main { flex: 1; min-width: 0; padding: 26px 32px 60px; }

/* ───────── masquerade banner ───────── */

.masq-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(90deg, #101828, #26324d);
  color: #fff; border-radius: var(--radius);
  padding: 10px 16px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.masq-banner .dot { width: 8px; height: 8px; border-radius: 99px; background: #ffd166; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.masq-banner form { margin-left: auto; }
.masq-banner .masq-switch form { margin-left: 0; }

/* quick customer switcher (masquerade banner, rightmost) */
.masq-switch { position: relative; }
.masq-switch-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 80;
  width: 300px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 10px;
}
.masq-switch-panel.open { display: block; }
.masq-switch-results { margin-top: 6px; max-height: 260px; overflow-y: auto; }
.masq-switch-results .hit {
  padding: 8px 10px; border-radius: 7px; cursor: pointer;
  font-size: 13.5px; color: var(--ink); display: flex; justify-content: space-between; gap: 8px;
}
.masq-switch-results .hit small { color: var(--ink-3); }
.masq-switch-results .hit:hover, .masq-switch-results .hit.sel { background: var(--accent-soft); color: var(--accent); }
.masq-switch-results .none { padding: 8px 10px; color: var(--ink-3); font-size: 13px; }

/* ───────── page header ───────── */

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--ink-2); font-size: 13.5px; margin-top: 3px; }
.page-head .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.csm-pickers { display: flex; gap: 8px; align-items: center; }
.csm-pickers select[name="channel"] { width: 240px; }
.csm-pickers select[name="brand"] { width: 260px; }

/* marketplace switcher */
.mkt-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.mkt {
  padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.mkt.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.mkt.soon { opacity: .45; font-weight: 500; }
.csm-range { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.garden-filters {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.garden-section-pick {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.garden-section-pick select { width: auto; min-width: 240px; }
.garden-section .card-head { align-items: flex-start; }
.garden-subhead {
  margin: 22px 0 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-2);
}
.garden-section .table + .garden-subhead { margin-top: 28px; }

/* ───────── cards & grids ───────── */

.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.ads-kpis {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}
.ads-tile { padding: 12px 14px; box-shadow: none; }
.ads-kpis .ads-tile .value { font-size: 20px; margin-top: 4px; }
.ads-kpis .ads-tile .note { margin-top: 2px; }
.ads-ico {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2);
}
.ads-ico.negate, .ads-ico.blind_spend { background: var(--red-soft); color: var(--red); border-color: #f5c2c2; }
.ads-ico.harvest { background: var(--green-soft); color: var(--green); border-color: #bfe9d9; }
.ads-ico.bid_cut, .ads-ico.pause { background: var(--amber-soft); color: var(--amber); border-color: #f3d7a3; }
.ads-ico.budget_shift, .ads-ico.placement { background: var(--accent-soft); color: var(--accent); border-color: #c9d2fb; }
button.mkt { cursor: pointer; font-family: var(--font); appearance: none; }
.ads-kpi-head { flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.ads-kpi-head .right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid.two { grid-template-columns: 1.6fr 1fr; }
.grid.halves { grid-template-columns: 1fr 1fr; }
.grid.thirds { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1100px) { .grid.two, .grid.halves, .grid.thirds { grid-template-columns: 1fr; } }

.csm-profile-tickets { align-items: stretch; }
.csm-profile-tickets > .card,
.csm-profile-tickets > .card-wrap > .card { height: 100%; }
.ticket-mini-list { max-height: 320px; overflow-y: auto; }
.csm-profile-tickets .ticket-mini-list { max-height: 28rem; }
.ticket-mini-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.tickets-board { margin-bottom: 22px; }
.tickets-board-head { margin-bottom: 14px; }
.tickets-board-head h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.tickets-board-head p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 13.5px;
  max-width: 64ch;
}
.tickets-board-note { color: var(--ink-3) !important; font-size: 12.5px !important; }
.tickets-piles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .tickets-piles { grid-template-columns: 1fr; }
}
.tickets-pile { min-width: 0; }
.tickets-pile.is-ares { border-top: 3px solid var(--accent); }
.tickets-pile.is-client { border-top: 3px solid var(--gold); }
.tickets-pile-head .card-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .015em;
  text-transform: none;
}
.tickets-pile-blurb {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 13.5px;
}
.tickets-pile .section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
  margin: 16px 0 4px;
}
.tickets-pile .section-label .count {
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  border-radius: 99px;
  padding: 1px 7px;
  letter-spacing: 0;
  text-transform: none;
}
.tickets-pile-list { max-height: none; }
.tickets-pile .empty { padding: 14px 6px; font-size: 13.5px; }
.tickets-pile-done { opacity: .78; }
.tickets-pile .row.ticket-row {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px 2px;
}
.tickets-pile .ticket-row-main { flex: 1; min-width: 0; }
.tickets-pile .ticket-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-transform: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}
.tickets-pile .ticket-title a {
  color: inherit;
  text-decoration: none;
}
.tickets-pile .ticket-title a:hover { text-decoration: underline; }
.tickets-pile .ticket-row-meta {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tickets-pile .ticket-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
}
.tickets-pile .ticket-inline-edit {
  flex: 1 1 100%;
  margin: 2px 0 4px;
  padding: 10px 0 2px;
  border-top: 1px solid var(--line);
}
.tickets-pile .ticket-inline-edit textarea { min-height: 64px; }
.tickets-pile .row.is-done .ticket-title { font-weight: 500; color: var(--ink-2); }
.tickets-pile .row.is-done .ticket-row-meta { color: #0b6b4a; }
.ticket-page-title {
  font-size: 26px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-transform: none;
  max-width: 42rem;
}
.ticket-edit-panel { max-width: 42rem; }
.ticket-edit-panel textarea { min-height: 72px; }
.tickets-pile .ws-add-promise {
  margin: 12px 0 4px;
  padding: 0 0 12px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}
.tickets-pile .ws-add-promise .csm-scrum-ask-row { flex-wrap: wrap; }
.tickets-pile .ws-add-promise input[data-shared-title] { flex: 1; min-width: 140px; }
.tickets-pile .ws-add-promise input[data-shared-due] { width: auto; max-width: 160px; flex: 0 0 160px; }
.csm-profile-tickets .profile-grid { grid-template-columns: 1fr; }
@media (max-width: 1100px) {
  .csm-profile-tickets .profile-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 900px) {
  .csm-profile-tickets .profile-grid { grid-template-columns: 1fr; }
}

.csm-profile-hero {
  display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px;
}
.csm-profile-hero-copy { flex: 1; min-width: 0; }
.csm-profile-hero-copy .card-head { margin-bottom: 0; align-items: flex-start; }
.brand-logo-wrap {
  width: 88px; height: 88px; flex-shrink: 0;
  border-radius: 18px; background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 10px; box-shadow: inset 0 0 0 1px rgba(15,23,42,.03);
}
.brand-logo-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-logo-wrap.portal {
  width: 48px; height: 48px; border-radius: 12px; padding: 4px;
}
.portal-tenant {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 14px; margin-bottom: 8px;
  border-bottom: 1px solid var(--nav-line);
}
.portal-tenant-copy { min-width: 0; }
.portal-tenant-name {
  font-size: 13.5px; font-weight: 700; color: var(--nav-ink);
  letter-spacing: -0.02em; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.portal-tenant-poc {
  font-size: 11.5px; color: var(--nav-ink-dim); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-logo-wrap .ph {
  font-size: 36px; font-weight: 800; letter-spacing: -0.04em; color: var(--ink);
  line-height: 1;
}
.csm-profile-hero .brand-name {
  font-size: 22px; font-weight: 800; letter-spacing: -0.03em;
  color: var(--ink); margin: 4px 0 6px; line-height: 1.15;
}
.csm-profile-hero .brand-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.card .card-title { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.card .card-title .hint { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.card-head { display: flex; align-items: center; margin-bottom: 12px; }
.card-head .right { margin-left: auto; }

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px 14px;
  margin-bottom: 12px;
}
.profile-grid label, .profile-goals { display: block; }
.profile-grid span, .profile-goals span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.profile-goals textarea { width: 100%; min-height: 72px; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }

#csm-client-profile.is-locked #csm-profile-save,
#csm-client-profile.is-locked #csm-profile-cancel { display: none; }
#csm-client-profile:not(.is-locked) #csm-profile-unlock { display: none; }
.ws-game {
  margin: 10px 0 4px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.ws-game .label {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0;
}
.ws-game b { font-size: 14.5px; }

#csm-scrum:not(.is-editing) #csm-scrum-save,
#csm-scrum:not(.is-editing) #csm-scrum-cancel,
#csm-scrum:not(.is-editing) .csm-scrum-edit { display: none; }
#csm-scrum.is-editing #csm-scrum-edit,
#csm-scrum.is-editing #csm-scrum-plan,
#csm-scrum.is-editing .csm-scrum-view { display: none; }
.csm-scrum-edit-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin: 0 0 8px;
}
.csm-scrum-item-row { grid-template-columns: 1fr 1fr; }
.csm-scrum-item-row .csm-scrum-item-title { grid-column: 1 / -1; }
.csm-scrum-edit .f { margin: 0 0 8px; }

.ws-rec-group { margin: 4px 0 16px; }
.ws-rec-group .card-title { margin-bottom: 8px; }
.ws-sent-warm { color: #047857; background: #ecfdf5; border-color: #bbf7d0; }
.ws-sent-concerned { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.ws-sent-mixed { color: #b45309; background: #fff7ed; border-color: #f3d19c; }
.ws-sent-steady { color: var(--ink-2); }
.ws-vault { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.ws-vault summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ws-vault ul { list-style: none; margin: 8px 0 0; padding: 0; }
.ws-vault li { padding: 10px 0; border-top: 1px solid var(--line); }
.ws-pl-drawer {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  background: var(--surface);
}
.ws-pl-drawer > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ws-pl-drawer > .card { box-shadow: none; border: 0; padding: 12px 0 0; }

#csm-client-profile.is-locked input,
#csm-client-profile.is-locked textarea {
  border-color: transparent;
  background: var(--surface-2);
  cursor: default;
  resize: none;
  box-shadow: none;
}
#csm-client-profile.is-locked input:focus,
#csm-client-profile.is-locked textarea:focus {
  outline: none;
  border-color: transparent;
}

.kpi .label { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.kpi .delta { font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.kpi .delta.up { color: var(--green); }
.kpi .delta.down { color: var(--red); }
.kpi .note { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

/* ───────── badges, chips, pills ───────── */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2.5px 9px; border-radius: 99px;
}
.badge.low       { background: #eef2f7; color: #5b6880; }
.badge.medium    { background: var(--accent-soft); color: var(--accent); }
.badge.high      { background: var(--amber-soft); color: var(--amber); }
.badge.critical  { background: var(--red-soft); color: var(--red); }
.badge.green     { background: var(--green-soft); color: var(--green); }
.badge.red       { background: var(--red-soft); color: var(--red); }
.badge.amber     { background: var(--amber-soft); color: var(--amber); }
.badge.violet    { background: var(--violet-soft); color: var(--violet); }
.badge.neutral   { background: #eef2f7; color: #5b6880; }
.badge.sample    { background: #fff8e6; color: #a16207; border: 1px dashed #eab308; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
}
.chip .dot { width: 7px; height: 7px; border-radius: 99px; }
.dot.green { background: var(--green); } .dot.amber { background: var(--amber); }
.dot.red { background: var(--red); } .dot.critical { background: #7f1d1d; }
.dot.gray { background: var(--ink-3); }

/* SLA state colouring */
.sla.on_track { color: var(--green); font-weight: 600; }
.sla.at_risk { color: var(--amber); font-weight: 700; }
.sla.breached { color: var(--red); font-weight: 700; }
.sla.met { color: var(--ink-3); }

/* progress stages for customer-owned tickets */
.stages { display: inline-flex; gap: 4px; align-items: center; }
.stage { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 99px; background: #eef2f7; color: #98a2b3; }
.stage.hit { background: var(--green-soft); color: var(--green); }

/* ───────── buttons & forms ───────── */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  border-radius: 10px; padding: 8px 16px; cursor: pointer;
  border: 1px solid transparent; transition: filter .12s ease;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.go { background: var(--green); color: #fff; }
.btn.danger { background: var(--red-soft); color: var(--red); border-color: #f5c2c2; }
.btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn.sm { font-size: 12.5px; padding: 5px 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], textarea, select {
  font-family: var(--font); font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; width: 100%;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 12px 0 5px; }

/* ───────── tables & list rows ───────── */

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-3); padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.click:hover { background: var(--surface-2); cursor: pointer; }

.rowlist .row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.rowlist .row:last-child { border-bottom: none; }
.row .thumb {
  width: 44px; height: 44px; border-radius: 10px; object-fit: cover;
  background: var(--surface-2); flex-shrink: 0; border: 1px solid var(--line);
}
.row .thumb.ph { display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--ink-3); }
.row .title { font-weight: 600; }
.row .meta { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.row .right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.recs-table td { vertical-align: top; }
.recs-table .recs-why { color: var(--ink-2); font-size: 13px; line-height: 1.45; max-width: 46ch; }
.recs-table .recs-go { text-align: right; width: 1%; white-space: nowrap; vertical-align: middle; }
.rec-lane { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.rec-lane-ads { border-color: #f3d19c; color: #b45309; background: #fff7ed; }
.rec-lane-stock { border-color: #fecaca; color: #b91c1c; background: #fef2f2; }
.rec-lane-reviews { border-color: #fde68a; color: #a16207; background: #fffbeb; }
.rec-lane-catalogue { border-color: #c4b5fd; color: #6d28d9; background: #f5f3ff; }
.rec-lane-growth { border-color: #bbf7d0; color: #047857; background: #ecfdf5; }
.rec-lane-profit { border-color: #a7f3d0; color: #047857; background: #ecfdf5; }

/* ───────── inventory runway ───────── */

.runway { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.runway .track { flex: 1; height: 9px; border-radius: 99px; background: #edf0f7; overflow: hidden; }
.runway .fill { height: 100%; border-radius: 99px; }
.fill.green { background: var(--green); } .fill.amber { background: var(--amber); }
.fill.red { background: var(--red); } .fill.critical { background: #7f1d1d; }
.runway .days { font-size: 12.5px; font-weight: 700; width: 46px; text-align: right; }

/* ───────── ticket timeline ───────── */

.timeline { margin-top: 14px; }
.tl-event { display: flex; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.tl-event:last-child { border-bottom: none; }
.tl-icon { width: 30px; height: 30px; border-radius: 99px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line); }
.tl-body { flex: 1; min-width: 0; }
.tl-head { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tl-head b { color: var(--ink); }
.tl-text { margin-top: 4px; white-space: pre-wrap; }
.tl-event.internal { background: var(--amber-soft); border-radius: var(--radius-sm); padding: 11px 12px; border-bottom: none; margin: 4px 0; }
.tl-event.internal .tl-icon { background: #fff; }

/* ───────── landing & login ───────── */

.landing { min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1200px 500px at 70% -10%, #dfe6ff 0%, transparent 60%), var(--bg); }
.landing-nav { display: flex; align-items: center; padding: 22px 48px; }
.landing-nav .right { margin-left: auto; }
.hero { max-width: 880px; margin: 60px auto 30px; text-align: center; padding: 0 24px; }
.hero h1 { font-size: 52px; letter-spacing: -0.03em; line-height: 1.06; }
.hero h1 .grad { background: linear-gradient(90deg, var(--accent), #7c3aed);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 17px; color: var(--ink-2); max-width: 620px; margin: 18px auto 26px; }
.feature-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; max-width: 1020px; margin: 30px auto 80px; padding: 0 24px; }
.landing-foot { margin-top: auto; padding: 22px 48px; color: var(--ink-3); font-size: 12.5px; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 400px at 50% -5%, #dfe6ff 0%, transparent 60%), var(--bg); }
.auth-card { width: 400px; max-width: calc(100vw - 32px); }
.auth-card .card { padding: 30px; }
.form-error { background: var(--red-soft); color: var(--red); border-radius: 10px;
  padding: 10px 13px; font-size: 13px; font-weight: 600; margin-top: 12px; display: none; }

/* ───────── report page ───────── */

.report-wrap { max-width: 900px; margin: 0 auto; padding: 40px 24px 80px; }
.report-band { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.score-cell { text-align: center; padding: 14px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.score-cell .n { font-size: 26px; font-weight: 800; }
.opt-block { background: var(--green-soft); border: 1px solid #bfe9d9; border-radius: var(--radius-sm); padding: 12px 15px; margin-top: 10px; }
.cur-block { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 15px; }
.wm-list { margin: 8px 0 0; padding-left: 0; list-style: none; }
.wm-list li { padding: 3px 0 3px 24px; position: relative; font-size: 13.5px; }
.wm-list li.y::before { content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 800; }
.wm-list li.n::before { content: "✕"; position: absolute; left: 4px; color: var(--red); font-weight: 800; }

/* ───────── misc ───────── */

.empty { text-align: center; color: var(--ink-3); padding: 34px 10px; }
.empty .big { font-size: 30px; margin-bottom: 8px; }
.hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.right-al { margin-left: auto; }

#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #101828; color: #fff; border-radius: 12px; padding: 11px 20px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 60;
}
#toast.show { opacity: 1; }
#toast.err { background: var(--red); }

.chart { width: 100%; height: 320px; }
.chart.tall { height: 380px; }
.chart.short { height: 230px; }

.billables-hero {
  border: 1px solid #ead9a8;
  background: linear-gradient(180deg, #fffdf6 0%, var(--surface) 56px);
}
.billables-lede {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--ink-2);
  max-width: 72ch;
  line-height: 1.45;
}
.billables-cash {
  margin: 4px 0 0;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.45;
}
tr.billables-on td { background: var(--accent-soft); }
.billables-hero .grid.kpis .card.kpi { box-shadow: none; }

/* ───────── chic financials ───────── */

.fin-rows { font-variant-numeric: tabular-nums; }
.fin-rows .fr {
  display: flex; align-items: baseline; gap: 12px;
  padding: 7px 2px; border-bottom: 1px solid var(--surface-2);
}
.fin-rows .fr:last-child { border-bottom: none; }
.fin-rows .fr .lbl { color: var(--ink-2); font-size: 13px; }
.fin-rows .fr .dots { flex: 1; border-bottom: 1px dotted var(--line); transform: translateY(-3px); }
.fin-rows .fr .amt { font-weight: 600; font-size: 13.5px; }
.fin-rows .fr.total { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; border-bottom: none; }
.fin-rows .fr.total .lbl { font-weight: 700; color: var(--ink); font-size: 13.5px; text-transform: uppercase; letter-spacing: .04em; }
.fin-rows .fr.total .amt { font-size: 17px; font-weight: 800; }
.fin-rows .fr.subtotal .lbl { font-weight: 600; color: var(--ink); }
.fin-rows .fr.subtotal .amt { font-weight: 700; }
.amt.pos { color: var(--green); } .amt.neg { color: var(--red); }

/* raw sheet backup view — collapsed by default, styled when open */
details.raw-sheet { margin-top: 10px; }
details.raw-sheet summary {
  cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .06em; padding: 6px 0;
}
details.raw-sheet summary:hover { color: var(--accent); }
.sheet-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.sheet-table th { position: sticky; top: 0; background: var(--surface-2); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 7px 9px;
  border-bottom: 1px solid var(--line); text-align: left; }
.sheet-table td { padding: 6px 9px; border-bottom: 1px solid var(--surface-2); }
.sheet-table tr:nth-child(even) td { background: var(--surface-2); }
.sheet-table td:first-child { font-weight: 600; }

/* ───────── markdown body (SOPs, reports, briefs) ───────── */

.md-body { font-size: 14px; line-height: 1.65; }
.md-body h1 { font-size: 22px; margin: 4px 0 12px; }
.md-body h2 { font-size: 17px; margin: 22px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.md-body h3 { font-size: 14.5px; margin: 16px 0 6px; }
.md-body table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.md-body th, .md-body td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; }
.md-body th { background: var(--surface-2); font-weight: 700; }
.md-body code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 12.5px; }
.md-body pre { background: #101828; color: #e5e9f2; border-radius: 10px; padding: 12px 15px; overflow-x: auto; font-size: 12.5px; }
.md-body pre code { background: none; border: none; color: inherit; }
.md-body blockquote { border-left: 3px solid var(--accent); margin: 10px 0; padding: 4px 14px; color: var(--ink-2); }
.md-body img { max-width: 100%; }

/* ───────── Ask Glass chat ───────── */

.chat-layout { display: grid; grid-template-columns: 290px 1fr; gap: 16px; align-items: start; }
@media (max-width: 950px) { .chat-layout { grid-template-columns: 1fr; } }
.chat-list .thread {
  display: block; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid transparent; margin-bottom: 4px; color: var(--ink);
}
.chat-list .thread:hover { background: var(--surface-2); text-decoration: none; }
.chat-list .thread.on { background: var(--accent-soft); border-color: #d5dcfb; }
.chat-list .t-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list .t-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 6px; align-items: center; }

.chat-pane { display: flex; flex-direction: column; min-height: 60vh; }
.chat-scroll { flex: 1; overflow-y: auto; max-height: 62vh; padding: 6px 2px; }
.csm-ask-pane { min-height: 0; }
.csm-ask-pane .chat-scroll { max-height: 280px; min-height: 160px; }

.csm-scrum-goals { margin: 4px 0 16px; }
.csm-scrum-goal-list { margin: 0; padding-left: 1.2em; }
.csm-scrum-goal-list li { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.csm-scrum-sprints {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}
.csm-scrum-sprint {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px 8px;
  background: var(--surface);
}
.csm-scrum-sprint.is-current { border-color: #bbf7d0; background: var(--green-soft); }
.csm-scrum-theme { margin: 4px 0 10px; font-size: 13px; font-style: italic; }
.csm-scrum-out { margin: 8px 0 4px; }
.csm-scrum-out summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.csm-scrum-out ul { margin: 8px 0 0; padding-left: 1.2em; }
.csm-scrum-out li { margin: 0 0 6px; font-size: 13.5px; }
.csm-scrum-ask { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.csm-scrum-ask-row { display: flex; gap: 8px; align-items: flex-end; }
.csm-scrum-ask-row textarea { flex: 1; min-height: 64px; margin: 0; }
.csm-scrum-answer {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
@media (max-width: 1100px) {
  .csm-scrum-sprints { grid-template-columns: 1fr; }
}

.pm-ask-pane { min-height: 0; }
.pm-ask-pane .chat-scroll { max-height: 340px; min-height: 200px; }
.tenth-man-card .card-head { margin-bottom: 0; }
.tenth-man-pane { min-height: 0; }
.tenth-man-pane .chat-scroll { max-height: 420px; min-height: 260px; }
/* PM delegation approval queue */
.pm-actions { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 2px; }
.pm-action {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--amber, #d97706); border-radius: 10px;
  background: var(--surface-2); font-size: 13.5px;
}
.pm-action-copy b { display: block; margin-bottom: 2px; }
.pm-action-btns { display: flex; gap: 6px; flex-shrink: 0; }
.ask-rec-bar { margin-top: 8px; }
.bubble-row { display: flex; margin: 10px 0; gap: 10px; }
.bubble-row.self { justify-content: flex-end; }
.bubble {
  max-width: 76%; padding: 10px 14px; border-radius: 16px;
  font-size: 14px; white-space: pre-wrap; word-break: break-word;
}
.bubble.customer  { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.bubble.assistant { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble.staff     { background: var(--violet-soft); border: 1px solid #e2d5fb; border-bottom-left-radius: 5px; }
.bubble-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 3px; display: flex; gap: 8px; align-items: center; }
.bubble .att { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; margin-right: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px;
  background: rgba(255,255,255,.22); color: inherit; border: 1px solid rgba(0,0,0,.08); }
.bubble.assistant .att, .bubble.staff .att { background: #fff; color: var(--accent); }
.bubble img.att-img { max-width: 260px; border-radius: 9px; display: block; margin-top: 8px; }
.bubble code { background: rgba(0,0,0,.08); border-radius: 4px; padding: 0 4px; font-size: 12.5px; }
.bubble.customer code { background: rgba(255,255,255,.22); }
.bubble pre { background: rgba(0,0,0,.08); border-radius: 8px; padding: 8px 10px; overflow-x: auto;
  font-size: 12px; margin: 6px 0; white-space: pre; }
.bubble.customer pre { background: rgba(255,255,255,.18); }
.bubble a { color: inherit; text-decoration: underline; }
.seen-tag { font-size: 10.5px; font-weight: 600; }
.seen-tag.seen { color: var(--green); }
.seen-tag.unseen { color: var(--ink-3); }

.chat-composer { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px; }
.chat-composer textarea { min-height: 64px; }
.pending-files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.typing { display: inline-flex; gap: 4px; padding: 12px 16px; }
.typing span { width: 7px; height: 7px; border-radius: 99px; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .25 } 50% { opacity: 1 } }

/* creative studio — brief generator states */
.brief-error {
  margin-top: 12px; padding: 10px 14px; border-radius: var(--radius);
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  font-size: 13px; line-height: 1.45; white-space: pre-wrap;
}
.drafting-dot { color: var(--ink-3); animation: pulse 1.6s infinite; }
.btn-spin {
  display: inline-block; width: 12px; height: 12px; vertical-align: -1px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 99px; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

.studio-alert {
  padding: 12px 16px; border-radius: var(--radius); font-size: 13.5px; line-height: 1.45;
}
.studio-alert.danger {
  background: var(--red-soft); border: 1px solid #fecaca; color: #991b1b;
}
.studio-alert a { color: inherit; font-weight: 600; margin-left: 6px; }
.cost-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cost-chip {
  font-size: 11.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 3px 8px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink-2);
}
.cost-chip.muted { opacity: .65; }

/* two-column compare (creative studio) */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .compare { grid-template-columns: 1fr; } }
.compare .col-label { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 7px; }
.compare .current .col-label { color: var(--ink-3); }
.compare .proposed .col-label { color: var(--green); }
.compare .box { border-radius: var(--radius-sm); padding: 13px 15px; height: 100%; }
.compare .current .box { background: var(--surface-2); border: 1px solid var(--line); }
.compare .proposed .box { background: var(--green-soft); border: 1px solid #bfe9d9; }

/* Agent Studio */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.agent-card textarea { min-height: 190px; font-size: 12.5px; line-height: 1.5; }
.agent-pre {
  margin-top: 10px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 11.5px; line-height: 1.5;
  white-space: pre-wrap; max-height: 280px; overflow-y: auto;
}

/* Channel Profit & Loss — MerchantSpring pivot layout */
.ms-pl-wrap { overflow-x: auto; margin: 0 -4px; }
.ms-pl {
  width: 100%; border-collapse: collapse;
  font-variant-numeric: tabular-nums; font-size: 12.5px;
}
.ms-pl th {
  text-align: right; font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ms-pl th.lab, .ms-pl td.lab {
  text-align: left; text-transform: none; letter-spacing: 0;
  font-weight: 600; color: var(--ink); white-space: nowrap; position: sticky; left: 0;
  background: var(--surface);
}
.ms-pl td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ms-pl tr.total td { font-weight: 700; border-top: 1px solid var(--line-2, var(--line)); background: var(--surface-2); }
.ms-pl tr.total td.lab { background: var(--surface-2); }
.ms-pl tr.net td { font-weight: 800; }
.ms-pl tr.net.up td.val { color: var(--green); }
.ms-pl tr.net.down td.val { color: var(--red); }
.ms-pl td.neg { color: var(--red); }

/* ───────── Emailing desk — pillar cards, inbox, reply modal ───────── */

.pillars { display: grid; gap: 14px; grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1400px) { .pillars { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); } }

.pillar {
  position: relative; overflow: hidden; padding-top: 21px;
  transition: transform .16s ease, box-shadow .16s ease;
}
.pillar::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--pillar-c, var(--accent));
}
.pillar:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(16, 24, 40, .06), 0 16px 34px -10px rgba(16, 24, 40, .16);
}
.pillar.gold   { --pillar-c: var(--gold);   --pillar-soft: var(--gold-soft); }
.pillar.blue   { --pillar-c: var(--accent); --pillar-soft: var(--accent-soft); }
.pillar.violet { --pillar-c: var(--violet); --pillar-soft: var(--violet-soft); }
.pillar.green  { --pillar-c: var(--green);  --pillar-soft: var(--green-soft); }
.pillar.amber  { --pillar-c: var(--amber);  --pillar-soft: var(--amber-soft); }
.pillar.red    { --pillar-c: var(--red);    --pillar-soft: var(--red-soft); }

.pillar-head { display: flex; align-items: center; gap: 9px; }
.pillar-ico {
  width: 33px; height: 33px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: var(--pillar-soft, var(--accent-soft));
}
.pillar .value { display: flex; align-items: baseline; gap: 7px; margin-top: 10px; }
.pillar .value .n {
  font-size: 27px; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.pillar .value .unit { font-size: 12px; font-weight: 600; color: var(--ink-3); }

.pillar-stats { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.pstat {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-size: 11.5px; font-weight: 500; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 2.5px 8px; white-space: nowrap;
}
.pstat b { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.pstat.good { background: var(--green-soft); border-color: #bfe9d9; color: var(--green); }
.pstat.good b { color: var(--green); }
.pstat.warn { background: var(--amber-soft); border-color: #f3d7a3; color: var(--amber); }
.pstat.warn b { color: var(--amber); }
.pstat.bad { background: var(--red-soft); border-color: #f5c2c2; color: var(--red); }
.pstat.bad b { color: var(--red); }
a.pstat:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* goal-meter tracks (light theme + animated fill) */
.meter-track { background: #edf0f7; border-radius: 99px; height: 10px; overflow: hidden; margin-top: 6px; }
.meter-fill { height: 100%; border-radius: 99px; width: 0; transition: width .9s cubic-bezier(.2, .7, .3, 1); }

/* master inbox / warm leads rows */
.inbox-row { cursor: pointer; transition: background .12s ease; border-radius: 9px; padding-left: 8px !important; padding-right: 8px !important; }
.inbox-row:hover { background: var(--surface-2); }
.inbox-row .prev {
  font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.inbox-row .btn.reply-cta { flex-shrink: 0; }
.inbox-row:hover .btn.reply-cta { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.due-pill { font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2.5px 9px; white-space: nowrap; }
.due-pill.overdue { background: var(--red-soft); color: var(--red); }
.due-pill.scheduled { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

/* reply modal — light, chat-style thread */
.im-backdrop {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(16, 24, 40, .45); backdrop-filter: blur(2px);
}
.im-backdrop.open { display: block; }
.im-panel {
  max-width: 780px; margin: 4vh auto; max-height: 92vh;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 70px -12px rgba(16, 24, 40, .4);
  animation: im-in .18s ease;
}
@keyframes im-in { from { transform: translateY(12px); opacity: 0 } to { transform: none; opacity: 1 } }
.im-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.im-head .who { min-width: 0; flex: 1; }
.im-head .who .t { font-weight: 700; font-size: 14.5px; }
.im-head .who .s { font-size: 12px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.im-body { overflow-y: auto; padding: 16px 18px; flex: 1; min-height: 140px; background: var(--surface-2); }
.im-bubble {
  border-radius: 13px; border-bottom-left-radius: 5px; padding: 10px 13px; margin-bottom: 10px;
  font-size: 13px; background: var(--surface); border: 1px solid var(--line); margin-right: 13%;
}
.im-bubble.sent {
  margin-right: 0; margin-left: 13%; background: var(--accent-soft);
  border-color: #d5dcfb; border-bottom-left-radius: 13px; border-bottom-right-radius: 5px;
}
.im-bubble .im-meta { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-bottom: 5px; }
.im-bubble .im-content { overflow-x: auto; line-height: 1.5; }
.im-bubble .im-content img { max-width: 100%; }
.im-compose { padding: 13px 18px; border-top: 1px solid var(--line); background: var(--surface); }

/* subscriptions inline edit */
.subs-table td { vertical-align: middle; }
.subs-table .sub-edit-btn { visibility: hidden; }
.subs-table tr:hover .sub-edit-btn { visibility: visible; }
.subs-table input, .subs-table select { padding: 5px 8px; font-size: 12.5px; border-radius: 7px; width: auto; }
.subs-table input[type="number"] { width: 88px; }
.subs-table input[type="date"] { width: 138px; }
.subs-total { display: flex; gap: 8px; align-items: baseline; justify-content: flex-end; padding: 10px 9px 2px; font-size: 12.5px; color: var(--ink-2); }
.subs-total b { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink); }

/* Sophie's Desk */
.sophie-compose {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.sophie-compose input[type="text"] { flex: 1; min-width: 200px; }
.sophie-compose input[type="date"], .sophie-compose select { width: auto; min-width: 140px; }
.sophie-inline { width: auto !important; min-width: 118px; padding: 5px 8px; font-size: 12.5px; }
.sophie-table td { vertical-align: top; }
.sophie-done .title { text-decoration: line-through; color: var(--ink-3); }
.sophie-conv-row > td { background: var(--surface-2); }
.sophie-conv { padding: 4px 2px; }
.sophie-conv-msgs {
  margin-top: 8px; max-height: 260px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; line-height: 1.5;
}
.sophie-conv-msg { padding: 3px 0; white-space: pre-wrap; }
.sophie-conv input[type="text"] { flex: 1; }
.leszek-conv-msgs { max-height: 420px; }
.jess-desk {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 860px) {
  .jess-desk { grid-template-columns: 1fr; }
}
.jess-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 520px;
  overflow-y: auto;
}
.jess-history-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}
.jess-history-item:hover { background: var(--surface-2); }
.jess-history-item.on { background: var(--surface-2); outline: 1px solid var(--line); }
.jess-history-item b {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cursor-desk-composer { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.cursor-desk-composer input[type="text"] { flex: 1; min-width: 180px; }
.cursor-desk-attach { cursor: pointer; margin: 0; }
.cursor-desk-attach input[type="file"] { display: none; }
.cursor-desk-attach-hint { font-size: 12px; margin: 8px 0 0; }
.cursor-desk-att {
  display: inline-block; margin-left: 8px; font-size: 12px;
  color: var(--accent); text-decoration: none;
}
.cursor-desk-att:hover { text-decoration: underline; }

/* Creative Workspace replica */
.ws-gantt { display: flex; flex-direction: column; gap: 10px; }
.ws-gantt-row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 12px;
  align-items: center;
}
.ws-gantt-label { min-width: 0; font-size: 13px; font-weight: 600; }
.ws-gantt-track {
  position: relative;
  height: 18px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}
.ws-gantt-bar {
  position: absolute;
  top: 3px;
  height: 12px;
  border-radius: 4px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
}
.ws-gantt-bar.overdue {
  background: var(--red-soft, #fde8e8);
  border-color: var(--red);
}
@media (max-width: 700px) {
  .ws-gantt-row { grid-template-columns: 1fr; }
}

/* Creative Studio — product photo strip */
.asset-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.asset-tile { position: relative; text-align: center; max-width: 110px; }
.asset-tile img, .asset-file {
  width: 100px; height: 100px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); display: block;
}
.asset-file { display: flex; align-items: center; justify-content: center; }
.asset-name {
  font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 4px;
}
.asset-tile .role-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 4px;
}
.mood-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mood-file {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); max-width: 100%;
}
.mood-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.mood-file button {
  border: 0; background: transparent; color: var(--red); cursor: pointer;
  font-weight: 700; line-height: 1; padding: 0 2px;
}
.slot-ref-row {
  display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap;
}
.slot-ref-thumb {
  width: 44px; height: 44px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); display: block;
}
.asset-remove {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; border-radius: 99px; padding: 0;
  border: 1px solid var(--line); background: var(--surface); color: var(--red);
  font-size: 15px; line-height: 1; font-weight: 700; cursor: pointer; z-index: 1;
}
.asset-remove:hover, .asset-remove:focus-visible {
  background: var(--red); color: #fff; border-color: var(--red); outline: none;
}
.studio-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.js-brief-remove, .js-render-remove { flex-shrink: 0; }

/* Client Creative review room */
.review-shell {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
  min-height: 70vh;
}
.review-rail {
  display: flex; flex-direction: column; gap: 10px;
  max-height: calc(100vh - 160px); overflow: auto; padding-right: 4px;
}
.review-thumb {
  border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  background: var(--surface); cursor: pointer; text-align: left; width: 100%;
}
.review-thumb.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.review-thumb img { width: 100%; border-radius: 6px; display: block; }
.review-thumb .meta { font-size: 11px; margin-top: 4px; }
.review-stage {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.review-stage-hint { font-size: 12.5px; color: var(--ink-3); }
.review-stage-frame { position: relative; display: inline-block; max-width: 100%; }
.review-stage-frame img {
  max-width: 100%; max-height: calc(100vh - 220px);
  display: block; border-radius: 8px; cursor: crosshair;
}
.review-pins { position: absolute; inset: 0; pointer-events: none; }
.review-shell.hide-pins .review-pins { display: none; }
.review-pin {
  pointer-events: auto;
  position: absolute; transform: translate(-50%, -100%);
  width: 24px; height: 24px; border-radius: 12px 12px 12px 2px;
  border: 2px solid #fff; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
  padding: 0; cursor: pointer; box-shadow: 0 2px 8px rgba(16,24,40,.25);
}
.review-pin.resolved { background: var(--green); }
.review-pin.active { outline: 2px solid var(--gold); }
.review-pin.draft { background: var(--amber); }
.review-side {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  min-height: 420px; display: flex; flex-direction: column; gap: 12px;
}
.review-thread { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.review-note {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--surface-2);
}
.review-note.resolved { opacity: .7; }
.review-note .who { font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.review-note .who b { color: var(--ink); }
.review-composer textarea, .review-note + textarea {
  width: 100%; min-height: 72px; font-size: 13px;
}
.review-overlay {
  position: fixed; inset: 0; background: rgba(16,24,40,.55);
  z-index: 40; display: flex; align-items: stretch; justify-content: center;
  padding: 24px;
}
.review-overlay[hidden] { display: none; }
.review-overlay-inner {
  background: var(--bg); border-radius: var(--radius);
  width: min(1200px, 100%); max-height: 100%; overflow: auto; padding: 18px 20px;
  position: relative;
}
.review-overlay-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
}
@media (max-width: 960px) {
  .review-shell { grid-template-columns: 1fr; }
  .review-rail { flex-direction: row; max-height: none; overflow-x: auto; }
  .review-thumb { min-width: 110px; }
  .review-stage-frame img { max-height: 55vh; }
}

.ws-page { min-width: 0; }
.ws-brand-pick {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ws-brand-pick select { min-width: 240px; width: auto; }
#ws-board.is-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity .15s ease;
}
.studio-account-filter {
  display: flex;
  align-items: center;
  gap: 10px;
}
.studio-account-filter select { min-width: 220px; }

.ws-jump {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 10px 0 12px;
  margin: -8px 0 18px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.ws-jump a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid transparent;
}
.ws-jump a:hover,
.ws-jump a.on {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #c9d2fb;
  text-decoration: none;
}

.ws-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scroll-margin-top: 58px;
}
.ws-hero-copy { flex: 1; min-width: 0; }
.ws-hero .brand-logo-wrap { width: 72px; height: 72px; border-radius: 16px; }
.ws-hero-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .015em;
}
.ws-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-2);
}
.ws-hero-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ws-flag { align-self: flex-start; }
.ws-flag-note { color: var(--ink-2); font-size: 13.5px; margin: -4px 0 16px; }
.ws-kicker {
  margin: 8px 0 0;
  font-size: 15.5px;
  line-height: 1.4;
  color: var(--ink);
  max-width: 56ch;
}
.ws-kicker.is-wait { color: var(--amber); }
.ws-goals-card {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.ws-goals-card h2 { font-size: 18px; margin-bottom: 8px; }
.ws-goal-list { margin: 0; padding-left: 1.2em; }
.ws-goal-list li { margin: 0 0 8px; font-size: 14.5px; line-height: 1.4; }
.ws-standing-goals { margin: 0 0 8px; font-size: 14.5px; line-height: 1.45; white-space: pre-line; }
.ws-bfcm-now {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: var(--gold-soft);
  border-radius: 10px;
  font-size: 13.5px;
  color: #6b5614;
}
.ws-goals-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
}
.ws-goals-status .label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ws-goals-status b { font-size: 20px; letter-spacing: -.02em; }
.ws-goals-status .is-wait { color: var(--amber); }
.ws-goals-status .is-open { color: var(--green); }
.ws-goals-status .ws-kpi-hot,
.ws-pulse .ws-kpi-hot,
.ws-cadence .ws-kpi-hot { color: var(--red); }
.ws-goals-status .ws-kpi-ok,
.ws-pulse .ws-kpi-ok,
.ws-cadence .ws-kpi-ok { color: var(--green); }
.ws-pulse .is-wait { color: var(--amber); font-size: 22px; }
.ws-pulse-go { margin-top: 10px; }
.ws-cadence {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ws-cadence-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 12px 18px;
  flex: 1;
  min-width: 0;
}
.ws-cadence-tiles .label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ws-cadence-tiles b {
  display: block;
  font-size: 22px;
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 2px 0;
}
.ws-cadence-tiles .note { font-size: 12.5px; color: var(--ink-2); }
.ws-role-switch { flex: 0 0 auto; }
.ws-garden-foot {
  margin: 8px 0 28px;
  font-size: 13px;
  color: var(--ink-3);
}
.csm-profile-tickets > .ws-tickets-stack {
  display: flex;
  flex-direction: column;
  align-self: start;
  width: 100%;
}
.csm-profile-tickets > .ws-tickets-stack > .card {
  height: auto;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  margin-bottom: 0;
}
.ws-tickets-stack .ws-add-promise {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 12px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}
.ws-fires-now { border-color: #fecaca; }
.ws-playbook {
  margin: 8px 0 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 58px;
}
.ws-playbook > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  padding: 16px 18px;
}
.ws-playbook > summary::-webkit-details-marker { display: none; }
.ws-playbook[open] > summary { border-bottom: 1px solid var(--line); }
.ws-playbook-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.ws-playbook[open] { padding-bottom: 8px; }
.ws-playbook .ws-sec { padding: 0 18px; }
.ws-role-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 18px 0 10px;
}

.ws-qlanes { display: grid; gap: 12px; }
.ws-qlane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  scroll-margin-top: 58px;
}
.ws-qlane.has-board { border-color: #c9d2fb; }
.ws-qlane-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.ws-qlane-id {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.ws-qlane-head h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.3;
  max-width: 46ch;
}
.ws-qlane-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr .9fr;
  gap: 16px;
}
.ws-qlane-col h4 {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 8px;
}
.ws-qlane-col > p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.ws-on-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  font-size: 13px;
}
.ws-on-item:hover { text-decoration: none; border: 1px solid #c9d2fb; }
.ws-on-item b { font-size: 13.5px; }
.ws-on-item span { color: var(--ink-2); font-size: 12.5px; }
.ws-on-item.is-fire { background: var(--red-soft); }
.ws-on-item.is-now { background: var(--green-soft); }
.ws-on-done { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); }
.ws-stand {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  margin-bottom: 8px;
  background: var(--bg);
}
.ws-stand summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  list-style: none;
}
.ws-stand summary::-webkit-details-marker { display: none; }
.ws-stand summary b { font-size: 13px; line-height: 1.3; flex: 1 1 140px; }
.ws-stand .ws-done, .ws-stand p { margin: 0 10px 10px; font-size: 13px; color: var(--ink-2); }

.ws-guide { margin-bottom: 8px; }
.ws-how {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.ws-how-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 13px;
  box-shadow: var(--shadow);
}
.ws-how-step .n {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .12em;
  font-weight: 700;
}
.ws-how-step h3 {
  font-size: 14.5px;
  margin: 6px 0 6px;
  letter-spacing: -.015em;
}
.ws-how-step p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
}
.ws-qs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.ws-qpill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 12px;
  min-width: 0;
}
.ws-qpill b {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: .04em;
}
.ws-qpill span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.ws-ground {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--ink-2);
}
.ws-ground summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-2);
}
.ws-ground p { margin: 8px 0 0; line-height: 1.5; }

.ws-sec { margin: 8px 0 28px; scroll-margin-top: 58px; }
.ws-sec-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.ws-sec-head h2 { font-size: 20px; }
.ws-sec-head p {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 13.5px;
  max-width: 62ch;
}
.ws-kpis .ws-kpi-plan.is-wait { color: var(--amber); font-size: 20px; }
.ws-kpis .ws-kpi-plan.is-open { font-size: 20px; color: var(--green); }
.ws-kpis .ws-kpi-hot { color: var(--red); }
.ws-kpis .ws-kpi-ok { color: var(--green); }
.ws-hidden-hint {
  margin: -8px 0 16px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.ws-role-tabs { margin: 0 0 14px; }
.ws-role-blurb {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.ws-task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.ws-task {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  transition: border-color .12s ease;
}
.ws-task:hover { border-color: #c9d2fb; }
.ws-task-top { display: flex; flex-direction: column; gap: 8px; }
.ws-task h3 {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.3;
}
.ws-task-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ws-qchip {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #c9d2fb;
}
.ws-face.is-client {
  background: var(--gold-soft);
  color: #8a7018;
  border-color: #ead9a0;
}
.ws-face.is-internal { background: var(--surface-2); }
.ws-done {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.45;
  margin: 0;
}
.ws-done span {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.ws-more { margin-top: 2px; }
.ws-more summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
}
.ws-more p { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.ws-more p b { color: var(--ink); font-weight: 600; }

.ws-trig-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.ws-trig-jump span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 4px;
}

.ws-trig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  align-items: start;
}
.ws-trig {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 64px;
}
.ws-trig[open] { border-color: #c9d2fb; }
.ws-trig summary {
  cursor: pointer;
  padding: 12px 14px;
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.ws-trig summary::-webkit-details-marker { display: none; }
.ws-trig-code {
  font-family: var(--font-display);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  min-width: 2.4em;
  padding-top: 1px;
}
.ws-trig-copy { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ws-trig-copy b { font-size: 13.5px; line-height: 1.3; }
.ws-trig-body {
  padding: 0 14px 14px;
  display: grid;
  gap: 8px;
}
.ws-field {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
}
.ws-field .k {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.ws-field.is-done { background: var(--green-soft); color: #0b6b4a; }
.ws-field.is-done .k { color: var(--green); }

.ws-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.ws-pack-card,
.ws-pack-side article,
.ws-bfcm-roles article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.ws-pack-card h3,
.ws-pack-side h3,
.ws-bfcm-roles h3 {
  font-size: 14.5px;
  margin: 6px 0 8px;
}
.ws-pack-card p,
.ws-pack-side p,
.ws-bfcm-roles p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  white-space: pre-line;
}
.ws-pack-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ws-pack-side article.is-done { border-color: #bbf7d0; background: var(--green-soft); }
.ws-pack-side article.is-done h3 { color: #0b6b4a; }

.ws-timeline {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}
.ws-tl {
  display: grid;
  grid-template-columns: 88px 18px 1fr;
  gap: 10px;
  align-items: start;
  min-height: 44px;
}
.ws-tl-when {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding-top: 2px;
  text-align: right;
}
.ws-tl-rail {
  display: flex;
  justify-content: center;
  position: relative;
  min-height: 100%;
}
.ws-tl-rail::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: -8px;
  width: 1px;
  background: var(--line);
}
.ws-tl:last-child .ws-tl-rail::before { display: none; }
.ws-tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--gold);
  margin-top: 6px;
  box-shadow: 0 0 0 4px var(--gold-soft);
  position: relative;
  z-index: 1;
}
.ws-tl-what {
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 1px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ws-tl.passed { opacity: .55; }
.ws-tl.passed .ws-tl-dot { background: var(--ink-3); box-shadow: none; }
.ws-soon { background: var(--amber-soft); color: var(--amber); border-color: #f3d7a3; }
.ws-event { background: var(--gold-soft); color: #8a7018; border-color: #ead9a0; }
.ws-bfcm-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ws-call {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.ws-call:last-child { border-bottom: 0; }
.ws-call-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.ws-call-summary { font-size: 13px; line-height: 1.45; margin: 6px 0 8px; }
.ws-actions { list-style: none; margin: 0 0 10px; padding: 0; }
.ws-actions li { margin: 0 0 6px; font-size: 13.5px; line-height: 1.4; }
.ws-actions label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.ws-actions input { margin-top: 3px; }
.ws-add-promise { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.ws-add-promise input[type="text"],
.ws-add-promise input:not([type]),
.ws-add-promise #ws-promise-title { flex: 1; }
.ws-add-promise #ws-promise-due { width: auto; max-width: 168px; flex: 0 0 168px; }

@media (max-width: 1100px) {
  .ws-hero { flex-direction: column; }
  .ws-how { grid-template-columns: 1fr 1fr; }
  .ws-pack-side, .ws-bfcm-roles, .ws-goals-card, .ws-qlane-grid { grid-template-columns: 1fr; }
  .ws-cadence { flex-direction: column; align-items: stretch; }
  .ws-cadence-tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .ws-how { grid-template-columns: 1fr; }
  .ws-tl { grid-template-columns: 72px 16px 1fr; }
}

.cts-lane-ops { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.cts-lanes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cts-assign { margin-top: 6px; max-width: 100%; font-size: 12px; }
.cts-request-row select#cts-req-assignee { max-width: 180px; }
.cts-timer { margin-top: 4px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted, #8a93a6); }
.cts-timer.due_soon { color: var(--amber, #d4a017); }
.cts-timer.overdue { color: var(--red, #c44536); font-weight: 600; }
.cts-timer-hint { margin: 8px 0 0; font-size: 12.5px; }
.cts-status-bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.cts-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cts-clock-live { font-size: 12px; color: var(--ink-2); max-width: 180px; }
.cts-request-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cts-request-form textarea, .cts-request-form #cts-req-attach, .cts-req-block { width: 100%; margin-top: 8px; }
.cts-req-block textarea, .cts-req-block input { width: 100%; margin-top: 4px; }
.cts-request-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.cts-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 10px; }
.cts-tab { padding: 10px 16px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; text-decoration: none; }
.cts-tab:hover { color: var(--ink); text-decoration: none; }
.cts-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.cts-brand-filter { display: flex; gap: 14px; align-items: end; margin-bottom: 16px; }
.cts-brand-inline { margin: 0; }
.cts-filter-hint { margin: 0 0 16px; font-size: 12.5px; }
.cts-h { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 4px 0 10px; }
.cts-stat { display: block; color: inherit; text-decoration: none; padding: 14px 16px; border-top: 3px solid var(--line); }
.cts-stat:hover { text-decoration: none; box-shadow: var(--shadow); }
.cts-stat .label { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.cts-stat .value { font-size: 28px; font-weight: 600; margin-top: 4px; }
.cts-stat .note { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.cts-stat.queue { border-top-color: var(--accent); }
.cts-stat.doing { border-top-color: var(--gold); }
.cts-stat.blocked { border-top-color: var(--red); }
.cts-stat.done { border-top-color: var(--green); }
.cts-stat.parked { border-top-color: #98a2b3; }
.cts-kpi-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.cts-kpi { display: block; color: inherit; text-decoration: none; padding: 12px 14px; }
.cts-kpi:hover { text-decoration: none; }
.cts-kpi-green { border-color: #b7e4d0; background: #f6fbf8; }
.cts-kpi-amber { border-color: #f0d9a8; background: #fffaf0; }
.cts-kpi-red { border-color: #f3c0c0; background: #fff7f7; }
.cts-kpi-gray { border-color: var(--line); }
.cts-kpi-top { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.cts-kpi .label { font-size: 11.5px; color: var(--ink-2); line-height: 1.3; }
.cts-kpi .value { font-size: 24px; font-weight: 600; margin: 6px 0 8px; }
.cts-bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.cts-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.cts-kpi-green .cts-bar span { background: var(--green); }
.cts-kpi-amber .cts-bar span { background: var(--amber); }
.cts-kpi-red .cts-bar span { background: var(--red); }
.cts-trend { font-size: 14px; font-weight: 600; }
.cts-trend.up { color: var(--green); }
.cts-trend.down { color: var(--red); }
.cts-trend.flat { color: var(--ink-3); }
.cts-member-picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cts-member-pick { display: flex; gap: 10px; align-items: center; padding: 12px; color: inherit; text-decoration: none; }
.cts-member-pick:hover { text-decoration: none; box-shadow: var(--shadow); }
.cts-member-pick.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cts-member-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cts-member-card { color: inherit; padding: 14px; }
.cts-member-who { display: flex; gap: 10px; align-items: center; }
.cts-avatar { width: 36px; height: 36px; border-radius: 50%; background: #1e3a5f; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.cts-avatar.lg { width: 48px; height: 48px; font-size: 18px; }
.cts-member-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; gap: 8px; }
.cts-load-pill { font-size: 11px; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.cts-load-pill.at_capacity { background: var(--red-soft); color: var(--red); }
.cts-load-pill.high { background: var(--amber-soft); color: var(--amber); }
.cts-load-pill.ok, .cts-load-pill.spare { background: var(--green-soft); color: var(--green); }
.cts-mini-kpis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cts-mini { font-size: 11px; font-variant-numeric: tabular-nums; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); text-decoration: none; }
.cts-mini.green { color: var(--green); }
.cts-mini.amber { color: var(--amber); }
.cts-mini.red { color: var(--red); }
.cts-capacity { padding: 14px 16px; }
.cts-cap-row { display: grid; grid-template-columns: 90px 1fr 36px; gap: 10px; align-items: center; margin: 8px 0; color: inherit; text-decoration: none; }
.cts-cap-row:hover { text-decoration: none; }
.cts-cap-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); }
.cts-cap-bar .seg.upload, .dot.upload { background: #1e3a5f; }
.cts-cap-bar .seg.reinst, .dot.reinst { background: var(--red); }
.cts-cap-bar .seg.other, .dot.other { background: #98a2b3; }
.cts-cap-legend { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.cts-cap-legend .dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 4px; }
.cts-split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.cts-explainer { background: var(--gold-soft); border-color: var(--gold); }
.cts-explainer p { margin: 8px 0; }
.cts-compare { margin-top: 10px; }
.cts-compare td:first-child { font-weight: 600; color: var(--ink-2); width: 22%; }
.cts-table td, .cts-table th { font-size: 12.5px; }
.cts-type { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); }
.cts-type.upload { background: #1e3a5f; color: #fff; }
.cts-type.reinstatement { background: var(--red); color: #fff; }
.cts-age.green { color: var(--green); }
.cts-age.amber { color: var(--amber); }
.cts-age.red { color: var(--red); font-weight: 600; }
tr.p1-upload td:first-child { box-shadow: inset 3px 0 0 #1e3a5f; }
tr.p1-reinstatement td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.cts-week-chart { display: flex; gap: 10px; align-items: flex-end; height: 180px; padding: 8px 8px 0; }
.cts-week-col { flex: 1; text-align: center; font-size: 11px; }
.cts-week-bar-wrap { height: 120px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 6px; }
.cts-week-bar-wrap span { display: block; width: 70%; background: var(--accent); border-radius: 6px 6px 0 0; min-height: 6px; }
.cts-pad { padding: 8px 16px 14px; }
.cts-qa-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cts-shift td { text-align: center; font-variant-numeric: tabular-nums; font-size: 12px; }
.cts-shift td.shift-on_time { background: var(--green-soft); color: var(--green); }
.cts-shift td.shift-minor_late { background: var(--amber-soft); color: var(--amber); }
.cts-shift td.shift-major_late, .cts-shift td.shift-missing { background: var(--red-soft); color: var(--red); }
@media (max-width: 1200px) {
  .cts-lanes, .cts-status-bar, .cts-member-grid, .cts-member-picks, .cts-kpi-row, .cts-qa-kpis { grid-template-columns: 1fr 1fr; }
  .cts-split, .cts-request-grid { grid-template-columns: 1fr; }
}


