/* ═════════════════════════════════════════════════════════════════
   EY Lattice — platform CSS
   Palette: EY Yellow #FFE600 on EY Black #2E2E38.
   Shape language: sharp corners, flat elevation, small radii (4–6px),
                   horizontal yellow rules as section dividers.
   Density: information-dense dashboards, tables first, chat second.
   ═════════════════════════════════════════════════════════════════ */

:root {
  /* EY core */
  --ey-yellow:       #FFE600;
  --ey-yellow-hover: #FFF04D;
  --ey-yellow-dim:   #D9C300;

  --ey-black:        #2E2E38;
  --ey-black-2:      #1F1F28;
  --ey-black-3:      #16161D;
  --ey-line:         #3A3A44;
  --ey-line-strong:  #4A4A56;
  --ey-line-subtle:  #2A2A34;

  --text:            #FFFFFF;
  --text-muted:      #B8B8C0;
  --text-faint:      #6F6F7C;

  --ok:    #34C27A;
  --warn:  #F5A524;
  --err:   #EF4E4E;
  --info:  #7AB4FF;

  /* Status chips */
  --status-active:    #34C27A;
  --status-proposed:  #7AB4FF;
  --status-paused:    #F5A524;
  --status-closed:    #6F6F7C;

  /* Message bubbles */
  --bubble-user:       var(--ey-yellow);
  --bubble-user-text:  var(--ey-black);
  --bubble-agent:      var(--ey-black-2);

  --radius:    4px;
  --radius-lg: 6px;

  --font-sans: "EYInterstate", "Helvetica Neue", Helvetica, "Segoe UI", Arial, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Roboto Mono", Consolas, monospace;

  --sidebar-w: 260px;
  --topbar-h:  56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--ey-black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

a { color: var(--ey-yellow); text-decoration: none; }
a:hover { color: var(--ey-yellow-hover); }
.agent-link { color: var(--text); border-bottom: 1px dotted var(--ey-yellow); }
.agent-link:hover { color: var(--ey-yellow); }

code {
  font-family: var(--font-mono);
  background: rgba(255, 230, 0, 0.08);
  color: var(--ey-yellow);
  padding: 0.05em 0.4em;
  border-radius: 2px;
  font-size: 0.9em;
}
.t-mono    { font-family: var(--font-mono); letter-spacing: 0.01em; }
.t-strong  { font-weight: 600; }
.t-dim     { color: var(--text-muted); font-size: 13px; }

/* ─── Auth (login) ──────────────────────────────────────────────── */
.auth-body {
  display: grid; place-items: center; min-height: 100%;
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(255, 230, 0, 0.05) 0%, transparent 60%),
    radial-gradient(700px 400px at 10% 90%, rgba(255, 230, 0, 0.03) 0%, transparent 55%),
    var(--ey-black);
}
.auth-card {
  width: min(92vw, 440px);
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--ey-yellow);
}
.auth-header { display: grid; gap: 18px; margin-bottom: 28px; }
.auth-title  { display: grid; gap: 4px; }
.auth-header h1 { margin: 0; font-size: 24px; }
.brand-sub   { margin: 0; color: var(--text-muted); font-size: 14px; }
.brand-tagline { margin-top: 4px; color: var(--text-muted); font-size: 13px; font-style: italic; }

.logo-panel {
  background: #F6F6F8;
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  width: 100%;
}
.ey-logo-lockup { display: block; max-width: 220px; width: 100%; height: auto; }
.ey-logo-sidebar {
  display: block; height: 28px; width: auto;
  filter: brightness(0) invert(1);
  flex-shrink: 0; user-select: none;
}

.auth-error {
  background: rgba(239, 78, 78, 0.12);
  border: 1px solid rgba(239, 78, 78, 0.45);
  border-left: 3px solid var(--err);
  color: #FBD7D7;
  padding: 10px 14px; border-radius: var(--radius);
  margin-bottom: 18px; font-size: 14px;
}
.auth-form { display: grid; gap: 16px; }
.auth-form label {
  display: grid; gap: 6px;
  color: var(--text-muted); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.auth-form input {
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--ey-black-3); border: 1px solid var(--ey-line);
  padding: 12px 14px; border-radius: var(--radius);
  outline: none; transition: border-color 120ms ease, box-shadow 120ms ease;
}
.auth-form input:hover { border-color: var(--ey-line-strong); }
.auth-form input:focus { border-color: var(--ey-yellow); box-shadow: 0 0 0 2px rgba(255, 230, 0, 0.18); }
.auth-form button {
  margin-top: 6px; padding: 13px 16px; border-radius: var(--radius);
  font: inherit; font-size: 14px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--ey-black); background: var(--ey-yellow); border: 0; cursor: pointer;
}
.auth-form button:hover { background: var(--ey-yellow-hover); }
.auth-footer {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--ey-line);
  text-align: center; color: var(--text-faint); font-size: 11px;
  letter-spacing: 0.05em; text-transform: uppercase;
}

/* ─── App shell ─────────────────────────────────────────────────── */
.app-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--ey-black);
}

/* Sidebar */
.app-sidebar {
  display: flex; flex-direction: column;
  background: var(--ey-black-2);
  border-right: 1px solid var(--ey-line);
  min-width: 0;
  position: sticky; top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex; gap: 12px; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ey-line);
  position: relative;
}
.sidebar-brand::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--ey-yellow); opacity: 0.9;
}
.brand-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.brand-tag   {
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.08em; text-transform: uppercase; margin-top: 2px;
}

.sidebar-nav {
  display: flex; flex-direction: column; padding: 12px 10px;
  gap: 2px;
}
.sidebar-nav--secondary { padding-top: 0; }

.nav-section {
  padding: 10px 12px 6px;
  color: var(--text-faint);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.nav-item:hover {
  color: var(--text);
  background: rgba(255, 230, 0, 0.04);
  border-left-color: var(--ey-yellow);
}
.nav-item.is-active {
  color: var(--text);
  background: rgba(255, 230, 0, 0.08);
  border-left-color: var(--ey-yellow);
  font-weight: 600;
}
.nav-item.is-disabled {
  color: var(--text-faint);
  cursor: not-allowed;
  border-left-color: transparent;
}
.nav-item.is-disabled:hover {
  background: transparent;
  border-left-color: transparent;
}
.nav-icon {
  width: 18px; display: inline-block; text-align: center;
  color: var(--ey-yellow);
  font-size: 14px;
  opacity: 0.85;
}
.nav-item.is-disabled .nav-icon { opacity: 0.4; }

.sidebar-divider {
  height: 1px;
  background: var(--ey-line);
  margin: 12px 14px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--ey-line);
}
.user-chip {
  display: flex; gap: 10px; align-items: center;
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--ey-yellow);
  color: var(--ey-black);
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.user-meta { display: grid; font-size: 13px; line-height: 1.3; }
.user-name { font-weight: 600; }
.user-signout { font-size: 12px; color: var(--text-muted); }
.user-signout:hover { color: var(--ey-yellow); }

/* Main area */
.app-main {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 100vh;
}
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: var(--ey-black-2);
  border-bottom: 1px solid var(--ey-line);
  position: sticky; top: 0; z-index: 10;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--ey-yellow); opacity: 0.35;
}
.breadcrumb {
  display: flex; gap: 8px; align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}
.crumb-sep     { color: var(--text-faint); }
.crumb-current { color: var(--text); font-weight: 600; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.page {
  padding: 28px 32px 48px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
.page-head { margin-bottom: 20px; }
.page-head h1 { margin-bottom: 4px; }
.page-sub    { color: var(--text-muted); font-size: 14px; margin: 0; }

.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.section-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; }
.section-head-inline { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 10px; font-weight: 700; }
.section-link {
  font-size: 12px; letter-spacing: 0.04em;
  color: var(--ey-yellow);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: var(--radius);
  font: inherit; font-size: 13px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; border: 0;
  transition: background 120ms ease, transform 60ms ease;
}
.btn-primary {
  color: var(--ey-black); background: var(--ey-yellow);
}
.btn-primary:hover { background: var(--ey-yellow-hover); color: var(--ey-black); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--ey-line-strong);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

/* ─── Dashboard ─────────────────────────────────────────────────── */
.hero {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(255, 230, 0, 0.08) 0%, transparent 60%);
  border: 1px solid var(--ey-line);
  border-left: 3px solid var(--ey-yellow);
  border-radius: var(--radius);
  margin-bottom: 22px;
}
.hero-eyebrow {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600; margin-bottom: 6px;
}
.hero-title { font-size: 22px; margin-bottom: 4px; }
.hero-sub   { color: var(--text-muted); font-size: 14px; margin: 0; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.kpi-card {
  padding: 18px 20px;
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius);
  position: relative;
}
.kpi-card--accent { border-left: 3px solid var(--ey-yellow); }
.kpi-label {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; margin-bottom: 10px;
}
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; line-height: 1; }
.kpi-value--text { font-size: 18px; font-weight: 700; }
.kpi-total { font-size: 16px; color: var(--text-faint); font-weight: 400; }
.kpi-sub   { color: var(--text-muted); font-size: 12px; margin-top: 8px; }

.split {
  display: grid; grid-template-columns: 2fr 1fr; gap: 22px;
}
@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
}

/* Engagement cards */
.card-list { display: grid; gap: 10px; }
.eng-card {
  display: block;
  padding: 14px 16px;
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 120ms ease, transform 60ms ease;
}
.eng-card:hover { border-color: var(--ey-yellow); color: var(--text); }
.eng-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.eng-code { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); letter-spacing: 0.02em; }
.eng-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.eng-meta { font-size: 12px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px; }
.eng-dot  { color: var(--text-faint); }

/* Status chip */
.status-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border: 1px solid var(--ey-line);
}
.status-chip.status-active   { background: rgba(52, 194, 122, 0.12); color: var(--status-active);   border-color: rgba(52,194,122,0.35); }
.status-chip.status-proposed { background: rgba(122, 180, 255, 0.12); color: var(--status-proposed); border-color: rgba(122,180,255,0.35); }
.status-chip.status-paused   { background: rgba(245, 165, 36, 0.12); color: var(--status-paused);   border-color: rgba(245,165,36,0.35); }
.status-chip.status-closed   { background: rgba(111, 111, 124, 0.15); color: var(--text-muted);      border-color: var(--ey-line-strong); }

/* Activity list */
.activity-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 2px;
}
.activity-list li {
  display: grid; grid-template-columns: 14px 1fr; gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--ey-line-subtle);
}
.activity-list li:first-child { border-top: 0; }
.activity-list--compact li { padding: 8px 0; border-top-color: var(--ey-line-subtle); }

.activity-dot {
  width: 8px; height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}
.activity-dot.kind-message { background: var(--ey-yellow); }
.activity-dot.kind-engagement_created { background: var(--status-active); }
.activity-dot.kind-engagement_updated { background: var(--status-proposed); }

.activity-body { min-width: 0; }
.activity-summary {
  color: var(--text);
  font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.activity-meta  {
  color: var(--text-muted); font-size: 12px; margin-top: 2px;
}
.activity-kind {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.activity-empty {
  padding: 20px 12px !important;
  color: var(--text-muted); font-style: italic; text-align: center;
}

/* ─── Engagements: list (table) ─────────────────────────────────── */
.filter-tabs {
  display: flex; gap: 4px;
  margin-top: 14px;
}
.filter-tab {
  padding: 6px 14px;
  color: var(--text-muted);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius);
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
}
.filter-tab:hover { color: var(--text); border-color: var(--ey-line-strong); }
.filter-tab.is-active {
  color: var(--ey-black); background: var(--ey-yellow); border-color: var(--ey-yellow);
}

.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
  border-bottom: 1px solid var(--ey-line);
  background: var(--ey-black-3);
}
.data-table tbody tr {
  cursor: pointer;
  transition: background 120ms ease;
}
.data-table tbody tr:hover,
.data-table tbody tr:focus-visible {
  background: rgba(255,230,0,0.04);
  outline: none;
}
.data-table tbody td {
  padding: 12px 14px;
  font-size: 14px;
  border-top: 1px solid var(--ey-line-subtle);
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  background: var(--ey-black-2);
  border: 1px dashed var(--ey-line-strong);
  border-radius: var(--radius-lg);
}
.empty-state p { margin-bottom: 16px; color: var(--text-muted); }

/* ─── Engagement: new form ──────────────────────────────────────── */
.form-card {
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  max-width: 720px;
}
.form-row { display: grid; gap: 10px; margin-bottom: 18px; }
.form-row--2 { grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row label {
  display: grid; gap: 6px;
  color: var(--text-muted); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.form-row input,
.form-row select,
.form-row textarea {
  font-family: var(--font-sans); font-size: 14px; color: var(--text);
  background: var(--ey-black-3); border: 1px solid var(--ey-line);
  padding: 10px 12px; border-radius: var(--radius);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.form-row textarea { resize: vertical; min-height: 100px; font-family: var(--font-sans); }
.form-row small { color: var(--text-faint); font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: normal; }
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--ey-yellow);
  box-shadow: 0 0 0 2px rgba(255, 230, 0, 0.15);
}
.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 14px; border-top: 1px solid var(--ey-line);
}

/* ─── Engagement: detail ────────────────────────────────────────── */
.eng-head {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(255, 230, 0, 0.06) 0%, transparent 60%);
  border: 1px solid var(--ey-line);
  border-left: 3px solid var(--ey-yellow);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.eng-head-code {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 6px;
}
.eng-head-title { font-size: 22px; margin-bottom: 8px; }
.eng-head-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-muted); }
.meta-chip strong { color: var(--text); font-weight: 600; }

.tabs {
  display: flex;
  border-bottom: 1px solid var(--ey-line);
  margin-bottom: 18px;
  /* Stick under the sticky topbar so navigation is always reachable. */
  position: sticky;
  top: var(--topbar-h, 56px);
  z-index: 5;
  background: var(--ey-black-2);
  /* Mobile/narrow: scroll horizontally instead of wrapping or cramming. */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tabs::-webkit-scrollbar { height: 4px; }
.tabs::-webkit-scrollbar-thumb { background: var(--ey-line); border-radius: 2px; }
.tab {
  padding: 10px 16px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.tab:hover { color: var(--text); }
.tab:focus-visible {
  outline: 2px solid var(--ey-yellow);
  outline-offset: -4px;
  border-radius: 2px;
}
.tab.is-active {
  color: var(--ey-yellow); border-bottom-color: var(--ey-yellow);
}
.tab.is-disabled { color: var(--text-faint); cursor: not-allowed; }
.tab.is-disabled:hover { color: var(--text-faint); }

.panel {
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  overflow: hidden;
}
.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ey-line);
  background: var(--ey-black-3);
}
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-sub { margin: 6px 0 0; color: var(--text-muted); font-size: 13px; }
.panel-body { padding: 18px 20px; }
.panel-empty { color: var(--text-muted); margin: 0; }

.brief-text {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  margin: 0;
}

/* ─── Chat panel (inside engagement) ────────────────────────────── */
.chat-panel {
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius-lg);
  min-height: 60vh;
  max-height: calc(100vh - 260px);
  overflow: hidden;
}
.messages {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.msg {
  display: flex;
  flex-direction: column;
  /* Cap at a comfortable reading width — without this, when the chat
     panel goes full canvas (~1760px), a bubble at 78% balloons to
     ~1370px and short messages look like giant empty rectangles. */
  max-width: min(720px, 78%);
}
.msg.msg-user { align-self: flex-end; align-items: flex-end; }
.msg.msg-user .msg-body {
  /* Shrink user bubble to content so a one-line reply doesn't stretch
     across the whole 720px cap. Agent bubbles stay full-width within
     their .msg so multi-paragraph markdown lays out naturally. */
  width: fit-content;
  max-width: 100%;
}
.msg.msg-agent { align-self: flex-start; }
.msg.msg-system {
  align-self: center; max-width: 680px; text-align: center;
}
.msg-meta {
  font-size: 11px; color: var(--text-muted);
  margin-bottom: 5px; letter-spacing: 0.02em; font-weight: 500;
}
.msg-meta strong {
  color: var(--ey-yellow); font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.msg-time { color: var(--text-faint); margin-left: 4px; }
.msg-body {
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--bubble-agent);
  border: 1px solid var(--ey-line);
  border-left: 3px solid var(--ey-yellow);
  line-height: 1.6;
  white-space: pre-wrap; word-wrap: break-word;
  font-size: 14px;
}
.msg.msg-user .msg-body {
  background: var(--bubble-user); color: var(--bubble-user-text);
  border: 0; font-weight: 500;
}
.msg.msg-user .msg-body code { background: rgba(46, 46, 56, 0.12); color: var(--ey-black); }
.msg.msg-system .msg-body {
  background: transparent;
  border: 1px dashed var(--ey-line-strong);
  color: var(--text-muted); font-size: 13px;
}
.msg-typing .msg-body { color: var(--text-muted); font-style: italic; }
.msg-typing .msg-body::after {
  content: "▍"; animation: ey-blink 1s steps(2) infinite; margin-left: 4px; color: var(--ey-yellow);
}
@keyframes ey-blink { 50% { opacity: 0; } }

.composer {
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
  padding: 14px 18px max(14px, env(safe-area-inset-bottom)) 18px;
  border-top: 1px solid var(--ey-line);
  background: var(--ey-black-2);
}
#composer-input {
  resize: none; min-height: 44px; max-height: 200px;
  padding: 10px 12px; border-radius: var(--radius);
  background: var(--ey-black-3); color: var(--text);
  border: 1px solid var(--ey-line);
  font-family: var(--font-sans); font-size: 14px;
  outline: none; line-height: 1.55;
}
#composer-input:focus { border-color: var(--ey-yellow); box-shadow: 0 0 0 2px rgba(255,230,0,0.15); }
#send-btn {
  padding: 0 20px; border-radius: var(--radius);
  font: inherit; font-size: 12px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ey-black); background: var(--ey-yellow); border: 0; cursor: pointer;
}
#send-btn:hover { background: var(--ey-yellow-hover); }
#send-btn:disabled { opacity: 0.4; cursor: wait; background: var(--ey-yellow-dim); }

/* ─── Team / Org chart ──────────────────────────────────────────── */
.tier { margin-bottom: 28px; }
.tier-head {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--ey-line);
  position: relative;
}
.tier-head::after {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 40px; height: 2px; background: var(--ey-yellow);
}
.tier-title {
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.tier-count {
  font-size: 11px; color: var(--text-faint);
  background: var(--ey-black-2); padding: 1px 8px;
  border-radius: 10px; border: 1px solid var(--ey-line);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.team-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 120ms ease, transform 60ms ease;
}
.team-card:hover { border-color: var(--ey-yellow); color: var(--text); }
.team-card-body { min-width: 0; }
.agent-name { font-weight: 600; font-size: 14px; }
.agent-role {
  font-size: 11px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.avatar {
  width: 32px; height: 32px;
  background: var(--ey-yellow); color: var(--ey-black);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0; letter-spacing: -0.01em;
  border-radius: 0;
}
.avatar--lg { width: 40px; height: 40px; font-size: 16px; }
.avatar--xl { width: 64px; height: 64px; font-size: 26px; }

/* Team mini-grid (inside engagement) */
.team-mini-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.team-mini {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--ey-black-3);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius);
  color: var(--text);
}
.team-mini:hover { border-color: var(--ey-yellow); }
.team-mini.is-lead { border-left: 3px solid var(--ey-yellow); background: rgba(255,230,0,0.04); }
.team-mini-meta { min-width: 0; }

/* ─── Agent profile ─────────────────────────────────────────────── */
.profile-head {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(255,230,0,0.06) 0%, transparent 60%);
  border: 1px solid var(--ey-line);
  border-left: 3px solid var(--ey-yellow);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.profile-head h1 { margin: 0; font-size: 22px; }
.profile-role { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.profile-tier {
  display: inline-block; margin-top: 8px;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 8px; border: 1px solid var(--ey-yellow);
  color: var(--ey-yellow);
}
.profile-split {
  display: grid; grid-template-columns: 3fr 1.2fr; gap: 20px;
}
@media (max-width: 1000px) { .profile-split { grid-template-columns: 1fr; } }
.profile-dossier {
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.dossier-text {
  font-family: var(--font-sans);
  font-size: 14px; line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap; margin: 0;
}
.profile-side { display: grid; gap: 14px; align-content: start; }
.profile-side .panel { margin: 0; }

.compact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.compact-list li {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 4px 0;
  border-bottom: 1px solid var(--ey-line-subtle);
}
.compact-list li:last-child { border-bottom: 0; }
.compact-list li a { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.compact-name {
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.compact-list.tips li { display: block; padding: 6px 0; color: var(--text-muted); font-size: 13px; }

/* ─── Scrollbars ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ey-line-strong); }
::-webkit-scrollbar-thumb:hover { background: var(--ey-yellow-dim); }

/* ─── Topbar search ─────────────────────────────────────────────── */
.topbar-search {
  flex: 1; max-width: 520px;
  margin: 0 20px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--ey-black-3);
  border: 1px solid var(--ey-line);
  color: var(--text);
  font-family: var(--font-sans); font-size: 13px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.topbar-search input:hover { border-color: var(--ey-line-strong); }
.topbar-search input:focus {
  border-color: var(--ey-yellow);
  box-shadow: 0 0 0 2px rgba(255,230,0,0.18);
}
.topbar-search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); font-size: 14px; pointer-events: none;
}

/* ─── User chip on sidebar (link form) ─────────────────────────── */
.user-chip {
  display: flex; gap: 10px; align-items: center;
  color: var(--text);
  padding: 6px 8px; border-radius: var(--radius);
}
.user-chip:hover { background: rgba(255,230,0,0.04); color: var(--text); }
.user-chip.is-active {
  background: rgba(255,230,0,0.08);
}
.user-sub { font-size: 11px; color: var(--text-muted); }

/* ─── Markdown inside agent messages ────────────────────────────── */
.msg-body--md {
  white-space: normal;     /* overrides pre-wrap from base .msg-body */
  font-size: 14px;
  line-height: 1.6;
}
.msg-body--md > *:first-child { margin-top: 0; }
.msg-body--md > *:last-child  { margin-bottom: 0; }
.msg-body--md p    { margin: 0.45em 0; }
.msg-body--md h1,
.msg-body--md h2,
.msg-body--md h3,
.msg-body--md h4 {
  margin: 0.8em 0 0.35em;
  font-weight: 700; letter-spacing: -0.01em;
}
.msg-body--md h1 { font-size: 17px; }
.msg-body--md h2 { font-size: 15.5px; }
.msg-body--md h3 { font-size: 14.5px; }
.msg-body--md h4 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.msg-body--md ul,
.msg-body--md ol {
  margin: 0.4em 0; padding-left: 1.3em;
}
.msg-body--md li { margin: 0.15em 0; }
.msg-body--md li > p { margin: 0.1em 0; }
.msg-body--md strong { color: var(--ey-yellow); }
.msg-body--md em { color: var(--text); font-style: italic; }
.msg-body--md blockquote {
  margin: 0.5em 0;
  padding: 6px 12px;
  border-left: 3px solid var(--ey-yellow);
  color: var(--text-muted);
  background: rgba(255,230,0,0.04);
}
.msg-body--md code {
  background: rgba(255, 230, 0, 0.10);
  color: var(--ey-yellow);
  padding: 0.05em 0.4em;
  border-radius: 2px;
  font-size: 0.9em;
}
.msg-body--md pre {
  margin: 0.6em 0;
  padding: 12px 14px;
  background: var(--ey-black-3);
  border: 1px solid var(--ey-line);
  border-left: 3px solid var(--ey-yellow);
  border-radius: var(--radius);
  overflow-x: auto;
}
.msg-body--md pre code {
  background: transparent; color: var(--text);
  padding: 0; border-radius: 0;
  font-size: 12.5px; line-height: 1.5;
}
.msg-body--md table {
  border-collapse: collapse; margin: 0.6em 0; width: 100%;
  background: var(--ey-black-3);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius); overflow: hidden;
  font-size: 13px;
}
.msg-body--md th, .msg-body--md td {
  padding: 7px 10px; border-bottom: 1px solid var(--ey-line);
  text-align: left;
}
.msg-body--md th {
  background: var(--ey-black-2);
  color: var(--text);
  font-weight: 700; font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.msg-body--md a { color: var(--ey-yellow); text-decoration: underline; }
.msg-body--md hr { border: 0; border-top: 1px solid var(--ey-line); margin: 0.8em 0; }

/* ─── Knowledge-base chip strip above the chat composer ─────────── */
.chat-kb-strip {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--ey-line);
  background: var(--ey-black-3);
}
.kb-label {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
  margin-right: 6px;
}
.kb-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  color: var(--text);
  font: inherit; font-size: 12px;
  cursor: pointer; border-radius: 999px;
  transition: border-color 120ms ease, background 120ms ease;
}
.kb-chip:hover { border-color: var(--ey-yellow); background: rgba(255,230,0,0.05); }
.kb-chip-name { font-weight: 500; }
.kb-chip-size { color: var(--text-muted); font-size: 11px; }
.kb-more { font-size: 12px; color: var(--text-muted); margin-left: 4px; }
.kb-more:hover { color: var(--ey-yellow); }

/* ─── Upload zone ───────────────────────────────────────────────── */
.upload-zone { margin-bottom: 18px; }
.upload-zone-inner {
  padding: 26px 20px;
  border: 1.5px dashed var(--ey-line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  background: var(--ey-black-3);
  transition: border-color 120ms ease, background 120ms ease;
}
.upload-zone-inner.is-drag {
  border-color: var(--ey-yellow);
  background: rgba(255,230,0,0.06);
}
.upload-zone-inner.is-busy {
  border-color: var(--ey-yellow-dim);
  background: rgba(255,230,0,0.04);
  opacity: 0.85;
}
.upload-title { font-size: 15px; font-weight: 600; }
.upload-sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.link-btn {
  background: transparent; border: 0;
  color: var(--ey-yellow); cursor: pointer;
  font: inherit; font-size: inherit;
  padding: 0; text-decoration: underline;
}
.link-btn:hover { color: var(--ey-yellow-hover); }
.link-btn--danger { color: var(--err); }
.link-btn--danger:hover { color: #FFA0A0; }

.upload-status {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}
.upload-status--info { background: rgba(122,180,255,0.08); color: var(--info); border: 1px solid rgba(122,180,255,0.3); }
.upload-status--ok   { background: rgba(52,194,122,0.08);  color: var(--ok);   border: 1px solid rgba(52,194,122,0.3); }
.upload-status--err  { background: rgba(239,78,78,0.10);   color: var(--err);  border: 1px solid rgba(239,78,78,0.35); }

/* File list table */
.data-table--files tbody tr { cursor: default; }
.data-table--files tbody tr:hover { background: var(--ey-black-3); }
.file-name    { font-weight: 600; }
.file-summary { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.file-actions { display: flex; gap: 12px; justify-content: flex-end; white-space: nowrap; }

.empty-state--compact {
  padding: 24px 16px;
  background: transparent;
  border-style: dashed;
}

/* ─── Banners (settings notices) ────────────────────────────────── */
.banner {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.banner-ok  { background: rgba(52,194,122,0.08);  color: var(--ok);   border-left-color: var(--ok); border: 1px solid rgba(52,194,122,0.3); border-left: 3px solid var(--ok); }
.banner-err { background: rgba(239,78,78,0.10);   color: var(--err);  border-left-color: var(--err); border: 1px solid rgba(239,78,78,0.35); border-left: 3px solid var(--err); }

/* ─── Settings + KV list ─────────────────────────────────────────── */
.settings-split {
  display: grid; grid-template-columns: 2fr 1fr; gap: 20px;
}
@media (max-width: 1000px) { .settings-split { grid-template-columns: 1fr; } }
.settings-side { display: grid; gap: 14px; align-content: start; }
.kv {
  display: grid; grid-template-columns: 160px 1fr;
  gap: 8px 16px; margin: 0 0 14px;
  font-size: 13px;
}
.kv dt { color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.06em; font-weight: 600; align-self: center; }
.kv dd { margin: 0; color: var(--text); }

/* ─── Search results ─────────────────────────────────────────────── */
.search-section { margin-bottom: 24px; }
.search-section-head {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; margin-bottom: 10px;
}
.search-results {
  list-style: none; padding: 0; margin: 0;
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius);
  overflow: hidden;
}
.search-results li { border-top: 1px solid var(--ey-line-subtle); }
.search-results li:first-child { border-top: 0; }
.search-results a {
  display: grid; gap: 6px;
  padding: 12px 16px;
  color: var(--text);
}
.search-results a:hover { background: rgba(255,230,0,0.04); color: var(--text); }
.search-meta {
  display: flex; gap: 10px; align-items: center;
  font-size: 12px; color: var(--text-muted);
  flex-wrap: wrap;
}
.search-sender strong { color: var(--ey-yellow); }
.search-snippet {
  font-size: 13.5px; color: var(--text); line-height: 1.5;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* ─── Panel variants ─────────────────────────────────────────────── */
.panel-head--split {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
}
.panel-head--split h2 { margin: 0; }

/* ─── Tickets board ─────────────────────────────────────────────── */
.ticket-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .ticket-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px)  { .ticket-board { grid-template-columns: 1fr; } }

.ticket-col {
  background: var(--ey-black-3);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius-lg);
  min-height: 200px;
  display: flex; flex-direction: column;
}
.ticket-col-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ey-line);
}
.ticket-col-head h3 {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; margin: 0;
}
.ticket-col-count {
  font-size: 11px; color: var(--text-faint);
  background: var(--ey-black-2);
  padding: 1px 8px; border-radius: 10px;
  border: 1px solid var(--ey-line);
}
.ticket-col-body {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px;
  flex: 1;
}

.ticket-card {
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-left: 3px solid var(--ey-line-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  position: relative;
  transition: border-color 120ms ease, transform 80ms ease;
}
.ticket-card:hover { border-color: var(--ey-yellow); }
.ticket-card.priority-urgent { border-left-color: var(--err); }
.ticket-card.priority-high   { border-left-color: var(--warn); }
.ticket-card.priority-med    { border-left-color: var(--ey-yellow); }
.ticket-card.priority-low    { border-left-color: var(--text-faint); }

.ticket-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.ticket-id { font-size: 11px; color: var(--text-muted); }
.priority-chip {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 2px;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  border: 1px solid var(--ey-line);
}
.priority-chip.priority-urgent { color: var(--err); background: rgba(239,78,78,0.08); border-color: rgba(239,78,78,0.35); }
.priority-chip.priority-high   { color: var(--warn); background: rgba(245,165,36,0.08); border-color: rgba(245,165,36,0.35); }
.priority-chip.priority-med    { color: var(--ey-yellow); background: rgba(255,230,0,0.06); border-color: rgba(255,230,0,0.35); }
.priority-chip.priority-low    { color: var(--text-muted); }

.ticket-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; line-height: 1.35; }
.ticket-desc  { color: var(--text-muted); font-size: 12.5px; line-height: 1.5; margin-bottom: 8px; }
.ticket-foot  {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-muted);
}
.ticket-owner { display: inline-flex; gap: 6px; align-items: center; color: var(--text); }
.ticket-owner .avatar { width: 20px; height: 20px; font-size: 10px; }
.ticket-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 10px; padding-top: 8px;
  border-top: 1px solid var(--ey-line-subtle);
  font-size: 11px;
}
.ticket-actions .link-btn { font-size: 11px; }

/* ─── Modal dialog ──────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: grid; place-items: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal[hidden] { display: none !important; }

/* Typing indicator — elapsed counter + cancel button */
.msg-body--typing {
  display: flex; align-items: center; gap: 12px;
}
.typing-elapsed {
  margin-left: 6px; color: var(--text-3, #888);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.msg-cancel-btn {
  margin-left: auto;
}

/* Firm-chat typing row — dots + Cancel inline */
.firm-typing-row {
  display: flex; align-items: center; gap: 12px;
}
.firm-typing-cancel { margin-left: auto; }
.modal-card {
  width: min(92vw, 620px);
  max-height: 92vh; overflow: auto;
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-top: 3px solid var(--ey-yellow);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ey-line);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal .form-card {
  border: 0; background: transparent; border-radius: 0; padding: 18px 20px 20px;
  max-width: none;
}

/* ─── Budgets ───────────────────────────────────────────────────── */
.budget-split {
  display: grid; grid-template-columns: 3fr 2fr; gap: 18px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .budget-split { grid-template-columns: 1fr; } }

.budget-totals {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.budget-kv {
  padding: 14px 16px;
  background: var(--ey-black-3);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius);
}
.budget-label {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; margin-bottom: 6px;
}
.budget-big {
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1;
}
.budget-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.budget-progress {
  padding: 16px 18px;
  background: var(--ey-black-3);
  border: 1px solid var(--ey-line);
  border-left: 3px solid var(--ey-yellow);
  border-radius: var(--radius);
  display: flex; flex-direction: column; justify-content: center;
}
.budget-progress-bar {
  height: 10px;
  background: var(--ey-black);
  border: 1px solid var(--ey-line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
}
.budget-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ey-yellow) 0%, var(--ey-yellow) 100%);
  transition: width 200ms ease;
}
.budget-progress-meta {
  display: flex; gap: 10px; align-items: center;
  font-size: 13px; font-weight: 600;
}

.cap-form {
  display: flex; align-items: end; gap: 14px;
  padding-top: 14px;
  margin-top: 10px;
  border-top: 1px solid var(--ey-line);
  flex-wrap: wrap;
}
.cap-form label { display: grid; gap: 6px; font-size: 11px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.cap-form input {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--ey-black-3); border: 1px solid var(--ey-line);
  padding: 9px 12px; border-radius: var(--radius); width: 160px;
  outline: none;
}
.cap-form input:focus { border-color: var(--ey-yellow); box-shadow: 0 0 0 2px rgba(255,230,0,0.15); }
.cap-status { font-size: 12px; }

/* ─── Heartbeat cards ───────────────────────────────────────────── */
.hb-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.hb-card {
  background: var(--ey-black-3);
  border: 1px solid var(--ey-line);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: grid; gap: 10px;
}
.hb-card.is-paused { border-left-color: var(--warn); opacity: 0.85; }
.hb-head {
  display: flex; justify-content: space-between; align-items: center;
}
.hb-ident {
  display: flex; gap: 10px; align-items: center;
  min-width: 0;
}
.hb-ident .avatar { width: 30px; height: 30px; font-size: 12px; }
.hb-interval { font-size: 13px; color: var(--text); }
.hb-interval strong { color: var(--ey-yellow); }
.hb-prompt {
  font-size: 13px; color: var(--text-muted); font-style: italic;
  border-left: 2px solid var(--ey-line-strong);
  padding-left: 10px;
  line-height: 1.45;
}
.hb-kv {
  display: grid; grid-template-columns: 90px 1fr;
  gap: 4px 10px; font-size: 12px; margin: 0;
}
.hb-kv dt { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; font-weight: 700; align-self: center; }
.hb-kv dd { margin: 0; color: var(--text); }
.hb-actions {
  display: flex; gap: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--ey-line-subtle);
  font-size: 12px;
}

/* heartbeat tag on chat messages produced by a scheduled run */
.msg-tag {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 1px 6px; margin-left: 6px;
  border-radius: 2px;
  background: rgba(255,230,0,0.10);
  color: var(--ey-yellow);
  border: 1px solid rgba(255,230,0,0.3);
}
.msg-heartbeat .msg-body {
  border-left: 3px solid var(--warn, #f5a524);
  background: rgba(245, 165, 36, 0.06);
}
.msg-heartbeat .msg-meta::before {
  content: "⚡";
  margin-right: 6px;
  color: var(--warn, #f5a524);
}
.msg-tag--heartbeat {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--r-pill, 999px);
  background: rgba(245, 165, 36, 0.18);
  color: var(--warn, #f5a524);
  border: 1px solid rgba(245, 165, 36, 0.35);
  vertical-align: middle;
  white-space: nowrap;
}
.msg-handoff .msg-body {
  border-left: 3px solid var(--ey-yellow, #FFE600);
}

/* ═══════════════════════════════════════════════════════════════════
   WORKBENCH modules — SOW, Estimate, Deck, RFP
   ═══════════════════════════════════════════════════════════════════ */

/* Common head for dedicated doc pages */
.doc-head {
  padding: 18px 22px; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(255,230,0,0.06) 0%, transparent 60%);
  border: 1px solid var(--ey-line);
  border-left: 3px solid var(--ey-yellow);
  border-radius: var(--radius-lg);
}
.doc-head h1 { font-size: 22px; margin-top: 4px; }

/* ── Docs hub (grid of module cards) ─────────────────────────── */
.docs-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
}
.doc-module {
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; min-width: 0;
}
.doc-module-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ey-line);
}
.doc-module-head h2 { margin: 2px 0 4px; font-size: 16px; }
.doc-kind {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ey-yellow); font-weight: 700;
}
.doc-sub { color: var(--text-muted); font-size: 12.5px; margin: 0; line-height: 1.45; }

.doc-list { list-style: none; padding: 10px; margin: 0; display: grid; gap: 6px; }
.doc-empty { padding: 14px 12px; color: var(--text-muted); font-style: italic; font-size: 13px; }
.doc-card {
  display: grid; gap: 6px;
  padding: 10px 12px;
  background: var(--ey-black-3);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color 120ms ease;
}
.doc-card:hover { border-color: var(--ey-yellow); color: var(--text); }
.doc-card-top  { display: flex; justify-content: space-between; align-items: center; }
.doc-card-id   { font-size: 11px; color: var(--text-muted); letter-spacing: 0.04em; }
.doc-card-title { font-weight: 600; font-size: 14px; }
.doc-card-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }

/* ── SOW page ────────────────────────────────────────────────── */
.sow-sections { display: grid; gap: 12px; }
.sow-section {
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sow-section-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--ey-line);
  background: var(--ey-black-3);
}
.sow-section-head h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); font-weight: 700; margin: 0;
}
.sow-section-actions { display: flex; gap: 14px; }
.sow-section-body {
  width: 100%; border: 0; outline: none; resize: vertical;
  padding: 14px 16px; min-height: 140px;
  background: var(--ey-black-2); color: var(--text);
  font-family: var(--font-mono); font-size: 13px; line-height: 1.55;
}
.sow-section-body:focus { background: var(--ey-black-3); }
.sow-section-status {
  padding: 0 16px 10px;
  font-size: 12px; color: var(--text-muted); min-height: 18px;
}

/* doc-head inline editors (status select, inputs) */
.doc-head .meta-chip select,
.doc-head .meta-chip input {
  font: inherit; font-size: 13px;
  background: var(--ey-black-3); color: var(--text);
  border: 1px solid var(--ey-line);
  padding: 3px 8px; border-radius: var(--radius);
  margin-left: 4px;
}
.doc-head .meta-chip input.is-saved,
.doc-head .meta-chip select.is-saved { border-color: var(--ok); }

/* ── Estimator page ──────────────────────────────────────────── */
.data-table--editable tbody tr { cursor: default; }
.data-table--editable tbody tr:hover { background: transparent; }
.data-table--editable input,
.data-table--editable select {
  width: 100%; font: inherit; font-size: 13px;
  background: var(--ey-black-3); color: var(--text);
  border: 1px solid var(--ey-line);
  padding: 6px 8px; border-radius: var(--radius); outline: none;
}
.data-table--editable input:focus,
.data-table--editable select:focus { border-color: var(--ey-yellow); }
.data-table--editable .est-subtotal { font-variant-numeric: tabular-nums; }

.estimate-totals {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px; margin-top: 18px;
}
.et-card {
  background: var(--ey-black-3);
  border: 1px solid var(--ey-line);
  border-left: 3px solid var(--ey-yellow);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.et-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.et-value { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-top: 6px; font-variant-numeric: tabular-nums; }

#est-assumptions {
  width: 100%; resize: vertical; min-height: 100px;
  padding: 10px 12px; border-radius: var(--radius);
  background: var(--ey-black-3); color: var(--text);
  border: 1px solid var(--ey-line);
  font-family: var(--font-sans); font-size: 14px; outline: none;
}
#est-assumptions:focus { border-color: var(--ey-yellow); }

.panel-actions { display: flex; gap: 8px; }

/* ── Deck editor ─────────────────────────────────────────────── */
.deck-editor {
  display: grid; grid-template-columns: 320px 1fr; gap: 16px;
  min-height: 70vh;
}
@media (max-width: 1000px) { .deck-editor { grid-template-columns: 1fr; } }

.deck-list {
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex; flex-direction: column; min-height: 0;
}
.deck-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.deck-list-head h2 { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin: 0; }
.deck-list ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; overflow-y: auto; }
.deck-slide-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--ey-line);
  border-radius: var(--radius);
  background: var(--ey-black-3);
}
.deck-slide-item.is-selected {
  border-color: var(--ey-yellow);
  background: rgba(255,230,0,0.05);
}
.deck-slide-item .slide-pick {
  flex: 1; text-align: left; display: flex; gap: 6px; align-items: baseline;
  background: transparent; border: 0; color: var(--text); font: inherit; cursor: pointer;
  min-width: 0;
}
.slide-n { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); min-width: 20px; }
.slide-type { font-size: 10px; color: var(--ey-yellow); font-family: var(--font-mono); text-transform: uppercase; }
.slide-head { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slide-item-actions { display: flex; gap: 6px; }
.slide-item-actions .link-btn { font-size: 12px; }

.deck-editor-main {
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.slide-editor-empty { color: var(--text-muted); text-align: center; padding: 60px 20px; }
.slide-ed-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.slide-ed-ix { font-size: 12px; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.slide-ed-head select {
  font: inherit; font-size: 13px;
  background: var(--ey-black-3); color: var(--text);
  border: 1px solid var(--ey-line);
  padding: 4px 10px; border-radius: var(--radius);
}
.slide-ed-label {
  display: grid; gap: 6px;
  margin-bottom: 14px;
  color: var(--text-muted); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.slide-ed-label input,
.slide-ed-label textarea {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--ey-black-3); border: 1px solid var(--ey-line);
  padding: 10px 12px; border-radius: var(--radius); outline: none;
}
.slide-ed-label textarea { resize: vertical; font-family: var(--font-mono); font-size: 13px; line-height: 1.55; }
.slide-ed-label input:focus,
.slide-ed-label textarea:focus { border-color: var(--ey-yellow); }
.slide-ed-hint { font-size: 12px; color: var(--text-muted); }

/* ── RFP editor ──────────────────────────────────────────────── */
.rfp-editor {
  display: grid; grid-template-columns: 340px 1fr; gap: 16px;
  min-height: 60vh;
  margin-top: 16px;
}
@media (max-width: 1000px) { .rfp-editor { grid-template-columns: 1fr; } }

.rfp-sections {
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius-lg);
  padding: 14px;
  max-height: 70vh; overflow-y: auto;
}
.rfp-sections header h2 {
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
  margin: 0 0 10px;
}
.rfp-sections ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rfp-empty { padding: 12px; color: var(--text-muted); font-style: italic; font-size: 13px; }
.rfp-section-btn {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 8px; align-items: baseline;
  width: 100%; text-align: left;
  padding: 8px 10px;
  background: var(--ey-black-3);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius);
  color: var(--text); font: inherit; cursor: pointer;
}
.rfp-section-btn:hover { border-color: var(--ey-yellow); }
.rfp-section-btn.is-selected { border-color: var(--ey-yellow); background: rgba(255,230,0,0.05); }
.rfp-section-btn.is-drafted  { border-left: 3px solid var(--info); }
.rfp-section-btn.is-reviewed { border-left: 3px solid var(--warn); }
.rfp-section-btn.is-final    { border-left: 3px solid var(--ok); }
.rfp-section-no { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.rfp-section-head { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rfp-section-status { font-size: 10px; color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase; }

.rfp-editor-main {
  background: var(--ey-black-2);
  border: 1px solid var(--ey-line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.rfp-ed-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.rfp-ed-no { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.rfp-ed-title { font-size: 18px; margin: 2px 0 0; }
.rfp-ed-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.rfp-ed-meta label { display: grid; gap: 4px; font-size: 10px; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.rfp-ed-meta select {
  font: inherit; font-size: 13px;
  background: var(--ey-black-3); color: var(--text);
  border: 1px solid var(--ey-line);
  padding: 4px 8px; border-radius: var(--radius);
}
.rfp-question {
  margin: 0; padding: 10px 14px;
  background: var(--ey-black-3);
  border-left: 3px solid var(--ey-yellow);
  color: var(--text-muted); font-size: 13px; line-height: 1.5;
}
.rfp-answer-label {
  display: grid; gap: 6px;
  color: var(--text-muted); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.rfp-answer-label textarea {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--ey-black-3); border: 1px solid var(--ey-line);
  padding: 12px 14px; border-radius: var(--radius); outline: none;
  resize: vertical; min-height: 280px; line-height: 1.55;
  font-family: var(--font-mono);
}
.rfp-answer-label textarea:focus { border-color: var(--ey-yellow); }
.rfp-ed-actions { display: flex; justify-content: space-between; align-items: center; }

/* select/input used in RFP source attach area */
#rfp-source-select {
  font: inherit; font-size: 13px;
  background: var(--ey-black-3); color: var(--text);
  border: 1px solid var(--ey-line);
  padding: 8px 10px; border-radius: var(--radius);
  margin-right: 8px; min-width: 320px;
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .app-body { grid-template-columns: 1fr; }
  .app-sidebar {
    position: static; height: auto;
    border-right: 0; border-bottom: 1px solid var(--ey-line);
  }
  .sidebar-nav { flex-direction: row; overflow-x: auto; padding: 10px; }
  .sidebar-nav--secondary { display: none; }
  .sidebar-divider, .sidebar-foot { display: none; }
  .nav-item { white-space: nowrap; }
  .split { grid-template-columns: 1fr; }
  .form-row--2 { grid-template-columns: 1fr; }
  .eng-head-meta { gap: 6px; }
  .msg { max-width: 92%; }
}

/* ─── Toasts ──────────────────────────────────────────────────── */
#lattice-toast-host {
  position: fixed; top: 16px; right: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  min-width: 220px; max-width: 360px;
  padding: 10px 14px;
  border-radius: var(--radius, 6px);
  background: #2e2e38; color: #fff;
  font-size: 13px; line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  border-left: 3px solid #ffe600;
  opacity: 0; transform: translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: auto;
}
.toast.is-in  { opacity: 1; transform: translateY(0); }
.toast.is-out { opacity: 0; transform: translateY(-6px); transition: opacity 240ms ease, transform 240ms ease; }
.toast--success { border-left-color: #2ea44f; }
.toast--error   { border-left-color: #cf222e; background: #3a1f22; }
.toast--warn    { border-left-color: #f59e0b; }
.toast--info    { border-left-color: #ffe600; }

/* ─── Estimate AI-staff proposal panel ─────────────────────────── */
.est-ai-proposal {
  margin-top: 12px; padding: 12px 14px;
  background: #fafaf8; border: 1px solid var(--ey-line, #e3e3dc);
  border-left: 3px solid #ffe600; border-radius: var(--radius, 6px);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.est-ai-proposal__msg { flex: 1 1 auto; font-size: 13px; color: #2e2e38; }
.est-ai-proposal__actions { display: flex; gap: 8px; }

/* ─── Markdown preview modal ──────────────────────────────────── */
.md-modal {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.md-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
}
.md-modal__panel {
  position: relative;
  background: #fff;
  width: min(820px, 92vw);
  max-height: 88vh;
  display: flex; flex-direction: column;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.24);
  overflow: hidden;
  border-top: 4px solid #ffe600;
}
.md-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--ey-line, #e3e3dc);
}
.md-modal__title { margin: 0; font-size: 14px; font-weight: 600; color: #2e2e38; }
.md-modal__close {
  border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer;
  color: #55555e; padding: 0 4px;
}
.md-modal__close:hover { color: #cf222e; }
.md-modal__body {
  padding: 18px 22px; overflow-y: auto;
}

/* Rendered markdown content styling */
.md-preview { color: #2e2e38; font-size: 14px; line-height: 1.55; }
.md-preview h1 { font-size: 22px; margin: 4px 0 10px; border-bottom: 2px solid #ffe600; padding-bottom: 4px; }
.md-preview h2 { font-size: 18px; margin: 18px 0 8px; }
.md-preview h3 { font-size: 15px; margin: 14px 0 6px; text-transform: none; }
.md-preview p  { margin: 8px 0; }
.md-preview ul, .md-preview ol { margin: 8px 0 8px 22px; padding: 0; }
.md-preview li { margin: 2px 0; }
.md-preview blockquote {
  margin: 10px 0; padding: 8px 12px; color: #55555e;
  border-left: 3px solid #ffe600; background: #fafaf8;
}
.md-preview code {
  font-family: Consolas, monospace; font-size: 12.5px;
  background: #f3f3ee; padding: 1px 4px; border-radius: 3px;
}
.md-preview pre.md-code {
  background: #2e2e38; color: #fafafa; padding: 10px 14px; border-radius: 6px;
  overflow-x: auto; margin: 10px 0;
}
.md-preview pre.md-code code { background: transparent; color: inherit; padding: 0; }
.md-preview table.md-table {
  width: 100%; border-collapse: collapse; margin: 10px 0;
  font-size: 13px;
}
.md-preview table.md-table th, .md-preview table.md-table td {
  border: 1px solid var(--ey-line, #e3e3dc); padding: 6px 10px; text-align: left; vertical-align: top;
}
.md-preview table.md-table th { background: #2e2e38; color: #fff; }
.md-preview table.md-table tr:nth-child(even) td { background: #fafaf8; }

/* ─── RFP inline upload row ───────────────────────────────────── */
.rfp-upload-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 6px;
}
.rfp-upload-row input[type="file"] {
  font-size: 13px; color: #2e2e38;
  padding: 4px 6px; border: 1px solid var(--ey-line, #e3e3dc);
  border-radius: 4px; background: #fff;
}

/* ─── Generic inline h1 input ──────────────────────────────── */
.h1-input {
  border: 0; border-bottom: 1px dashed transparent;
  background: transparent; font: inherit; color: inherit;
  width: 100%; padding: 2px 0;
}
.h1-input:hover, .h1-input:focus {
  border-bottom-color: #ffe600; outline: none;
}

/* ─── Status Report — RAG board ──────────────────────────────── */
.rag-board {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
  margin: 14px 0 22px;
}
.rag-tile {
  padding: 14px 16px; border-radius: 8px;
  border: 1px solid var(--ey-line, #e3e3dc);
  background: #fff; position: relative;
}
.rag-tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: 8px 0 0 8px;
  background: #2ea44f;
}
.rag-tile.rag-amber::before { background: #f59e0b; }
.rag-tile.rag-red::before   { background: #cf222e; }
.rag-label { font-size: 12px; color: #55555e; text-transform: uppercase; letter-spacing: 0.5px; }
.rag-picker {
  margin-top: 6px; font-weight: 600; text-transform: uppercase; font-size: 13px;
  border: 0; background: transparent; color: #2e2e38;
}
.rag-tile.rag-green  .rag-picker { color: #2ea44f; }
.rag-tile.rag-amber  .rag-picker { color: #b45309; }
.rag-tile.rag-red    .rag-picker { color: #cf222e; }
@media (max-width: 1000px) { .rag-board { grid-template-columns: repeat(2, 1fr); } }

/* ─── RAID log ──────────────────────────────────────────────── */
.raid-add {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.raid-add input, .raid-add select {
  font-size: 13px; padding: 6px 8px;
  border: 1px solid var(--ey-line, #e3e3dc); border-radius: 4px;
}
.raid-add input[type="text"] { flex: 1 1 240px; }

.raid-board {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: 18px;
}
.raid-col h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px;
  color: #55555e; margin: 0 0 8px;
}
.raid-col-count {
  background: #2e2e38; color: #fff; padding: 1px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.raid-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.raid-empty { padding: 10px; border: 1px dashed var(--ey-line, #e3e3dc); border-radius: 6px; text-align: center; }
.raid-card {
  background: #fff; border: 1px solid var(--ey-line, #e3e3dc); border-radius: 6px;
  padding: 10px 12px; border-left: 4px solid #55555e;
}
.raid-card.raid-sev-low      { border-left-color: #2ea44f; }
.raid-card.raid-sev-med      { border-left-color: #f59e0b; }
.raid-card.raid-sev-high     { border-left-color: #d97706; }
.raid-card.raid-sev-critical { border-left-color: #cf222e; background: #fff5f5; }
.raid-card.raid-status-closed { opacity: 0.5; }
.raid-card header { display: flex; align-items: center; gap: 8px; }
.raid-card header .raid-title { flex: 1 1 auto; font-size: 14px; }
.raid-sev-chip {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 8px;
  background: #f3f3ee; color: #2e2e38; text-transform: uppercase;
}
.raid-sev-chip.raid-sev-critical { background: #cf222e; color: #fff; }
.raid-sev-chip.raid-sev-high     { background: #d97706; color: #fff; }
.raid-sev-chip.raid-sev-med      { background: #f59e0b; color: #fff; }
.raid-sev-chip.raid-sev-low      { background: #2ea44f; color: #fff; }
.raid-desc { font-size: 12.5px; color: #55555e; margin: 6px 0; }
.raid-card footer {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; margin-top: 6px;
}
.raid-card footer input, .raid-card footer select {
  font-size: 12px; padding: 2px 6px;
  border: 1px solid var(--ey-line, #e3e3dc); border-radius: 3px; background: #fafaf8;
}
@media (max-width: 1100px) { .raid-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .raid-board { grid-template-columns: 1fr; } }

/* ─── R&Q Checklist ─────────────────────────────────────────── */
.rq-grid { display: flex; flex-direction: column; gap: 12px; }
.rq-row {
  background: #fff; border: 1px solid var(--ey-line, #e3e3dc);
  border-radius: 6px; padding: 12px 14px;
  display: grid; grid-template-columns: 220px 1fr; gap: 10px; align-items: start;
}
.rq-check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.rq-check input[type="checkbox"] { width: 18px; height: 18px; }
.rq-key { font-size: 13px; }
.rq-desc { grid-column: 2; margin: 0; font-size: 13px; color: #55555e; }
.rq-note { grid-column: 2; width: 100%; font-size: 13px; font-family: inherit; }
.rq-signoff { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rq-signoff input { padding: 6px 10px; font-size: 14px; border: 1px solid var(--ey-line, #e3e3dc); border-radius: 4px; flex: 1 1 200px; }
.rq-signed { background: #e8f6ed; color: #1a6f3a; border-color: #2ea44f; }
@media (max-width: 860px) { .rq-row { grid-template-columns: 1fr; } .rq-desc, .rq-note { grid-column: 1; } }

/* ─── Methodology library ──────────────────────────────────── */
.meth-filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.meth-filters input[type="search"] {
  flex: 1 1 300px; padding: 8px 10px;
  border: 1px solid var(--ey-line, #e3e3dc); border-radius: 4px; font-size: 14px;
}
.meth-filters select { padding: 8px 10px; border: 1px solid var(--ey-line, #e3e3dc); border-radius: 4px; }

.meth-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
  margin-top: 18px;
}
.meth-card {
  display: block; background: #fff; border: 1px solid var(--ey-line, #e3e3dc);
  border-radius: 8px; padding: 16px; text-decoration: none; color: inherit;
  transition: transform 120ms, box-shadow 120ms;
  border-top: 3px solid #ffe600;
}
.meth-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); }
.meth-card h3 { margin: 8px 0; font-size: 16px; color: #2e2e38; }
.meth-card p { font-size: 13px; color: #55555e; margin: 0 0 10px; }
.meth-cat {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: #55555e; font-weight: 600;
}
.meth-card.meth-cat-pov          { border-top-color: #6366f1; }
.meth-card.meth-cat-framework    { border-top-color: #ffe600; }
.meth-card.meth-cat-sow_template { border-top-color: #2ea44f; }
.meth-card.meth-cat-case_study   { border-top-color: #f59e0b; }
.meth-card footer {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: #55555e;
}
.meth-tags { background: #f3f3ee; padding: 1px 7px; border-radius: 3px; font-size: 11px; }

/* ─── Benchmark table ──────────────────────────────────────── */
.bm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bm-table th, .bm-table td { border: 1px solid var(--ey-line, #e3e3dc); padding: 6px 8px; vertical-align: top; }
.bm-table th { background: #2e2e38; color: #fff; text-align: left; }
.bm-table input.bm-f {
  width: 100%; border: 0; background: transparent; padding: 2px 4px; font: inherit;
}
.bm-table input.bm-f:focus { outline: 1px solid #ffe600; background: #fffdf0; }
.bm-actions {
  margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

/* ─── Firm Budget page ─────────────────────────────────────── */
.budget-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 14px 0 22px;
}
.budget-metric {
  padding: 16px 18px; background: #fff;
  border: 1px solid var(--ey-line, #e3e3dc); border-radius: 8px;
  border-left: 3px solid #ffe600;
}
.budget-metric-label { font-size: 12px; color: #55555e; text-transform: uppercase; letter-spacing: 0.5px; }
.budget-metric-value { font-size: 26px; font-weight: 700; color: #2e2e38; font-variant-numeric: tabular-nums; margin-top: 4px; }
.budget-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
@media (max-width: 1000px) { .budget-split { grid-template-columns: 1fr; } .budget-row { grid-template-columns: 1fr; } }

.fb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fb-table th, .fb-table td { border-bottom: 1px solid var(--ey-line, #e3e3dc); padding: 6px 10px; text-align: left; }
.fb-table th { background: #fafaf8; font-weight: 600; }
.fb-table td.fb-bar { width: 40%; }
.fb-bar-fill { display: block; height: 8px; background: #ffe600; border-radius: 4px; }
.fb-cap-bar { display: inline-block; width: 80px; height: 8px; background: #f3f3ee; border-radius: 4px; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.fb-cap-bar span { display: block; height: 100%; background: #2ea44f; }
.fb-cap-bar.is-amber span { background: #f59e0b; }
.fb-cap-bar.is-red   span { background: #cf222e; }

.status-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: #f3f3ee; }
.status-active    { background: #e8f6ed; color: #1a6f3a; }
.status-on_hold   { background: #fff5d0; color: #92400e; }
.status-archived  { background: #f3f3ee; color: #55555e; }
.status-closed    { background: #f3f3ee; color: #55555e; }

/* ─── Cost-to-Complete tiles ──────────────────────────────── */
.ctc-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 22px; }
.ctc-tile {
  padding: 16px 18px; background: #fff;
  border: 1px solid var(--ey-line, #e3e3dc); border-radius: 8px;
  border-left: 4px solid #2ea44f;
}
.ctc-tile.ctc-rag-amber { border-left-color: #f59e0b; }
.ctc-tile.ctc-rag-red   { border-left-color: #cf222e; background: #fff5f5; }
.ctc-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #55555e; }
.ctc-value { font-size: 26px; font-weight: 700; color: #2e2e38; font-variant-numeric: tabular-nums; margin-top: 4px; }
.ctc-sub   { font-size: 12px; color: #55555e; margin-top: 4px; }
@media (max-width: 1000px) { .ctc-board { grid-template-columns: 1fr; } }

/* ─── Consult trail ────────────────────────────────────────── */
.consult-trail { list-style: none; padding: 0; margin: 0; position: relative; }
.consult-trail::before {
  content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px;
  background: var(--ey-line, #e3e3dc);
}
.consult-step { position: relative; padding: 6px 0 10px 36px; }
.consult-dot {
  position: absolute; left: 4px; top: 10px; width: 16px; height: 16px;
  border-radius: 50%; background: #ffe600; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--ey-line, #e3e3dc);
}
.consult-step.consult-kind-team-synth .consult-dot { background: #2ea44f; }
.consult-step.consult-kind-team-dispatch .consult-dot { background: #6366f1; }
.consult-body { background: #fff; border: 1px solid var(--ey-line, #e3e3dc); border-radius: 6px; padding: 10px 12px; }
.consult-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: #55555e; margin-bottom: 4px; }
.consult-meta strong { color: #2e2e38; }
.consult-kind { background: #f3f3ee; padding: 1px 7px; border-radius: 3px; font-family: Consolas, monospace; font-size: 11px; }
.consult-summary { font-size: 13px; color: #2e2e38; }

/* ─── Accessibility: skip link ───────────────────────────────── */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: #2e2e38; color: #fff;
  padding: 10px 14px; border-radius: 0 0 6px 0;
  font-size: 13px; font-weight: 600;
  z-index: 100001;
  text-decoration: none;
}
.skip-link:focus {
  left: 0; top: 0;
  outline: 3px solid #ffe600;
  outline-offset: 0;
}

/* ─── Responsive table wrapper ───────────────────────────────── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── @-mention autocomplete on the engagement composer ──────── */
.composer-input-wrap { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.composer-input-wrap > textarea { flex: 1 1 auto; min-width: 0; width: 100%; }
.mention-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--surface-1, #fff);
  color: var(--text-1, #111);
  border: 1px solid var(--border-1, rgba(0,0,0,0.15));
  border-radius: var(--r-2, 6px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
  z-index: 30;
  font-size: 13px;
}
.mention-menu[hidden] { display: none; }
.mention-menu li {
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.mention-menu li.is-active,
.mention-menu li:hover { background: var(--surface-2, rgba(0,0,0,0.06)); }
.mention-menu .mention-handle {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  color: var(--text-1, #111);
  flex: 0 0 auto;
}
.mention-menu .mention-role {
  color: var(--text-2, #666);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Engagement budget calculator (Excel-style grid) ──────── */
.bc-toolbar {
  display: flex; gap: 8px; align-items: center;
  flex-shrink: 0;
}
.bc-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--ey-line, rgba(255,255,255,0.12));
  border-radius: 4px;
  background: var(--ey-black-3, #18181c);
}
.bc-table {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-variant-numeric: tabular-nums;
}
.bc-table thead th {
  background: var(--ey-black-2, #1d1d23);
  color: var(--text-muted, #aaa);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10.5px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ey-line, rgba(255,255,255,0.12));
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
}
.bc-table thead th.bc-col-num { text-align: right; }
.bc-table thead th.bc-rownum,
.bc-table thead th.bc-col-x { width: 36px; text-align: center; }
.bc-table tbody tr { background: var(--ey-black-3, #18181c); }
.bc-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.015); }
.bc-table td {
  padding: 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-right: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
  color: var(--text, #d3d3d8);
}
.bc-table td:last-child { border-right: 0; }
.bc-table .bc-cell {
  padding: 8px 10px;
  outline: 0;
  cursor: text;
  min-height: 1.4em;
}
.bc-table .bc-cell:focus {
  background: rgba(255, 230, 0, 0.10);
  box-shadow: inset 0 0 0 2px var(--ey-yellow, #FFE600);
}
.bc-table .bc-cell:hover { background: rgba(255,255,255,0.03); }
.bc-table .bc-col-num { text-align: right; }
.bc-table .bc-cell-readonly {
  padding: 8px 10px;
  color: var(--text, #fff);
  font-weight: 600;
  background: rgba(255,255,255,0.02);
}
.bc-table .bc-rownum {
  width: 36px;
  text-align: center;
  color: var(--text-faint, #666);
  background: var(--ey-black-2, #1d1d23);
  font-size: 11px;
  user-select: none;
}
.bc-table .bc-col-x {
  width: 36px;
  text-align: center;
}
.bc-table .bc-remove {
  font-size: 16px;
  line-height: 1;
  padding: 4px 8px;
  color: var(--text-faint, #666);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.bc-table .bc-remove:hover { color: #ff8a8a; background: rgba(255,138,138,0.08); }
.bc-table .bc-totals-row td {
  background: var(--ey-black-2, #1d1d23) !important;
  font-weight: 700;
  border-top: 2px solid var(--ey-yellow, #FFE600);
  padding: 10px;
}
.bc-table .bc-totals-label { text-align: right; color: var(--text-muted, #aaa); }
.bc-table .bc-grand {
  color: var(--ey-yellow, #FFE600);
  font-size: 15px;
}
.bc-help {
  margin-top: 12px;
  font-size: 12px;
}
.bc-help code {
  background: rgba(255,230,0,0.08);
  color: var(--ey-yellow, #FFE600);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 11px;
}
@media (max-width: 760px) {
  .bc-toolbar { flex-wrap: wrap; }
}

/* ─── Button label safety: never wrap inside a pill button ───
   "Open checklist", "Open RAID log", "Open benchmarks" sit in
   .doc-module-head's flex row as the second child. Default
   flex-shrink: 1 was squeezing the button below its content
   width on narrow cards, so the text broke INSIDE the pill. */
.btn { white-space: nowrap; }
.doc-module-head .btn { flex-shrink: 0; }
.doc-module-head > div:first-child { min-width: 0; }
@media (max-width: 520px) {
  .doc-module-head {
    flex-direction: column;
    align-items: stretch;
  }
  .doc-module-head .btn { align-self: flex-start; }
}

/* ─── Doc-card title row: prevent chip / title overflow ──────
   Status chips like "internal_review" wrap onto two lines and
   break the doc-card-top row when the chip has no nowrap rule.
   Same for priority / severity / RAG chips elsewhere in the app.
   Long doc titles also need a clamp so they don't sprawl. */
.status-chip,
.priority-chip,
.raid-sev-chip,
.rag-chip,
.doc-card-id {
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-card-id { flex-shrink: 0; }
.doc-card-top {
  gap: 8px;
  min-width: 0;
}
.doc-card-top > * { min-width: 0; }
.doc-card-title {
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  /* Clamp at 2 lines so a long title doesn't make the card 4x taller
     than its neighbours in the grid. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Layout reset: panels are full-width by default ──────────
   sleek.css:227 used to cap .panel-body at 78ch, which made the
   Overview tab's Brief drop to a 700px island in the middle of
   an otherwise 1760px canvas — looked broken next to the wide
   Tickets / Files / Audit tabs. Flip the default: panels span
   their parent. Prose blocks opt IN to readable measure with
   .panel-body--prose. */
.panel-body {
  max-width: none !important;
  width: 100%;
}
.panel-body--prose {
  /* Inner content cap so paragraph lines stay readable, but the
     panel itself stays the full canvas width and visually aligned
     with every other tab. */
  max-width: 78ch;
}

/* Cap the Documents-tab grid so cards don't shrink to 5 squeezed
   columns on wide screens. Below 1400px, auto-fit responsive
   layout. Above, hard-cap at 3 columns. */
.docs-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)) !important;
  gap: 16px !important;
}
@media (min-width: 1400px) {
  .docs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

/* ─── Empty state in ticket columns ──────────────────────────── */
.ticket-col-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 14px 12px;
  text-align: center;
  border: 1px dashed var(--ey-line, rgba(255,255,255,0.12));
  border-radius: 6px;
  background: rgba(255,255,255,0.015);
  line-height: 1.45;
}

/* ─── Color-not-only on RAG chips: pair colour with a dot glyph */
.status-chip[class*="status-active"]::before,
.status-chip[class*="status-proposed"]::before,
.status-chip[class*="status-paused"]::before,
.status-chip[class*="status-closed"]::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  background: currentColor;
  opacity: 0.85;
}
/* RAG-specific dot colors so the dot is independently readable. */
.rag-chip { display: inline-flex; align-items: center; gap: 6px; }
.rag-chip::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.rag-green  { color: #2ea44f; }
.rag-amber  { color: #d97706; }
.rag-red,
.rag-critical { color: #cf222e; }

/* ─── Color-not-only on RAID severity badges: prefix glyph ──── */
.raid-sev-chip { display: inline-flex; align-items: center; gap: 4px; }
.raid-sev-chip.raid-sev-low::before     { content: "•"; }
.raid-sev-chip.raid-sev-med::before     { content: "▲"; }
.raid-sev-chip.raid-sev-high::before    { content: "▲"; font-weight: 700; }
.raid-sev-chip.raid-sev-critical::before{ content: "■"; font-weight: 700; }

/* ─── Full-bleed panels for kanban / wide grids ──────────────
   sleek.css :227 caps .panel-body at 78ch for readability — great
   for prose, terrible for kanbans. Two ways to opt out:
   (1) explicit modifier class .panel--wide  ← always works
   (2) :has() inference                       ← modern browsers only */
.panel--wide,
.panel--wide .panel-body {
  max-width: 100% !important;
  width: 100% !important;
}
.panel-body:has(.ticket-board),
.panel-body:has(.raid-board),
.panel-body:has(.kanban),
.panel-body:has(.docs-grid),
.panel-body:has(.table-responsive),
.panel-body:has(.data-table) {
  max-width: none !important;
}
.ticket-board,
.raid-board,
.pursuit-board {
  width: 100%;
  max-width: none;
}

/* ─── Documents-tab card download pills ──────────────────────── */
/* Sit just below each doc-card link inside the same <li>. The pills
   themselves are <a>s with explicit format hrefs so right-click + Save As
   works, and they don't trigger the parent card-link navigation. */
.doc-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding: 0 8px 10px 8px;
}
.doc-card-actions .dl-pill {
  font-size: 12px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  letter-spacing: 0.04em;
  padding: 8px 14px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-1, rgba(255,255,255,0.12));
  border-radius: var(--r-pill, 999px);
  color: var(--text-2, #aaa);
  background: var(--surface-1, rgba(255,255,255,0.02));
  text-decoration: none;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .doc-card-actions .dl-pill {
    transition: background-color 120ms, color 120ms, border-color 120ms;
  }
}
.doc-card-actions .dl-pill:hover {
  background: var(--brand-yellow, #FFE600);
  color: #111;
  border-color: var(--brand-yellow, #FFE600);
}
.doc-card-actions .dl-pill:focus-visible {
  outline: 2px solid var(--brand-yellow, #FFE600);
  outline-offset: 2px;
}
/* Mobile: bump to platform-min 44pt — the cards are wide enough to hold it. */
@media (max-width: 768px), (pointer: coarse) {
  .doc-card-actions .dl-pill {
    padding: 11px 16px;
    min-height: 44px;
    font-size: 13px;
  }
}

/* ─── Engagement header actions (delete button etc.) ─────────── */
.eng-head { display: flex; align-items: flex-start; gap: 16px; }
.eng-head-main { flex: 1 1 auto; min-width: 0; }
.eng-head-actions { flex: 0 0 auto; align-self: flex-start; }
.eng-head-actions .link-btn {
  font-size: 13px;
  padding: 10px 16px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill, 999px);
}
.eng-head-actions .link-btn:focus-visible {
  outline: 2px solid var(--err, #ff8a8a);
  outline-offset: 2px;
}
@media (max-width: 768px), (pointer: coarse) {
  .eng-head-actions .link-btn {
    min-height: 44px;
    padding: 12px 18px;
  }
}

/* ─── Delete affordance on engagement chat messages ──────────── */
.msg { position: relative; }
.msg-actions {
  position: absolute;
  top: -10px; right: 8px;
  display: none;
  gap: 2px;
  background: var(--surface-1, #fff);
  border: 1px solid var(--border-1, rgba(0,0,0,0.1));
  border-radius: var(--r-pill, 999px);
  padding: 2px 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  z-index: 2;
}
.msg:hover .msg-actions,
.msg-actions:focus-within { display: inline-flex; }
.msg-actions .link-btn {
  font-size: 14px;
  padding: 6px 10px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2, #555);
  background: transparent;
  border: 0;
  border-radius: var(--r-pill, 999px);
  cursor: pointer;
}
.msg-actions .link-btn:hover { background: var(--surface-2, rgba(0,0,0,0.05)); }
.msg-actions .link-btn:focus-visible {
  outline: 2px solid var(--brand-yellow, #FFE600);
  outline-offset: 1px;
}
.msg-actions .msg-delete:hover { color: #ff8a8a; }
@media (max-width: 768px), (pointer: coarse) {
  .msg-actions .link-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
  }
}
.msg--deleted .msg-body {
  font-style: italic;
  color: var(--text-3, #888);
  opacity: 0.7;
}
.msg--deleted .msg-actions { display: none !important; }

/* ─── Accessibility: reduced motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .toast { transition: none !important; }
  .md-modal__panel { box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
  .meth-card:hover { transform: none; }
}
