@font-face {
  font-family: Manrope;
  src: url('/cabinet-assets/Manrope-Variable.ttf') format('truetype');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Manrope, 'Segoe UI', sans-serif;
  color: #f6f1fa;
  background: #14111a;
  --background: #14111a;
  --rail: #18141f;
  --panel: #201a29;
  --raised: #2a2236;
  --divider: #3a3046;
  --ink: #f6f1fa;
  --muted: #bbafc6;
  --accent: #dac0ff;
  --accent-bg: #382b4d;
  --accent-deep: #24172f;
  --success: #9bd8ba;
  --warning: #ffbd9c;
  --warning-bg: #402b2d;
  --radius: 17px;
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 0; margin: 0; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
svg { display: block; width: 20px; height: 20px; flex: 0 0 auto; fill: currentColor; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 4; top: 10px; left: 10px; transform: translateY(-140%);
  padding: 10px 16px; border-radius: 8px; background: var(--accent); color: var(--accent-deep); }
.skip-link:focus { transform: translateY(0); }

.top {
  display: grid;
  grid-template-columns: 202px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 9px 24px;
  border-bottom: 1px solid var(--divider);
  background: #1c1625;
}
.brand { display: flex; align-items: center; gap: 11px; width: fit-content; text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 11px; object-fit: contain; }
.brand span { display: grid; gap: 1px; }
.brand strong { font-size: 16px; letter-spacing: -.035em; white-space: nowrap; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .02em; }
.projects { display: flex; align-items: center; justify-self: start; min-width: 0; gap: 4px; }
.projects button, .choice { background: transparent; border: 1px solid transparent; }
.projects button {
  min-height: 40px; padding: 7px 12px; border-radius: 8px; color: var(--muted);
  font-size: 13px; font-weight: 740; white-space: nowrap;
}
.projects button:hover, .choice:hover { color: var(--ink); background: var(--raised); }
.projects [aria-pressed='true'] { color: var(--accent); background: var(--accent-bg); border-color: #5b4673; }
.connection {
  display: flex; align-items: center; gap: 8px; color: var(--muted);
  white-space: nowrap; font-size: 12px; font-weight: 750;
}
.connection span { width: 7px; height: 7px; border-radius: 50%; background: #cba5ca; }
.connection[data-live='true'] { color: var(--success); }
.connection[data-live='true'] span { background: var(--success); }

.shell { display: grid; grid-template-columns: 192px minmax(0, 1fr); max-width: 1920px; margin: auto; }
.sidebar {
  position: sticky; top: 0; align-self: start; display: flex; flex-direction: column;
  min-height: calc(100vh - 68px); padding: 22px 12px 18px;
  background: var(--rail); border-inline-end: 1px solid var(--divider);
}
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 10px;
  border: 1px solid transparent; border-radius: 9px; color: var(--muted); text-decoration: none;
  font-size: 13px; font-weight: 720;
}
.sidebar nav a:hover { background: var(--raised); color: var(--ink); }
.sidebar nav a[aria-current] { color: var(--accent); background: var(--accent-bg); border-color: #514166; }
.sidebar svg { width: 18px; height: 18px; }
.rail-meta { margin-top: auto; padding: 22px 9px 5px; display: grid; gap: 8px; color: var(--muted); font-size: 11px; }
.link-button {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 0;
  border: none; background: transparent; color: var(--accent); font-size: 13px; font-weight: 700; text-align: start;
}
.link-button:hover { text-decoration: underline; }
.link-button svg { width: 15px; height: 15px; }

main { min-width: 0; padding: 24px clamp(18px, 2.4vw, 35px) 52px; }
#page { display: grid; width: min(100%, 1500px); margin-inline: auto; gap: 17px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.deal-header { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(400px, 1.1fr); gap: 18px; align-items: stretch; }
.deal-header .page-heading { display: grid; align-content: center; justify-items: start; gap: 7px; }
.context-line { display: flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 730; font-size: 13px; }
.context-line svg { width: 15px; height: 15px; }
.context-line small { margin-inline-start: 4px; color: var(--muted); font-weight: 600; }
h1 { margin-block: 3px 4px; font-size: clamp(31px, 3.5vw, 48px); line-height: 1.07; letter-spacing: -.065em; font-weight: 780; }
.page-heading p, .section-title p, .panel p { color: var(--muted); font-size: 14px; line-height: 1.55; }
h2 { font-size: 19px; font-weight: 780; line-height: 1.22; letter-spacing: -.035em; }
h3 { font-size: 16px; font-weight: 760; line-height: 1.3; letter-spacing: -.015em; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px;
  padding: 7px 12px; border: 1px solid transparent; border-radius: 9px; text-decoration: none;
  font-size: 13px; font-weight: 770; line-height: 1.25; white-space: nowrap;
}
.button svg { width: 17px; height: 17px; }
.action { background: var(--accent); color: var(--accent-deep); }
.action:not(:disabled):hover { background: #ebd9ff; }
.subtle { background: var(--raised); color: var(--ink); border-color: var(--divider); }
.subtle:not(:disabled):hover { border-color: #70598a; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.choice {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 9px;
  border-radius: 7px; color: var(--muted); font-size: 13px; line-height: 1.2; font-weight: 720;
}
.choice[aria-pressed='true'] { background: var(--accent-bg); color: var(--accent); border-color: #5b4673; }
.choices { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.panel { min-width: 0; border: 1px solid var(--divider); border-radius: var(--radius); background: var(--panel); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.padded, .guide, .info-panel { padding: 19px; }
.padded > p, .info-panel p { margin-top: 8px; }
.padded > .button { margin-top: 13px; }
.padded > .section-title { margin-bottom: 12px; }

.plan { padding: 14px 16px 12px; }
.month-control input, select, .search {
  border: 1px solid var(--divider); border-radius: 8px; background: #191520;
}
.month-control input, select { min-height: 39px; padding: 6px 9px; font-size: 13px; }
.plan-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; margin-top: 11px; }
.plan-metric { min-height: 62px; padding: 9px 11px; border-left: 2px solid #765c91; background: #292134; border-radius: 6px; }
.plan-metric > span { display: block; color: #d8cde0; font-size: 12px; font-weight: 740; line-height: 1.2; }
.plan-metric strong { display: block; margin-top: 4px; font-size: 21px; line-height: 1.13; color: var(--ink); }
.plan-metric small { color: var(--muted); font-size: 15px; }
.plan .caption, .caption { margin-top: 8px; color: var(--muted); font-size: 12px; }

.cover { position: relative; overflow: hidden; border: 1px solid #514069; border-radius: var(--radius); background: #30243f; }
.cover-inner { position: relative; display: flex; align-items: stretch; gap: 0; min-height: 103px; }
.cover-picture {
  position: absolute; inset: 0 0 0 auto; width: 49%; height: 100%; object-fit: cover; object-position: 50% 47%;
  opacity: .58; mask-image: linear-gradient(90deg, transparent, #000 31%); filter: saturate(.68);
}
.cover-main, .cover-stat { display: grid; align-content: center; gap: 2px; padding: 11px 19px; min-width: 0; }
.cover-main { border-inline-end: 1px solid #67547d; }
.cover-stat { border: 0; background: transparent; text-align: left; }
.cover-stat:not(:disabled):hover { background: #765c9129; }
.cover-inner span { color: #f4eafa; font-size: 13px; font-weight: 750; }
.cover-inner strong { display: block; font-size: 34px; line-height: 1.02; font-weight: 800; font-variant-numeric: tabular-nums; }
.cover-inner small { font-size: 12px; color: #e1d1eb; }
.cover-stat strong { color: #ffd1b7; }

.work { overflow: hidden; }
.work > .section-title { padding: 14px 16px 11px; }
.mode-control { padding: 2px; border: 1px solid var(--divider); border-radius: 10px; }
.mode-control .choice { min-height: 32px; }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; padding: 0 16px 7px; }
.select-control { display: inline-flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 13px; }
.select-control select { max-width: 205px; }
.search { display: inline-flex; align-items: center; gap: 7px; padding: 0 9px; min-height: 39px; }
.search svg { width: 17px; height: 17px; color: var(--muted); }
.search input { min-width: 0; width: 100%; padding: 6px 0; border: 0; background: transparent; font-size: 13px; }
.search input:focus { outline: none; }
.search:focus-within { border-color: var(--accent); }
.search input::placeholder { color: var(--muted); }
.filter-row .search { flex: 1 1 230px; min-width: min(195px, 100%); }
.issue-filters, .stage-filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px 16px 7px; }
.issue-filters .choice:not([aria-pressed='true']) { border-color: var(--divider); }
.issue-filters .overdue[aria-pressed='true'] { background: var(--warning-bg); color: var(--warning); border-color: #865448; }
.stage-filters { padding-top: 0; }
.stage-filters .choice { font-size: 12px; min-height: 32px; }
.table-scroll { position: relative; overflow-x: auto; overscroll-behavior-inline: contain; }
.records { width: 100%; min-width: 700px; border-collapse: collapse; text-align: left; }
.records th {
  padding: 9px 11px; background: #271f32; border-block: 1px solid var(--divider);
  color: #d7cadf; font-size: 12px; line-height: 1.2; font-weight: 780;
}
.records th:first-child, .records td:first-child { padding-left: 16px; }
.records td { padding: 10px 11px; border-bottom: 1px solid #352c40; color: #eee6f3;
  font-size: 13px; line-height: 1.36; vertical-align: top; overflow-wrap: anywhere; }
.records td small { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.records tr:last-child td { border-bottom: 0; }
.records tbody tr:hover { background: #251d30; }
.record-link { color: var(--ink); text-decoration: none; font-weight: 780; }
.record-link:hover { color: var(--accent); text-decoration: underline; }
.records td:first-child { width: 20%; }
.records td:nth-child(2) { width: 17%; }
.records td:nth-child(3) { width: 18%; }
.records td:nth-child(4) { width: 25%; }
.date-cell { white-space: nowrap; }
.records .late { color: var(--warning); font-weight: 780; }
.stage-name { color: #e1d1ef; }
.row-action { color: var(--accent); }
.row-action svg { width: 16px; height: 16px; }
.flag { display: inline-flex; width: fit-content; padding: 2px 6px; border-radius: 5px; font-weight: 790; font-size: 11px;
  background: #393045; color: var(--accent); }
.next-cell .flag { display: flex; margin-top: 5px; }
.flag.overdue { color: var(--warning); background: var(--warning-bg); }
.flag.missing { color: #ffbacd; background: #492937; }
.flag.undated { color: #f4d39b; background: #47382b; }
.flag.unverified { color: #e2d7eb; }
.empty { padding: 14px 16px; color: var(--muted); font-size: 13px; }
.subhead { padding: 14px 16px 7px; }
.more { margin: 8px 16px 12px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; color: var(--muted); font-size: 12px; }
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 8px; padding: 4px 11px 12px; }
.lane { min-width: 0; padding: 8px; border: 1px solid var(--divider); border-radius: 10px; background: #18141f; }
.lane h3 { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 4px 3px 8px; font-size: 13px; }
.lane h3 span { color: var(--accent); }
.lane article { padding: 10px; border: 1px solid var(--divider); border-radius: 9px; background: var(--panel); font-size: 13px; overflow-wrap: anywhere; }
.lane article + article { margin-top: 7px; }
.lane article p { margin-top: 4px; font-size: 12px; }
.kanban-top { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.kanban-task { border-top: 1px solid var(--divider); margin-top: 7px; padding-top: 7px; font-size: 12px; }
.kanban-task small { display: block; color: var(--muted); margin-top: 3px; }
.record-actions { display: flex; align-items: center; gap: 5px; }
.record-actions .history-button, .kanban .history-button { min-height: 32px; padding: 4px 9px; font-size: 12px; }
.kanban .history-button { margin-top: 8px; }

.office-grid, .team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.office-grid .select-control { margin-top: 14px; }
.office-grid .select-control select { width: min(100%, 300px); max-width: none; }
.shift-funnel { padding: 20px; border-color: #35405c; background: #151d2b; }
.shift-funnel h2 { color: #f6f8ff; }
.shift-funnel-stages {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); position: relative;
  margin: 16px 0 0; padding: 0; list-style: none; isolation: isolate;
}
.shift-funnel-stages::before {
  content: ''; position: absolute; inset: 68px 0 58px; z-index: -1;
  background: linear-gradient(90deg, #587bf4 3%, #67a1ee 36%, #76d1ca 68%, #c7df9b 100%);
  clip-path: var(--funnel-shape, polygon(0 50%, 100% 50%, 100% 50%, 0 50%));
}
.shift-funnel-stages li {
  display: grid; grid-template-rows: minmax(2.2em, auto) auto 1fr; min-height: 222px; min-width: 0;
  padding-inline: 14px; border-inline-start: 1px dashed #52617c;
}
.shift-funnel-stages li:last-child { border-inline-end: 1px dashed #52617c; }
.shift-funnel-stages li > span { font-size: 13px; font-weight: 760; line-height: 1.15; color: #dae4f8; }
.shift-funnel-stages li > strong {
  font-size: clamp(29px, 4vw, 54px); line-height: .93; letter-spacing: -.065em; font-variant-numeric: tabular-nums;
}
.shift-funnel-note { align-self: end; display: grid; align-content: end; gap: 3px; min-height: 55px; }
.shift-funnel-note b { color: #a9dfd5; font-size: 12px; }
.shift-funnel-note small { color: #c7d0e3; font-size: 12px; }
.shift-outcomes {
  display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 16px 0 0; padding: 12px 0 0;
  border-top: 1px solid #35405c; list-style: none; color: #e0e7f6; font-size: 13px;
}
.shift-outcomes span { margin-inline-end: 3px; color: #a9dfd5; font-weight: 800; }
.shift-scope { margin-top: -8px; }
.shift-details h2 { margin-bottom: 12px; }
.shift-details .definitions { gap: 0; }
.shift-details .definitions > div {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline;
  gap: 12px; padding-block: 7px; border-bottom: 1px solid var(--divider);
}
.shift-details dt { font-size: 13px; font-weight: 620; }
.shift-details dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.panel .route-note, .source-detail { margin-top: 11px; padding: 12px; border-radius: 8px; background: var(--raised); }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 15px; color: var(--accent); font-size: 13px; }
.flow span { padding: 6px 8px; border: 1px solid var(--divider); border-radius: 6px; }
.flow svg { width: 13px; height: 13px; }
.person { display: flex; align-items: center; gap: 9px; padding: 12px; }
.person > div:nth-child(2) { flex: 1; }
.person h2 { font-size: 16px; }
.person p { margin-top: 3px; font-size: 12px; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px;
  background: var(--accent-bg); color: var(--accent); font-size: 13px; font-weight: 800; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.marketing-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.funnel-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 0 16px 14px; }
.funnel-filters label { display: inline-flex; align-items: center; gap: 7px; }
.funnel-filters input { min-width: 130px; font: inherit; color: inherit; background: transparent; border: 1px solid currentColor; border-radius: 6px; padding: 5px 7px; }
.funnel-filters .caption { flex-basis: 100%; margin: 0; }
.funnel-summary, .funnel-notes { padding: 0 16px 14px; }
.funnel-table { min-width: 1200px; }
.funnel-table tbody th, .funnel-table tfoot th { text-align: left; min-width: 175px; }
.funnel-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.funnel-table tfoot { font-weight: 700; }
.funnel-shift { margin-top: 12px; }
.mini { padding: 14px; display: grid; gap: 5px; }
.mini span { color: #dfd2e7; font-size: 13px; font-weight: 760; }
.mini strong { font-size: 29px; line-height: 1.1; }
.mini small, .status-label { color: var(--muted); font-size: 12px; }
.guide summary { cursor: pointer; font-weight: 760; }
.guide p { margin-top: 8px; }
.guide a { display: inline-block; margin-top: 7px; color: var(--accent); font-size: 13px; }
.stage-bars { display: grid; gap: 10px; }
.stage-bars > div { display: grid; grid-template-columns: minmax(120px, 200px) 1fr 35px; align-items: center; gap: 8px; font-size: 13px; }
.stage-bars progress { width: 100%; height: 13px; accent-color: #b397d8; }
.marketing-tabs, .knowledge-tools { padding: 8px 10px; }
.knowledge-tools { display: grid; gap: 8px; }
.department-tabs { padding-bottom: 8px; border-bottom: 1px solid var(--divider); }
.library-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.library-card { display: grid; grid-template-columns: 31px minmax(0,1fr); gap: 7px;
  align-content: start; min-height: 159px; padding: 13px; text-align: start; }
.library-card:hover { border-color: #82659e; background: var(--raised); }
.document-icon { display: grid; place-items: center; min-block-size: 30px; background: var(--accent-bg); color: var(--accent); border-radius: 7px; }
.document-icon svg { width: 17px; height: 17px; }
.document-kind { align-self: center; color: var(--muted); font-size: 12px; }
.library-card strong, .document-summary, .document-open { grid-column: 1 / -1; }
.library-card strong { font-size: 15px; }
.document-summary { color: var(--muted); font-size: 13px; }
.document-open { display: flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--accent); font-size: 12px; font-weight: 750; }
.document-open svg { width: 13px; height: 13px; }
.channels td { min-width: 100px; }
.channels td:first-child { width: 28%; }
.agent-flow { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 6px; }
.agent-flow button { display: grid; gap: 7px; min-height: 85px; padding: 8px;
  border: 1px solid var(--divider); border-radius: 8px; background: #1b1623; text-align: left; font-size: 12px; }
.agent-flow button[aria-pressed='true'] { border-color: #8e6dac; background: var(--accent-bg); color: var(--accent); }
.agent-flow strong { align-self: end; font-size: 23px; }
.source-detail p { margin-top: 4px; }
.agent-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.agent-heading h2 { font-size: 19px; }
.agent-journal { padding: 16px; }
.journal-list, .dialogue-stream { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.journal-row, .agent-review { padding: 13px 15px; border: 1px solid var(--divider); border-radius: 10px; background: #1b1623; }
.journal-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(115px, 24%) auto; align-items: center; gap: 12px; }
.journal-row h3, .agent-review h3 { font-size: 15px; }
.journal-channel, .journal-result small { margin-bottom: 3px; color: var(--accent); font-size: 12px; }
.journal-result { display: grid; gap: 3px; font-size: 13px; }
.agent-journal p, .agent-review dd { color: var(--muted); font-size: 13px; }
.journal-row p { margin-top: 4px; }
.agent-review .definitions { margin-bottom: 12px; overflow-wrap: anywhere; }

dialog { width: min(550px, calc(100% - 28px)); max-height: 85dvh; padding: 18px 20px 22px; color: var(--ink);
  background: var(--panel); border: 1px solid #5b4673; border-radius: 15px; }
dialog::backdrop { background: #100d16cc; }
.dialog-top { display: flex; justify-content: end; }
.icon-button { border: 1px solid var(--divider); border-radius: 8px; padding: 6px; background: var(--raised); }
dialog h2 { margin: -4px 38px 12px 0; }
dialog p, dialog dd { line-height: 1.55; color: var(--muted); font-size: 14px; }
dialog p + p, dialog .button { margin-top: 10px; }
dialog:has(.history-summary) { width: min(670px, calc(100% - 28px)); }
.history-summary, .history-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.history-summary > div, .history-facts > section, .history-next {
  padding: 11px; border: 1px solid var(--divider); border-radius: 9px; background: var(--background);
}
.history-summary span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.history-summary strong { font-size: 14px; overflow-wrap: anywhere; }
.history-facts, .history-next, .history-events { margin-top: 10px; }
.history-facts h3, .history-next h3, .history-events h3 { margin-bottom: 4px; font-size: 14px; }
.history-facts p + p { margin-top: 5px; }
.history-conversations { margin-top: 10px; }
.history-conversations h3 { margin-bottom: 5px; font-size: 14px; }
.history-conversations h3 span { margin-inline-start: 3px; color: var(--muted); font-weight: 550; }
.history-conversations ul { margin: 6px 0 0; padding: 0; list-style: none; }
.history-conversations ul > li { padding: 8px 10px; background: var(--background);
  border: 1px solid var(--divider); border-radius: 8px; }
.history-conversations ul > li + li { margin-top: 4px; }
.conversation-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px 12px; }
.conversation-actions { flex-wrap: wrap; }
.history-conversations li strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.history-conversations li small, .history-conversations li time { display: block; color: var(--muted); font-size: 12px; }
.history-conversations li .button { margin: 0; white-space: nowrap; }
.chat-transcript { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--divider); }
.transcript-messages { display: grid; gap: 5px; margin: 7px 0 0; padding: 0; list-style: none; }
.transcript-message { background: var(--panel); border-radius: 7px; padding: 7px 9px; }
.history-conversations .transcript-message strong, .history-conversations .transcript-message time { display: inline; }
.transcript-message p { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.transcript-message.system-message p { color: var(--muted); font-size: 12px; }
.transcript-status:empty { display: none; }
.history-next.history-attention { border-color: #765556; background: var(--warning-bg); }
.history-next.history-attention h3 { color: var(--warning); }
.history-events ol { margin: 7px 0 0; padding: 0 0 0 12px; border-left: 1px solid #71588c; list-style: none; }
.history-events li { display: flex; justify-content: space-between; gap: 7px 13px; padding: 6px 0; }
.history-events li + li { border-top: 1px solid var(--divider); }
.history-events strong { display: block; font-size: 13px; }
.history-events span, .history-events time { color: var(--muted); font-size: 12px; }
.history-events time { text-align: right; flex: 0 0 38%; }
.history-loading { padding-bottom: 8px; color: var(--muted); font-size: 14px; }
.history-links { flex-wrap: wrap; }
.dialogue-context { margin-bottom: 10px; }
.dialogue-message { padding: 11px 13px; border: 1px solid var(--divider); border-radius: 9px; background: var(--background); }
.dialogue-message.ai-message { border-color: #5b4673; background: var(--accent-bg); }
.message-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; font-size: 13px; font-weight: 750; }
.message-head time { color: var(--muted); font-size: 12px; font-weight: 500; }
.dialogue-message p { color: var(--ink); }
.review-form { display: grid; gap: 9px; margin-top: 10px; padding-top: 12px; border-top: 1px solid #71588c; }
.review-form label { display: grid; gap: 5px; font-size: 13px; font-weight: 700; }
.review-form textarea { width: 100%; resize: vertical; padding: 8px; border: 1px solid var(--divider);
  border-radius: 7px; color: var(--ink); background: var(--background); font: inherit; }
.review-form .button { margin-top: 0; }
.review-form .caption { color: var(--muted); }
.dialogue-message .review-confirmed { color: var(--success); }
.review-form .review-error { color: var(--warning); }
.definitions { display: grid; gap: 9px; margin: 0; }
.definitions dt { font-weight: 800; }
.definitions dd { margin: 3px 0 0; }
.plan-document { max-height: 45vh; overflow: auto; padding: 12px; border: 1px solid var(--divider);
  border-radius: 8px; background: var(--background); white-space: pre-wrap; overflow-wrap: anywhere;
  font: 13px/1.5 Manrope, 'Segoe UI', sans-serif; }
.connect-page main { width: min(100%, 620px); margin: 34px auto; }
.connect-page main > p { margin-top: 10px; color: var(--muted); }
.connect-page .top { grid-template-columns: 1fr; }
.connect-form { display: grid; gap: 12px; margin-top: 18px; padding: 18px; }
.connect-form input:is([type='password'], [type='text']) { min-height: 43px; padding: 7px 10px; color: var(--ink); background: var(--background);
  border: 1px solid var(--divider); border-radius: 9px; }
.connect-form a { justify-self: start; color: var(--accent); font-size: 13px; }
.connect-form #webhook-help { color: var(--muted); font-size: 13px; }
.remember-session { display: flex; align-items: center; gap: 8px; width: fit-content; }
.remember-session input { flex: none; width: 16px; height: 16px; accent-color: var(--accent); }
.connect-form button { justify-self: start; }
.connect-form [role='alert'] { color: var(--warning); }

@media (max-width: 1100px) {
  .top { grid-template-columns: 177px minmax(0, 1fr) auto; padding-inline: 16px; }
  .shell { grid-template-columns: 168px minmax(0,1fr); }
  .sidebar { padding-inline: 8px; }
}
@media (max-width: 820px) {
  .top { grid-template-columns: 1fr auto; gap: 5px 8px; padding: 8px 14px; }
  .projects { grid-row: 2; grid-column: 1 / -1; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .connection { grid-row: 1; grid-column: 2; }
  .shell { display: block; }
  .sidebar { z-index: 2; min-height: 0; padding: 6px 10px; border-inline-end: 0; border-bottom: 1px solid var(--divider); }
  .sidebar nav { display: flex; overflow-x: auto; scrollbar-width: thin; gap: 2px; }
  .sidebar nav a { flex: 0 0 auto; min-height: 38px; gap: 5px; white-space: nowrap; }
  .rail-meta { display: none; }
  .agent-flow { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width: 1000px) {
  .deal-header { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .deal-header .page-heading { display: flex; }
}
@media (max-width: 580px) {
  main { padding: 16px 11px 34px; }
  #page { gap: 12px; }
  .page-heading { flex-wrap: wrap; gap: 8px; }
  .plan-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .plan-metric { min-height: 52px; }
  .plan .section-title { flex-wrap: wrap; gap: 6px; }
  .cover-picture { width: 48%; opacity: .4; }
  .cover-main, .cover-stat { padding-inline: 10px; }
  .cover-inner span, .cover-inner small { font-size: 11px; }
  .work > .section-title, .filter-row, .issue-filters, .stage-filters { padding-inline: 10px; }
  .summary-grid, .marketing-grid, .library-grid, .agent-flow { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .office-grid, .team-grid { grid-template-columns: minmax(0,1fr); }
  .shift-funnel { padding: 14px 11px; }
  .shift-funnel-stages li { min-height: 203px; padding-inline: 6px; }
  .shift-funnel-stages li > span, .shift-funnel-note b, .shift-funnel-note small { font-size: 11px; }
  .shift-funnel-stages li > span { overflow-wrap: anywhere; }
  .library-heading .search { max-width: 52%; }
  .person { flex-wrap: wrap; }
  .journal-row { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .journal-row .button { justify-self: start; }
  .history-facts { grid-template-columns: minmax(0, 1fr); }
}
