/* ---- Osney Capital brand fonts ---- */
@font-face {
  font-family: "Miasma";
  src: url("/assets/fonts/miasma_light.woff") format("woff");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Modern Gothic";
  src: url("/assets/fonts/ModernGothic-Light.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Modern Gothic";
  src: url("/assets/fonts/ModernGothic-LightItalic.woff2") format("woff2");
  font-style: italic;
  font-weight: 300;
  font-display: swap;
}

/* ---- Osney Capital refreshed brand palette ----
   Oxford blue #001A3D | Off White #F3E8DF | Chalk blue #BED7F4
   Electric blue #1A5BF3 | Green blue #6FD2BF */
:root {
  --navy: #001a3d;        /* Oxford blue */
  --navy-dark: #0d2b52;   /* hover state on Oxford blue */
  --accent: #1a5bf3;      /* Electric blue */
  --chalk: #bed7f4;       /* Chalk blue */
  --teal: #6fd2bf;        /* Green blue */
  --offwhite: #f3e8df;    /* Off White */
  --amber: #b7791f;
  --green: #0e7c6b;       /* dark Green blue, for won states */
  --red: #9b2c2c;
  --ink: #001a3d;
  --muted: #5a6b81;
  --line: #e6dbd0;
  --bg: #f3e8df;
  --card: #ffffff;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 26, 61, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Modern Gothic", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  height: 52px;
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--offwhite);
}
.brand img { height: 17px; display: block; }
.brand span {
  font-weight: 300;
  opacity: 0.75;
  font-size: 15px;
  letter-spacing: 0.08em;
}
.brand:hover { text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: 4px; }
.topbar nav > a,
.nav-menu > summary {
  color: rgba(255, 255, 255, 0.75);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
}
.topbar nav > a:hover,
.nav-menu > summary:hover {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}
.topbar nav > a.active,
.nav-menu.active > summary {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}
.nav-menu {
  position: relative;
  flex: none;
}
.nav-menu > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary span {
  font-size: 14px;
  line-height: 1;
  transition: transform 120ms ease;
}
.nav-menu[open] > summary {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}
.nav-menu[open] > summary span { transform: rotate(180deg); }
.nav-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 172px;
  padding: 6px;
  border: 1px solid rgba(0, 26, 61, 0.08);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 26, 61, 0.2);
}
.nav-menu-panel-right {
  right: 0;
  left: auto;
}
.nav-menu-panel a {
  display: block;
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--ink);
  white-space: nowrap;
}
.nav-menu-panel a:hover {
  color: var(--ink);
  text-decoration: none;
  background: var(--bg);
}
.nav-menu-panel a.active {
  color: var(--navy);
  background: rgba(190, 215, 244, 0.55);
  font-weight: 500;
}
.session-list {
  margin: 14px 0;
  border-top: 1px solid var(--line);
}
.session-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.session-row > div { flex: 1; min-width: 0; }

.search-wrap { margin-left: auto; position: relative; width: 320px; }
.search-wrap input {
  width: 100%;
  padding: 7px 12px;
  border-radius: 6px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  outline: none;
}
.search-wrap input::placeholder { color: rgba(255, 255, 255, 0.55); }
.search-wrap input:focus { background: #fff; color: var(--ink); }
.search-results {
  position: absolute;
  top: 42px;
  left: 0;
  right: 0;
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 26, 61, 0.18);
  max-height: 60vh;
  overflow: auto;
  padding: 6px 0;
}
.search-results .group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 8px 14px 2px;
}
.search-results a {
  display: block;
  padding: 6px 14px;
  color: var(--ink);
}
.search-results a:hover { background: var(--bg); text-decoration: none; }
.search-results a small { color: var(--muted); margin-left: 6px; }
.search-results .empty { padding: 10px 14px; color: var(--muted); }

@media (max-width: 780px) {
  .topbar {
    height: auto;
    min-height: 52px;
    padding: 8px 12px 0;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand { min-width: 0; }
  .brand img { width: 138px; height: auto; max-width: 36vw; }
  .brand span { display: none; }
  .search-wrap {
    flex: 1;
    width: auto;
    min-width: 90px;
    margin-left: auto;
  }
  .topbar nav {
    order: 4;
    width: calc(100% + 24px);
    margin: 0 -12px;
    padding: 0 8px 6px;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .topbar nav > a,
  .nav-menu > summary {
    flex: none;
    padding: 6px 9px;
    font-size: 12.5px;
  }
  .nav-menu-panel { z-index: 1; }
  .search-results { top: 38px; }
}

/* ---- layout ---- */
main { padding: 20px; }
.page-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-family: "Miasma", "Modern Gothic", serif;
  font-weight: 300;
  font-size: 24px;
  margin: 0;
  letter-spacing: 0.01em;
}
.page-head .spacer { flex: 1; }
.back-link { color: var(--muted); font-size: 13px; }
.subtle { color: var(--muted); }

/* ---- board ---- */
.board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  cursor: grab;
  padding-bottom: 16px;
  align-items: flex-start;
  min-height: calc(100vh - 140px);
}
.board.is-swiping {
  cursor: grabbing;
  user-select: none;
}
.board.is-swiping * { cursor: grabbing !important; }
.board:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.column {
  flex: 0 0 240px;
  background: rgba(0, 26, 61, 0.05);
  border-radius: var(--radius);
  border-top: 3px solid var(--accent);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 150px);
}
.column.group-parked { border-top-color: var(--amber); }
.column.group-terminal-won { border-top-color: var(--green); }
.column.group-terminal-lost { border-top-color: var(--red); }
.column.group-divider { margin-left: 16px; }
.column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.column-stage-name { min-width: 0; }
.column-stage-type {
  padding: 2px 6px;
  border-radius: 999px;
  color: #76520b;
  background: #fff1bd;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
}
.column-probability {
  margin-left: auto;
  font-size: 10px;
  font-weight: 650;
}
.column-head .count {
  background: rgba(0, 26, 61, 0.08);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
}
.column-body {
  padding: 4px 8px 12px;
  overflow-y: auto;
  min-height: 40px;
  flex: 1;
}
.column-body.drop-hover { background: rgba(26, 91, 243, 0.08); border-radius: 0 0 var(--radius) var(--radius); }

.deal-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: grab;
  border: 1px solid transparent;
}
.deal-card:hover { border-color: var(--accent); }
.deal-card.dragging { opacity: 0.5; }
.deal-card .org { font-weight: 600; margin-bottom: 2px; }
.deal-card .org a { color: var(--ink); }
.deal-card .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.deal-card .days { margin-left: auto; }
.deal-card .days.stale { color: var(--red); font-weight: 600; }

/* ---- chips ---- */
.chip {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--chalk);
  color: var(--navy);
}
.chip.kind-startup { background: #d9e7fc; color: var(--accent); }
.chip.kind-investor { background: #dcf4ee; color: var(--green); }
.chip.kind-lp { background: #f3e8ff; color: #7e22ce; }
.chip.kind-partner { background: #fef3c7; color: #92400e; }
.chip.kind-university { background: #e0f2fe; color: #0369a1; }
.chip.tag { background: #ece1d6; color: var(--muted); }

.stage-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--chalk);
  color: var(--navy);
}
.stage-badge.group-parked { background: #fef3c7; color: #92400e; }
.stage-badge.stage-won { background: #dcf4ee; color: var(--green); }
.stage-badge.stage-lost { background: #fee2e2; color: #991b1b; }

/* ---- panels / detail pages ---- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.panel h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 12px;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px 20px;
}
.field-grid .field label {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 2px;
}
.field-grid .field div { font-weight: 500; overflow-wrap: anywhere; }

/* ---- lists / tables ---- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: #faf5ef; }
tbody tr.clickable { cursor: pointer; }

.row-list { list-style: none; margin: 0; padding: 0; }
.row-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.row-list li:last-child { border-bottom: none; }
.row-list .spacer { flex: 1; }

/* Searchable contact → company association control. */
.association-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(70px, 110px) auto;
  position: relative;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
}
.association-autocomplete {
  position: static;
  min-width: 0;
}
.association-role { min-width: 0; }
.association-add-row .btn { white-space: nowrap; }
.association-autocomplete-results {
  position: absolute;
  z-index: 12;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #cfc4b6;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 26, 61, 0.16);
}
.association-autocomplete-option,
.association-autocomplete-empty {
  padding: 7px 9px;
  border-radius: 4px;
}
.association-autocomplete-option { cursor: pointer; }
.association-autocomplete-option.active {
  color: #fff;
  background: var(--accent);
}
.association-autocomplete-empty { color: var(--muted); }
@media (max-width: 520px) {
  .association-add-row { grid-template-columns: minmax(0, 1fr) auto; }
  .association-autocomplete {
    position: relative;
    grid-column: 1 / -1;
  }
}

/* Searchable company lookup in the new-deal modal. */
.company-lookup { position: relative; }
.company-lookup-results {
  position: absolute;
  z-index: 12;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #cfc4b6;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 26, 61, 0.16);
}
.company-lookup-option,
.company-lookup-empty {
  padding: 7px 9px;
  border-radius: 4px;
}
.company-lookup-option { cursor: pointer; }
.company-lookup-option.active {
  color: #fff;
  background: var(--accent);
}
.company-lookup-match {
  padding: 0;
  color: inherit;
  background: transparent;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
.company-lookup-help {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.company-lookup-empty { color: var(--muted); }

/* Linked-people rows (deal + account panels): name, email, phone, LinkedIn. */
.row-list li.person-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.5fr) minmax(0, 1fr) 74px 30px;
  align-items: center;
}
.person-row .person-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person-row .person-who { display: flex; align-items: center; gap: 8px; }
.person-row .person-who .avatar-sm { flex: none; }
.person-row .person-who a { overflow: hidden; text-overflow: ellipsis; }
.person-row .person-who .chip { flex: none; }
.account-people-panel .person-row .person-who,
.opportunity-people-panel .person-row .person-who { gap: 12px; }
.account-people-panel .person-row .avatar-sm,
.opportunity-people-panel .person-row .avatar-sm {
  width: 44px;
  height: 44px;
  font-size: 14px;
}
@media (max-width: 700px) {
  .row-list li.person-row { grid-template-columns: minmax(0, 1fr) 30px; row-gap: 2px; }
  .person-row .person-cell { grid-column: 1; }
  .person-row .btn.danger-text { grid-column: 2; grid-row: 1; }
}

/* ---- timeline ---- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 14px 22px;
  border-left: 2px solid var(--line);
  margin-left: 6px;
}
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
}
.timeline li.terminal-lost::before { background: var(--red); }
.timeline li.terminal-won::before { background: var(--green); }
.timeline .when { color: var(--muted); font-size: 12px; }
.timeline .reason { color: var(--muted); font-style: italic; margin-top: 2px; }

/* ---- notes ---- */
.notes-panel-head {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.note-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 26, 61, 0.07);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.quick-note-composer {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfaf8;
}
.quick-note-composer textarea {
  width: 100%;
  min-height: 64px;
  padding: 2px;
  resize: vertical;
  border: none;
  background: transparent;
  line-height: 1.45;
}
.quick-note-composer textarea:focus {
  outline: none;
  border-color: transparent;
}
.note-composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: none;
}
.quick-note-composer .note-composer-actions { width: 100%; }
.note-formatting { margin-right: auto; }
.note-list { display: flex; flex-direction: column; gap: 8px; }
.note-item {
  padding: 14px 14px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fdfcfb;
  box-shadow: 0 1px 1px rgba(0, 26, 61, 0.025);
}
.note-item:hover { border-color: #d4c6b7; }
.note-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.note-card-head .spacer { flex: 1; }
.note-card-head h3 {
  min-width: 0;
  margin: 0;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.note-card-actions,
.timeline-note-actions { display: flex; align-items: center; gap: 2px; }
.note-card-actions .btn,
.timeline-note-actions .btn {
  padding: 3px 6px;
  font-size: 11.5px;
  font-weight: 500;
}
.note-item .note-head {
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  margin-bottom: 10px;
}
.note-item .note-body {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.5;
}
.note-association-links {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin: -2px 0 10px;
}
.note-association-label {
  color: var(--muted);
  font-size: 10.5px;
}
.note-association-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 7px 2px 4px;
  border: 1px solid #d9dfe8;
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 10.5px;
  line-height: 1.4;
}
.note-association-chip:hover {
  border-color: #afc5e5;
  background: #f5f8fd;
  text-decoration: none;
}
.note-association-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #e7edf6;
  color: var(--navy);
  font-size: 9px;
  font-weight: 700;
}
.note-association-icon.person { background: #e7f3ff; color: #18558f; }
.note-association-icon.deal { background: #fff1dc; color: #8a5000; }
.note-association-icon.organisation { background: #e5f5f1; color: #176756; }
.modal.rich-note-modal { max-width: 820px; padding: 22px; }
.rich-note-intro {
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: 12.5px;
}
.rich-note-field > label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.rich-note-associations {
  position: relative;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf8;
}
.rich-note-association-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.rich-note-association-heading label {
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
}
.rich-note-association-heading span {
  color: var(--muted);
  font-size: 11px;
}
.note-association-suggestions {
  margin-bottom: 10px;
  padding: 9px;
  border: 1px solid #d8e4f4;
  border-radius: 7px;
  background: #f4f8fd;
}
.note-suggestion-heading {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 7px;
}
.note-suggestion-heading span {
  color: var(--navy);
  font-size: 11px;
  font-weight: 650;
}
.note-suggestion-heading small {
  color: var(--muted);
  font-size: 10px;
}
.note-suggestion-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.note-suggestion {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid #d9e2ef;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.note-suggestion:hover,
.note-suggestion:focus {
  border-color: #9cb8df;
  background: #fbfdff;
  outline: none;
}
.note-suggestion-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}
.note-suggestion-copy strong,
.note-suggestion-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-suggestion-copy strong {
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
}
.note-suggestion-copy small {
  color: var(--muted);
  font-size: 9.5px;
}
.note-suggestion-add {
  flex: none;
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
}
.note-association-selection {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 26px;
  margin-bottom: 8px;
}
.note-association-empty {
  color: var(--muted);
  font-size: 11.5px;
}
.note-selected-association {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 4px 3px 5px;
  border: 1px solid #d9dfe8;
  border-radius: 7px;
  background: #fff;
  color: var(--navy);
  font-size: 11.5px;
}
.note-selected-association > span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-selected-association button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.note-selected-association button:hover {
  background: #fbeaea;
  color: var(--red);
}
.rich-note-associations input[type="search"] {
  padding: 7px 9px;
  background: #fff;
  font-size: 12px;
}
.note-association-results {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% - 12px);
  z-index: 2;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(0, 26, 61, 0.18);
}
.note-association-results:empty { display: none; }
.note-association-result {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid #eee7df;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.note-association-result:last-child { border-bottom: none; }
.note-association-result:hover,
.note-association-result:focus { background: #f3f7fd; outline: none; }
.note-association-result-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.note-association-result-copy strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-association-result-copy small {
  color: var(--muted);
  font-size: 10.5px;
}
.note-association-status {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 11.5px;
}
.rich-note-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  padding: 6px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: #f8f4ef;
}
.rich-note-tool {
  min-width: 30px;
  height: 28px;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.rich-note-tool:hover { border-color: var(--line); background: #fff; }
.rich-note-tool.strong { font-weight: 800; }
.rich-note-tool.italic { font-style: italic; }
.rich-note-tool.underline { text-decoration: underline; }
.rich-note-editor {
  min-height: 300px;
  max-height: 52vh;
  overflow: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: #fff;
  line-height: 1.55;
  outline: none;
}
.rich-note-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(20, 93, 160, 0.12); }
.rich-note-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}
.rich-note-editor p,
.rich-note-content p { margin: 0 0 0.75em; }
.rich-note-editor h2,
.rich-note-content h2 { margin: 1em 0 0.45em; color: var(--navy); font-size: 18px; }
.rich-note-editor h3,
.rich-note-content h3 { margin: 0.9em 0 0.4em; color: var(--navy); font-size: 15px; }
.rich-note-editor blockquote,
.rich-note-content blockquote {
  margin: 0.8em 0;
  padding-left: 12px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.rich-note-editor img,
.rich-note-content img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  margin: 10px 0;
  border-radius: 7px;
}
.rich-note-editor hr,
.rich-note-content hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.rich-note-content { line-height: 1.5; overflow-wrap: anywhere; }
.rich-note-content > :first-child { margin-top: 0; }
.rich-note-content > :last-child { margin-bottom: 0; }
.note-item .rich-note-content h2 {
  margin: 0.85em 0 0.35em;
  font-size: 16px;
  line-height: 1.3;
}
.note-item .rich-note-content h3 { font-size: 14px; }
.note-item .rich-note-content hr { margin: 14px 0; }
.rich-note-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.rich-note-actions .spacer { flex: 1; }

@media (max-width: 640px) {
  .rich-note-actions { flex-wrap: wrap; }
  .rich-note-actions .dated-section-add { width: 100%; }
  .note-card-head { align-items: flex-start; }
  .note-card-actions { margin-top: -3px; }
  .note-suggestion-list { grid-template-columns: 1fr; }
}

/* ---- activity timeline (emails & meetings, Salesforce-style) ---- */
.panel-head-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.panel-head-row h2 { margin-bottom: 0; }
.panel-head-row .spacer { flex: 1; }

.act-group-head {
  display: flex;
  align-items: center;
  background: rgba(0, 26, 61, 0.05);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  margin: 10px 0 4px;
}
.act-group-head .act-group-tag { margin-left: auto; }
.act-empty { color: var(--muted); font-size: 12.5px; padding: 6px 12px; margin: 0 0 6px; }

.act-list { position: relative; }
.act-item { position: relative; }
/* Keep every timeline connector centred on the icon tiles. Drawing from one
   icon centre to the next lets the tiles mask the line without visible gaps. */
.act-item:not(:last-child)::after,
.tl-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 35px;
  top: 22px;
  bottom: -22px;
  width: 2px;
  background: var(--line);
}
.act-item summary {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
}
.act-item summary::-webkit-details-marker { display: none; }
.act-caret {
  flex: none;
  width: 14px;
  margin-top: 7px;
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.12s ease;
}
.act-item[open] .act-caret { transform: rotate(90deg); }
.act-icon {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
  z-index: 1;
}
.act-icon svg { width: 16px; height: 16px; }
.act-icon.act-email { background: #8091a7; }
.act-icon.act-meeting { background: #9333ea; }
.act-main { flex: 1; min-width: 0; }
.act-head { display: flex; align-items: baseline; gap: 10px; }
.act-subject {
  font-size: 13.5px;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.act-item summary:hover .act-subject { text-decoration: underline; }
.act-when { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.act-summary {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.act-detail { padding: 0 0 10px 52px; font-size: 12.5px; }
.act-snippet { margin: 0 0 6px; color: var(--ink); white-space: pre-wrap; }
.act-meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.act-participants { color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }

/* ---- email viewer ---- */
.email-page-head { align-items: flex-end; }
.email-page-head > div > p {
  margin: 4px 0 0;
  color: var(--muted);
}
.email-layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-height: calc(100vh - 135px);
}
.email-inbox {
  padding: 0;
  overflow: hidden;
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 88px);
}
.email-toolbar { padding: 14px; border-bottom: 1px solid var(--line); }
.email-filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.email-list { overflow-y: auto; max-height: calc(100vh - 184px); }
.email-list-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 3px;
  padding: 12px 14px;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  font: inherit;
  cursor: pointer;
}
.email-list-item:hover { background: #faf5ef; }
.email-list-item.active {
  background: rgba(190, 215, 244, 0.38);
  box-shadow: inset 3px 0 0 var(--accent);
}
.email-list-top { display: flex; align-items: center; gap: 8px; }
.email-list-top strong {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-list-top time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.email-list-subject {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-list-preview {
  color: var(--muted);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-list-flags { display: flex; align-items: center; gap: 7px; margin-top: 4px; flex-wrap: wrap; }
.email-needs-record { font-size: 11.5px; font-weight: 700; }
.email-needs-record.contact { color: #9f1239; }
.email-needs-record.account { color: #92400e; }
.email-linked { color: var(--green); font-size: 11.5px; font-weight: 600; }
.email-queue-flag {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 5px 9px;
  background: #fff;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.email-queue-flag:hover { background: #fff8ed; }
.email-queue-flag.contact { color: #9f1239; }
.email-queue-flag.account { color: #92400e; }
.email-list-empty, .email-empty {
  padding: 36px 20px;
  color: var(--muted);
  text-align: center;
}
.email-empty { display: flex; flex-direction: column; gap: 5px; }
.email-reader { min-height: 560px; padding: 24px; }
.email-reader-head {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.email-reader-head > div:first-child { min-width: 0; flex: 1; }
.email-reader-kicker {
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.email-reader h1 {
  margin: 5px 0 9px;
  font-family: "Miasma", "Modern Gothic", serif;
  font-size: 28px;
  font-weight: 300;
  overflow-wrap: anywhere;
}
.email-reader-meta { color: var(--muted); overflow-wrap: anywhere; }
.email-reader-meta strong { color: var(--ink); }
.email-reader-meta span { display: block; margin-top: 3px; }
.email-reader-actions {
  flex: none;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
}
.email-action-badge, .email-matched-badge {
  flex: none;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 700;
}
.email-action-badge { color: #92400e; background: #fef3c7; }
.email-matched-badge { color: var(--green); background: #dcf4ee; }
.email-to-line {
  padding: 10px 0;
  color: var(--muted);
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
}
.email-body {
  min-height: 150px;
  padding: 24px 0 30px;
  white-space: pre-wrap;
  line-height: 1.65;
}
.email-has-attachments {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}
.email-reader-attachments {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0 0 20px;
}
.email-reader-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.email-reader-attachment {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fafafa;
  text-decoration: none;
}
.email-reader-attachment:hover {
  border-color: var(--accent);
  background: #faf5ef;
}
.email-reader-attachment span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-reader-attachment small {
  flex: none;
  color: var(--muted);
}
/* Email attachments inside a record timeline */
.act-attach-flag {
  flex: none;
  border: none;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}
.act-attach-flag:hover,
.act-attach-flag:focus-visible {
  background: #dbe4f0;
  outline: 1px solid var(--navy);
}
.act-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 4px;
}
.act-attachment-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
button.email-reader-attachment {
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.act-attachment-row .email-reader-attachment {
  flex: 0 1 auto;
  min-width: 0;
}
.act-attachment-download {
  flex: none;
  text-decoration: none;
}
.act-attachment-file {
  flex: none;
  white-space: nowrap;
}
.email-crm-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.email-crm-head-copy { min-width: 0; }
.email-crm-head h2 { margin-bottom: 4px; }
.email-crm-head p { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; }
.email-record-row {
  display: grid;
  grid-template-columns: minmax(170px, .8fr) minmax(280px, 1.4fr);
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.email-record-person { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.email-record-person-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.email-record-person-head > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-record-person > strong, .email-record-person > a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-record-person > a { font-size: 12px; }
.email-record-person .chip { align-self: flex-start; }
.email-record-links { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.email-record-link {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(190, 215, 244, .45);
  font-size: 12px;
}
.email-record-link:hover { background: var(--chalk); text-decoration: none; }
.missing-record-flag {
  display: inline-flex;
  flex: none;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10.5px;
  font-weight: 700;
}
.missing-record-flag.contact { color: #9f1239; background: #ffe4e6; }
.missing-record-flag.account { color: #92400e; background: #fef3c7; }

/* Email intake keeps the three-record workflow in one reviewable surface. */
.modal.email-intake-modal { max-width: 760px; }
.email-intake-intro { margin: -5px 0 18px; color: var(--muted); line-height: 1.45; }
.email-intake-section + .email-intake-section { margin-top: 22px; }
.email-intake-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.email-intake-section-head h3 { margin: 0; font-size: 14px; }
.email-intake-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfdff;
}
.email-intake-card + .email-intake-card { margin-top: 8px; }
.email-intake-checkline {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
}
.email-intake-checkline input[type="checkbox"] { margin: 0; }
.email-intake-checkline.opportunity {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.email-intake-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 9px 0 0 25px;
}
.email-intake-fields .form-row,
.email-intake-opportunity-name .form-row { margin: 0; }
.email-intake-opportunity-name { margin: 7px 0 0 25px; }
.email-intake-existing { margin: 7px 0 0 25px; color: var(--muted); font-size: 12px; }

/* Full email draft editor. Draft creation is intentionally distinct from
   sending: the destination and permission boundary stay visible throughout. */
.modal.email-editor-modal {
  width: min(900px, calc(100vw - 32px));
  max-width: 900px;
  max-height: 90vh;
  padding: 22px;
}
.email-draft-destination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -4px 0 16px;
  padding: 10px 12px;
  border: 1px solid #c9d8ee;
  border-radius: 8px;
  color: var(--navy);
  background: #f1f6fd;
  font-size: 12.5px;
}
.email-draft-destination span { color: var(--muted); text-align: right; }
.email-recipient-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}
.email-recipient-row .form-row { min-width: 0; }
.email-recipient-options {
  display: flex;
  gap: 2px;
  padding-bottom: 12px;
}
.email-recipient-options button {
  border: 0;
  padding: 5px 7px;
  color: var(--accent);
  background: none;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.email-recipient-options button:hover { text-decoration: underline; }
.email-template-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(180px, auto);
  align-items: end;
  gap: 10px;
}
.email-template-row .form-row { min-width: 0; margin-bottom: 10px; }
.email-template-row .btn { margin-bottom: 10px; white-space: nowrap; }
.email-template-status {
  align-self: center;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11.5px;
}
.email-subject-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 175px;
  align-items: end;
  gap: 10px;
}
.email-subject-row .form-row { margin-bottom: 10px; }
.email-subject-row select { margin-bottom: 10px; }
.email-composer-tabs {
  display: flex;
  gap: 20px;
  min-height: 34px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
}
.email-composer-tabs button {
  margin-bottom: -1px;
  padding: 7px 2px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.email-composer-tabs button:hover { color: var(--navy); }
.email-composer-tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}
.email-composer-tabs button:focus-visible {
  border-radius: 3px;
  outline: 2px solid rgba(26, 91, 243, .3);
  outline-offset: 2px;
}
.email-composer-pane { margin-top: 8px; }
.email-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 38px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #f8f6f3;
  overflow-x: auto;
}
.email-format-button {
  min-width: 29px;
  height: 27px;
  padding: 3px 7px;
  border: 0;
  border-radius: 5px;
  color: var(--navy);
  background: transparent;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.email-format-button:hover, .email-format-button:focus-visible {
  color: var(--accent);
  background: #fff;
  outline: 1px solid #d2dce9;
}
.email-format-button:nth-child(1) { font-weight: 700; }
.email-format-button:nth-child(2) { font-style: italic; }
.email-format-button:nth-child(3) { text-decoration: underline; }
.email-format-button:nth-child(4) { text-decoration: line-through; }
.email-toolbar-divider { align-self: stretch; width: 1px; margin: 2px 3px; background: var(--line); }
.email-editor-body {
  min-height: 280px;
  max-height: 44vh;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  overflow-y: auto;
  line-height: 1.55;
  outline: none;
}
.email-editor-body:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(26, 91, 243, .1); }
.email-editor-body:empty::before {
  content: attr(data-placeholder);
  color: #9a948c;
  pointer-events: none;
}
.email-editor-body p { margin: 0 0 .8em; }
.email-editor-body blockquote {
  margin: .5em 0;
  padding-left: 12px;
  border-left: 3px solid #c9d8ee;
  color: var(--muted);
}
.email-preview-pane {
  min-height: 319px;
  max-height: calc(44vh + 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-y: auto;
  background: #fff;
}
.email-preview-status {
  min-height: 34px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  font-size: 11.5px;
}
.email-preview-resolved { color: #247146; }
.email-preview-resolved::before {
  content: '✓';
  margin-right: 6px;
  font-weight: 700;
}
.email-preview-warning { color: #8b5a18; }
.email-preview-warning code {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 4px;
  color: #76501d;
  background: #fff2d8;
  font: inherit;
}
.email-preview-subject-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.email-preview-subject-row > span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}
.email-preview-subject {
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.email-preview-subject.empty {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}
.email-preview-body {
  padding: 18px 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.email-preview-body p { margin: 0 0 .8em; }
.email-preview-body blockquote {
  margin: .5em 0;
  padding-left: 12px;
  border-left: 3px solid #c9d8ee;
  color: var(--muted);
}
.email-preview-empty { color: var(--muted); font-style: italic; }
.email-attachments {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
}
.email-attachments > label { flex: none; cursor: pointer; }
.email-attachments input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.email-attachment-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.email-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 240px;
  padding: 4px 6px 4px 9px;
  border-radius: 999px;
  color: var(--navy);
  background: #edf2f8;
  font-size: 11.5px;
}
.email-attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-attachment-chip button {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.email-attachment-chip button:hover { color: var(--red); }
.email-create-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
}
@media (max-width: 900px) {
  .email-layout { grid-template-columns: 1fr; }
  .email-inbox { position: static; max-height: none; }
  .email-list { max-height: 42vh; }
  .email-reader { min-height: 420px; }
}
@media (max-width: 560px) {
  .email-filter-row, .email-record-row, .email-intake-fields { grid-template-columns: 1fr; }
  .email-reader { padding: 18px; }
  .email-reader-head { flex-direction: column; }
  .email-reader-actions { align-items: flex-start; }
  .email-crm-head { align-items: flex-start; flex-direction: column; }
  .email-draft-destination { align-items: flex-start; flex-direction: column; gap: 3px; }
  .email-draft-destination span { text-align: left; }
  .email-template-row { grid-template-columns: minmax(0, 1fr) auto; }
  .email-template-status { grid-column: 1 / -1; margin-top: -6px; }
  .email-subject-row { grid-template-columns: 1fr; }
  .email-subject-row select { margin-top: -6px; }
  .email-editor-body { min-height: 220px; }
}

/* ---- forms ---- */
.form-row { margin-bottom: 12px; }
.form-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--navy);
}
input[type="text"], input[type="search"], input[type="url"], input[type="email"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cfc4b6;
  border-radius: 6px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(26, 91, 243, 0.3);
  border-color: var(--accent);
}
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.person-email-rows { display: grid; gap: 7px; }
.person-email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  gap: 8px;
  align-items: center;
}
.person-primary-choice {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  margin: 0 !important;
  color: var(--muted) !important;
  font-weight: 500 !important;
  white-space: nowrap;
  cursor: pointer;
}
.person-primary-choice input { margin: 0; }
.person-email-remove {
  width: 30px;
  min-height: 30px;
  padding: 0;
  font-size: 18px;
}
.person-email-add { margin-top: 8px; }
.contact-email-list { display: grid; gap: 3px; }
.person-emails-field { grid-column: span 2; }
.contact-email-address {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.primary-email-chip {
  padding: 1px 5px;
  vertical-align: 1px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.merge-email-note {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  color: #14532d;
  background: #ecfdf5;
  font-size: 12px;
}
.form-warning {
  background: #fef3c7;
  border: 1px solid #f6e05e;
  color: #92400e;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 13px;
}
.checkbox-grid label { display: flex; gap: 6px; align-items: center; font-weight: 400; }
@media (max-width: 480px) {
  .person-emails-field { grid-column: span 1; }
  .person-email-row { grid-template-columns: minmax(0, 1fr) 30px; }
  .person-primary-choice { grid-column: 1; }
  .person-email-remove { grid-column: 2; grid-row: 1; }
}

/* ---- buttons ---- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--navy-dark); }
.btn.secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid #cfc4b6;
  font-weight: 500;
}
.btn.secondary:hover { background: var(--bg); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn.danger-text { background: none; border: none; color: var(--red); padding: 2px 6px; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ---- deal people picker ---- */
.avatar-sm {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--chalk);
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.person-avatar {
  display: block;
  object-fit: cover;
  background: var(--chalk);
}
.person-headshot {
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  background: var(--chalk);
  color: var(--navy);
  font-size: 22px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.headshot-editor {
  position: relative;
  flex: none;
}
.headshot-trigger {
  flex: none;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}
.headshot-edit {
  position: absolute;
  right: -3px;
  bottom: -2px;
  width: 25px;
  height: 25px;
  border: 2px solid #fff;
  border-radius: 50%;
  padding: 0;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.headshot-edit:hover { background: var(--navy-dark); }
.headshot-edit:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.headshot-trigger:hover .person-avatar { filter: brightness(0.92); }
.headshot-trigger:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.modal.headshot-modal { max-width: 760px; }
.headshot-large {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 68vh;
  margin: 0 auto;
  border-radius: 8px;
  object-fit: contain;
}
.person-list-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.person-picker {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #faf5ef;
  padding: 10px;
}
.picker-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: #ece1d6;
  margin-bottom: 8px;
}
.picker-tab {
  border: none;
  background: none;
  padding: 4px 12px;
  border-radius: 6px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.picker-tab .count { margin-left: 6px; font-size: 11px; opacity: 0.7; }
.picker-tab.active { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.picker-controls { display: flex; gap: 8px; }
.picker-controls input[type="search"] { flex: 1; }
.picker-controls input[type="text"] { width: 150px; }
.picker-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  max-height: 280px;
  overflow: auto;
}
.picker-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
}
.picker-list li:hover { background: #fff; }
.picker-list .who { display: flex; flex-direction: column; min-width: 0; }
.picker-list .who-line { display: flex; align-items: center; gap: 8px; }
.picker-list .sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker-add { margin-left: auto; flex: none; }
.picker-empty { color: var(--muted); font-size: 12.5px; }
.picker-empty:hover { background: none; }
.picker-foot { margin-top: 6px; }

/* ---- modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 26, 61, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  z-index: 50;
}
.modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 540px;
  max-height: 84vh;
  overflow: auto;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 26, 61, 0.3);
}
.modal-overlay.record-form-overlay { padding-top: 24px; }
.record-form-modal { max-height: calc(100vh - 48px); }
.new-deal-modal { max-width: 760px; }
.company-record-modal { max-width: 960px; }
@media (min-width: 900px) {
  .company-record-modal .checkbox-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .company-details-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .company-address-grid,
  .company-investment-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .modal-overlay.record-form-overlay { padding: 12px; }
  .record-form-modal { max-height: calc(100vh - 24px); }
  .record-form-modal .form-2col { grid-template-columns: 1fr; }
}
.modal h2 { margin: 0 0 16px; font-size: 17px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.modal-actions .spacer { flex: 1; }
.merge-intro { margin: 0 0 12px; line-height: 1.45; }
.merge-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  overflow: auto;
  margin: 10px 0;
}
.merge-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.merge-option:hover { background: var(--bg); border-color: #b8aa9a; }
.merge-option.selected {
  background: #edf4ff;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.merge-option-copy { display: flex; flex-direction: column; min-width: 0; }
.merge-option-copy strong,
.merge-option-copy .subtle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.merge-option-copy .subtle { font-size: 12px; margin-top: 2px; }
.merge-results-label {
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  margin: 2px 0 1px;
}
.merge-match-reason {
  color: #806017;
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
}
.merge-match-reason.high { color: #187259; }
.merge-account-icon { width: 28px; height: 28px; font-size: 14px; }
.merge-modal { max-width: 780px; }
.merge-resolution h3 {
  margin: 0;
  color: var(--navy);
  font-size: 14px;
}
.merge-master-section > .subtle,
.merge-conflicts-section > .subtle {
  display: block;
  margin: 4px 0 10px;
  font-size: 12px;
}
.merge-master-options,
.merge-value-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.merge-master-card,
.merge-value-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.merge-master-card:hover,
.merge-value-card:hover { background: var(--bg); border-color: #b8aa9a; }
.merge-master-card.selected,
.merge-value-card.selected {
  background: #edf4ff;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.merge-master-card input,
.merge-value-card input { flex: none; margin: 2px 0 0; }
.merge-master-card > span,
.merge-value-card > span { min-width: 0; }
.merge-master-card strong,
.merge-master-card small { display: block; }
.merge-master-card small { margin-top: 2px; color: var(--muted); }
.merge-conflicts-section { margin-top: 20px; }
.merge-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.merge-conflict {
  min-width: 0;
  margin: 0;
  padding: 13px 0;
  border: none;
  border-top: 1px solid var(--line);
}
.merge-conflict legend {
  width: 100%;
  margin-bottom: 8px;
  padding: 0;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}
.merge-value-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  padding: 9px 10px;
}
.merge-value-card input { grid-row: 1 / 3; }
.merge-value-record {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.merge-value-text {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.35;
}
.merge-value-card.combine { background: #fbfaf7; }
.merge-value-card.combine.selected { background: #edf4ff; }
.merge-no-conflicts {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid #b8dfc5;
  border-radius: 8px;
  background: #edf9f1;
  color: #17663a;
  font-size: 13px;
}
.merge-warning { margin: 12px 0 0; line-height: 1.45; }
@media (max-width: 600px) {
  .merge-master-options, .merge-value-options { grid-template-columns: 1fr; }
}

/* ---- toasts ---- */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; }
.toast {
  background: var(--navy);
  color: var(--offwhite);
  border-radius: 8px;
  padding: 10px 16px;
  margin-top: 8px;
  box-shadow: 0 6px 18px rgba(0, 26, 61, 0.35);
  max-width: 360px;
  font-size: 13.5px;
}
.toast.error { background: var(--red); }

.empty-state { color: var(--muted); padding: 12px 0; }

/* ---- live-deal panel ---- */
.panel.live-deal { border-left: 3px solid var(--accent); }
.live-deal-head { display: flex; align-items: center; gap: 10px; }
.live-deal-head a { white-space: nowrap; }

/* ---- stage path (chevron banner shared by deal & company pages) ---- */
.stage-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}
.stage-strip .strip-days, .stage-strip .strip-link { white-space: nowrap; font-size: 12.5px; }
.stage-path {
  display: flex;
  flex: 1;
  gap: 3px;
  min-width: 0;
}
.stage-path .seg {
  --notch: 11px;
  flex: 1 1 0;
  min-width: 0;
  border: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 9px 8px 9px 16px;
  background: #e9ddd2;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% 50%,
    calc(100% - var(--notch)) 100%, 0 100%, var(--notch) 50%);
}
.stage-path .seg:first-child {
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% 50%,
    calc(100% - var(--notch)) 100%, 0 100%);
}
.stage-path .seg:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, var(--notch) 50%);
}
.stage-path .seg:not(:disabled):hover { filter: brightness(0.93); }
.stage-path .seg:disabled { cursor: default; }
.stage-path .seg { transition: flex-grow 0.28s ease; }
.stage-path .seg.done { flex: 0 1 44px; background: var(--green); color: #fff; }
/* Collapsed ticks grow on hover/focus, crossfading ✓ → stage name. */
.stage-path .seg.done { display: grid; align-items: center; justify-items: center; }
.stage-path .seg.done > span {
  grid-area: 1 / 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.18s ease;
}
.stage-path .seg.done .seg-label { opacity: 0; }
.stage-path .seg.done:hover,
.stage-path .seg.done:focus-visible { flex-grow: 1.4; }
.stage-path .seg.done:hover .seg-tick,
.stage-path .seg.done:focus-visible .seg-tick { opacity: 0; }
.stage-path .seg.done:hover .seg-label,
.stage-path .seg.done:focus-visible .seg-label { opacity: 1; transition-delay: 0.08s; }
@media (prefers-reduced-motion: reduce) {
  .stage-path .seg, .stage-path .seg.done > span { transition: none; }
}
.stage-path .seg.current { flex: 1.7 1 auto; background: var(--navy); color: #fff; }
.stage-path .seg.parked { flex: 1.7 1 auto; background: var(--amber); color: #fff; }
.stage-path .seg.won { flex: 1.4 1 auto; background: var(--green); color: #fff; }
.stage-path .seg.lost { flex: 1.4 1 auto; background: var(--red); color: #fff; }

/* On narrow screens the full path becomes a touch-friendly horizontal rail.
   Fixed segment widths keep labels legible, and stagePath() centres the active
   segment after render. Actions sit below the rail instead of competing with
   it for width. */
@media (max-width: 700px) {
  .stage-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
    padding: 12px;
  }
  .stage-path {
    grid-column: 1 / -1;
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-padding-inline: 24px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    touch-action: pan-x;
  }
  .stage-path::-webkit-scrollbar { display: none; }
  .stage-path .seg,
  .stage-path .seg.done,
  .stage-path .seg.done:hover,
  .stage-path .seg.done:focus-visible {
    flex: 0 0 128px;
    min-width: 128px;
    min-height: 44px;
    padding: 10px 15px 10px 22px;
    scroll-snap-align: center;
    font-size: 13px;
  }
  .stage-path .seg:first-child { padding-left: 14px; }
  .stage-path .seg.current,
  .stage-path .seg.parked,
  .stage-path .seg.won,
  .stage-path .seg.lost {
    flex-basis: 172px;
    min-width: 172px;
  }
  .stage-path .seg.done .seg-tick { display: none; }
  .stage-path .seg.done .seg-label { opacity: 1; }
  .stage-strip .mark-complete {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
    justify-self: stretch;
  }
  .stage-strip .strip-days { justify-self: start; }
  .stage-strip .strip-link { justify-self: end; }
}
@media (prefers-reduced-motion: reduce) {
  .stage-path { scroll-behavior: auto; }
}

/* ---- unified companies view ---- */
.org-deal-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  cursor: pointer;
  white-space: nowrap;
}
.org-deal-line:hover .stage-badge { filter: brightness(0.94); }
.page-head a .stage-badge { cursor: pointer; }
.page-head a:hover { text-decoration: none; }

/* ---- segmented pipeline toggle ---- */
.segmented {
  display: inline-flex;
  border: 1px solid #cfc4b6;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.segmented button {
  border: none;
  background: none;
  padding: 7px 16px;
  font: inherit;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button.active {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}

/* ---- dashboard ---- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.kpi .kpi-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}
.kpi .kpi-value { font-size: 22px; font-weight: 700; }
.kpi .kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
.deployment-pace-panel { overflow: hidden; }
.deployment-pace-head {
  align-items: flex-start;
  margin-bottom: 12px;
}
.deployment-pace-head h2 { margin-bottom: 3px; }
.deployment-pace-head p { margin: 0; max-width: 720px; font-size: 12.5px; }
.deployment-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.deployment-stat {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--canvas) 62%, #fff);
}
.deployment-stat span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.deployment-stat strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.deployment-chart-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--muted) transparent;
  scrollbar-width: thin;
  border-radius: 6px;
}
.deployment-chart-scroll::-webkit-scrollbar { height: 9px; }
.deployment-chart-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 70%, transparent);
  border-radius: 999px;
}
.deployment-chart-track {
  position: relative;
  min-width: 760px;
}
.deployment-y-axis {
  position: sticky;
  left: 0;
  z-index: 3;
  display: block;
  margin-top: -324px;
  max-width: none;
  pointer-events: none;
}
.deployment-forecast-chart { min-width: 760px; }
.chart-current-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.deployment-chart-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}
.deployment-plan-intro { margin: -4px 0 14px; line-height: 1.45; }
.deployment-plan-summary {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 720px) {
  .deployment-stats { grid-template-columns: 1fr 1fr; }
  .deployment-pace-head .spacer { display: none; }
}
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---- custom reports ---- */
.page-lede {
  margin: 5px 0 0;
  color: var(--muted);
  max-width: 720px;
}
.report-section-head,
.report-library-tools,
.report-result-meta,
.report-byline,
.report-filter-head,
.report-drill-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.report-section-head { margin: 0 0 10px; }
.report-section-head h2 {
  margin: 0;
  font: 300 19px/1.2 "Miasma", "Modern Gothic", serif;
}
.report-section-head span { color: var(--muted); font-size: 12.5px; }
.report-template-section { margin-bottom: 20px; }
.report-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.report-template-card {
  min-height: 172px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(0, 26, 61, 0.08);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.report-template-card:nth-child(2n) { border-top-color: #17a08a; }
.report-template-card:nth-child(3n) { border-top-color: var(--chalk); }
.report-template-kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10.5px;
}
.report-template-card h3 {
  margin: 8px 0 5px;
  font-size: 16px;
  font-weight: 600;
}
.report-template-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}
.report-template-card .btn { align-self: flex-start; }
.report-library { padding: 0; overflow: hidden; }
.report-library-tools {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.report-library-tools .report-search {
  width: min(320px, 100%);
  margin-left: auto;
}
.report-library-table-wrap,
.report-values-wrap,
.report-drill-table-wrap { overflow-x: auto; }
.report-library-table,
.report-values,
.report-drill-table { width: 100%; }
.report-library-table td:first-child { min-width: 230px; }
.report-library-table td:last-child { min-width: 220px; }
.report-library-table .report-library-empty {
  padding: 28px 16px;
  text-align: center;
  border-bottom: 0;
}
.report-row-description,
.report-drill-name {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  max-width: 460px;
}
.report-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.report-visibility {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11.5px;
  background: #eee4da;
  color: var(--muted);
}
.report-visibility.shared { background: #e6efff; color: #1243a7; }
.report-delete { color: var(--red) !important; border-color: rgba(155, 44, 44, 0.25) !important; }

.report-editor-head {
  position: sticky;
  top: 52px;
  z-index: 15;
  min-height: 60px;
  margin: -20px -20px 0;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 9px rgba(0, 26, 61, 0.06);
  backdrop-filter: blur(12px);
}
.report-name-input {
  min-width: 240px;
  max-width: 520px;
  font: 300 21px/1.2 "Miasma", "Modern Gothic", serif;
  border-color: transparent !important;
  background: transparent !important;
}
.report-name-input:focus { border-color: var(--accent) !important; background: #fff !important; }
.report-unsaved {
  font-size: 11.5px;
  color: var(--amber);
  white-space: nowrap;
}
.report-conflict {
  margin: 14px 0 0;
  padding: 10px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: #fff7e8;
  border: 1px solid #e7bc71;
  border-radius: var(--radius);
}
.report-editor {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  min-height: calc(100vh - 132px);
  margin: 0 -20px -20px;
}
.report-setup {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px 20px 40px;
}
.report-setup section + section {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 18px;
}
.report-setup h2,
.report-preview-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.report-filter-head { justify-content: space-between; margin: 16px 0 8px; }
.report-filter-head > span {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.report-match { width: auto; font-size: 12px; padding: 5px 7px; }
.report-filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.report-filter-chips .chip-filter { max-width: 100%; }
.report-preview {
  padding: 20px;
  min-width: 0;
  background:
    radial-gradient(circle at 100% 0, rgba(190, 215, 244, 0.35), transparent 32%),
    var(--offwhite);
}
.report-preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.report-preview-host,
.report-run-panel {
  min-height: 360px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 6px 22px rgba(0, 26, 61, 0.09);
}
.report-preview-host { padding: 20px; }
.report-preview-loading,
.report-preview-error,
.report-empty {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}
.report-preview-error strong { color: var(--red); }
.report-empty-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font: 300 28px "Miasma", serif;
  background: var(--offwhite);
  color: var(--navy);
}
.report-result-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 14px;
}
.report-result-meta span + span { border-left: 1px solid var(--line); padding-left: 10px; }
.report-result-meta .report-personalized {
  border-left: 0;
  background: #e6efff;
  color: #1243a7;
}
.report-quality {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  background: #fff8ea;
  color: #765018;
  font-size: 12.5px;
  line-height: 1.4;
}
.report-quality > div + div { margin-top: 4px; }
.report-visual {
  padding: 8px 0 20px;
  min-height: 220px;
}
.report-kpi {
  width: 100%;
  min-height: 250px;
  border: 0;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 28px clamp(24px, 7vw, 70px);
  background:
    linear-gradient(135deg, rgba(190, 215, 244, 0.5), rgba(255, 255, 255, 0.4)),
    #fff;
  color: var(--navy);
  text-align: left;
  cursor: pointer;
}
.report-kpi:hover { box-shadow: inset 0 0 0 2px rgba(26, 91, 243, 0.2); }
.report-kpi span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11.5px;
}
.report-kpi strong {
  margin: 6px 0;
  font: 300 clamp(38px, 7vw, 68px)/1 "Miasma", "Modern Gothic", serif;
}
.report-kpi small { color: var(--muted); }
.report-values-wrap {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.report-values th,
.report-values td { white-space: nowrap; }
.report-cell-link {
  border: 0;
  background: none;
  color: var(--accent);
  padding: 2px 0;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.report-cell-link:hover { text-decoration: underline; }
.report-run-head { align-items: flex-end; }
.report-run-head h1 { margin-top: 5px; }
.report-byline {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.report-run-population {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: -4px 0 14px;
}
.chip-filter-static { cursor: default; background: rgba(255, 255, 255, 0.7); }
.report-run-panel { padding: 20px; }
.report-danger-row { display: flex; justify-content: flex-end; }
.report-drill-modal { width: min(1040px, calc(100vw - 32px)); }
.report-drill-loading { color: var(--muted); padding: 30px 0; text-align: center; }
.report-drill-summary { margin: 4px 0 12px; color: var(--muted); }
.report-drill-table td:first-child { min-width: 190px; }

@media (max-width: 900px) {
  .report-editor-head { top: 0; flex-wrap: wrap; }
  .report-editor-head .report-name-input { order: -1; width: 100%; max-width: none; }
  .report-editor {
    grid-template-columns: 1fr;
    margin-top: 0;
  }
  .report-setup { border-right: 0; border-bottom: 1px solid var(--line); }
  .report-preview { padding: 14px; }
  .report-library-tools .report-search { width: 100%; margin-left: 0; }
}
@media (max-width: 780px) {
  .report-editor-head { margin-left: -14px; margin-right: -14px; }
  .report-editor { margin-left: -14px; margin-right: -14px; }
}
@media (max-width: 520px) {
  .report-template-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
  .report-template-card { flex: 0 0 84vw; scroll-snap-align: start; }
  .report-editor-head { margin-left: -14px; margin-right: -14px; padding: 10px 12px; }
  .report-editor-head .back-link,
  .report-editor-head .report-unsaved { display: none; }
  .report-editor-head .btn { min-height: 44px; flex: 1; }
  .report-editor { margin-left: -14px; margin-right: -14px; }
  .report-setup { padding: 16px 14px 28px; }
  .report-preview { padding: 14px; }
  .report-preview-host,
  .report-run-panel { padding: 14px; }
  .report-result-meta span + span { border-left: 0; padding-left: 0; }
  .report-run-head { align-items: stretch; }
  .report-run-head .btn { min-height: 44px; text-align: center; }
  .report-drill-modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
}

/* ---- charts ---- */
.chart { width: 100%; height: auto; display: block; }
.chart-tick { font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-label { font-size: 12px; }
.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-tip {
  position: absolute;
  z-index: 90;
  display: none;
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 26, 61, 0.35);
  max-width: 280px;
}
.chart-tip-title { font-weight: 600; margin-bottom: 4px; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.chart-tip-row strong { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.chart-tip-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
}

/* ---- enrichment ---- */
.enrich-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.enrich-item:last-child { border-bottom: none; }
.enrich-head { display: flex; align-items: center; gap: 8px; }
.enrich-head .spacer { flex: 1; }
.enrich-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.enrich-last { font-size: 12.5px; margin-top: 6px; }
.enrich-last .when { color: var(--muted); }
.chip.status-ok { background: #dcf4ee; color: var(--green); }
.chip.status-error { background: #fee2e2; color: #991b1b; }
.chip.status-unconfigured { background: #ece1d6; color: var(--muted); }
.enrich-history summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 6px; }
.enrich-history pre {
  background: #faf5ef;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  font-size: 11px;
  max-height: 260px;
  overflow: auto;
}
.companies-house-modal {
  max-width: 860px;
  max-height: calc(100vh - 48px);
}
.ch-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  position: sticky;
  top: -20px;
  z-index: 2;
  margin: -2px 0 14px;
  padding: 2px 0 10px;
  background: #fff;
}
.ch-search input { min-width: 0; }
.ch-results { display: flex; flex-direction: column; gap: 12px; }
.ch-results-summary {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.ch-candidate {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
  background: #fff;
}
.ch-candidate.recommended {
  border-color: #78b7a8;
  box-shadow: 0 0 0 2px rgba(20, 126, 105, 0.08);
}
.ch-candidate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ch-company-title { font-weight: 650; line-height: 1.3; }
.ch-company-meta,
.ch-address,
.ch-match-reasons,
.ch-preview-warning {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 3px;
}
.ch-match-reasons { color: var(--green); }
.ch-preview-warning { color: #8a5b12; }
.ch-officers {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}
.ch-officers > summary {
  padding: 9px 0 6px;
  cursor: pointer;
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 600;
}
.ch-officer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 12px;
}
.ch-officer:nth-of-type(odd) { background: #faf8f5; }
.ch-officer.has-crm-match { background: #edf8f4; }
.ch-officer-role {
  color: var(--muted);
  margin-left: 6px;
  text-transform: capitalize;
}
.ch-contact-match {
  color: var(--green);
  text-align: right;
}
.ch-no-officers {
  color: var(--muted);
  font-size: 12px;
  padding: 7px 8px;
}
.ch-match-action {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.ch-match-action .subtle {
  margin-right: auto;
  font-size: 11.5px;
}
@media (max-width: 640px) {
  .companies-house-modal { max-height: calc(100vh - 24px); }
  .ch-candidate-head,
  .ch-officer,
  .ch-match-action { align-items: flex-start; flex-direction: column; }
  .ch-contact-match { text-align: left; }
  .ch-match-action .btn { width: 100%; }
}

/* ---- profile avatar & settings ---- */
.avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--accent);
}
a.avatar:hover { text-decoration: none; filter: brightness(1.12); }
.avatar-row { display: flex; align-items: center; gap: 10px; }
.avatar-row input[type="color"] {
  width: 44px;
  height: 30px;
  padding: 2px;
  border: 1px solid #cfc4b6;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.avatar-preview { width: 34px; height: 34px; font-size: 12.5px; }

.settings-frame {
  width: min(100%, 1440px);
  margin-inline: auto;
}
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(16px, 1.6vw, 24px);
  align-items: start;
}
.settings-stack { min-width: 0; }
@media (max-width: 980px) {
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .settings-frame .page-head {
    align-items: flex-start;
  }
  .settings-frame .page-head .subtle {
    width: 100%;
    order: 2;
  }
  .settings-frame .page-head .spacer { display: none; }
  .settings-frame .page-head .btn {
    margin-left: auto;
  }
  .settings-frame .form-2col { grid-template-columns: 1fr; }
}
.notify-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.notify-row:last-child { border-bottom: none; }
.notify-row input { margin-top: 2px; }
.notify-row .form-hint { margin-top: 1px; }

/* ---- administration control centre ---- */
.admin-frame {
  width: min(100%, 1480px);
  margin: 0 auto;
}
.admin-page-head {
  min-height: 112px;
  margin: 0;
  padding: 10px 4px 24px;
}
.admin-page-head p { margin: 4px 0 0; }
.admin-eyebrow {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.admin-subnav {
  display: flex;
  align-items: center;
  gap: 4px;
  position: sticky;
  top: 62px;
  z-index: 10;
  padding: 6px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(230, 219, 208, 0.9);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 26, 61, 0.06);
  backdrop-filter: blur(12px);
}
.admin-subnav a {
  flex: none;
  color: var(--muted);
  padding: 9px 16px;
  border-radius: 7px;
  font-weight: 500;
}
.admin-subnav a:hover {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}
.admin-subnav a.active {
  color: var(--navy);
  background: #fff;
  box-shadow: var(--shadow);
}
.admin-content {
  min-width: 0;
  padding: 28px 4px 48px;
}
.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.admin-metrics a.metric-card { color: inherit; transition: border-color 120ms, transform 120ms; }
.admin-metrics a.metric-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
}
.admin-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.admin-overview-grid .panel { margin: 0; }
.admin-health-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.admin-health-row:last-child { border-bottom: none; }
.admin-health-row > div { min-width: 0; }
.admin-health-row strong { display: block; }
.admin-health-row .subtle { margin-top: 2px; font-size: 12px; }
.health-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.health-dot.good { background: var(--green); }
.health-dot.bad { background: var(--amber); }
.admin-audit-list { display: flex; flex-direction: column; }
.admin-audit-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.admin-audit-row:last-child { border-bottom: none; }
.admin-audit-row strong { display: block; }
.admin-audit-row .subtle { margin-top: 2px; font-size: 12px; }
.admin-audit-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--chalk);
  font-size: 11px;
  font-weight: 700;
}
.admin-audit-icon.template { background: #e7f6ec; color: #17663a; }
.admin-audit-icon.automation { background: #fff3d6; color: #7b5610; }
.admin-audit-icon.funnel { background: #e7eef8; color: #244e7a; }
.admin-audit-list.compact .admin-audit-row { padding: 8px 0; }
.funnel-info { margin-bottom: 16px; }
.funnel-editor-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.funnel-editor {
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.funnel-editor-head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.funnel-editor-head > div:first-child { min-width: 0; }
.funnel-editor-head h2 { margin: 0; font-size: 19px; }
.funnel-editor-head p { margin: 4px 0 0; font-size: 12px; }
.funnel-editor-actions {
  display: flex;
  flex: none;
  gap: 8px;
  margin-left: auto;
}
.funnel-groups { background: #faf8f5; }
.funnel-group {
  padding: 18px 20px 20px;
  border-bottom: 1px solid var(--line);
}
.funnel-group:last-child { border-bottom: 0; }
.funnel-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.funnel-group-head h3 { margin: 0; font-size: 14px; }
.funnel-group-head p { margin: 2px 0 0; font-size: 11.5px; }
.funnel-stage-columns,
.funnel-stage-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 126px 130px 72px;
  gap: 10px;
  align-items: center;
}
.funnel-stage-columns {
  padding: 0 10px 6px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.funnel-stage-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.funnel-stage-row {
  min-height: 54px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  transition: background 100ms, box-shadow 100ms;
}
.funnel-stage-row:last-child { border-bottom: 0; }
.funnel-stage-row.system { background: #fcfbf9; }
.funnel-stage-row.parked { box-shadow: inset 3px 0 var(--amber); }
.funnel-stage-name,
.funnel-stage-type,
.funnel-stage-probability {
  min-width: 0;
  padding: 7px 9px;
}
.funnel-stage-name:disabled {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  opacity: 1;
  font-weight: 600;
}
.funnel-stage-fixed { padding-left: 9px; font-size: 12px; }
.funnel-probability-field {
  display: flex;
  align-items: center;
  gap: 6px;
}
.funnel-probability-field span { color: var(--muted); font-size: 12px; }
.funnel-stage-probability { width: 92px; }
.funnel-stage-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}
.btn.icon-btn {
  width: 31px;
  height: 31px;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.btn.icon-btn:disabled { cursor: not-allowed; opacity: 0.38; }
.template-toolbar { margin: 0 0 10px; font-size: 12px; }
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.template-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.template-card.archived { opacity: 0.66; }
.template-card-head { display: flex; justify-content: space-between; gap: 8px; }
.template-card h3 { margin: 12px 0 5px; font-size: 16px; }
.template-subject { font-size: 12.5px; }
.template-card p {
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.45;
  margin: 8px 0 14px;
}
.template-card-meta { margin-top: auto; font-size: 11.5px; }
.template-card-actions { display: flex; gap: 7px; margin-top: 12px; }
.template-modal {
  width: min(940px, calc(100vw - 32px));
  max-width: none;
  max-height: 88vh;
  padding: 26px;
}
.template-modal h2 {
  margin-bottom: 5px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.template-modal-intro {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13.5px;
}
.template-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(180px, 0.8fr);
  gap: 14px;
}
.template-field { min-width: 0; }
.template-field > label,
.template-field-heading label {
  display: block;
  color: var(--navy);
  font-size: 12px;
  font-weight: 650;
}
.template-field > label { margin-bottom: 5px; }
.template-field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 20px;
  margin-bottom: 5px;
}
.template-field-heading span,
.template-body-counter {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.template-composer {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.85fr);
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.template-editor-panel {
  min-width: 0;
  padding: 18px;
}
.template-editor-panel .template-field + .template-field { margin-top: 14px; }
.template-editor-panel input,
.template-editor-panel textarea {
  border-color: #d7cdbf;
  background: #fefdfb;
}
.template-editor-panel textarea {
  min-height: clamp(220px, 28vh, 320px);
  line-height: 1.55;
}
.template-token-panel {
  min-width: 0;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: #faf7f2;
}
.template-token-panel-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 14px;
}
.template-token-panel-head p {
  margin: 3px 0 12px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}
.template-target-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
}
.template-target-control > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.template-target-options {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eee7de;
}
.template-target-option {
  padding: 4px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.template-target-option.active {
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 26, 61, 0.1);
}
.template-token-search {
  margin-bottom: 9px;
  background: #fff;
}
.template-token-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 236px;
  overflow-y: auto;
}
.template-token-option {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 0 9px;
  width: 100%;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.template-token-option:hover {
  border-color: var(--line);
  background: #fff;
}
.template-token-option:focus-visible,
.template-target-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.template-token-option.custom {
  margin-top: 2px;
  border-color: #d6e1f0;
  background: #f5f8fc;
}
.template-token-braces {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #e7eef8;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
}
.template-token-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.template-token-copy strong { color: var(--navy); font-size: 12.5px; }
.template-token-copy span {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.template-token-option code {
  grid-column: 2;
  margin-top: 5px;
  overflow: hidden;
  color: #315b8b;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.template-token-empty {
  padding: 18px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}
.template-token-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}
.template-token-help code { color: #315b8b; }
.template-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}
.template-save-summary {
  color: var(--muted);
  font-size: 11.5px;
}
.template-modal-footer .modal-actions { margin-top: 0; }
@media (max-width: 760px) {
  .template-modal {
    width: min(100%, calc(100vw - 24px));
    padding: 20px;
  }
  .template-meta-grid,
  .template-composer { grid-template-columns: 1fr; }
  .template-token-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .template-editor-panel textarea { min-height: 220px; }
  .template-modal-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .template-modal-footer .modal-actions { justify-content: stretch; }
  .template-modal-footer .btn { flex: 1; }
}
.admin-empty-state {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed #cfc4b6;
  box-shadow: none;
  background:
    radial-gradient(circle at 50% 35%, rgba(190, 215, 244, 0.28), transparent 38%),
    rgba(255, 255, 255, 0.72);
}
.admin-empty-state h2 { margin: 16px 0 7px; font-size: 20px; }
.admin-empty-state p {
  max-width: 520px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.admin-empty-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  background: var(--chalk);
  border-radius: 14px;
  font-family: "Miasma", "Modern Gothic", serif;
  font-size: 25px;
  box-shadow: 0 8px 24px rgba(0, 26, 61, 0.1);
}
.automation-list { display: flex; flex-direction: column; gap: 14px; }
.automation-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.automation-card-main {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px;
}
.automation-card-main h3 { margin: 0; }
.automation-card-main p { margin: 5px 0 0; }
.automation-title-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.automation-controls {
  display: grid;
  grid-template-columns: 120px 220px minmax(160px, 1fr) minmax(180px, 1fr);
  gap: 16px;
  align-items: end;
  padding: 13px 16px;
  background: rgba(0, 26, 61, 0.025);
  border-top: 1px solid var(--line);
}
.automation-controls .form-row { margin: 0; }
.automation-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  font-weight: 600;
  cursor: pointer;
}
.automation-run-state { display: flex; flex-direction: column; gap: 2px; }
.automation-run-state > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.automation-run-state strong { font-size: 12.5px; }
.automation-run-state small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.status-error { color: var(--red); }
.admin-info-panel { margin-bottom: 14px; padding-top: 13px; padding-bottom: 13px; }
.admin-info-panel span { color: var(--muted); }

/* ---- user access administration ---- */
.access-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 180px));
  gap: 12px;
  margin-bottom: 14px;
}
.metric-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-card strong { font-size: 24px; color: var(--navy); }
.metric-card span { color: var(--muted); font-size: 12px; }
.access-level-guide {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 14px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.access-level-guide div { display: flex; flex-direction: column; gap: 2px; }
.access-level-guide strong { font-size: 13px; }
.access-level-guide span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.access-table {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.access-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 100px 160px auto;
  gap: 16px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.access-row:last-child { border-bottom: none; }
.access-row.suspended { background: rgba(0, 26, 61, 0.025); }
.access-row.suspended .access-identity { opacity: 0.58; }
.access-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.access-identity .avatar { width: 36px; height: 36px; }
.access-identity > div { min-width: 0; }
.access-identity strong,
.access-identity .subtle {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.access-identity .subtle { margin-top: 2px; font-size: 12px; }
.access-status {
  justify-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.access-status.active { color: #17663a; background: #e7f6ec; }
.access-status.suspended { color: #8a3b22; background: #fbe9e3; }
.access-select { min-width: 0; padding-top: 6px; padding-bottom: 6px; }
.access-actions { display: flex; justify-content: flex-end; gap: 7px; }
.btn.compact { padding: 6px 10px; font-size: 12px; }
.btn.danger-ghost {
  color: var(--red);
  background: #fff;
  border: 1px solid #e7c0b5;
}
.btn.danger-ghost:hover { background: #fff5f2; }
.admin-user-form { margin-top: 8px; }
@media (max-width: 850px) {
  .admin-subnav {
    position: static;
    overflow-x: auto;
  }
  .admin-content { padding-top: 20px; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-overview-grid { grid-template-columns: 1fr; }
  .automation-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-summary { grid-template-columns: repeat(3, 1fr); }
  .access-level-guide { grid-template-columns: 1fr; gap: 10px; }
  .access-row {
    grid-template-columns: minmax(0, 1fr) 140px;
    gap: 9px 12px;
  }
  .access-status { grid-column: 1; }
  .access-select { grid-column: 2; grid-row: 1; }
  .access-actions { grid-column: 2; grid-row: 2; }
  .funnel-stage-columns { display: none; }
  .funnel-stage-row {
    grid-template-columns: minmax(170px, 1fr) 110px 114px;
  }
}
@media (max-width: 560px) {
  .admin-metrics, .template-grid, .automation-controls { grid-template-columns: 1fr; }
  .automation-card-main { flex-direction: column; }
  .access-summary { grid-template-columns: 1fr; }
  .access-row { grid-template-columns: 1fr; }
  .access-select, .access-status, .access-actions {
    grid-column: 1;
    grid-row: auto;
  }
  .access-actions { justify-content: flex-start; }
  .admin-user-form { grid-template-columns: 1fr; }
  .funnel-editor-head {
    align-items: stretch;
    flex-direction: column;
  }
  .funnel-editor-actions { margin-left: 0; }
  .funnel-editor-actions .btn { flex: 1; }
  .funnel-group { padding: 16px 12px; }
  .funnel-stage-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .funnel-stage-type,
  .funnel-stage-fixed,
  .funnel-probability-field,
  .funnel-stage-actions { grid-column: 1; }
  .funnel-stage-actions { justify-content: flex-start; }
}

/* ---- view bar (saved list views) ---- */
.view-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -6px 0 14px;
}
.view-select { width: auto; max-width: 260px; padding: 6px 10px; font-weight: 600; }
.btn.view-pin[aria-pressed="true"] {
  background: #fff7dc;
  border-color: var(--amber);
  color: var(--ink);
}
.btn.view-pin[aria-pressed="true"]:hover { background: #ffefb4; }
.dirty-dot { color: var(--amber); font-size: 10px; }
.chip-filter {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 10px;
  background: #fff;
  border: 1px solid #cfc4b6;
  color: var(--ink);
}
.chip-filter:hover { border-color: var(--accent); }
.chip-x {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  border-radius: 4px;
}
.chip-x:hover { color: var(--red); background: #fee2e2; }
.chip-add {
  cursor: pointer;
  background: none;
  border: 1px dashed #b7a996;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 10px;
}
.chip-add:hover { color: var(--accent); border-color: var(--accent); }
.view-bar .spacer { flex: 1; }

/* dropdown menu (view management) */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: inline-block; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] .menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 26, 61, 0.18);
  min-width: 200px;
  padding: 6px;
  display: flex;
  flex-direction: column;
}
.menu-item {
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink);
}
.menu-item:hover { background: var(--bg); }
.menu-item.danger { color: var(--red); }

/* column chooser */
.col-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.col-row:last-child { border-bottom: none; }
.col-row .spacer { flex: 1; }
.col-add-head {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 12px 0 4px;
}

/* ---- deals table ---- */
.table-panel { overflow-x: auto; }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--accent); }
.check-cell { width: 30px; }
.check-cell input { cursor: pointer; }
td.editable { position: relative; cursor: text; }
td.editable .edit-pen {
  opacity: 0;
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
}
td.editable:hover .edit-pen { opacity: 1; }
td.editable select, td.editable input { padding: 4px 8px; font-size: 13px; }
.owner-cell { display: inline-flex; align-items: center; gap: 6px; }
.avatar-xs {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--chalk);
  color: var(--navy);
  font-size: 9px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.next-task { font-size: 12.5px; }

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 12px;
}
.bulk-bar .spacer { flex: 1; }
.bulk-bar .danger-text { color: #ffb4b4; }

/* ---- due chips & tasks ---- */
.due-chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #ece1d6;
  color: var(--muted);
  white-space: nowrap;
}
.due-chip.today { background: #fef3c7; color: #92400e; }
.due-chip.overdue { background: #fee2e2; color: #991b1b; }
.task-flag { color: var(--red); font-weight: 700; }
.card-owner { float: right; margin-left: 6px; }

/* Large-list Tasks page */
.task-page-head { margin-bottom: 12px; }
.task-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.task-open-count {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.task-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.task-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 74px;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(0, 26, 61, 0.08);
  border-radius: 9px;
  box-shadow: 0 1px 2px rgba(0, 26, 61, 0.05);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.task-stat:hover {
  border-color: rgba(26, 91, 243, 0.35);
  box-shadow: 0 3px 10px rgba(0, 26, 61, 0.08);
  transform: translateY(-1px);
}
.task-stat.active {
  background: #fff;
  border-color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent), 0 2px 8px rgba(0, 26, 61, 0.08);
}
.task-stat-value {
  font-family: "Miasma", "Modern Gothic", serif;
  font-size: 25px;
  line-height: 1;
}
.task-stat-label {
  color: var(--muted);
  font-size: 12px;
}
.task-stat:nth-child(2) .task-stat-value { color: var(--red); }
.task-stat:nth-child(3) .task-stat-value { color: var(--amber); }

.task-workspace { padding: 0; overflow: hidden; }
.task-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 150px 190px auto;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.task-search { position: relative; }
.task-search::before {
  content: "⌕";
  position: absolute;
  z-index: 1;
  left: 11px;
  top: 50%;
  transform: translateY(-53%);
  color: var(--muted);
  font-size: 18px;
  pointer-events: none;
}
.task-search input[type="search"] {
  padding-left: 34px;
  background: #fbfaf8;
  border-color: #ded6cd;
}
.task-status-select,
.task-source-select { min-width: 0; background: #fbfaf8; }
.task-result-count {
  min-width: 76px;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.task-source {
  display: inline-flex;
  align-items: center;
  max-width: 260px;
  padding: 2px 7px;
  overflow: hidden;
  border: 1px solid #cfe3de;
  border-radius: 999px;
  color: #256b5b;
  background: #edf8f5;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-results { padding: 8px 16px 16px; }

.task-group {
  border-bottom: 1px solid var(--line);
}
.task-group:last-child { border-bottom: 0; }
.task-group > summary {
  list-style: none;
}
.task-group > summary::-webkit-details-marker { display: none; }
.task-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 7px 4px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.task-group-head::after {
  content: "⌄";
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.15s;
}
.task-group:not([open]) .task-group-head::after { transform: rotate(-90deg); }
.task-group-head:hover .task-group-name { color: var(--accent); }
.task-group-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #91a0b1;
  flex: none;
}
.task-group-overdue .task-group-dot { background: var(--red); }
.task-group-today .task-group-dot { background: var(--amber); }
.task-group-upcoming .task-group-dot { background: var(--accent); }
.task-group-completed .task-group-dot { background: var(--green); }
.task-group-name { transition: color 0.12s; }
.task-group-count {
  margin-left: auto;
  min-width: 28px;
  padding: 1px 8px;
  border-radius: 999px;
  text-align: center;
  color: var(--muted);
  background: rgba(0, 26, 61, 0.055);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.task-group-body { padding: 0 0 8px; }

.task-list li.task-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  min-height: 52px;
  padding: 9px 4px;
  border-bottom: 1px solid rgba(230, 219, 208, 0.78);
  transition: background 0.12s;
}
.task-list li.task-row:hover {
  background: #fcf9f6;
}
.task-list li.task-row:last-child { border-bottom: 0; }
.task-check {
  display: flex;
  justify-content: center;
  padding-top: 3px;
}
.task-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}
.task-row .task-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.task-row .task-title {
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  cursor: pointer;
}
.task-row .task-title:hover { color: var(--accent); }
.task-row .task-details {
  max-width: min(1100px, 100%);
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.75px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.task-row .task-details.expanded {
  display: block;
  white-space: pre-wrap;
}
.task-row .task-details a { color: #476f9e; }
.task-expand {
  margin: 3px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.task-meta {
  display: flex;
  align-items: center;
  gap: 6px 10px;
  flex-wrap: wrap;
  min-height: 18px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.task-meta:empty { display: none; }
.task-meta .chip.tag { white-space: nowrap; }
.task-owner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.task-owner .avatar-xs { width: 18px; height: 18px; font-size: 8px; }
.task-completed-at { color: var(--green); }
.task-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 58px;
  justify-content: flex-end;
  opacity: 0.18;
  transition: opacity 0.12s;
}
.task-row:hover .task-actions,
.task-row:focus-within .task-actions { opacity: 1; }
.task-action {
  min-width: 28px;
  padding: 3px 5px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: none;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.task-action:hover { color: var(--accent); background: rgba(26, 91, 243, 0.08); }
.task-action.danger { color: var(--red); font-size: 15px; }
.task-action.danger:hover { background: #fee2e2; }
.task-row.done { opacity: 0.72; }
.task-row.done .task-title {
  color: var(--muted);
  text-decoration: line-through;
}
.task-more {
  width: 100%;
  margin-top: 5px;
  padding: 8px;
  border: 1px dashed #cfc4b6;
  border-radius: 7px;
  color: var(--accent);
  background: #fcfaf8;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.task-more:hover { border-color: var(--accent); background: rgba(26, 91, 243, 0.04); }
.task-more span { color: var(--muted); }
.task-empty {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
  text-align: center;
}
.task-empty-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 50%;
  color: var(--green);
  background: #dcf4ee;
  font-size: 18px;
}
.task-empty strong { color: var(--ink); font-size: 14px; }
.overdue-head { color: #991b1b; }
.quick-add { display: flex; gap: 8px; margin-top: 10px; }
.done-fold summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 8px; }

@media (max-width: 900px) {
  .task-stats {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }
  .task-toolbar {
    grid-template-columns: minmax(180px, 1fr) 140px 170px;
  }
  .task-result-count { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 620px) {
  main { padding: 14px; }
  .task-page-head { align-items: stretch; }
  .task-page-head .task-heading { width: 100%; }
  .task-page-head .spacer { display: none; }
  .task-page-head .btn { flex: 1; text-align: center; }
  .task-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .task-stat { min-height: 62px; padding: 9px 11px; }
  .task-stat:first-child { grid-column: 1 / -1; }
  .task-stat-value { font-size: 21px; }
  .task-toolbar { grid-template-columns: 1fr; padding: 12px; }
  .task-results { padding: 6px 12px 12px; }
  .task-status-select { width: 100%; }
  .task-list li.task-row { grid-template-columns: 24px minmax(0, 1fr); }
  .task-actions {
    grid-column: 2;
    opacity: 1;
    justify-content: flex-start;
    min-width: 0;
    margin-top: -2px;
  }
  .task-owner { font-size: 0; }
}

/* ---- personal & team calendar ---- */
.calendar-page-head { row-gap: 8px; }
.calendar-range-label { min-width: 190px; text-align: center; }
.calendar-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.calendar-sidebar { position: sticky; top: 68px; }
.calendar-user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  margin: 0 -6px;
  border-radius: 6px;
  cursor: pointer;
}
.calendar-user-row:hover { background: #faf6f1; }
.calendar-user-row input { margin: 0; }
.calendar-user-avatar { color: #fff; }
.calendar-user-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-text-btn {
  flex: none;
  border: none;
  background: none;
  padding: 2px 4px;
  color: var(--accent);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.cal-text-btn:hover { text-decoration: underline; }
.cal-only-btn { opacity: 0; }
.calendar-user-row:hover .cal-only-btn, .cal-only-btn:focus-visible { opacity: 1; }
.calendar-main { padding: 0; overflow: hidden; min-height: 430px; }
.calendar-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  min-width: 770px;
}
.cal-weekday {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
}
.cal-day {
  min-height: 116px;
  padding: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day.outside { background: #faf8f5; color: var(--muted); }
.cal-day.today { background: rgba(26, 91, 243, 0.045); }
.cal-day-number {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 4px auto;
  font-size: 12px;
}
.cal-day.today .cal-day-number {
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-weight: 600;
}
.cal-event {
  --cal-colour: var(--accent);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px;
  width: 100%;
  margin: 0 0 4px;
  padding: 4px 5px;
  border: none;
  border-left: 3px solid var(--cal-colour);
  border-radius: 4px;
  background: color-mix(in srgb, var(--cal-colour) 10%, white);
  color: var(--ink);
  text-align: left;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
}
.cal-event:hover, .cal-event:focus-visible {
  outline: 1px solid var(--cal-colour);
  background: color-mix(in srgb, var(--cal-colour) 16%, white);
}
.cal-event.private { background: #f1efec; border-left-color: var(--muted); }
.cal-event-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-event-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-event-signals {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}
.cal-fireflies-cue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f4e5ff;
  color: #7e22ce;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.cal-fireflies-cue.labelled {
  width: auto;
  height: 24px;
  gap: 5px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  white-space: nowrap;
}
.cal-event-account {
  grid-column: 1 / -1;
  padding-left: 2px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-colour-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 5px;
  vertical-align: 1px;
}
.cal-colour-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}
.cal-more { color: var(--muted); font-size: 11px; padding: 2px 5px; }
/* ---- week & day time grid ---- */
.cal-grid-scroll {
  overflow: auto;
  /* Fill the viewport below the topbar + calendar page head. */
  height: calc(100vh - 134px);
  min-height: 430px;
}
.cal-grid-top { position: sticky; top: 0; z-index: 5; background: #fff; }
.cal-grid-head { display: grid; border-bottom: 1px solid var(--line); }
.cal-grid-day-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.cal-grid-day-head.today strong { color: var(--accent); }
.cal-grid-allday {
  display: grid;
  border-bottom: 1px solid var(--line);
  max-height: 132px;
  overflow-y: auto;
}
.cal-grid-allday-label {
  align-self: center;
  text-align: right;
  padding-right: 6px;
  color: var(--muted);
  font-size: 10.5px;
}
.cal-grid-allday-cell {
  padding: 3px 3px 0;
  border-left: 1px solid var(--line);
  min-width: 0;
}
.cal-grid-allday-cell .cal-event { margin-bottom: 3px; }
.cal-grid-body { display: grid; }
/* 1056px = 24 hours × CAL_HOUR_PX (44px, keep in sync with app.js). */
.cal-grid-gutter { position: relative; height: 1056px; }
.cal-grid-gutter span {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.cal-grid-col {
  position: relative;
  height: 1056px;
  border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom,
    var(--line) 0, var(--line) 1px, transparent 1px, transparent 44px);
}
.cal-grid-col.today { background-color: rgba(26, 91, 243, 0.035); }
.cal-now-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px solid var(--red);
  z-index: 3;
  pointer-events: none;
}
.cal-now-line::before {
  content: '';
  position: absolute;
  left: -1px;
  top: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}
.cal-slot {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
  margin: 0;
  overflow: hidden;
  padding: 3px 5px;
  box-shadow: 0 0 0 1px #fff;
  z-index: 1;
}
.cal-slot:hover, .cal-slot:focus-visible { z-index: 2; }
.cal-slot-title {
  font-weight: 600;
  font-size: 11px;
  line-height: 14px;
  overflow: hidden;
  /* Whole lines only — the inline -webkit-line-clamp set per slot does the
     counting; without it long titles would clip mid-glyph. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
/* Slots under ~45 min: one "Title ·· time" row instead of stacked lines. */
.cal-slot.slim {
  flex-direction: row;
  align-items: center;
  gap: 5px;
  padding: 2px 5px;
}
.cal-slot.slim .cal-slot-title {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cal-slot .cal-fireflies-cue {
  display: inline-flex;
  margin-left: 5px;
  vertical-align: -2px;
}
.cal-slot.slim .cal-fireflies-cue { margin-left: 0; }
.cal-slot.slim .cal-colour-dots { flex: none; margin-left: 0; }
.cal-slot.slim .cal-slot-time { flex: none; }
/* In cramped side-by-side slots the title beats the clock (tooltip has both). */
.cal-slot { container-type: inline-size; }
@container (max-width: 88px) {
  .cal-slot-time { display: none; }
}
.cal-slot-time {
  color: var(--muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-slot-account {
  color: var(--muted);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-agenda { padding: 6px 16px 16px; }
.calendar-agenda section > header {
  margin: 10px -4px 6px;
  padding: 7px 8px;
  background: var(--bg);
  border-radius: 6px;
  font-weight: 600;
}
.calendar-agenda .cal-event {
  grid-template-columns: 70px minmax(0, 1fr) auto;
  padding: 8px 10px;
  font-size: 13px;
}
.calendar-event-modal {
  display: flex;
  flex-direction: column;
  width: min(820px, 100%);
  max-width: 820px;
  max-height: 88vh;
  padding: 0;
  overflow: hidden;
}
.calendar-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.calendar-modal-header h2 {
  min-width: 0;
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.calendar-modal-close {
  flex: none;
  width: 32px;
  height: 32px;
  margin: -6px -8px -2px auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 25px;
  line-height: 30px;
  cursor: pointer;
}
.calendar-modal-close:hover,
.calendar-modal-close:focus-visible {
  background: var(--bg);
  color: var(--navy);
  outline: none;
}
.calendar-modal-body {
  min-height: 0;
  padding: 16px 22px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.calendar-modal-footer {
  flex: none;
  margin: 0;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.calendar-event-when {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.calendar-event-when .cal-fireflies-cue { margin-left: auto; }
.calendar-event-fields {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 24px;
  margin: 0 0 18px;
}
.calendar-event-fields .field.wide { grid-column: 1 / -1; }
.calendar-owner-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.calendar-owner-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 12.5px;
}
.calendar-owner-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.calendar-owner-chip .subtle { font-weight: 400; }
.calendar-event-preview {
  white-space: pre-wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--chalk);
  border-radius: 7px;
  background: #fbfaf8;
  line-height: 1.45;
}
.calendar-event-preview p { margin: 0; }
.calendar-event-preview.booking-notice {
  border-left-color: var(--amber);
  background: #fffaf1;
}
.calendar-event-preview.booking-notice .calendar-preview-label { color: #8a5a14; }
.calendar-event-preview.fireflies-preview {
  border-left: 3px solid #a855f7;
  background: #faf5ff;
}
.calendar-preview-label {
  margin-bottom: 6px;
  color: #7e22ce;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.calendar-private-note {
  padding: 10px 12px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 6px;
}
.calendar-external-links, .calendar-link-picker-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.calendar-external-links { margin-top: 12px; }
.calendar-link-picker {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}
.calendar-link-picker summary {
  padding: 11px 0 0;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.calendar-link-picker summary:hover { text-decoration: underline; }
.calendar-link-picker-body { padding-top: 10px; }
.calendar-link-picker-body > input[type="search"] { width: 100%; }
.calendar-link-search-status { margin: 4px 0 7px; }
.calendar-crm-links {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 18px;
}
.calendar-crm-links .calendar-section-title {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.calendar-crm-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(340px, 1.4fr);
  gap: 12px;
  align-items: start;
}
.calendar-crm-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf8;
}
.calendar-crm-card h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--navy);
}
.calendar-crm-card .empty-state {
  margin: 0;
  padding: 4px 0;
  font-size: 12.5px;
}
.calendar-link-list { display: flex; flex-direction: column; gap: 6px; }
.calendar-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 30px;
}
.calendar-link-row > a {
  min-width: 0;
  overflow-wrap: anywhere;
}
.calendar-record-chip { align-self: flex-start; font-size: 12px; }
.calendar-people-links {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  font-size: 12.5px;
}
.calendar-people-links > span {
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.calendar-suggestion-block { margin-top: 12px; }
.calendar-suggestion-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.calendar-suggestion-list .btn {
  width: 100%;
  white-space: normal;
  text-align: left;
  line-height: 1.3;
}
.calendar-link-picker-controls select { min-width: 280px; flex: 1; }
.calendar-jump { display: inline-block; margin-top: 7px; font-size: 12px; }
.fireflies-open { margin: 8px 8px 0 0; }
.chip.fireflies-brand {
  background: #f4e5ff;
  color: #7e22ce;
}
.fireflies-summary-chip {
  flex: none;
  border: none;
  font: inherit;
  line-height: 1.35;
  cursor: pointer;
}
.fireflies-summary-chip:hover,
.fireflies-summary-chip:focus-visible {
  background: #ead3ff;
  outline: 1px solid #a855f7;
}

/* ---- Fireflies meeting detail ---- */
.fireflies-modal { max-width: 880px; }
.fireflies-meta {
  display: flex;
  align-items: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 12.5px;
}
.fireflies-meta .fireflies-brand { margin-left: auto; }
.fireflies-tabs { margin-bottom: 14px; }
.fireflies-tab-content { min-height: 240px; }
.fireflies-summary section + section { margin-top: 20px; }
.fireflies-summary h3 {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fireflies-summary p { line-height: 1.55; }
.fireflies-summary .chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.fireflies-action-items {
  padding: 12px 14px;
  border-radius: 7px;
  background: var(--bg);
  line-height: 1.5;
  white-space: pre-wrap;
}
.fireflies-recording video,
.fireflies-recording audio {
  display: block;
  width: 100%;
  max-height: 52vh;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--navy);
}
.fireflies-media-empty {
  padding: 30px 20px;
  margin-bottom: 12px;
  border: 1px dashed #cfc4b6;
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
}
.fireflies-media-empty p { max-width: 520px; margin: 7px auto 0; }
.fireflies-transcript {
  max-height: 52vh;
  margin-top: 10px;
  overflow: auto;
  border-top: 1px solid var(--line);
}
.fireflies-sentence {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
}
.fireflies-sentence p { margin: 3px 0 0; line-height: 1.45; }
.fireflies-time {
  align-self: start;
  border: none;
  background: none;
  padding: 1px 0;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.fireflies-time:hover:not(:disabled) { text-decoration: underline; }
.fireflies-time:disabled { color: var(--muted); cursor: default; }

@media (max-width: 1000px) {
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-sidebar {
    position: static;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }
  .calendar-sidebar .panel-head-row { width: 100%; margin-bottom: 0; }
  .calendar-user-row { padding: 2px 6px; margin: 0 -6px; }
  .calendar-main { overflow-x: auto; }
}

@media (max-width: 760px) {
  .calendar-crm-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .modal-overlay { padding: 12px; }
  .calendar-event-modal { max-height: calc(100vh - 24px); }
  .calendar-modal-header { padding: 17px 16px 12px; }
  .calendar-modal-header h2 { font-size: 17px; }
  .calendar-modal-body { padding: 14px 16px 18px; }
  .calendar-modal-footer { padding: 10px 16px; }
  .calendar-modal-footer .btn { width: 100%; }
  .calendar-event-fields { grid-template-columns: 1fr; }
  .calendar-event-fields .field.wide { grid-column: auto; }
  .calendar-external-links > * { flex: 1; text-align: center; }
  .calendar-range-label { order: 3; width: 100%; text-align: left; }
  .calendar-page-head .segmented { margin-left: 0; }
  /* The page head wraps to several rows on small screens. */
  .cal-grid-scroll { height: calc(100vh - 230px); }
  .calendar-agenda { padding: 5px 9px 12px; }
  .calendar-agenda .cal-event { grid-template-columns: 55px minmax(0, 1fr) auto; }
  .calendar-link-picker-controls select { min-width: 0; width: 100%; }
}

/* ---- board column totals ---- */
.column-head .col-total { margin-left: auto; font-weight: 600; color: var(--ink); }

/* ---- toast action (undo) ---- */
.toast-action {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font: inherit;
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 10px;
  margin-left: 12px;
  cursor: pointer;
}
.toast-action:hover { background: rgba(255, 255, 255, 0.28); }

/* ---- unified timeline ---- */
.tl-composer { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.tl-composer textarea { min-height: 44px; flex: 1; }
.tl-composer .note-composer-actions { padding-top: 1px; }
.tl-item { display: flex; gap: 8px; padding: 8px 0; position: relative; }
.tl-caret-spacer { flex: none; width: 14px; }
.tl-item .act-icon { z-index: 1; }
.tl-main { flex: 1; min-width: 0; }
.tl-head { display: flex; align-items: baseline; gap: 10px; }
.tl-head .timeline-note-actions { margin-left: auto; }
.tl-head .timeline-note-actions + .act-when { margin-left: 0; }
.tl-head .act-when { margin-left: auto; }
.tl-body { font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.tl-main > .rich-note-content { margin-top: 6px; font-size: 12.5px; }
.tl-note-updated { margin-top: 6px; color: var(--muted); font-size: 10.5px; }
.act-icon.act-note { background: var(--amber); font-size: 13px; }
.act-icon.act-stage { background: var(--navy); font-size: 12px; }
.act-icon.act-stage.won { background: var(--green); }
.act-icon.act-stage.lost { background: var(--red); }
.segmented.small button { padding: 4px 10px; font-size: 12px; }

/* ---- command palette ---- */
.palette-overlay { align-items: flex-start; padding-top: 14vh; }
.palette {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 24px 60px rgba(0, 26, 61, 0.35);
  overflow: hidden;
}
.palette input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 14px 18px;
  font-size: 15px;
  outline: none;
}
.palette-list { max-height: 50vh; overflow: auto; padding: 6px; }
.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
}
.palette-item.active { background: var(--bg); }
.palette-item.empty { color: var(--muted); cursor: default; }
.palette-hint {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* "More from Salesforce" long-tail panel */
.sf-extra summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
}
.sf-extra summary::-webkit-details-marker { display: none; }
.sf-extra summary::before { content: '▸ '; color: var(--muted); }
.sf-extra[open] summary::before { content: '▾ '; }
.sf-extra .field-grid { word-break: break-word; }

/* Wide tables (portfolio metrics) scroll inside their panel */
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 560px; }
.metric-row {
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}
.metric-row:hover,
.metric-row:focus-visible {
  background: #f4f7fc;
  box-shadow: inset 3px 0 0 var(--accent);
  outline: none;
}
.metric-last-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.metric-row-chevron {
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
  transition: color 0.12s ease, transform 0.12s ease;
}
.metric-row:hover .metric-row-chevron,
.metric-row:focus-visible .metric-row-chevron {
  color: var(--accent);
  transform: translateX(2px);
}
.modal.metric-detail-modal {
  width: min(920px, calc(100vw - 32px));
  max-width: 920px;
  max-height: calc(100vh - 48px);
  padding: 24px;
}
.modal.metric-detail-modal:focus { outline: none; }
.metric-detail-intro {
  margin: -7px 0 20px;
  color: var(--muted);
  font-size: 13px;
}
.metric-detail-section + .metric-detail-section,
.metric-detail-sections + .metric-detail-section { margin-top: 24px; }
.metric-detail-section h3 {
  margin: 0 0 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  font-size: 13px;
}
.metric-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 28px;
  margin: 0;
}
.metric-detail-field {
  min-width: 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(225, 216, 205, 0.7);
}
.metric-detail-field dt {
  color: var(--muted);
  font-size: 11.5px;
}
.metric-detail-field dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
@media (max-width: 760px) {
  .modal.metric-detail-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 18px;
  }
  .metric-detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .metric-detail-grid { grid-template-columns: 1fr; }
}

/* ---- SharePoint files panel ---- */
/* Unlinked on the account page: folded shut until the header is clicked */
.files-fold summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.files-fold summary::-webkit-details-marker { display: none; }
.files-fold summary::before { content: '▸'; color: var(--muted); }
.files-fold[open] summary::before { content: '▾'; }
.files-fold summary h2 { margin: 0; }
.files-fold[open] summary { margin-bottom: 12px; }
.files-fold .files-fold-hint { font-size: 12px; }
.files-fold[open] .files-fold-hint { display: none; }

.files-panel.drop-target { outline: 2px dashed var(--accent); outline-offset: -6px; }
.files-panel .files-filter { width: 150px; padding: 5px 9px; font-size: 12.5px; }
.files-root-path { font-size: 12px; overflow-wrap: anywhere; }

.files-crumbs { display: flex; align-items: center; gap: 2px; margin: 2px 0 6px; flex-wrap: wrap; }
.files-crumbs .crumb {
  background: none; border: none; padding: 2px 5px; border-radius: 6px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer;
}
.files-crumbs .crumb:disabled { color: var(--ink); cursor: default; }
.files-crumbs .crumb:not(:disabled):hover { background: var(--bg); }
.files-crumbs .crumb-sep { color: var(--muted); font-size: 12px; }

.files-table th:nth-child(2), .files-table td.fsize { width: 70px; white-space: nowrap; }
.files-table th:nth-child(3), .files-table td.fdate { width: 110px; white-space: nowrap; }
.files-table td { padding: 7px 8px; }
.files-table td.fname { display: flex; align-items: center; gap: 8px; min-width: 0; }
.files-table .fname-text { overflow-wrap: anywhere; }
.file-entry-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-align: left;
  cursor: pointer;
}
.file-entry-button:hover .fname-text,
.file-entry-button:focus-visible .fname-text {
  color: var(--accent);
  text-decoration: underline;
}
.file-entry-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
.files-table td.fsize, .files-table td.fdate { color: var(--muted); font-size: 12.5px; }
.files-table td.row-actions { width: 150px; text-align: right; white-space: nowrap; }
.files-table .row-actions .btn { visibility: hidden; }
.files-table tr:hover .row-actions .btn { visibility: visible; }
.files-table tr:focus-within .row-actions .btn { visibility: visible; }
.files-table .files-empty { color: var(--muted); text-align: center; padding: 18px 8px; }

.btn.ghost {
  background: none; border: none; color: var(--accent); padding: 3px 7px;
}
.btn.ghost:hover { background: var(--bg); }
.btn.ghost.danger-text { color: var(--red); }

.fext {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 20px; padding: 0 4px; border-radius: 5px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px; flex: none;
  background: #e7e0d8; color: var(--muted);
}
.fext.kind-folder { background: none; font-size: 15px; min-width: 24px; }
.fext.kind-pdf { background: #fde3e3; color: var(--red); }
.fext.kind-doc { background: #d9e7fc; color: var(--accent); }
.fext.kind-xls { background: #dcf4ee; color: var(--green); }
.fext.kind-ppt { background: #fdeacc; color: #b45309; }
.fext.kind-img { background: #f3e8ff; color: #7e22ce; }
.fext.kind-med { background: #e0f2fe; color: #0369a1; }
.fext.kind-msg { background: #e2e8f0; color: #334155; }

.files-link-list { max-height: 260px; overflow-y: auto; margin-top: 8px; }
.files-link-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 8px;
}
.files-link-nav .files-crumbs {
  min-width: 0;
  margin: 0;
}
.files-link-nav .files-up { flex: none; }
.files-link-browser.loading { opacity: 0.65; }
.files-folder-open {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.files-folder-open:hover { color: var(--accent); }
.files-folder-open .who-line {
  min-width: 0;
  flex-wrap: wrap;
}
.files-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; }

/* ---- file preview modal ---- */
.modal-overlay.file-preview-overlay {
  align-items: center;
  padding: 24px;
}
.modal.file-preview-modal {
  display: flex;
  flex-direction: column;
  width: min(1120px, 100%);
  max-width: 1120px;
  height: min(800px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
}
.file-preview-header {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 14px 16px 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.file-preview-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.file-preview-heading .fext { flex: none; }
.file-preview-heading > div { min-width: 0; }
.modal .file-preview-title {
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}
.file-preview-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.file-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.file-preview-action { white-space: nowrap; }
.file-preview-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}
.file-preview-close:hover,
.file-preview-close:focus-visible {
  background: var(--bg);
  color: var(--ink);
}
.file-preview-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.file-preview-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #edf1f5;
}
.file-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 440px;
  border: 1px solid rgba(0, 26, 61, 0.12);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 26, 61, 0.1);
}
.file-preview-image,
.file-preview-media {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 26, 61, 0.14);
}
.file-preview-stage-audio {
  background: linear-gradient(145deg, #e7eef7, #f8f4f0);
}
.file-preview-stage-docx {
  align-items: flex-start;
  justify-content: center;
}
.file-preview-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: auto;
  color: var(--muted);
}
.file-preview-loading span {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(26, 91, 243, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: docx-preview-spin 700ms linear infinite;
}
@keyframes docx-preview-spin { to { transform: rotate(360deg); } }
.docx-preview-page {
  width: min(794px, 100%);
  min-height: 1028px;
  margin: 0 auto;
  padding: 72px 82px;
  overflow-wrap: anywhere;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 26, 61, 0.12);
  color: #172033;
  font-family: Aptos, Calibri, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.docx-preview-page h1,
.docx-preview-page h2,
.docx-preview-page h3,
.docx-preview-page h4,
.docx-preview-page h5,
.docx-preview-page h6 {
  margin: 1.15em 0 0.45em;
  color: #172033;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.2;
}
.docx-preview-page h1 { font-size: 27px; }
.docx-preview-page h2 { font-size: 22px; }
.docx-preview-page h3 { font-size: 18px; }
.docx-preview-page h4 { font-size: 16px; }
.docx-preview-page h5,
.docx-preview-page h6 { font-size: 14px; }
.docx-preview-page .docx-title {
  margin-top: 0;
  font-size: 32px;
  font-weight: 400;
}
.docx-preview-page p { margin: 0 0 0.72em; min-height: 1em; }
.docx-preview-page blockquote {
  margin: 1em 24px;
  padding-left: 16px;
  border-left: 3px solid var(--chalk);
  color: #44536a;
}
.docx-bold { font-weight: 700; }
.docx-italic { font-style: italic; }
.docx-underline { text-decoration: underline; }
.docx-strike { text-decoration: line-through; }
.docx-sup { vertical-align: super; font-size: 0.72em; }
.docx-sub { vertical-align: sub; font-size: 0.72em; }
.docx-align-center { text-align: center; }
.docx-align-right { text-align: right; }
.docx-align-both { text-align: justify; }
.docx-list-item {
  position: relative;
  padding-left: calc(22px + var(--docx-list-level) * 18px);
}
.docx-list-marker {
  position: absolute;
  left: calc(5px + var(--docx-list-level) * 18px);
}
.docx-image {
  display: block;
  max-width: 100%;
  max-height: 620px;
  margin: 12px auto;
  object-fit: contain;
}
.docx-table {
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  white-space: normal;
}
.docx-table td {
  min-width: 48px;
  padding: 7px 9px;
  border: 1px solid #b8c0cc;
  vertical-align: top;
}
.docx-table td > :last-child { margin-bottom: 0; }
.docx-preview-notice {
  padding: 9px 11px;
  border-radius: 5px;
  background: #fff6df;
  color: #6c5319;
  font-size: 12px;
}
.file-preview-audio,
.file-preview-unavailable {
  width: min(420px, 100%);
  padding: 42px 34px;
  border: 1px solid rgba(0, 26, 61, 0.08);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 26, 61, 0.1);
  text-align: center;
}
.file-preview-audio .fext,
.file-preview-unavailable .fext {
  display: inline-flex;
  justify-content: center;
  margin-bottom: 16px;
  transform: scale(1.45);
}
.file-preview-audio strong,
.file-preview-unavailable strong {
  display: block;
  margin-bottom: 8px;
}
.file-preview-audio audio {
  width: 100%;
  margin-top: 22px;
}
.file-preview-unavailable p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 700px) {
  .modal-overlay.file-preview-overlay { padding: 0; }
  .modal.file-preview-modal {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .file-preview-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }
  .file-preview-heading { width: calc(100% - 48px); }
  .file-preview-actions {
    width: 100%;
    order: 3;
  }
  .file-preview-actions .file-preview-action { flex: 1; text-align: center; }
  .file-preview-close {
    position: absolute;
    top: 8px;
    right: 8px;
  }
  .file-preview-stage { padding: 10px; }
  .file-preview-frame { min-height: 0; }
  .docx-preview-page {
    min-height: calc(100vh - 156px);
    padding: 34px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .file-preview-loading span { animation: none; }
}

/* ---- Salesforce-style opportunity record layout ---- */
.page-head.slim { margin-bottom: 10px; }

.record-head { padding: 14px 16px; }
.record-head-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.record-head-top .spacer { flex: 1; }
.record-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e8850c; /* Salesforce opportunity orange */
  color: #fff;
  box-shadow: var(--shadow);
}
.record-icon svg { width: 20px; height: 20px; }
.record-icon.sm { width: 26px; height: 26px; border-radius: 6px; }
.record-icon.sm svg { width: 15px; height: 15px; }
.record-icon.account { background: #5876a3; } /* Salesforce account slate */
.record-eyebrow { font-size: 12px; color: var(--muted); }
.record-title h1 {
  font-family: "Miasma", "Modern Gothic", serif;
  font-weight: 300;
  font-size: 22px;
  margin: 0;
  line-height: 1.15;
}

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

/* ---- CRM-native scheduling ---- */
.scheduling-tabs {
  display: flex;
  gap: 4px;
  margin: -8px 0 20px;
  padding-bottom: 1px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}
.scheduling-tabs a {
  flex: none;
  padding: 9px 12px 10px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.scheduling-tabs a:hover { color: var(--ink); text-decoration: none; }
.scheduling-tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
.scheduling-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}
.scheduling-type-card { margin: 0; border-top: 3px solid var(--teal); }
.scheduling-type-card.inactive { border-top-color: var(--line); opacity: .75; }
.scheduling-type-card.editable {
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.scheduling-type-card.editable:hover {
  border-top-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 26, 61, .12);
  transform: translateY(-1px);
}
.scheduling-type-card .panel-head-row h2 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  letter-spacing: 0;
  text-transform: none;
}
.scheduling-type-edit-button {
  all: unset;
  border-radius: 3px;
  cursor: pointer;
}
.scheduling-type-edit-button:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.scheduling-type-edit-button:focus-visible {
  color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.scheduling-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 7px 14px;
  margin: 16px 0;
}
.scheduling-facts dt { color: var(--muted); }
.scheduling-facts dd { margin: 0; }
.scheduling-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #edf0f4;
  font-size: 12px;
  text-transform: capitalize;
}
.scheduling-status.active,
.scheduling-status.confirmed,
.scheduling-status.completed {
  color: #075d50;
  background: rgba(111, 210, 191, .28);
}
.scheduling-status.provisioning,
.scheduling-status.pending,
.scheduling-status.running {
  color: #76500a;
  background: #fff1c7;
}
.scheduling-status.failed,
.scheduling-status.needs_attention,
.scheduling-status.revoked {
  color: var(--red);
  background: #fde8e8;
}
.scheduling-status.cancelled,
.scheduling-status.consumed,
.scheduling-status.expired,
.scheduling-status.inactive {
  color: var(--muted);
  background: #edf0f4;
}
.scheduling-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.scheduling-two-column > .panel { margin: 0; }
.scheduling-form fieldset {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.scheduling-form legend { padding: 0 7px; font-weight: 500; }
.scheduling-inline {
  display: grid;
  grid-template-columns: 1fr max-content;
  gap: 16px;
  align-items: end;
}
.scheduling-inline .form-row { margin: 0; }
.scheduling-staff-table th,
.scheduling-staff-table td { text-align: center; }
.scheduling-staff-table th:first-child,
.scheduling-staff-table td:first-child { text-align: left; }
.scheduling-staff-table input { width: auto; }
.modal.scheduling-modal {
  width: min(1080px, calc(100vw - 64px));
  max-width: 1080px;
}
.scheduling-modal .scheduling-form {
  max-height: min(76vh, 780px);
  padding-right: 4px;
  overflow-y: auto;
}
.scheduling-availability-form .weekday-row {
  display: flex;
  gap: 6px;
  margin: 14px 0;
}
.weekday {
  display: grid;
  place-items: center;
  gap: 4px;
  min-width: 46px;
  padding: 8px 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.weekday input { width: auto; }
.block { display: block; }
.scheduling-onboarding {
  max-width: 680px;
  margin: 40px auto;
  padding: 36px;
  text-align: center;
}
.scheduling-onboarding h2 {
  color: var(--ink);
  font-family: "Miasma", serif;
  font-size: 28px;
  letter-spacing: 0;
  text-transform: none;
}
.scheduling-association-results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 14px;
}
.scheduling-association-option {
  display: flex;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}
.scheduling-association-option:hover { background: var(--bg); }
.scheduling-association-option small {
  color: var(--muted);
  text-transform: capitalize;
}

@media (max-width: 780px) {
  .modal.scheduling-modal {
    width: calc(100vw - 24px);
    max-width: none;
  }
  .scheduling-modal .form-2col,
  .scheduling-modal .form-3col { grid-template-columns: 1fr; }
  .scheduling-two-column { grid-template-columns: 1fr; }
  .scheduling-inline { grid-template-columns: 1fr; }
  .scheduling-availability-form .weekday-row { overflow-x: auto; }
}

.hl-row {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.hl-field label {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 2px;
}
.hl-field > div { font-weight: 500; }

.stage-strip .mark-complete {
  white-space: nowrap;
  font-size: 12.5px;
  padding: 8px 14px;
  background: var(--accent);
}

/* Record detail tabs. */
.tab-card { padding: 0; overflow: hidden; }
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 0 12px;
  border-bottom: 2px solid var(--line);
}
.tab-bar .tab {
  border: none;
  background: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 12px 14px 10px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab-bar .tab:hover { color: var(--ink); }
.tab-bar .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-body { padding: 16px; }
/* Panels reused inside a tab lose their card chrome. Direct children (a
   .tab-pane wrapper is transparent here) also drop their h2 (the tab already
   names the content); panels nested deeper (e.g. Files + Deal history under
   Related) keep theirs as section titles. */
.tab-body .panel { box-shadow: none; border-radius: 0; padding: 0; margin: 0 0 24px; }
.tab-body .panel:last-child { margin-bottom: 0; }
.tab-body > .panel > h2:first-child,
.tab-body > .tab-pane > .panel > h2:first-child,
.tab-body > .panel .panel-head-row h2,
.tab-body > .tab-pane > .panel .panel-head-row h2 { display: none; }

/* ---- Intelligence workspace ---- */
.intelligence-status,
.intelligence-card-head,
.intelligence-evidence,
.intelligence-actions,
.relationship-row,
.intro-path-row,
.knowledge-result-meta,
.knowledge-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.intelligence-status { margin-bottom: 12px; }
.intelligence-status .spacer,
.intelligence-card-head .spacer { flex: 1; }
.intelligence-toolbar { margin-bottom: 14px; }
.intelligence-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.intelligence-card { margin: 0; border-left: 4px solid var(--chalk); }
.intelligence-card.status-approved { border-left-color: var(--teal); }
.intelligence-card.status-rejected { border-left-color: var(--line); opacity: 0.82; }
.intelligence-card h2,
.knowledge-result h2 {
  margin: 13px 0 7px;
  text-transform: none;
  font-size: 17px;
  color: var(--ink);
}
.intelligence-kind,
.knowledge-source {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(190, 215, 244, 0.55);
  color: var(--navy);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.intelligence-kind.kind-task { background: #dcf4ee; color: var(--green); }
.intelligence-kind.kind-note { background: #fef3c7; color: #92400e; }
.confidence-score { font-size: 12px; color: var(--muted); }
.suggestion-proposal {
  line-height: 1.55;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(243, 232, 223, 0.55);
}
.intelligence-rationale { min-height: 34px; }
.intelligence-evidence {
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.intelligence-actions {
  justify-content: flex-end;
  margin-top: 14px;
}
.intelligence-empty { grid-column: 1 / -1; text-align: center; padding: 40px; }
.chip.status-pending,
.chip.status-requested { background: #fef3c7; color: #92400e; }
.chip.status-approved,
.chip.status-completed,
.chip.status-accepted { background: #dcf4ee; color: var(--green); }
.chip.status-rejected,
.chip.status-dismissed,
.chip.status-declined,
.chip.status-cancelled { background: #ece1d6; color: var(--muted); }

.relationship-panel { margin-top: 0; }
.relationship-connectors {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.relationship-row {
  width: 100%;
  padding: 9px 0;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
a.relationship-row:hover { text-decoration: none; background: rgba(190, 215, 244, 0.15); }
.relationship-row:last-child { border-bottom: 0; }
.relationship-row > div { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.relationship-score {
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ece1d6;
  color: var(--muted);
  font-weight: 600;
}
.relationship-score.score-strong { background: #dcf4ee; color: var(--green); }
.relationship-score.score-established { background: #d9e7fc; color: var(--accent); }
.relationship-score.score-developing { background: #fef3c7; color: #92400e; }
.relationship-paths { margin-top: 12px; }
.relationship-paths > summary { cursor: pointer; color: var(--accent); }
.intro-path-row { align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.intro-path-row > div { flex: 1; min-width: 0; }
.intro-path-row p { margin: 4px 0 0; }
.intro-path-preview { display: flex; align-items: center; gap: 8px; padding: 12px; background: var(--bg); }
.relationship-finder input { width: 100%; }
.relationship-search-results { display: grid; margin-top: 10px; }
.relationship-search-person {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.intelligence-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 14px;
}
.intelligence-two-column > .panel { margin: 0; }
.introduction-request-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.introduction-request-row > div { display: flex; flex-direction: column; }

.knowledge-search-bar {
  flex-wrap: wrap;
}
.knowledge-search-bar input { flex: 1 1 420px; }
.knowledge-search-bar select { flex: 0 1 300px; }
.knowledge-coverage { width: 100%; margin: 0; }
.knowledge-results { display: grid; gap: 10px; }
.knowledge-result {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.knowledge-result-meta { flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.knowledge-result p { margin: 0; line-height: 1.55; white-space: pre-wrap; }
.knowledge-source.source-meeting_intelligence { background: #f3e8ff; color: #7e22ce; }
.knowledge-source.source-market_data { background: #dcf4ee; color: var(--green); }
.knowledge-source.source-document { background: #fef3c7; color: #92400e; }

@media (max-width: 900px) {
  .intelligence-list,
  .intelligence-two-column { grid-template-columns: 1fr; }
}

/* Details tab: two columns of label-over-value fields with hairlines. */
.sf-field-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
@media (max-width: 700px) { .sf-field-grid { grid-template-columns: 1fr; } }
.sf-field {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label label" "value pencil";
  padding: 7px 0 6px;
  border-bottom: 1px solid var(--line);
}
.sf-field label { grid-area: label; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.sf-field .sf-value {
  grid-area: value;
  font-weight: 500;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  min-width: 0;
}
.sf-pencil, .sf-pencil-gap { grid-area: pencil; align-self: end; }
.sf-pencil {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  padding: 0 2px;
  opacity: 0.45;
}
.sf-field:hover .sf-pencil, .sf-pencil:focus-visible { opacity: 1; }
.sf-pencil:hover { color: var(--accent); }

.sf-section { margin-top: 20px; }
.sf-section summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 6px;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.sf-section summary::-webkit-details-marker { display: none; }
.sf-section summary::before { content: "▸"; color: var(--muted); transition: transform 0.15s ease; }
.sf-section[open] summary::before { transform: rotate(90deg); }
.sf-section > .sf-field { margin-top: 10px; }

/* Sidebar Account Details card */
.account-details .field-grid { grid-template-columns: 1fr 1fr; }
.account-details .field-wide { grid-column: 1 / -1; }
.account-details .panel-head-row h2 { text-transform: none; font-size: 14px; color: var(--ink); }
.chip-row { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Salesforce-style account record layout ---- */
.record-title h1 .chip {
  font-size: 11px;
  vertical-align: 3px;
  margin-left: 6px;
}

/* Sidebar "Opportunities (N)" related-list card */
.related-card .panel-head-row h2 { text-transform: none; font-size: 14px; color: var(--ink); }
.related-card .rel-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.related-card .rel-item:last-of-type { border-bottom: none; }
.rel-title { font-weight: 600; display: inline-block; margin-bottom: 3px; }
.rel-kv { display: flex; gap: 8px; font-size: 12.5px; padding: 1px 0; }
.rel-k { color: var(--muted); min-width: 78px; flex: none; }
.rel-v { font-weight: 500; overflow-wrap: anywhere; }
.btn.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  padding: 8px 0 0;
  font-size: 12.5px;
}
.btn.link-btn:hover { background: none; text-decoration: underline; }

/* ---- Felix floating chat ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.felix-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 45;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), #003fb9);
  box-shadow: 0 10px 28px rgba(0, 26, 61, 0.32);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.felix-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 26, 61, 0.38);
}
.felix-launcher:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}
.felix-launcher-headshot,
.felix-launcher svg {
  position: absolute;
  width: 29px;
  height: 29px;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.felix-launcher-headshot {
  inset: 4px;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  object-fit: cover;
}
.felix-launcher svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.felix-launcher-close { opacity: 0; transform: rotate(-35deg) scale(0.7); }
.felix-launcher.open .felix-launcher-headshot { opacity: 0; transform: rotate(35deg) scale(0.7); }
.felix-launcher.open .felix-launcher-close { opacity: 1; transform: rotate(0) scale(1); }
.felix-launcher-pulse {
  position: absolute;
  right: 1px;
  top: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--teal);
}

.felix-chat {
  position: fixed;
  right: 24px;
  bottom: 94px;
  z-index: 44;
  width: min(440px, calc(100vw - 32px));
  height: min(650px, calc(100vh - 126px));
  min-height: 420px;
  border: 1px solid rgba(0, 26, 61, 0.12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(0, 26, 61, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: felix-in 0.18s ease-out;
}
@keyframes felix-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.felix-chat-head {
  min-height: 66px;
  padding: 12px 12px 12px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  background:
    radial-gradient(circle at 85% -40%, rgba(111, 210, 191, 0.42), transparent 50%),
    var(--navy);
}
.felix-agent-mark,
.felix-mini-mark {
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}
.felix-agent-mark {
  width: 40px;
  height: 40px;
  border: 2px solid var(--teal);
}
.felix-chat-head > div:nth-child(2) { min-width: 0; flex: 1; }
.felix-chat-head strong {
  display: block;
  font-family: "Miasma", serif;
  font-size: 19px;
  font-weight: 300;
  letter-spacing: 0.02em;
}
#felix-status {
  display: block;
  max-width: 225px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11.5px;
}
#felix-status i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f6c453;
}
#felix-status.online i { background: var(--teal); }
#felix-status.offline i { background: #f38b8b; }
.felix-head-action {
  width: 32px;
  height: 32px;
  padding: 7px;
  border: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  cursor: pointer;
}
.felix-head-action:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.felix-head-action.call-active {
  color: var(--navy);
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(111, 210, 191, 0.2);
}
.felix-head-action svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.felix-context {
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #fbf8f5;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.felix-call-bar {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #c9eae4;
  color: var(--navy);
  background: linear-gradient(90deg, #ecf9f6, #f7fcfb);
}
.felix-call-bar[hidden] { display: none; }
.felix-call-bar > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.felix-call-bar strong,
.felix-call-bar span {
  display: block;
}
.felix-call-bar strong {
  font-size: 12.5px;
  line-height: 1.25;
}
.felix-call-bar span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}
.felix-call-bar button {
  padding: 6px 9px;
  border: 1px solid rgba(0, 26, 61, 0.18);
  border-radius: 7px;
  color: var(--navy);
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.felix-call-bar button:hover {
  border-color: #d45a5a;
  color: #a82e2e;
}
.felix-voice-level {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: none;
  border-radius: 50%;
  background: var(--navy);
}
.felix-voice-level i {
  width: 2px;
  height: 12px;
  border-radius: 999px;
  background: var(--teal);
  transform: scaleY(var(--voice-scale, 0.25));
  transition: transform 80ms linear;
}
.felix-voice-level.speaking i {
  animation: felix-wave 0.7s ease-in-out infinite alternate;
}
.felix-voice-level.speaking i:nth-child(2),
.felix-voice-level.speaking i:nth-child(4) { animation-delay: -0.3s; }
.felix-voice-level.speaking i:nth-child(3) { animation-delay: -0.5s; }
@keyframes felix-wave {
  from { transform: scaleY(0.25); }
  to { transform: scaleY(1); }
}
.felix-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  background: linear-gradient(#fff, #fdfbf9);
  scroll-behavior: smooth;
}
.felix-message-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin-bottom: 14px;
}
.felix-message-row.user { justify-content: flex-end; }
.felix-mini-mark {
  width: 24px;
  height: 24px;
  border: 1px solid var(--chalk);
}
.felix-message {
  max-width: 82%;
  padding: 9px 11px;
  border-radius: 5px 13px 13px 13px;
  color: var(--ink);
  background: #eef4fb;
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.felix-message-row.assistant:not(.felix-thinking) .felix-message {
  width: 100%;
  max-width: calc(100% - 31px);
}
.felix-rich-text p {
  margin: 0 0 8px;
}
.felix-rich-text p:last-child { margin-bottom: 0; }
.felix-rich-text h4 {
  margin: 13px 0 5px;
  color: var(--navy);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.felix-rich-text h4:first-child { margin-top: 0; }
.felix-rich-text ul,
.felix-rich-text ol {
  margin: 4px 0 9px;
  padding-left: 19px;
}
.felix-rich-text li { margin: 0 0 4px; }
.felix-rich-text strong { color: var(--navy); }
.felix-rich-text a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.felix-rich-text a:hover { text-decoration: underline; }
.felix-card-stack {
  display: grid;
  gap: 9px;
  margin-top: 11px;
}
.felix-entity-card {
  display: block;
  padding: 11px;
  border: 1px solid #d7e0eb;
  border-radius: 11px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(236, 244, 252, 0.56), rgba(255, 255, 255, 0) 55%),
    #fff;
  box-shadow: 0 3px 10px rgba(0, 26, 61, 0.07);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.felix-entity-card:hover {
  border-color: rgba(10, 83, 207, 0.45);
  box-shadow: 0 6px 16px rgba(0, 26, 61, 0.12);
  transform: translateY(-1px);
}
.felix-entity-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.felix-card-top {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.felix-card-media {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--navy);
  font-family: "Miasma", serif;
  font-size: 17px;
  font-weight: 500;
  object-fit: cover;
}
.felix-card-media.opportunity {
  color: var(--navy);
  background: linear-gradient(145deg, var(--teal), #b5eadf);
  font-family: inherit;
  font-size: 22px;
}
.felix-card-media.person { border-radius: 50%; }
.felix-card-heading {
  flex: 1;
  min-width: 0;
}
.felix-card-eyebrow {
  display: block;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.2;
  text-transform: uppercase;
}
.felix-card-heading strong {
  display: block;
  overflow: hidden;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.felix-card-subtitle {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.felix-card-badge {
  flex: none;
  max-width: 112px;
  padding: 3px 6px;
  overflow: hidden;
  border: 1px solid rgba(10, 83, 207, 0.16);
  border-radius: 999px;
  color: var(--accent);
  background: #edf4ff;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.felix-card-description {
  display: -webkit-box;
  margin: 9px 0 0;
  overflow: hidden;
  color: #4e5968;
  font-size: 11.5px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.felix-card-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 7px;
  margin: 10px 0 0;
  padding: 9px 0 0;
  border-top: 1px solid var(--line);
}
.felix-card-facts div { min-width: 0; }
.felix-card-facts dt {
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.felix-card-facts dd {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--navy);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.felix-card-open {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 9px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
}
.felix-message-row.user .felix-message {
  border-radius: 13px 5px 13px 13px;
  color: #fff;
  background: var(--accent);
  white-space: pre-wrap;
}
.felix-message-row.error .felix-message {
  margin-left: 31px;
  color: var(--red);
  background: #fff1f1;
  border: 1px solid #f2caca;
  white-space: pre-wrap;
}
.felix-thinking .felix-message {
  min-width: 48px;
  display: flex;
  gap: 4px;
}
.felix-thinking .felix-message i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: felix-dot 1s infinite ease-in-out;
}
.felix-thinking .felix-message i:nth-child(2) { animation-delay: 0.14s; }
.felix-thinking .felix-message i:nth-child(3) { animation-delay: 0.28s; }
@keyframes felix-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .felix-voice-level.speaking i,
  .felix-thinking .felix-message i {
    animation: none;
  }
}
@media (max-width: 520px) {
  .felix-chat {
    right: 16px;
    bottom: 86px;
    height: min(650px, calc(100vh - 106px));
  }
  .felix-card-facts { grid-template-columns: 1fr 1fr; }
  .felix-card-badge { max-width: 88px; }
}
.felix-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 11px 9px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.felix-composer textarea {
  min-height: 40px;
  max-height: 110px;
  padding: 10px 11px;
  resize: none;
  border-color: #d9d0c6;
}
.felix-composer button {
  flex: none;
  width: 40px;
  height: 40px;
  padding: 9px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}
.felix-composer button:hover { background: #1248c9; }
.felix-composer button:disabled { opacity: 0.45; cursor: default; }
.felix-composer button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.felix-disclaimer {
  padding: 0 12px 9px;
  color: var(--muted);
  background: #fff;
  text-align: center;
  font-size: 10.5px;
}

@media (max-width: 560px) {
  .felix-launcher { right: 16px; bottom: 16px; }
  .felix-chat {
    right: 8px;
    bottom: 82px;
    width: calc(100vw - 16px);
    height: calc(100vh - 98px);
    max-height: none;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .felix-chat { animation: none; }
  .felix-launcher, .felix-launcher svg { transition: none; }
}

/* ---- authentication ---- */
.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 85% 15%, rgba(111, 210, 191, 0.18), transparent 32rem),
    linear-gradient(145deg, #001a3d 0%, #0d2b52 55%, #142f50 100%);
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 20px;
  padding: 32px 20px;
}
.login-card {
  width: min(440px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: var(--navy);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}
.login-card > img {
  width: 205px;
  height: auto;
  margin: 30px 32px 26px;
}
.login-card-body {
  padding: 32px;
  color: var(--ink);
  background: #fff;
}
.login-eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.login-card h1 {
  margin: 0 0 12px;
  font-family: "Miasma", Georgia, serif;
  font-size: 34px;
  font-weight: 300;
  letter-spacing: -0.02em;
}
.login-card p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.55;
}
.login-primary {
  display: block;
  padding: 12px 18px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-weight: 650;
  text-align: center;
}
.login-primary:hover {
  color: #fff;
  background: #1248c9;
  text-decoration: none;
}
.login-card .login-help {
  margin: 16px 0 0;
  font-size: 12px;
  text-align: center;
}
.login-message {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 13px;
}
.login-message.error { color: var(--red); background: #fff1f1; }
.login-message.success { color: var(--green); background: #ecfaf6; }
.login-security {
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  text-align: center;
}
