/* Inter — self-hosted (copied from the Ummah app's brand fonts). Body stack
   falls back DM Sans → Inter → system; these faces make Inter actually load. */
@font-face{font-family:'Inter';src:url('/fonts/Inter-Regular.ttf') format('truetype');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'Inter';src:url('/fonts/Inter-Medium.ttf') format('truetype');font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:'Inter';src:url('/fonts/Inter-SemiBold.ttf') format('truetype');font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:'Inter';src:url('/fonts/Inter-Bold.ttf') format('truetype');font-weight:700;font-style:normal;font-display:swap}
*{box-sizing:border-box;margin:0;padding:0}
:root{
  --bg:#FAFAF8;--bg-card:#ffffff;--bg-hover:#f0f4f8;--bg-subtle:#edf2f7;
  --border:#E2E8F0;--border-light:#EDF2F7;
  --text:#0D1117;--text-secondary:#4A5568;--text-muted:#64748B;
  --accent:#0056A4;--accent-light:#e8f2fc;--accent-dark:#004485;
  --sky:#6AABE5;--sky-light:#e0f0fb;
  --green:#16a34a;--green-light:#dcfce7;--green-dark:#15803d;
  --amber:#d97706;--amber-light:#fef3c7;
  --red:#dc2626;--red-light:#fee2e2;
  --purple:#7c3aed;--purple-light:#ede9fe;
  --cyan:#06b6d4;
  --pink:#EC4899;
  --text-on-dark-muted:rgba(255,255,255,0.5);
  --sidebar:#0D1B2A;--sidebar-hover:rgba(106,171,229,0.1);--sidebar-active:rgba(106,171,229,0.18);
  --radius:10px;--radius-sm:6px;--radius-md:8px;--radius-lg:14px;--radius-xl:16px;--radius-3xl:24px;--radius-pill:999px;
  --shadow:0 1px 3px rgba(0,86,164,0.06),0 1px 2px rgba(16,24,40,0.05);
  --shadow-sm:0 1px 3px rgba(16,24,40,0.08),0 1px 2px -1px rgba(16,24,40,0.04);
  --shadow-md:0 4px 16px rgba(0,86,164,0.1);
  --shadow-lg:0 10px 18px -4px rgba(16,24,40,0.08),0 4px 8px -4px rgba(16,24,40,0.04);
  --primary:#0056A4;--primary-50:#E5EDF5;--primary-100:#C2DDFF;--primary-dark:#004999;
  --sky-tint:rgba(106,171,229,0.18);--sky-glass:rgba(106,171,229,0.08);
  --success:#16a34a;--card:#ffffff;
  /* Semantic status tokens — solid / bg-tint / fg-text triads. */
  --danger:#DC2626;--danger-bg:#fee2e2;--danger-fg:#991b1b;
  --warn:#D97706;--warn-bg:#fef3c7;--warn-fg:#92400e;
  --info:#0056A4;--info-bg:#E8F0F5;--info-fg:#0056A4;
  --success-bg:#dcfce7;--success-fg:#15803d;
  --ease-out:cubic-bezier(0.22,0.61,0.36,1);--duration-fast:120ms;--duration-base:180ms;
  --ring-primary:0 0 0 4px rgba(0,86,164,0.18);
  /* Page background — Ummah signature gradient: F8FAFD → DFE6F3, top to bottom */
  --bg-page:linear-gradient(180deg,#F8FAFD 0%,#EAF1FA 50%,#DFE6F3 100%);
  --bg-glass:rgba(253,253,254,0.55);
  --bg-glass-border:rgba(255,255,255,0.55);
}
/* DARK MODE — opt-in via [data-theme="dark"] on <html>. Applied by the
   theme toggle in the topbar; persists to localStorage. The sidebar is
   already dark (#0D1B2A) so it stays the same in both modes. Navy primary
   + sky accent also stay identical — brand colors don't shift.
   Variables NOT overridden here keep their light values: --primary,
   --primary-dark, --sky, --accent (brand) and all the --radius/--ease/
   --duration tokens (geometry/motion, theme-independent).
   Reference: project_dashboard_design_canon memory. */
[data-theme="dark"]{
  /* Surface ramp — more separation between canvas, card, hover. */
  --bg:#0B0E13;
  --bg-card:#181C24;
  --bg-hover:#222732;
  --bg-subtle:#13171E;
  /* Borders — lift alpha so card edges read on dark surfaces. */
  --border:rgba(255,255,255,0.16);
  --border-light:rgba(255,255,255,0.10);
  /* Text — bump all three steps for stronger contrast. WCAG AAA on body, AA on muted. */
  --text:#F5F7FA;
  --text-secondary:#C8CFD8;
  --text-muted:#9CA5B0;
  /* Accent — lift navy to a brighter blue against dark canvas. */
  --accent:#3B8FE0;
  --accent-light:rgba(59,143,224,0.20);
  --accent-dark:#2876C7;
  /* Sky tint stays on the same hue, lifted slightly. */
  --sky-light:rgba(106,171,229,0.22);
  /* Semantic backgrounds — bump alpha so pill backgrounds read. */
  --green-light:rgba(22,163,74,0.24);
  --amber-light:rgba(217,119,6,0.26);
  --red-light:rgba(220,38,38,0.26);
  --purple-light:rgba(124,58,237,0.26);
  /* Shadows — punchier in dark so cards lift visibly. */
  --shadow:0 1px 3px rgba(0,0,0,0.50),0 1px 2px rgba(0,0,0,0.40);
  --shadow-sm:0 2px 6px rgba(0,0,0,0.50),0 1px 2px -1px rgba(0,0,0,0.35);
  --shadow-md:0 6px 18px rgba(0,0,0,0.55);
  --shadow-lg:0 14px 28px -4px rgba(0,0,0,0.65),0 6px 12px -4px rgba(0,0,0,0.45);
  --primary-50:rgba(59,143,224,0.18);
  --primary-100:rgba(59,143,224,0.28);
  --sky-tint:rgba(106,171,229,0.26);
  --sky-glass:rgba(106,171,229,0.12);
  --card:#181C24;
  --bg-page:linear-gradient(180deg,#0B0E13 0%,#13171E 50%,#181C24 100%);
  --bg-glass:rgba(31,35,42,0.65);
  --bg-glass-border:rgba(255,255,255,0.10);
  --ring-primary:0 0 0 4px rgba(59,143,224,0.40);
  /* Semantic status tokens — lifted hues + alpha tints for dark surfaces. */
  --danger:#f87171;--danger-bg:rgba(220,38,38,0.18);--danger-fg:#fca5a5;
  --warn:#fbbf24;--warn-bg:rgba(217,119,6,0.16);--warn-fg:#fcd34d;
  --info:#6AABE5;--info-bg:rgba(106,171,229,0.14);--info-fg:#9cc8f0;
  --success:#4ade80;--success-bg:rgba(22,163,74,0.16);--success-fg:#86efac;

  /* MK-* parallel token system used by Newsletter, Content Calendar,
     mk-cards, nl-* drawers. Mirror in dark so those surfaces switch. */
  --mk-bg:var(--bg);
  --mk-surface:var(--bg-card);
  --mk-text:var(--text);
  --mk-text-muted:var(--text-muted);
  --mk-border:var(--border);
  --mk-border-strong:rgba(255,255,255,0.22);
  --mk-sky-tint:rgba(106,171,229,0.16);
  --mk-shadow-sm:var(--shadow-sm);
  --mk-shadow-md:var(--shadow-md);
  --mk-shadow-lg:var(--shadow-lg);

  color-scheme:dark;
}
/* Auto theme respects OS preference — JS applies data-theme="dark"
   dynamically if user picks "auto" and system is dark. */
.tab-panel{background:var(--bg-page) !important}
body{font-family:'DM Sans','Inter',system-ui,-apple-system,sans-serif;background:var(--bg);display:flex;height:100vh;overflow:hidden;color:var(--text);font-size:13px;-webkit-font-smoothing:antialiased}
/* Global keyboard focus ring — :where() keeps specificity at zero so any
   component-level :focus style still wins. Mouse clicks don't trigger it. */
:where(button,a,input,select,textarea,[tabindex],[role="tab"]):focus-visible{outline:none;box-shadow:var(--ring-primary, 0 0 0 3px color-mix(in srgb,var(--sky) 45%,transparent))}

/* SIDEBAR */
.sidebar{width:240px;background:var(--sidebar);display:flex;flex-direction:column;flex-shrink:0;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}
.sidebar::-webkit-scrollbar{width:0;height:0;display:none}
.logo{padding:22px 18px;border-bottom:1px solid color-mix(in srgb,var(--sky) 12%,transparent);display:flex;align-items:center;gap:12px}
.logo img{width:34px;height:34px;border-radius:10px;object-fit:cover;flex-shrink:0;box-shadow:0 2px 8px rgba(16,24,40,0.2)}
.logo-text h1{font-size:16px;font-weight:700;color:#fff;letter-spacing:-0.02em}
.logo-text p{font-size:10px;color:var(--sky);text-transform:uppercase;letter-spacing:0.1em;margin-top:2px;font-weight:600}
.nav-section{padding:12px 10px;flex:1;overflow-y:auto}
.nav-label{font-size:10px;color:color-mix(in srgb,var(--sky) 50%,transparent);padding:0 10px;margin:18px 0 6px;text-transform:uppercase;letter-spacing:0.1em;font-weight:600}
.nav-label:first-child{margin-top:0}
.nav-item{display:flex;align-items:center;gap:10px;padding:9px 12px;cursor:pointer;font-size:13px;color:rgba(255,255,255,0.55);border-radius:8px;margin-bottom:2px;transition:all 0.15s;position:relative;user-select:none;font-weight:500}
/* Nav items are real <button>s for keyboard access — neutralize UA button
   styles only. :where() keeps specificity at 0 so .nav-item (color, padding,
   hover, active) still wins; layout/spacing carries over unchanged. */
:where(button.nav-item){background:none;border:0;width:100%;text-align:left;font:inherit;color:inherit;cursor:pointer;display:flex;align-items:center;gap:10px}
.nav-item:hover{background:var(--sidebar-hover);color:rgba(255,255,255,0.85)}
.nav-item.active{background:var(--sidebar-active);color:#fff}
.nav-item.active::before{content:'';position:absolute;left:0;top:25%;height:50%;width:2.5px;background:var(--sky);border-radius:0 2px 2px 0}
.nav-icon{width:16px;height:16px;flex-shrink:0;opacity:0.65}
.nav-item.active .nav-icon{opacity:1}
.nav-badge{background:var(--red);color:#fff;font-size:10px;font-weight:700;padding:1px 6px;border-radius:20px;margin-left:auto;min-width:18px;text-align:center}
.nav-bottom{padding:10px;border-top:1px solid color-mix(in srgb,var(--sky) 10%,transparent)}
.nav-item.logout:hover{background:color-mix(in srgb,var(--red) 15%,transparent);color:#fca5a5}

/* MAIN AREA */
.main{flex:1;display:flex;flex-direction:column;overflow:hidden}
.topbar{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border-bottom:1px solid var(--bg-glass-border);
  padding:16px 32px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-shrink:0;
  position:relative;
  z-index:5;
  /* Drop shadow so panel content visually scrolls UNDER the topbar */
  box-shadow:0 6px 16px -4px rgba(16,24,40,0.08),0 2px 6px -2px rgba(16,24,40,0.04);
}
.topbar::after{content:'';position:absolute;bottom:-1px;left:0;right:0;height:1px;background:linear-gradient(90deg,transparent 0%,var(--sky-tint) 30%,var(--sky-tint) 70%,transparent 100%)}
.topbar-left h2{font-size:18px;font-weight:700;color:var(--text);letter-spacing:-0.02em;line-height:1.2}
.topbar-left p{font-size:12px;color:var(--text-muted);margin-top:3px;font-weight:500}
.topbar-emergency-status{
  display:none;
  align-items:center;
  gap:8px;
  padding:6px 12px;
  background:var(--red-light);
  color:var(--red);
  border:1px solid color-mix(in srgb,var(--red) 25%,transparent);
  border-radius:var(--radius-pill);
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.06em;
}
.topbar-emergency-status.is-active{display:inline-flex}
.topbar-emergency-status::before{content:'';width:8px;height:8px;border-radius:50%;background:var(--red);animation:tv2-pulse-anim 1.6s var(--ease-out) infinite}
.status-badge{font-size:11px;color:var(--accent-dark);background:var(--accent-light);padding:4px 12px;border-radius:20px;font-weight:600;display:flex;align-items:center;gap:5px}
.status-dot{width:6px;height:6px;background:var(--sky);border-radius:50%;animation:pulse 2s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.4}}

/* PANELS */
.panel{flex:1;overflow:hidden;display:none}
.panel.active{display:flex;flex-direction:column}
.tab-panel{flex:1;overflow-y:auto;overflow-x:hidden;padding:28px;background:var(--bg);min-width:0}

/* DASHBOARD */
.dash-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:24px}
.stat-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:22px;box-shadow:var(--shadow);transition:all 0.2s ease;position:relative;overflow:hidden}
.stat-card::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,var(--accent),var(--sky));opacity:0;transition:opacity 0.2s}
.stat-card:hover{box-shadow:var(--shadow-md);transform:translateY(-2px)}
.stat-card:hover::before{opacity:1}
.stat-label{font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:10px}
.stat-value{font-size:28px;font-weight:700;color:var(--accent);line-height:1;letter-spacing:-0.03em}
.stat-sub{font-size:11px;color:var(--text-secondary);margin-top:8px;display:flex;align-items:center;gap:4px}
.stat-tag{font-size:10px;font-weight:600;padding:2px 7px;border-radius:12px}
.tag-up{background:var(--green-light);color:var(--green-dark)}
.tag-down{background:var(--red-light);color:var(--red)}
.tag-neutral{background:var(--bg-subtle);color:var(--text-secondary)}

/* SECTION TITLE */
.section-title{font-size:11px;font-weight:700;color:var(--accent);text-transform:uppercase;letter-spacing:0.08em;margin-bottom:14px;display:flex;align-items:center;justify-content:space-between}

/* ORG CHART */
.org-chart{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:40px 20px 32px;box-shadow:var(--shadow);margin-bottom:24px;overflow:visible;background:linear-gradient(180deg,var(--bg-card) 0%,var(--accent-light) 100%)}
.org-tree{display:flex;flex-direction:column;align-items:center;gap:0}
.org-node{background:var(--bg-card);border:2px solid var(--border);border-radius:12px;padding:16px 24px;text-align:center;position:relative;transition:all 0.3s;min-width:150px;cursor:pointer}
.org-node:hover{box-shadow:var(--shadow-md);border-color:var(--text-muted)}
.org-node.active{border-color:var(--sky);box-shadow:0 0 0 3px var(--sky-light)}
.org-node-icon{width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;margin:0 auto 8px;font-size:14px;color:#fff}
.org-node-name{font-size:15px;font-weight:700;color:var(--text);letter-spacing:-0.01em}
.org-node-role{font-size:11px;color:var(--text-muted);margin-top:2px}
.org-node-model{display:flex;align-items:center;gap:4px;justify-content:center;margin-top:6px;font-size:10px;color:var(--text-secondary)}
.org-model-dot{width:6px;height:6px;border-radius:50%;background:var(--amber)}
.org-active-badge{position:absolute;top:-8px;right:-8px;background:var(--sky);color:#fff;font-size:10px;font-weight:700;padding:2px 8px;border-radius:10px;letter-spacing:0.03em}
/* Hover tooltip */
.org-tooltip{position:absolute;bottom:calc(100% + 12px);left:50%;transform:translateX(-50%) scale(0.95);background:var(--text);color:#fff;padding:12px 16px;border-radius:10px;font-size:11px;line-height:1.6;white-space:nowrap;opacity:0;pointer-events:none;transition:all 0.2s ease;z-index:10;box-shadow:0 8px 24px rgba(16,24,40,0.2)}
.org-tooltip::after{content:'';position:absolute;top:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-top-color:var(--text)}
.org-node:hover .org-tooltip{opacity:1;transform:translateX(-50%) scale(1)}
.org-tooltip-title{font-weight:700;font-size:12px;margin-bottom:4px;color:#fff}
.org-tooltip-desc{color:rgba(255,255,255,0.7);font-weight:400}
/* AGENT DETAIL DRAWER — slide-out right panel */
.agent-drawer-backdrop{position:fixed;inset:0;background:rgba(13,17,23,0.42);opacity:0;pointer-events:none;transition:opacity 0.2s;z-index:998}
.agent-drawer-backdrop.open{opacity:1;pointer-events:auto}
.agent-drawer{position:fixed;top:0;right:0;bottom:0;width:480px;max-width:92vw;background:var(--bg-card);box-shadow:-12px 0 32px rgba(13,17,23,0.18);transform:translateX(100%);transition:transform 0.28s cubic-bezier(0.4,0,0.2,1);z-index:999;display:flex;flex-direction:column;overflow:hidden}
.agent-drawer.open{transform:translateX(0)}
/* When any right-side drawer is closed, transform:translateX(100%) slides it
   off-screen but its negative-x box-shadow still renders, bleeding back into
   the viewport as a vertical haze on the right edge. Null the shadow when
   closed. Applies to every drawer that follows this pattern. */
.agent-drawer:not(.open),
.proj-drawer:not(.open),
.tm-drawer:not(.open),
.obl-drawer:not(.open),
.admin-drawer:not(.open) { box-shadow: none; }
.agd-head{padding:20px 22px 16px;border-bottom:1px solid var(--border);position:relative}
.agd-head-row{display:flex;align-items:center;gap:14px}
.agd-icon{width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;color:#fff;flex-shrink:0;box-shadow:0 4px 12px color-mix(in srgb,var(--primary) 18%,transparent)}
.agd-name{font-size:18px;font-weight:700;color:var(--text);letter-spacing:-0.015em}
.agd-role{font-size:12px;color:var(--text-muted);margin-top:1px}
.agd-status{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:20px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;margin-top:8px}
.agd-status.active{background:var(--green-light);color:var(--green-dark)}
.agd-status.idle{background:var(--bg-subtle);color:var(--text-muted)}
.agd-status.error{background:var(--red-light);color:var(--red)}
.agd-status-dot{width:6px;height:6px;border-radius:50%;background:currentColor;flex-shrink:0}
.agd-status.active .agd-status-dot{animation:agdPulse 1.6s ease-in-out infinite}
@keyframes agdPulse{0%,100%{opacity:1}50%{opacity:0.35}}
.agd-close{position:absolute;top:18px;right:18px;width:30px;height:30px;border:none;background:var(--bg-subtle);border-radius:8px;color:var(--text-secondary);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:18px;transition:all 0.15s}
.agd-close:hover{background:var(--bg-hover);color:var(--text)}
.agd-body{flex:1;overflow-y:auto;padding:18px 22px 28px}
.agd-section{margin-bottom:22px}
.agd-section-title{font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.08em;margin-bottom:10px;display:flex;align-items:center;gap:8px}
.agd-mission{font-size:13px;line-height:1.55;color:var(--text-secondary);background:color-mix(in srgb,var(--sky) 7%,transparent);padding:12px 14px;border-radius:10px;border:1px solid color-mix(in srgb,var(--sky) 18%,transparent)}
.agd-list{list-style:none;padding:0;margin:0}
.agd-list li{font-size:12.5px;color:var(--text-secondary);padding:5px 0 5px 18px;position:relative;line-height:1.5}
.agd-list li::before{content:'';position:absolute;left:4px;top:11px;width:6px;height:6px;border-radius:50%;background:var(--accent)}
.agd-chips{display:flex;flex-wrap:wrap;gap:6px}
.agd-chip{font-size:11px;font-weight:500;padding:4px 10px;border-radius:14px;background:var(--bg-subtle);color:var(--text-secondary);border:1px solid var(--border-light)}
.agd-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px}
.agd-kpi{background:var(--bg-card);border:1px solid var(--border);border-radius:10px;padding:10px 12px}
.agd-kpi-label{font-size:10px;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.05em;font-weight:600}
.agd-kpi-value{font-size:18px;font-weight:700;color:var(--text);margin-top:2px;letter-spacing:-0.015em}
.agd-cron-row{display:flex;align-items:flex-start;gap:10px;padding:8px 0;border-bottom:1px solid var(--border-light)}
.agd-cron-row:last-child{border-bottom:none}
.agd-cron-name{font-size:12px;font-weight:600;color:var(--text);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.agd-cron-when{font-size:11px;color:var(--accent);font-weight:600;margin-top:1px}
.agd-cron-desc{font-size:11.5px;color:var(--text-muted);margin-top:2px;line-height:1.4}
.agd-activity-item{padding:8px 10px;background:var(--bg-subtle);border-radius:8px;margin-bottom:6px;border:1px solid var(--border-light)}
.agd-activity-item.success{border-left-color:var(--green)}
.agd-activity-item.error{border-left-color:var(--red)}
.agd-activity-action{font-size:12px;font-weight:600;color:var(--text)}
.agd-activity-details{font-size:11px;color:var(--text-secondary);margin-top:2px;line-height:1.45;word-break:break-word}
.agd-activity-time{font-size:10px;color:var(--text-muted);margin-top:3px;font-variant-numeric:tabular-nums}
.agd-empty{font-size:12px;color:var(--text-muted);font-style:italic;padding:6px 0}
.agd-loading{display:flex;align-items:center;justify-content:center;padding:60px 20px;color:var(--text-muted);font-size:13px}
/* Connectors */
.org-connector-v{width:2px;height:24px;background:var(--border);margin:0 auto}
.org-children{display:flex;gap:48px;justify-content:center;position:relative}
.org-child-wrap{display:flex;flex-direction:column;align-items:center}
.org-child-wrap::before{content:'';width:2px;height:24px;background:var(--border)}
.org-pulse{width:10px;height:10px;border-radius:50%;background:var(--sky);margin:0 auto;animation:orgPulse 2s infinite;position:relative;z-index:1}
@keyframes orgPulse{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--sky) 40%,transparent)}50%{box-shadow:0 0 0 6px color-mix(in srgb,var(--sky) 0%,transparent)}}

/* SCHEDULE TIMELINE */
.schedule-card{background:linear-gradient(135deg,#0D1B2A 0%,#0a2a4a 100%);border-radius:var(--radius-lg);padding:24px;margin-bottom:24px;color:#fff;box-shadow:0 4px 20px rgba(0,27,42,0.15)}
.schedule-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}
.schedule-title{font-size:13px;font-weight:700;color:#fff}
.schedule-subtitle{font-size:10px;color:rgba(255,255,255,0.4)}
.schedule-hours{display:flex;justify-content:space-between;padding:0 0 12px 140px;border-bottom:1px solid rgba(255,255,255,0.08);margin-bottom:16px}
.schedule-hour{font-size:10px;color:rgba(255,255,255,0.35);font-weight:500}
.schedule-row{display:flex;align-items:center;margin-bottom:24px}
.schedule-row:last-child{margin-bottom:0}
.schedule-bot-info{width:140px;flex-shrink:0}
.schedule-bot-name{font-size:13px;font-weight:600;color:#fff}
.schedule-bot-freq{font-size:10px;color:rgba(255,255,255,0.4);margin-top:2px}
.schedule-track{flex:1;height:2px;background:rgba(255,255,255,0.1);position:relative;border-radius:1px;overflow:visible}
.schedule-progress{position:absolute;top:0;left:0;height:100%;background:linear-gradient(90deg,color-mix(in srgb,var(--sky) 50%,transparent),color-mix(in srgb,var(--sky) 15%,transparent));border-radius:1px;transition:width 0.5s ease}
.schedule-now-marker{position:absolute;top:50%;transform:translate(-50%,-50%);width:3px;height:14px;background:var(--sky);border-radius:2px;box-shadow:0 0 8px color-mix(in srgb,var(--sky) 70%,transparent);z-index:3;transition:left 0.5s ease}
.schedule-dot{position:absolute;top:50%;transform:translate(-50%,-50%);width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,0.25);border:1.5px solid rgba(255,255,255,0.15);transition:all 0.3s;cursor:pointer;z-index:2}
.schedule-dot:hover{width:12px;height:12px;background:var(--sky);border-color:var(--sky);box-shadow:0 0 10px color-mix(in srgb,var(--sky) 50%,transparent)}
.schedule-dot.active{width:12px;height:12px;background:var(--sky);border-color:var(--sky);box-shadow:0 0 8px color-mix(in srgb,var(--sky) 60%,transparent)}
.schedule-dot.done{background:rgba(255,255,255,0.4);border-color:rgba(255,255,255,0.35)}
.schedule-dot.done:hover{background:rgba(255,255,255,0.6);border-color:rgba(255,255,255,0.5)}
/* Tooltip that shows on hover */
.schedule-tip{position:absolute;bottom:18px;left:50%;transform:translateX(-50%) scale(0.9);background:var(--bg-card);color:var(--text);padding:8px 12px;border-radius:8px;font-size:11px;line-height:1.5;white-space:nowrap;opacity:0;pointer-events:none;transition:all 0.2s ease;z-index:10;box-shadow:0 4px 16px rgba(16,24,40,0.3)}
.schedule-tip::after{content:'';position:absolute;top:100%;left:50%;transform:translateX(-50%);border:5px solid transparent;border-top-color:#fff}
.schedule-dot:hover .schedule-tip{opacity:1;transform:translateX(-50%) scale(1)}
.schedule-tip-time{font-weight:700;color:var(--text);font-size:12px}
.schedule-tip-task{color:var(--text-secondary);font-weight:400}
.schedule-tip-status{margin-top:2px;font-size:10px;font-weight:600}
/* Active dot label (current task) */
.schedule-label{position:absolute;bottom:14px;left:50%;transform:translateX(-50%);font-size:10px;color:var(--sky);font-weight:600;white-space:nowrap;background:color-mix(in srgb,var(--sky) 15%,transparent);padding:2px 8px;border-radius:8px;pointer-events:none}

/* BUDGET TABLE */
.budget-table{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px;box-shadow:var(--shadow);margin-bottom:24px}
.budget-table-header{display:grid;grid-template-columns:180px 1fr 120px;gap:12px;padding-bottom:12px;border-bottom:1px solid var(--border);margin-bottom:4px}
.budget-table-header span{font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.08em}
.budget-table-row{display:grid;grid-template-columns:180px 1fr 120px;gap:12px;align-items:center;padding:14px 0;border-bottom:1px solid var(--border-light)}
.budget-table-row:last-child{border-bottom:none}
.budget-table-row.total-row{border-top:2px solid var(--border);border-bottom:none;padding-top:16px;margin-top:4px}
.budget-agent{display:flex;align-items:center;gap:10px}
.budget-agent-icon{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:12px;flex-shrink:0}
.budget-agent-name{font-size:13px;font-weight:600;color:var(--text)}
.budget-agent-model{font-size:10px;color:var(--text-muted)}
.budget-bar-wrap{height:8px;background:var(--bg-subtle);border-radius:4px;overflow:hidden}
.budget-bar-fill{height:100%;border-radius:4px;transition:width 1s cubic-bezier(0.4,0,0.2,1)}
.budget-cost{font-size:14px;font-weight:700;color:var(--text);text-align:right}
.budget-cost span{font-weight:400;color:var(--text-muted);font-size:12px}

/* TWO COL LAYOUT */
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:24px}
.dash-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px;box-shadow:var(--shadow)}
.dash-card-header{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:16px}
.dash-card-title{font-size:13px;font-weight:700;color:var(--text)}
.dash-card-badge{font-size:10px;color:var(--text-muted)}

/* PIPELINE */
.pipe-stage{margin-bottom:12px}
.pipe-stage:last-child{margin-bottom:0}
.pipe-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}
.pipe-label{font-size:12px;color:var(--text-secondary);font-weight:500}
.pipe-count{font-size:14px;font-weight:700;color:var(--text)}
.pipe-bar-bg{background:var(--bg-subtle);border-radius:4px;height:6px;overflow:hidden}
.pipe-bar-fill{height:6px;border-radius:4px;transition:width 0.6s ease}

/* COST TRACKER */
.cost-row{display:flex;align-items:center;justify-content:space-between;padding:10px 0;border-bottom:1px solid var(--border-light);font-size:12px}
.cost-row:last-child{border-bottom:none}
.cost-bot{display:flex;align-items:center;gap:8px;font-weight:500;color:var(--text)}
.cost-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.cost-amount{font-weight:700;color:var(--text);font-size:13px}
.cost-bar-wrap{flex:1;margin:0 16px;height:6px;background:var(--bg-subtle);border-radius:3px;overflow:hidden;max-width:120px}
.cost-bar{height:100%;border-radius:3px;transition:width 0.8s cubic-bezier(0.4,0,0.2,1)}
.budget-section{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}
.budget-label{display:flex;justify-content:space-between;font-size:11px;color:var(--text-muted);margin-bottom:6px}
.budget-bar{height:10px;background:var(--bg-subtle);border-radius:5px;overflow:hidden}
.budget-fill{height:100%;border-radius:5px;transition:width 0.5s}

/* ACTIVITY TIMELINE */
.timeline-section{margin-bottom:24px}
.timeline-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow);overflow:hidden}
.timeline-item{display:flex;align-items:flex-start;gap:12px;padding:12px 20px;border-bottom:1px solid var(--border-light);font-size:12px;transition:background 0.1s}
.timeline-item:last-child{border-bottom:none}
.timeline-item:hover{background:var(--bg-hover)}
.timeline-icon{width:28px;height:28px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:13px;flex-shrink:0;background:var(--bg-subtle)}
.timeline-content{flex:1;min-width:0}
.timeline-bot-tag{font-size:11px;font-weight:700;padding:2px 7px;border-radius:10px;text-transform:uppercase;letter-spacing:0.04em;margin-right:6px}
.tag-bd{background:var(--sky-light);color:var(--accent)}
.tag-marketing{background:var(--green-light);color:var(--green-dark)}
.tag-website{background:var(--purple-light);color:var(--purple)}
.tag-sys{background:var(--bg-subtle);color:var(--text-secondary)}
.timeline-action{color:var(--text);font-weight:500}
.timeline-details{color:var(--text-muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.timeline-time{font-size:10px;color:var(--text-muted);white-space:nowrap;flex-shrink:0;margin-top:2px}

/* APPROVALS SECTION (dashboard inline) */
.approvals-inline{margin-bottom:24px}
.approval-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px 20px;margin-bottom:10px;box-shadow:var(--shadow);transition:box-shadow 0.2s}
.approval-card:hover{box-shadow:var(--shadow-md)}
.approval-meta{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.approval-bot-tag{font-size:10px;font-weight:700;padding:2px 9px;border-radius:20px;text-transform:uppercase;letter-spacing:0.05em}
.approval-time{font-size:11px;color:var(--text-muted);margin-left:auto}
.approval-title{font-size:14px;font-weight:600;color:var(--text);margin-bottom:8px}
.approval-content{font-size:12px;color:var(--text-secondary);line-height:1.65;background:color-mix(in srgb,var(--sky) 6%,transparent);border-radius:8px;padding:12px;margin-bottom:12px;white-space:pre-wrap;border:1px solid color-mix(in srgb,var(--sky) 20%,transparent)}
.approval-actions{display:flex;gap:8px;flex-wrap:wrap}
.btn-approve{background:var(--accent);color:#fff;border:none;padding:7px 16px;border-radius:8px;font-size:12px;cursor:pointer;font-weight:600;transition:background 0.15s}
.btn-approve:hover{background:var(--accent-dark)}
.btn-edit{background:var(--bg-card);color:var(--text-secondary);border:1.5px solid var(--border);padding:7px 16px;border-radius:8px;font-size:12px;cursor:pointer}
.btn-reject{background:var(--bg-card);color:var(--red);border:1.5px solid var(--red-light);padding:7px 16px;border-radius:8px;font-size:12px;cursor:pointer}
.btn-preview{background:var(--purple);color:#fff;border:none;padding:7px 16px;border-radius:8px;font-size:12px;cursor:pointer;font-weight:600}

/* ACTION BUTTONS */
.action-btns{display:flex;gap:8px;align-items:center}
.ping-btn{font-size:11px;background:var(--accent);color:#fff;border:none;padding:6px 14px;border-radius:8px;cursor:pointer;font-weight:600;transition:all 0.15s;letter-spacing:-0.01em}
.ping-btn:hover{background:var(--accent-dark)}
.stop-btn-dash{font-size:11px;background:var(--red);color:#fff;border:none;padding:6px 14px;border-radius:8px;cursor:pointer;font-weight:600;transition:all 0.15s}
.stop-btn-dash:hover{background:#b91c1c}

/* THEME TOGGLE — three-state cycler (light → dark → auto).
   Shows the icon matching the CURRENT state; label shows the state name.
   Persists to localStorage via cycleTheme() in JS. */
.theme-toggle{display:inline-flex;align-items:center;gap:6px;background:var(--bg-card);border:1px solid var(--border);color:var(--text-secondary);font-family:inherit;font-size:11px;font-weight:600;padding:6px 10px;border-radius:8px;cursor:pointer;transition:background 0.15s,border-color 0.15s,color 0.15s;letter-spacing:-0.01em}
.theme-toggle:hover{background:var(--bg-hover);color:var(--text);border-color:var(--accent)}
.theme-toggle:focus-visible{outline:none;box-shadow:var(--ring-primary)}
.theme-icon{flex-shrink:0;color:currentColor}
/* Show only the icon for the active state. JS sets data-theme-mode on the button. */
.theme-toggle .theme-icon-light,
.theme-toggle .theme-icon-dark,
.theme-toggle .theme-icon-auto{display:none}
.theme-toggle[data-theme-mode="light"] .theme-icon-light{display:inline-block}
.theme-toggle[data-theme-mode="dark"] .theme-icon-dark{display:inline-block}
.theme-toggle[data-theme-mode="auto"] .theme-icon-auto{display:inline-block}
.theme-label{user-select:none}
@media(max-width:480px){
  .theme-label{display:none}
  .theme-toggle{padding:6px 8px}
}

/* CHAT PANELS */
.chat-panel{background:var(--bg)}
.messages{flex:1;overflow-y:auto;padding:24px 28px;display:flex;flex-direction:column;gap:14px}
.msg-row{display:flex;flex-direction:column;max-width:72%}
.msg-row.user{align-self:flex-end;align-items:flex-end}
.msg-row.bot{align-self:flex-start;align-items:flex-start}
.msg-sender{font-size:10px;color:var(--text-muted);margin-bottom:4px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em}
.msg-bubble{padding:12px 16px;border-radius:var(--radius-lg);font-size:13px;line-height:1.7;word-break:break-word;max-width:100%}
.msg-row.bot .msg-bubble{background:var(--bg-card);border:1px solid var(--border);color:var(--text);border-bottom-left-radius:4px;box-shadow:var(--shadow)}
.msg-row.user .msg-bubble{background:var(--accent);color:#fff;border-bottom-right-radius:4px}
.msg-row.bot .msg-bubble h1,.msg-row.bot .msg-bubble h2,.msg-row.bot .msg-bubble h3{font-size:13px;font-weight:600;color:var(--text);margin:10px 0 5px}
.msg-row.bot .msg-bubble h1:first-child,.msg-row.bot .msg-bubble h2:first-child,.msg-row.bot .msg-bubble h3:first-child{margin-top:0}
.msg-row.bot .msg-bubble p{margin-bottom:7px}
.msg-row.bot .msg-bubble p:last-child{margin-bottom:0}
.msg-row.bot .msg-bubble ul,.msg-row.bot .msg-bubble ol{padding-left:16px;margin-bottom:7px}
.msg-row.bot .msg-bubble li{margin-bottom:3px}
.msg-row.bot .msg-bubble strong{font-weight:600;color:var(--accent)}
.msg-row.bot .msg-bubble{background:color-mix(in srgb,var(--sky) 5%,transparent)}
.msg-row.bot .msg-bubble a{color:var(--accent)}
.msg-row.bot .msg-bubble table{width:100%;border-collapse:collapse;font-size:12px;margin:8px 0}
.msg-row.bot .msg-bubble th{background:var(--bg-subtle);padding:6px 10px;text-align:left;border:1px solid var(--border);font-weight:600;color:var(--text)}
.msg-row.bot .msg-bubble td{padding:6px 10px;border:1px solid var(--border)}
.msg-row.bot .msg-bubble code{background:var(--bg-subtle);padding:2px 6px;border-radius:4px;font-size:12px;font-family:'SF Mono',monospace}
.typing{display:flex;gap:4px;align-items:center;padding:12px 16px;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);border-bottom-left-radius:4px;width:fit-content}
.typing span{width:5px;height:5px;background:var(--text-muted);border-radius:50%;animation:bounce 1.2s infinite}
.typing span:nth-child(2){animation-delay:0.2s}
.typing span:nth-child(3){animation-delay:0.4s}
@keyframes bounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-4px)}}
.chat-input-area{padding:16px 24px;border-top:1px solid var(--border);background:var(--bg-card);display:flex;gap:10px;align-items:flex-end;flex-shrink:0}
.chat-input-area textarea{flex:1;padding:10px 14px;border:1.5px solid var(--border);border-radius:var(--radius);font-size:13px;font-family:inherit;resize:none;outline:none;background:var(--bg);transition:border-color 0.15s,background 0.15s,box-shadow 0.15s;line-height:1.5;color:var(--text);max-height:120px}
.chat-input-area textarea:focus{border-color:var(--accent);background:var(--bg-card);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 8%,transparent)}
.chat-input-area textarea::placeholder{color:var(--text-muted)}
.send-btn{background:var(--accent);color:#fff;border:none;padding:10px 20px;border-radius:var(--radius);font-size:13px;cursor:pointer;font-weight:600;white-space:nowrap;transition:all 0.15s;flex-shrink:0}
.send-btn:hover{background:var(--accent-dark)}
.send-btn:disabled{background:var(--text-muted);cursor:not-allowed}
.stop-btn{background:var(--bg-card);color:var(--red);border:1.5px solid var(--red);padding:10px 14px;border-radius:var(--radius);font-size:13px;cursor:pointer;font-weight:500;display:none;flex-shrink:0}
.stop-btn.visible{display:block}

/* WELCOME */
.welcome{text-align:center;padding:60px 20px;color:var(--text-muted)}
.welcome-icon{width:52px;height:52px;background:var(--accent-light);border-radius:14px;display:flex;align-items:center;justify-content:center;margin:0 auto 14px;font-size:22px}
.welcome h3{font-size:15px;font-weight:600;color:var(--text);margin-bottom:6px}
.welcome p{font-size:12px;line-height:1.6}

/* SETTINGS */
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.settings-card{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--bg-glass-border);
  box-shadow:0 4px 24px rgba(16,24,40,0.06),0 1px 0 rgba(255,255,255,0.6) inset;
  border-radius:var(--radius-xl);
  padding:22px 24px;
}
.settings-card h3{font-size:11px;font-weight:700;color:var(--text-muted);margin-bottom:14px;text-transform:uppercase;letter-spacing:0.1em;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.health-bar-wrap{margin-bottom:10px}
.health-label{display:flex;justify-content:space-between;font-size:11px;color:var(--text-secondary);margin-bottom:4px}
.health-bar{height:6px;background:var(--bg-subtle);border-radius:4px;overflow:hidden}
.health-fill{height:100%;border-radius:4px;transition:width 0.6s ease}
.fill-green{background:var(--green)}
.fill-amber{background:var(--amber)}
.fill-red{background:var(--red)}
.conn-item{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--border-light);font-size:12px}
.conn-item:last-child{border-bottom:none}
.conn-name{color:var(--text-secondary);font-weight:500}
.conn-status{font-size:10px;font-weight:700;padding:2px 8px;border-radius:20px}
.conn-on{background:var(--green-light);color:var(--green-dark)}
.conn-off{background:var(--red-light);color:var(--red)}
.conn-pending{background:var(--amber-light);color:var(--amber)}
.settings-uptime{font-size:11px;color:var(--text-muted);margin-top:10px}
.usage-row{display:flex;align-items:center;justify-content:space-between;padding:6px 0;border-bottom:1px solid var(--border-light);font-size:12px}
.usage-row:last-child{border-bottom:none;padding-top:10px;margin-top:4px;border-top:1px solid var(--border)}
.usage-bot{color:var(--text-secondary);font-weight:500}
.usage-cost{font-size:11px;font-weight:700;color:var(--text);background:var(--bg-subtle);padding:2px 8px;border-radius:20px}
.model-row{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--border-light)}
.model-row:last-child{border-bottom:none}
.model-bot-name{font-size:12px;font-weight:500;color:var(--text)}
.model-select{font-size:11px;border:1.5px solid var(--border);border-radius:8px;padding:5px 10px;outline:none;color:var(--text);background:var(--bg-card);cursor:pointer;font-family:inherit}
.model-select:focus{border-color:var(--text)}
.key-row{display:flex;align-items:center;gap:8px;padding:7px 0;border-bottom:1px solid var(--border-light)}
.key-row:last-child{border-bottom:none}
.key-label{font-size:10px;font-weight:700;color:var(--text-muted);width:120px;flex-shrink:0;text-transform:uppercase;letter-spacing:0.04em}
.key-value{font-size:11px;font-family:'SF Mono',monospace;color:var(--text-secondary);flex:1;background:var(--bg-subtle);padding:5px 10px;border-radius:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.key-edit-btn{background:none;border:none;cursor:pointer;font-size:13px;flex-shrink:0;padding:2px 4px;opacity:0.5;transition:opacity 0.15s}
.key-edit-btn:hover{opacity:1}

/* BLOG MODAL */
.blog-modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);z-index:1000;display:none;align-items:center;justify-content:center;backdrop-filter:blur(4px)}
.blog-modal-overlay.open{display:flex}
.blog-modal{background:var(--bg-card);border-radius:16px;width:90%;max-width:800px;max-height:90vh;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 24px 64px rgba(16,24,40,0.2)}
.blog-modal-header{padding:18px 24px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;background:var(--accent)}
.blog-modal-header h3{color:#fff;font-size:14px;font-weight:600}
.blog-modal-close{background:none;border:none;color:rgba(255,255,255,0.6);font-size:20px;cursor:pointer;line-height:1;transition:color 0.15s}
.blog-modal-close:hover{color:#fff}
.blog-modal-meta{padding:12px 24px;background:var(--bg-subtle);border-bottom:1px solid var(--border);display:grid;grid-template-columns:1fr 1fr;gap:8px}
.blog-meta-item{font-size:11px}
.blog-meta-label{color:var(--text-muted);font-weight:600;text-transform:uppercase;letter-spacing:0.05em}
.blog-meta-value{color:var(--text);margin-top:2px}
.blog-modal-body{flex:1;overflow-y:auto;padding:24px;font-size:14px;line-height:1.8;color:var(--text)}
.blog-modal-body h1{font-size:20px;font-weight:700;color:var(--text);margin-bottom:14px}
.blog-modal-body h2{font-size:16px;font-weight:600;color:var(--text);margin:20px 0 8px;border-bottom:2px solid var(--bg-subtle);padding-bottom:6px}
.blog-modal-body p{margin-bottom:12px}
.blog-modal-footer{padding:14px 24px;border-top:1px solid var(--border);display:flex;gap:8px;justify-content:flex-end;background:var(--bg-card)}

/* SPINNER */
@keyframes spin{to{transform:rotate(360deg)}}
.spinner{width:10px;height:10px;border-radius:50%;border:2px solid var(--amber);border-top-color:transparent;animation:spin 1s linear infinite;display:inline-block;vertical-align:middle}

/* CONTENT CALENDAR — generating placeholder card */
@keyframes ccGenPulse{0%,100%{opacity:0.55}50%{opacity:0.95}}
.cc-card-generating{cursor:wait !important;background:repeating-linear-gradient(45deg,var(--border-light),var(--border-light) 8px,var(--border) 8px,var(--border) 16px) !important;border:1.5px dashed var(--amber) !important;animation:ccGenPulse 1.4s ease-in-out infinite}
.cc-card-generating .post-card-title{color:var(--text-muted);font-style:italic}
.cal-event.cc-card-generating{background:var(--text-muted) !important;color:#fff;animation:ccGenPulse 1.4s ease-in-out infinite}

/* MOBILE */
.mobile-menu-btn{display:none;background:none;border:none;color:var(--text);font-size:22px;cursor:pointer;padding:8px;line-height:1}
@media(max-width:768px){
  body{flex-direction:column;height:auto;min-height:100vh;overflow:auto}
  .sidebar{width:100%;height:auto;position:fixed;top:0;left:-100%;z-index:100;height:100vh;width:270px;transition:left 0.25s ease;box-shadow:4px 0 20px rgba(16,24,40,0.3)}
  .sidebar.open{left:0}
  .sidebar-overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.4);z-index:99}
  .sidebar-overlay.open{display:block}
  .mobile-menu-btn{display:block}
  .main{width:100%;min-height:100vh}
  .topbar{padding:12px 16px}
  .tab-panel{padding:16px}
  .dash-stats{grid-template-columns:repeat(2,1fr);gap:10px}
  .agents-grid{grid-template-columns:1fr}
  .two-col{grid-template-columns:1fr}
  .settings-grid{grid-template-columns:1fr}
  .chat-input-area{padding:12px 14px}
  .chat-input-area textarea{font-size:14px}
  .messages{padding:16px}
  .msg-row{max-width:90%}
  .approval-actions{flex-direction:column}
  .approval-actions button{width:100%;text-align:center}
  .blog-modal{width:95%;max-height:85vh}
  .blog-modal-meta{grid-template-columns:1fr}
}
@media(max-width:480px){
  .dash-stats{grid-template-columns:1fr}
  .msg-row{max-width:95%}
  .key-row{flex-wrap:wrap;gap:4px}
  .key-label{width:100%}
  .key-value{width:100%}
  .pipeline-controls-grid{grid-template-columns:1fr}
}

/* MOBILE — broad responsive pass for tables, modals, dense panels */
@media(max-width:768px){
  /* Tables: keep them readable with horizontal scroll + smaller fonts. */
  .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:var(--radius)}
  .data-table{font-size:11px;min-width:540px}
  .data-table th,.data-table td{padding:8px 10px}
  .table-controls{flex-wrap:wrap;gap:8px}
  .table-controls select,.table-controls input{flex:1;min-width:120px}
  .table-pagination{justify-content:center;flex-wrap:wrap;gap:6px}

  /* Cards: tighter padding + single column for KV / form rows. */
  .dash-card{padding:14px}
  .dash-card-header{flex-wrap:wrap;gap:8px}
  .analytics-card{padding:14px}
  .analytics-big{font-size:22px}

  /* Modals: full-width sheets instead of centered cards. */
  .blog-modal,.content-modal,.cw-modal{width:96vw;max-width:96vw;max-height:92vh;border-radius:12px}
  .modal,.modal-card{width:96vw;max-width:96vw;max-height:92vh}

  /* Topbar: hide subtitle, prioritise menu + title. */
  .topbar-left p{display:none}
  .topbar-left h2{font-size:14px}

  /* Marketing hero blocks: stack everything. */
  .mk-grid-2col,.mk-stat-strip{grid-template-columns:1fr !important}
  .mk-hero{padding:18px}
  .mk-hero h1{font-size:20px}

  /* Send-log buttons + filters wrap on small screens. */
  .send-log-toolbar{flex-wrap:wrap}

  /* Panels: never let a fixed-pixel inner element force horizontal page scroll. */
  .panel,.tab-panel{overflow-x:hidden}

  /* Long horizontally-scrolling boards (kanban, competitor) get visible scroll on touch. */
  .kanban-board,.cw-board{overflow-x:auto;-webkit-overflow-scrolling:touch}
}

/* PIPELINE CONTROLS */
.pipeline-controls-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:24px}
@media(max-width:900px){.pipeline-controls-grid{grid-template-columns:repeat(2,1fr)}}
.pipeline-control-item{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:14px 16px;display:flex;align-items:center;gap:12px;box-shadow:var(--shadow);transition:all 0.15s}
.pipeline-control-item:hover{box-shadow:var(--shadow-md)}
.pipeline-control-label{flex:1;font-size:12px;font-weight:600;color:var(--text);line-height:1.3}
.pipeline-toggle{position:relative;width:40px;height:22px;flex-shrink:0}
.pipeline-toggle input{opacity:0;width:0;height:0;position:absolute}
.pipeline-toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background:var(--border);border-radius:22px;transition:all 0.25s}
.pipeline-toggle-slider::before{content:'';position:absolute;height:16px;width:16px;left:3px;bottom:3px;background:var(--bg-card);border-radius:50%;transition:all 0.25s;box-shadow:0 1px 3px rgba(16,24,40,0.15)}
.pipeline-toggle input:checked+.pipeline-toggle-slider{background:var(--sky)}
.pipeline-toggle input:checked+.pipeline-toggle-slider::before{transform:translateX(18px)}
.pipeline-trigger-btn{font-size:10px;background:var(--accent);color:#fff;border:none;padding:5px 10px;border-radius:8px;cursor:pointer;font-weight:600;transition:all 0.15s;letter-spacing:-0.01em;white-space:nowrap}
.pipeline-trigger-btn:hover{background:var(--accent-dark)}

/* ANALYTICS PANELS */
.analytics-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:24px}
@media(max-width:900px){.analytics-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:480px){.analytics-grid{grid-template-columns:1fr}}
.analytics-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px;box-shadow:var(--shadow)}
.analytics-card h4{font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:8px}
.analytics-big{font-size:28px;font-weight:700;letter-spacing:-0.03em;line-height:1}
.analytics-sub{font-size:11px;color:var(--text-secondary);margin-top:6px}

/* DATA TABLE */
.data-table{width:100%;border-collapse:collapse;font-size:12px}
.data-table th{text-align:left;padding:10px 12px;background:var(--bg-subtle);font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;border-bottom:2px solid var(--border);position:sticky;top:0}
.data-table td{padding:9px 12px;border-bottom:1px solid var(--border-light);color:var(--text)}
.data-table tr:hover{background:var(--bg-hover)}
.data-table .status-sent{color:var(--green);font-weight:600}
.data-table .status-failed{color:var(--red);font-weight:600}
.data-table .status-bounced{color:var(--amber);font-weight:600}
.table-wrap{max-height:500px;overflow-y:auto;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-card);box-shadow:var(--shadow)}
.table-controls{display:flex;gap:8px;align-items:center;margin-bottom:14px;flex-wrap:wrap}
.table-filter{font-size:12px;border:1.5px solid var(--border);border-radius:8px;padding:6px 12px;outline:none;color:var(--text);background:var(--bg-card);font-family:inherit}
.table-filter:focus{border-color:var(--accent)}
.table-pagination{display:flex;gap:6px;align-items:center;margin-top:12px;justify-content:center}
.table-pagination button{font-size:11px;background:var(--bg-card);color:var(--text-secondary);border:1px solid var(--border);padding:5px 12px;border-radius:6px;cursor:pointer;font-weight:500}
.table-pagination button:hover{background:var(--bg-hover)}
.table-pagination button:disabled{opacity:0.4;cursor:not-allowed}
.table-pagination span{font-size:11px;color:var(--text-muted)}

/* EVENT FEED */
.event-feed{max-height:600px;overflow-y:auto}
.event-item{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border-light);transition:background 0.1s}
.event-item:hover{background:var(--bg-hover)}
.event-icon{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0}
.event-icon.hot-lead{background:var(--red-light);color:var(--red)}
.event-icon.deal-won{background:var(--green-light);color:var(--green)}
.event-icon.email-bounced{background:var(--amber-light);color:var(--amber)}
.event-icon.landing-page{background:var(--purple-light);color:var(--purple)}
.event-icon.emergency{background:var(--red-light);color:var(--red)}
.event-icon.resume{background:var(--green-light);color:var(--green)}
.event-content{flex:1;min-width:0}
.event-type{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.04em}
.event-details{font-size:12px;color:var(--text-secondary);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.event-time{font-size:10px;color:var(--text-muted);white-space:nowrap;flex-shrink:0}

/* BOT HEALTH */
.health-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:24px}
@media(max-width:900px){.health-grid{grid-template-columns:1fr 1fr}}
@media(max-width:480px){.health-grid{grid-template-columns:1fr}}
.health-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px;box-shadow:var(--shadow)}
.health-card h4{font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:12px}
.health-metric{display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid var(--border-light);font-size:12px}
.health-metric:last-child{border-bottom:none}
.health-metric-label{color:var(--text-secondary);font-weight:500}
.health-metric-value{font-weight:700;color:var(--text)}
.health-ok{color:var(--green) !important}
.health-warn{color:var(--amber) !important}
.health-error{color:var(--red) !important}
.cron-row{display:flex;align-items:center;gap:8px;padding:8px 0;border-bottom:1px solid var(--border-light);font-size:12px}
.cron-row:last-child{border-bottom:none}
.cron-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.cron-name{flex:1;font-weight:500;color:var(--text)}
.cron-time{color:var(--text-muted);font-size:10px}

/* VELOCITY CARD */
.velocity-stage{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border-light);font-size:12px}
.velocity-stage:last-child{border-bottom:none}
.velocity-name{width:160px;font-weight:500;color:var(--text)}
.velocity-count{width:40px;font-weight:700;color:var(--accent);text-align:center}
.velocity-days{width:60px;color:var(--text-secondary);text-align:center}
.velocity-stale{width:40px;text-align:center;font-weight:600}
.velocity-bar{flex:1;height:6px;background:var(--bg-subtle);border-radius:3px;overflow:hidden}
.velocity-bar-fill{height:100%;border-radius:3px;transition:width 0.6s ease}

/* CONTENT CALENDAR */
.cal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;flex-wrap:wrap;gap:12px}
.cal-nav{display:flex;align-items:center;gap:12px}
.cal-nav-btn{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);padding:6px 12px;cursor:pointer;font-size:12px;font-weight:600;color:var(--text-secondary);transition:all var(--duration-base) var(--ease-out)}
.cal-nav-btn:hover{background:var(--accent-light);color:var(--accent);border-color:var(--accent)}
.cal-month-label{font-size:15px;font-weight:700;color:var(--text);min-width:160px;text-align:center}
.cal-actions{display:flex;gap:8px}
.cal-add-btn{background:var(--accent);color:#fff;border:none;border-radius:var(--radius-md);padding:8px 16px;font-size:12px;font-weight:600;cursor:pointer;transition:all var(--duration-base) var(--ease-out);display:flex;align-items:center;gap:6px}
.cal-add-btn:hover{background:var(--accent-dark)}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:var(--border);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;margin-bottom:24px}
.cal-day-header{background:var(--bg-subtle);padding:8px;font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;text-align:center}
.cal-day{background:var(--bg-card);min-height:100px;padding:6px;cursor:pointer;transition:background 0.1s;position:relative}
.cal-day:hover{background:var(--bg-hover)}
.cal-day.today{background:var(--accent-light)}
.cal-day.other-month{background:var(--bg-subtle);opacity:0.5}
.cal-day-num{font-size:11px;font-weight:600;color:var(--text-secondary);margin-bottom:4px}
.cal-day.today .cal-day-num{color:var(--accent);font-weight:700}
.cal-event{font-size:10px;padding:2px 5px;border-radius:4px;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;font-weight:500;transition:all 0.1s}
.cal-event:hover{opacity:0.85;transform:scale(1.02)}
.cal-event.instagram{background:#E1306C;color:#fff}
.cal-event.linkedin{background:#0A66C2;color:#fff}
.cal-event.facebook{background:#1877F2;color:#fff}
.cal-event.twitter{background:#1DA1F2;color:#fff}
.cal-event.tiktok{background:#010101;color:#fff}
.cal-event.whatsapp{background:#25D366;color:#fff}
.cal-event.newsletter{background:var(--amber);color:#fff}
.cal-event.blog{background:var(--purple);color:#fff}
.cal-event.approved{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--green) 50%,transparent)}
.cal-event.posted{opacity:0.55}
.cal-upcoming{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:20px;box-shadow:var(--shadow);margin-bottom:24px}
.cal-upcoming-item{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border-light)}
.cal-upcoming-item:last-child{border-bottom:none}
.cal-upcoming-platform{font-size:10px;font-weight:700;padding:3px 8px;border-radius:6px;color:#fff;min-width:70px;text-align:center;text-transform:uppercase;letter-spacing:0.03em}
.cal-upcoming-content{flex:1;min-width:0}
.cal-upcoming-title{font-size:13px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cal-upcoming-meta{font-size:10px;color:var(--text-muted);margin-top:2px}
.cal-upcoming-status{font-size:10px;font-weight:600;padding:2px 8px;border-radius:10px}
.cal-status-idea{background:#F0F4FF;color:#5B6BD5}
.cal-status-draft{background:var(--sky-light);color:var(--accent)}
.cal-status-designed{background:#FFF7ED;color:#C2410C}
.cal-status-review{background:#FDF4FF;color:#A21CAF}
.cal-status-planned{background:var(--sky-light);color:var(--accent)}
.cal-status-approved{background:var(--green-light);color:var(--green-dark)}
.cal-status-posted{background:var(--bg-subtle);color:var(--text-muted)}
.cal-status-analyzed{background:#F0FDF4;color:var(--success-fg)}
.cal-status-recycled{background:var(--amber-light);color:var(--amber)}
.cal-action-row{display:flex;gap:4px;flex-shrink:0}
.cal-action-btn{background:var(--bg-subtle);border:1px solid var(--border);border-radius:var(--radius-sm);padding:3px 8px;font-size:10px;font-weight:600;cursor:pointer;transition:all var(--duration-base) var(--ease-out);white-space:nowrap}
.cal-action-btn:hover{background:var(--accent-light);color:var(--accent);border-color:var(--accent)}
.cal-action-btn.approve{background:var(--green-light);color:var(--green-dark);border-color:var(--green-light)}
.cal-action-btn.approve:hover{background:var(--green);color:#fff}
.cal-action-btn.post{background:var(--accent-light);color:var(--accent);border-color:var(--accent-light)}
.cal-action-btn.post:hover{background:var(--accent);color:#fff}
.cal-action-btn.download{background:var(--purple-light);color:var(--purple);border-color:var(--purple-light)}
.cal-action-btn.download:hover{background:var(--purple);color:#fff}
.cal-action-btn.reschedule{background:var(--amber-light);color:var(--amber);border-color:var(--amber-light)}
.cal-action-btn.reschedule:hover{background:var(--amber);color:#fff}
.cal-status-brief{background:#EFF6FF;color:#2563EB}
.cal-status-creating{background:#FFF7ED;color:#C2410C}
.cal-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:24px}
/* View toggle buttons */
.cal-view-toggles{display:flex;gap:4px;background:var(--bg-subtle);border-radius:8px;padding:3px}
.cal-view-btn{background:transparent;border:none;padding:5px 12px;font-size:11px;font-weight:600;color:var(--text-muted);cursor:pointer;border-radius:var(--radius-sm);transition:all var(--duration-base) var(--ease-out)}
.cal-view-btn.active{background:var(--bg-card);color:var(--accent);box-shadow:0 1px 3px rgba(16,24,40,0.08)}
/* Post card redesign */
.post-card{display:flex;gap:10px;padding:10px;background:var(--bg-card);border:1px solid var(--border);border-radius:10px;margin-bottom:8px;transition:all 0.15s;position:relative;cursor:pointer;overflow:hidden}
.post-card:hover{border-color:var(--accent);box-shadow:0 2px 8px rgba(16,24,40,0.06)}
.post-card-thumb{width:56px;height:56px;border-radius:6px;background:var(--bg-subtle);flex-shrink:0;overflow:hidden;display:flex;align-items:center;justify-content:center;position:relative}
.post-card-thumb img{width:100%;height:100%;object-fit:cover;cursor:pointer}
.post-card-thumb .no-img{font-size:16px;color:var(--text-muted);opacity:0.25}
.post-card-thumb .img-count{position:absolute;bottom:2px;right:2px;background:rgba(0,0,0,0.65);color:#fff;font-size:10px;font-weight:700;padding:1px 4px;border-radius:3px}
.post-card-body{flex:1;min-width:0;overflow:hidden}
.post-card-top{display:flex;align-items:center;gap:4px;margin-bottom:3px;flex-wrap:wrap}
.post-card-platform{font-size:11px;font-weight:700;padding:1px 5px;border-radius:3px;color:#fff;text-transform:uppercase;letter-spacing:0.03em}
.post-card-type{font-size:10px;font-weight:600;padding:1px 5px;border-radius:3px;background:var(--bg-subtle);color:var(--text-muted)}
.post-card-phase{font-size:10px;font-weight:600;padding:1px 5px;border-radius:8px}
.post-card-title{font-size:12px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:2px}
.post-card-meta{font-size:10px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.post-card-actions{display:flex;gap:3px;margin-top:4px;flex-wrap:wrap}
/* Kanban columns */
.kanban-board{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:24px}
.kanban-col{background:var(--bg-subtle);border-radius:10px;padding:8px;min-height:120px;overflow:hidden}
.kanban-col-header{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;padding:6px 8px;border-radius:6px;margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}
.kanban-col-count{font-size:10px;font-weight:600;padding:2px 6px;border-radius:10px;background:rgba(0,0,0,0.08)}
.kanban-col .post-card{margin-bottom:6px;padding:8px;gap:8px}
.kanban-col .post-card-thumb{width:40px;height:40px;border-radius:5px}
.kanban-col .post-card-title{font-size:11px}
.kanban-col .post-card-meta{font-size:10px}
.kanban-col .post-card-top{gap:3px}
.kanban-col .post-card-actions{gap:2px}
.kanban-col .cal-action-btn{font-size:10px;padding:2px 5px}
@media(max-width:900px){.kanban-board{grid-template-columns:1fr 1fr;gap:8px}}
@media(max-width:480px){.kanban-board{grid-template-columns:1fr}}
/* Image lightbox */
.img-lightbox{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.85);z-index:10000;align-items:center;justify-content:center;flex-direction:column;gap:16px}
.img-lightbox.active{display:flex}
.img-lightbox img{max-width:90vw;max-height:80vh;object-fit:contain;border-radius:8px;box-shadow:0 8px 32px rgba(16,24,40,0.4)}
.img-lightbox-close{position:absolute;top:20px;right:24px;background:rgba(255,255,255,0.15);border:none;color:#fff;font-size:24px;width:40px;height:40px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center}
.img-lightbox-close:hover{background:rgba(255,255,255,0.3)}
.img-lightbox-actions{display:flex;gap:10px}
.img-lightbox-actions a,.img-lightbox-actions button{background:rgba(255,255,255,0.15);border:1px solid rgba(255,255,255,0.2);color:#fff;padding:8px 20px;border-radius:8px;font-size:13px;font-weight:500;cursor:pointer;text-decoration:none;display:flex;align-items:center;gap:6px}
.img-lightbox-actions a:hover,.img-lightbox-actions button:hover{background:rgba(255,255,255,0.25)}
/* Image filmstrip in modal */
.img-filmstrip{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.img-filmstrip-item{width:80px;height:80px;border-radius:8px;overflow:hidden;position:relative;cursor:pointer;border:2px solid var(--border);transition:border-color 0.15s}
.img-filmstrip-item:hover{border-color:var(--accent)}
.img-filmstrip-item img{width:100%;height:100%;object-fit:cover}
.img-filmstrip-item .img-delete{position:absolute;top:2px;right:2px;background:rgba(0,0,0,0.6);color:#fff;border:none;font-size:10px;width:16px;height:16px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity 0.15s}
.img-filmstrip-item:hover .img-delete{opacity:1}
.img-upload-zone{width:80px;height:80px;border:2px dashed var(--border);border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;transition:all 0.15s;font-size:10px;color:var(--text-muted);gap:2px}
.img-upload-zone:hover{border-color:var(--accent);background:var(--accent-light)}
/* Phase progress bar (stepped editor) */
.phase-progress{display:flex;gap:4px;margin-bottom:14px;align-items:center;flex-wrap:wrap}
.phase-step{flex:1;min-width:70px;padding:6px 8px;border-radius:6px;background:var(--bg-subtle);border:1px solid var(--border);font-size:10px;font-weight:600;color:var(--text-muted);text-align:center;cursor:pointer;text-transform:uppercase;letter-spacing:0.03em;transition:all 0.15s;display:flex;align-items:center;justify-content:center;gap:4px;position:relative}
.phase-step:hover{border-color:var(--accent)}
.phase-step.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.phase-step.done{background:var(--green);color:#fff;border-color:var(--green)}
.phase-step.done::after{content:'✓';font-weight:700}
.phase-advance-btn{background:var(--accent);color:#fff;border:none;padding:6px 12px;border-radius:6px;font-size:11px;font-weight:600;cursor:pointer;white-space:nowrap}
.phase-advance-btn:hover{opacity:0.9}
.phase-advance-btn:disabled{background:var(--border);cursor:default}
@media(max-width:768px){
  .cal-grid{grid-template-columns:repeat(7,1fr)}
  .cal-day{min-height:70px}
  .cal-event{font-size:10px;padding:1px 3px}
  .cal-stats{grid-template-columns:repeat(2,1fr)}
  .cal-header{flex-direction:column;align-items:stretch}
}
@media(max-width:480px){
  .cal-stats{grid-template-columns:1fr}
  .cal-day{min-height:55px;padding:3px}
  .cal-day-num{font-size:10px}
}

/* CONTENT MODAL — only the inner-pane + form-field rules survive. The
   shell (.content-modal-overlay, .content-modal, .content-modal-header,
   .content-modal-body, .content-modal-footer) was migrated to .tv2-modal-*
   on 2026-04-30; those orphan rules were removed because the backdrop
   in particular (rgba(0,0,0,0.5) blur(4px)) was a candidate to override
   the new tv2-modal-backdrop visually if a stale class lingered anywhere. */
.content-modal-grid{display:grid;grid-template-columns:1fr 260px;gap:0}
.content-modal-left{padding:20px 24px;border-right:1px solid var(--border)}
.content-modal-right{padding:20px;background:var(--bg-subtle)}
.content-modal-right h4{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:var(--text-secondary);margin:0 0 10px 0}
@media(max-width:700px){.content-modal-grid{grid-template-columns:1fr}.content-modal-right{border-top:1px solid var(--border);border-right:none}}
.content-form-group{margin-bottom:16px}
.content-form-group label{display:block;font-size:11px;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:0.04em;margin-bottom:6px}
.content-form-group input,.content-form-group select,.content-form-group textarea{width:100%;padding:8px 12px;border:1.5px solid var(--border);border-radius:8px;font-size:13px;font-family:inherit;color:var(--text);background:var(--bg-card);transition:border-color 0.15s}
.content-form-group input:focus,.content-form-group select:focus,.content-form-group textarea:focus{border-color:var(--accent);outline:none;box-shadow:0 0 0 3px var(--accent-light)}
.content-form-group textarea{min-height:80px;resize:vertical}
.content-form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media(max-width:480px){.content-form-row{grid-template-columns:1fr}.post-card-thumb{width:52px;height:52px}.post-card-actions{flex-wrap:wrap}}

/* ============================================================
   MARKETING REBUILD — design tokens & components
   ============================================================ */
:root{
  --mk-navy:#0056A4; --mk-navy-dark:#004485; --mk-sky:#6AABE5; --mk-sky-tint:#EEF5FD;
  --mk-bg:#FAFAF8; --mk-surface:#FFFFFF; --mk-text:#0D1117; --mk-text-muted:#6B7280;
  --mk-border:#E5E7EB; --mk-border-strong:#D1D5DB;
  --mk-success:#16A34A; --mk-warn:#D97706; --mk-error:#DC2626; --mk-purple:#7C3AED;
  --mk-r-sm:8px; --mk-r-md:16px; --mk-r-lg:24px; --mk-r-pill:999px;
  --mk-shadow-sm:0 1px 3px rgba(13,17,23,.06),0 1px 2px rgba(13,17,23,.04);
  --mk-shadow-md:0 4px 16px rgba(13,17,23,.08);
  --mk-shadow-lg:0 8px 32px rgba(13,17,23,.10);
}

/* All marketing panels migrated to V2 hero — they use standard tab-panel padding now.
   Idea-engine kept on the legacy mk-hero until it gets its own V2 pass. */
#panel-content-calendar,#panel-idea-engine,#panel-competitor-watch,#panel-newsletter{
  font-size:14px;color:var(--mk-text);
}
#panel-idea-engine .tab-panel{padding:0}

.mk-hero{background:linear-gradient(135deg,var(--mk-sky-tint) 0%,#FFFFFF 100%);border:1px solid var(--mk-border);border-radius:var(--mk-r-lg);padding:24px 28px;margin-bottom:20px;display:flex;justify-content:space-between;align-items:center;gap:24px;flex-wrap:wrap}
.mk-hero-newsletter{background:linear-gradient(135deg,var(--mk-navy) 0%,var(--mk-sky) 100%);color:#fff;border-color:transparent}
.mk-hero-newsletter .mk-hero-title,.mk-hero-newsletter .mk-hero-eyebrow,.mk-hero-newsletter .mk-hero-sub{color:#fff}
.mk-hero-newsletter .mk-hero-eyebrow{opacity:0.85}
.mk-hero-newsletter .mk-hero-sub{opacity:0.92}
.mk-hero-newsletter .mk-pill-tag{background:rgba(255,255,255,0.2);color:#fff;border-color:rgba(255,255,255,0.4)}
.mk-hero-left{flex:1;min-width:280px}
.mk-hero-eyebrow{font-size:11px;font-weight:700;color:var(--mk-navy);text-transform:uppercase;letter-spacing:0.08em;margin-bottom:8px}
.mk-hero-title{font-size:24px;font-weight:700;line-height:1.2;color:var(--mk-text);margin-bottom:8px}
.mk-hero-sub{font-size:14px;color:var(--mk-text-muted);line-height:1.55;max-width:680px}
.mk-hero-cta{display:flex;gap:8px;flex-wrap:wrap}
.mk-hero-side{text-align:right;min-width:200px}
.mk-hero-bignum{font-size:22px;font-weight:700;color:#fff;margin:6px 0}

.mk-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.mk-toolbar-sub{margin-bottom:10px}
.mk-toolbar-group{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.mk-toolbar-label{font-size:14px;font-weight:600;color:var(--mk-text)}

.mk-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border-radius:var(--radius-pill);padding:10px 20px;font-size:13px;font-weight:600;font-family:inherit;cursor:pointer;border:1.5px solid transparent;transition:all var(--duration-base) var(--ease-out);min-height:40px;line-height:1}
.mk-btn-primary{background:var(--mk-navy);color:#fff;border-color:var(--mk-navy)}
.mk-btn-primary:hover{background:var(--mk-navy-dark);border-color:var(--mk-navy-dark)}
.mk-btn-secondary{background:var(--bg-card);color:var(--mk-navy);border-color:var(--mk-navy)}
.mk-btn-secondary:hover{background:var(--mk-sky-tint)}
.mk-btn-ghost{background:transparent;color:var(--mk-navy);border-color:var(--mk-border)}
.mk-btn-ghost:hover{background:var(--mk-sky-tint);border-color:var(--mk-sky)}
.mk-btn-danger:hover{background:#FEF2F2;color:var(--mk-error);border-color:var(--mk-error)}

.mk-pill{background:var(--bg-card);color:var(--mk-text);border:1px solid var(--mk-border);border-radius:var(--mk-r-pill);padding:7px 14px;font-size:12px;font-weight:600;cursor:pointer;transition:all .15s}
.mk-pill:hover{border-color:var(--mk-sky);color:var(--mk-navy)}
.mk-pill-muted{background:var(--mk-bg);color:var(--mk-text-muted)}
.mk-pill-tag{display:inline-block;background:var(--mk-sky-tint);color:var(--mk-navy);border:1px solid var(--mk-sky);border-radius:var(--mk-r-pill);padding:3px 10px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.05em}
.mk-icon-btn{width:32px;height:32px;border:1px solid var(--mk-border);border-radius:var(--mk-r-pill);background:var(--bg-card);color:var(--mk-text);cursor:pointer;font-size:16px;line-height:1;display:inline-flex;align-items:center;justify-content:center;transition:all .15s}
.mk-icon-btn:hover{border-color:var(--mk-sky);color:var(--mk-navy);background:var(--mk-sky-tint)}

.mk-segmented{display:inline-flex;background:var(--mk-bg);border:1px solid var(--mk-border);border-radius:var(--mk-r-pill);padding:3px;gap:0}
.mk-seg{background:transparent;border:none;color:var(--mk-text-muted);padding:6px 14px;font-size:12px;font-weight:600;border-radius:var(--mk-r-pill);cursor:pointer;transition:all .15s}
.mk-seg.active{background:var(--bg-card);color:var(--mk-navy);box-shadow:var(--mk-shadow-sm)}
.mk-seg:hover:not(.active){color:var(--mk-text)}

.mk-stat-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:20px}
.mk-stat{background:var(--bg-card);border:1px solid var(--mk-border);border-radius:var(--mk-r-md);padding:14px 18px;box-shadow:var(--mk-shadow-sm)}
.mk-stat-label{font-size:10px;font-weight:600;color:var(--mk-text-muted);text-transform:uppercase;letter-spacing:0.08em;margin-bottom:6px}
.mk-stat-value{font-size:24px;font-weight:700;color:var(--mk-text);line-height:1.1}
.mk-color-amber{color:var(--mk-warn)}
.mk-color-green{color:var(--mk-success)}
.mk-color-navy{color:var(--mk-navy)}
.mk-color-red{color:var(--mk-error)}

.mk-section-title{font-size:14px;font-weight:700;color:var(--mk-text);text-transform:uppercase;letter-spacing:0.05em;margin:24px 0 12px;display:flex;align-items:center;gap:10px}
.mk-section-sub{font-size:11px;font-weight:400;color:var(--mk-text-muted);text-transform:none;letter-spacing:0}

.mk-card{background:var(--bg-card);border:1px solid var(--mk-border);border-radius:var(--mk-r-md);box-shadow:var(--mk-shadow-sm);transition:all .15s}
.mk-card-padded{padding:20px}
.mk-card-stack{display:flex;flex-direction:column;gap:10px}
.mk-card-title{font-size:14px;font-weight:700;color:var(--mk-text);margin-bottom:12px}
.mk-card-title-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.mk-empty{font-size:13px;color:var(--mk-text-muted);text-align:center;padding:32px 20px;background:var(--bg-card);border:1px dashed var(--mk-border);border-radius:var(--mk-r-md)}
.mk-microcopy{font-size:12px;color:var(--mk-text-muted);line-height:1.55;margin-top:12px}
.mk-microcopy code{background:var(--mk-bg);padding:1px 6px;border-radius:4px;font-size:11px;color:var(--mk-navy);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}

/* Calendar grid override */
.mk-cal-grid{background:var(--mk-border);border:1px solid var(--mk-border);border-radius:var(--mk-r-md);overflow:hidden;margin-bottom:24px;box-shadow:var(--mk-shadow-sm)}
.mk-cal-grid .cal-day-header{background:var(--mk-bg);font-size:11px;font-weight:700;color:var(--mk-text-muted);padding:10px 8px}
.mk-cal-grid .cal-day{background:var(--bg-card);min-height:110px;padding:8px}
.mk-cal-grid .cal-day:hover{background:var(--mk-sky-tint)}
.mk-cal-grid .cal-day.today{background:var(--mk-sky-tint);box-shadow:inset 0 0 0 2px var(--mk-sky)}
.mk-cal-grid .cal-day.today .cal-day-num{color:var(--mk-navy);font-weight:800}
.mk-cal-grid .cal-day-num{font-size:12px;font-weight:600;color:var(--mk-text);margin-bottom:5px}

/* Week grid */
.mk-week-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;min-height:420px}

/* Kanban */
.mk-kanban-board{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;overflow-x:auto;padding-bottom:8px}
@media(max-width:1100px){.mk-kanban-board{grid-template-columns:repeat(3,minmax(220px,1fr));overflow-x:auto}}
@media(max-width:700px){.mk-kanban-board{grid-template-columns:repeat(2,minmax(220px,1fr))}}
.mk-kanban-col{background:var(--mk-bg);border:1px solid var(--mk-border);border-radius:var(--mk-r-md);padding:10px;min-height:200px;transition:all .15s}
.mk-kanban-col.dragover{background:var(--mk-sky-tint);border-color:var(--mk-sky);box-shadow:inset 0 0 0 2px var(--mk-sky)}
.mk-kanban-col-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;padding:0 4px}
.mk-kanban-col-name{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;color:var(--mk-text)}
.mk-kanban-col-count{font-size:10px;font-weight:700;background:var(--bg-card);padding:2px 8px;border-radius:var(--mk-r-pill);color:var(--mk-text-muted);border:1px solid var(--mk-border)}
.mk-kanban-card{background:var(--bg-card);border:1px solid var(--mk-border);border-radius:var(--mk-r-sm);padding:10px;margin-bottom:8px;cursor:grab;box-shadow:var(--mk-shadow-sm);transition:all .15s;font-size:12px}
.mk-kanban-card:hover{box-shadow:var(--mk-shadow-md);transform:translateY(-1px)}
.mk-kanban-card.dragging{opacity:0.4;cursor:grabbing}
.mk-kanban-card-title{font-weight:600;color:var(--mk-text);margin-bottom:6px;line-height:1.3}
.mk-kanban-card-meta{font-size:10px;color:var(--mk-text-muted);display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.mk-platform-chip{display:inline-block;font-size:10px;font-weight:700;padding:2px 6px;border-radius:var(--mk-r-pill);color:#fff;text-transform:uppercase}

/* Phase semantic colors — pastel tints in light mode.
   Dark mode override below replaces with translucent tinted hues
   on the dark canvas so kanban columns don't look like bright
   pastel islands in dark theme. */
.mk-phase-idea{background:#F3F4F6;color:var(--text-muted)}
.mk-phase-brief{background:var(--mk-sky-tint);color:var(--mk-navy)}
.mk-phase-creating{background:#E0F2FE;color:#0284C7}
.mk-phase-review{background:var(--warn-bg);color:#B45309}
.mk-phase-approved{background:#D1FAE5;color:#047857}
.mk-phase-posted{background:var(--success-bg);color:#16A34A}
.mk-phase-analyzed{background:#EDE9FE;color:#7C3AED}
[data-theme="dark"] .mk-phase-idea{background:rgba(148,163,184,0.10);color:var(--text-muted)}
[data-theme="dark"] .mk-phase-brief{background:color-mix(in srgb,var(--sky) 10%,transparent);color:#6AABE5}
[data-theme="dark"] .mk-phase-creating{background:rgba(56,189,248,0.12);color:#7DD3FC}
[data-theme="dark"] .mk-phase-review{background:color-mix(in srgb,var(--amber) 14%,transparent);color:#FCD34D}
[data-theme="dark"] .mk-phase-approved{background:rgba(34,197,94,0.14);color:#86EFAC}
[data-theme="dark"] .mk-phase-posted{background:color-mix(in srgb,var(--green) 14%,transparent);color:#86EFAC}
[data-theme="dark"] .mk-phase-analyzed{background:rgba(167,139,250,0.14);color:#C4B5FD}

/* Idea Engine */
.mk-grid-2col{display:grid;grid-template-columns:380px 1fr;gap:20px}
@media(max-width:900px){.mk-grid-2col{grid-template-columns:1fr}.mk-stat-strip{grid-template-columns:repeat(2,1fr)}}
.mk-form-stack{display:flex;flex-direction:column;gap:12px}
.mk-form-row label,.mk-label{display:block;font-size:11px;font-weight:600;color:var(--mk-text-muted);text-transform:uppercase;letter-spacing:0.05em;margin-bottom:6px}
.mk-form-2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.mk-input{width:100%;padding:10px 14px;border:1.5px solid var(--mk-border);border-radius:var(--mk-r-sm);background:var(--bg-card);color:var(--mk-text);font-size:13px;font-family:inherit;box-sizing:border-box;transition:all .15s}
.mk-input:focus{outline:none;border-color:var(--mk-sky);box-shadow:0 0 0 3px var(--mk-sky-tint)}
.mk-input-mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.5}

.mk-idea-card{background:var(--bg-card);border:1px solid var(--mk-border);border-radius:var(--mk-r-md);padding:18px;box-shadow:var(--mk-shadow-sm);transition:all .15s}
.mk-idea-card:hover{box-shadow:var(--mk-shadow-md)}
.mk-idea-meta{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}
.mk-idea-hook{font-size:15px;font-weight:600;color:var(--mk-text);line-height:1.35;margin-bottom:6px}
.mk-idea-angle{font-size:13px;color:var(--mk-text-muted);line-height:1.55;margin-bottom:10px}
.mk-idea-ref{font-size:11px;color:var(--mk-navy);background:var(--mk-sky-tint);padding:4px 10px;border-radius:var(--mk-r-pill);display:inline-block;margin-bottom:12px}
.mk-idea-actions{display:flex;gap:6px;flex-wrap:wrap}

/* Brand & Voice tabs */
.mk-tabs{display:flex;gap:4px;border-bottom:1px solid var(--mk-border);margin-bottom:20px;flex-wrap:wrap}
.mk-tab{background:transparent;border:none;border-bottom:2px solid transparent;padding:10px 16px;font-size:13px;font-weight:600;color:var(--mk-text-muted);cursor:pointer;transition:all .15s;font-family:inherit}
.mk-tab:hover{color:var(--mk-text)}
.mk-tab.active{color:var(--mk-navy);border-bottom-color:var(--mk-navy)}
.mk-bv-pane{margin-bottom:0}
.mk-kv-list{display:flex;flex-direction:column;gap:10px}
.mk-kv{display:grid;grid-template-columns:200px 1fr;gap:14px;padding:12px 16px;background:var(--mk-bg);border-radius:var(--mk-r-sm);align-items:start}
.mk-kv-key{font-size:12px;font-weight:700;color:var(--mk-text);text-transform:capitalize}
.mk-kv-val{font-size:13px;color:var(--mk-text-muted);line-height:1.55;white-space:pre-wrap;word-break:break-word}
@media(max-width:700px){.mk-kv{grid-template-columns:1fr}}

.mk-swatch-row{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px}
.mk-swatch{width:120px;height:80px;border-radius:var(--mk-r-md);color:#fff;padding:10px;display:flex;flex-direction:column;justify-content:space-between;font-size:11px;font-weight:700;box-shadow:var(--mk-shadow-sm);border:1px solid rgba(16,24,40,0.04)}
.mk-swatch code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px;opacity:0.85}
.mk-swatch-light{color:var(--mk-text);border-color:var(--mk-border)}

/* Strengths grid (Brand & Voice → Our strengths tab) */
.mk-strengths-grid{display:flex;flex-direction:column;gap:18px;margin-top:14px}
.mk-strengths-section-label{font-size:11px;font-weight:700;color:var(--mk-navy);text-transform:uppercase;letter-spacing:0.08em;margin:0 0 10px 2px}
.mk-strengths-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.mk-strength-card{background:linear-gradient(135deg,var(--mk-sky-tint) 0%,var(--bg-card) 70%);border:1px solid var(--mk-navy);border-radius:var(--mk-r-md);padding:14px 16px;box-shadow:var(--mk-shadow-sm)}
[data-theme="dark"] .mk-strength-card{background:linear-gradient(135deg,color-mix(in srgb,var(--sky) 10%,transparent) 0%,var(--bg-card) 70%);border-color:color-mix(in srgb,var(--sky) 32%,transparent)}
.mk-strength-title{font-size:11px;font-weight:700;color:var(--mk-navy);text-transform:uppercase;letter-spacing:0.04em;margin-bottom:6px}
.mk-strength-value{font-size:13px;color:var(--mk-text);line-height:1.5}
.mk-strength-source{font-size:10px;color:var(--mk-text-muted);margin-top:8px;font-style:italic}

/* Competitor Watch */
.mk-cw-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
@media(max-width:1024px){.mk-cw-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.mk-cw-grid{grid-template-columns:1fr}}
.mk-cw-category{display:flex;flex-direction:column;min-height:200px}
.mk-cw-category-grid{flex:1}
.mk-cw-card{background:var(--bg-card);border:1px solid var(--mk-border);border-radius:var(--mk-r-md);padding:18px;box-shadow:var(--mk-shadow-sm);cursor:grab;transition:transform .15s,box-shadow .15s,opacity .15s;user-select:none}
.mk-cw-card:hover{box-shadow:var(--mk-shadow-md);transform:translateY(-2px)}
.mk-cw-card.threat-direct{border-left-color:var(--mk-error)}
.mk-cw-card.threat-adjacent{border-left-color:var(--mk-warn)}
.mk-cw-card.threat-inspiration{border-left-color:var(--mk-navy)}
/* Drag feedback — parallels the Kanban animation so the drop is visible */
.mk-cw-card.cw-dragging{opacity:0.45;cursor:grabbing;transform:scale(0.96) rotate(-1deg);box-shadow:0 12px 28px rgba(16,24,40,0.15)}
.mk-cw-card.cw-other{opacity:0.55}
.mk-cw-category.cw-dragover .mk-cw-category-grid{background:var(--mk-sky-tint);box-shadow:inset 0 0 0 2px var(--mk-sky)}
.mk-cw-category.cw-dragover .mk-cw-category-head{transform:scale(1.02)}
.mk-cw-category-head{transition:transform 0.15s}
@keyframes cwLanded{0%{transform:scale(0.85);box-shadow:0 0 0 6px var(--mk-sky)}60%{transform:scale(1.04);box-shadow:0 0 0 2px var(--mk-sky)}100%{transform:scale(1);box-shadow:var(--mk-shadow-sm)}}
.mk-cw-card.cw-landed{animation:cwLanded 0.6s ease-out}
.mk-cw-name{font-size:15px;font-weight:700;color:var(--mk-text);margin-bottom:6px}
.mk-cw-tags{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.mk-cw-tag{font-size:10px;font-weight:600;padding:3px 8px;border-radius:var(--mk-r-pill);background:var(--mk-bg);color:var(--mk-text-muted)}
.mk-cw-tag-direct{background:var(--red-light);color:var(--red)}
.mk-cw-tag-adjacent{background:var(--amber-light);color:var(--amber)}
.mk-cw-tag-inspiration{background:var(--mk-sky-tint);color:var(--mk-navy)}
.mk-cw-learning{font-size:12px;color:var(--mk-text-muted);line-height:1.5;border-top:1px solid var(--mk-border);padding-top:10px;margin-top:10px}

/* Drawer */
.mk-drawer{position:fixed;inset:0;z-index:1500;display:flex;justify-content:flex-end}
.mk-drawer-shade{position:absolute;inset:0;background:rgba(13,17,23,0.4);backdrop-filter:blur(4px)}
.mk-drawer-panel{position:relative;width:min(560px,100%);height:100%;background:var(--bg-card);box-shadow:var(--mk-shadow-lg);display:flex;flex-direction:column;overflow:hidden;border-left:1px solid var(--mk-border)}
.mk-drawer-header{padding:24px 28px;border-bottom:1px solid var(--mk-border);background:linear-gradient(135deg,var(--mk-sky-tint) 0%,var(--bg-card) 100%);display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.mk-drawer-eyebrow{font-size:10px;font-weight:700;color:var(--mk-navy);text-transform:uppercase;letter-spacing:0.08em;margin-bottom:4px}
.mk-drawer-title{font-size:22px;font-weight:700;color:var(--mk-text)}
.mk-drawer-sub{font-size:12px;color:var(--mk-text-muted);margin-top:4px}
.mk-drawer-body{flex:1;overflow-y:auto;padding:24px 28px}
.mk-drawer-section{margin-bottom:22px}
.mk-drawer-section-title{font-size:11px;font-weight:700;color:var(--mk-text);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:8px}
.mk-drawer-section ul{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}
.mk-drawer-section li{font-size:13px;color:var(--mk-text-muted);line-height:1.55;padding-left:14px;position:relative}
.mk-drawer-section li::before{content:'';position:absolute;left:0;top:9px;width:5px;height:5px;background:var(--mk-sky);border-radius:50%}

/* Newsletter editor extras */
.mk-counter-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.mk-counter{font-size:11px;color:var(--mk-text-muted);font-weight:500}
.mk-counter.mk-over{color:var(--mk-error);font-weight:700}
.mk-checklist{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px;font-size:12px}
.mk-checklist li{display:flex;align-items:center;gap:8px;color:var(--mk-text)}
.mk-check{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;background:var(--mk-bg);border:1px solid var(--mk-border);font-size:11px;font-weight:700;color:var(--mk-text-muted)}
.mk-check.pass{background:#D1FAE5;border-color:#86EFAC;color:#065F46}
.mk-check.fail{background:var(--danger-bg);border-color:#FCA5A5;color:var(--danger-fg)}
.mk-counter.mk-counter-over{color:var(--mk-error);font-weight:700}

/* =========================================================
   Newsletter (Phase 2) — tooltips, modal polish, editor host
   ========================================================= */
.help-tip{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border-radius:50%;background:var(--mk-text-muted);color:#fff;font-size:10px;font-weight:700;cursor:help;margin-left:6px;vertical-align:middle;transition:background .12s;font-family:inherit;letter-spacing:0;text-transform:none;flex-shrink:0}
.help-tip:hover{background:var(--mk-navy)}
/* Floating tooltip — JS-positioned via position:fixed so it escapes any
   overflow:hidden ancestor (modals, drawers, tables) and can flip to stay
   in the viewport. Wired up by floatingTipInit() at boot. */
.float-tip{position:fixed;background:#0D1117;color:#fff;padding:9px 13px;border-radius:6px;font-size:12px;font-weight:400;line-height:1.45;width:240px;max-width:calc(100vw - 24px);box-shadow:0 8px 24px rgba(16,24,40,0.22);z-index:99999;pointer-events:none;opacity:0;transform:translateY(-2px);transition:opacity .15s ease,transform .15s ease;font-family:inherit;letter-spacing:0;text-transform:none;text-align:left;white-space:normal}
.float-tip.is-open{opacity:1;transform:translateY(0)}
.float-tip.is-wide{width:300px}
.float-tip::after{content:"";position:absolute;left:var(--arrow-x,50%);transform:translateX(-50%);border:6px solid transparent}
.float-tip.is-above::after{top:100%;border-top-color:#0D1117}
.float-tip.is-below::after{bottom:100%;border-bottom-color:#0D1117}

/* Modal shell that matches the existing newsletter modal aesthetic
   without inline-style sprawl. Use .nl-modal as the backdrop, .nl-modal-card
   inside for the content container. */
.nl-modal{display:none;position:fixed;inset:0;background:rgba(13,17,23,0.55);backdrop-filter:blur(4px);z-index:2002;padding:20px;overflow-y:auto}
/* overflow:visible so Editor.js popovers, dropdowns, and tooltips can
   escape the card edges. The corners are clipped via border-radius on
   header (top) + footer (bottom) instead of on the card itself. */
.nl-modal-card{max-width:640px;margin:40px auto;background:var(--bg-card);border-radius:16px;overflow:visible;box-shadow:0 24px 64px rgba(13,17,23,0.22);border:1px solid var(--border)}
.nl-modal-card-wide{max-width:880px}
.nl-modal-card>.nl-modal-header{border-radius:16px 16px 0 0}
.nl-modal-card>.nl-modal-footer{border-radius:0 0 16px 16px}
.nl-modal-header{padding:20px 24px;display:flex;justify-content:space-between;align-items:center;background:linear-gradient(135deg,var(--mk-navy) 0%,var(--mk-sky) 100%);color:#fff}
.nl-modal-header-warn{background:linear-gradient(135deg,color-mix(in srgb,var(--danger) 70%,black) 0%,var(--danger) 100%)}
.nl-modal-header h3{font-size:15px;font-weight:700;margin:0;letter-spacing:0.005em}
.nl-modal-eyebrow{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;opacity:0.82;margin-bottom:2px}
.nl-modal-close{background:rgba(255,255,255,0.12);border:none;width:30px;height:30px;border-radius:8px;color:#fff;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s}
.nl-modal-close:hover{background:rgba(255,255,255,0.22)}
.nl-modal-body{padding:24px}
.nl-modal-footer{padding:14px 24px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:8px;background:var(--bg-subtle)}
.nl-modal-section{margin-bottom:18px}
.nl-modal-section:last-child{margin-bottom:0}
.nl-modal-section .mk-label{display:flex;align-items:center}

/* Helper banner used inside modals to surface key info / constraints. */
.nl-info-banner{padding:12px 14px;border-radius:8px;font-size:12px;line-height:1.5;display:flex;gap:10px;align-items:flex-start}
.nl-info-banner-info{background:var(--accent-light);color:var(--mk-navy);border:1px solid #C2DDFF}
.nl-info-banner-warn{background:var(--warn-bg);color:var(--warn-fg);border:1px solid #FCD34D}
.nl-info-banner-icon{flex-shrink:0;font-weight:700;width:18px;height:18px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px}
.nl-info-banner-info .nl-info-banner-icon{background:var(--mk-navy);color:#fff}
.nl-info-banner-warn .nl-info-banner-icon{background:#92400E;color:#fff}

/* Segment rule builder. Each rule is one row with: field / comparator /
   value(s) / remove-x. Stacks gracefully on narrow screens. */
.nl-seg-rules{display:flex;flex-direction:column;gap:8px}
.nl-seg-rule{display:grid;grid-template-columns:minmax(140px,1.4fr) minmax(120px,1fr) minmax(140px,1.4fr) auto;gap:8px;align-items:center;background:var(--bg-card);border:1px solid var(--mk-border);border-radius:10px;padding:8px}
.nl-seg-rule select,.nl-seg-rule input{font-family:inherit;font-size:13px;border:1px solid var(--mk-border);border-radius:6px;padding:7px 10px;background:var(--bg-card);color:var(--mk-text);min-width:0}
.nl-seg-rule select:focus,.nl-seg-rule input:focus{border-color:var(--mk-sky);outline:none;box-shadow:0 0 0 2px var(--mk-sky-tint)}
.nl-seg-rule-remove{background:transparent;border:0;color:var(--mk-text-muted);cursor:pointer;font-size:18px;line-height:1;padding:6px 8px;border-radius:6px;transition:background .12s,color .12s}
.nl-seg-rule-remove:hover{background:var(--danger-bg);color:var(--danger)}
.nl-seg-rule-empty{color:var(--mk-text-muted);font-size:13px;font-style:italic;padding:14px;text-align:center;background:var(--bg-card);border:1px dashed var(--mk-border);border-radius:10px}
.nl-seg-preview-card{margin-top:18px;background:linear-gradient(135deg,#EEF5FD,#F8FBFF);border:1px solid #C2DDFF;border-radius:12px;padding:16px 18px}
.nl-seg-preview-count{display:flex;align-items:baseline;gap:8px}
.nl-seg-preview-num{font-size:28px;font-weight:700;color:var(--mk-navy);letter-spacing:-0.01em;line-height:1}
.nl-seg-preview-label{font-size:13px;color:var(--mk-text-muted);font-weight:500}
.nl-seg-preview-sample{margin-top:10px;font-size:12px;color:var(--mk-text-muted);line-height:1.5}
.nl-seg-preview-sample b{color:var(--mk-text);font-weight:600}
/* Newsletter Agent — fixed-position chat drawer on the right edge.
   Higher z-index than the campaign-edit modal so it floats above when
   both are open. Slides in from the right with a soft shade behind it. */
.nl-agent-drawer{position:fixed;inset:0;z-index:2050;display:flex;justify-content:flex-end;pointer-events:none}
.nl-agent-drawer-shade{position:absolute;inset:0;background:rgba(13,17,23,0.18);pointer-events:auto;animation:nl-agent-fade-in .18s ease-out}
.nl-agent-drawer-panel{position:relative;width:min(480px,100vw);height:100vh;background:var(--bg-card);display:flex;flex-direction:column;box-shadow:-12px 0 40px rgba(13,17,23,0.18);pointer-events:auto;animation:nl-agent-slide-in .22s cubic-bezier(.2,.7,.2,1);border-left:1px solid var(--mk-border)}
@keyframes nl-agent-fade-in{from{opacity:0}to{opacity:1}}
@keyframes nl-agent-slide-in{from{transform:translateX(100%)}to{transform:translateX(0)}}
.nl-agent-head{display:flex;justify-content:space-between;align-items:center;padding:18px 20px;border-bottom:1px solid var(--mk-border);background:linear-gradient(135deg,var(--sky),var(--primary));color:#fff}
.nl-agent-head .nl-modal-close{color:rgba(255,255,255,0.9)}
.nl-agent-head .nl-modal-close:hover{color:#fff}
.nl-agent-avatar{width:36px;height:36px;border-radius:8px;background:rgba(255,255,255,0.18);color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;letter-spacing:0.04em}
.nl-agent-name{font-size:15px;font-weight:700;color:#fff;letter-spacing:-0.005em;line-height:1.2}
.nl-agent-sub{font-size:11px;color:rgba(255,255,255,0.85);margin-top:2px}
.nl-agent-quick{display:flex;flex-wrap:wrap;gap:6px;padding:12px 16px;border-bottom:1px solid var(--mk-border);background:var(--bg-subtle)}
.nl-agent-quick button{padding:6px 12px;border:1px solid var(--mk-border);border-radius:999px;background:var(--bg-card);color:var(--mk-text);font-size:11px;font-weight:600;cursor:pointer;transition:background .12s,border-color .12s}
.nl-agent-quick button:hover{background:#EEF5FD;border-color:var(--mk-sky);color:var(--mk-navy)}
.nl-agent-messages{flex:1;overflow-y:auto;padding:16px 18px;display:flex;flex-direction:column;gap:12px;background:var(--bg-subtle)}
.nl-agent-msg{max-width:90%;padding:10px 14px;border-radius:14px;font-size:13.5px;line-height:1.55;white-space:pre-wrap;word-wrap:break-word}
.nl-agent-msg-user{align-self:flex-end;background:var(--mk-navy);color:#fff;border-bottom-right-radius:4px}
.nl-agent-msg-assistant{align-self:flex-start;background:var(--bg-card);color:var(--mk-text);border:1px solid var(--mk-border);border-bottom-left-radius:4px;box-shadow:0 1px 2px rgba(13,17,23,0.04)}
.nl-agent-msg-system{align-self:center;background:transparent;color:var(--mk-text-muted);font-size:12px;font-style:italic;text-align:center;max-width:100%;padding:6px 14px}
.nl-agent-msg-thinking{align-self:flex-start;background:var(--bg-card);border:1px solid var(--mk-border);color:var(--mk-text-muted);font-size:12px;font-style:italic;border-bottom-left-radius:4px}
.nl-agent-input-row{display:flex;gap:8px;padding:12px 16px;border-top:1px solid var(--mk-border);background:var(--bg-card);align-items:flex-end}
.nl-agent-input-row textarea{flex:1;border:1.5px solid var(--mk-border);border-radius:8px;padding:9px 12px;font-size:13px;line-height:1.5;font-family:inherit;color:var(--mk-text);resize:none;min-height:40px;max-height:120px;transition:border-color .12s}
.nl-agent-input-row textarea:focus{border-color:var(--mk-sky);outline:none;box-shadow:0 0 0 2px var(--mk-sky-tint)}
.nl-agent-msg-assistant .nl-agent-apply{display:inline-block;margin-top:8px;padding:5px 12px;background:var(--mk-navy);color:#fff;border:0;border-radius:6px;font-size:11px;font-weight:600;cursor:pointer;transition:background .12s}
.nl-agent-msg-assistant .nl-agent-apply:hover{background:#003E7A}
/* Applied-edit chips appear under an assistant bubble so the user sees
   exactly what landed in the editor. Subtle, single-line list. */
.nl-agent-applied{margin-top:8px;display:flex;flex-wrap:wrap;gap:5px}
.nl-agent-applied-chip{font-size:10px;font-weight:600;color:#0E7C3A;background:var(--success-bg);border:1px solid #BBF7D0;padding:2px 8px;border-radius:999px;letter-spacing:0.005em}

/* Auto-draft variations — angle picker grid + result cards */
.nl-variations-angles{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}
.nl-variations-angle{border:1.5px solid var(--mk-border);border-radius:10px;padding:14px 16px;cursor:pointer;background:var(--bg-card);transition:border-color .12s,background .12s,box-shadow .12s;display:flex;flex-direction:column;gap:6px;position:relative}
.nl-variations-angle:hover{border-color:var(--mk-sky);box-shadow:var(--mk-shadow-sm)}
.nl-variations-angle.is-selected{border-color:var(--mk-navy);background:#EEF5FD}
.nl-variations-angle-name{font-weight:700;font-size:14px;color:var(--mk-text);letter-spacing:-0.005em}
.nl-variations-angle-desc{font-size:12px;line-height:1.45;color:var(--mk-text-muted)}
.nl-variations-angle .check{position:absolute;top:10px;right:10px;width:18px;height:18px;border-radius:50%;border:1.5px solid var(--mk-border);background:var(--bg-card);display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;color:#fff}
.nl-variations-angle.is-selected .check{background:var(--mk-navy);border-color:var(--mk-navy)}
.nl-variations-angle.is-selected .check::after{content:"\2713"}
.nl-variations-result{border:1px solid var(--mk-border);border-radius:12px;padding:16px 18px;margin-top:10px;background:var(--bg-card);display:flex;flex-direction:column;gap:10px}
.nl-variations-result-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.nl-variations-result-angle{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;color:var(--mk-navy);background:#EEF5FD;padding:3px 8px;border-radius:4px;display:inline-block}
.nl-variations-result-subject{font-size:16px;font-weight:700;color:var(--mk-text);margin-top:6px;line-height:1.3}
.nl-variations-result-preview{font-size:13px;color:var(--mk-text-muted);line-height:1.5}
.nl-variations-result-actions{display:flex;gap:8px;margin-top:6px}

/* Media picker — grid tile with thumbnail + filename overlay */
.nl-media-tile{position:relative;border:1px solid var(--mk-border);border-radius:10px;overflow:hidden;cursor:pointer;background:var(--bg-subtle);aspect-ratio:1;transition:transform .12s,border-color .12s,box-shadow .12s}
.nl-media-tile:hover{border-color:var(--mk-sky);transform:translateY(-1px);box-shadow:var(--mk-shadow-md)}
.nl-media-tile-img{display:block;width:100%;height:100%;object-fit:cover;background:var(--bg-subtle)}
.nl-media-tile-label{position:absolute;left:0;right:0;bottom:0;padding:8px 10px;background:linear-gradient(to top,rgba(13,17,23,0.78),rgba(13,17,23,0));color:#fff;font-size:11px;font-weight:500;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:0.005em}
.nl-media-tile-vid{position:absolute;top:8px;right:8px;background:color-mix(in srgb,var(--primary) 92%,transparent);color:#fff;font-size:10px;font-weight:700;padding:3px 7px;border-radius:4px;text-transform:uppercase;letter-spacing:0.05em}

/* "Browse library" button row inside Editor.js Image/Video block */
.nl-media-pickbar{display:flex;gap:6px;align-items:center;margin-top:8px}
.nl-media-pickbar button{padding:7px 14px;border:1px solid var(--mk-border);border-radius:6px;background:var(--bg-card);color:var(--mk-navy);font-size:12px;font-weight:600;cursor:pointer;transition:background .12s,border-color .12s}
.nl-media-pickbar button:hover{background:#EEF5FD;border-color:var(--mk-sky)}
.nl-media-pickbar .nl-media-pickbar-hint{font-size:11px;color:var(--mk-text-muted)}

/* Segments list (saved segments grid) */
.nl-seg-card{display:flex;justify-content:space-between;align-items:center;background:var(--bg-card);border:1px solid var(--mk-border);border-radius:10px;padding:14px 16px;margin-bottom:8px;cursor:pointer;transition:border-color .12s,box-shadow .12s}
.nl-seg-card:hover{border-color:var(--mk-sky);box-shadow:var(--mk-shadow-sm)}
.nl-seg-card-name{font-weight:600;color:var(--mk-text);font-size:14px}
.nl-seg-card-meta{font-size:12px;color:var(--mk-text-muted);margin-top:2px}
.nl-seg-card-count{font-size:18px;font-weight:700;color:var(--mk-navy);min-width:60px;text-align:right}

/* Editor.js host — gives the editor a card frame matching mk-input. */
.nl-editorjs-host{border:1.5px solid var(--mk-border);border-radius:var(--mk-r-sm);background:var(--bg-card);padding:12px 16px;min-height:280px;font-family:'DM Sans','Inter',system-ui,sans-serif;font-size:14px;color:var(--mk-text);transition:border-color .15s;position:relative}
/* Editor.js floating menus — slash command popover, conversion toolbar,
   inline toolbar, plus-button menu. They render IN-PLACE inside the
   editor host (we don't portal — that breaks Editor.js's internal size
   calc). Visibility comes from: overflow:visible on every ancestor +
   !important z-index so they always layer above modal content. */
.ce-popover,.ce-conversion-toolbar,.ce-inline-toolbar,.ce-toolbar__plus,.ce-toolbar__settings-btn,.ce-toolbox{z-index:99998!important}
.ce-popover,.ce-toolbox{box-shadow:0 12px 32px rgba(13,17,23,0.18)!important;border-radius:10px!important;background:var(--bg-card)!important;border:1px solid var(--mk-border)}
.ce-popover{max-height:min(400px,60vh)!important;overflow-y:auto}
.ce-popover__items{max-height:none!important}
/* Every ancestor of the editor host must allow overflow so the popover
   can extend beyond the host without clipping. The modal-card already
   has overflow:visible; lock down the body and editor host too. */
.nl-modal-body{overflow:visible}
.nl-editorjs-host{overflow:visible!important}
.nl-editorjs-host .codex-editor,.nl-editorjs-host .ce-block,.nl-editorjs-host .ce-toolbar,.nl-editorjs-host .ce-toolbar__content,.nl-editorjs-host .ce-toolbar__actions{overflow:visible!important}
/* No custom drop indicator — the editorjs-drag-drop plugin sometimes
   leaves drop-target classes attached after init and any pseudo-element
   we hang on them paints a stray line on mount. Drop still works via
   the plugin's silent position swap; visual feedback is nice-to-have. */
.ce-block--drop-target,.ce-block--drop-target-top,.ce-block--drop-target-bottom{outline:none!important;border:0!important}
.ce-block--drop-target::before,.ce-block--drop-target::after,
.ce-block--drop-target-top::before,.ce-block--drop-target-top::after,
.ce-block--drop-target-bottom::before,.ce-block--drop-target-bottom::after{display:none!important;content:none!important}
.nl-editorjs-host:focus-within{border-color:var(--mk-sky);box-shadow:0 0 0 3px var(--mk-sky-tint)}
.nl-editorjs-host .ce-block__content,.nl-editorjs-host .ce-toolbar__content{max-width:100%}
.nl-editorjs-host h1.ce-header{font-size:22px;font-weight:700;color:var(--mk-text);line-height:1.2}
.nl-editorjs-host h2.ce-header{font-size:18px;font-weight:700;color:var(--mk-text);line-height:1.25}
.nl-editorjs-host h3.ce-header{font-size:15px;font-weight:600;color:var(--mk-text);line-height:1.3}
.nl-editorjs-host .ce-paragraph{font-size:14px;line-height:1.55;color:var(--mk-text)}

/* Inline error / loading states for the table-based newsletter views. */
.nl-tbl-msg{padding:32px;text-align:center;color:var(--mk-text-muted);font-size:13px}
.nl-tbl-msg-error{color:var(--danger-fg)}
.nl-tbl-msg-error code{background:var(--danger-bg);color:var(--danger-fg);padding:2px 6px;border-radius:4px;font-size:11px}

/* Kanban card internals */
.mk-kanban-empty{font-size:11px;color:var(--mk-text-muted);text-align:center;padding:24px 8px;border:1px dashed var(--mk-border);border-radius:var(--mk-r-sm);background:rgba(255,255,255,0.5)}
.mk-kanban-col-body{display:flex;flex-direction:column;gap:6px}
.mk-kc-platform{font-size:11px;font-weight:700;color:var(--mk-navy);text-transform:uppercase;letter-spacing:0.05em;margin-bottom:4px}
.mk-kc-title{font-size:12px;font-weight:600;color:var(--mk-text);line-height:1.35;margin-bottom:6px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.mk-kc-meta{font-size:10px;color:var(--mk-text-muted);line-height:1.3}
.mk-kanban-card.mk-phase-idea{border-left:3px solid var(--text-muted)}
.mk-kanban-card.mk-phase-brief{border-left:3px solid #6366F1}
.mk-kanban-card.mk-phase-creating{border-left:3px solid var(--mk-sky)}
.mk-kanban-card.mk-phase-review{border-left:3px solid var(--mk-warn)}
.mk-kanban-card.mk-phase-approved{border-left:3px solid #10B981}
.mk-kanban-card.mk-phase-posted{border-left:3px solid var(--mk-navy)}
.mk-kanban-card.mk-phase-analyzed{border-left:3px solid #6B7280}
.mk-kanban-card{position:relative}
.mk-kc-delete{position:absolute;top:6px;right:6px;width:22px;height:22px;border:none;background:rgba(0,0,0,0.04);color:var(--mk-text-muted);border-radius:50%;cursor:pointer;font-size:16px;line-height:1;display:flex;align-items:center;justify-content:center;opacity:0;transition:all .15s}
.mk-kanban-card:hover .mk-kc-delete{opacity:1}
.mk-kc-delete:hover{background:var(--danger-bg);color:#dc2626}
.mk-kc-generate{display:block;width:100%;padding:8px 12px;margin:0 0 10px;background:var(--mk-navy);color:#fff;border:none;border-radius:var(--mk-r-sm);font-size:11px;font-weight:600;cursor:pointer;letter-spacing:0.02em;transition:all .15s}
.mk-kc-generate:hover{background:#003a78;transform:translateY(-1px);box-shadow:var(--mk-shadow-md)}

/* Brief rendered preview inside content modal */
.mk-brief-rendered{background:#fafafa;border:1px solid var(--mk-border);border-radius:var(--mk-r-sm);padding:14px 16px;margin-bottom:8px;max-height:340px;overflow-y:auto;font-size:13px;line-height:1.5;color:var(--mk-text)}
.mk-brief-rendered h3{font-size:12px;font-weight:700;color:var(--mk-navy);text-transform:uppercase;letter-spacing:0.05em;margin:14px 0 6px;padding-bottom:4px;border-bottom:1px solid var(--mk-border)}
.mk-brief-rendered h3:first-child{margin-top:0}
.mk-brief-rendered strong{color:var(--mk-navy)}
.mk-brief-rendered p{margin:6px 0}
.mk-brief-rendered ul{margin:6px 0;padding-left:20px}
.mk-brief-rendered em{color:var(--mk-text-muted);font-style:normal;background:var(--mk-sky-tint);padding:1px 6px;border-radius:4px;font-size:11px}

/* Idea queue cards */
.mk-idea-tags{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}
.mk-tag{font-size:10px;font-weight:600;padding:3px 9px;border-radius:var(--mk-r-pill);background:var(--mk-bg);color:var(--mk-text-muted);border:1px solid var(--mk-border);text-transform:capitalize}
.mk-tag-pillar{background:var(--mk-sky-tint);color:var(--mk-navy);border-color:transparent}
.mk-tag-muted{opacity:0.75}
.mk-idea-comp{font-size:11px;color:var(--mk-navy);background:var(--mk-sky-tint);padding:6px 10px;border-radius:var(--mk-r-pill);display:inline-block;margin:6px 0 12px}
.mk-idea-card.mk-idea-promoted{opacity:0.65}
.mk-idea-card.mk-idea-archived{opacity:0.4;text-decoration:line-through}

/* Pills (extends mk-pill base from earlier block) */
.mk-pill-primary{background:var(--mk-navy);color:#fff;border-color:var(--mk-navy)}
.mk-pill-primary:hover{background:#003E7A}
.mk-pill-tag{background:var(--mk-sky-tint);color:var(--mk-navy);border-color:transparent;cursor:default}
.mk-pill-success{background:#D1FAE5;color:#065F46;border-color:transparent;cursor:default}
.mk-pill-danger{background:transparent;color:var(--mk-error);border-color:transparent;padding:4px 8px}
.mk-pill-danger:hover{background:var(--danger-bg)}

/* Competitor card extras */
.mk-cw-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:6px}
.mk-cw-type{font-size:11px;color:var(--mk-text-muted);text-transform:capitalize;margin-bottom:10px}
.mk-cw-row{font-size:12px;color:var(--mk-text);line-height:1.5;margin-bottom:6px}
.mk-cw-label{font-size:10px;font-weight:700;color:var(--mk-text-muted);text-transform:uppercase;letter-spacing:0.05em;margin-right:4px}

/* Drawer extras */
.mk-drawer-label{font-size:11px;font-weight:700;color:var(--mk-text);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:8px}
.mk-drawer-pre{background:var(--mk-bg);border:1px solid var(--mk-border);border-radius:var(--mk-r-sm);padding:10px 12px;font-size:11px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--mk-text);overflow-x:auto;line-height:1.5}
.mk-drawer-text{font-size:13px;color:var(--mk-text-muted);line-height:1.55}
.mk-drawer-foot{font-size:11px;color:var(--mk-text-muted);padding-top:14px;border-top:1px dashed var(--mk-border)}

/* Honesty ledger inside content modal */
.mk-sources-list{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}
.mk-source-row{background:var(--mk-bg);border:1px solid var(--mk-border);border-radius:var(--mk-r-sm);padding:8px 10px}
.mk-source-claim{font-size:11px;font-weight:600;color:var(--mk-text);line-height:1.4;margin-bottom:4px}
.mk-source-meta{font-size:10px;color:var(--mk-text-muted);display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.mk-source-meta a{color:var(--mk-navy)}

@media(max-width:768px){
  .mk-hero{padding:20px}
  .mk-hero-title{font-size:20px}
  .mk-stat-strip{grid-template-columns:repeat(2,1fr)}
  .mk-kanban-board{grid-template-columns:repeat(3,minmax(0,1fr))}
  .mk-cw-grid{grid-template-columns:1fr}
}

/* ============================================================
   TEAM V2 — Operations Overview
   Editorial canvas with glass surfaces over the gradient page bg
   ============================================================ */

/* Glass primitive — used on hero, KPIs, rail, pulse card */
.tv2-glass{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--bg-glass-border);
  box-shadow:0 4px 24px rgba(16,24,40,0.06),0 1px 0 rgba(255,255,255,0.6) inset;
}

/* .tv2-hero* removed 2026-05-14 — every tab now uses .uo-pagehead instead.
   See .uo-pagehead at the BD Pipeline V2 section for the canonical pattern. */

/* === Projects (Sprints / Folders / Backlog) === */
.proj-shell{display:flex;flex-direction:column;gap:14px;padding:0 4px;height:calc(100vh - 70px);min-height:720px}
.proj-badge{display:inline-block;font-size:11px;font-weight:600;padding:5px 10px;border-radius:999px;letter-spacing:0.01em}
.proj-badge-muted{background:color-mix(in srgb,var(--primary) 7%,transparent);color:var(--primary);border:1px solid color-mix(in srgb,var(--primary) 18%,transparent)}
.proj-pill{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:999px;font-size:11px;font-weight:600;line-height:1.3;white-space:nowrap}
.proj-pill-mini{padding:2px 7px;font-size:10px}
.proj-pill-completed{background:var(--green-light);color:var(--green-dark)}
.proj-pill-active{background:color-mix(in srgb,var(--primary) 12%,transparent);color:var(--primary)}
.proj-pill-planning{background:var(--amber-light);color:var(--amber)}
.proj-pill-todo{background:var(--bg-subtle);color:var(--text-secondary)}
.proj-pill-progress{background:var(--amber-light);color:var(--amber)}
.proj-pill-blocked{background:var(--red-light);color:var(--red)}
.proj-pill-cancelled{background:var(--bg-subtle);color:var(--text-muted)}
.proj-pill-pushed{background:var(--purple-light);color:var(--purple)}
.proj-pill-priority-critical{background:var(--red-light);color:var(--red)}
.proj-pill-priority-high{background:color-mix(in srgb,var(--amber) 16%,transparent);color:var(--amber)}
.proj-pill-priority-medium{background:var(--bg-subtle);color:var(--text-secondary)}
.proj-pill-priority-low{background:var(--bg-subtle);color:var(--text-muted)}
.proj-tabs{display:flex;gap:2px;padding:0 4px;border-bottom:1px solid var(--border-light);margin-bottom:-1px}
.proj-tab{background:transparent;border:0;padding:10px 16px;font-size:13px;font-weight:600;color:var(--text-muted);cursor:pointer;font-family:inherit;border-bottom:2px solid transparent;transition:color 0.12s,border-color 0.12s}
.proj-tab:hover{color:var(--text)}
.proj-tab.active{color:var(--primary);border-bottom-color:var(--primary)}
.proj-tab-badge{display:inline-block;min-width:18px;padding:0 6px;margin-left:6px;background:var(--amber-light);color:var(--amber);border-radius:10px;font-size:10px;font-weight:700;line-height:18px;text-align:center;vertical-align:1px}
.proj-tab-badge:empty{display:none}

/* Triage tab — punch-list of issues missing description / points / assignee. */
.proj-triage-head{display:grid;grid-template-columns:90px 1fr 100px 220px 90px 130px;gap:12px;padding:10px 22px;font-size:10px;font-weight:700;text-transform:uppercase;color:var(--text-muted);letter-spacing:0.06em;background:var(--bg-subtle);border-bottom:1px solid var(--border-light);position:sticky;top:0;z-index:1}
.proj-triage-row{display:grid;grid-template-columns:90px 1fr 100px 220px 90px 130px;gap:12px;padding:11px 22px;border-bottom:1px solid var(--border-light);font-size:13px;cursor:pointer;align-items:center;transition:background 0.08s}
.proj-triage-row:hover{background:var(--bg-subtle)}
.proj-gap-chip{display:inline-block;padding:2px 7px;font-size:10.5px;font-weight:600;border-radius:8px;letter-spacing:0.01em}
.proj-gap-no_description{background:var(--warn-bg);color:var(--warn-fg)}
.proj-gap-no_points{background:var(--info-bg);color:var(--info-fg)}
.proj-gap-no_assignee{background:var(--danger-bg);color:var(--danger-fg)}
.proj-gap-in_triage{background:var(--amber-light);color:var(--amber)}

/* Reports tab — velocity bars, burndown, throughput tiles, attachments. */
.proj-reports-grid{flex:1;display:grid;grid-template-columns:repeat(auto-fit,minmax(360px,1fr));gap:16px;padding:14px 4px 32px;overflow-y:auto;align-content:start}
.proj-report-card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:18px}
.proj-report-head{display:flex;align-items:baseline;gap:10px;margin-bottom:14px}
.proj-report-head h3{margin:0;font-size:14px;font-weight:600;color:var(--text)}
.proj-chart{min-height:240px;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-end;gap:10px}
.proj-bars{display:flex;align-items:flex-end;gap:10px;height:220px;width:100%;padding:0 8px 38px;border-bottom:1px solid var(--border-light);position:relative}
.proj-bar{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;min-width:0;gap:4px;position:relative}
.proj-bar-val{font-size:11px;font-weight:700;color:var(--text);min-height:14px}
.proj-bar-fill{width:78%;max-width:42px;background:linear-gradient(180deg,var(--primary) 0%,var(--primary-dark) 100%);border-radius:6px 6px 0 0;min-height:0;transition:height 0.32s cubic-bezier(0.2,0.9,0.3,1)}
.proj-bar:hover .proj-bar-fill{filter:brightness(1.1)}
/* Rotated labels: anchored to the bar's bottom-center, tilted -32° so each
   label fans out into its own slanted lane. Prevents overlap when many
   sprints share the chart width. */
.proj-bar-lbl{position:absolute;bottom:-30px;left:50%;font-size:10px;color:var(--text-muted);font-weight:500;letter-spacing:0.02em;white-space:nowrap;transform:translateX(-50%) rotate(-32deg);transform-origin:left center;pointer-events:none}
.proj-bar:hover .proj-bar-lbl{color:var(--text);font-weight:600}
.proj-velocity-toggle{display:inline-flex;gap:0;align-self:flex-end;border:1px solid var(--border);border-radius:8px;overflow:hidden;background:var(--bg-subtle);font-size:11px;margin-bottom:6px}
.proj-velocity-toggle button{background:transparent;border:0;padding:5px 12px;font-size:11px;font-weight:600;color:var(--text-muted);cursor:pointer;font-family:inherit;transition:background 0.12s,color 0.12s}
.proj-velocity-toggle button:hover{color:var(--text)}
.proj-velocity-toggle button.active{background:var(--primary);color:#fff}
.proj-velocity-foot{font-size:11px;color:var(--text-muted);margin-top:4px}
.proj-throughput-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.proj-throughput-tile{background:var(--bg-subtle);border-radius:8px;padding:14px}
.proj-throughput-window{font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:0.05em;color:var(--text-muted)}
.proj-throughput-num{font-size:28px;font-weight:600;color:var(--text);line-height:1.1;margin:6px 0 2px}
@media (max-width: 700px){
  .proj-triage-head,.proj-triage-row{grid-template-columns:90px 1fr 100px}
  .proj-throughput-grid{grid-template-columns:1fr}
}
/* Sprints tab: sidebar + main grid (original Phase 2 layout, restored) */
.proj-body{flex:1;display:grid;grid-template-columns:280px 1fr;gap:16px;min-height:0}

/* Backlog tab: flat list */
.proj-backlog-flat{flex:1;overflow-y:auto;background:var(--card);border:1px solid var(--border);border-radius:12px;padding:0}

/* JIRA-style floating accordion list (Phase 3.7) — only used by Folders */
.proj-listview{flex:1;display:flex;flex-direction:column;min-height:0}
.proj-toolbar{display:flex;align-items:center;gap:10px;padding:14px 4px 10px;flex-wrap:wrap}
.proj-toolbar input{flex:1;min-width:240px;max-width:360px;padding:8px 12px;border:1px solid var(--border);border-radius:8px;font-size:12.5px;outline:none;font-family:inherit;background:var(--card);color:var(--text)}
.proj-toolbar input:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent)}

/* Board-specific toolbar bits.
   - Scope dropdown: collapsed width when closed, expands while focused/open.
     Long titles get truncated with ellipsis. Width grows in steps so it's not
     comically narrow OR the giant 360px box it used to be.
   - Filter icon-button: matches the toolbar height; active dot when filters set. */
.proj-board-toolbar .proj-board-scope{
  width:200px;max-width:220px;padding:8px 28px 8px 12px;
  text-overflow:ellipsis;white-space:nowrap;overflow:hidden;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%237a7f87' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 10px center;
  -webkit-appearance:none;appearance:none;
  transition:width 0.18s ease, max-width 0.18s ease;
}
.proj-board-toolbar .proj-board-scope:focus{width:360px;max-width:60vw;border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent)}
.proj-board-toolbar .proj-board-scope option{white-space:normal} /* allow wrap inside the OS popup */

.proj-icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border:1px solid var(--border);background:var(--card);color:var(--text-secondary);border-radius:8px;cursor:pointer;flex-shrink:0;transition:background 0.12s,border-color 0.12s,color 0.12s}
.proj-icon-btn:hover{background:var(--bg-hover);color:var(--text);border-color:var(--border-strong, var(--border))}
.proj-icon-btn.active{color:var(--primary);border-color:var(--primary);background:color-mix(in srgb,var(--primary) 6%,transparent)}
.proj-icon-btn-dot{position:absolute;top:5px;right:5px;width:7px;height:7px;border-radius:50%;background:var(--primary);box-shadow:0 0 0 2px var(--card)}
.proj-chip-group{display:flex;gap:5px;flex-wrap:wrap}
.proj-accordion-list{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:10px;padding:4px 4px 32px}

/* One accordion (folder/epic). Manual <div>/click — we deliberately don't
   use <details>/<summary> because Chrome breaks summary rendering when
   child content uses display:flex. Open/close state is a CSS class.
   flex-shrink:0 prevents the parent flex container from squeezing every
   accordion to share its height (without it, 30 epics flatten to ~25px each). */
.proj-acc{flex-shrink:0;background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden;box-shadow:0 1px 2px rgba(13,17,23,0.04);transition:box-shadow 0.15s,border-color 0.15s}
.proj-acc:hover{box-shadow:0 4px 14px rgba(13,17,23,0.06);border-color:var(--border-light)}
.proj-acc-summary{display:flex;align-items:center;gap:14px;padding:16px 20px;cursor:pointer;user-select:none;font-size:13.5px;background:var(--card)}
.proj-acc-summary:hover{background:var(--bg-subtle)}
.proj-acc-arrow{display:inline-block;width:0;height:0;border-left:6px solid var(--text-muted);border-top:5px solid transparent;border-bottom:5px solid transparent;transition:transform 0.15s;flex-shrink:0}
.proj-acc.open .proj-acc-arrow{transform:rotate(90deg)}
.proj-acc-body{display:none;border-top:1px solid var(--border-light);background:var(--card)}
.proj-acc.open .proj-acc-body{display:block}
.proj-acc-name{font-weight:700;color:var(--text);font-size:14px;letter-spacing:-0.005em}
.proj-acc-dates{color:var(--text-muted);font-size:12px;font-weight:500}
.proj-acc-meta{color:var(--text-muted);font-size:12px;font-weight:500}
.proj-acc-status-counts{display:inline-flex;align-items:center;gap:2px;margin-left:auto}
.proj-acc-count-pill{display:inline-flex;align-items:center;justify-content:center;min-width:26px;padding:2px 6px;border-radius:6px;font-size:11px;font-weight:700;text-align:center}
.proj-acc-count-todo{background:var(--bg-subtle);color:var(--text-secondary)}
.proj-acc-count-progress{background:var(--info-bg);color:var(--info-fg)}
.proj-acc-count-done{background:var(--success-bg);color:var(--success-fg)}
.proj-acc-action{padding:6px 14px;font-size:12.5px;font-weight:600;border-radius:8px;border:1px solid var(--border);background:var(--card);color:var(--text);cursor:pointer;font-family:inherit;transition:background 0.12s,border-color 0.12s,color 0.12s}
.proj-acc-action:hover{border-color:var(--primary);color:var(--primary);background:color-mix(in srgb,var(--primary) 4%,transparent)}
.proj-acc-action:disabled{opacity:0.55;cursor:not-allowed}
.proj-acc-empty{padding:24px;color:var(--text-muted);font-size:12.5px;text-align:center;font-style:italic}
.proj-acc-goal{padding:0 18px 12px;font-size:12.5px;color:var(--text-secondary);font-style:italic;line-height:1.45}

/* Issue row tweaks for accordion bodies (slimmer, no outer table padding) */
.proj-acc-body .proj-issue-row{padding-left:46px;padding-right:18px}
.proj-acc-body .proj-issue-list-head{padding-left:46px;padding-right:18px}

/* Subtle "Backlog" accordion variant: dashed top emphasis */
.proj-acc-backlog{border-style:dashed;border-color:color-mix(in srgb,var(--primary) 30%,transparent);background:color-mix(in srgb,var(--primary) 2%,transparent)}

/* === Board (kanban) view === */
.proj-board{flex:1;display:flex;gap:12px;overflow-x:auto;overflow-y:hidden;padding:4px 4px 24px;min-height:0}
.proj-board-col{flex:0 0 280px;display:flex;flex-direction:column;background:var(--bg-subtle);border:1px solid var(--border-light);border-radius:10px;min-height:0;max-height:100%}
.proj-board-col.dragover{background:color-mix(in srgb,var(--primary) 6%,transparent);border-color:var(--primary);border-style:dashed}
.proj-board-col-head{padding:10px 14px;border-bottom:1px solid var(--border-light);display:flex;align-items:center;gap:8px;font-size:11.5px;font-weight:700;text-transform:uppercase;color:var(--text-secondary);letter-spacing:0.06em}
.proj-board-col-count{margin-left:auto;background:var(--card);color:var(--text-muted);padding:1px 7px;border-radius:999px;font-size:11px;font-weight:700}
.proj-board-col-body{flex:1;overflow-y:auto;padding:8px;display:flex;flex-direction:column;gap:8px}
.proj-board-card{background:var(--card);border:1px solid var(--border);border-radius:8px;padding:10px 12px;cursor:grab;font-size:12.5px;line-height:1.4;transition:box-shadow 0.12s,border-color 0.12s,transform 0.06s;display:flex;flex-direction:column;gap:6px}
.proj-board-card:hover{border-color:var(--primary);box-shadow:0 2px 8px color-mix(in srgb,var(--primary) 8%,transparent)}
.proj-board-card:active{cursor:grabbing}
.proj-board-card.dragging{opacity:0.55;transform:scale(0.98)}
.proj-board-card-key{font-family:'JetBrains Mono','SF Mono',Menlo,monospace;font-size:10.5px;color:var(--primary);font-weight:600}
.proj-board-card-title{font-weight:500;color:var(--text);overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical}
.proj-board-card-foot{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:10.5px;color:var(--text-muted);margin-top:2px}
.proj-board-empty-col{color:var(--text-muted);font-size:11.5px;font-style:italic;text-align:center;padding:16px 8px}

/* Sprint completion modal */
.proj-complete-modal-card{max-width:680px}
.proj-complete-row{display:grid;grid-template-columns:90px 1fr 200px;gap:12px;align-items:center;padding:10px 14px;border-bottom:1px solid var(--border-light);font-size:12.5px}
.proj-complete-row:last-child{border-bottom:0}
.proj-complete-row .proj-complete-actions{display:flex;gap:4px;justify-content:flex-end}
.proj-complete-row select{font-family:inherit;font-size:11.5px;padding:5px 8px;border:1px solid var(--border);border-radius:6px;background:var(--card);color:var(--text)}
.proj-sidebar{background:var(--card);border:1px solid var(--border);border-radius:12px;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.proj-sidebar-head{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--border-light);font-size:11px;font-weight:700;text-transform:uppercase;color:var(--text-muted);letter-spacing:0.06em}
.proj-sidebar-chips{display:flex;gap:6px;padding:10px 12px 0;flex-wrap:wrap}
.proj-chip{font-size:11px;font-weight:600;padding:5px 10px;border-radius:999px;border:1px solid var(--border);background:var(--card);color:var(--text-secondary);cursor:pointer;font-family:inherit;letter-spacing:0.005em;transition:background 0.12s,color 0.12s,border-color 0.12s}
.proj-chip:hover{background:var(--bg-hover);color:var(--text)}
.proj-chip.active{background:var(--primary);color:#fff;border-color:var(--primary)}
.proj-sidebar-search{padding:10px 12px;border-bottom:1px solid var(--border-light)}
.proj-sidebar-search input{width:100%;padding:7px 10px;font-size:12px;border:1px solid var(--border);border-radius:8px;outline:none;background:var(--bg-subtle);color:var(--text);font-family:inherit}
.proj-sidebar-search input:focus{border-color:var(--primary);background:var(--card);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent)}
.proj-sidebar-list{flex:1;overflow-y:auto;padding:6px 8px}
.proj-sprint-row{display:flex;flex-direction:column;gap:4px;padding:9px 10px;border-radius:8px;cursor:pointer;font-size:12.5px;transition:background 0.12s}
.proj-sprint-row:hover{background:var(--bg-hover)}
.proj-sprint-row.active{background:color-mix(in srgb,var(--primary) 10%,transparent);box-shadow:inset 3px 0 0 var(--primary)}
.proj-sprint-row-name{font-weight:600;color:var(--text);display:flex;justify-content:space-between;align-items:center;gap:6px}
.proj-sprint-row-meta{display:flex;justify-content:space-between;align-items:center;font-size:10.5px;color:var(--text-muted)}
.proj-main{background:var(--card);border:1px solid var(--border);border-radius:12px;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.proj-empty{flex:1;display:flex;align-items:center;justify-content:center;color:var(--text-muted);font-size:13px}
.proj-main-head{padding:18px 22px;border-bottom:1px solid var(--border-light)}
.proj-main-head h3{font-size:18px;font-weight:700;color:var(--text);margin:0;letter-spacing:-0.01em}
.proj-main-head .proj-meta-row{display:flex;flex-wrap:wrap;gap:14px;margin-top:8px;font-size:12px;color:var(--text-muted)}
.proj-main-head .proj-meta-row strong{color:var(--text);font-weight:600;margin-right:4px}
.proj-main-head .proj-goal{margin-top:8px;font-size:13px;color:var(--text-secondary);line-height:1.5;font-style:italic}
.proj-issue-toolbar{display:flex;align-items:center;gap:10px;padding:10px 22px;border-bottom:1px solid var(--border-light);flex-wrap:wrap}
.proj-issue-toolbar input{padding:6px 10px;border:1px solid var(--border);border-radius:8px;font-size:12px;outline:none;font-family:inherit;color:var(--text);background:var(--bg-subtle)}
.proj-issue-toolbar input:focus{border-color:var(--primary);background:var(--card)}
.proj-issue-toolbar select{padding:6px 8px;border:1px solid var(--border);border-radius:8px;font-size:12px;background:var(--bg-subtle);color:var(--text);font-family:inherit;outline:none;cursor:pointer}
.proj-issue-list{flex:1;overflow-y:auto}
/* Folders/sprints/backlog row grid:
   [type-icon 22px] [key 88px] [title 1fr] [epic 160px] [status 110px] [priority 90px] [assignee 130px] */
.proj-issue-row{display:grid;grid-template-columns:22px 88px 1fr 160px 110px 90px 130px;gap:10px;padding:10px 22px;border-bottom:1px solid var(--border-light);font-size:12.5px;color:var(--text);cursor:pointer;transition:background 0.12s;align-items:center}
.proj-issue-row:hover{background:var(--bg-hover)}
.proj-issue-row .pi-key{font-family:'JetBrains Mono','SF Mono',Menlo,monospace;font-size:11px;font-weight:600;color:var(--primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.proj-issue-row .pi-title{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.proj-issue-row .pi-epic{font-size:11.5px;color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.proj-issue-row .pi-assignee{font-size:11px;color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.proj-issue-list-head{display:grid;grid-template-columns:22px 88px 1fr 160px 110px 90px 130px;gap:10px;padding:10px 22px;font-size:10px;font-weight:700;text-transform:uppercase;color:var(--text-muted);letter-spacing:0.06em;background:var(--bg-subtle);border-bottom:1px solid var(--border-light);position:sticky;top:0;z-index:1}

/* JIRA-style issue type icons. 18px rounded square with a 1-letter pictogram. */
.pi-typeicon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:4px;font-size:10px;font-weight:800;color:#fff;font-family:'Inter',sans-serif;letter-spacing:-0.02em;flex-shrink:0;box-shadow:inset 0 -1px 0 rgba(16,24,40,0.10)}
.pi-typeicon-story{background:var(--green)}    /* green */
.pi-typeicon-task{background:var(--info)}     /* blue */
.pi-typeicon-bug{background:var(--danger)}      /* red */
.pi-typeicon-epic{background:var(--purple)}     /* purple */
.pi-typeicon-subtask{background:var(--sky)}  /* light blue */

/* Inline-edit "no epic" chip styled like the empty assignee */
.proj-inline-chip-empty .pi-epic-empty{color:var(--text-muted);font-style:italic}

@media (max-width: 1100px){
  .proj-body{grid-template-columns:1fr}
  .proj-sidebar{max-height:240px}
  .proj-issue-row,.proj-issue-list-head{grid-template-columns:22px 88px 1fr 110px}
  .proj-issue-row .pi-epic,.proj-issue-row .pi-priority,.proj-issue-row .pi-assignee,
  .proj-issue-list-head .pi-epic,.proj-issue-list-head .pi-priority,.proj-issue-list-head .pi-assignee{display:none}
}

/* Issue detail drawer */
.proj-drawer{position:fixed;top:0;right:0;width:min(860px,100vw);height:100vh;background:var(--card);border-left:1px solid var(--border);box-shadow:-12px 0 36px rgba(13,17,23,0.10);transform:translateX(100%);transition:transform 0.22s ease-out;z-index:120;display:flex;flex-direction:column}
.proj-drawer.open{transform:translateX(0)}
.proj-drawer-overlay{position:fixed;inset:0;background:rgba(13,17,23,0.32);opacity:0;pointer-events:none;transition:opacity 0.22s ease-out;z-index:119}
.proj-drawer-overlay.open{opacity:1;pointer-events:auto}
.proj-drawer-bcrumb{padding:10px 16px 0 16px;background:var(--bg-subtle);border-bottom:1px solid var(--border-light)}
.proj-drawer-back{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;font-size:12px;font-weight:500;background:var(--card);border:1px solid var(--border);border-radius:8px;cursor:pointer;color:var(--text-secondary);font-family:inherit;transition:background 0.12s,color 0.12s,border-color 0.12s;margin-bottom:10px}
.proj-drawer-back:hover{background:color-mix(in srgb,var(--primary) 6%,transparent);color:var(--primary);border-color:var(--primary)}
.proj-drawer-back-arrow{font-size:14px;line-height:1}
.proj-drawer-back-key{font-family:'JetBrains Mono','SF Mono',Menlo,monospace;font-size:11px;font-weight:600;color:var(--primary)}
.proj-drawer-back-title{color:var(--text-muted);font-size:11.5px;max-width:320px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.proj-drawer-head{padding:18px 24px;border-bottom:1px solid var(--border-light);display:flex;align-items:flex-start;gap:14px}
.proj-drawer-head h3{font-size:17px;font-weight:600;color:var(--text);margin:6px 0 0;letter-spacing:-0.005em;line-height:1.35}
.proj-drawer-head .pdh-key{font-family:'JetBrains Mono','SF Mono',Menlo,monospace;font-size:11px;font-weight:600;color:var(--primary)}
.proj-drawer-head .pdh-jira{display:inline-block;margin-left:8px;font-family:'JetBrains Mono','SF Mono',Menlo,monospace;font-size:10px;color:var(--text-muted);background:var(--bg-subtle);padding:2px 7px;border-radius:6px;border:1px solid var(--border-light);text-decoration:none}
.proj-drawer-head .pdh-jira:hover{color:var(--primary);border-color:var(--primary)}
.proj-drawer-close{background:transparent;border:0;color:var(--text-muted);font-size:18px;cursor:pointer;padding:6px 10px;border-radius:6px}
.proj-drawer-close:hover{background:var(--bg-hover);color:var(--text)}
.proj-drawer-iconbtn{margin-left:auto;background:transparent;border:1px solid var(--border);color:var(--text-secondary);cursor:pointer;padding:6px 8px;border-radius:6px;display:inline-flex;align-items:center;gap:4px;transition:background 0.12s,color 0.12s,border-color 0.12s}
.proj-drawer-iconbtn:hover{background:var(--bg-hover);color:var(--primary);border-color:var(--primary)}
.proj-drawer-iconbtn.copied{color:var(--green);border-color:var(--green);background:color-mix(in srgb,var(--green) 6%,transparent)}
/* Meta grid lives inside .proj-drawer-body now (scrolls with the rest).
   Keeps the soft-gray surface so it still reads as a "card" of metadata
   distinct from the description/comments below. */
.proj-drawer-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:14px 22px;padding:14px 18px;background:var(--bg-subtle);border:1px solid var(--border-light);border-radius:10px;margin-bottom:18px}
.proj-drawer-meta-cell{display:flex;flex-direction:column;gap:3px}
.proj-drawer-meta-label{font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em}
.proj-drawer-meta-value{font-size:13px;color:var(--text);font-weight:500}
.proj-drawer-body{flex:1;overflow-y:auto;padding:18px 24px}
.proj-drawer-section{margin-bottom:24px}
.proj-drawer-section h4{font-size:11px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;margin:0 0 10px}
.proj-md{font-size:13.5px;line-height:1.6;color:var(--text)}
.proj-md h1,.proj-md h2,.proj-md h3,.proj-md h4{margin:18px 0 8px;font-weight:700;color:var(--text)}
.proj-md h1{font-size:18px}
.proj-md h2{font-size:16px}
.proj-md h3{font-size:14px}
.proj-md h4{font-size:13px}
.proj-md p{margin:8px 0}
.proj-md ul,.proj-md ol{margin:8px 0;padding-left:22px}
.proj-md li{margin:3px 0}
.proj-md code{background:var(--bg-subtle);padding:1px 5px;border-radius:4px;font-size:0.92em;font-family:'JetBrains Mono','SF Mono',Menlo,monospace}
.proj-md pre{background:var(--bg-subtle);border:1px solid var(--border-light);border-radius:8px;padding:12px;overflow-x:auto;font-size:12px;margin:10px 0}
.proj-md pre code{background:transparent;padding:0}
.proj-md a{color:var(--primary);text-decoration:underline}
.proj-md blockquote{border-left:3px solid var(--border);padding:2px 12px;margin:8px 0;color:var(--text-secondary);font-style:italic}
.proj-md table{border-collapse:collapse;font-size:12px;margin:10px 0}
.proj-md th,.proj-md td{border:1px solid var(--border-light);padding:6px 10px;text-align:left}
.proj-md th{background:var(--bg-subtle);font-weight:600}
/* Finance Agent suggested-prompt chips */
.fin-suggest{text-align:left;background:#fff;border:1px solid var(--border);border-radius:10px;padding:8px 12px;font-size:12px;font-family:inherit;color:var(--text);cursor:pointer;line-height:1.4;transition:border-color 0.12s,background 0.12s,color 0.12s}
.fin-suggest:hover{border-color:var(--primary);background:color-mix(in srgb,var(--primary) 4%,transparent);color:var(--primary)}
[data-theme="dark"] .fin-suggest{background:var(--bg-card)}
/* Finance Agent chat messages */
.fin-msg{padding:10px 0;border-bottom:1px solid var(--border-light)}
.fin-msg:last-child{border-bottom:0}
.fin-msg-role{font-size:10.5px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:4px}
.fin-msg-role.user{color:var(--primary)}
.fin-msg-body{font-size:13.5px;line-height:1.6;color:var(--text);white-space:pre-wrap;word-break:break-word}
.fin-thinking{display:inline-flex;gap:3px;align-items:center}
.fin-thinking span{width:6px;height:6px;border-radius:50%;background:var(--primary);opacity:0.4;animation:fin-pulse 1.2s infinite ease-in-out}
.fin-thinking span:nth-child(2){animation-delay:0.15s}
.fin-thinking span:nth-child(3){animation-delay:0.3s}
@keyframes fin-pulse{0%,80%,100%{opacity:0.2;transform:scale(0.8)}40%{opacity:1;transform:scale(1)}}
/* Inline-edit affordance on finance table cells */
.fin-edit{cursor:text;border-radius:4px;padding:0 4px;transition:background 0.12s}
.fin-edit:hover{background:color-mix(in srgb,var(--primary) 5%,transparent);box-shadow:inset 0 -1px 0 var(--primary)}
.fin-edit input{width:100%;padding:2px 4px;border:1px solid var(--primary);border-radius:4px;font:inherit;background:var(--bg-card);color:var(--text);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent)}
.fin-saved-flash{animation:fin-row-flash 0.6s ease-out}
@keyframes fin-row-flash{0%{background:color-mix(in srgb,var(--green) 18%,transparent)}100%{background:transparent}}

.proj-mention{font-weight:700;color:var(--primary);background:color-mix(in srgb,var(--primary) 8%,transparent);padding:0 4px;border-radius:4px}
[data-theme="dark"] .proj-mention{background:color-mix(in srgb,var(--sky) 18%,transparent);color:var(--info-fg)}
.proj-comment-showmore{display:block;width:100%;margin:6px 0;padding:6px 10px;background:transparent;border:1px solid var(--border-light);border-radius:8px;font-size:11px;font-weight:600;color:var(--text-muted);cursor:pointer;font-family:inherit;transition:color 0.12s,border-color 0.12s,background 0.12s}
.proj-comment-showmore:hover{color:var(--primary);border-color:var(--primary);background:color-mix(in srgb,var(--primary) 4%,transparent)}
.proj-comment{padding:12px 14px;background:var(--bg-subtle);border:1px solid var(--border-light);border-radius:10px;margin-bottom:10px}
.proj-comment-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;font-size:11.5px}
.proj-comment-author{font-weight:600;color:var(--text)}
.proj-comment-time{color:var(--text-muted)}
.proj-comment-reply{margin-left:auto;background:transparent;border:1px solid transparent;border-radius:6px;padding:3px 8px;font-size:11px;font-weight:500;color:var(--text-muted);cursor:pointer;transition:color 0.12s,border-color 0.12s,background 0.12s;font-family:inherit}
.proj-comment-reply:hover{color:var(--primary);border-color:var(--border);background:var(--card)}
.proj-comment-del{background:transparent;border:0;color:var(--text-muted);cursor:pointer;font-size:13px;padding:2px 6px;border-radius:6px;font-family:inherit;transition:color 0.12s,background 0.12s}
.proj-comment-del:hover{color:var(--danger-fg);background:var(--danger-bg)}
.proj-comment-edit{background:transparent;border:1px solid transparent;border-radius:6px;padding:3px 8px;font-size:11px;font-weight:500;color:var(--text-muted);cursor:pointer;transition:color 0.12s,border-color 0.12s,background 0.12s;font-family:inherit}
.proj-comment-edit:hover{color:var(--primary);border-color:var(--border);background:var(--card)}
.proj-comment-edited{margin-left:6px;color:var(--text-muted);font-size:10.5px;font-style:italic;letter-spacing:0.01em}
.proj-comment-editor{margin-top:4px}
.proj-comment-editor textarea{width:100%;min-height:84px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;font-size:13px;font-family:inherit;line-height:1.55;background:var(--bg-card);color:var(--text);resize:vertical;box-sizing:border-box}
.proj-comment-editor textarea:focus{outline:0;border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent)}
.proj-comment-editor-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:8px}
.proj-comment-editor-actions button{padding:6px 14px;border-radius:999px;font-size:11.5px;font-weight:600;cursor:pointer;font-family:inherit;border:1px solid var(--border);background:var(--bg);color:var(--text);transition:background 0.12s,color 0.12s,border-color 0.12s}
.proj-comment-editor-actions .proj-comment-editor-save{background:var(--primary);color:#fff;border-color:var(--primary)}
.proj-comment-editor-actions .proj-comment-editor-save:hover{background:var(--primary-dark)}
.proj-comment-editor-actions .proj-comment-editor-cancel:hover{background:var(--card)}
.proj-pill-design-done{background:color-mix(in srgb,var(--purple) 12%,transparent);color:var(--purple);border:1px solid color-mix(in srgb,var(--purple) 22%,transparent)}
.proj-drawer-delete{display:inline-flex;align-items:center;gap:6px;background:transparent;border:1px solid var(--border);color:var(--danger-fg);border-radius:8px;padding:7px 12px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;margin-right:8px;transition:background 0.12s,border-color 0.12s}
.proj-drawer-delete:hover{background:var(--danger-bg);border-color:color-mix(in srgb,var(--danger) 35%,transparent)}
/* Roadmap (Gantt) — light, modern timeline. Year chips + month band on top,
   pillar/epic rows on the left, soft pastel bars in the canvas. Drag bars
   horizontally to reschedule. Today line is a subtle accent. */
.proj-rm{display:flex;flex-direction:column;gap:10px;flex:1;min-height:0;margin-top:6px}
.proj-rm-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 12px;background:var(--card);border:1px solid var(--border-light);border-radius:12px}
.proj-rm-years{display:inline-flex;background:var(--bg-subtle);border-radius:10px;padding:3px;gap:2px}
.proj-rm-year{padding:6px 14px;border:0;background:transparent;font-family:inherit;font-size:12px;font-weight:600;color:var(--text-muted);border-radius:8px;cursor:pointer;letter-spacing:0.01em;transition:background 0.18s ease,color 0.18s ease,transform 0.12s ease}
.proj-rm-year:hover{color:var(--text);background:color-mix(in srgb,var(--primary) 6%,transparent)}
.proj-rm-year.active{background:var(--card);color:var(--text);box-shadow:0 1px 2px rgba(13,17,23,0.06)}
.proj-rm-year.current{position:relative}
.proj-rm-year.current::after{content:"";position:absolute;left:50%;bottom:-1px;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 18%,transparent)}
.proj-rm-zoom{display:inline-flex;border:1px solid var(--border-light);border-radius:8px;overflow:hidden}
.proj-rm-zoom button{padding:6px 12px;background:transparent;border:0;color:var(--text-muted);font-family:inherit;font-size:11px;font-weight:600;cursor:pointer;letter-spacing:0.04em;text-transform:uppercase;transition:background 0.18s,color 0.18s}
.proj-rm-zoom button:not(:last-child){border-right:1px solid var(--border-light)}
.proj-rm-zoom button.active{background:var(--primary);color:#fff}
.proj-rm-zoom button:hover:not(.active){background:var(--bg-subtle);color:var(--text)}
.proj-rm-pill-filter{display:inline-flex;gap:6px;flex-wrap:wrap;align-items:center}
.proj-rm-pill-chip{display:inline-flex;align-items:center;gap:5px;padding:5px 10px;border-radius:14px;border:1px solid transparent;background:var(--bg-subtle);font-family:inherit;font-size:11px;font-weight:600;color:var(--text-muted);cursor:pointer;letter-spacing:0.01em;transition:transform 0.12s,box-shadow 0.18s,opacity 0.18s}
.proj-rm-pill-chip:hover{transform:translateY(-1px)}
.proj-rm-pill-chip.off{opacity:0.4}
.proj-rm-pill-dot{width:7px;height:7px;border-radius:50%}
.proj-rm-actions{margin-left:auto;display:inline-flex;gap:8px}
.proj-rm-canvas{flex:1;min-height:520px;display:grid;grid-template-columns:240px 1fr;background:var(--card);border:1px solid var(--border-light);border-radius:14px;overflow:hidden}
.proj-rm-rail{border-right:1px solid var(--border-light);background:var(--bg-subtle);overflow-y:auto;overflow-x:hidden}
.proj-rm-rail-header{height:64px;display:flex;align-items:flex-end;padding:0 14px 10px;border-bottom:1px solid var(--border-light);background:var(--bg-subtle);font-size:11px;color:var(--text-muted);font-weight:600;letter-spacing:0.06em;text-transform:uppercase;position:sticky;top:0;z-index:2}
.proj-rm-pillar-group{border-bottom:1px solid var(--border-light)}
.proj-rm-pillar-head{display:flex;align-items:center;gap:8px;padding:10px 14px;font-weight:600;font-size:12px;color:var(--text);cursor:pointer;background:transparent;transition:background 0.18s}
.proj-rm-pillar-head:hover{background:color-mix(in srgb,var(--primary) 4%,transparent)}
.proj-rm-pillar-caret{font-size:10px;color:var(--text-muted);transition:transform 0.2s}
.proj-rm-pillar-group.collapsed .proj-rm-pillar-caret{transform:rotate(-90deg)}
.proj-rm-pillar-group.collapsed .proj-rm-row,
.proj-rm-pillar-group.collapsed .proj-rm-track{display:none}
.proj-rm-pillar-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.proj-rm-pillar-name{flex:1}
.proj-rm-pillar-count{font-size:10px;color:var(--text-muted);font-weight:500;background:var(--bg-subtle);padding:1px 7px;border-radius:8px}
.proj-rm-row{height:36px;display:flex;align-items:center;gap:8px;padding:0 14px 0 24px;font-size:12px;color:var(--text);border-bottom:1px solid var(--border-light);cursor:pointer;transition:background 0.16s}
.proj-rm-row:hover{background:color-mix(in srgb,var(--primary) 4%,transparent)}
.proj-rm-row-title{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.proj-rm-row-meta{font-size:10px;color:var(--text-muted);font-weight:500;flex-shrink:0}
.proj-rm-timeline{position:relative;overflow:auto;background:var(--bg-card)}
.proj-rm-timeline-inner{position:relative}
.proj-rm-band-years{position:sticky;top:0;z-index:3;display:flex;height:32px;background:var(--bg-subtle);border-bottom:1px solid var(--border-light)}
.proj-rm-band-year{display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;color:var(--text);letter-spacing:0.02em;border-right:1px solid var(--border-light);box-sizing:border-box}
.proj-rm-band-year.is-current{color:var(--primary)}
.proj-rm-band-months{position:sticky;top:32px;z-index:3;display:flex;height:32px;background:var(--bg-subtle);border-bottom:1px solid var(--border-light)}
.proj-rm-band-month{display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;border-right:1px solid var(--border-light);box-sizing:border-box}
.proj-rm-band-month.is-current{color:var(--primary);background:color-mix(in srgb,var(--primary) 4%,transparent)}
.proj-rm-grid{position:absolute;top:64px;bottom:0;left:0;right:0;pointer-events:none}
.proj-rm-grid-month{position:absolute;top:0;bottom:0;width:1px;background:var(--border-light)}
.proj-rm-grid-quarter{background:var(--border)}
.proj-rm-grid-year{background:rgba(148,163,184,0.4);width:1px}
.proj-rm-today{position:absolute;top:0;bottom:0;width:2px;background:linear-gradient(180deg,color-mix(in srgb,var(--red) 55%,transparent),color-mix(in srgb,var(--red) 15%,transparent));z-index:2;pointer-events:none}
.proj-rm-today::before{content:"Today";position:absolute;top:-2px;left:6px;background:var(--danger);color:#fff;font-size:11px;font-weight:700;letter-spacing:0.06em;padding:2px 6px;border-radius:0 0 5px 5px;text-transform:uppercase;white-space:nowrap}
.proj-rm-pillar-track{height:42px;border-bottom:1px solid var(--border-light)}
.proj-rm-track{position:relative;height:36px;border-bottom:1px solid var(--border-light)}
.proj-rm-track:nth-child(even){background:var(--bg-subtle)}
.proj-rm-bar{position:absolute;top:5px;height:26px;border-radius:7px;display:flex;align-items:center;padding:0 10px;font-size:11px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:grab;border-left:3px solid;box-shadow:0 1px 2px rgba(13,17,23,0.05);transition:transform 0.15s ease,box-shadow 0.18s ease,filter 0.18s ease;user-select:none;animation:projRmBarIn 0.32s cubic-bezier(0.2,0.9,0.3,1.05) backwards;animation-delay:calc(var(--idx,0) * 24ms)}
@keyframes projRmBarIn{from{opacity:0;transform:translateY(4px) scaleX(0.92);transform-origin:left center}to{opacity:1;transform:translateY(0) scaleX(1)}}
.proj-rm-bar:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(13,17,23,0.10);filter:brightness(1.02);z-index:4}
.proj-rm-bar.dragging{cursor:grabbing;box-shadow:0 8px 20px rgba(13,17,23,0.18);z-index:6}
.proj-rm-bar.kind-historical{filter:saturate(0.85)}
.proj-rm-bar.kind-historical::after{content:"✓";margin-left:6px;opacity:0.7;font-size:10px}
.proj-rm-bar.kind-current{box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 18%,transparent),0 1px 2px rgba(13,17,23,0.05);animation:projRmBarIn 0.32s cubic-bezier(0.2,0.9,0.3,1.05) backwards,projRmPulse 2.4s ease-in-out infinite 0.32s}
.proj-rm-bar.kind-forecast{border-style:dashed;border-left-style:solid}
.proj-rm-bar.kind-planned{}
@keyframes projRmPulse{0%,100%{box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 18%,transparent),0 1px 2px rgba(13,17,23,0.05)}50%{box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 10%,transparent),0 1px 2px rgba(13,17,23,0.05)}}
.proj-rm-bar-handle{position:absolute;top:0;bottom:0;width:6px;cursor:ew-resize;background:transparent}
.proj-rm-bar-handle.left{left:0}
.proj-rm-bar-handle.right{right:0}
.proj-rm-bar-handle:hover{background:rgba(13,17,23,0.06)}
.proj-rm-bar-pct{position:absolute;left:0;top:0;bottom:0;background:rgba(13,17,23,0.06);border-radius:7px 0 0 7px;pointer-events:none}
/* In-flight overlay — work in QA / review / in_progress. Sits on top of the
   completed band (so completed % is solid, in-flight % is the lighter band
   to its right). Striped pattern so it's visually distinct from completed. */
.proj-rm-bar-inflight{position:absolute;top:0;bottom:0;background:repeating-linear-gradient(45deg,color-mix(in srgb,var(--amber) 22%,transparent),color-mix(in srgb,var(--amber) 22%,transparent) 4px,color-mix(in srgb,var(--amber) 10%,transparent) 4px,color-mix(in srgb,var(--amber) 10%,transparent) 8px);pointer-events:none}
.proj-rm-tooltip{position:fixed;z-index:10010;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:10px 12px;box-shadow:0 10px 24px rgba(13,17,23,0.18);font-size:12px;color:var(--text);min-width:240px;max-width:320px;pointer-events:none;animation:projRmTipIn 0.16s ease-out}
@keyframes projRmTipIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
.proj-rm-tooltip h4{margin:0 0 4px;font-size:13px;font-weight:700;letter-spacing:-0.01em}
.proj-rm-tooltip .meta{color:var(--text-muted);font-size:11px;margin-bottom:6px}
.proj-rm-tooltip .row{display:flex;justify-content:space-between;gap:12px;font-size:11px;padding:2px 0}
.proj-rm-tooltip .row span:first-child{color:var(--text-muted)}
.proj-rm-tooltip .row span:last-child{color:var(--text);font-weight:600}
.proj-rm-empty{padding:40px 24px;text-align:center;color:var(--text-muted);font-size:13px;line-height:1.6}
.proj-rm-empty button{margin-top:14px}
.proj-rm-legend{display:flex;flex-wrap:wrap;align-items:center;gap:14px;padding:8px 14px;font-size:11px;color:var(--text-muted)}
.proj-rm-legend-item{display:inline-flex;align-items:center;gap:6px}
.proj-rm-legend-swatch{width:14px;height:10px;border-radius:3px;border-left:2px solid}
.proj-rm-legend-swatch.kind-current{box-shadow:0 0 0 1.5px color-mix(in srgb,var(--primary) 25%,transparent)}
.proj-rm-legend-swatch.kind-forecast{border-style:dashed;border-left-style:solid}
@media (max-width: 720px){
  .proj-rm-canvas{grid-template-columns:1fr}
  .proj-rm-rail{display:none}
}

/* Sprint completion celebration. Overlay + summary card + canvas confetti. */
.proj-celebration{position:fixed;inset:0;z-index:10002;background:rgba(13,17,23,0.62);backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;animation:projCelebFade 0.32s ease-out}
.proj-celebration canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.proj-celebration-card{position:relative;z-index:1;background:var(--card);border-radius:18px;padding:32px 36px 26px;width:min(440px,92vw);box-shadow:0 24px 64px rgba(13,17,23,0.4);text-align:center;animation:projCelebPop 0.42s cubic-bezier(0.2,1.3,0.4,1)}
.proj-celebration-emoji{font-size:48px;line-height:1;margin-bottom:8px;animation:projCelebSpin 0.9s ease-out}
.proj-celebration-card h2{margin:0 0 18px;font-size:22px;font-weight:700;color:var(--text);letter-spacing:-0.01em}
.proj-celebration-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:22px}
.proj-celebration-stats > div{display:flex;flex-direction:column;align-items:center;background:var(--bg-subtle);border-radius:10px;padding:10px 6px}
.proj-celebration-stats span{font-size:22px;font-weight:700;color:var(--primary);line-height:1.1}
.proj-celebration-stats label{font-size:10px;color:var(--text-muted);font-weight:600;text-transform:uppercase;letter-spacing:0.04em;margin-top:4px}
.proj-celebration-card button{padding:10px 28px;font-size:13px;font-weight:600}
.proj-celebration-out{animation:projCelebFadeOut 0.32s ease-in forwards}
@keyframes projCelebFade{from{opacity:0}to{opacity:1}}
@keyframes projCelebFadeOut{to{opacity:0}}
@keyframes projCelebPop{from{opacity:0;transform:translateY(20px) scale(0.86)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes projCelebSpin{0%{transform:rotate(-30deg) scale(0)}60%{transform:rotate(20deg) scale(1.2)}100%{transform:rotate(0) scale(1)}}

/* Custom confirm modal — replaces native confirm() everywhere. */
.uo-confirm-bd{position:fixed;inset:0;background:rgba(13,17,23,0.5);backdrop-filter:blur(4px);z-index:10001;display:flex;align-items:center;justify-content:center;animation:uoConfBg 0.16s ease-out}
.uo-confirm-card{background:var(--card);border:1px solid var(--border);border-radius:14px;width:min(440px,92vw);padding:24px 24px 18px;box-shadow:0 24px 64px rgba(13,17,23,0.32);font-family:inherit;animation:uoConfIn 0.18s cubic-bezier(0.2,0.9,0.3,1)}
.uo-confirm-card h3{margin:0 0 10px;font-size:16px;font-weight:700;color:var(--text)}
.uo-confirm-card p{margin:0 0 18px;font-size:13px;color:var(--text-muted);line-height:1.55}
.uo-confirm-actions{display:flex;justify-content:flex-end;gap:8px}
.uo-confirm-cancel,.uo-confirm-go{padding:8px 16px;border-radius:8px;font-size:12.5px;font-weight:600;font-family:inherit;cursor:pointer;border:1px solid var(--border);transition:background 0.12s,border-color 0.12s}
.uo-confirm-cancel{background:var(--card);color:var(--text)}
.uo-confirm-cancel:hover{background:var(--bg-subtle)}
.uo-confirm-go{background:var(--primary);color:#fff;border-color:var(--primary)}
.uo-confirm-go:hover{background:var(--primary-dark)}
.uo-confirm-danger{background:var(--danger);border-color:var(--danger)}
.uo-confirm-danger:hover{background:color-mix(in srgb,var(--danger) 85%,black);border-color:color-mix(in srgb,var(--danger) 85%,black)}
@keyframes uoConfBg{from{opacity:0}to{opacity:1}}
@keyframes uoConfIn{from{opacity:0;transform:translateY(8px) scale(0.97)}to{opacity:1;transform:translateY(0) scale(1)}}
.proj-comment-body{font-size:13px;line-height:1.5;color:var(--text)}
/* Threaded replies: indent + connector line on the left so a thread
   reads as one unit instead of two stacked comments. */
.proj-comment-replies{margin:-4px 0 10px 22px;padding-left:14px;border-left:2px solid var(--border-light);display:flex;flex-direction:column;gap:6px}
.proj-comment-reply-row{margin-bottom:0;background:var(--card);border-color:var(--border)}
.proj-reply-hint{display:flex;align-items:center;gap:8px;background:color-mix(in srgb,var(--primary) 6%,transparent);border:1px solid color-mix(in srgb,var(--primary) 18%,transparent);border-radius:6px;padding:6px 10px;font-size:11.5px;color:var(--primary);margin-bottom:6px}
.proj-reply-hint button{margin-left:auto;background:transparent;border:0;cursor:pointer;color:var(--primary);font-size:14px;line-height:1}
/* Inline-edit chip for folder rows — click to edit priority/status/assignee
   right in the row without opening the drawer. JIRA-style. */
.proj-inline-chip{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;border-radius:6px;border:1px dashed transparent;cursor:pointer;font-size:11px;font-weight:500;transition:border-color 0.1s,background 0.1s}
.proj-inline-chip:hover{border-color:var(--primary);background:color-mix(in srgb,var(--primary) 4%,transparent)}
.proj-inline-chip-empty{color:var(--text-muted);font-style:italic;border-color:var(--border-light)}
.proj-inline-chip-empty:hover{color:var(--primary);font-style:normal}

/* Global toast/undo container — used by inline edits, deletes, etc. */
.uo-toast-wrap{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);display:flex;flex-direction:column-reverse;gap:8px;z-index:10000;pointer-events:none}
.uo-toast{pointer-events:auto;background:var(--sidebar);color:#fff;padding:10px 14px;border-radius:10px;display:flex;align-items:center;gap:14px;font-size:13px;box-shadow:0 12px 32px rgba(16,24,40,0.3);animation:uoToastIn 0.22s cubic-bezier(0.2,0.9,0.3,1)}
.uo-toast.uo-toast-error{border-left:3px solid var(--danger)}
.uo-toast.uo-toast-success{border-left:3px solid var(--success)}
.uo-toast-msg{flex:1;min-width:200px}
.uo-toast-action{background:transparent;border:1px solid rgba(255,255,255,0.3);color:#fff;border-radius:6px;padding:4px 10px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;transition:background 0.12s}
.uo-toast-action:hover{background:rgba(255,255,255,0.12)}
.uo-toast-x{background:transparent;border:0;color:rgba(255,255,255,0.55);cursor:pointer;font-size:16px;line-height:1;padding:0 4px;font-family:inherit}
.uo-toast-x:hover{color:#fff}
.uo-toast-bar{position:absolute;left:0;right:0;bottom:0;height:2px;background:rgba(255,255,255,0.35);border-radius:0 0 10px 10px;transform-origin:left;animation:uoToastBar 5s linear forwards}
.uo-toast.uo-out{animation:uoToastOut 0.18s ease-in forwards}
@keyframes uoToastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@keyframes uoToastOut{to{opacity:0;transform:translateY(8px)}}
@keyframes uoToastBar{from{transform:scaleX(1)}to{transform:scaleX(0)}}

/* Board column polish — clearer column separation, sticky-ish heads, and
   a subtle status-tinted top stripe so the eye doesn't have to chase. */
.proj-board-col{background:var(--bg-subtle);border:1px solid var(--border);border-radius:10px;padding:0;display:flex;flex-direction:column;overflow:hidden;box-shadow:inset 0 1px 0 rgba(16,24,40,0.02)}
.proj-board-col-head{padding:10px 12px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;color:var(--text);background:var(--card);border-bottom:1px solid var(--border-light);display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:1}
.proj-board-col-head::before{content:'';position:absolute;left:0;right:0;top:0;height:3px;background:var(--primary);opacity:0.22}
.proj-board-col[data-status="completed"]    .proj-board-col-head::before{background:var(--green);opacity:0.45}
.proj-board-col[data-status="in_progress"]  .proj-board-col-head::before{background:var(--info);opacity:0.55}
.proj-board-col[data-status="dev_review"]   .proj-board-col-head::before{background:var(--purple);opacity:0.55}
.proj-board-col[data-status="in_qa"]        .proj-board-col-head::before{background:var(--amber);opacity:0.55}
.proj-board-col[data-status="product_review"].proj-board-col-head::before{background:var(--cyan);opacity:0.55}
.proj-board-col[data-status="ready_for_dev"].proj-board-col-head::before{background:var(--sky);opacity:0.45}
.proj-board-col[data-status="design_phase"] .proj-board-col-head::before{background:var(--pink);opacity:0.45}
.proj-board-col[data-status="to_do"]        .proj-board-col-head::before{background:var(--text-muted);opacity:0.45}
.proj-board-col[data-status="blocked"]      .proj-board-col-head::before{background:var(--danger);opacity:0.6}
.proj-board-col[data-status="cancelled"]    .proj-board-col-head::before{background:var(--text-muted);opacity:0.45}
.proj-board-col-count{background:var(--bg-subtle);border:1px solid var(--border);color:var(--text-muted);min-width:22px;height:18px;border-radius:9px;padding:0 6px;font-size:10.5px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;letter-spacing:0}
.proj-board-col-body{flex:1;overflow-y:auto;padding:10px 8px 14px;display:flex;flex-direction:column;gap:8px;min-height:60px}
.proj-board-col.dragover{background:color-mix(in srgb,var(--primary) 6%,transparent);border-color:var(--primary);border-style:dashed}

/* Filter button + popover (Folders toolbar). */
.proj-filter-btn{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:1px solid var(--border);border-radius:8px;background:var(--card);color:var(--text);font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;transition:border-color 0.12s,background 0.12s}
.proj-filter-btn:hover{border-color:var(--primary)}
.proj-filter-btn.active{background:var(--primary);color:#fff;border-color:var(--primary)}
/* Filter popover: vertical-flex column with a scrollable body and a sticky
   footer. Sized to match the Board filter (~460px tall, 320px wide); shrinks
   to fit small screens via the viewport clamp. */
.proj-filter-pop{position:absolute;background:var(--card);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px rgba(13,17,23,0.16);z-index:200;width:320px;max-width:calc(100vw - 24px);font-family:inherit;display:flex;flex-direction:column;max-height:min(460px,calc(100vh - 100px));overflow:hidden}
.proj-filter-pop-body{padding:12px 14px;overflow-y:auto;flex:1;min-height:0}
.proj-filter-pop-section{margin-bottom:14px}
.proj-filter-pop-section:last-child{margin-bottom:0}
.proj-filter-pop-section h5{margin:0 0 6px;font-size:10.5px;text-transform:uppercase;letter-spacing:0.06em;color:var(--text-muted);font-weight:700}
.proj-filter-checkbox{display:flex;align-items:center;gap:8px;padding:5px 6px;font-size:12px;color:var(--text);cursor:pointer;border-radius:6px}
.proj-filter-checkbox:hover{background:var(--bg-subtle)}
.proj-filter-checkbox input{margin:0}
.proj-filter-pop-foot{display:flex;gap:8px;justify-content:space-between;align-items:center;border-top:1px solid var(--border-light);padding:10px 14px;background:var(--card);flex-shrink:0;position:sticky;bottom:0}
.proj-filter-clear{background:transparent;border:0;color:var(--text-muted);font-size:11.5px;cursor:pointer;font-family:inherit;padding:4px 6px}
.proj-filter-clear:hover{color:var(--text)}

/* Multi-select assignee popover (used by the inline editor + create modal). */
.proj-multi-row{display:flex;align-items:center;gap:8px;padding:6px 8px;font-size:12px;cursor:pointer;border-radius:6px}
.proj-multi-row:hover{background:var(--bg-subtle)}
.proj-multi-row input[type=checkbox]{margin:0}
.proj-multi-check{width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center;border-radius:3px;border:1.5px solid var(--border);background:var(--card);flex-shrink:0;font-size:10px;color:#fff}
.proj-multi-row[data-checked="1"] .proj-multi-check{background:var(--primary);border-color:var(--primary)}
.proj-multi-row[data-checked="1"] .proj-multi-check::after{content:'✓'}

/* Mobile responsive sweep for projects panel. Below 720 the multi-column
   row grids collapse to key + title + status; the rest moves to a second row. */
@media (max-width: 720px){
  .proj-tabs{overflow-x:auto;flex-wrap:nowrap;gap:0}
  .proj-tab{padding:10px 12px;font-size:12px;flex-shrink:0}
  .proj-toolbar{flex-direction:column;align-items:stretch}
  .proj-toolbar input{max-width:none}
  .proj-issue-row,.proj-issue-list-head{grid-template-columns:22px 80px 1fr 1fr;font-size:12px;gap:8px}
  .proj-issue-list-head .pi-epic,.proj-issue-list-head .pi-priority,.proj-issue-list-head .pi-assignee,
  .proj-issue-row .pi-epic,.proj-issue-row .pi-priority,.proj-issue-row .pi-assignee{display:none}
  .proj-drawer{width:100vw}
  .proj-board-col{flex:0 0 240px}
  .proj-reports-grid{grid-template-columns:1fr}
}
.proj-subbadge{display:inline-flex;align-items:center;font-size:10.5px;font-weight:600;color:var(--primary);background:color-mix(in srgb,var(--primary) 7%,transparent);padding:2px 7px;border-radius:6px;border:1px solid color-mix(in srgb,var(--primary) 18%,transparent);margin-left:6px;letter-spacing:0.005em;cursor:default}
.proj-subbadge-orphan{color:var(--text-muted);background:var(--bg-subtle);border-color:var(--border-light)}
.proj-subtask-row{display:grid;grid-template-columns:90px 1fr auto auto 120px 130px;gap:10px;align-items:center;padding:8px 12px;border:1px solid var(--border-light);border-radius:8px;margin-bottom:6px;font-size:12px;cursor:pointer;background:var(--bg-subtle);transition:border-color 0.12s,background 0.12s}
.proj-desc-draft-banner{display:flex;align-items:center;gap:12px;background:var(--warn-bg);border:1px solid color-mix(in srgb,var(--warn) 45%,transparent);border-radius:8px;padding:8px 12px;font-size:12px;color:var(--warn-fg);margin-bottom:10px}
.proj-desc-draft-banner strong{font-weight:600}
.proj-desc-discard{margin-left:auto;font-size:11.5px;padding:4px 10px}
.proj-desc-draft-pill{display:inline-flex;align-items:center;gap:8px;background:var(--warn-bg);border:1px solid color-mix(in srgb,var(--warn) 45%,transparent);border-radius:999px;padding:4px 12px;font-size:11.5px;color:var(--warn-fg);font-weight:500;cursor:pointer;margin-bottom:10px;transition:background 0.12s,border-color 0.12s}
.proj-desc-draft-pill:hover{background:color-mix(in srgb,var(--warn) 16%,transparent);border-color:var(--warn)}
.proj-qa-optional{font-size:10.5px;color:var(--text-muted);font-weight:500;text-transform:none;letter-spacing:0;margin-left:6px}
.proj-storyfb .proj-storyfb-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.proj-storyfb-btn{display:inline-flex;align-items:center;gap:6px;background:var(--card);border:1px solid var(--border);border-radius:8px;padding:6px 12px;font-size:12px;font-weight:500;color:var(--text-secondary);cursor:pointer;font-family:inherit;transition:background 0.12s,border-color 0.12s,color 0.12s}
.proj-storyfb-btn:hover{background:var(--bg-hover);color:var(--text);border-color:var(--primary)}
.proj-storyfb-btn.proj-storyfb-active[data-verdict="clear"]{background:var(--success-bg);border-color:var(--green);color:var(--success-fg)}
.proj-storyfb-btn.proj-storyfb-active[data-verdict="needs_work"]{background:var(--danger-bg);border-color:var(--danger);color:var(--danger-fg)}
.proj-storyfb-check{font-weight:700}
.proj-storyfb-cross{font-weight:700}
.proj-storyfb-state{font-size:11.5px;color:var(--text-muted);font-style:italic;margin-left:4px}
.proj-storyfb-reason{margin-top:10px}
.proj-storyfb-reason textarea{width:100%;min-height:60px;padding:8px 10px;border:1px solid var(--border);border-radius:6px;font-family:inherit;font-size:12.5px;color:var(--text);background:var(--card);resize:vertical}
.proj-storyfb-reason textarea:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 12%,transparent)}
.proj-storyfb-actions{display:flex;gap:8px;margin-top:8px}
.proj-storyfb-save{background:var(--primary);color:#fff;border:0;border-radius:6px;padding:6px 14px;font-size:12px;font-weight:500;cursor:pointer;font-family:inherit}
.proj-storyfb-save:hover{filter:brightness(1.05)}
.proj-storyfb-skip{background:transparent;color:var(--text-muted);border:1px solid var(--border);border-radius:6px;padding:6px 14px;font-size:12px;cursor:pointer;font-family:inherit}
.proj-storyfb-skip:hover{background:var(--bg-hover);color:var(--text)}
.proj-desc-draft-dot{width:8px;height:8px;border-radius:50%;background:var(--warn);display:inline-block;animation:proj-draft-pulse 1.6s ease-in-out infinite}
@keyframes proj-draft-pulse{0%,100%{opacity:1}50%{opacity:0.45}}
.proj-st-edit{cursor:pointer;display:inline-block;border-radius:6px;padding:1px 2px;transition:background 0.12s,box-shadow 0.12s}
.proj-st-edit:hover{background:color-mix(in srgb,var(--primary) 8%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 25%,transparent)}
.proj-st-empty{color:var(--text-muted);font-style:italic;font-size:11px}
.proj-st-assignee{padding:2px 6px}
.proj-st-title-edit{cursor:text}
.proj-st-title-edit:hover{background:color-mix(in srgb,var(--primary) 4%,transparent);border-radius:4px}

/* ---------- Recent activity (May 2026) ---------- */
.proj-recent-list{padding:4px 0}
.proj-recent-row{display:grid;grid-template-columns:8px max-content max-content 76px 1fr auto auto;gap:10px;align-items:center;padding:8px 16px;font-size:12.5px;color:var(--text);cursor:pointer;border-bottom:1px solid var(--border-light);transition:background 0.12s}
.proj-recent-row:hover{background:var(--bg-hover)}
.proj-recent-dot{width:8px;height:8px;border-radius:50%;background:var(--text-muted)}
.proj-recent-bucket-created{background:var(--green)}
.proj-recent-bucket-edited{background:var(--info)}
.proj-recent-bucket-commented{background:var(--purple)}
.proj-recent-bucket-deleted{background:var(--danger)}
.proj-recent-bucket-sprint{background:var(--amber)}
.proj-recent-actor{font-weight:600;color:var(--text)}
.proj-recent-verb{color:var(--text-secondary);font-size:12px}
.proj-recent-key{font-family:'JetBrains Mono','SF Mono',Menlo,monospace;font-size:11px;font-weight:600;color:var(--primary)}
.proj-recent-title{color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.proj-recent-when{font-size:11px;color:var(--text-muted);white-space:nowrap}
.proj-recent-deleted-pill{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.04em;background:var(--danger-bg);color:var(--danger-fg);padding:1px 6px;border-radius:4px}
.proj-recent-ai-pill{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.04em;background:color-mix(in srgb,var(--primary) 10%,transparent);color:var(--primary);padding:1px 6px;border-radius:4px}

/* ---------- Designer Log (May 2026) ---------- */
/* Rows reuse .proj-issue-row from Folders so the structure matches.
   Below are only the small additions: Figma link chip + row ⋯ menu. */
.dlog-figma-link{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border:1px solid var(--border);border-radius:6px;background:var(--card);color:var(--text);font-size:11px;font-weight:500;text-decoration:none;transition:border-color 0.12s,color 0.12s,background 0.12s;cursor:pointer;font-family:inherit;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dlog-figma-link:hover{border-color:var(--primary);color:var(--primary);background:color-mix(in srgb,var(--primary) 4%,transparent)}
.dlog-figma-empty{color:var(--text-muted);border-style:dashed}
.dlog-figma-link svg{flex-shrink:0}
.dlog-icon-btn{background:transparent;border:0;color:var(--text-muted);cursor:pointer;padding:2px 6px;border-radius:5px;font-size:11px;line-height:1}
.dlog-icon-btn:hover{background:var(--bg-hover);color:var(--text)}
.dlog-row-menu{background:transparent;border:0;color:var(--text-muted);font-size:18px;line-height:1;padding:0 6px;border-radius:5px;cursor:pointer}
.dlog-row-menu:hover{background:var(--bg-hover);color:var(--text)}
.dlog-row-menu-pop{position:absolute;background:var(--card);border:1px solid var(--border);border-radius:8px;box-shadow:0 8px 24px rgba(13,17,23,0.12);padding:4px;z-index:200;min-width:180px;display:flex;flex-direction:column}
.dlog-row-menu-pop button{background:transparent;border:0;text-align:left;padding:8px 12px;font-size:12.5px;color:var(--text);font-family:inherit;cursor:pointer;border-radius:6px}
.dlog-row-menu-pop button:hover{background:var(--bg-hover)}

/* Inline Figma URL editor popover */
.dlog-url-pop{position:absolute;background:var(--card);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px rgba(13,17,23,0.14);padding:14px;z-index:210;width:min(380px,calc(100vw - 24px));display:flex;flex-direction:column;gap:8px}
.dlog-url-pop label{font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.04em}
.dlog-url-pop input{padding:8px 10px;border:1px solid var(--border);border-radius:7px;font-size:12.5px;font-family:inherit;background:var(--card);color:var(--text);outline:none}
.dlog-url-pop input:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 10%,transparent)}
.dlog-url-actions{display:flex;justify-content:flex-end;gap:6px;align-items:center}
.dlog-url-actions > span:first-child{margin-right:auto}
.dlog-url-actions .proj-btn-primary, .dlog-url-actions .proj-btn-ghost{padding:5px 12px;font-size:11.5px}

/* Standalone Design Agent chat widget retired May 2026; the merged
   PM Agent floating widget was removed June 2026. dlogOpenAgentChat is
   now a no-op stub. */

/* Design Brief drawer section: tinted card with primary accent, capped
   at a sensible reading width, hard divider after to separate from the
   dev-flavored Description that follows. */
.dlog-drawer-section{background:color-mix(in srgb,var(--primary) 4%,transparent);border:1px solid color-mix(in srgb,var(--primary) 18%,transparent);border-radius:10px;padding:14px 18px;margin-bottom:24px;position:relative}
.dlog-drawer-section + .proj-drawer-section{padding-top:24px;border-top:1px solid var(--border-light)}
.dlog-drawer-section + .proj-drawer-section h4::before{content:'Engineering view · ';color:var(--text-muted);font-weight:500;font-size:10.5px;text-transform:uppercase;letter-spacing:0.05em;display:block;margin-bottom:4px}
.dlog-drawer-head{display:flex;align-items:center;gap:14px;margin-bottom:12px;flex-wrap:wrap}
.dlog-drawer-head h4{margin:0;font-size:11.5px;text-transform:uppercase;letter-spacing:0.06em;color:var(--primary);font-weight:700}
.dlog-drawer-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-left:auto}
.dlog-drawer-thumb{display:block;max-width:100%;max-height:240px;border-radius:8px;border:1px solid var(--border-light);margin-bottom:12px}
.dlog-drawer-brief{font-size:12.5px;line-height:1.55;color:var(--text)}
.dlog-drawer-brief h1, .dlog-drawer-brief h2, .dlog-drawer-brief h3{font-size:11.5px;font-weight:700;margin:18px 0 4px;letter-spacing:0.05em;text-transform:uppercase;color:var(--primary)}
.dlog-drawer-brief h1:first-child, .dlog-drawer-brief h2:first-child, .dlog-drawer-brief h3:first-child{margin-top:0}
.dlog-drawer-brief hr{border:0;border-top:1px dashed color-mix(in srgb,var(--primary) 25%,transparent);margin:14px 0}
.dlog-drawer-brief p, .dlog-drawer-brief ul, .dlog-drawer-brief ol{margin:6px 0}
.dlog-drawer-brief code{background:rgba(0,0,0,0.04);padding:1px 4px;border-radius:3px;font-size:11.5px}
.proj-subtask-row:hover{border-color:var(--primary);background:var(--card)}
.proj-subtask-key{font-family:'JetBrains Mono','SF Mono',Menlo,monospace;font-weight:600;font-size:11px;color:var(--primary)}
.proj-subtask-title{color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.proj-subtask-meta{font-size:10.5px}
.proj-subtask-assignee{font-size:11px;color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.proj-subtask-sprint{font-size:10.5px;color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:right}
.proj-collapse{border:1px solid var(--border-light);border-radius:8px;padding:0;background:var(--bg-subtle)}
.proj-collapse summary{cursor:pointer;list-style:none;padding:10px 14px;font-size:12px;font-weight:600;color:var(--primary);user-select:none;display:flex;align-items:center;gap:6px}
.proj-collapse summary::-webkit-details-marker{display:none}
.proj-collapse summary::before{content:'▸';display:inline-block;transition:transform 0.15s;font-size:10px}
.proj-collapse[open] summary::before{transform:rotate(90deg)}
.proj-collapse summary:hover{color:var(--primary-dark)}
.proj-collapse-cap{display:inline-block}
.proj-collapse[open]{background:var(--card)}
.proj-collapse[open] .proj-activity{padding:4px 14px 14px}
.proj-readonly-hint{font-size:11.5px;color:var(--text-muted);padding:8px 12px;margin-top:8px;border:1px dashed var(--border);border-radius:8px;background:var(--bg-subtle);font-style:italic}

/* Inline-edit controls in the drawer (Phase 3.4) */
.proj-edit-select{font-family:inherit;font-size:12.5px;font-weight:500;color:var(--text);background:var(--card);border:1px solid var(--border);border-radius:6px;padding:4px 8px;cursor:pointer;outline:none;max-width:100%}
.proj-edit-select:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent)}
.proj-edit-select:disabled{opacity:0.55;cursor:not-allowed;background:var(--bg-subtle)}
.proj-edit-input{font-family:inherit;font-size:13px;color:var(--text);background:var(--card);border:1px solid var(--border);border-radius:6px;padding:5px 8px;outline:none;width:100%}
.proj-edit-input:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent)}
.proj-edit-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.proj-edit-pencil{cursor:pointer;color:var(--text-muted);font-size:11px;padding:2px 5px;border-radius:4px;background:transparent;border:0;font-family:inherit;line-height:1}
.proj-edit-pencil:hover{color:var(--primary);background:var(--bg-hover)}
.proj-edit-saving{font-size:10.5px;color:var(--primary);font-weight:600;letter-spacing:0.005em}
.proj-edit-error{font-size:11px;color:var(--red);font-weight:500}
.proj-divergence-banner{display:flex;align-items:center;gap:10px;padding:10px 14px;background:var(--warn-bg);border:1px solid color-mix(in srgb,var(--warn) 45%,transparent);color:var(--warn-fg);border-radius:8px;font-size:12px;margin:0 24px 14px;font-weight:500}
.proj-assignee-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 10px 3px 8px;background:color-mix(in srgb,var(--primary) 7%,transparent);border:1px solid color-mix(in srgb,var(--primary) 18%,transparent);border-radius:999px;font-size:11.5px;color:var(--primary);font-weight:500}
.proj-assignee-chip-x{cursor:pointer;color:var(--text-muted);font-weight:600;font-size:13px;line-height:1;padding:0 2px}
.proj-assignee-chip-x:hover{color:var(--red)}
.proj-label-chip{display:inline-flex;align-items:center;gap:5px;padding:2px 8px 2px 8px;background:var(--bg-subtle);border:1px solid var(--border);border-radius:6px;font-size:11px;color:var(--text);font-weight:500}
.proj-label-chip-x{cursor:pointer;color:var(--text-muted);font-size:13px;line-height:1}
.proj-label-chip-x:hover{color:var(--red)}
.proj-add-pill{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;background:transparent;border:1px dashed var(--border);border-radius:999px;font-size:11px;color:var(--text-muted);cursor:pointer;font-family:inherit;font-weight:500}
.proj-add-pill:hover{border-color:var(--primary);color:var(--primary);background:color-mix(in srgb,var(--primary) 4%,transparent)}
.proj-popover{position:absolute;background:var(--card);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px rgba(13,17,23,0.14),0 2px 8px rgba(13,17,23,0.06);z-index:200;min-width:240px;max-width:340px;max-height:280px;overflow-y:auto;padding:6px}
.proj-popover input{width:100%;border:0;border-bottom:1px solid var(--border-light);padding:7px 8px;outline:none;font-family:inherit;font-size:12.5px;background:transparent;color:var(--text);margin-bottom:4px}
.proj-popover-row{padding:7px 10px;border-radius:6px;cursor:pointer;font-size:12.5px;color:var(--text);display:flex;align-items:center;gap:8px}
.proj-popover-row:hover,.proj-popover-row.active{background:var(--bg-hover)}
.proj-popover-row-meta{font-size:10.5px;color:var(--text-muted);margin-left:auto}
.proj-popover-empty{padding:10px;color:var(--text-muted);font-size:11.5px;text-align:center;font-style:italic}
.proj-desc-edit{position:relative}
/* Auto-growing description editor. Starts compact (~140px) and grows
   with content via the projAutoGrowTextarea handler so the Save button
   below stays in view without scrolling. */
.proj-desc-edit textarea{width:100%;min-height:140px;max-height:none;border:1px solid var(--border);border-radius:0 0 10px 10px;padding:14px 16px;font-family:inherit;font-size:14px;line-height:1.65;color:var(--text);background:var(--card);resize:none;outline:none;border-top:0;box-sizing:border-box;overflow:hidden}
.proj-desc-edit textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent);border-top-color:var(--primary)}
.proj-desc-actions{display:flex;gap:8px;margin-top:8px;align-items:center}
.proj-btn-primary{background:var(--primary);color:#fff;border:0;padding:7px 14px;border-radius:8px;font-size:12.5px;font-weight:600;cursor:pointer;font-family:inherit;letter-spacing:0.005em}
.proj-btn-primary:hover{background:var(--primary-dark)}
.proj-btn-primary:disabled{opacity:0.55;cursor:not-allowed}
.proj-btn-ghost{background:transparent;color:var(--text-secondary);border:1px solid var(--border);padding:7px 14px;border-radius:8px;font-size:12.5px;font-weight:600;cursor:pointer;font-family:inherit}
.proj-btn-ghost:hover{background:var(--bg-hover);color:var(--text)}
.proj-md-hint{font-size:10.5px;color:var(--text-muted);font-style:italic}
.proj-comment-composer{margin-top:14px;position:relative}
.proj-comment-composer textarea{width:100%;min-height:80px;display:block;box-sizing:border-box;border:1px solid var(--border);border-top:0;border-bottom-left-radius:10px;border-bottom-right-radius:10px;padding:12px 14px;outline:none;font-family:inherit;font-size:13px;line-height:1.5;color:var(--text);background:var(--card);resize:vertical}
.proj-comment-composer textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent);border-top-color:var(--primary)}
.proj-comment-composer textarea::placeholder{color:var(--text-muted)}
.proj-comment-composer-actions{display:flex;justify-content:space-between;align-items:center;margin-top:10px}

/* Editor toolbar shared by description and comment composers */
.proj-editor-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:2px;padding:6px 10px;background:var(--card);border:1px solid var(--border);border-bottom:0;border-top-left-radius:10px;border-top-right-radius:10px}
.proj-editor-toolbar + textarea{border-top-left-radius:0!important;border-top-right-radius:0!important;border-top:0!important;background:var(--card)!important}
.proj-tb-btn{font-family:inherit;font-size:13px;background:transparent;border:0;padding:6px 9px;border-radius:6px;cursor:pointer;color:var(--text);min-width:32px;height:30px;line-height:1;display:inline-flex;align-items:center;justify-content:center;transition:background 0.12s,color 0.12s}
.proj-tb-btn:hover{background:var(--bg-subtle);color:var(--primary)}
.proj-tb-btn:active{background:var(--bg-hover)}
.proj-tb-btn svg{width:15px;height:15px;display:block}
.proj-tb-sep{width:1px;height:18px;background:var(--border-light);margin:0 6px;flex-shrink:0}

/* Rendered markdown media (description + comments) */
/* Inline media: keep thumbnails small/medium so a description doesn't
   become a wall of pictures. Click to open the full-size lightbox. */
.proj-md-image{max-width:360px;max-height:240px;width:auto;height:auto;border-radius:8px;border:1px solid var(--border-light);margin:8px 0;display:block;cursor:zoom-in;transition:box-shadow 0.15s ease}
.proj-md-image:hover{box-shadow:0 6px 20px rgba(13,17,23,0.12)}
.proj-md-video{max-width:480px;width:100%;border-radius:8px;border:1px solid var(--border-light);margin:8px 0;display:block;background:#000}

/* Description readonly preview hover affordance */
.proj-desc-readonly{cursor:pointer;padding:10px 12px;border:1px solid transparent;border-radius:8px;transition:background 0.12s,border-color 0.12s}
.proj-desc-readonly:hover{background:var(--bg-subtle);border-color:var(--border-light)}

/* Lightbox for click-to-expand on inline images */
.proj-lightbox-bd{position:fixed;inset:0;background:rgba(13,17,23,0.85);z-index:9999;display:flex;align-items:center;justify-content:center;cursor:zoom-out;animation:proj-lb-fade 0.15s ease}
@keyframes proj-lb-fade{from{opacity:0}to{opacity:1}}
.proj-lightbox-bd img{max-width:92vw;max-height:92vh;border-radius:6px;box-shadow:0 30px 80px rgba(16,24,40,0.4)}
.proj-lightbox-close{position:absolute;top:18px;right:24px;width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,0.1);color:#fff;border:0;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center}
.proj-lightbox-close:hover{background:rgba(255,255,255,0.2)}
.proj-jira-attachment{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;background:var(--bg-subtle);border:1px dashed var(--border);border-radius:6px;font-size:11.5px;color:var(--text-muted);font-style:italic}
.proj-jira-attachment-block{display:flex;padding:14px 16px;margin:8px 0;font-size:12px}

/* Create-issue modal (Phase 3.6) */
.proj-create-modal{position:fixed;inset:0;z-index:130;display:flex;align-items:center;justify-content:center;padding:24px}
.proj-create-overlay{position:absolute;inset:0;background:rgba(13,17,23,0.45)}
.proj-create-card{position:relative;background:var(--card);border:1px solid var(--border);border-radius:14px;width:min(880px,100%);max-height:calc(100vh - 48px);box-shadow:0 24px 48px rgba(13,17,23,0.18);display:flex;flex-direction:column;overflow:hidden}

/* Issue upload zone — drag/drop or click-to-pick. Thumbnails preview
   inline under Description so a user can see what they're attaching
   before they submit. */
.proj-upload-zone{border:1.5px dashed var(--border);border-radius:10px;padding:18px;text-align:center;color:var(--text-muted);font-size:12.5px;cursor:pointer;transition:background 0.15s,border-color 0.15s,color 0.15s;background:var(--bg-subtle)}
.proj-upload-zone:hover{border-color:var(--primary);color:var(--primary);background:color-mix(in srgb,var(--primary) 4%,transparent)}
.proj-upload-zone.dragover{border-color:var(--primary);background:color-mix(in srgb,var(--primary) 8%,transparent);color:var(--primary)}
.proj-upload-zone-cta{font-weight:600;color:var(--text)}
.proj-upload-zone-hint{font-size:11px;color:var(--text-muted);margin-top:4px}
.proj-upload-thumbs{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;margin-top:10px}
.proj-upload-thumbs:empty{display:none}
.proj-upload-thumb{position:relative;border:1px solid var(--border-light);border-radius:8px;overflow:hidden;background:var(--bg-subtle);aspect-ratio:4/3;display:flex;align-items:center;justify-content:center}
.proj-upload-thumb img,.proj-upload-thumb video{width:100%;height:100%;object-fit:cover;display:block}
.proj-upload-thumb-meta{position:absolute;bottom:0;left:0;right:0;padding:4px 6px;background:linear-gradient(transparent,rgba(0,0,0,0.65));color:#fff;font-size:10.5px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.proj-upload-thumb-remove{position:absolute;top:4px;right:4px;width:22px;height:22px;border-radius:50%;background:rgba(13,17,23,0.7);color:#fff;border:0;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:13px;line-height:1;padding:0;transition:background 0.12s}
.proj-upload-thumb-remove:hover{background:var(--danger)}
.proj-upload-thumb-progress{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(13,17,23,0.65);color:#fff;font-size:11px;font-weight:600}
.proj-create-head{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--border-light)}
.proj-create-head h3{font-size:22px;font-weight:700;color:var(--text);margin:0;letter-spacing:-0.015em;line-height:1.2}
.proj-create-body{padding:18px 22px;overflow-y:auto;display:flex;flex-direction:column;gap:8px}
.proj-create-row{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:6px}
.proj-create-label{font-size:11px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-top:8px;display:block}
.proj-create-foot{display:flex;align-items:center;padding:14px 22px;border-top:1px solid var(--border-light);background:var(--bg-subtle);gap:10px}
.proj-activity{font-size:12px;color:var(--text-secondary);line-height:1.5;display:flex;flex-direction:column;gap:6px}
.proj-activity-row{padding:6px 0;border-bottom:1px dashed var(--border-light)}
.proj-activity-row:last-child{border-bottom:0}
.proj-activity-row strong{color:var(--text);font-weight:600}
.proj-empty-line{color:var(--text-muted);font-size:12px;font-style:italic}

.tv2-shell{display:flex;flex-direction:column;gap:22px;padding:0 4px}
.tv2-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap;padding:4px 0 0}
.tv2-head-left h2{font-size:28px;font-weight:700;color:var(--text);letter-spacing:-0.015em;margin:0;text-wrap:balance}
.tv2-head-left p{font-size:13px;color:var(--text-secondary);margin:6px 0 0;line-height:1.5;max-width:62ch}
.tv2-head-actions{display:flex;gap:8px;align-items:center}
.tv2-btn{padding:9px 16px;border-radius:var(--radius-pill);font-size:12px;font-weight:600;cursor:pointer;transition:all var(--duration-base) var(--ease-out);font-family:inherit}
.tv2-btn-ghost{background:transparent;border:1px solid var(--border);color:var(--text-secondary)}
.tv2-btn-ghost:hover{background:var(--bg-hover);color:var(--text);border-color:var(--primary-100)}
.tv2-btn-primary{background:var(--primary);border:1px solid var(--primary);color:#fff}
.tv2-btn-primary:hover{background:var(--primary-dark);border-color:var(--primary-dark)}
.tv2-btn:focus-visible{outline:none;box-shadow:var(--ring-primary)}

/* ============================================================
   CANONICAL BUTTON PRIMITIVES (2026-06-10) — .uo-btn family.
   Modeled exactly on the tv2 button family above. New code should
   use these instead of inventing another per-panel *-btn family.
   ============================================================ */
.uo-btn{padding:9px 16px;border-radius:var(--radius-pill);font-size:12px;font-weight:600;cursor:pointer;transition:all var(--duration-base) var(--ease-out);font-family:inherit;display:inline-flex;align-items:center;gap:6px}
.uo-btn-primary{background:var(--primary);border:1px solid var(--primary);color:#fff}
.uo-btn-primary:hover{background:var(--primary-dark);border-color:var(--primary-dark)}
.uo-btn-ghost{background:transparent;border:1px solid var(--border);color:var(--text-secondary)}
.uo-btn-ghost:hover{background:var(--bg-hover);color:var(--text);border-color:var(--primary-100)}
.uo-btn-danger{background:transparent;border:1px solid var(--red);color:var(--red)}
.uo-btn-danger:hover{background:var(--red-light)}
.uo-btn-sm{padding:6px 12px;font-size:12px}
.uo-btn:focus-visible{outline:none;box-shadow:var(--ring-primary)}
.uo-btn:disabled{opacity:0.5;cursor:not-allowed}

/* KPI strip — glass tiles */
.tv2-kpi-strip{display:grid;grid-template-columns:repeat(5,1fr);gap:14px}
.tv2-kpi{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--bg-glass-border);
  box-shadow:0 4px 24px rgba(16,24,40,0.06),0 1px 0 rgba(255,255,255,0.6) inset;
  border-radius:var(--radius-xl);
  padding:20px 22px;
  transition:box-shadow var(--duration-base) var(--ease-out),border-color var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out);
  position:relative;
}
.tv2-kpi:hover{box-shadow:0 8px 32px rgba(16,24,40,0.1),0 1px 0 rgba(255,255,255,0.8) inset;border-color:var(--primary-100);transform:translateY(-1px)}
.tv2-kpi-label{font-size:10px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.08em;margin-bottom:10px}
.tv2-kpi-value{font-size:30px;font-weight:700;color:var(--text);letter-spacing:-0.02em;line-height:1}
.tv2-kpi-meta{font-size:11px;color:var(--text-secondary);margin-top:8px}
.tv2-kpi-accent{color:var(--primary)}
.tv2-kpi-warn{color:var(--red)}
.tv2-kpi-good{color:var(--green)}

/* Two-column main */
.tv2-main{display:grid;grid-template-columns:minmax(0,2.1fr) minmax(0,1fr);gap:20px;align-items:flex-start}
.tv2-canvas{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--bg-glass-border);
  box-shadow:0 4px 24px rgba(16,24,40,0.06);
  border-radius:var(--radius-xl);
  padding:28px;
  min-height:400px;
}
.tv2-canvas-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px;padding-bottom:14px;border-bottom:1px solid var(--border-light)}
.tv2-canvas-title{font-size:15px;font-weight:700;color:var(--text);letter-spacing:-0.01em}
.tv2-canvas-sub{font-size:11px;color:var(--text-muted);margin-top:2px}
.tv2-filter{display:flex;gap:4px;background:var(--bg-subtle);border-radius:var(--radius-pill);padding:3px}
.tv2-filter-btn{padding:6px 14px;border-radius:var(--radius-pill);font-size:11px;font-weight:600;color:var(--text-secondary);background:transparent;border:none;cursor:pointer;transition:all var(--duration-fast) var(--ease-out);font-family:inherit}
.tv2-filter-btn:hover{color:var(--text)}
.tv2-filter-btn.active{background:var(--bg-card);color:var(--primary);box-shadow:var(--shadow-sm)}

/* Hierarchy — clean grid sections, no tree */
.tv2-tree{display:flex;flex-direction:column;gap:28px}
.tv2-section{display:flex;flex-direction:column;gap:14px}
.tv2-section-head{display:flex;align-items:center;gap:10px;padding-bottom:6px;border-bottom:1px solid var(--border-light)}
.tv2-section-label{font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.12em}
.tv2-section-count{font-size:10px;font-weight:700;color:var(--primary);background:var(--sky-tint);padding:3px 8px;border-radius:var(--radius-pill);font-variant-numeric:tabular-nums}
.tv2-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:14px}
.tv2-grid--root{grid-template-columns:repeat(auto-fill,minmax(280px,420px));justify-content:center}

.tv2-node{
  background:var(--bg-card);
  border:1px solid var(--border-light);
  box-shadow:var(--shadow-sm);
  border-radius:var(--radius-xl);
  padding:18px 16px;
  cursor:pointer;
  transition:box-shadow var(--duration-base) var(--ease-out),border-color var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out);
  position:relative;
  text-align:center;
  font-family:inherit;
}
.tv2-node:hover{box-shadow:var(--shadow-md);border-color:var(--primary-100);transform:translateY(-2px)}
.tv2-node:focus-visible{outline:none;box-shadow:var(--ring-primary)}
/* Selected: only ring + border. Never override background — that breaks white text on the navy Founder card. */
.tv2-node.is-selected{border-color:var(--primary);box-shadow:0 0 0 3px var(--sky-tint),0 6px 20px rgba(16,24,40,0.1)}
.tv2-node.is-selected.tv2-node--root{box-shadow:0 0 0 3px color-mix(in srgb,var(--sky) 55%,transparent),0 8px 24px color-mix(in srgb,var(--primary) 25%,transparent)}
.tv2-node--root{background:linear-gradient(135deg,#0056A4 0%,#003875 100%);color:#fff;border-color:rgba(255,255,255,0.2);min-height:120px}
.tv2-node--root .tv2-node-name{color:#fff}
.tv2-node--root .tv2-node-role{color:rgba(255,255,255,0.8)}
.tv2-node--root .tv2-node-meta{color:rgba(255,255,255,0.85)}
.tv2-node--root .tv2-node-tag{background:rgba(255,255,255,0.18);color:#fff}
.tv2-node--root .tv2-node-avatar{background:rgba(255,255,255,0.18);color:#fff;box-shadow:0 0 0 2px rgba(255,255,255,0.25)}
.tv2-node-avatar{width:48px;height:48px;border-radius:50%;margin:0 auto 10px;background:var(--bg-subtle);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px;color:var(--text-secondary);position:relative;overflow:hidden}
.tv2-node-avatar img{width:100%;height:100%;object-fit:cover}
.tv2-node--agent .tv2-node-avatar{background:var(--primary-50);color:var(--primary);box-shadow:0 0 0 2px var(--sky-tint)}
.tv2-node-name{font-size:13px;font-weight:700;color:var(--text);letter-spacing:-0.01em;line-height:1.3}
.tv2-node-role{font-size:11px;color:var(--text-muted);margin-top:3px;line-height:1.4}
.tv2-node-meta{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:10px;font-size:10px;color:var(--text-secondary);font-weight:600}
.tv2-node-tag{font-size:11px;font-weight:700;color:var(--primary);background:var(--sky-tint);padding:3px 8px;border-radius:var(--radius-pill);text-transform:uppercase;letter-spacing:0.06em;display:inline-block;margin-bottom:8px}
.tv2-node--agent .tv2-node-tag{color:#fff;background:var(--primary)}

/* Pulse dot — sky breathing */
.tv2-pulse{width:8px;height:8px;border-radius:50%;background:var(--sky);position:relative;flex-shrink:0;display:inline-block}
.tv2-pulse::after{content:'';position:absolute;inset:-4px;border-radius:50%;border:2px solid var(--sky);opacity:0;animation:tv2-pulse-anim 1.6s var(--ease-out) infinite}
.tv2-pulse--idle{background:var(--text-muted)}
.tv2-pulse--idle::after{display:none}
.tv2-pulse--blocked{background:var(--red)}
.tv2-pulse--blocked::after{border-color:var(--red)}
.tv2-pulse--thriving{background:var(--green)}
.tv2-pulse--thriving::after{border-color:var(--green)}
@keyframes tv2-pulse-anim{
  0%{transform:scale(0.85);opacity:0.7}
  70%{transform:scale(1.6);opacity:0}
  100%{transform:scale(1.6);opacity:0}
}
@media(prefers-reduced-motion:reduce){
  .tv2-pulse::after{animation:none}
  .tv2-node,.tv2-kpi,.tv2-btn,.tv2-filter-btn{transition:none}
}

/* Right rail — glass */
.tv2-rail{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--bg-glass-border);
  box-shadow:0 4px 24px rgba(16,24,40,0.06),0 1px 0 rgba(255,255,255,0.6) inset;
  border-radius:var(--radius-xl);
  padding:24px;
  min-height:400px;
  position:sticky;
  top:14px;
}
.tv2-rail-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;height:100%;min-height:340px;color:var(--text-muted);padding:0 16px}
.tv2-rail-empty-icon{width:42px;height:42px;border-radius:50%;background:var(--bg-subtle);display:flex;align-items:center;justify-content:center;margin-bottom:14px;color:var(--text-muted)}
.tv2-rail-empty-title{font-size:14px;font-weight:600;color:var(--text-secondary);margin-bottom:6px}
.tv2-rail-empty-text{font-size:12px;line-height:1.5;max-width:28ch}
.tv2-rail-head{display:flex;align-items:flex-start;gap:14px;padding-bottom:18px;border-bottom:1px solid var(--border-light);margin-bottom:18px}
.tv2-rail-avatar{width:56px;height:56px;border-radius:50%;background:var(--primary-50);display:flex;align-items:center;justify-content:center;font-weight:700;color:var(--primary);font-size:18px;flex-shrink:0;overflow:hidden}
.tv2-rail-avatar img{width:100%;height:100%;object-fit:cover}
.tv2-rail-title{font-size:18px;font-weight:700;color:var(--text);letter-spacing:-0.015em;line-height:1.25}
.tv2-rail-role{font-size:12px;color:var(--text-muted);margin-top:3px}
.tv2-rail-status{display:flex;align-items:center;gap:6px;margin-top:8px;font-size:11px;color:var(--text-secondary);font-weight:600}
.tv2-rail-section{margin-bottom:18px}
.tv2-rail-section-title{font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.1em;margin-bottom:10px}
.tv2-rail-row{display:flex;justify-content:space-between;align-items:center;padding:9px 0;border-bottom:1px solid var(--border-light);font-size:12px;gap:10px}
.tv2-rail-row:last-child{border-bottom:none}
.tv2-rail-key{color:var(--text-secondary);font-weight:500;flex-shrink:0}
.tv2-rail-val{color:var(--text);font-weight:600;text-align:right}
.tv2-rail-checkin{padding:10px 12px;background:var(--bg-subtle);border-radius:var(--radius-md);margin-bottom:8px;border:1px solid var(--border-light)}
.tv2-rail-checkin--thriving{border-left-color:var(--green)}
.tv2-rail-checkin--blocked{border-left-color:var(--red)}
.tv2-rail-checkin--ok{border-left-color:var(--amber)}
.tv2-rail-checkin-meta{display:flex;justify-content:space-between;font-size:10px;color:var(--text-muted);margin-bottom:4px;text-transform:uppercase;letter-spacing:0.05em;font-weight:600}
.tv2-rail-checkin-text{font-size:12px;color:var(--text);line-height:1.5}
.tv2-rail-actions{display:flex;gap:8px;margin-top:18px;padding-top:18px;border-top:1px solid var(--border-light)}

/* Schedule chips inside agent rail */
.tv2-sched-list{display:flex;flex-wrap:wrap;gap:6px}
.tv2-sched-chip{font-size:11px;font-weight:600;color:var(--primary);background:var(--sky-glass);padding:5px 10px;border-radius:var(--radius-pill);font-variant-numeric:tabular-nums}

/* Pulse heatmap (bottom) — glass */
.tv2-pulse-card{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--bg-glass-border);
  box-shadow:0 4px 24px rgba(16,24,40,0.06),0 1px 0 rgba(255,255,255,0.6) inset;
  border-radius:var(--radius-xl);
  padding:26px 28px;
}
.tv2-pulse-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}
.tv2-pulse-title{font-size:13px;font-weight:700;color:var(--text)}
.tv2-pulse-sub{font-size:11px;color:var(--text-muted);margin-top:2px}
.tv2-pulse-grid{display:grid;grid-template-columns:80px 1fr;gap:14px;align-items:center}
.tv2-pulse-row-label{font-size:11px;font-weight:600;color:var(--text-secondary)}
.tv2-pulse-row{display:contents}
.tv2-pulse-bar{display:flex;gap:4px;height:32px}
.tv2-pulse-cell{flex:1;border-radius:var(--radius-sm);background:var(--bg-subtle);min-width:14px;transition:transform var(--duration-fast) var(--ease-out);cursor:default}
.tv2-pulse-cell:hover{transform:scaleY(1.1)}
.tv2-pulse-cell--low{background:var(--sky-glass)}
.tv2-pulse-cell--med{background:color-mix(in srgb,var(--sky) 45%,transparent)}
.tv2-pulse-cell--high{background:var(--sky)}
.tv2-pulse-cell--top{background:var(--primary)}
.tv2-pulse-day{font-size:10px;color:var(--text-muted);text-align:center;font-weight:600;text-transform:uppercase;letter-spacing:0.06em}
.tv2-pulse-days{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin-top:8px;padding-left:94px}

/* Responsive — 4 breakpoints */
@media(max-width:1440px){
  .tv2-canvas{padding:22px}
}
@media(max-width:1024px){
  .tv2-main{grid-template-columns:1fr}
  .tv2-rail{position:static;min-height:auto}
  .tv2-kpi-strip{grid-template-columns:repeat(3,1fr)}
  .tv2-kpi-strip .tv2-kpi:nth-child(n+4){grid-column:span 1}
}
@media(max-width:768px){
  /* Tighter page padding on tablets/phones */
  .tab-panel{padding:18px}
  /* Pagehead title scales down on mobile */
  .uo-pagehead-title{font-size:20px}
  .uo-pagehead-actions{width:100%}
  .uo-pagehead-actions .tv2-btn{flex:1 1 auto}
  .tv2-head-left h2{font-size:22px}
  .tv2-kpi-strip{grid-template-columns:repeat(2,1fr)}
  .tv2-canvas{padding:18px}
  .tv2-tier{gap:10px}
  .tv2-node{min-width:140px;max-width:100%;flex:1 1 calc(50% - 10px)}
  .tv2-pulse-grid{grid-template-columns:60px 1fr;gap:10px}
  .tv2-pulse-days{padding-left:74px}
  /* Glass section cards compact */
  .cp-glass-card{padding:18px 18px;margin-bottom:16px}
  .cp-glass-head{margin-bottom:12px}
  .cp-glass-title{font-size:13px}
  /* Settings cards same compact */
  .settings-card{padding:18px}
  /* Brand panes */
  .bv2-pane{padding:18px}
  /* Section gap tighter */
  .tv2-shell{gap:18px}
}
@media(max-width:480px){
  .tab-panel{padding:14px}
  .uo-pagehead{flex-direction:column;align-items:flex-start;gap:10px}
  .uo-pagehead-title{font-size:18px;letter-spacing:-0.01em}
  .uo-pagehead-actions{flex-direction:row;width:100%;flex-wrap:wrap}
  .uo-pagehead-actions .tv2-btn{min-height:44px;flex:1 1 auto}
  .tv2-kpi-strip{grid-template-columns:repeat(2,1fr);gap:10px}
  .tv2-kpi{padding:14px 14px}
  .tv2-kpi-value{font-size:22px}
  .tv2-kpi-label{font-size:11px}
  .tv2-grid{grid-template-columns:1fr}
  .tv2-grid--root{grid-template-columns:1fr}
  .tv2-node{max-width:100%;min-width:0;width:100%}
  .tv2-btn{padding:11px 18px;min-height:44px}
  .cp-glass-card{padding:16px;margin-bottom:14px;border-radius:var(--radius-lg)}
  .cp-glass-head{flex-direction:column;align-items:flex-start;gap:6px}
  .settings-card{padding:16px}
  .bv2-pane{padding:16px}
  .tv2-shell{gap:14px}
  .tv2-filter-btn{padding:8px 14px;min-height:36px}
  .tv2-rail-actions{flex-direction:column}
  .tv2-rail-actions .tv2-btn{width:100%}
}

/* ============================================================
   MODERN MODAL — form-field styles for content inside .tv2-modal
   ============================================================
   ROOT-CAUSE FIX 2026-04-30: removed the OLD ".tv2-modal{background:rgba
   (255,255,255,0.95) !important; border-radius:var(--radius-3xl) !important;
   ...}" block. It treated .tv2-modal as the modal CARD itself (a single-
   element design where the same div was both overlay and card). The newer
   tv2-modal pattern (overlay = .tv2-modal, card = .tv2-modal-card) lives
   at lines ~2199+. The old !important flags overrode the new overlay
   styling, rendering every modal as a 95%-opaque white viewport sheet —
   exactly the "completely shutting me off" symptom Hamza flagged. The
   .tv2-modal-header rules + .tv2-modal-body rule below were also removed
   because the new markup uses .tv2-modal-head/body/foot inside .tv2-modal-
   card, not directly under .tv2-modal.
   What's preserved below: form-field styles. Inputs/selects/textareas inside
   .tv2-modal still inherit consistent design-system styling regardless of
   inner structure. */

.tv2-field label{font-size:11px !important;font-weight:600 !important;color:var(--text-muted) !important;text-transform:uppercase !important;letter-spacing:0.06em !important;margin-bottom:8px !important;display:block !important}
.tv2-field label .req{color:var(--red)}
.tv2-input,.tv2-modal input[type="text"],.tv2-modal input[type="email"],.tv2-modal input[type="url"],.tv2-modal input[type="date"],.tv2-modal input[type="number"],.tv2-modal select,.tv2-modal textarea{
  width:100% !important;
  padding:11px 14px !important;
  border:1px solid var(--border) !important;
  border-radius:var(--radius-lg) !important;
  background:var(--bg-card) !important;
  color:var(--text) !important;
  font-size:13px !important;
  font-family:'DM Sans','Inter',system-ui,-apple-system,sans-serif !important;
  transition:border-color var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out) !important;
  box-sizing:border-box !important;
}
.tv2-modal input:focus,.tv2-modal select:focus,.tv2-modal textarea:focus{
  outline:none !important;
  border-color:var(--primary) !important;
  box-shadow:var(--ring-primary) !important;
}
.tv2-modal input::placeholder,.tv2-modal textarea::placeholder{color:var(--text-muted) !important;opacity:0.7}
.tv2-modal textarea{resize:vertical !important;min-height:64px !important;line-height:1.5}
.tv2-help{font-size:11px;color:var(--text-muted);margin-top:6px;line-height:1.4}

.tv2-modal-actions{
  display:flex !important;
  justify-content:flex-end;
  gap:10px !important;
  padding:18px 28px !important;
  border-top:1px solid var(--border-light) !important;
  background:var(--bg-subtle) !important;
  flex-shrink:0 !important;
}
.tv2-modal-actions .tv2-btn-danger{margin-right:auto;color:var(--red);border:1px solid var(--red);background:transparent}
.tv2-modal-actions .tv2-btn-danger:hover{background:var(--red-light)}

/* Active toggle row inside modal */
.tv2-toggle-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:14px 16px;
  background:var(--bg-subtle);
  border-radius:var(--radius-lg);
  border:1px solid var(--border-light);
}
.tv2-toggle-row-info > div:first-child{font-size:13px;font-weight:600;color:var(--text);margin-bottom:2px}
.tv2-toggle-row-info > div:last-child{font-size:11px;color:var(--text-muted);line-height:1.4;max-width:42ch}

/* Form error banner */
.tv2-form-error{
  font-size:12px;
  color:var(--red);
  padding:10px 14px;
  background:var(--red-light);
  border-radius:var(--radius-lg);
  border:1px solid color-mix(in srgb,var(--red) 20%,transparent);
}

/* Compact iOS-style toggle for tv2 rail rows. */
.tv2-toggle{position:relative;display:inline-block;width:36px;height:20px;flex-shrink:0;cursor:pointer}
.tv2-toggle input{opacity:0;width:0;height:0;position:absolute;margin:0}
.tv2-toggle-slider{position:absolute;inset:0;background:#d1d5db;border-radius:20px;transition:background var(--duration-fast) var(--ease-out)}
.tv2-toggle-slider::before{content:'';position:absolute;height:14px;width:14px;left:3px;top:3px;background:var(--bg-card);border-radius:50%;transition:transform var(--duration-fast) var(--ease-out);box-shadow:0 1px 3px rgba(16,24,40,0.15)}
.tv2-toggle input:checked+.tv2-toggle-slider{background:var(--primary)}
.tv2-toggle input:checked+.tv2-toggle-slider::before{transform:translateX(16px)}

/* ============================================================
   DASHBOARD COCKPIT — success metrics, tab cards, sprint bar
   ============================================================ */
.cp-shell{display:flex;flex-direction:column;gap:22px;margin-bottom:24px}
.cp-success-strip{display:grid;grid-template-columns:repeat(5,1fr);gap:14px}
.cp-success-tile{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--bg-glass-border);
  box-shadow:0 4px 24px rgba(16,24,40,0.06),0 1px 0 rgba(255,255,255,0.6) inset;
  border-radius:var(--radius-xl);
  padding:18px 20px;
  position:relative;
  overflow:hidden;
}
.cp-success-label{font-size:10px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.08em;margin-bottom:8px}
.cp-success-value{font-size:28px;font-weight:700;color:var(--text);letter-spacing:-0.02em;line-height:1.1;font-variant-numeric:tabular-nums}
.cp-success-meta{font-size:11px;color:var(--text-secondary);margin-top:6px;line-height:1.4}
.cp-success-trend{display:inline-flex;align-items:center;gap:3px;font-size:11px;font-weight:600;margin-top:8px;font-variant-numeric:tabular-nums}
.cp-success-trend--up{color:var(--green)}
.cp-success-trend--down{color:var(--red)}
.cp-success-trend--flat{color:var(--text-muted)}
.cp-pending{
  position:absolute;
  top:14px;right:14px;
  font-size:11px;
  font-weight:700;
  color:var(--amber);
  background:var(--amber-light);
  padding:3px 8px;
  border-radius:var(--radius-pill);
  text-transform:uppercase;
  letter-spacing:0.06em;
}

/* .cp-sprint* removed 2026-06-10 — dead since the sprint card moved into the cockpit grid. */
.cp-tab-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}
.cp-tab-card{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--bg-glass-border);
  box-shadow:0 4px 24px rgba(16,24,40,0.06),0 1px 0 rgba(255,255,255,0.6) inset;
  border-radius:var(--radius-xl);
  padding:18px 20px;
  cursor:pointer;
  transition:box-shadow var(--duration-base) var(--ease-out),border-color var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out);
  text-align:left;
  font-family:inherit;
  display:flex;
  flex-direction:column;
  gap:8px;
  min-height:130px;
}
.cp-tab-card:hover{box-shadow:0 8px 32px rgba(16,24,40,0.1);border-color:var(--primary-100);transform:translateY(-2px)}
.cp-tab-card-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.cp-tab-card-icon{width:34px;height:34px;border-radius:var(--radius-md);background:var(--sky-tint);color:var(--primary);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.cp-tab-card-arrow{font-size:18px;color:var(--text-muted);line-height:1;transition:transform var(--duration-fast) var(--ease-out)}
.cp-tab-card:hover .cp-tab-card-arrow{transform:translateX(4px);color:var(--primary)}
.cp-tab-card-title{font-size:13px;font-weight:700;color:var(--text);letter-spacing:-0.005em}
.cp-tab-card-value{font-size:22px;font-weight:700;color:var(--text);letter-spacing:-0.015em;line-height:1;font-variant-numeric:tabular-nums}
.cp-tab-card-sub{font-size:11px;color:var(--text-muted);line-height:1.4;margin-top:auto}

/* DASHBOARD ZONES (2026-06-10) — three differentiated bands replace the old
   uniform 8-card grid: Today (queue chips) / Money & funnel / Agents. */
.cp-zone{display:flex;flex-direction:column;gap:14px}
.cp-zone .section-title{margin-bottom:0}
.cp-zone .cp-glass-card{margin-bottom:0}
/* Zone A — compact horizontal queue chips, visually distinct from KPI tiles:
   row layout, bg-card surface, navy left accent, no glass. */
.cp-today-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.cp-today-chip{
  display:flex;align-items:flex-start;gap:11px;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-left:3px solid var(--primary);
  border-radius:var(--radius-lg);
  padding:12px 14px;
  cursor:pointer;text-align:left;font-family:inherit;
  box-shadow:var(--shadow-sm);
  transition:box-shadow var(--duration-base) var(--ease-out),border-color var(--duration-base) var(--ease-out),transform var(--duration-base) var(--ease-out);
}
.cp-today-chip:hover{box-shadow:var(--shadow-md);border-color:var(--primary-100);border-left-color:var(--primary);transform:translateY(-1px)}
.cp-today-chip-icon{width:28px;height:28px;border-radius:var(--radius-md);background:var(--sky-tint);color:var(--primary);display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:1px}
.cp-today-chip-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.cp-today-chip-top{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.cp-today-chip-label{font-size:11px;font-weight:700;color:var(--text-secondary);text-transform:uppercase;letter-spacing:0.05em}
.cp-today-chip-value{font-size:16px;font-weight:700;color:var(--text);letter-spacing:-0.01em;font-variant-numeric:tabular-nums;white-space:nowrap}
.cp-today-chip-sub{font-size:11px;color:var(--text-muted);line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cp-today-bar{margin-top:5px;height:5px;background:var(--bg-subtle);border-radius:var(--radius-pill);overflow:hidden;display:flex}
.cp-today-bar-fill{height:100%;width:0%;background:linear-gradient(90deg,var(--sky),var(--primary));transition:width 0.6s var(--ease-out)}
.cp-today-bar-flight{height:100%;width:0%;background:repeating-linear-gradient(45deg,color-mix(in srgb,var(--amber) 55%,transparent),color-mix(in srgb,var(--amber) 55%,transparent) 4px,color-mix(in srgb,var(--amber) 30%,transparent) 4px,color-mix(in srgb,var(--amber) 30%,transparent) 8px);transition:width 0.6s var(--ease-out)}

/* ============================================================
   HEARTBEAT TRACKS — per-agent timeline, 6am–9pm
   ============================================================ */
.tv2-heartbeat-hours{display:flex;justify-content:space-between;font-size:10px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:10px;padding:0 4px 0 156px}
.tv2-heartbeat-tracks{display:flex;flex-direction:column;gap:8px}
.tv2-heartbeat-row{display:grid;grid-template-columns:148px 1fr;gap:14px;align-items:center}
.tv2-heartbeat-name{font-size:11px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center;gap:8px}
.tv2-heartbeat-name .tv2-pulse{flex-shrink:0}
.tv2-heartbeat-track{position:relative;height:28px;background:var(--sky-glass);border:1px solid color-mix(in srgb,var(--sky) 18%,transparent);border-radius:var(--radius-pill);overflow:visible}
.tv2-heartbeat-track::before{content:'';position:absolute;left:8px;right:8px;top:50%;height:1px;background:color-mix(in srgb,var(--sky) 30%,transparent);border-radius:1px}
.tv2-heartbeat-tick{position:absolute;top:0;bottom:0;width:1px;background:color-mix(in srgb,var(--primary) 8%,transparent)}
.tv2-heartbeat-now{position:absolute;top:-3px;bottom:-3px;width:2px;background:var(--primary);border-radius:2px;box-shadow:0 0 12px color-mix(in srgb,var(--primary) 40%,transparent);z-index:3;pointer-events:none}
.tv2-heartbeat-now::after{content:'';position:absolute;top:-4px;left:-3px;width:8px;height:8px;border-radius:50%;background:var(--primary)}
.tv2-heartbeat-dot{position:absolute;top:50%;width:10px;height:10px;border-radius:50%;background:var(--sky);transform:translate(-50%,-50%);transition:transform var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out);cursor:default;border:2px solid #fff;z-index:1;box-shadow:0 1px 3px rgba(16,24,40,0.15)}
.tv2-heartbeat-dot:hover{transform:translate(-50%,-50%) scale(1.5);z-index:4;box-shadow:0 4px 12px rgba(16,24,40,0.25)}
.tv2-heartbeat-dot--success{background:var(--green)}
.tv2-heartbeat-dot--error{background:var(--red);animation:tv2-pulse-anim 1.6s var(--ease-out) infinite}
.tv2-heartbeat-dot--scheduled{background:transparent;width:8px;height:8px;border:1.5px dashed var(--text-muted);opacity:0.55;z-index:0}
.tv2-heartbeat-dot--scheduled:hover{opacity:1;border-color:var(--primary)}
.tv2-heartbeat-empty{font-size:11px;color:var(--text-muted);text-align:center;padding:24px;font-style:italic}
.tv2-heartbeat-tooltip{position:fixed;background:#0D1B2A;color:#fff;font-size:11px;padding:6px 10px;border-radius:var(--radius-md);pointer-events:none;z-index:9999;box-shadow:0 6px 16px rgba(16,24,40,0.25);white-space:nowrap;font-family:inherit}
.tv2-heartbeat-tooltip strong{color:var(--sky)}

@media(max-width:768px){
  .tv2-heartbeat-row{grid-template-columns:90px 1fr;gap:10px}
  .tv2-heartbeat-hours{padding-left:104px}
  .tv2-heartbeat-name{font-size:10px}
  .tv2-heartbeat-track{height:24px}
}
@media(max-width:480px){
  .tv2-heartbeat-row{grid-template-columns:1fr;gap:4px}
  .tv2-heartbeat-name{margin-bottom:2px;font-size:11px}
  .tv2-heartbeat-hours{padding-left:0}
}

/* Agent detail modal — content sections */
.am-section{padding-bottom:16px;margin-bottom:16px;border-bottom:1px solid var(--border-light)}
.am-section:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}
.am-section-title{font-size:11px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.1em;margin-bottom:10px}
.am-stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.am-stat{background:var(--bg-subtle);border:1px solid var(--border-light);border-radius:var(--radius-lg);padding:14px}
.am-stat-label{font-size:10px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:6px}
.am-stat-value{font-size:20px;font-weight:700;color:var(--text);font-variant-numeric:tabular-nums;letter-spacing:-0.01em;line-height:1}
.am-run-list{display:flex;flex-direction:column;gap:6px;max-height:240px;overflow-y:auto}
.am-run-row{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:var(--bg-subtle);border-radius:var(--radius-md);font-size:12px}
.am-run-row--success{border-left:3px solid var(--green)}
.am-run-row--error{border-left:3px solid var(--red)}
.am-run-time{font-variant-numeric:tabular-nums;color:var(--text);font-weight:600}
.am-run-status{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;padding:2px 8px;border-radius:var(--radius-pill)}
.am-run-status--success{background:var(--green-light);color:var(--green-dark)}
.am-run-status--error{background:var(--red-light);color:var(--red)}
@media(max-width:480px){
  .am-stat-grid{grid-template-columns:1fr 1fr}
}

/* ============================================================
   SEND LOG V2 — modern table, status pills, click-to-view rows
   ============================================================ */
.sl-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.sl-table{width:100%;border-collapse:collapse;font-size:12px;min-width:760px}
.sl-table thead{background:var(--bg-subtle);position:sticky;top:0;z-index:1}
.sl-table th{
  text-align:left;
  font-size:10px;
  font-weight:700;
  color:var(--text-muted);
  text-transform:uppercase;
  letter-spacing:0.08em;
  padding:14px 16px;
  border-bottom:1px solid var(--border-light);
  white-space:nowrap;
}
.sl-table td{padding:12px 16px;border-bottom:1px solid var(--border-light);color:var(--text);vertical-align:middle}
.sl-table tbody tr{transition:background var(--duration-fast) var(--ease-out)}
.sl-table tbody tr:hover{background:var(--bg-hover)}
.sl-table tbody tr.sl-clickable{cursor:pointer}
.sl-table tbody tr.sl-clickable:hover{background:var(--accent-light)}
.sl-table tbody tr.sl-muted{opacity:0.6;cursor:default}
.sl-time{font-variant-numeric:tabular-nums;color:var(--text-secondary);font-size:11px;white-space:nowrap}
.sl-recipient{font-weight:600;color:var(--text);max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sl-subject{color:var(--text-secondary);max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sl-tpl{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;color:var(--text-muted);background:var(--bg-subtle);padding:3px 8px;border-radius:var(--radius-pill);white-space:nowrap;display:inline-block}
.sl-status{
  display:inline-flex;
  align-items:center;
  gap:5px;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.08em;
  padding:4px 10px;
  border-radius:var(--radius-pill);
  white-space:nowrap;
}
.sl-status::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor;flex-shrink:0}
.sl-status--sent{background:var(--green-light);color:var(--green-dark)}
.sl-status--failed{background:var(--red-light);color:var(--red)}
.sl-status--bounced{background:var(--amber-light);color:#8d5e16}
.sl-error{color:var(--red);font-size:11px;font-style:italic;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sl-empty{text-align:center;color:var(--text-muted);padding:32px 16px;font-size:12px}

.sl-pagination{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 20px;
  border-top:1px solid var(--border-light);
  background:var(--bg-subtle);
  gap:12px;
  flex-wrap:wrap;
  font-size:12px;
  color:var(--text-secondary);
}
.sl-pagination button{
  padding:7px 14px;
  border-radius:var(--radius-pill);
  border:1px solid var(--border);
  background:transparent;
  color:var(--text-secondary);
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  font-family:inherit;
  transition:all var(--duration-fast) var(--ease-out);
}
.sl-pagination button:hover:not(:disabled){background:var(--bg-hover);color:var(--text);border-color:var(--primary-100)}
.sl-pagination button:disabled{opacity:0.4;cursor:not-allowed}

/* Send-log row detail modal */
.sl-modal{
  width:min(720px,95vw);
  max-height:90vh;
  z-index:9999;
}
.sl-modal-meta{font-size:12px;color:var(--text-muted);margin-top:4px;line-height:1.55}
.sl-modal-meta strong{color:var(--text);font-weight:600}
.sl-modal-body-pre{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:12px;
  line-height:1.65;
  color:var(--text);
  white-space:pre-wrap;
  word-break:break-word;
  background:var(--bg-subtle);
  padding:18px 20px;
  border-radius:var(--radius-lg);
  border:1px solid var(--border-light);
}

@media(max-width:768px){
  .sl-table{font-size:11px;min-width:640px}
  .sl-table th,.sl-table td{padding:10px 12px}
}

/* ============================================================
   BD PIPELINE V2 — list + detail rail, infinite scroll, comments
   ============================================================ */
/* Compact product-style page head (replaces the marketing tv2-hero on this surface).
   Single 22px title + action buttons on one row. */
.uo-pagehead{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:14px}
.uo-pagehead-title{margin:0;font-size:22px;font-weight:700;color:var(--text);letter-spacing:-0.015em;line-height:1.2}
.uo-pagehead-desc{margin:4px 0 0;font-size:12.5px;color:var(--text-secondary);line-height:1.45}
.uo-pagehead-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
/* Tabular one-line KPI summary (replaces the 5-tile hero-metric grid). */
.bdp-kpi-line{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;padding:10px 16px;background:var(--bg-card);border:1px solid var(--border-light);border-radius:var(--radius-lg);margin-bottom:14px;font-variant-numeric:tabular-nums}
.bdp-kpi-item{display:inline-flex;align-items:baseline;gap:6px;font-size:14px;font-weight:600;color:var(--text)}
.bdp-kpi-item-label{font-size:11px;font-weight:500;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.04em}
.bdp-kpi-sep{width:1px;align-self:stretch;background:var(--border-light)}
.bdp-kpi-good{color:#27B973}
.bdp-kpi-accent{color:var(--primary)}
.bdp-kpi-warn{color:#8d5e16}
.bdp-main{display:grid;grid-template-columns:minmax(0,1fr) 380px;gap:18px;align-items:start}
.bdp-list-card{padding:0;overflow:hidden;display:flex;flex-direction:column;height:calc(100vh - 380px);min-height:520px}
.bdp-list{flex:1;overflow-y:auto;scrollbar-width:thin;scroll-behavior:smooth;outline:none}
.bdp-list::-webkit-scrollbar{width:6px}
.bdp-list::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}
.bdp-list-empty{padding:48px 20px;text-align:center;color:var(--text-muted);font-size:13px}
.bdp-list-foot{padding:10px 16px;border-top:1px solid var(--border-light);font-size:11px;color:var(--text-muted);text-align:center;font-variant-numeric:tabular-nums;background:var(--bg-subtle);min-height:38px;display:flex;align-items:center;justify-content:center}

.bdp-row{display:flex;align-items:center;gap:14px;padding:14px 18px;border-bottom:1px solid var(--border-light);cursor:pointer;transition:background var(--duration-fast) var(--ease-out)}
.bdp-row:hover{background:var(--bg-hover)}
.bdp-row.is-selected{background:var(--primary-50);box-shadow:inset 3px 0 0 var(--primary)}
.bdp-row-mark{width:8px;height:8px;border-radius:50%;flex-shrink:0;margin-top:5px}
.bdp-row-main{flex:1;min-width:0}
.bdp-row-top{display:flex;align-items:center;gap:8px;justify-content:space-between}
.bdp-row-name{font-size:14px;font-weight:600;color:var(--text);text-overflow:ellipsis;overflow:hidden;white-space:nowrap;letter-spacing:-0.005em}
.bdp-row-meta{font-size:11px;color:var(--text-muted);margin-top:3px;display:flex;gap:10px;flex-wrap:wrap;font-variant-numeric:tabular-nums}
.bdp-row-meta span{display:inline-flex;align-items:center;gap:4px}
.bdp-row-meta .bdp-meta-sep{color:var(--border)}
.bdp-row-status{font-size:10px;font-weight:600;padding:3px 9px;border-radius:var(--radius-pill);background:var(--bg-subtle);color:var(--text-secondary);white-space:nowrap;border:1px solid var(--border-light)}
.bdp-row-status[data-status="Engaged"],.bdp-row-status[data-status="Demo Scheduled"],.bdp-row-status[data-status="Closed Won"]{background:var(--green-light);color:var(--green-dark);border-color:transparent}
.bdp-row-status[data-status="Cold Outreach"],.bdp-row-status[data-status="Prospects"]{background:var(--amber-light);color:#8d5e16;border-color:transparent}
.bdp-row-status[data-status="Closed Lost"],.bdp-row-status[data-status="Lost"]{background:var(--red-light);color:var(--red);border-color:transparent}

.bdp-rail{position:sticky;top:24px;background:var(--bg-card);border:1px solid var(--border-light);border-radius:var(--radius-xl);box-shadow:var(--shadow-md);padding:24px;max-height:calc(100vh - 380px);min-height:520px;overflow-y:auto;scrollbar-width:thin}
.bdp-rail::-webkit-scrollbar{width:6px}
.bdp-rail::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}
.bdp-rail-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;height:100%;padding:30px 12px;color:var(--text-muted)}
.bdp-rail-empty-icon{width:44px;height:44px;border-radius:50%;background:var(--primary-50);display:flex;align-items:center;justify-content:center;color:var(--primary);margin-bottom:14px}
.bdp-rail-empty-title{font-size:14px;font-weight:600;color:var(--text);margin-bottom:6px}
.bdp-rail-empty-text{font-size:12px;line-height:1.55;max-width:30ch;color:var(--text-secondary)}

.bdp-rail-head{margin-bottom:18px;padding-bottom:14px;border-bottom:1px solid var(--border-light)}
.bdp-rail-name{font-size:18px;font-weight:700;color:var(--text);letter-spacing:-0.015em;margin-bottom:6px;text-wrap:balance}
.bdp-rail-meta{font-size:11px;color:var(--text-muted);line-height:1.6}
.bdp-rail-meta a{color:var(--primary);text-decoration:none}
.bdp-rail-meta a:hover{text-decoration:underline}
.bdp-rail-status-row{display:flex;gap:8px;align-items:center;margin-top:10px}
.bdp-rail-status-row select{flex:1;padding:7px 10px;border:1px solid var(--border);border-radius:var(--radius-md);font-size:12px;font-family:inherit;background:var(--bg-card);color:var(--text)}
.bdp-rail-section{margin-bottom:16px}
.bdp-rail-section-label{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:0.06em;color:var(--text-muted);margin-bottom:8px}

.bdp-comments{display:flex;flex-direction:column;gap:10px;max-height:none}
.bdp-comment{padding:10px 12px;border-radius:var(--radius-md);background:rgba(255,255,255,0.7);border:1px solid var(--border-light)}
.bdp-comment.bdp-comment--bot{background:var(--primary-50);border-color:rgba(66,123,178,0.18)}
.bdp-comment.bdp-comment--system{background:var(--bg-subtle);border-style:dashed}
.bdp-comment-head{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:var(--text-muted);margin-bottom:5px;font-weight:500}
.bdp-comment-author{color:var(--text);font-weight:600}
.bdp-comment-body{font-size:12px;line-height:1.55;color:var(--text);white-space:pre-wrap;word-wrap:break-word}

.bdp-add-comment{margin-top:14px}
.bdp-add-comment textarea{width:100%;min-height:64px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-md);font-size:12px;font-family:inherit;line-height:1.5;color:var(--text);resize:vertical;outline:none;background:var(--bg-card);transition:border-color var(--duration-fast) var(--ease-out)}
.bdp-add-comment textarea:focus{border-color:var(--primary)}
.bdp-add-comment-row{display:flex;gap:8px;justify-content:flex-end;margin-top:8px}

/* Inline editable fields in the detail rail */
.bdp-edit-row{display:grid;grid-template-columns:84px 1fr;gap:10px;align-items:center;padding:6px 0;border-bottom:1px dashed transparent}
.bdp-edit-row:hover{border-bottom-color:var(--border-light)}
.bdp-edit-label{font-size:10px;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;font-weight:600}
.bdp-edit-value{font-size:12px;color:var(--text);cursor:text;line-height:1.4;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 8px;border-radius:6px;transition:background var(--duration-fast) var(--ease-out);min-height:24px;word-break:break-all}
.bdp-edit-value:hover{background:color-mix(in srgb,var(--primary) 5%,transparent)}
.bdp-edit-pencil{color:var(--text-muted);font-size:10px;opacity:0;transition:opacity var(--duration-fast) var(--ease-out)}
.bdp-edit-value:hover .bdp-edit-pencil{opacity:0.7}
.bdp-edit-input{width:100%;padding:5px 8px;border:1px solid var(--primary);border-radius:6px;font-size:12px;font-family:inherit;color:var(--text);background:var(--bg-card);outline:none;box-shadow:var(--ring-primary)}

/* CC list rows */
.bdp-cc-row{display:flex;align-items:center;justify-content:space-between;padding:5px 8px;background:color-mix(in srgb,var(--primary) 4%,transparent);border:1px solid var(--border-light);border-radius:6px;margin-bottom:4px;font-size:12px}
.bdp-cc-email{color:var(--text);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;word-break:break-all}
.bdp-cc-x{background:none;border:none;color:var(--text-muted);font-size:18px;line-height:1;cursor:pointer;padding:0 4px;flex-shrink:0;transition:color var(--duration-fast) var(--ease-out)}
.bdp-cc-x:hover{color:var(--red)}

/* Delete icon button */
.bdp-icon-btn{background:transparent;border:1px solid var(--border);border-radius:8px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;color:var(--text-muted);cursor:pointer;flex-shrink:0;transition:all var(--duration-fast) var(--ease-out)}
.bdp-icon-btn:hover{background:var(--red-light);border-color:var(--red);color:var(--red)}

/* tv2-modal — JIRA-style enterprise modal (page-qa skill section 8).
   Reference: Atlassian's "create issue" dialog. Sharp 8px corners, white
   card, deep but compact shadow, 24px padding throughout, gray-bg footer. */
.tv2-modal{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:20px;animation:tv2ModalFadeIn 0.14s ease-out}
@keyframes tv2ModalFadeIn{from{opacity:0}to{opacity:1}}
/* Backdrop: frosted-glass — minimal tint + heavy blur so the page behind
   stays visibly recognizable, just clearly de-emphasized. Iterations:
     1) 0.48 alpha + 3px blur → read as a solid wall ("completely shutting me off")
     2) 0.28 alpha + 14px blur → still felt opaque on the calendar panel
        (large modal + uniform-gray background offered nothing for the blur
        to "show off")
     3) 0.10 alpha + 18px blur → page-behind clearly visible through frost
   `will-change` forces a compositing layer so backdrop-filter reliably
   renders on Chrome/Safari (some builds drop the filter without it). */
.tv2-modal-backdrop{
  position:absolute;inset:0;
  background:rgba(13,27,42,0.10);
  backdrop-filter:blur(18px) saturate(130%);
  -webkit-backdrop-filter:blur(18px) saturate(130%);
  will-change:backdrop-filter;
}
/* Card: solid white, sharp 8px corners, JIRA-style layered shadow. */
.tv2-modal-card{
  position:relative;
  background:var(--bg-card);
  border-radius:8px;
  box-shadow:0 4px 8px -2px rgba(9,30,66,0.25),0 0 0 1px rgba(9,30,66,0.08);
  width:100%;max-height:90vh;
  display:flex;flex-direction:column;
}
/* Header — single-line title, no border line below (JIRA-style). The
   eyebrow renders only when present in markup. */
.tv2-modal-head{
  display:flex;justify-content:space-between;align-items:flex-start;gap:14px;
  padding:24px 24px 16px;flex-shrink:0;
}
.tv2-modal-eyebrow{font-size:11px;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:4px}
.tv2-modal-title{font-size:20px;font-weight:600;color:var(--text);letter-spacing:-0.01em;margin:0;line-height:1.3}
.tv2-modal-close{background:transparent;border:none;border-radius:4px;width:28px;height:28px;display:flex;align-items:center;justify-content:center;color:var(--text-muted);cursor:pointer;flex-shrink:0;transition:background var(--duration-fast) var(--ease-out)}
.tv2-modal-close:hover{background:rgba(9,30,66,0.06);color:var(--text)}
/* Body scrolls when content overflows; head + foot stay pinned. */
.tv2-modal-body{
  padding:0 24px 20px;
  flex:1 1 auto;min-height:0;
  overflow-y:auto;overflow-x:hidden;
  scrollbar-width:thin;
  scrollbar-color:rgba(9,30,66,0.16) transparent;
}
.tv2-modal-body::-webkit-scrollbar{width:8px}
.tv2-modal-body::-webkit-scrollbar-track{background:transparent}
.tv2-modal-body::-webkit-scrollbar-thumb{background:rgba(9,30,66,0.16);border-radius:4px}
.tv2-modal-body::-webkit-scrollbar-thumb:hover{background:rgba(9,30,66,0.32)}
/* Footer: light gray with crisp border-top (JIRA-style). Primary on right. */
.tv2-modal-foot{padding:16px 24px;display:flex;gap:8px;justify-content:flex-end;border-top:1px solid var(--border-light);background:var(--bg-subtle);flex-shrink:0;border-radius:0 0 8px 8px}
/* When ANY tv2-modal is visible, lock the body scroll. Uses :has() so we
   don't have to touch every modal's open/close JS — purely CSS-driven.
   Supported in Chrome 105+, Safari 15.4+, Firefox 121+ (matches our other
   modern-CSS usage like backdrop-filter). */
body:has(.tv2-modal[style*="display:flex"]),
body:has(.tv2-modal[style*="display: flex"]){overflow:hidden}
.bdp-form-row{margin-bottom:14px}
.bdp-form-label{display:block;font-size:11px;font-weight:600;color:var(--text);text-transform:uppercase;letter-spacing:0.04em;margin-bottom:6px}
.bdp-form-input{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-md);font-size:14px;font-family:inherit;color:var(--text);background:var(--bg-card);outline:none;transition:border-color var(--duration-fast) var(--ease-out)}
.bdp-form-input:focus{border-color:var(--primary);box-shadow:var(--ring-primary)}
textarea.bdp-form-input{resize:vertical;line-height:1.5;font-size:13px}

@media(max-width:1024px){
  .bdp-main{grid-template-columns:1fr;gap:14px}
  .bdp-rail{position:relative;top:0;max-height:none;min-height:0}
  .bdp-list-card{height:auto;max-height:60vh;min-height:380px}
}
@media(max-width:768px){
  .bdp-row{padding:12px 14px;gap:10px}
  .bdp-row-name{font-size:13px}
  .bdp-row-status{font-size:10px;padding:2px 7px}
  .bdp-rail{padding:18px}
}
@media(max-width:480px){
  .bdp-row-meta{flex-direction:column;gap:3px}
  .bdp-meta-sep{display:none}
}

/* ============================================================
   EMAIL ANALYTICS V2 — chart bars, template rows, conversion bars
   ============================================================ */
.ea-chart{display:flex;align-items:flex-end;gap:3px;height:180px;padding:12px 4px 8px;overflow-x:auto;scrollbar-width:thin}
.ea-chart::-webkit-scrollbar{height:6px}
.ea-chart::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}
.ea-bar-col{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:4px;min-width:18px;flex:1 1 0;height:100%}
.ea-bar-count{font-size:10px;font-weight:600;color:var(--text);font-variant-numeric:tabular-nums;white-space:nowrap}
.ea-bar{width:100%;min-width:8px;background:linear-gradient(180deg,var(--sky) 0%,var(--primary) 100%);border-radius:var(--radius-sm) var(--radius-sm) 2px 2px;transition:opacity var(--duration-fast) var(--ease-out);flex-shrink:0}
.ea-bar:hover{opacity:0.7}
.ea-bar--zero{background:var(--bg-subtle)}
.ea-bar-day{font-size:10px;color:var(--text-muted);font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap}

.ea-tpl-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 14px;background:rgba(255,255,255,0.55);border:1px solid var(--border-light);border-radius:var(--radius-lg);margin-bottom:8px;transition:border-color var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out)}
.ea-tpl-row:hover{border-color:var(--primary-100);box-shadow:var(--shadow-sm)}
.ea-tpl-row:last-child{margin-bottom:0}
.ea-tpl-name{font-size:13px;font-weight:600;color:var(--text);text-transform:capitalize}
.ea-tpl-stats{display:flex;gap:14px;font-size:12px;font-variant-numeric:tabular-nums;flex-shrink:0}
.ea-tpl-pill{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border-radius:var(--radius-pill);font-size:11px;font-weight:700}
.ea-tpl-pill--good{background:var(--green-light);color:var(--green-dark)}
.ea-tpl-pill--bad{background:var(--red-light);color:var(--red)}

.ea-conv-row{display:grid;grid-template-columns:minmax(140px,260px) 1fr 56px;gap:14px;align-items:center;padding:11px 4px;border-bottom:1px solid var(--border-light);font-size:12px}
.ea-conv-row:last-child{border-bottom:none}
.ea-conv-stages{color:var(--text);font-weight:500;display:flex;align-items:center;gap:8px}
.ea-conv-stages span{font-weight:600}
.ea-conv-stages svg{flex-shrink:0;color:var(--text-muted)}
.ea-conv-bar{height:8px;background:var(--bg-subtle);border-radius:var(--radius-pill);overflow:hidden}
.ea-conv-bar-fill{height:100%;border-radius:var(--radius-pill);transition:width 0.6s var(--ease-out)}
.ea-conv-rate{text-align:right;font-weight:700;font-variant-numeric:tabular-nums}

@media(max-width:768px){
  .ea-chart{height:120px}
  .ea-conv-row{grid-template-columns:1fr;gap:6px}
  .ea-conv-stages{font-size:11px}
}

/* ============================================================
   APPROVALS V2 — glass cards, type-coded badges, sticky actions
   ============================================================ */
.av-shell{display:flex;flex-direction:column;gap:22px;padding:0 4px}
.av-empty{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--bg-glass-border);
  box-shadow:0 4px 24px rgba(16,24,40,0.06),0 1px 0 rgba(255,255,255,0.6) inset;
  border-radius:var(--radius-xl);
  padding:48px 32px;
  text-align:center;
}
.av-empty-icon{width:56px;height:56px;border-radius:50%;background:var(--green-light);color:var(--green-dark);display:flex;align-items:center;justify-content:center;margin:0 auto 14px;font-size:24px;font-weight:700}
.av-empty-title{font-size:18px;font-weight:700;color:var(--text);letter-spacing:-0.015em;margin-bottom:6px}
.av-empty-sub{font-size:13px;color:var(--text-muted);max-width:46ch;margin:0 auto;line-height:1.55}

.av-cards{display:flex;flex-direction:column;gap:14px}
.av-card{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--bg-glass-border);
  box-shadow:0 4px 24px rgba(16,24,40,0.06),0 1px 0 rgba(255,255,255,0.6) inset;
  border-radius:var(--radius-xl);
  padding:22px 24px;
  transition:box-shadow var(--duration-base) var(--ease-out),border-color var(--duration-base) var(--ease-out);
}
.av-card:hover{box-shadow:0 8px 32px rgba(16,24,40,0.08);border-color:var(--primary-100)}
.av-card--building{border-left:3px solid var(--amber)}
.av-card--error{border-left:3px solid var(--red)}
.av-card-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.av-card-tag{
  display:inline-flex;align-items:center;gap:6px;
  font-size:10px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;
  padding:4px 10px;border-radius:var(--radius-pill);
}
.av-card-tag--bd{background:color-mix(in srgb,var(--sky) 18%,transparent);color:var(--primary)}
.av-card-tag--website{background:color-mix(in srgb,var(--purple) 14%,transparent);color:#7c3aed}
.av-card-tag--marketing{background:color-mix(in srgb,var(--green) 14%,transparent);color:var(--green-dark)}
.av-card-tag--pm{background:color-mix(in srgb,var(--amber) 14%,transparent);color:#d97706}
.av-card-type{font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.08em}
.av-card-time{font-size:11px;color:var(--text-muted);margin-left:auto;font-variant-numeric:tabular-nums}
.av-card-title{font-size:15px;font-weight:700;color:var(--text);letter-spacing:-0.01em;line-height:1.35;margin-bottom:8px;text-wrap:balance}
.av-card-content{font-size:12px;color:var(--text-secondary);line-height:1.55;background:var(--bg-subtle);border:1px solid var(--border-light);border-radius:var(--radius-md);padding:10px 12px;margin-bottom:14px;white-space:pre-wrap;word-break:break-word;max-height:180px;overflow-y:auto}
.av-card-content[contenteditable="true"]{outline:2px solid var(--primary);outline-offset:1px;background:var(--bg-card)}
.av-card-status{font-size:12px;font-weight:600;margin-bottom:12px;display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border-radius:var(--radius-pill);background:var(--bg-subtle)}
.av-card-status--building{color:var(--amber);background:var(--amber-light)}
.av-card-status--error{color:var(--red);background:var(--red-light)}
.av-card-status--ready{color:var(--green-dark);background:var(--green-light)}
.av-card-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.av-btn{
  padding:9px 16px;border-radius:var(--radius-pill);font-size:12px;font-weight:600;
  cursor:pointer;font-family:inherit;border:1px solid transparent;
  transition:all var(--duration-base) var(--ease-out);
  display:inline-flex;align-items:center;gap:6px;
}
.av-btn-primary{background:var(--primary);color:#fff;border-color:var(--primary)}
.av-btn-primary:hover{background:var(--primary-dark);border-color:var(--primary-dark)}
.av-btn-secondary{background:transparent;color:var(--primary);border-color:var(--primary-100)}
.av-btn-secondary:hover{background:var(--primary-50);border-color:var(--primary)}
.av-btn-ghost{background:transparent;color:var(--text-secondary);border-color:var(--border)}
.av-btn-ghost:hover{background:var(--bg-hover);color:var(--text)}
.av-btn-danger{background:transparent;color:var(--red);border-color:var(--red-light)}
.av-btn-danger:hover{background:var(--red-light)}
.av-btn:focus-visible{outline:none;box-shadow:var(--ring-primary)}

@media(max-width:480px){
  .av-card{padding:18px}
  .av-card-actions{flex-direction:column}
  .av-card-actions .av-btn{width:100%;justify-content:center;min-height:44px}
}

/* ============================================================
   MEDIA LIBRARY — grid + cards + preview modal + buttons
   ============================================================ */
/* .ml-btn* removed 2026-06-10 — media library now uses the canonical .uo-btn primitives. */

/* Upload modal */
.ml-upload-modal{position:fixed;inset:0;background:color-mix(in srgb,var(--sidebar) 60%,transparent);z-index:1000;display:none;align-items:center;justify-content:center;padding:20px}
.ml-upload-modal.open{display:flex}
.ml-upload-card{background:var(--bg-card);border-radius:14px;width:100%;max-width:640px;box-shadow:0 24px 60px rgba(16,24,40,0.4);overflow:hidden}
.ml-upload-head{padding:20px 24px 0;display:flex;justify-content:space-between;align-items:flex-start}
.ml-upload-body{padding:18px 24px 24px}
.ml-upload-dropzone{
  border:2px dashed var(--border);
  border-radius:12px;padding:40px 24px;
  text-align:center;
  background:var(--bg-subtle);
  transition:all 0.2s ease;
  cursor:pointer;
}
.ml-upload-dropzone:hover, .ml-upload-dropzone.is-drag{
  border-color:var(--primary);
  background:color-mix(in srgb,var(--primary) 4%,transparent);
}
.ml-upload-dropzone-title{font-size:14px;font-weight:600;color:var(--text);margin-bottom:6px}
.ml-upload-dropzone-sub{font-size:12px;color:var(--text-muted)}
.ml-upload-field{margin-top:14px}
.ml-upload-field-label{display:block;font-size:11px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:6px}
.ml-upload-input{width:100%;padding:9px 12px;border:1px solid var(--border);border-radius:8px;font-size:12px;font-family:inherit;background:var(--bg-card)}
.ml-upload-input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent)}
.ml-upload-files{margin-top:14px;max-height:160px;overflow-y:auto}
.ml-upload-file{display:flex;align-items:center;gap:10px;padding:6px 10px;background:var(--bg-subtle);border-radius:6px;font-size:12px;margin-bottom:4px}
.ml-upload-file-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}
.ml-upload-file-size{color:var(--text-muted);font-size:11px}
.ml-upload-file-status{color:var(--text-muted);font-size:11px;min-width:120px;text-align:right}
.ml-upload-file-remove{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:16px;line-height:1;padding:0 4px}
.ml-upload-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:18px;padding-top:14px;border-top:1px solid var(--border-light)}

/* ============================================================
   MEDIA LIBRARY — grid + cards + preview modal
   ============================================================ */
.ml-card{
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:10px;
  overflow:hidden;
  cursor:pointer;
  transition:transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display:flex;flex-direction:column;
}
.ml-card:hover{transform:translateY(-2px);box-shadow:0 8px 18px rgba(13,27,42,0.08);border-color:var(--primary)}
.ml-thumb{position:relative;background:var(--bg-subtle);height:140px;overflow:hidden}
.ml-thumb img{width:100%;height:140px;object-fit:cover;display:block}
.ml-thumb-fallback{display:flex;align-items:center;justify-content:center;height:140px;color:var(--primary);font-size:18px;font-weight:700;background:var(--accent-light)}
.ml-badge{
  position:absolute;top:8px;right:8px;
  padding:2px 8px;border-radius:999px;
  font-size:11px;font-weight:700;
  letter-spacing:0.05em;text-transform:uppercase;
  background:color-mix(in srgb,var(--sidebar) 85%,transparent);color:#fff;
}
.ml-badge-wp{background:rgba(33,117,155,0.92)}
.ml-badge-local{background:color-mix(in srgb,var(--primary) 92%,transparent)}
/* "Used in N pages" chip — sits on the LEFT of the thumb so it doesn't
   overlap the source badge. Green = "this is in use, be careful deleting." */
.ml-badge-used{position:absolute;top:8px;right:auto;left:8px;background:color-mix(in srgb,var(--green-dark) 92%,transparent);font-weight:700}
.ml-card-body{padding:10px 12px}
.ml-card-name{font-size:12px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ml-card-meta{font-size:10px;color:var(--text-muted);margin-top:3px}

/* ============================================================
   BRAND & VOICE V2 — same design language as the team panel
   ============================================================ */
.bv2-shell{display:flex;flex-direction:column;gap:22px;padding:0 4px}
.bv2-tabs{
  display:flex;flex-wrap:nowrap;gap:6px;
  background:var(--bg-card);
  border:1px solid var(--border-light);
  box-shadow:var(--shadow-sm);
  border-radius:var(--radius-pill);
  padding:6px;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-snap-type:x proximity;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.bv2-tabs::-webkit-scrollbar{display:none}
.bv2-tab{scroll-snap-align:start;flex-shrink:0}
.bv2-tab{
  padding:9px 18px;
  border-radius:var(--radius-pill);
  font-size:12px;
  font-weight:600;
  color:var(--text-secondary);
  background:transparent;
  border:none;
  cursor:pointer;
  font-family:inherit;
  transition:all var(--duration-fast) var(--ease-out);
  white-space:nowrap;
}
.bv2-tab:hover{color:var(--text);background:var(--bg-hover)}
.bv2-tab.active{background:var(--primary);color:#fff;box-shadow:0 2px 8px color-mix(in srgb,var(--primary) 25%,transparent)}
.bv2-tab:focus-visible{outline:none;box-shadow:var(--ring-primary)}
.bv2-tab-count{
  display:inline-block;
  font-size:10px;
  font-weight:700;
  margin-left:6px;
  padding:1px 7px;
  background:var(--sky-tint);
  color:var(--primary);
  border-radius:var(--radius-pill);
  font-variant-numeric:tabular-nums;
}
.bv2-tab.active .bv2-tab-count{background:rgba(255,255,255,0.25);color:#fff}

.bv2-pane{
  background:var(--bg-card);
  border:1px solid var(--border-light);
  box-shadow:var(--shadow-sm);
  border-radius:var(--radius-xl);
  padding:28px;
}
.bv2-pane-head{margin-bottom:18px;padding-bottom:14px;border-bottom:1px solid var(--border-light)}
.bv2-pane-title{font-size:16px;font-weight:700;letter-spacing:-0.01em;color:var(--text);margin-bottom:4px}
.bv2-pane-sub{font-size:12px;color:var(--text-muted);line-height:1.5}

/* Voice / copy / pillar / etc. card — full content, no truncation */
.bv2-rule{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:14px 16px;
  background:var(--bg-card);
  border:1px solid var(--border-light);
  border-radius:var(--radius-lg);
  transition:border-color var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out);
  margin-bottom:8px;
}
.bv2-rule:hover{border-color:var(--primary-100);box-shadow:var(--shadow-sm)}
.bv2-rule-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.bv2-rule-key{font-size:11px;font-weight:700;color:var(--primary);text-transform:uppercase;letter-spacing:0.06em}
.bv2-rule-source{font-size:10px;color:var(--text-muted);font-style:italic;flex-shrink:0}
.bv2-rule-value{font-size:13px;line-height:1.55;color:var(--text)}

/* Don'ts get a red accent */
.bv2-rule--dont{border-left:3px solid var(--red);background:linear-gradient(90deg,color-mix(in srgb,var(--red) 6%,transparent) 0%,var(--bg-card) 60%)}
.bv2-rule--dont .bv2-rule-key{color:var(--red)}

/* Hero example callout (used inside Copy Patterns) */
.bv2-formula{
  background:linear-gradient(135deg,#0056A4 0%,#003875 100%);
  color:#fff;
  border-radius:var(--radius-xl);
  padding:24px 28px;
  margin-bottom:18px;
  position:relative;
  overflow:hidden;
}
.bv2-formula::before{
  content:'';position:absolute;inset:0;
  background:radial-gradient(500px 280px at 110% -10%,color-mix(in srgb,var(--sky) 40%,transparent),transparent 60%);
  pointer-events:none;
}
.bv2-formula-eyebrow{font-size:10px;font-weight:700;color:rgba(255,255,255,0.75);text-transform:uppercase;letter-spacing:0.12em;margin-bottom:8px;position:relative}
.bv2-formula-text{font-size:18px;font-weight:600;letter-spacing:-0.01em;line-height:1.5;position:relative;text-wrap:balance}

/* === Visual showcase === */
.bv2-showcase{display:flex;flex-direction:column;gap:24px}
.bv2-showcase-section{background:var(--bg-card);border:1px solid var(--border-light);border-radius:var(--radius-lg);padding:20px 22px}
.bv2-showcase-title{font-size:11px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.1em;margin-bottom:14px}

/* Color ramps */
.bv2-ramp-row{display:flex;align-items:center;gap:14px;margin-bottom:14px}
.bv2-ramp-row:last-child{margin-bottom:0}
.bv2-ramp-label{font-size:11px;font-weight:600;color:var(--text-secondary);min-width:80px;flex-shrink:0}
.bv2-ramp-strip{display:flex;flex:1;border-radius:var(--radius-md);overflow:hidden;height:48px;border:1px solid var(--border-light)}
.bv2-ramp-cell{flex:1;display:flex;align-items:flex-end;justify-content:center;padding:4px 0;font-size:10px;font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;cursor:default;transition:flex var(--duration-base) var(--ease-out)}
.bv2-ramp-cell:hover{flex:2}

/* Type scale */
.bv2-type-row{display:flex;align-items:baseline;gap:14px;padding:10px 0;border-bottom:1px dashed var(--border-light)}
.bv2-type-row:last-child{border-bottom:none}
.bv2-type-label{font-size:11px;font-weight:600;color:var(--text-muted);min-width:90px;flex-shrink:0;font-variant-numeric:tabular-nums}
.bv2-type-sample{color:var(--text);font-family:'DM Sans','Inter',system-ui,sans-serif;letter-spacing:-0.015em;line-height:1.2;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Shadow ladder */
.bv2-shadow-row{display:flex;align-items:center;gap:14px;margin-bottom:18px;padding:0 4px}
.bv2-shadow-tile{width:120px;height:64px;background:var(--bg-card);border-radius:var(--radius-lg);flex-shrink:0}
.bv2-shadow-meta{font-size:11px;color:var(--text-secondary);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;line-height:1.5}
.bv2-shadow-meta strong{color:var(--text);font-family:inherit;text-transform:uppercase;font-size:10px;letter-spacing:0.08em;display:block;margin-bottom:2px}

/* Glass demo over a navy block */
.bv2-glass-demo{
  height:140px;
  background:linear-gradient(135deg,#0056A4 0%,#003875 60%,#1856B5 100%);
  border-radius:var(--radius-xl);
  position:relative;
  overflow:hidden;
}
.bv2-glass-demo-card{
  position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  width:min(280px,80%);
  padding:14px 18px;
  background:rgba(253,253,254,0.6);
  backdrop-filter:blur(20px) saturate(140%);
  -webkit-backdrop-filter:blur(20px) saturate(140%);
  border:1px solid rgba(255,255,255,0.6);
  /* This is THE glass demo for the brand-voice showcase — it's MEANT to look
     glassy over the navy block. Leave the rgba whites here. */
  border-radius:var(--radius-xl);
  box-shadow:0 4px 24px rgba(16,24,40,0.15);
  text-align:center;
}
.bv2-glass-demo-text{font-size:13px;font-weight:700;color:var(--text)}
.bv2-glass-demo-sub{font-size:11px;color:var(--text-muted);margin-top:3px}

/* Strengths grid (kept for compat with brand-strengths-grid) */
.bv2-strengths-section{margin-bottom:18px}
.bv2-strengths-section:last-child{margin-bottom:0}
.bv2-strengths-section-label{font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.1em;margin-bottom:10px}
.bv2-strengths-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px}
.bv2-strength-card{
  background:var(--bg-card);
  border:1px solid var(--border-light);
  border-radius:var(--radius-lg);
  padding:14px 16px;
  display:flex;flex-direction:column;gap:6px;
  transition:border-color var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out);
}
.bv2-strength-card:hover{border-color:var(--primary-100);box-shadow:var(--shadow-sm)}
.bv2-strength-title{font-size:11px;font-weight:700;color:var(--primary);text-transform:uppercase;letter-spacing:0.06em}
.bv2-strength-value{font-size:13px;color:var(--text);line-height:1.5}
.bv2-strength-source{font-size:10px;color:var(--text-muted);font-style:italic}

/* Wins (Brand & Voice → Wins tab) */
.bv2-wins-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 16px;flex-wrap:wrap}
.bv2-wins-add-btn{
  display:inline-flex;align-items:center;background:var(--primary);color:#fff;border:0;border-radius:var(--radius-md);
  padding:9px 16px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;
  box-shadow:0 2px 8px color-mix(in srgb,var(--primary) 20%,transparent);transition:background var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out);
}
.bv2-wins-add-btn:hover{background:var(--primary-dark);transform:translateY(-1px)}
.bv2-wins-help{font-size:12px;color:var(--text-muted);max-width:520px;line-height:1.5}
.bv2-wins-form{
  background:var(--bg-card);border:1px solid var(--border-light);border-radius:var(--radius-lg);
  padding:18px 18px 16px;margin-bottom:16px;display:flex;flex-direction:column;gap:12px;
}
.bv2-wins-form-row{display:flex;gap:12px;flex-wrap:wrap}
.bv2-wins-form-row > .bv2-wins-label{flex:1;min-width:200px}
.bv2-wins-label{display:flex;flex-direction:column;gap:6px;font-size:11px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.04em}
.bv2-wins-req{color:var(--error);font-weight:700}
.bv2-wins-input{
  border:1px solid var(--border);border-radius:var(--radius-md);padding:8px 11px;font-size:13px;color:var(--text);
  font-family:inherit;background:var(--bg-card);transition:border-color var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out);
}
.bv2-wins-input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent)}
.bv2-wins-textarea{resize:vertical;min-height:64px;line-height:1.5}
.bv2-wins-form-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:4px}
.bv2-wins-btn-primary{background:var(--primary);color:#fff;border:0;border-radius:var(--radius-md);padding:8px 16px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit}
.bv2-wins-btn-primary:hover{background:var(--primary-dark)}
.bv2-wins-btn-secondary{background:transparent;color:var(--text-muted);border:1px solid var(--border);border-radius:var(--radius-md);padding:8px 14px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit}
.bv2-wins-btn-secondary:hover{background:var(--bg-subtle);color:var(--text)}
.bv2-wins-list{display:flex;flex-direction:column;gap:10px}
.bv2-win-card{
  background:var(--bg-card);border:1px solid var(--border-light);border-left:3px solid var(--primary);
  border-radius:var(--radius-md);padding:14px 16px 13px;display:flex;flex-direction:column;gap:6px;
  transition:border-color var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out);
}
.bv2-win-card:hover{border-color:var(--primary-100);box-shadow:var(--shadow-sm)}
.bv2-win-card[data-cat="customer"]{border-left-color:#16A34A}
.bv2-win-card[data-cat="product"]{border-left-color:var(--primary)}
.bv2-win-card[data-cat="press"]{border-left-color:#9333EA}
.bv2-win-card[data-cat="community"]{border-left-color:#0EA5E9}
.bv2-win-card[data-cat="partnership"]{border-left-color:#F59E0B}
.bv2-win-card[data-cat="team"]{border-left-color:var(--text-muted)}
.bv2-win-card[data-cat="revenue"]{border-left-color:#16A34A}
.bv2-win-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.bv2-win-meta{display:flex;align-items:center;gap:8px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.06em;color:var(--text-muted)}
.bv2-win-cat-pill{background:var(--bg-subtle);color:var(--text);padding:2px 8px;border-radius:999px}
.bv2-win-actions{display:flex;gap:4px;opacity:0;transition:opacity var(--duration-fast) var(--ease-out)}
.bv2-win-card:hover .bv2-win-actions{opacity:1}
.bv2-win-action-btn{background:transparent;border:0;color:var(--text-muted);padding:4px 6px;border-radius:var(--radius-sm);cursor:pointer;font-family:inherit;font-size:11px}
.bv2-win-action-btn:hover{color:var(--error);background:var(--bg-subtle)}
.bv2-win-title{font-size:14px;font-weight:700;color:var(--text);line-height:1.4}
.bv2-win-impact{font-size:13px;font-weight:600;color:var(--primary)}
.bv2-win-desc{font-size:13px;color:var(--text-muted);line-height:1.55}
.bv2-win-link{font-size:11px;color:var(--primary);text-decoration:none}
.bv2-win-link:hover{text-decoration:underline}
.bv2-wins-empty{text-align:center;padding:40px 20px;color:var(--text-muted);font-size:13px}

@media(max-width:768px){
  .bv2-pane{padding:20px}
  .bv2-tab{padding:8px 14px;font-size:11px}
  .bv2-shadow-row{flex-wrap:wrap;gap:12px}
  .bv2-shadow-tile{width:84px;height:48px}
  .bv2-formula-text{font-size:15px}
  .bv2-ramp-row{flex-direction:column;align-items:stretch;gap:6px}
  .bv2-ramp-strip{height:40px}
}

/* Glass dashboard sections (pipeline, live pages, activity).
   In dark mode, the inset top-highlight is dimmed so it doesn't create a
   bright edge against the dark canvas. */
.cp-glass-card{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--bg-glass-border);
  box-shadow:var(--shadow-md),0 1px 0 rgba(255,255,255,0.6) inset;
  border-radius:var(--radius-xl);
  padding:22px 24px;
  margin-bottom:22px;
}
[data-theme="dark"] .cp-glass-card{
  box-shadow:var(--shadow-md),0 1px 0 rgba(255,255,255,0.06) inset;
}
.cp-glass-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;gap:12px;flex-wrap:wrap}
.cp-glass-title{font-size:14px;font-weight:700;color:var(--text);letter-spacing:-0.01em}
.cp-glass-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.cp-section-label{font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.1em;margin-bottom:10px}

/* Live page / blog chips — horizontal wrap, sky-tinted hover */
.cp-chip-row{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.cp-chip{
  display:inline-flex;
  align-items:center;
  gap:7px;
  background:rgba(255,255,255,0.7);
  border:1px solid var(--border);
  border-radius:var(--radius-pill);
  padding:7px 14px;
  font-size:12px;
  color:var(--text);
  text-decoration:none;
  font-weight:600;
  font-family:inherit;
  transition:background var(--duration-fast) var(--ease-out),border-color var(--duration-fast) var(--ease-out),transform var(--duration-fast) var(--ease-out),box-shadow var(--duration-fast) var(--ease-out);
  max-width:100%;
  cursor:pointer;
  white-space:nowrap;
}
.cp-chip:hover{background:var(--bg-card);border-color:var(--primary-100);transform:translateY(-1px);box-shadow:var(--shadow-sm)}
.cp-chip-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}
.cp-chip-dot--page{background:var(--green)}
.cp-chip-dot--blog{background:var(--purple)}
.cp-chip-text{overflow:hidden;text-overflow:ellipsis;max-width:240px;white-space:nowrap}
.cp-chip-meta{font-size:10px;color:var(--text-muted);font-weight:500;font-variant-numeric:tabular-nums}
.cp-chip-readmore{
  background:transparent;
  border:1px dashed var(--border);
  color:var(--text-muted);
  font-style:italic;
}
.cp-chip-readmore:hover{background:var(--bg-hover);color:var(--text);border-style:solid}

@media(max-width:1024px){
  .cp-success-strip{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:768px){
  .cp-success-strip{grid-template-columns:repeat(2,1fr)}
  .cp-sprint{padding:18px 22px;flex-direction:column;align-items:stretch;gap:14px}
  .cp-sprint-progress{max-width:none}
}
@media(max-width:480px){
  .cp-success-strip{grid-template-columns:1fr 1fr}
  .cp-success-value{font-size:22px}
  .cp-tab-grid{grid-template-columns:1fr}
}

/* =============================================================
   Daily progress grid (Team tab) — channel-driven EOD tracking. */
/* Daily progress widget — matches tv2-pulse-card glass styling so it
   reads as part of the Team tab design system. Lives at the bottom of
   the page; cells fill full width using a single grid (header row + per-
   member rows) so there's no awkward right-side whitespace. */
.dpg-card{
  background:var(--bg-glass);
  backdrop-filter:blur(22px) saturate(140%);
  -webkit-backdrop-filter:blur(22px) saturate(140%);
  border:1px solid var(--bg-glass-border);
  box-shadow:0 4px 24px rgba(16,24,40,0.06),0 1px 0 rgba(255,255,255,0.6) inset;
  border-radius:var(--radius-xl);
  padding:22px 24px;
}
.dpg-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:14px}
.dpg-head h3{margin:0;font-size:13px;font-weight:700;color:var(--text);letter-spacing:-0.01em}
.dpg-sub{margin:3px 0 0;font-size:11px;color:var(--text-muted);line-height:1.5}
.dpg-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.dpg-stat{font-size:11px;color:var(--text);font-weight:600;background:var(--sky-tint);padding:4px 10px;border-radius:var(--radius-pill)}
.dpg-legend{display:inline-flex;align-items:center;gap:14px;font-size:10px;color:var(--text-muted);font-weight:500}
.dpg-legend-dot{display:inline-flex;align-items:center;gap:5px}
.dpg-legend-dot::before{content:'';width:9px;height:9px;border-radius:2px;display:inline-block}
.dpg-legend-dot.posted::before{background:var(--green)}
.dpg-legend-dot.nudged-then-posted::before{background:#facc15}
.dpg-legend-dot.nudged-no-post::before{background:var(--red)}
.dpg-legend-dot.none::before{background:rgba(148,163,184,0.4)}
/* Grid header: name slot + 14 day labels. Cells fill the entire row. */
.dpg-grid{display:grid;grid-template-columns:148px repeat(14,minmax(0,1fr)) 44px;gap:0 6px;align-items:center;row-gap:6px}
.dpg-grid-head{display:contents;color:var(--text-muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.06em}
.dpg-grid-head > div{padding:0 0 6px;text-align:center;color:var(--text-muted);font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:0.06em}
.dpg-grid-head > div:first-child{text-align:left}
.dpg-row{display:contents}
.dpg-name{font-size:12px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dpg-cell{aspect-ratio:1;max-height:22px;border-radius:4px;background:rgba(148,163,184,0.18);position:relative;cursor:default;transition:transform 0.12s var(--ease-out),box-shadow 0.16s,filter 0.14s}
.dpg-cell:hover{transform:scale(1.5);box-shadow:0 4px 10px rgba(16,24,40,0.18);z-index:3;filter:brightness(1.05)}
.dpg-cell.posted          {background:var(--green);box-shadow:inset 0 0 0 1px rgba(255,255,255,0.4)}
.dpg-cell.nudged-then-posted{background:#facc15;box-shadow:inset 0 0 0 1px rgba(255,255,255,0.4)}
.dpg-cell.nudged-no-post  {background:var(--red);box-shadow:inset 0 0 0 1px rgba(255,255,255,0.4)}
.dpg-cell.none            {background:rgba(148,163,184,0.18)}
.dpg-cell-tip{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:#0D1117;color:#fff;font-size:10px;padding:4px 8px;border-radius:5px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity 0.16s;z-index:5}
.dpg-cell:hover .dpg-cell-tip{opacity:1}
.dpg-cell-detail{position:fixed;background:var(--card);border:1px solid var(--border);border-radius:10px;padding:12px 14px;box-shadow:0 8px 24px rgba(16,24,40,0.16);z-index:1000;max-width:360px;font-size:12px;line-height:1.5}
.dpg-cell-detail h5{margin:0 0 6px;font-size:13px;font-weight:700}
.dpg-cell-detail .meta{color:var(--text-muted);font-size:11px;margin-bottom:6px}
.dpg-streak{font-size:11px;color:var(--text-muted);text-align:center;font-weight:600}
.dpg-streak strong{color:var(--green);font-size:12px}
@media (max-width: 920px){
  .dpg-grid{grid-template-columns:120px repeat(14,minmax(0,1fr)) 36px}
  .dpg-name{font-size:11px}
}
@media (max-width: 720px){
  .dpg-grid{grid-template-columns:96px repeat(7,minmax(0,1fr));gap:0 4px}
  .dpg-grid-head > div:nth-child(-n+8) ~ div,
  .dpg-cell:nth-of-type(-n+7){display:none}
  .dpg-streak{display:none}
}

/* Team-member drawer — right-side slide-in, matches agent-drawer pattern.
   Uses .open class for animated entry (no inline display flips). */
.tm-drawer-backdrop{position:fixed;inset:0;background:rgba(13,17,23,0.45);backdrop-filter:blur(4px);opacity:0;pointer-events:none;transition:opacity 0.22s ease;z-index:9998}
.tm-drawer-backdrop.open{opacity:1;pointer-events:auto}
.tm-drawer{position:fixed;top:0;right:0;bottom:0;width:520px;max-width:92vw;background:var(--bg-card);box-shadow:-12px 0 32px rgba(13,17,23,0.18);transform:translateX(100%);transition:transform 0.28s cubic-bezier(0.4,0,0.2,1);z-index:9999;display:flex;flex-direction:column;overflow:hidden}
.tm-drawer.open{transform:translateX(0)}
.tm-drawer .tv2-modal-header{display:flex;justify-content:space-between;align-items:center;padding:18px 22px;border-bottom:1px solid var(--border-light);background:var(--bg-card);flex-shrink:0}
.tm-drawer .tv2-modal-header h2{margin:0;font-size:16px;font-weight:700;color:var(--text);letter-spacing:-0.01em}
.tm-drawer .tv2-modal-header button[aria-label="Close"]{width:30px;height:30px;border:none;background:var(--bg-subtle);border-radius:8px;color:var(--text-secondary);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:18px;transition:background 0.15s,color 0.15s}
.tm-drawer .tv2-modal-header button[aria-label="Close"]:hover{background:var(--border);color:var(--text)}
.tm-drawer .tv2-modal-body{padding:18px 22px;overflow-y:auto;flex:1;min-height:0}
.tm-drawer .tv2-modal-actions{padding:14px 22px;border-top:1px solid var(--border-light);background:var(--bg-card);flex-shrink:0}
@media (max-width: 720px){
  .tm-drawer{width:100vw;max-width:100vw}
}
@media(max-width:720px){
  .dpg-grid{grid-template-columns:120px 1fr}
  .dpg-streak{display:none}
  .dpg-cells{grid-template-columns:repeat(7,1fr)}
  .dpg-cell:nth-child(-n+7){display:none}
}

/* =============================================================
   PM Agent — multi-conversation tab. ChatGPT-style 3-pane layout
   with shared, searchable conversations. */
/* Two-pane: conversation list + chat, full width. Issue clicks open the
   full drawer overlay (same one used everywhere else) — no inline rail. */
.pma-shell{display:grid;grid-template-columns:280px 1fr;height:calc(100vh - 120px);min-height:520px;background:var(--card);border:1px solid var(--border-light);border-radius:14px;overflow:hidden}
.pma-sidebar{display:flex;flex-direction:column;background:var(--bg-subtle);border-right:1px solid var(--border-light);min-width:0}
.pma-sidebar-head{padding:14px 14px 10px;border-bottom:1px solid var(--border-light)}
.pma-new-btn{width:100%;display:flex;align-items:center;justify-content:center;gap:8px;padding:9px 12px;border:1px solid var(--primary);background:var(--primary);color:#fff;font-family:inherit;font-size:13px;font-weight:600;border-radius:var(--radius-md);cursor:pointer;transition:transform var(--duration-fast) var(--ease-out),box-shadow var(--duration-base) var(--ease-out)}
.pma-new-btn:hover{box-shadow:0 4px 12px color-mix(in srgb,var(--primary) 22%,transparent)}
.pma-sidebar-search{position:relative;padding:10px 14px;border-bottom:1px solid var(--border-light)}
.pma-sidebar-search svg{position:absolute;left:24px;top:50%;transform:translateY(-50%);color:var(--text-muted)}
.pma-sidebar-search input{width:100%;padding:8px 12px 8px 32px;border:1px solid var(--border);border-radius:8px;background:var(--bg-card);font-family:inherit;font-size:12px;color:var(--text)}
.pma-sidebar-search input:focus{outline:none;border-color:var(--primary)}
.pma-sidebar-list{flex:1;overflow-y:auto;padding:8px 0}
.pma-date-bucket{padding:10px 14px 4px;font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em}
.pma-conv-item{padding:10px 14px;cursor:pointer;border-left:3px solid transparent;transition:background 0.14s,border-color 0.14s}
.pma-conv-item:hover{background:color-mix(in srgb,var(--primary) 4%,transparent)}
.pma-conv-item.active{background:color-mix(in srgb,var(--primary) 8%,transparent);border-left-color:var(--primary)}
/* Design Agent threads get a violet accent so the eye instantly groups them
   apart from PM threads in the same list. */
.pma-conv-item.is-design:hover{background:color-mix(in srgb,var(--purple) 5%,transparent)}
.pma-conv-item.is-design.active{background:color-mix(in srgb,var(--purple) 10%,transparent);border-left-color:#7c3aed}
.pma-conv-title{font-size:13px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:3px;display:flex;align-items:center;gap:6px}
/* Kind chip: tiny pill prefixing the title, "PM" or "Design". */
.pma-kind-chip{flex-shrink:0;display:inline-flex;align-items:center;padding:1px 6px;border-radius:4px;font-size:11px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;line-height:1.4}
.pma-kind-chip.pm{background:color-mix(in srgb,var(--primary) 10%,transparent);color:var(--primary)}
.pma-kind-chip.design{background:color-mix(in srgb,var(--purple) 12%,transparent);color:#7c3aed}
.pma-conv-snippet{font-size:11px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pma-conv-foot{display:flex;align-items:center;justify-content:space-between;margin-top:5px;font-size:10px;color:var(--text-muted)}
.pma-avatars{display:flex;gap:-4px}
.pma-avatar{width:18px;height:18px;border-radius:50%;background:var(--bg-subtle);color:var(--text-muted);display:inline-flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;border:1.5px solid var(--bg-card);margin-left:-4px;text-transform:uppercase}
.pma-avatar:first-child{margin-left:0}
.pma-avatar.bot{background:linear-gradient(135deg,var(--primary),var(--sky));color:#fff}
.pma-avatar.bot.design{background:linear-gradient(135deg,#7c3aed,#a78bfa);color:#fff}
.pma-main{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--bg-card)}
.pma-main-head{display:flex;align-items:center;gap:14px;padding:14px 24px;border-bottom:1px solid var(--border-light);flex-shrink:0}
.pma-title-input{flex:0 0 auto;min-width:200px;max-width:400px;border:1px solid transparent;background:transparent;font-size:16px;font-weight:700;color:var(--text);padding:5px 10px;border-radius:6px;font-family:inherit}
.pma-title-input:hover{background:var(--bg-subtle)}
.pma-title-input:focus{outline:none;border-color:var(--primary);background:var(--bg-card)}
.pma-meta-row{flex:1;display:flex;align-items:center;gap:8px;font-size:11px;color:var(--text-muted)}
.pma-meta-dot{opacity:0.5}
.pma-actions{display:inline-flex;gap:6px}
.pma-thread{flex:1 1 auto;min-height:0;overflow-y:auto;padding:24px 32px;background:var(--bg-card)}
.pma-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--text-muted);text-align:center;padding:40px}
.pma-empty h3{margin:14px 0 6px;font-size:16px;font-weight:600;color:var(--text)}
.pma-empty p{font-size:13px;max-width:380px;line-height:1.55}
/* Thread reads as prose: capped width so long answers don't sprawl */
.pma-thread > *{max-width:820px;margin-left:auto;margin-right:auto}
.pma-msg{display:flex;gap:14px;margin-bottom:24px;animation:pmaMsgIn 0.22s cubic-bezier(0.2,0.8,0.3,1)}
.pma-msg + .pma-msg.same-author{margin-top:-12px}
.pma-msg + .pma-msg.same-author .pma-msg-avatar,
.pma-msg + .pma-msg.same-author .pma-msg-head{visibility:hidden;height:0;margin:0;padding:0;overflow:hidden}
@keyframes pmaMsgIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
.pma-msg-avatar{width:30px;height:30px;border-radius:50%;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:0.02em}
.pma-msg-avatar.user{background:var(--primary-50);color:var(--primary)}
.pma-msg-avatar.assistant{background:linear-gradient(135deg,var(--primary),var(--sky));color:#fff}
.pma-msg-body{flex:1;min-width:0;padding-top:3px}
.pma-msg-head{display:flex;align-items:baseline;gap:8px;margin-bottom:6px}
.pma-msg-author{font-size:13px;font-weight:600;color:var(--text)}
.pma-msg-ts{font-size:11px;color:var(--text-muted);font-weight:500}
/* Body text: tighter line-height + better hierarchy across markdown blocks */
.pma-msg-text{font-size:14.5px;line-height:1.65;color:var(--text);word-wrap:break-word}
.pma-msg-text > *:first-child{margin-top:0}
.pma-msg-text > *:last-child{margin-bottom:0}
.pma-msg-text p{margin:0 0 12px}
.pma-msg-text strong{font-weight:600;color:var(--text)}
.pma-msg-text em{font-style:italic;color:var(--text)}
.pma-msg-text h1,.pma-msg-text h2,.pma-msg-text h3,.pma-msg-text h4{margin:18px 0 8px;font-weight:700;color:var(--text);line-height:1.3;letter-spacing:-0.01em}
.pma-msg-text h1{font-size:18px;margin-top:4px}
.pma-msg-text h2{font-size:16px}
.pma-msg-text h3{font-size:14.5px}
.pma-msg-text h4{font-size:13.5px;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.05em}
.pma-msg-text ul,.pma-msg-text ol{margin:6px 0 14px;padding-left:22px}
.pma-msg-text li{margin:0 0 5px;line-height:1.6}
.pma-msg-text li > p{margin:0 0 4px}
.pma-msg-text li::marker{color:var(--text-muted)}
.pma-msg-text ul ul,.pma-msg-text ol ol,.pma-msg-text ul ol,.pma-msg-text ol ul{margin:4px 0}
.pma-msg-text blockquote{margin:8px 0;padding:6px 12px;border-left:3px solid var(--border);background:var(--bg-subtle);color:var(--text);border-radius:0 6px 6px 0}
.pma-msg-text blockquote p{margin:0}
.pma-msg-text hr{border:0;border-top:1px solid var(--border-light);margin:18px 0}
.pma-msg-text code{background:var(--bg-subtle);padding:2px 6px;border-radius:4px;font-size:12.5px;font-family:ui-monospace,SFMono-Regular,'SF Mono',Menlo,monospace;color:var(--text)}
.pma-msg-text pre{background:#0D1117;color:#E6EDF3;padding:14px 16px;border-radius:10px;overflow-x:auto;font-size:12.5px;line-height:1.55;margin:10px 0;border:1px solid rgba(255,255,255,0.05)}
.pma-msg-text pre code{background:transparent;padding:0;color:inherit;font-size:12.5px}
.pma-msg-text a{color:var(--primary);text-decoration:none;border-bottom:1px solid color-mix(in srgb,var(--primary) 25%,transparent);transition:border-color 0.16s}
.pma-msg-text a:hover{border-bottom-color:var(--primary)}
.pma-msg-text table{width:100%;border-collapse:collapse;margin:10px 0;font-size:13px;background:var(--card);border:1px solid var(--border-light);border-radius:8px;overflow:hidden}
.pma-msg-text th{background:var(--bg-subtle);padding:8px 12px;text-align:left;font-weight:600;font-size:11px;text-transform:uppercase;letter-spacing:0.04em;color:var(--text-muted);border-bottom:1px solid var(--border-light)}
.pma-msg-text td{padding:8px 12px;border-bottom:1px solid var(--border-light)}
.pma-msg-text tr:last-child td{border-bottom:0}
.pma-msg-text tr:hover td{background:color-mix(in srgb,var(--primary) 3%,transparent)}
/* Inline issue-key chips: rendered by pmaLinkifyIssueKeys */
.pma-issue-link{display:inline-flex;align-items:center;gap:4px;padding:1px 7px;background:color-mix(in srgb,var(--primary) 8%,transparent);color:var(--primary);font-weight:600;border-radius:5px;text-decoration:none;font-size:12.5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:0.01em;border:0;transition:background 0.14s,transform 0.12s}
.pma-issue-link:hover{background:color-mix(in srgb,var(--primary) 14%,transparent);transform:translateY(-1px);border-bottom:0 !important}
.pma-issue-link.sprint{background:rgba(34,160,107,0.10);color:var(--success-fg)}
.pma-issue-link.sprint:hover{background:rgba(34,160,107,0.16)}
.pma-issue-link.kan{background:rgba(139,92,246,0.10);color:#7c3aed}
.pma-issue-link.kan:hover{background:rgba(139,92,246,0.16)}
/* Brief flash on the destination sprint card after a jump from chat */
.proj-sprint-flash{animation:projSprintFlash 1.4s ease-out}
@keyframes projSprintFlash{0%{background:rgba(34,160,107,0.20);box-shadow:0 0 0 3px rgba(34,160,107,0.30)}100%{background:transparent;box-shadow:none}}
.pma-tool-card{display:inline-flex;align-items:center;gap:10px;background:var(--bg-subtle);border:1px solid var(--border-light);border-left:3px solid #0EA5E9;border-radius:8px;padding:7px 12px;margin:8px 6px 8px 0;font-size:12px;color:var(--text);transition:background 0.14s,transform 0.12s;font-family:inherit;max-width:100%}
.pma-tool-card:hover{background:var(--border-light)}
.pma-tool-card.success{border-left-color:#22c55e}
.pma-tool-card.error{border-left-color:#ef4444;background:var(--red-light)}
.pma-tool-icon{width:20px;height:20px;border-radius:50%;background:#0EA5E9;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:11px;flex-shrink:0}
.pma-tool-card.success .pma-tool-icon{background:#22c55e}
.pma-tool-card.error   .pma-tool-icon{background:#ef4444}
.pma-tool-name{font-weight:600;color:var(--text)}
.pma-tool-summary{color:var(--text-muted)}
/* Loading state: rotating Islamic-themed phrases (Bismillah, In Sha Allah,
   Make dua…) instead of plain dots, with three little pulsing dots beside
   the phrase for motion. The phrase cross-fades on each rotation. */
.pma-typing{display:inline-flex;align-items:center;gap:10px;padding:6px 0;font-size:13.5px;color:var(--text);font-weight:500;font-style:italic;letter-spacing:0.005em}
.pma-typing-dots{display:inline-flex;gap:3px;flex-shrink:0}
.pma-typing-dots span{width:5px;height:5px;background:var(--primary);border-radius:50%;animation:pmaTypingDot 1.1s infinite}
.pma-typing-dots span:nth-child(2){animation-delay:0.16s}
.pma-typing-dots span:nth-child(3){animation-delay:0.32s}
@keyframes pmaTypingDot{0%,60%,100%{opacity:0.25;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.pma-typing-phrase{display:inline-block;background:linear-gradient(90deg,var(--primary) 0%,var(--sky) 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent;animation:pmaPhraseFade 1.6s ease-in-out}
@keyframes pmaPhraseFade{0%{opacity:0;transform:translateY(2px)}20%,80%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-2px)}}
.pma-compose{display:flex;align-items:flex-end;gap:10px;padding:14px 24px;border-top:1px solid var(--border-light);background:var(--bg-card);flex-shrink:0}
.pma-compose textarea{flex:1;border:1px solid var(--border);border-radius:10px;padding:10px 14px;font-family:inherit;font-size:14px;line-height:1.5;color:var(--text);background:var(--bg-card);resize:none;min-height:42px;max-height:200px;outline:none;transition:border-color 0.18s,box-shadow 0.18s}
.pma-compose textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 8%,transparent)}
.pma-send-btn{width:42px;height:42px;border-radius:var(--radius);border:0;background:var(--primary);color:#fff;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;transition:background var(--duration-base) var(--ease-out),transform var(--duration-fast) var(--ease-out)}
.pma-send-btn:hover:not(:disabled){background:var(--primary-dark,#003d75);transform:translateY(-1px)}
.pma-send-btn:disabled{background:var(--text-muted);cursor:not-allowed;opacity:0.6}
.pma-rail{background:var(--bg-subtle);border-left:1px solid var(--border-light);overflow:hidden;display:flex;flex-direction:column;min-width:0}
.pma-rail-head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--border-light);background:var(--bg-card);flex-shrink:0}
.pma-rail-head .key{display:inline-flex;align-items:center;padding:3px 10px;background:color-mix(in srgb,var(--primary) 8%,transparent);color:var(--primary);font-weight:700;border-radius:6px;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:0.01em}
.pma-rail-head .title{flex:1;font-size:13px;font-weight:600;color:var(--text);min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pma-rail-head button{background:transparent;border:0;color:var(--text-muted);cursor:pointer;padding:6px;border-radius:6px;display:inline-flex;transition:background 0.15s,color 0.15s}
.pma-rail-head button:hover{background:var(--bg-subtle);color:var(--text)}
.pma-rail-body{flex:1;overflow-y:auto;padding:16px 18px}
.pma-rail-row{display:flex;justify-content:space-between;gap:12px;padding:6px 0;font-size:12px;border-bottom:1px solid var(--border-light)}
.pma-rail-row:last-of-type{border-bottom:0}
.pma-rail-row .label{color:var(--text-muted);font-weight:500}
.pma-rail-row .value{color:var(--text);font-weight:600;text-align:right}
.pma-rail-section{margin-top:18px}
.pma-rail-section h4{margin:0 0 8px;font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.06em}
.pma-rail-section .desc{font-size:13px;line-height:1.55;color:var(--text);background:var(--bg-card);border:1px solid var(--border-light);border-radius:8px;padding:10px 12px;max-height:240px;overflow-y:auto}
.pma-rail-empty{padding:40px 24px;text-align:center;color:var(--text-muted);font-size:12px;line-height:1.55}
.pma-rail-loading{padding:40px 24px;text-align:center;color:var(--text-muted);font-size:12px}
.pma-rail-foot{padding:10px 16px;border-top:1px solid var(--border-light);background:var(--bg-card);flex-shrink:0}
.pma-rail-open-full{display:block;width:100%;padding:8px 12px;border:1px solid var(--border);border-radius:8px;background:var(--bg-card);color:var(--text);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background 0.14s,border-color 0.14s}
.pma-rail-open-full:hover{background:var(--bg-subtle);border-color:var(--primary)}
.pma-search-results{padding:6px 0}
.pma-search-result{padding:9px 14px;cursor:pointer;border-left:3px solid transparent;transition:background 0.14s}
.pma-search-result:hover{background:color-mix(in srgb,var(--primary) 4%,transparent);border-left-color:var(--primary)}
.pma-search-result-title{font-size:12px;font-weight:600;color:var(--text);margin-bottom:2px}
.pma-search-result-snippet{font-size:11px;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pma-search-result-snippet mark{background:rgba(255,221,0,0.4);color:inherit;padding:1px 2px;border-radius:2px}
@media (max-width: 1100px){
  .pma-shell{grid-template-columns:240px 1fr}
  .pma-rail{display:none !important}
}
@media (max-width: 720px){
  .pma-shell{grid-template-columns:1fr;height:calc(100vh - 100px)}
  .pma-sidebar{display:none}
  .pma-sidebar.mobile-open{display:flex;position:fixed;inset:60px 0 0 0;z-index:30;background:var(--card)}
  .pma-thread{padding:16px}
  .pma-compose{padding:10px 12px}
}

/* =============================================================
   Subtle motion pass (May 2026) — uniform feel across the app.
   Affects existing components without changing layout. Honors
   prefers-reduced-motion. */

/* 1. Buttons: gentle press scale + hover lift on the common ones. */
button, .btn, .proj-btn-primary, .proj-btn-ghost,
.btn-approve, .btn-discuss, .ping-btn, .stop-btn-dash,
.proj-chip, .proj-tab, .proj-filter-btn {
  transition: transform 0.12s ease, box-shadow 0.18s ease,
              background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
button:not(:disabled):active, .btn:not(:disabled):active,
.proj-btn-primary:not(:disabled):active, .proj-btn-ghost:not(:disabled):active {
  transform: scale(0.97);
}
.proj-btn-primary:not(:disabled):hover, .btn-approve:not(:disabled):hover {
  box-shadow: 0 3px 10px color-mix(in srgb,var(--primary) 18%,transparent);
}

/* 2. Card / row hover lift — apply to common card patterns. */
.proj-card, .proj-sprint-card, .proj-board-card,
.stat-card, .approval-card, .proj-folder-row, .proj-backlog-row {
  transition: transform 0.16s ease, box-shadow 0.18s ease,
              background 0.16s ease, border-color 0.16s ease;
}
.proj-card:hover, .proj-sprint-card:hover, .proj-board-card:hover,
.stat-card:hover, .approval-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13,17,23,0.06);
}

/* 3. Tab switching — fade-in for newly activated panels. */
.tab-panel.fade-in, .proj-listview.fade-in, .panel.fade-in {
  animation: uoTabFadeIn 0.22s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes uoTabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 4. Toast slide-in (extends existing). */
@keyframes uoToastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 5. Drag ghost: faded + tilted while dragging. */
[draggable=true].dragging,
.proj-board-card.dragging, .proj-folder-row.dragging {
  opacity: 0.5;
  transform: rotate(-1.2deg) scale(0.99);
  cursor: grabbing !important;
}

/* 6. Status / priority chip pulse on update. */
.proj-edit-chip.just-changed, .proj-status-chip.just-changed,
.proj-priority-chip.just-changed {
  animation: uoChipPulse 0.6s cubic-bezier(0.2, 1.4, 0.3, 1);
}
@keyframes uoChipPulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 color-mix(in srgb,var(--primary) 40%,transparent); }
  40%  { transform: scale(1.08); box-shadow: 0 0 0 6px color-mix(in srgb,var(--primary) 0%,transparent); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 color-mix(in srgb,var(--primary) 0%,transparent); }
}

/* 7. Skeleton shimmer (for list loaders). */
.uo-skel {
  background: linear-gradient(90deg, var(--bg-subtle) 0%, rgba(0,0,0,0.04) 50%, var(--bg-subtle) 100%);
  background-size: 200% 100%;
  animation: uoSkel 1.4s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes uoSkel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 8. Drawer / modal default entry (used by .open transition on existing
   drawers — keep cubic-bezier consistent). */
.proj-drawer, .agent-drawer {
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.proj-drawer-overlay, .agent-drawer-backdrop {
  transition: opacity 0.22s ease;
}

/* 9. Sidebar nav item hover. */
.nav-item:hover { background: rgba(255,255,255,0.04); transform: translateX(1px); }
.nav-item.active { transform: none; }

/* 10. Honor reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Looping pulse / typing / shimmer effects off entirely (Phase D, 2026-06-10). */
  .status-dot, .org-pulse, .typing span, .pma-typing-dots span, .pma-typing-phrase,
  .agd-status.active .agd-status-dot, .fin-thinking span, .proj-desc-draft-dot,
  .topbar-emergency-status::before, .tv2-heartbeat-dot--error, .tv2-pulse::after,
  .cc-card-generating, .cal-event.cc-card-generating, .uo-skel,
  .proj-rm-bar.kind-current, .spinner {
    animation: none !important;
  }
}

/* =============================================================
   Mobile responsive pass (May 2026) — unify the breakpoint
   behavior across older tabs. Targets <=720px (tablet/phone)
   and <=480px (small phone). Doesn't touch desktop layout. */
@media (max-width: 720px) {
  /* Modals — full-screen with sticky header/footer */
  .modal-content, .proj-modal-card, .proj-create-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  /* Tab strips — horizontal scroll with snap */
  .proj-tabs, .tab-strip, .panel-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    flex-wrap: nowrap !important;
    padding-bottom: 4px;
  }
  .proj-tabs::-webkit-scrollbar, .tab-strip::-webkit-scrollbar { height: 0; }
  .proj-tab, .tab-strip > * { scroll-snap-align: start; flex-shrink: 0; }

  /* Sidebar — push content full width when nav is hidden */
  .main-content, .content-wrap { padding-left: 0 !important; }

  /* Toolbars wrap, search inputs full-width */
  .proj-toolbar { flex-wrap: wrap; gap: 8px; }
  .proj-toolbar input[type=text], .proj-toolbar input[type=search],
  .proj-toolbar input:not([type]) { flex: 1 1 100%; min-width: 0; }

  /* Drawer becomes bottom sheet */
  .proj-drawer {
    top: auto !important; left: 0 !important; right: 0 !important;
    width: 100% !important; height: 88vh !important; max-width: 100vw !important;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%) !important;
  }
  .proj-drawer.open { transform: translateY(0) !important; }

  /* Tables -> stacked cards */
  table.responsive-stack thead { display: none; }
  table.responsive-stack tr {
    display: block;
    margin-bottom: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 8px 10px;
  }
  table.responsive-stack td {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 4px 0; border: 0;
  }
  table.responsive-stack td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  /* Project sprints + folders — stack sidebar above main */
  .proj-body { flex-direction: column; }
  .proj-sidebar {
    width: 100% !important; max-width: 100% !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--border-light);
    max-height: 220px;
  }

  /* Reports grid → single column */
  .proj-reports-grid { grid-template-columns: 1fr !important; }
  .proj-throughput-grid { grid-template-columns: 1fr !important; }

  /* Topbar — compact */
  .topbar { padding: 10px 14px; }
  .topbar h1 { font-size: 16px; }

  /* Forms */
  .proj-form-row { flex-direction: column; align-items: stretch !important; }
  .proj-form-row label { min-width: 0 !important; }
}
@media (max-width: 480px) {
  .proj-tab { font-size: 12px; padding: 6px 10px; }
  .stat-card, .approval-card { padding: 14px; }
  .proj-celebration-stats { grid-template-columns: 1fr 1fr !important; }
  /* Create-issue modal form rows collapse to 1 column so dropdowns aren't crushed */
  .proj-create-row { grid-template-columns: 1fr !important; gap: 10px !important; }
  /* Wins form + multi-list */
  .bv2-wins-form-row { flex-direction: column; }
  /* Send Log table — table itself already scrolls horizontally; tighten pagination */
  .sl-pagination { padding: 12px 14px; font-size: 11px; }
  /* tv2 kpi strip */
  .tv2-kpi-strip { grid-template-columns: 1fr 1fr !important; }
}
