:root {
  --bg: #f6f7f3;
  --surface: #ffffff;
  --surface-2: #eef3ef;
  --ink: #202522;
  --muted: #667068;
  --line: #dce3dc;
  --accent: #156c5b;
  --accent-2: #d9472b;
  --accent-3: #2e5e9e;
  --warning: #b37700;
  --shadow: 0 18px 50px rgba(28, 39, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-loading .app-shell {
  display: none;
}

.login-page {
  background: #1f2b26;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(31, 43, 38, 0.92), rgba(21, 108, 91, 0.82)),
    url("https://images.unsplash.com/photo-1493238792000-8113da705763?auto=format&fit=crop&w=1600&q=80") center / cover;
}

.login-panel {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.login-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.login-brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.login-panel h1 {
  font-size: 30px;
}

.auth-copy,
.auth-hint {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.auth-hint {
  font-size: 13px;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.form-error {
  border: 1px solid #e0a094;
  border-radius: 8px;
  background: #fae8e4;
  color: #8d2d1f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  margin: 0;
  padding: 10px 12px;
}

.user-chip {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #1f2b26;
  color: #f6faf7;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f2c14e;
  color: #1f2b26;
  font-weight: 800;
}

.brand span,
.sidebar-note p,
.eyebrow {
  color: var(--muted);
}

.brand span {
  display: block;
  color: #b8c8bf;
  font-size: 13px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  color: #dfe9e3;
  background: transparent;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.11);
}

.sidebar-note {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 18px;
}

.sidebar-note span {
  color: #f2c14e;
  font-weight: 700;
}

.sidebar-note p {
  color: #b8c8bf;
  margin: 8px 0 0;
  line-height: 1.45;
}

.workspace {
  padding: 28px;
  min-width: 0;
}

.topbar,
.section-head,
.toolbar,
.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.category-switcher {
  display: flex;
  align-items: end;
  gap: 10px;
  min-width: min(420px, 42vw);
}

.category-switcher label {
  flex: 1;
}

.category-switcher select {
  min-width: 190px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.email-notification-center {
  align-self: center;
  position: relative;
}

.notification-bell {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 42px;
}

.notification-bell:hover,
.notification-bell[aria-expanded="true"] {
  background: #eaf6f1;
  border-color: #9fc9bf;
  color: var(--accent);
}

.notification-bell svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 22px;
}

.notification-badge {
  align-items: center;
  background: var(--accent-2);
  border: 2px solid var(--surface);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 4px;
  position: absolute;
  right: -7px;
  top: -7px;
}

.email-notification-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: grid;
  overflow: hidden;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(410px, calc(100vw - 32px));
  z-index: 120;
}

.email-notification-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px;
}

.email-notification-head h2 {
  font-size: 19px;
}

.email-notification-head .eyebrow {
  margin-bottom: 3px;
}

.email-notification-list {
  max-height: min(430px, calc(100vh - 230px));
  overflow-y: auto;
}

.email-notification-item {
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: grid;
  gap: 4px;
  padding: 13px 16px;
  text-align: left;
  width: 100%;
}

.email-notification-item:hover,
.email-notification-item:focus-visible {
  background: #f0f8f5;
  outline: none;
}

.email-notification-item-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.email-notification-item strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.email-notification-time {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
}

.email-notification-subject {
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.email-notification-preview {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.email-notification-empty {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  padding: 24px 18px;
  text-align: center;
}

.email-notification-footer {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  padding: 12px;
}

.button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 750;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.button.danger {
  background: #a73b2d;
  border-color: #a73b2d;
  color: white;
}

.button:disabled,
.mini-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button.ghost {
  background: transparent;
}

.button.wide {
  width: 100%;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat,
.panel,
.lead-card,
.task,
.finder-card,
.table-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat {
  padding: 16px;
}

.stat span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.toolbar {
  margin-bottom: 14px;
}

.lead-filter-toolbar,
.client-filter-toolbar {
  align-items: end;
  display: grid;
  gap: 12px;
}

.lead-filter-toolbar {
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(180px, 230px));
}

.client-filter-toolbar {
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(170px, 220px)) auto;
}

.filter-clear-button {
  white-space: nowrap;
}

.timeline-filter-panel {
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px 12px;
  grid-template-columns: minmax(220px, 300px) minmax(190px, 240px) minmax(190px, 240px) auto;
  margin: 0 0 16px;
  padding: 12px;
}

.timeline-filter-panel small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  grid-column: 1 / -1;
  line-height: 1.4;
}

.timeline-filter-panel .button {
  white-space: nowrap;
}

.activity-filters {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
}

.activity-filter-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-field {
  flex: 1;
}

.select-field {
  min-width: 180px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px 11px;
  min-height: 40px;
}

[hidden] {
  display: none !important;
}

input[type="file"] {
  padding: 8px 10px;
}

textarea {
  min-height: 260px;
  line-height: 1.5;
  resize: vertical;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(230px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.column {
  min-width: 230px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.column-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.lead-card {
  overflow: hidden;
  padding: 14px;
  position: relative;
  display: grid;
  gap: 12px;
  box-shadow: 0 6px 20px rgba(31, 43, 38, 0.05);
}

.lead-card > :not(.lead-card-marker-watermark) {
  position: relative;
  z-index: 1;
}

.lead-card h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.lead-card-marker-watermark {
  align-items: center;
  display: flex;
  font-family: Arial, sans-serif;
  font-size: 150px;
  font-weight: 900;
  height: 170px;
  justify-content: center;
  line-height: 1;
  opacity: 0.065;
  pointer-events: none;
  position: absolute;
  right: -20px;
  top: 42px;
  transform: rotate(-9deg);
  width: 190px;
  z-index: 0;
}

.lead-marker-skull .lead-card-marker-watermark {
  color: #050505;
}

.lead-marker-heart .lead-card-marker-watermark {
  color: #d32636;
}

.lead-marker-money .lead-card-marker-watermark {
  border: 8px double currentColor;
  border-radius: 14px;
  color: #148447;
  font-size: 90px;
  height: 95px;
  right: -8px;
  top: 78px;
  width: 165px;
}

.lead-card-primary-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-card-marker-actions {
  display: flex;
  gap: 5px;
  margin-left: auto;
}

.lead-card-marker-actions .lead-marker-choice {
  align-items: center;
  display: inline-flex;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  min-width: 32px;
  padding: 3px 7px;
}

.lead-card-phone {
  display: flex;
  flex-wrap: wrap;
}

.lead-latest-note {
  background: #f6f8f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  padding: 10px 11px;
}

.lead-latest-note.empty {
  color: var(--muted);
}

.lead-latest-note-head {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.lead-latest-note strong {
  font-size: 12px;
}

.lead-latest-note time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.lead-latest-note p {
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  max-height: 7.25em;
  overflow-y: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.lead-card-notes {
  background: #f6f8f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  min-height: 0;
  overflow: hidden;
}

.lead-card-notes-title {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  padding: 8px 10px;
}

.lead-card-notes-title span {
  align-items: center;
  background: #e3ebe6;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding: 0 6px;
}

.lead-card-notes-scroll {
  max-height: 220px;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.lead-card-notes-scroll:focus-visible {
  outline: 2px solid rgba(21, 108, 91, 0.3);
  outline-offset: -2px;
}

.lead-card-note {
  background: rgba(255, 255, 255, 0.78);
  border-left: 3px solid rgba(21, 108, 91, 0.28);
  display: grid;
  gap: 6px;
  padding: 10px;
}

.lead-card-note + .lead-card-note {
  border-top: 1px solid var(--line);
}

.lead-card-note.alternate {
  background: #edf3ef;
}

.lead-card-note.system {
  border-left-color: #aeb9b2;
}

.lead-card-note-meta {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.lead-card-note-meta strong {
  font-size: 11px;
  overflow-wrap: anywhere;
}

.lead-card-note-meta time {
  color: var(--muted);
  flex: none;
  font-size: 10px;
  white-space: nowrap;
}

.lead-card-note p,
.lead-card-notes-empty {
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.lead-card-notes-empty {
  color: var(--muted);
  padding: 12px 10px;
}

.lead-phone-gate {
  border-style: dashed;
  color: var(--accent);
}

.lead-phone-visible {
  color: var(--accent);
  text-decoration: none;
}

.lead-source-pill {
  font-weight: 700;
}

.lead-status-history {
  border: 1px solid var(--line);
  border-radius: 7px;
  max-height: 126px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.lead-status-history:focus-visible {
  outline: 2px solid rgba(21, 108, 91, 0.3);
  outline-offset: 1px;
}

.lead-status-history table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.lead-status-history th,
.lead-status-history td {
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.3;
  padding: 6px 7px;
  text-align: left;
  vertical-align: top;
}

.lead-status-history th {
  background: #eef3f0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}

.lead-status-history th:first-child,
.lead-status-history td:first-child {
  font-weight: 800;
  width: 34%;
}

.lead-status-history th:nth-child(2),
.lead-status-history td:nth-child(2) {
  width: 30%;
}

.lead-status-history tbody tr:nth-child(even) td {
  background: rgba(237, 243, 239, 0.76);
}

.lead-status-history tbody tr:last-child td {
  border-bottom: 0;
}

.lead-status-history time {
  color: var(--muted);
  white-space: nowrap;
}

.lead-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pill-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.call-panel {
  display: grid;
  gap: 8px;
}

.call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.call-note {
  min-height: 68px;
  font-size: 13px;
}

.lead-notes-dialog {
  width: min(760px, calc(100vw - 28px));
}

.lead-phone-dialog {
  width: min(520px, calc(100vw - 28px));
}

.lead-notes-dialog form,
.lead-phone-dialog form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.dialog-heading {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.dialog-heading h2 {
  margin-top: 3px;
}

.lead-note-history {
  display: grid;
  gap: 10px;
  max-height: min(42vh, 420px);
  overflow-y: auto;
  padding-right: 4px;
}

.lead-note-entry {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  display: grid;
  gap: 9px;
  padding: 12px;
}

.lead-note-entry.system {
  border-left-color: var(--muted);
}

.lead-note-entry-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.lead-note-entry time,
.lead-note-entry small {
  color: var(--muted);
  font-size: 12px;
}

.lead-note-entry p {
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
}

.lead-note-create {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
}

.lead-note-create legend {
  font-size: 13px;
  font-weight: 850;
  padding: 0 6px;
}

.lead-note-locked {
  background: #fff7e3;
  border: 1px solid #e8d49a;
  border-radius: 8px;
  color: #6f5520;
  line-height: 1.5;
  padding: 12px;
}

.pill {
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pill.consent {
  background: #dff1ea;
  color: var(--accent);
}

.pill.demo {
  background: #e3ecfa;
  color: var(--accent-3);
}

.pill.blocked {
  background: #fae4df;
  color: var(--accent-2);
}

.mini-button {
  border: 1px solid var(--line);
  background: #fbfcfb;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
}

.section-head {
  margin-bottom: 16px;
}

.finder-grid,
.message-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
}

.panel {
  padding: 16px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.finder-head-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.finder-mode-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}

.finder-mode-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.finder-mode-picker label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 6px;
  background: #fbfcfb;
  cursor: pointer;
}

.finder-mode-picker label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.finder-mode-picker label:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

.finder-mode-picker input {
  width: 16px;
  min-height: 16px;
}

.finder-form-hint {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.account-settings-form {
  max-width: 520px;
}

.email-setting-toggle {
  align-items: flex-start;
}

.email-setting-toggle span {
  display: grid;
  gap: 4px;
}

.email-setting-toggle small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.read-receipt-dialog {
  width: min(620px, calc(100vw - 28px));
}

.read-receipt-dialog-card {
  width: 100%;
}

.read-receipt-description {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.read-receipt-actions {
  flex-wrap: wrap;
}

.spellcheck-feedback {
  background: #fff8e8;
  border: 1px solid #ead49a;
  border-radius: 7px;
  color: #6f5000;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 6px;
  line-height: 1.45;
  margin-top: 6px;
  padding: 8px 10px;
}

.spellcheck-plain-editor {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  min-height: 40px;
  outline: none;
  overflow-wrap: anywhere;
  padding: 10px 11px;
  width: 100%;
}

.spellcheck-plain-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 108, 91, 0.12);
}

.spellcheck-plain-editor:empty::before {
  color: #8b948e;
  content: attr(data-placeholder);
  pointer-events: none;
}

.spellcheck-subject-editor {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.spellcheck-multiline-editor {
  min-height: 150px;
  white-space: pre-wrap;
}

.spellcheck-misspelled {
  cursor: context-menu;
  text-decoration-color: #d52222;
  text-decoration-line: underline;
  text-decoration-skip-ink: none;
  text-decoration-style: wavy;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.spellcheck-context-menu {
  background: #fff;
  border: 1px solid #cfd8d1;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(26, 43, 34, 0.22);
  display: grid;
  min-width: 220px;
  overflow: hidden;
  padding: 5px;
  position: fixed;
  z-index: 10000;
}

.spellcheck-context-menu[hidden] {
  display: none !important;
}

.spellcheck-context-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 7px 9px 5px;
  text-transform: uppercase;
}

.spellcheck-suggestion,
.spellcheck-no-suggestion {
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--ink);
  font: inherit;
  padding: 8px 9px;
  text-align: left;
  width: 100%;
}

.spellcheck-suggestion:hover,
.spellcheck-suggestion:focus-visible {
  background: #eaf6f1;
  color: #174d42;
  outline: none;
}

.spellcheck-no-suggestion {
  color: var(--muted);
  cursor: default;
}

.spellcheck-feedback[hidden] {
  display: none !important;
}

.spellcheck-feedback.unavailable {
  background: #fff2ef;
  border-color: #efc0b7;
  color: #8d2d1f;
}

@media (max-width: 640px) {
  .read-receipt-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .read-receipt-actions .button {
    width: 100%;
  }
}

.finder-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.map-search {
  display: grid;
  gap: 14px;
}

.search-notice {
  border: 1px solid #e4c06e;
  border-radius: 8px;
  background: #fff8e8;
  color: #6f4b00;
  font-size: 13px;
  font-weight: 800;
  padding: 12px 14px;
}

.result-map {
  width: 100%;
  height: clamp(360px, 50vh, 560px);
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  z-index: 1;
}

.leaflet-popup-content {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.35;
}

.leaflet-popup-content a {
  color: var(--accent);
  font-weight: 800;
}

.data-checklist {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 9px;
}

.data-checklist legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 0 5px;
}

.data-checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-checklist input {
  width: 16px;
  min-height: 16px;
}

.finder-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.finder-card.known-card {
  background: #f6f8f6;
}

.finder-card p {
  color: var(--muted);
  margin-bottom: 0;
  font-size: 13px;
}

.task-list {
  display: grid;
  gap: 10px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
}

.settings-section {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.compact-head {
  margin-bottom: 0;
}

.compact-head h3 {
  font-size: 20px;
  margin-bottom: 0;
}

.status-option-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.status-option-card .pill {
  max-width: 180px;
  overflow-wrap: anywhere;
}

.template-list {
  display: grid;
  gap: 12px;
}

.template-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.template-card.active-template {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(21, 108, 91, 0.12);
}

.template-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input {
  width: 16px;
  min-height: 16px;
}

.mini-button.danger {
  border-color: #e0a094;
  color: #8d2d1f;
}

.table-shell {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  padding-bottom: 6px;
  scrollbar-gutter: stable;
}

.status-delete-dialog {
  width: min(560px, calc(100vw - 28px));
}

.status-delete-warning {
  background: #fff6e8;
  border: 1px solid #efd2a2;
  border-radius: 8px;
  color: #704715;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  padding: 10px 12px;
}

.finder-results > .empty-state {
  grid-column: 1 / -1;
}

.finder-point-summary {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.finder-catalog-message {
  margin-bottom: 14px;
}

.finder-modal {
  height: auto;
  max-width: none;
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

.finder-catalog-modal {
  width: min(1080px, calc(100vw - 32px));
}

.finder-coverage-modal {
  width: min(1280px, calc(100vw - 32px));
}

.finder-catalog-dialog,
.finder-coverage-dialog {
  box-sizing: border-box;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.finder-catalog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.finder-catalog-section {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.finder-catalog-form,
.finder-catalog-list {
  display: grid;
  gap: 10px;
}

.finder-location-autocomplete {
  display: block;
  position: relative;
}

.finder-location-autocomplete input {
  width: 100%;
}

.finder-location-suggestions {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  left: 0;
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  z-index: 1200;
}

.finder-location-suggestion {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 2px;
  min-height: 0;
  padding: 9px 10px;
  text-align: left;
  width: 100%;
}

.finder-location-suggestion:hover,
.finder-location-suggestion:focus-visible,
.finder-location-suggestion.is-active {
  background: #eaf3ff;
  outline: none;
}

.finder-location-suggestion strong,
.finder-location-suggestion span {
  overflow-wrap: anywhere;
}

.finder-location-suggestion span,
.finder-location-hint,
.finder-google-attribution {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.finder-location-suggestion-context {
  color: #3e6258 !important;
  font-weight: 750;
}

.finder-location-suggestion-address {
  font-size: 11px !important;
}

.finder-location-suggestion-status {
  color: var(--muted);
  display: block;
  font-size: 13px;
  padding: 11px 10px;
}

.finder-location-hint.is-selected {
  color: var(--accent);
  font-weight: 750;
}

.finder-google-attribution {
  border-top: 1px solid var(--line);
  display: block;
  margin: 5px 4px 0;
  padding: 7px 6px 3px;
  text-align: right;
}

.finder-google-attribution img {
  display: inline-block;
  height: 14px;
  max-width: 120px;
  object-fit: contain;
  width: auto;
}

.finder-geometry-fields {
  gap: 10px;
}

.finder-catalog-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfcfb;
}

.finder-catalog-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.finder-catalog-item strong {
  overflow-wrap: anywhere;
}

.finder-catalog-item span {
  color: var(--muted);
  font-size: 12px;
}

.finder-catalog-item.is-inactive {
  opacity: 0.62;
}

.finder-catalog-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.finder-coverage-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr)) minmax(240px, 0.8fr);
  align-items: end;
  gap: 16px;
}

.finder-coverage-toolbar label {
  min-width: 0;
}

.finder-coverage-toolbar p {
  margin: 0;
  color: var(--muted);
}

.finder-coverage-map {
  width: 100%;
  height: clamp(360px, 55vh, 580px);
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.finder-history-list {
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow: auto;
  padding-right: 3px;
}

.finder-history-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fbfcfb;
}

.finder-history-item div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.finder-history-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.clients-table-shell {
  container: clients-table / inline-size;
  min-width: 0;
  overscroll-behavior-inline: contain;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.clients-table-shell:focus-visible {
  outline: 3px solid rgba(21, 108, 91, 0.2);
  outline-offset: 2px;
}

.clients-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  margin-bottom: 14px;
}

.clients-map,
.map-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.clients-map {
  min-height: 280px;
  overflow: hidden;
  z-index: 1;
}

.map-side {
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.map-side h3 {
  font-size: 17px;
  margin-bottom: 0;
}

.map-side p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 0;
}

.clients-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.clients-table th,
.clients-table td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

.clients-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.clients-table tr:last-child td {
  border-bottom: 0;
}

.clients-table tbody tr {
  cursor: pointer;
}

.clients-table tbody tr:hover td,
.clients-table tbody tr.selected-client-row td {
  background: #eef6f1;
}

.clients-table td strong,
.clients-table td span {
  display: block;
}

.clients-table td span,
.contact-cell {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.clients-table a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.table-category {
  min-width: 150px;
}

.table-status {
  min-width: 155px;
}

.importance-select {
  min-width: 140px;
  font-weight: 800;
}

.importance-super_important {
  background: #fff1d6;
  border-color: #d99a22;
  color: #7a3e00;
}

.importance-important {
  background: #e5f3ff;
  border-color: #7fb4e3;
  color: #174f82;
}

.importance-low {
  background: #f3f5f2;
  color: #5d675f;
}

.importance-not_important {
  background: #fae8e4;
  border-color: #e0a094;
  color: #8d2d1f;
}

.importance-row.importance-super_important td {
  background: #fffaf0;
}

.importance-row.importance-important td {
  background: #f5fbff;
}

.importance-row.importance-low td {
  background: #fbfcfb;
}

.importance-row.importance-not_important td {
  opacity: 0.78;
}

.table-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  min-width: 0;
}

.client-col-select {
  width: 48px;
}

.client-col-name {
  width: 220px;
}

.clients-table td.client-col-name {
  overflow: hidden;
  position: relative;
}

.client-name-content {
  position: relative;
  z-index: 1;
}

.client-marker-watermark {
  align-items: center;
  bottom: -9px;
  display: flex !important;
  font-family: Arial, sans-serif;
  font-size: 64px !important;
  font-weight: 900;
  justify-content: center;
  line-height: 1 !important;
  opacity: 0.13;
  pointer-events: none;
  position: absolute;
  right: 12px;
  transform: rotate(-8deg);
  width: 70px;
  z-index: 0;
}

.client-marker-skull .client-marker-watermark {
  color: #050505 !important;
}

.client-marker-heart .client-marker-watermark {
  color: #d32636 !important;
}

.client-marker-money .client-marker-watermark {
  border: 4px double currentColor;
  border-radius: 7px;
  bottom: 7px;
  color: #148447 !important;
  font-size: 39px !important;
  height: 43px;
  transform: rotate(-7deg);
  width: 66px;
}

.client-col-city {
  width: 140px;
}

.client-col-contact {
  width: 190px;
}

.client-col-status {
  width: 180px;
}

.client-col-category {
  width: 180px;
}

.client-col-importance {
  width: 168px;
}

.client-col-assignee {
  width: 170px;
}

.client-col-source {
  width: 100px;
}

.client-col-last-email {
  width: 170px;
}

.client-col-actions {
  width: 116px;
}

.clients-table .table-status,
.clients-table .table-category,
.clients-table .importance-select {
  min-width: 0;
  width: 100%;
}

.actions-column,
.actions-cell {
  position: sticky;
  right: 0;
  width: 116px;
  min-width: 116px;
  background: var(--surface);
  box-shadow: -10px 0 16px rgba(28, 39, 34, 0.08);
  z-index: 2;
}

.actions-column {
  z-index: 3;
}

.actions-cell.actions-menu-open {
  z-index: 9999;
}

.clients-table tbody tr:hover .actions-cell,
.clients-table tbody tr.selected-client-row .actions-cell {
  background: #eef6f1;
}

@container clients-table (max-width: 1681px) {
  .client-col-source {
    display: none;
  }
}

@container clients-table (max-width: 1581px) {
  .client-col-category {
    display: none;
  }
}

@container clients-table (max-width: 1401px) {
  .client-col-city {
    display: none;
  }
}

@container clients-table (max-width: 1261px) {
  .client-col-last-email {
    display: none;
  }
}

@container clients-table (max-width: 921px) {
  .client-col-name {
    width: 170px;
  }

  .client-col-contact {
    width: 150px;
  }

  .client-col-status {
    width: 145px;
  }

  .client-col-importance {
    width: 140px;
  }

  .client-col-assignee {
    width: 145px;
  }

  .client-col-actions,
  .actions-column,
  .actions-cell {
    width: 104px;
    min-width: 104px;
  }
}

.actions-menu {
  position: relative;
  min-width: 0;
}

.actions-menu-trigger {
  width: 100%;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  list-style: none;
}

.actions-menu-trigger::-webkit-details-marker {
  display: none;
}

.actions-menu-trigger::marker {
  content: "";
}

.actions-menu-trigger::after {
  content: "v";
  margin-left: 7px;
  font-size: 10px;
}

.actions-menu[open] .actions-menu-trigger {
  border-color: var(--accent);
  color: var(--accent);
}

.actions-menu[open] .actions-menu-trigger::after {
  content: "^";
}

.actions-menu-list {
  display: grid;
  gap: 7px;
  position: fixed;
  z-index: 10000;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(28, 39, 34, 0.2);
}

.actions-menu-list .mini-button {
  width: 100%;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.client-marker-actions {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 7px;
  padding: 8px 0;
}

.client-marker-actions > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-marker-actions > div {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, 1fr);
}

.actions-menu-list .marker-choice {
  font-family: Arial, sans-serif;
  font-size: 20px;
  font-weight: 900;
  min-width: 0;
  padding: 3px;
}

.marker-choice.marker-skull {
  color: #050505;
}

.marker-choice.marker-heart {
  color: #d32636;
}

.marker-choice.marker-money {
  color: #148447;
}

.marker-choice.active {
  background: #e8f3ed;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(21, 108, 91, 0.12);
}

.action-assignment-block {
  display: grid;
  gap: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.action-assignment-block label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.action-assignment-block select {
  width: 100%;
  min-height: 36px;
  min-width: 0;
}

.assignment-button {
  color: var(--accent);
}

.danger-subtle {
  color: #9d392b;
  border-color: #e2b4ac;
  background: #fff8f6;
}

.assignee-name {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e9f4ef;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.assignee-name.unassigned {
  background: #f2f3f2;
  color: var(--muted);
}

.importance-picker {
  max-width: 220px;
}

.task {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.task p {
  margin: 4px 0 0;
  color: var(--muted);
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(16, 24, 20, 0.42);
}

.fullscreen-dialog {
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  max-width: none;
  max-height: none;
}

.full-row {
  grid-column: 1 / -1;
}

.dialog-card {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.client-edit-dialog {
  min-height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.client-edit-grid {
  align-content: start;
  overflow: auto;
  padding-right: 4px;
}

.client-edit-grid textarea {
  min-height: 160px;
}

.notice-dialog {
  width: min(440px, calc(100vw - 28px));
}

.notice-card {
  padding: 22px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.notice-card .dialog-actions {
  grid-column: 1 / -1;
  justify-content: end;
  margin-top: 2px;
}

.notice-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e8f5ef;
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.notice-icon.error {
  background: #fff0ed;
  color: #b23520;
}

.notice-icon.warning {
  background: #fff4d6;
  color: #8a5a00;
}

.notice-content h2 {
  margin: 2px 0 8px;
  font-size: 22px;
}

.notice-content p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

.calendar-head-actions {
  align-items: end;
  display: flex;
  gap: 10px;
}

.calendar-user-switcher {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 4px;
  min-width: 230px;
}

.calendar-user-switcher select {
  min-height: 40px;
}

.calendar-main,
.calendar-agenda {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calendar-main {
  min-width: 0;
  overflow-x: auto;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.calendar-toolbar h3 {
  margin: 0;
  font-size: 20px;
  text-transform: capitalize;
}

.calendar-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  background: #f8faf8;
  border-bottom: 1px solid var(--line);
}

.calendar-weekdays span {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-grid {
  min-width: 760px;
}

.calendar-day {
  min-height: 126px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.outside-month {
  background: #f5f7f5;
  color: #8a948c;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px rgba(21, 108, 91, 0.22);
}

.calendar-day:focus-visible,
.calendar-event:focus-visible,
.calendar-agenda-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.calendar-day-number {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 850;
}

.calendar-day.today .calendar-day-number {
  background: var(--accent);
  color: white;
}

.calendar-day-events {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.calendar-event {
  width: 100%;
  border: 1px solid #b9d7cd;
  border-radius: 8px;
  background: #eaf6f1;
  color: #174d42;
  padding: 6px 7px;
  display: grid;
  gap: 2px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  min-width: 0;
}

.calendar-event span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-time,
.calendar-more,
.calendar-agenda-date,
.calendar-agenda-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-more {
  display: block;
  padding: 2px 4px;
}

.calendar-agenda {
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.calendar-agenda h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.calendar-agenda-list {
  display: grid;
  gap: 10px;
}

.calendar-agenda-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
  display: grid;
  gap: 5px;
  text-align: left;
}

.calendar-agenda-item strong,
.calendar-agenda-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.meeting-dialog-actions #deleteMeeting {
  margin-right: auto;
}

.meeting-participants-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  min-width: 0;
  padding: 12px;
}

.meeting-participants-fieldset legend {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  padding: 0 5px;
}

.meeting-participants {
  align-items: start;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.meeting-participant-option {
  align-items: center;
  align-self: start;
  background: #f8faf8;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  grid-template-columns: 18px minmax(0, 1fr);
  line-height: 1.35;
  min-height: 42px;
  min-width: 0;
  padding: 9px 10px;
}

.meeting-participant-option:has(input:checked) {
  background: #eaf6f1;
  border-color: #9fc9bb;
}

.meeting-participant-option input[type="checkbox"] {
  height: 18px;
  margin: 0;
  min-height: 18px;
  padding: 0;
  width: 18px;
}

.meeting-participant-option span {
  display: block;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

.meeting-readonly-notice {
  background: #fff8e8;
  border: 1px solid #ead49a;
  border-radius: 7px;
  color: #6f5000;
  margin: 0;
  padding: 10px 12px;
}

.calendar-notification-settings-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.meeting-lead-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.meeting-lead-combobox {
  position: relative;
  min-width: 0;
}

.meeting-lead-trigger {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  font-weight: 750;
}

.meeting-lead-trigger span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meeting-lead-panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 8px;
  display: grid;
  gap: 8px;
}

.meeting-lead-panel[hidden] {
  display: none;
}

.meeting-lead-panel input {
  min-height: 38px;
}

.meeting-lead-options {
  max-height: 260px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
}

.meeting-lead-option {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  font-weight: 650;
}

.meeting-lead-option:hover,
.meeting-lead-option.selected {
  background: #eaf6f1;
  color: #174d42;
}

.meeting-lead-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    padding: 16px;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .sidebar-note {
    display: none;
  }

  .stats-grid,
  .finder-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finder-grid,
  .message-layout,
  .clients-map-layout,
  .calendar-layout,
  .activity-filters,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .activity-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .email-conversation-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .email-panel-heading {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .category-switcher,
  .nav,
  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions,
  .category-switcher {
    display: grid;
    min-width: 0;
  }

  .calendar-head-actions {
    align-items: stretch;
    display: grid;
    width: 100%;
  }

  .calendar-user-switcher {
    min-width: 0;
  }

  .meeting-participants {
    grid-template-columns: 1fr;
  }

  .finder-catalog-grid {
    grid-template-columns: 1fr;
  }

  .finder-head-actions {
    justify-content: stretch;
  }

  .finder-head-actions .button {
    flex: 1 1 210px;
  }

  .topbar-actions {
    grid-template-columns: auto 1fr;
  }

  .email-notification-center {
    align-self: start;
    grid-column: 1;
    grid-row: 1;
  }

  .user-chip {
    grid-column: 2;
    grid-row: 1;
  }

  .email-notification-panel {
    left: 12px;
    max-height: calc(100vh - 32px);
    position: fixed;
    right: 12px;
    top: 16px;
    width: auto;
  }

  .email-notification-list {
    max-height: calc(100vh - 190px);
  }

  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-nav-actions {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  h1 {
    font-size: 28px;
  }
}

.client-bulk-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid #bdd7cc;
  border-radius: 8px;
  background: #eef7f3;
}

.client-bulk-toolbar[hidden] {
  display: none;
}

.bulk-assignment-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bulk-assignment-field[hidden] {
  display: none;
}

.bulk-assignment-field select {
  min-width: 200px;
  min-height: 38px;
}

.selection-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.select-column,
.select-cell {
  width: 44px;
  text-align: center;
}

.select-column input,
.select-cell input {
  width: 16px;
  min-height: 16px;
}

.last-email-cell {
  min-width: 150px;
}

.mini-button.subtle {
  background: #f6fbf8;
  color: var(--accent);
}

.email-layout {
  align-items: start;
  grid-template-columns: 290px minmax(0, 1fr);
}

@media (max-width: 820px) {
  .bulk-assignment-field {
    align-items: stretch;
    flex: 1 1 100%;
    flex-direction: column;
    margin-left: 0;
  }

  .bulk-assignment-field select {
    min-width: 0;
    width: 100%;
  }
}

.email-conversation-panel {
  gap: 16px;
}

.message-lead-field {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  min-width: 0;
}

.message-lead-combobox {
  min-width: 0;
  position: relative;
}

.message-lead-trigger {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  font-weight: 750;
  gap: 10px;
  justify-content: space-between;
  min-height: 40px;
  padding: 10px 11px;
  text-align: left;
  width: 100%;
}

.message-lead-trigger span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-lead-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  left: 0;
  padding: 8px;
  position: absolute;
  top: calc(100% + 6px);
  width: min(540px, calc(100vw - 64px));
  z-index: 80;
}

.message-lead-panel[hidden] {
  display: none;
}

.message-lead-panel input {
  min-height: 40px;
}

.message-lead-options {
  display: grid;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}

.message-lead-option {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  display: grid;
  gap: 3px;
  min-height: 42px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.message-lead-option strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.message-lead-option span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.message-lead-option:hover,
.message-lead-option.selected {
  background: #eaf6f1;
  color: #174d42;
}

.message-lead-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 10px;
}

.email-panel-heading,
.email-subsection-head {
  min-width: 0;
}

.email-panel-heading h3,
.email-subsection-head h3 {
  font-size: 18px;
  margin: 0;
}

.email-main-column {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.email-history-section {
  min-width: 0;
}

.email-subsection-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.email-template-tools {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.email-template-picker {
  display: grid;
  gap: 5px;
  min-width: min(280px, 38vw);
}

.email-template-picker span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-button {
  min-height: 42px;
  padding: 9px 13px;
}

.email-composer-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.email-compose-fields {
  display: grid;
  gap: 14px;
}

.rich-editor-field {
  display: grid;
  gap: 0;
}

.rich-editor-field > span {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 7px;
}

.rich-text-toolbar {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 44px;
  padding: 6px;
}

.rich-text-toolbar button,
.rich-text-toolbar select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 32px;
}

.rich-text-toolbar button {
  min-width: 34px;
  padding: 5px 9px;
}

.rich-text-toolbar select {
  margin-left: auto;
  max-width: 190px;
  padding: 5px 28px 5px 9px;
}

.rich-text-toolbar button:hover,
.rich-text-toolbar button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.toolbar-separator {
  align-self: stretch;
  border-left: 1px solid #cbd5cd;
  margin: 2px 3px;
}

.rich-text-editor {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  line-height: 1.55;
  min-height: 190px;
  outline: none;
  overflow-wrap: anywhere;
  padding: 14px;
}

.rich-text-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 108, 91, 0.12);
}

.rich-text-editor p:last-child,
.rich-text-editor ul:last-child,
.rich-text-editor ol:last-child {
  margin-bottom: 0;
}

.rich-text-editor img {
  display: block;
  height: auto;
  margin: 12px 0;
  max-width: 100%;
}

.visually-hidden {
  height: 1px !important;
  margin: -1px !important;
  opacity: 0;
  overflow: hidden !important;
  padding: 0 !important;
  pointer-events: none;
  position: absolute !important;
  width: 1px !important;
}

.email-compose-footer {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 16px;
  padding-top: 16px;
}

.email-attachment-control {
  display: grid;
  gap: 10px;
  max-width: 560px;
}

.email-attachment-control .attachment-hint {
  margin: 0;
}

.email-send-button {
  min-width: 160px;
}

.email-template-dialog {
  max-height: calc(100vh - 36px);
  overflow: hidden;
  width: min(920px, calc(100vw - 28px));
}

.email-template-form {
  max-height: calc(100vh - 36px);
  overflow-x: hidden;
  overflow-y: auto;
}

.email-template-meta {
  grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1.3fr);
}

.template-body-editor {
  min-height: 280px;
}

.template-attachment-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 9px;
  padding-top: 15px;
}

.template-attachment-section .attachment-hint {
  margin: 0;
}

.template-attachment-list {
  display: grid;
  gap: 7px;
}

.attachment-empty {
  color: var(--muted);
  font-size: 13px;
}

.template-attachment-item {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
  padding: 7px 9px 7px 11px;
}

.template-attachment-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.small-icon-button {
  flex: 0 0 30px;
  min-height: 30px;
  padding: 3px;
  width: 30px;
}

.email-template-form .dialog-actions #deleteEmailTemplate {
  margin-right: auto;
}

@media (max-width: 760px) {
  .email-subsection-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .email-template-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .email-template-picker {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .email-template-tools .button,
  .email-send-button {
    width: 100%;
  }

  .email-compose-footer,
  .email-template-meta {
    grid-template-columns: 1fr;
  }

  .rich-text-toolbar select {
    flex: 1 1 180px;
    margin-left: 0;
    max-width: none;
  }

  .template-body-editor {
    min-height: 220px;
  }
}

.email-history {
  display: block;
  max-height: 390px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

.email-list-item {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  min-height: 56px;
  overflow: hidden;
}

.email-list-item + .email-list-item {
  margin-top: 12px;
}

.email-list-item.email-inbound {
  border-left-color: #2f80ed;
}

.email-list-item.email-unread {
  border-color: #8eb9e9;
  border-left-color: #2f80ed;
  box-shadow: 0 4px 16px rgba(47, 128, 237, 0.1);
}

.email-list-item.email-unread .email-message-summary {
  background: #f2f7fd !important;
}

.email-unread-label {
  background: #dcecff;
  border-radius: 999px;
  color: #1d5d9f;
  font-size: 10px;
  font-weight: 900;
  padding: 4px 7px;
  text-transform: uppercase;
}

.email-message-summary {
  align-items: center;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto 30px;
  min-height: 56px;
  padding: 12px 14px;
  width: 100%;
}

.email-message-summary:hover {
  background: #f7faf8 !important;
}

.email-message-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.email-message-subject {
  color: var(--ink);
  display: block;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}

.email-message-title-area {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.email-message-title-area .email-message-subject {
  min-width: 0;
}

.email-message-meta {
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.email-message-toggle {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  font-size: 18px;
  font-weight: 900;
  height: 28px;
  justify-content: center;
  line-height: 1;
  width: 28px;
}

.email-title-row {
  align-items: center;
  background: #fff;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: flex !important;
  gap: 14px;
  justify-content: space-between;
  line-height: 1.35;
  min-height: 54px;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
}

.email-title-row:hover {
  background: #f7faf8;
}

.email-card-summary {
  align-items: center;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: flex !important;
  gap: 14px;
  justify-content: space-between;
  line-height: 1.35;
  min-height: 54px;
  padding: 12px 14px;
}

.email-card-summary strong,
.email-card-summary span {
  color: var(--ink) !important;
  display: block !important;
}

.email-title-text {
  color: var(--ink) !important;
  display: block !important;
  flex: 1 1 auto;
  font-size: 15px !important;
  font-weight: 900 !important;
  min-width: 0;
  overflow-wrap: anywhere;
}

.email-title-meta {
  background: var(--surface-2);
  border-radius: 999px;
  color: var(--muted) !important;
  display: inline-flex !important;
  flex: 0 0 auto;
  font-size: 12px !important;
  font-weight: 900;
  padding: 4px 8px;
  white-space: nowrap;
}

.email-detail-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 14px;
}

.email-detail-panel[hidden] {
  display: none !important;
}

.email-message-body {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.email-message-html {
  background: #fff;
  border: 1px solid #edf0ed;
  border-radius: 8px;
  padding: 16px;
  white-space: normal;
}

.email-message-html > :first-child {
  margin-top: 0;
}

.email-message-html > :last-child {
  margin-bottom: 0;
}

.email-message-html p,
.email-message-html div,
.email-message-html blockquote,
.email-message-html pre,
.email-message-html ul,
.email-message-html ol,
.email-message-html table {
  margin-bottom: 12px;
  margin-top: 0;
}

.email-message-html ul,
.email-message-html ol {
  list-style-position: outside;
  padding-left: 28px;
}

.email-message-html li + li {
  margin-top: 4px;
}

.email-message-html blockquote {
  border-left: 3px solid var(--line);
  color: inherit;
  margin-left: 0;
  padding-left: 14px;
}

.email-message-html a {
  color: #1268b3;
  text-decoration: underline;
}

.email-message-html table {
  border-collapse: collapse;
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.email-message-html td,
.email-message-html th {
  border: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
}

.email-message-html img {
  border-radius: 6px;
  cursor: zoom-in;
  display: block;
  height: auto;
  margin: 10px 0;
  max-height: 520px;
  max-width: 100%;
  object-fit: contain;
}

.email-inline-image-loading {
  background: #f1f4f2;
  min-height: 120px;
  min-width: min(320px, 100%);
}

.email-inline-image-unavailable {
  background: #f6f8f6;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: block;
  font-size: 12px;
  padding: 12px;
}

.email-attachment-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.email-attachment-heading {
  color: var(--ink);
  font-size: 13px;
}

.email-attachment-gallery {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 260px));
}

.email-attachment-image {
  background: #f6f8f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  overflow: hidden;
}

.email-attachment-image img {
  background: #eef2ef;
  cursor: zoom-in;
  display: block;
  height: 170px;
  object-fit: contain;
  width: 100%;
}

.email-attachment-image figcaption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
  padding: 9px 10px;
}

.email-attachment-file {
  background: #f6f8f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  min-height: 48px;
  overflow-wrap: anywhere;
  padding: 9px 11px;
  text-align: left;
}

.email-attachment-file:not(:disabled):hover {
  background: #eaf6f1;
  border-color: #9fc9bf;
}

.email-attachment-file.unavailable {
  color: var(--muted);
  cursor: default;
}

.email-image-dialog {
  background: #111714;
  height: calc(100vh - 32px);
  max-height: none;
  max-width: none;
  width: calc(100vw - 32px);
}

.email-image-dialog-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  padding: 14px;
}

.email-image-dialog .dialog-head {
  color: #fff;
  margin-bottom: 12px;
}

.email-image-dialog .dialog-head h2 {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.email-image-dialog .icon-button {
  background: #fff;
}

.email-image-dialog img {
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  place-self: center;
  width: 100%;
}

.email-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  overflow: hidden;
}

.email-card.email-inbound {
  border-left: 4px solid #2f80ed;
}

.email-card.email-outbound {
  border-left: 4px solid var(--accent);
}

.email-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.email-card-toggle {
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: center;
  line-height: 1.35;
  min-height: 58px;
  padding: 14px;
  text-align: left;
  width: 100%;
}

.email-card-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.email-card-toggle::after {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  content: "+";
  display: grid;
  font-weight: 900;
  height: 28px;
  place-items: center;
  width: 28px;
}

.email-card.expanded .email-card-toggle {
  border-bottom: 1px solid var(--line);
}

.email-card.expanded .email-card-toggle::after {
  content: "-";
}

.email-card-head strong,
.email-card-head span,
.email-card-toggle strong,
.email-card-toggle span {
  display: block;
}

.email-card-toggle strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.email-card-head span,
.email-card-toggle span,
.email-mailbox,
.email-partner {
  color: var(--muted);
  font-size: 13px;
}

.email-card-content {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.email-card-content[hidden] {
  display: none;
}

.email-mailbox,
.email-partner {
  margin: 0;
  font-weight: 800;
}

.email-body {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.email-error {
  color: #8d2d1f;
  font-size: 13px;
  font-weight: 800;
  margin: 0;
}

.email-warning {
  color: #8a5a00;
  font-size: 13px;
  font-weight: 800;
  margin: 0;
}

.email-attachments {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
}

.bulk-email-dialog {
  max-width: 860px;
}

.bulk-email-summary {
  background: #f6f8f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 12px;
}

.attachment-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  margin: -6px 0 0;
  overflow-wrap: anywhere;
}

.client-history-toolbar {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(170px, 220px) minmax(260px, 380px) minmax(180px, 240px) minmax(260px, 1fr);
  margin: 16px 0;
  padding: 16px;
}

.history-client-field {
  width: 100%;
}

.client-history-context {
  border-left: 3px solid var(--accent);
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 5px 0 5px 16px;
}

.client-history-context span,
.client-history-context small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.client-history-context strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.client-history-shell {
  padding-bottom: 0;
}

.client-history-table {
  border-collapse: collapse;
  min-width: 850px;
  width: 100%;
}

.client-history-table th,
.client-history-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
}

.client-history-table th {
  background: #f6f8f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.client-history-table th:first-child {
  width: 170px;
}

.client-history-table th:nth-child(2) {
  width: 230px;
}

.client-history-table th:nth-child(3) {
  width: 190px;
}

.client-history-table th:last-child {
  width: 210px;
}

.client-history-table tbody tr:last-child td {
  border-bottom: 0;
}

.client-history-table tbody tr:hover td {
  background: #f8fbf9;
}

.history-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.history-description {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.history-client-name {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.history-event {
  background: #edf1ef;
  border-radius: 6px;
  color: #46544e;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
  padding: 6px 8px;
}

.history-event-call {
  background: #e7f1ff;
  color: #205da8;
}

.history-event-status {
  background: #fff2cf;
  color: #74520b;
}

.history-event-email {
  background: #e7f5f0;
  color: #176b5a;
}

.history-event-meeting {
  background: #f0ebff;
  color: #5b3e91;
}

.history-event-created {
  background: #e9f4ea;
  color: #366d3b;
}

.history-actor {
  color: var(--ink);
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.history-actor.system {
  color: var(--muted);
}

.history-row.system-entry td:first-child {
  box-shadow: inset 3px 0 0 #9ca9a3;
}

.history-empty-row td {
  color: var(--muted);
  font-size: 14px;
  padding: 36px 18px;
  text-align: center;
}

.employee-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 260px));
  gap: 12px;
  margin-bottom: 16px;
}

.employee-summary > div {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
}

.employee-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.employee-summary strong {
  font-size: 24px;
}

.employee-table-shell {
  overflow-x: auto;
}

.employee-table {
  border-collapse: collapse;
  min-width: 1080px;
  width: 100%;
}

.employee-table th,
.employee-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

.employee-table th {
  background: #f6f8f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.employee-table tbody tr:last-child td {
  border-bottom: 0;
}

.employee-table tbody tr:hover td {
  background: #f8fbf9;
}

.employee-inactive {
  opacity: 0.68;
}

.employee-rank {
  display: inline-flex;
  min-width: 38px;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e9f4ef;
  color: var(--accent);
  font-weight: 850;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.employee-mailbox-permissions {
  display: grid;
  gap: 9px;
}

.employee-mailbox-option {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) repeat(3, minmax(130px, 1fr));
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.employee-mailbox-option.own-mailbox {
  border-color: #79b5a3;
  background: #eef8f4;
}

.employee-mailbox-option.own-mailbox .employee-mailbox-identity strong::after {
  content: " • skrzynka pracownika";
  color: var(--accent);
  font-size: 11px;
}

.employee-mailbox-identity {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.employee-mailbox-identity span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.employee-mailbox-option label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.employee-mailbox-option input {
  flex: 0 0 auto;
  width: 16px;
  min-height: 16px;
}

.employee-mailbox-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.employee-mailbox-summary {
  line-height: 1.45;
}

@media (max-width: 760px) {
  .employee-mailbox-option {
    grid-template-columns: 1fr;
  }
}

.employee-status,
.employee-access-chip {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  padding: 5px 8px;
}

.employee-status.active {
  background: #e4f4ed;
  color: #12634f;
}

.employee-status.inactive {
  background: #f0f1f0;
  color: #647069;
}

.employee-access-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 520px;
}

.employee-access-chip {
  background: #edf1ef;
  color: #405149;
}

.employee-statistics-summary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 8px;
  max-width: 520px;
}

.employee-statistics-summary span {
  color: var(--ink);
  font-weight: 800;
}

.employee-empty {
  color: var(--muted);
  padding: 36px 18px !important;
  text-align: center !important;
}

#employeeDialog {
  max-width: none;
  overflow: hidden;
  width: min(820px, calc(100vw - 28px));
}

.employee-dialog-card {
  max-height: min(820px, calc(100vh - 40px));
  max-width: none;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
}

.employee-permissions-fieldset {
  border: 0;
  margin: 20px 0 0;
  padding: 0;
}

.employee-permissions-fieldset legend {
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  margin-bottom: 10px;
}

.employee-fieldset-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: -3px 0 10px;
}

.employee-statistics-fieldset:disabled {
  opacity: 0.56;
}

.employee-permission-option.option-disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.employee-permissions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.employee-permission-option {
  align-items: flex-start;
  background: #f7f9f7;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  min-height: 78px;
  min-width: 0;
  padding: 12px;
}

.employee-permission-option:has(input:checked) {
  background: #eef7f3;
  border-color: #83b8a8;
}

.employee-permission-option input {
  flex: 0 0 auto;
  height: 18px;
  margin-top: 3px;
  min-height: 18px;
  min-width: 18px;
  padding: 0;
  width: 18px;
}

.employee-permission-option span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.employee-permission-option strong {
  font-size: 14px;
}

.employee-permission-option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 980px) {
  .email-layout {
    grid-template-columns: 1fr;
  }

  .client-history-toolbar {
    grid-template-columns: 1fr;
  }

  .lead-filter-toolbar,
  .client-filter-toolbar,
  .timeline-filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-history-context {
    border-left: 0;
    border-top: 3px solid var(--accent);
    padding: 14px 0 0;
  }
}

@media (max-width: 760px) {
  .employee-summary,
  .employee-permissions {
    grid-template-columns: 1fr;
  }

  #employeeDialog {
    width: calc(100vw - 16px);
  }

  .employee-dialog-card {
    max-height: calc(100vh - 16px);
    padding: 16px;
    width: 100%;
  }

  .email-conversation-panel,
  .email-compose-footer {
    grid-template-columns: 1fr;
  }

  .email-panel-heading {
    grid-column: auto;
  }

  .email-composer-panel {
    padding: 14px;
  }

  .email-send-button {
    width: 100%;
  }

  .email-message-summary {
    grid-template-columns: minmax(0, 1fr) 30px !important;
  }

  .email-message-meta {
    grid-column: 1;
    grid-row: 2;
    white-space: normal !important;
  }

  .email-message-toggle {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .fullscreen-dialog {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .client-edit-dialog {
    padding: 16px;
  }

  .client-edit-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .full-row {
    grid-column: auto;
  }

  .client-history-toolbar {
    padding: 14px;
  }

  .lead-filter-toolbar,
  .client-filter-toolbar,
  .timeline-filter-panel {
    grid-template-columns: 1fr;
  }

  .filter-clear-button {
    width: 100%;
  }

  .timeline-filter-panel .button {
    width: 100%;
  }
}

.dashboard-heading {
  align-items: end;
}

.dashboard-day-controls,
.dashboard-analysis-filters {
  align-items: end;
  display: grid;
  gap: 10px;
}

.dashboard-day-controls {
  grid-template-columns: minmax(170px, 220px) auto;
}

.dashboard-analysis-filters {
  grid-template-columns: minmax(190px, 250px) minmax(145px, 180px) minmax(145px, 180px) auto;
}

.dashboard-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.dashboard-summary article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 15px;
}

.dashboard-summary span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.dashboard-summary strong {
  display: block;
  font-size: 28px;
  margin-top: 6px;
}

.dashboard-chart-grid,
.dashboard-detail-grid {
  display: grid;
  gap: 14px;
}

.dashboard-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-detail-grid {
  grid-template-columns: minmax(320px, 0.7fr) minmax(560px, 1.3fr);
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 16px;
}

.dashboard-card-head {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dashboard-card-head h3,
.dashboard-analysis-head h3 {
  font-size: 19px;
  margin-bottom: 0;
}

.dashboard-card-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: right;
}

.dashboard-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-bottom: 12px;
}

.dashboard-legend-item {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  gap: 6px;
}

.dashboard-legend-item i {
  border-radius: 2px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.dashboard-chart-scroll {
  overflow-x: auto;
  padding: 16px 2px 4px;
}

.dashboard-hourly-plot {
  align-items: end;
  background-image: linear-gradient(to top, rgba(220, 227, 220, 0.65) 1px, transparent 1px);
  background-size: 100% 25%;
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 225px;
  min-width: 980px;
}

.dashboard-hour-column {
  display: grid;
  flex: 1 0 40px;
  grid-template-rows: 190px 24px;
  height: 214px;
  min-width: 40px;
}

.dashboard-hour-bars {
  align-items: end;
  display: flex;
  gap: 2px;
  justify-content: center;
  padding: 0 2px;
}

.dashboard-hour-bar {
  border-radius: 3px 3px 0 0;
  flex: 1 1 0;
  max-width: 16px;
  min-width: 4px;
  opacity: 0.92;
  position: relative;
  transition: filter 120ms ease;
}

.dashboard-hour-bar.has-value:hover {
  filter: brightness(1.12);
}

.dashboard-hour-bar span {
  color: var(--ink);
  font-size: 9px;
  font-weight: 850;
  left: 50%;
  position: absolute;
  top: -15px;
  transform: translateX(-50%);
}

.dashboard-hour-label {
  align-self: end;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

.dashboard-analysis-head {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 24px 0 14px;
}

.dashboard-status-chart {
  display: grid;
  gap: 11px;
}

.dashboard-status-row {
  align-items: center;
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(110px, 0.9fr) minmax(100px, 1.3fr) 34px;
}

.dashboard-status-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-status-row strong {
  font-size: 13px;
  text-align: right;
}

.dashboard-status-track {
  background: #e8eeea;
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}

.dashboard-status-track i {
  background: linear-gradient(90deg, var(--accent), #43a087);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.dashboard-call-card {
  overflow: hidden;
}

.dashboard-call-table-shell {
  max-height: 520px;
  overflow: auto;
}

.dashboard-call-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1050px;
  width: 100%;
}

.dashboard-call-table th,
.dashboard-call-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

.dashboard-call-table th {
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  position: sticky;
  text-transform: uppercase;
  top: 0;
  z-index: 1;
}

.dashboard-call-table td {
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-call-table td strong,
.dashboard-call-table td span {
  display: block;
}

.dashboard-call-table td span:not(.pill) {
  color: var(--muted);
  margin-top: 3px;
}

.dashboard-call-table a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.dashboard-note-cell {
  max-width: 270px;
  min-width: 190px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.dashboard-call-empty {
  color: var(--muted);
  padding: 34px 16px !important;
  text-align: center !important;
}

@media (max-width: 1250px) {
  .dashboard-chart-grid,
  .dashboard-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .dashboard-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-analysis-head {
    align-items: stretch;
    display: grid;
  }

  .dashboard-analysis-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .dashboard-heading,
  .dashboard-card-head {
    align-items: stretch;
    display: grid;
  }

  .dashboard-day-controls,
  .dashboard-analysis-filters,
  .dashboard-summary {
    grid-template-columns: 1fr;
  }

  .dashboard-card-hint {
    text-align: left;
  }

  .dashboard-status-row {
    grid-template-columns: minmax(90px, 0.8fr) minmax(90px, 1.2fr) 28px;
  }
}

@media (max-width: 820px) {
  .finder-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .finder-catalog-dialog,
  .finder-coverage-dialog {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .finder-coverage-toolbar {
    grid-template-columns: 1fr;
  }

  .finder-coverage-map {
    height: min(52vh, 460px);
    min-height: 300px;
  }
}

@media (max-width: 540px) {
  .finder-modal {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .finder-catalog-dialog,
  .finder-coverage-dialog {
    max-height: 100vh;
  }

  .finder-coverage-map {
    height: 360px;
    min-height: 360px;
  }
}

