:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  color: #182a41;
  background: #f3f6fa;
  --navy: #19283e;
  --navy-muted: #b6c7da;
  --navy-active: #304a64;
  --background: #f3f6fa;
  --paper: #fff;
  --ink: #182a41;
  --muted: #50647a;
  --line: #dce4ed;
  --primary: #244f7b;
  --primary-hover: #193d62;
  --focus: #087cb1;
  --radius: 14px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 2.7rem); font-weight: 700; letter-spacing: -.047em; line-height: 1.1; overflow-wrap: anywhere; }
h2 { font-size: 1.16rem; letter-spacing: -.018em; }
.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;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .89rem;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
}
.button svg { flex: none; }
.primary { background: var(--primary); color: #fff; }
.primary:hover:not(:disabled) { background: var(--primary-hover); }
.secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
.secondary:hover:not(:disabled) { background: #f1f6fb; border-color: #b5c7d8; }
button:disabled { opacity: .62; cursor: default; }
.text-button { color: var(--primary); background: none; border: none; padding: 0; text-decoration: underline; }

.wordmark {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 630;
  letter-spacing: -.035em;
  white-space: nowrap;
}
.wordmark strong { color: #c5d7ea; font-weight: 620; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  background: #d3eafb;
  color: var(--navy);
  border-radius: 9px;
  font-size: 1.15rem;
  font-weight: 800;
}

.sign-in { display: grid; place-items: center; min-height: 100svh; padding: 24px; }
.sign-in-frame {
  width: min(100%, 410px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 18px 55px #19283e16;
}
.sign-in-banner { padding: 26px 31px; background: var(--navy); }
.sign-in-body { padding: 31px; }
.sign-in-body h1 { font-size: 2rem; }
.sign-in-body > p { margin-top: 10px; }
.sign-in-form { display: grid; gap: 12px; margin: 24px 0 20px; }
.sign-in-form .button { min-height: 46px; }
.sign-in-licences { font-size: .87rem; color: var(--muted); text-underline-offset: 3px; }

.workspace { min-height: 100vh; display: grid; grid-template-columns: 218px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; background: var(--navy); padding: 24px 15px; }
.sidebar .wordmark { padding: 0 10px; margin-bottom: 42px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  min-height: 45px;
  border-radius: 8px;
  color: var(--navy-muted);
  font-size: .92rem;
  font-weight: 620;
  text-decoration: none;
}
.sidebar nav a:hover { background: #263b53; color: white; }
.sidebar nav a[aria-current] { background: var(--navy-active); color: #fff; }
.sidebar nav a[aria-current] svg { color: #bce6fc; }
.sidebar :focus-visible { outline-color: #7dd8ff; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 10px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.account { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
.initials {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #e7eff8;
  color: #32567a;
  font-size: .76rem;
  font-weight: 750;
}
.account-identity { display: grid; gap: 1px; line-height: 1.25; min-width: 0; }
.account-identity strong { font-size: .86rem; overflow-wrap: anywhere; }
.account-identity span { font-size: .76rem; color: var(--muted); }
.sign-out { margin-left: 10px; }
.content { width: min(100%, 1260px); margin: 0 auto; padding: 40px clamp(20px, 4vw, 48px) 64px; }
.content:focus { outline: none; }
.page-heading { margin-bottom: 25px; }
.page-heading p { margin-top: 8px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.muted { color: var(--muted); line-height: 1.5; }

.today-card {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 17px;
  max-width: 620px;
  padding: 25px 28px;
  border: 1px solid #c6d9ed;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #f7fbff 0%, #e8f2fc 100%);
}
.today-card-heading { display: flex; align-items: center; gap: 12px; }
.card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #d9e9f9;
  color: var(--primary);
}
.lead-count { font-size: 2.45rem; line-height: 1.1; letter-spacing: -.05em; font-weight: 700; }
.lead-count span { font-size: .95rem; font-weight: 520; color: var(--muted); letter-spacing: normal; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 21px; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: min(100%, 355px);
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #c6d1df;
  border-radius: 8px;
  color: var(--muted);
}
.search-box svg { flex: none; }
.search-box:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.search-box input { width: 100%; min-width: 0; border: none; background: transparent; outline: none; color: var(--ink); font-size: .91rem; }
.result-count { white-space: nowrap; font-size: .84rem; color: var(--muted); }
.lead-table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; }
.lead-table th, .lead-table td { padding: 0 21px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.lead-table th { padding-block: 11px; background: #f7f9fc; font-size: .80rem; font-weight: 650; color: var(--muted); }
.lead-table td { font-size: .9rem; color: var(--muted); }
.lead-table th:first-child { width: 52%; }
.lead-table th:last-child, .lead-table td:last-child { width: 50px; padding-left: 0; }
.lead-table td:nth-child(2) { padding-left: 0; }
.lead-table th:nth-child(2) { padding-left: 0; }
.lead-link { display: flex; align-items: center; min-height: 58px; gap: 10px; color: var(--ink); font-weight: 650; text-decoration: none; }
.lead-link:hover span:last-child { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.lead-table tbody tr:focus-within, .lead-table tbody tr:hover { background: #f7fbff; }
.list-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 15px 21px; color: var(--muted); font-size: .85rem; }
.list-footer nav { display: flex; gap: 8px; }
.status-panel { display: grid; gap: 13px; justify-items: start; padding: 22px; color: var(--muted); font-size: .92rem; }
.panel .status-panel { border-top: 1px solid var(--line); }

.back-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px; font-size: .9rem; font-weight: 650; text-decoration: none; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.lead-heading { display: flex; align-items: center; gap: 15px; }
.large-initials { width: 56px; height: 56px; font-size: 1.05rem; border-radius: 13px; }
.lead-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(245px, 1fr); align-items: start; gap: 18px; }
.detail-panel { display: grid; gap: 18px; padding: 23px; }
.detail-panel h2 { display: flex; align-items: center; gap: 8px; }
.detail-panel h2 svg { color: var(--primary); }
.notes { padding: 0; margin: 0; list-style: none; }
.notes li { display: flex; align-items: flex-start; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.notes li:first-child { padding-top: 0; }
.notes li strong { font-size: .87rem; }
.notes li p { margin: 4px 0 0; color: var(--muted); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.notes li div { min-width: 0; overflow-wrap: anywhere; }
.note-form, .outcome-form { display: grid; gap: 10px; }
.note-form button, .outcome-form button { justify-self: start; }
.note-form label { font-size: .88rem; font-weight: 650; }
textarea, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c6d1df;
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--paper);
  color: var(--ink);
}
textarea { resize: vertical; line-height: 1.45; }
.import-panel { max-width: 620px; margin-top: 18px; }
.import-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; margin: 0; }
.import-summary dt { padding-bottom: 4px; color: var(--muted); font-size: .83rem; }
.import-summary dd { margin: 0; overflow-wrap: anywhere; font-weight: 650; }
.form-error { color: #9d2835; font-size: .87rem; line-height: 1.45; }
.content > .form-error { margin-bottom: 16px; }
.form-success { color: #146445; font-size: .87rem; line-height: 1.45; }

@media (max-width: 880px) {
  .workspace { grid-template-columns: 178px minmax(0, 1fr); }
  .lead-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { position: static; height: auto; padding: 13px 15px 8px; }
  .sidebar .wordmark { margin: 0 0 10px; padding: 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar nav a { padding: 8px 10px; min-height: 40px; }
  .topbar { min-height: 60px; padding: 8px 15px; }
  .content { padding: 24px 15px 45px; }
  .list-toolbar, .list-footer { padding: 13px; }
  .lead-table th, .lead-table td { padding-inline: 13px; }
  .lead-table th:first-child { width: 60%; }
  .lead-table th:last-child, .lead-table td:last-child { width: 26px; padding-right: 9px; }
  .lead-link { min-height: 50px; }
  .lead-initials { display: none; }
  .detail-panel, .today-card { padding: 18px; }
}

@media (max-width: 360px) {
  .account-initials { display: none; }
  .sign-in { padding: 15px; }
  .sign-in-body, .sign-in-banner { padding: 22px; }
  .sidebar nav a { gap: 6px; padding-inline: 8px; }
  .search-box input { font-size: .83rem; }
}
/* Foundation workspace controls and pages */
.theme-switch { flex: none; white-space: nowrap; }
.tools-file-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, 1fr); gap: 20px; align-items: start; }
.tools-panel { min-width: 0; padding: clamp(18px, 3vw, 26px); }
.tools-panel h2 { margin-bottom: 16px; }
.tools-panel :where(strong, p, time) { overflow-wrap: anywhere; }
.tools-panel :where(input, select) { background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; min-height: 44px; padding: 8px 10px; }
.tools-panel label { font-weight: 650; font-size: .91rem; }
.tools-search { display: grid; gap: 6px; margin: 0 0 18px; }
.tools-search div { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto; }
.tools-upload { display: grid; gap: 8px; }
.tools-upload input[type=file] { width: 100%; }
.tools-upload select, .tools-upload .button { margin-bottom: 6px; }
.tools-upload .button { justify-self: start; }
.tools-upload .muted { margin: -3px 0 8px; font-size: .83rem; }
.tools-list { list-style: none; padding: 0; margin: 0; }
.tools-file-row, .tools-audit-row, .tools-stacked-row { padding: 14px 0; display: grid; align-items: center; gap: 12px; }
.tools-file-row, .tools-audit-row { grid-template-columns: minmax(0, 1fr) auto; }
.tools-list li + li { border-top: 1px solid var(--line); }
.tools-list li:last-child { padding-bottom: 0; }
.tools-list strong + p { margin-top: 5px; }
.tools-list .muted { font-size: .84rem; }
.tools-stacked-row { gap: 4px; }
.tools-stacked-row p { white-space: pre-wrap; }

:root[data-theme=dark] {
  color-scheme: dark;
  color: #dde8f7;
  background: #101c2c;
  --navy: #0b1524;
  --navy-muted: #b5c5da;
  --navy-active: #233d56;
  --background: #101c2c;
  --paper: #18283b;
  --ink: #dde8f7;
  --muted: #adbed3;
  --line: #3a4d67;
  --primary: #376d9d;
  --primary-hover: #28547d;
  --focus: #80cfff;
}
:root[data-theme=dark] a:not(.button):not(.sidebar a),
:root[data-theme=dark] .text-button { color: #a3d4ff; }
:root[data-theme=dark] .secondary:hover:not(:disabled),
:root[data-theme=dark] .lead-table tbody tr:hover,
:root[data-theme=dark] .lead-table tbody tr:focus-within { background: #223751; border-color: var(--line); }
:root[data-theme=dark] .lead-table th { background: #172338; }
:root[data-theme=dark] .today-card { background: linear-gradient(120deg, #20354f, #1a2c43); border-color: var(--line); }
:root[data-theme=dark] .initials,
:root[data-theme=dark] .card-icon { background: #2a4761; color: #c7e4ff; }
:root[data-theme=dark] .form-error { color: #ffaab3; }
:root[data-theme=dark] .form-success { color: #9ae6c3; }

@media (max-width: 980px) {
  .tools-file-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .sidebar .workspace-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .sidebar .workspace-nav a { flex-direction: column; justify-content: center; padding: 5px 2px; gap: 3px; min-height: 48px; font-size: .74rem; }
  .sidebar .workspace-nav svg { width: 16px; height: 16px; }
  .topbar { gap: 6px; }
  .theme-switch { padding-inline: 7px; font-size: .76rem; }
  .topbar .account { gap: 5px; }
  .topbar .sign-out { margin-left: 2px; padding-inline: 6px; }
  .tools-audit-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .tools-file-row .button { padding-inline: 8px; }
}

/* Sales workspace */
.crm-heading { display: flex; align-items: flex-end; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.crm-heading :where(h1, p) { overflow-wrap: anywhere; }
.crm-heading-actions, .crm-form-actions, .crm-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.crm-lead-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: -6px 0 16px; }
.crm-lead-nav a { min-height: 44px; display: flex; align-items: center; border-radius: 9px; padding: 8px 12px; font-size: .88rem; font-weight: 650; }
.crm-lead-nav a[aria-current] { background: var(--paper); color: var(--ink); border: 1px solid var(--line); text-decoration: none; }
.crm-panel { padding: clamp(16px, 3vw, 24px); min-width: 0; overflow-wrap: anywhere; }
.crm-panel h2 { margin: 0 0 14px; }
.crm-field, .crm-workflow-form { display: grid; align-content: start; gap: 6px; }
.crm-field label, .crm-workflow-form label { font-size: .88rem; font-weight: 650; }
.crm-field :where(input, select, textarea), .crm-workflow-form :where(input:not([type=checkbox]), select), .crm-pipeline-card select {
  width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink); border-radius: 8px; padding: 8px 10px; font: inherit;
}
.crm-field output { padding: 10px 0; color: var(--muted); }
.crm-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.crm-field-wide { grid-column: 1 / -1; }
.crm-profile { display: grid; gap: 12px; }
.crm-profile summary, .crm-script summary { cursor: pointer; display: list-item; min-height: 32px; font-weight: 700; }
.crm-profile-group[open] summary { margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.crm-profile-overview, .crm-profile-group { max-width: 960px; }
.crm-form-actions { margin-top: 6px; }
.crm-form-actions .form-error { flex-basis: 100%; }
.crm-brief { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.crm-brief-data { display: flex; gap: 10px 25px; flex-wrap: wrap; margin: 0; }
.crm-brief-data dt { font-size: .77rem; color: var(--muted); margin-bottom: 4px; }
.crm-brief-data dd { margin: 0; font-weight: 650; }
.crm-call-hold { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; }
.crm-call-hold p { font-size: .84rem; max-width: 220px; }
.crm-lead-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, 1fr); gap: 16px; align-items: start; }
.crm-workflow-form { gap: 10px; }
.crm-workflow-form .button { justify-self: start; }
.crm-checkbox { display: flex; align-items: center; gap: 6px; min-height: 32px; }
.crm-checkbox input { width: 18px; height: 18px; }
.crm-script { margin-top: 16px; max-width: 960px; }
.crm-script p + p { margin-top: 12px; }
.crm-list-controls { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.crm-list-controls .crm-field { flex: 1 1 220px; }
.crm-list-controls > p { padding-bottom: 12px; }
.crm-result-list, .crm-pipeline-stage ul { list-style: none; padding: 0; margin: 0; }
.crm-result-list li { display: flex; align-items: center; justify-content: space-between; gap: 6px 18px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line); }
.crm-result-list li .muted { margin-top: 4px; }
.crm-result-list li a { display: inline-flex; padding: 5px 0; }
.crm-tag { border: 1px solid var(--line); padding: 5px 9px; border-radius: 8px; font-size: .84rem; }
.crm-pages { margin-top: 10px; justify-content: flex-end; }
.crm-pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(165px, 1fr); gap: 12px; align-items: start; overflow-x: auto; padding: 3px 3px 10px; }
.crm-pipeline-stage ul { max-height: 430px; overflow-y: auto; }
.crm-pipeline-stage { min-width: 0; padding: 12px; overflow-wrap: anywhere; }
.crm-pipeline-stage header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.crm-pipeline-stage h2 { font-size: 1rem; }
.crm-pipeline-card { padding: 10px 0; border-top: 1px solid var(--line); }
.crm-pipeline-card p { margin-top: 3px; font-size: .87rem; }
.crm-pipeline-card form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; margin-top: 8px; }
.crm-pipeline-card select { padding-inline: 5px; }
.crm-pipeline-card .button { padding-inline: 8px; }
.crm-pipeline-card .form-error { grid-column: 1 / -1; }
.crm-pipeline-empty { font-size: .85rem; }
.crm-pipeline-more { display: inline-block; margin: 8px 0; }
@media (max-width: 680px) {
  .crm-form-grid, .crm-lead-grid { grid-template-columns: minmax(0, 1fr); }
  .crm-lead-nav a { padding-inline: 8px; }
  .crm-heading { align-items: flex-start; }
  .crm-call-hold { align-items: start; }
  .crm-list-controls { align-items: start; }
  .crm-list-controls .crm-field { flex-basis: 100%; }
  .crm-list-controls > p { padding-bottom: 3px; }
}
.crm-script-picker { max-width: 240px; margin-bottom: 10px; }
@media (max-width: 640px) {
  .crm-profile summary, .crm-script summary { min-height: 44px; }
}
.crm-call-availability { display: grid; align-content: start; gap: 8px; min-width: 0; }
.crm-call-availability > p, .crm-call-numbers { font-size: .84rem; }
.crm-call-numbers { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.crm-call-numbers li { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.crm-call-history { margin-top: 16px; }

@media (max-width: 680px) {
  .crm-pipeline { grid-auto-flow: row; grid-auto-columns: minmax(0, 1fr); overflow-x: visible; padding: 0; }
}

.mobile-tabs{display:none}.mobile-more{display:grid;grid-template-columns:repeat(auto-fit,minmax(9rem,1fr));gap:.7rem}.mobile-more a{padding:.9rem;border:1px solid var(--line);border-radius:8px}
@media(max-width:640px){.mobile-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;bottom:0;left:0;right:0;z-index:8;background:var(--paper,#fff);color:var(--ink,#162b40);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}.mobile-tabs a{min-height:48px;display:grid;place-items:center;font-size:.85rem;font-weight:600}.mobile-tabs a[aria-current]{text-decoration:underline}.workspace{padding-bottom:calc(55px + env(safe-area-inset-bottom))}}

.books{min-width:0}.books dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(12rem,100%),1fr));gap:1rem}.books dd{margin:0;font-size:1.12rem}.books details{border:1px solid var(--line);padding:.8rem;margin:.7rem 0}.books label{display:grid;gap:.2rem;margin:.3rem 0}.books fieldset{min-width:0}.books :is(input,textarea,select){max-width:100%}.books li{overflow-wrap:anywhere}

.projects{min-width:0}.projects form,.projects fieldset,.projects label{display:grid;gap:.45rem;min-width:0}.projects form,.projects details,.projects fieldset{padding:1rem;margin:.7rem 0}.projects input,.projects select,.projects textarea{max-width:100%}.project-board{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(13rem,100%),1fr));gap:.75rem}.project-board section{padding:.8rem;border:1px solid var(--line);border-radius:8px}.project-board button{display:block;text-align:left;width:100%;margin-block:.35rem}.project-board small{display:block}

/* Mail workspace */
.mail-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; }
.mail-account-picker, .mail-account-label { display: grid; gap: 3px; min-width: 0; }
.mail-account-picker label { font-size: .86rem; font-weight: 650; }
.mail-account-label :where(strong, span), .mail-reader-title :where(h2, p), .mail-attachment :where(strong, span) { overflow-wrap: anywhere; }
.mail-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.mail-toolbar .button { flex: none; }
.mail-status { margin-bottom: 12px; }
.mail-workspace { display: grid; grid-template-columns: minmax(120px, .65fr) minmax(205px, 1.1fr) minmax(0, 2fr); min-height: 410px; }
.mail-workspace > * { min-width: 0; }
.mail-rail, .mail-list { border-right: 1px solid var(--line); }
.mail-rail nav { display: grid; gap: 3px; padding: 10px; }
.mail-rail nav button { display: flex; justify-content: space-between; align-items: center; gap: 3px; min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; padding: 5px 8px; overflow-wrap: anywhere; }
.mail-rail nav button[aria-current], .mail-row[aria-current] { background: var(--background); font-weight: 700; }
.mail-counter { font-size: .8rem; color: var(--muted); }
.mail-list-header { padding: 12px; border-bottom: 1px solid var(--line); }
.mail-list-header h2 { margin-bottom: 7px; }
.mail-search, .mail-move { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
.mail-search .button, .mail-move .button { padding-inline: 8px; }
.mail-account-picker select, .mail-workspace :where(input, select, textarea) {
  min-width: 0; min-height: 44px; width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; color: var(--ink); background: var(--paper); font: inherit;
}
.mail-message-list, .mail-attachments ul { list-style: none; padding: 0; margin: 0; }
.mail-message-list li + li { border-top: 1px solid var(--line); }
.mail-row { width: 100%; display: grid; gap: 5px; min-height: 74px; border: 0; background: var(--paper); color: var(--ink); padding: 12px; text-align: left; }
.mail-row:hover, .mail-rail nav button:hover { background: var(--background); }
.mail-row.unread { box-shadow: inset 3px 0 var(--focus); }
.mail-row.unread strong { font-weight: 800; }
.mail-row-sender { display: flex; justify-content: space-between; gap: 5px; min-width: 0; font-size: .83rem; color: var(--muted); }
.mail-row-sender small { flex: none; }
.mail-row-sender span, .mail-row-preview, .mail-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-preview { font-size: .8rem; }
.mail-feedback { padding: 14px; }
.mail-pane:focus { outline: none; }
.mail-reader, .mail-composer { padding: 14px; }
.mail-reader-title { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 0 0 12px; }
.mail-reader-title p { margin-top: 4px; font-size: .87rem; }
.mail-message-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.mail-message-actions .button { min-height: 44px; }
.mail-body-text { padding: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.mail-back { display: none; margin-bottom: 10px; }
.mail-attachments h3 { font-size: 1rem; margin: 4px 0; }
.mail-attachment { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mail-attachment p { grid-column: 1 / -1; }
.mail-attachment div { display: grid; gap: 3px; }
.mail-attachment div span { font-size: .82rem; }
.mail-draft-form { display: grid; gap: 8px; }
.mail-draft-form label { font-size: .9rem; font-weight: 650; }
.mail-draft-form .button { justify-self: start; }
@media (max-width: 1000px) {
  .mail-workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
  .mail-rail { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .mail-rail nav { display: flex; flex-wrap: wrap; }
  .mail-rail nav button { padding-inline: 6px; }
}
@media (max-width: 680px) {
  .mail-workspace { display: block; }
  .mail-list { border-right: 0; }
  .mail-workspace:not(.mail-focused) .mail-pane,
  .mail-workspace.mail-focused :where(.mail-list, .mail-rail) { display: none; }
  .mail-back { display: inline-flex; }
  .mail-reader, .mail-composer { padding: 12px; }
  .mail-counter { padding-inline: 3px; }
}
.mail-pagination { display: flex; justify-content: space-between; gap: 6px; padding: 10px; }
.mail-pagination .button { padding-inline: 7px; }

.outreach {display:grid;gap:1rem}
.outreach h2,.outreach h3,.outreach p {margin:0 0 .45rem}
.outreach input:not([type=checkbox]),.outreach select,.outreach textarea {display:block;width:100%;box-sizing:border-box;min-width:0}
.outreach select {max-width:100%}
.outreach label {display:block;min-width:0;font-weight:600}
.outreach-section-heading,.outreach-actions {display:flex;align-items:center;justify-content:space-between;gap:.65rem;flex-wrap:wrap}
.outreach-summary,.outreach-editor,.outreach-preview {padding:1rem;min-width:0}
.outreach-main {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;align-items:start}
.outreach-editor form {display:grid;gap:.75rem}
.outreach-actions {justify-content:flex-start}
.outreach-fields {display:grid;gap:.5rem;margin:.75rem 0}
.outreach-fields div {display:grid;grid-template-columns:5rem minmax(0,1fr);gap:.6rem}
.outreach-fields dt {font-weight:600}
.outreach-fields dd {margin:0;overflow-wrap:anywhere}
.outreach-body {white-space:pre-wrap;overflow-wrap:anywhere;margin:.8rem 0;line-height:1.55}
.outreach-history {margin-top:1rem}
.outreach-history details {margin:.4rem 0;overflow-wrap:anywhere}
.outreach-inbox-list,.outreach-rows {list-style:none;margin:.4rem 0 0;padding:0;display:grid;gap:.55rem}
.outreach-inbox-list li,.outreach-rows li {border-top:1px solid var(--line);padding-top:.55rem;overflow-wrap:anywhere}
.outreach-inbox-list li {display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,.8fr) minmax(0,1fr);gap:.5rem}
.outreach-rows li {display:flex;align-items:center;justify-content:space-between;gap:.7rem;flex-wrap:wrap}
.outreach-rows input[type=checkbox] {margin-right:.5rem}
@media(max-width:760px) {
  .outreach-main,.outreach-inbox-list li {grid-template-columns:minmax(0,1fr)}
  .outreach-inbox-list li {gap:.2rem}
}

.automations {display:grid;gap:1rem}
.automations h2,.automations h3,.automations p {margin:.1rem 0 .45rem}
.auto-panel,.auto-builder,.auto-form,.auto-inspector {padding:1rem;min-width:0}
.auto-heading,.auto-actions {display:flex;align-items:center;justify-content:space-between;gap:.7rem;flex-wrap:wrap}
.auto-actions {justify-content:flex-start}
.automations label {display:block;font-weight:600;min-width:0}
.automations input,.automations select,.automations textarea {width:100%;box-sizing:border-box;min-width:0}
.auto-builder form,.auto-form form,.auto-inspector {display:grid;gap:.65rem}
.auto-builder-layout {display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);align-items:start;gap:1rem}
.auto-board {display:grid;gap:.8rem;min-width:0}
.auto-node {position:relative;padding:.9rem;border:1px solid var(--line);border-radius:10px;overflow-wrap:anywhere}
.auto-node:not(:first-child)::before {position:absolute;content:"";top:-.8rem;left:1.2rem;height:.8rem;border-left:2px solid var(--line)}
.auto-node.selected {border-color:currentColor}
.auto-trigger {display:grid;gap:.45rem}
.auto-node-title {border:0;background:transparent;color:inherit;font:inherit;font-weight:700;padding:0;text-align:left;cursor:pointer}
.auto-edges {display:flex;gap:.75rem;flex-wrap:wrap;font-size:.9rem}
.auto-edges span {border:1px solid var(--line);padding:.2rem .42rem;border-radius:5px}
.auto-list {list-style:none;padding:0;margin:.55rem 0;display:grid;gap:.6rem}
.auto-list li {display:flex;justify-content:space-between;align-items:start;gap:.75rem;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:.65rem;overflow-wrap:anywhere}
.auto-run-detail {border:1px solid var(--line);border-radius:8px;padding:.75rem}
.auto-sink-copy {white-space:pre-wrap}
@media(max-width:760px) {
  .auto-builder-layout {grid-template-columns:minmax(0,1fr)}
}

.booking-workspace { display: grid; gap: 1rem; min-width: 0; }
.booking-workspace h1, .booking-workspace h2, .booking-workspace h3, .booking-workspace p { margin: 0; }
.booking-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr)); gap: .75rem; }
.booking-panel, .booking-confirm {
  display: grid; align-content: start; gap: .75rem; min-width: 0; padding: 1rem;
  color: #132743; background: #fff; border: 1px solid #d8e2ef; border-radius: 12px;
}
.booking-panel h2 { font-size: 1.2rem; }
.booking-meta { color: #485f7b; font-size: .86rem; }
.booking-workspace button {
  width: fit-content; padding: .6rem .85rem; background: #244a77; color: #fff;
  border: 1px solid transparent; border-radius: .45rem; cursor: pointer; font: inherit;
}
.booking-workspace button[aria-pressed=true] { background: #16365e; box-shadow: 0 0 0 2px #7ba0cb; }
.booking-workspace button:disabled { opacity: .65; cursor: default; }
.booking-workspace button.booking-secondary { background: #edf3fa; color: #23436b; border-color: #d1ddec; }
.booking-line { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.booking-form { display: grid; justify-items: start; gap: .75rem; }
.booking-form label, .booking-line label { display: grid; gap: .25rem; min-width: 0; width: min(100%, 28rem); }
.booking-line label { width: min(100%, 12rem); }
.booking-form input:not([type=checkbox], [type=radio]), .booking-line input, .booking-form textarea, .booking-form select {
  min-width: 0; width: 100%; padding: .55rem .65rem; border: 1px solid #aebed1;
  border-radius: .35rem; background: #fff; color: #132743; font: inherit;
}
.booking-workspace fieldset { width: 100%; min-width: 0; margin: 0; border: 1px solid #d8e2ef; border-radius: .4rem; }
.booking-form label.booking-check, .booking-times label { display: inline-flex; align-items: center; gap: .45rem; width: auto; }
.booking-times { display: flex; flex-wrap: wrap; gap: .55rem; }
.booking-times label { padding: .45rem; }
.booking-admin { display: grid; gap: .75rem; }
.booking-admin summary { cursor: pointer; font-weight: 650; }
.booking-admin details[open] > :not(summary) { margin-top: .65rem; }
.booking-admin details:not([open]) { display: block; }
.booking-status { color: #245444; }
.booking-error { color: #8d1e28; }
.booking-reservations { display: grid; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.booking-reservations li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .65rem; padding: .65rem 0; border-bottom: 1px solid #e0e8f2;
}
.booking-counts { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; }
.booking-counts dd { margin: .3rem 0 0; font-weight: 650; }
.booking-visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }


.booking-guest { width: min(100% - 2rem, 48rem); margin: 2rem auto; }
.booking-guest header { display: grid; gap: .45rem; }
.booking-guest-receipt { display: grid; gap: .65rem; }
.booking-guest .booking-check { max-width: 100%; }

.invoicing { display:grid; gap:1rem; min-width:0; }
.invoicing h1,.invoicing h2,.invoicing h3,.invoicing p { margin:0; }
.invoicing header p { margin-top:.35rem; }
.invoice-panel { display:grid; align-content:start; gap:.75rem; min-width:0; padding:1rem; border:1px solid #d5e1ef;
  border-radius:.75rem; color:#172d4c; background:#fff; }
.invoicing button,.invoice-actions a { display:inline-flex; align-items:center; justify-content:center; text-align:center;
  width:fit-content; max-width:100%; padding:.55rem .75rem; border:1px solid #234873; border-radius:.45rem;
  color:#fff; background:#244c7d; cursor:pointer; font:inherit; text-decoration:none; }
.invoicing button:disabled { cursor:default; opacity:.6; }
.invoicing button.invoice-secondary,.invoice-actions a { color:#24466d; background:#eff4fa; border-color:#cad9eb; }
.invoice-actions { display:flex; flex-wrap:wrap; gap:.55rem; align-items:center; }
.invoice-form { display:grid; gap:.75rem; min-width:0; justify-items:start; }
.invoice-form label,.invoice-filter { display:grid; gap:.3rem; min-width:0; }
.invoice-form > label { width:min(100%,30rem); }
.invoice-form input,.invoice-form select,.invoice-form textarea,.invoice-filter select { appearance:auto; width:100%; min-width:0;
  border:1px solid #a1b5ce; border-radius:.4rem; padding:.55rem; color:#142946; background:#fff; font:inherit; }
.invoice-filter { width:min(100%,24rem); }
.invoice-fields,.invoice-line { display:grid; gap:.65rem; grid-template-columns:repeat(auto-fit,minmax(min(100%,10.5rem),1fr)); width:100%; min-width:0; }
.invoice-line { margin:0; border:1px solid #d5e1ef; border-radius:.5rem; padding:.65rem; }
.invoice-line legend { font-weight:650; }
.invoice-lines,.invoice-list { display:grid; gap:.5rem; padding:0; margin:0; list-style:none; }
.invoice-lines li { display:flex; flex-wrap:wrap; align-items:start; justify-content:space-between;
  gap:.5rem; padding:.45rem 0; border-bottom:1px solid #e4ecf6; overflow-wrap:anywhere; }
.invoice-detail { display:grid; gap:.85rem; }
.invoice-detail-header { display:flex; flex-wrap:wrap; justify-content:space-between; gap:1rem; align-items:end; }
.invoice-detail-header h2 { margin-top:.5rem; }
.invoice-columns { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1fr); gap:.85rem; }
.invoice-totals { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.4rem .75rem; margin:0; }
.invoice-totals dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.invoicing .invoice-card { width:100%; display:flex; justify-content:space-between; text-align:left; gap:.5rem; }
.invoice-card small { display:block; color:#485c78; }
.invoice-note { white-space:pre-wrap; overflow-wrap:anywhere; }
.invoice-status { color:#24634e; }
.invoice-error { color:#982630; }
@media(max-width:640px) { .invoice-columns { grid-template-columns:1fr; } }


.desk, .desk-form, .desk-detail { display: grid; gap: 14px; min-width: 0; }
.desk-heading, .desk-tabs { display: flex; align-items: center; gap: 8px; }
.desk-heading { justify-content: space-between; }
.desk-page-heading { align-items: start; margin-bottom: 6px; flex-wrap: wrap; }
.desk-heading h2, .desk-heading strong { overflow-wrap: anywhere; }
.desk-grid { display: grid; grid-template-columns: minmax(250px, .83fr) minmax(0, 1.7fr); gap: 14px; align-items: start; min-width: 0; }
.desk-card { background: var(--paper); border: 1px solid var(--line); padding: 16px; border-radius: var(--radius); min-width: 0; }
.desk-queue-list { display: grid; gap: 12px; }
.desk-form > .button { justify-self: start; }
.desk-form label, .desk-fields label { display: grid; gap: 5px; min-width: 0; font-weight: 650; font-size: .88rem; }
.desk-form input:not([type=checkbox]), .desk-form select, .desk-form textarea, .desk-contact input {
  width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  color: var(--ink); background: var(--paper); min-width: 0; font-weight: 400;
}
.desk-form textarea { resize: vertical; }
.desk-fields { display: flex; align-items: start; flex-wrap: wrap; gap: 10px; }
.desk-fields > * { flex: 1 1 110px; min-width: 0; font-size: .88rem; }
.desk-form .desk-check { display: flex; flex-direction: row; align-items: center; gap: 8px; margin-block: 4px; }
.desk-form fieldset { border: 1px solid var(--line); border-radius: 6px; }
.desk-ticket-list, .desk-history, .desk-matches { list-style: none; margin: 0; padding: 0; }
.desk-ticket-list { display: grid; gap: 3px; }
.desk-ticket-list a { display: grid; gap: 5px; padding: 10px; border: 1px solid transparent; border-radius: 8px; text-decoration: none; color: var(--ink); }
.desk-ticket-list a:hover, .desk-ticket-list a[aria-current] { background: var(--background); border-color: var(--line); }
.desk-ticket-list a > span, .desk-history .muted, .desk-history time { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.desk-badge { line-height: 1.1; font-size: .74rem; font-weight: 650; padding: 4px 7px; border-radius: 99px; color: var(--ink); background: var(--background); border: 1px solid var(--line); white-space: nowrap; }
.desk-badge.open { border-color: #58a78f; }
.desk-badge.pending { border-color: #c28833; }
.desk-contact { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.desk-contact-search { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.desk-matches { display: grid; gap: 7px; }
.desk-editors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.desk-history { margin-top: 8px; }
.desk-history li { border-top: 1px solid var(--line); display: grid; gap: 4px; padding-block: 10px; }
.desk-attachment-name { overflow-wrap: anywhere; }
.desk-event-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.desk-back { justify-self: start; }
.desk-tabs [aria-pressed=true] { border-color: var(--primary); }
@media(max-width: 880px) { .desk-grid { grid-template-columns: minmax(210px,.75fr) minmax(0,1fr); } .desk-editors { grid-template-columns: 1fr; } }
@media(max-width: 700px) { .desk-grid { grid-template-columns: minmax(0,1fr); } .desk-selected .desk-queue-list { display: none; } }
@media(max-width: 400px) { .desk-card { padding: 12px; } .desk-heading { flex-wrap: wrap; } }
.sam-chat, .chat-form, .chat-conversation { display: grid; gap: 13px; min-width: 0; }
.chat-heading, .chat-actions, .chat-composer-tools { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.chat-heading { justify-content: space-between; }
.chat-page-heading { align-items: start; }
.chat-workspace { display: grid; grid-template-columns: minmax(210px, .7fr) minmax(0, 2fr); gap: 14px; align-items: start; min-width: 0; }
.chat-panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.chat-form > .button { justify-self: start; }
.chat-form label:not(.chat-check) { display: grid; gap: 5px; font-size: .88rem; font-weight: 650; }
.chat-form :is(select,input:not([type=checkbox],[type=file]),textarea) {
  width: 100%; min-width: 0; min-height: 42px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink); font-weight: 400;
}
.chat-form textarea { resize: vertical; }
.chat-form fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 8px; }
.chat-people { max-height: 158px; overflow: auto; display: grid; gap: 5px; margin-top: 6px; }
.chat-check { display: flex; align-items: center; gap: 5px; }
.chat-room-links, .chat-stream { list-style: none; margin: 0; padding: 0; }
.chat-room-links li + li { margin-top: 3px; }
.chat-room-links a { display: flex; justify-content: space-between; align-items: center; overflow-wrap: anywhere; gap: 7px;
  color: var(--ink); text-decoration: none; border: 1px solid transparent; border-radius: 8px; padding: 8px 9px; min-height: 44px; }
.chat-room-links a:hover, .chat-room-links a[aria-current] { background: var(--background); border-color: var(--line); }
.chat-room-links a span + span { padding-inline: 5px; border-radius: 5px; border: 1px solid var(--line); }
.chat-room-header h2 { margin-top: 3px; overflow-wrap: anywhere; }
.chat-room-header a { font-size: .85rem; }
.chat-members, .chat-mentions-picker { font-size: .85rem; min-width: 0; }
.chat-stream { display: grid; gap: 7px; }
.chat-stream li { display: grid; gap: 5px; background: var(--background); border-radius: 8px; padding: 9px 12px; overflow-wrap: anywhere; }
.chat-stream li.chat-own { border-inline-start: 3px solid var(--focus); }
.chat-stream time, .chat-reply { font-size: .78rem; }
.chat-stream time { color: var(--muted); }
.chat-stream p { white-space: pre-wrap; }
.chat-mentioned { display: flex; flex-wrap: wrap; gap: 4px; }
.chat-mentioned span { font-size: .82rem; padding: 1px 5px; border-radius: 5px; background: var(--paper); border: 1px solid var(--line); }
.chat-composer { border-top: 1px solid var(--line); padding-top: 11px; }
.chat-file { max-width: min(100%, 220px); }
.chat-file input { width: 100%; font-weight: 400; font-size: .83rem; }
@media(max-width: 700px) {
  .chat-workspace { display: block; }
  .workspace:has(.chat-room-open) { display: block; min-height: 100svh; }
  .chat-room-open .chat-rooms { display: none; }
  .workspace:has(.chat-room-open) > .sidebar, .workspace:has(.chat-room-open) .topbar { display: none; }
  .workspace:has(.chat-room-open) .content { padding: 12px; }
  .sam-chat.chat-room-open .chat-page-heading h1 { font-size: 1.3rem; }
  .chat-panel { padding: 12px; }
}