:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #4f5d58;
  --faint: #68756f;
  --line: #dfe5e2;
  --line-strong: #cbd4d0;
  --canvas: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --green: #1f6654;
  --green-dark: #174c40;
  --green-soft: #e8f3ef;
  --coral: #c85b43;
  --coral-soft: #fff0ec;
  --amber: #9a6616;
  --amber-soft: #fff6df;
  --sidebar: #173f35;
  --sidebar-soft: #225246;
  --sidebar-ink: #eff8f4;
  --sidebar-text: #cce0d9;
  --sidebar-muted: #8fb0a5;
  --sidebar-heading: #86aa9e;
  --sidebar-accent: #e9c46a;
  --sidebar-border: rgb(255 255 255 / 10%);
  --sidebar-wash: rgb(255 255 255 / 4%);
  --focus-ring: rgb(31 102 84 / 24%);
  font-family: "IBM Plex Sans", "Aptos", "Segoe UI", sans-serif;
  font-size: 15px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

.crm-app.palette-sapphire {
  --ink: #17232a;
  --muted: #52636b;
  --faint: #6d7d84;
  --line: #dbe5e8;
  --line-strong: #c4d3d8;
  --canvas: #f1f6f7;
  --surface-soft: #f6fafb;
  --green: #19708b;
  --green-dark: #15566b;
  --green-soft: #e4f2f6;
  --sidebar: #163d49;
  --sidebar-soft: #205463;
  --focus-ring: rgb(25 112 139 / 24%);
}

.crm-app.palette-ruby {
  --ink: #281b1d;
  --muted: #6b5357;
  --faint: #826b6f;
  --line: #eadcdf;
  --line-strong: #d8c3c8;
  --canvas: #f8f2f3;
  --surface-soft: #fcf8f8;
  --green: #a32943;
  --green-dark: #7e1f34;
  --green-soft: #f8e7eb;
  --sidebar: #501d29;
  --sidebar-soft: #6a2838;
  --focus-ring: rgb(163 41 67 / 24%);
}

.crm-app.palette-pearl {
  --ink: #29272b;
  --muted: #656168;
  --faint: #7d7880;
  --line: #e5e0e5;
  --line-strong: #d2cbd2;
  --canvas: #f6f4f6;
  --surface-soft: #fbfafb;
  --green: #786477;
  --green-dark: #5c4c5b;
  --green-soft: #f0eaef;
  --sidebar: #4c454d;
  --sidebar-soft: #625863;
  --focus-ring: rgb(120 100 119 / 24%);
}

.crm-app.palette-moonstone {
  --ink: #202b33;
  --muted: #566672;
  --faint: #6e7c86;
  --line: #dbe2e6;
  --line-strong: #c5d1d7;
  --canvas: #eef2f4;
  --surface: #ffffff;
  --surface-soft: #f7f9fa;
  --green: #36747a;
  --green-dark: #28595e;
  --green-soft: #e2eff0;
  --coral: #a44f5f;
  --coral-soft: #f8e8eb;
  --sidebar: #344956;
  --sidebar-soft: #425f6c;
  --sidebar-muted: #a5c1c4;
  --sidebar-heading: #a5c1c4;
  --focus-ring: rgb(54 116 122 / 24%);
}

.crm-app.palette-onyx {
  --ink: #202524;
  --muted: #59615f;
  --faint: #717a77;
  --line: #dfe3e1;
  --line-strong: #cbd1ce;
  --canvas: #f3f4f3;
  --surface-soft: #f8f9f8;
  --green: #4f6f68;
  --green-dark: #39534e;
  --green-soft: #e9efed;
  --sidebar: #29302e;
  --sidebar-soft: #3a4542;
  --focus-ring: rgb(79 111 104 / 24%);
}

.crm-app.palette-citrine {
  --ink: #2e2922;
  --muted: #655d52;
  --faint: #7b7164;
  --line: #e5ddd1;
  --line-strong: #d3c5b2;
  --canvas: #f5f2ec;
  --surface: #ffffff;
  --surface-soft: #faf7f2;
  --green: #b1661d;
  --green-dark: #81470f;
  --green-soft: #f7ead8;
  --coral: #a64e45;
  --coral-soft: #f8e8e4;
  --sidebar: #493a2d;
  --sidebar-soft: #604b38;
  --sidebar-text: #eadfd0;
  --sidebar-muted: #c9b79f;
  --sidebar-heading: #d6c2a8;
  --sidebar-accent: #e3a83b;
  --focus-ring: rgb(177 102 29 / 24%);
}

.crm-app.palette-amethyst {
  --ink: #29242e;
  --muted: #62596a;
  --faint: #796f80;
  --line: #e2dce6;
  --line-strong: #cec3d5;
  --canvas: #f3f1f5;
  --surface: #ffffff;
  --surface-soft: #faf8fb;
  --green: #735b86;
  --green-dark: #554363;
  --green-soft: #eee8f2;
  --coral: #a85068;
  --coral-soft: #f7e7ec;
  --sidebar: #403548;
  --sidebar-soft: #55445f;
  --sidebar-text: #dfd3e5;
  --sidebar-muted: #bdaac7;
  --sidebar-heading: #c9b5d3;
  --sidebar-accent: #d6a85b;
  --focus-ring: rgb(115 91 134 / 24%);
}

.crm-app.palette-obsidian {
  --ink: #1e2322;
  --muted: #59625f;
  --faint: #717b77;
  --line: #d9dfdc;
  --line-strong: #c5ceca;
  --canvas: #e9edeb;
  --surface: #fbfcfb;
  --surface-soft: #f3f5f4;
  --green: #416b61;
  --green-dark: #2d5148;
  --green-soft: #e2ece8;
  --coral: #9b4f4b;
  --coral-soft: #f5e7e5;
  --sidebar: #151918;
  --sidebar-soft: #252b29;
  --sidebar-text: #d6dfdb;
  --sidebar-muted: #9eada7;
  --sidebar-heading: #acbbb5;
  --sidebar-accent: #d5a84f;
  --focus-ring: rgb(65 107 97 / 26%);
}

.crm-app.dark-mode {
  color-scheme: dark;
  --ink: #edf2f0;
  --muted: #b0bbb6;
  --faint: #8e9b95;
  --line: #35413c;
  --line-strong: #48564f;
  --canvas: #151a18;
  --surface: #202724;
  --surface-soft: #27302c;
  --green-dark: color-mix(in srgb, var(--green) 52%, white);
  --green-soft: color-mix(in srgb, var(--green) 22%, var(--surface));
  --coral: #e08372;
  --coral-soft: #412925;
  --amber: #e0ad55;
  --amber-soft: #3b3020;
  color: var(--ink);
}

.crm-app.dark-mode .topbar {
  background: rgb(32 39 36 / 95%);
}

.crm-app.dark-mode input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.crm-app.dark-mode select,
.crm-app.dark-mode textarea {
  color: var(--ink);
  background: var(--surface);
}

.crm-app.dark-mode + .site-footer {
  border-color: #35413c;
  background: #151a18;
  color: #b0bbb6;
}

.crm-app.dark-mode + .site-footer a {
  color: #8bc4b8;
}

.initiative-panel {
  display: grid;
  gap: 16px;
}

.initiative-catalog {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.initiative-catalog > button {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.initiative-catalog > button.selected {
  background: var(--green-soft);
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.initiative-catalog span,
.initiative-active p,
.initiative-history span {
  color: var(--muted);
}

.initiative-catalog small,
.initiative-active small,
.initiative-history small,
.initiative-waiting {
  color: var(--faint);
}

.initiative-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.initiative-active h3,
.initiative-active p {
  margin: 5px 0;
}

.initiative-progress,
.initiative-decisions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.initiative-progress span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.initiative-progress span.current {
  color: var(--green);
  border-color: var(--green);
}

.initiative-progress span.complete {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.initiative-decisions,
.initiative-waiting {
  grid-column: 1 / -1;
}

.initiative-history {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.initiative-history > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.5fr) 1fr auto;
  gap: 12px;
}

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

@media (max-width: 600px) {
  .initiative-catalog,
  .initiative-active {
    grid-template-columns: 1fr;
  }

  .initiative-history > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

* {
  box-sizing: border-box;
}

button,
[role="button"],
tbody tr {
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

.site-shell {
  min-height: 100vh;
  background: var(--canvas);
}

.site-footer {
  max-width: 88rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.crm-app + .site-footer {
  width: calc(100% - 268px);
  max-width: none;
  box-sizing: border-box;
  margin-left: 268px;
}

.prologue-screen + .site-footer {
  width: 100%;
  margin-left: 0;
}

.site-footer p {
  margin: 0.5rem 0;
}

.site-footer a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px dotted var(--muted);
}

.site-footer a:hover {
  color: var(--green-dark);
  border-bottom-color: var(--green-dark);
}

.site-footer .donate-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.site-footer a.donate {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border: 0;
  border-radius: 0.5rem;
  background: #f7931a;
  box-shadow: 0 2px 6px rgb(0 0 0 / 20%);
  color: #000;
  font-weight: 700;
}

.site-footer a.donate:hover {
  border: 0;
  background: #e0830f;
  color: #000;
}

.crm-app.dark-mode + .site-footer a.donate,
.crm-app.dark-mode + .site-footer a.donate:hover {
  color: #000;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
label:focus-within {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
}

.spin {
  animation: spin 900ms linear infinite;
}

.crm-app {
  min-height: 100vh;
  background: var(--canvas);
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: 268px;
  flex-direction: column;
  padding: 0 13px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--sidebar);
  color: var(--sidebar-ink);
}

.nav-scrim,
.lead-detail-scrim,
.mobile-contact-actions,
.mobile-save-state,
.mobile-topbar-overflow {
  display: none;
}

.brand {
  display: flex;
  min-height: 74px;
  align-items: center;
  gap: 11px;
  padding: 12px 7px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #173f35;
  background: var(--sidebar-accent);
  font-weight: 800;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  font-size: 13px;
}

.brand > div:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brand strong {
  overflow: hidden;
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.brand span {
  color: var(--sidebar-muted);
  font-size: 12px;
}

.sidebar nav {
  display: grid;
  gap: 3px;
  padding-top: 18px;
}

.nav-heading {
  padding: 14px 10px 6px;
  color: var(--sidebar-heading);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar nav button,
.settings-link {
  display: grid;
  width: 100%;
  min-height: 38px;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--sidebar-text);
  background: transparent;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.sidebar nav button:hover,
.sidebar nav button.active,
.settings-link:hover,
.settings-link.active {
  color: var(--sidebar-ink);
  background: var(--sidebar-soft);
}

.sidebar nav button.active {
  box-shadow: inset 3px 0 var(--sidebar-accent);
}

.sidebar nav button b {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 10px;
  color: var(--sidebar-ink);
  background: var(--sidebar-wash);
  font-size: 11px;
  text-align: center;
}

.sidebar nav button.locked {
  color: var(--sidebar-muted);
}

.sidebar nav button.tutorial-current {
  color: var(--sidebar-ink);
  background: var(--sidebar-soft);
  box-shadow:
    inset 4px 0 var(--sidebar-accent),
    0 0 0 2px rgb(233 196 106 / 55%);
  animation: tutorial-nav-pulse 1.6s ease-in-out infinite;
}

.unlock-note {
  display: flex;
  gap: 9px;
  margin: auto 5px 12px;
  padding: 11px;
  border: 1px solid var(--sidebar-border);
  border-radius: 7px;
  color: var(--sidebar-text);
  background: var(--sidebar-wash);
}

.unlock-note svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--sidebar-accent);
}

.unlock-note div {
  display: grid;
  gap: 3px;
}

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

.unlock-note span {
  color: var(--sidebar-muted);
  font-size: 11px;
  line-height: 1.4;
}

.unlock-note.unlocked {
  border-color: rgb(233 196 106 / 45%);
  background: rgb(233 196 106 / 9%);
}

.settings-link {
  grid-template-columns: 20px 1fr;
}

main {
  min-height: 100vh;
  margin-left: 268px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 58px;
  align-items: center;
  gap: 18px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 95%);
  backdrop-filter: blur(10px);
}

.search-shell {
  position: relative;
  min-width: 0;
  width: min(520px, 46vw);
}

.search {
  display: flex;
  width: 100%;
  height: 34px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--faint);
  background: var(--surface-soft);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.crm-app.dark-mode .search input {
  background: transparent;
}

.search input::placeholder {
  color: #99a49f;
}

.search > button {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.search-results {
  position: absolute;
  z-index: 50;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 16px 38px color-mix(in srgb, var(--ink) 16%, transparent);
}

.search-results button {
  display: grid;
  width: 100%;
  min-height: 62px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--green);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.search-results button:last-child {
  border-bottom: 0;
}

.search-results button:hover {
  background: var(--green-soft);
}

.search-results button span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.search-results strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-results small,
.search-empty {
  overflow: hidden;
  color: var(--muted);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-empty {
  padding: 18px;
  text-align: center;
}

.topbar-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.time-controls {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.time-controls button {
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.time-controls button:last-child {
  border-right: 0;
}

.time-controls button.active {
  color: var(--green-dark);
  background: var(--green-soft);
}

.save-state,
.game-clock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.save-state.error {
  color: var(--coral);
}

.save-state.saving svg {
  animation: spin 1s linear infinite;
}

.save-state > span {
  display: grid;
  line-height: 1.05;
}

.save-state small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 500;
}

.guidance-card {
  display: grid;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--green) 28%, var(--line));
  border-radius: 14px;
  margin-bottom: 18px;
  background: linear-gradient(115deg, var(--green-soft), var(--surface) 62%);
  box-shadow: 0 10px 24px rgb(23 63 53 / 7%);
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.guidance-card.compact {
  padding: 14px 16px;
}

.guidance-icon {
  display: grid;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--green-dark);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  place-items: center;
}

.guidance-card span {
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guidance-card h2 {
  margin: 3px 0 2px;
  font-size: 18px;
}

.guidance-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.guidance-card button {
  white-space: nowrap;
}

.tutorial-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--green) 42%, var(--line));
  border-radius: 7px;
  background:
    linear-gradient(110deg, var(--green-soft), var(--surface) 68%),
    var(--surface);
  box-shadow: 0 8px 24px rgb(23 63 53 / 8%);
  animation: tutorial-panel-pulse 1.8s ease-in-out infinite;
}

.tutorial-panel.important {
  border: 3px solid var(--amber);
  box-shadow:
    0 0 0 5px rgb(233 196 106 / 24%),
    0 16px 38px rgb(116 85 29 / 18%);
}

.tutorial-progress {
  display: grid;
  gap: 7px;
}

.tutorial-progress > span {
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tutorial-progress > div {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: color-mix(in srgb, var(--green) 15%, var(--surface));
}

.tutorial-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease-out;
}

.tutorial-content {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.tutorial-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--green-dark);
  background: var(--surface);
}

.tutorial-content h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.tutorial-important {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--amber) 52%, var(--line));
  border-radius: 5px;
  color: #74551d;
  background: var(--amber-soft);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dark-mode .tutorial-important {
  color: #f0d49b;
}

.tutorial-content p {
  max-width: 78ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tutorial-content small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
}

.tutorial-content > button {
  white-space: nowrap;
}

.tutorial-next-action {
  outline: 4px solid rgb(233 196 106 / 34%);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px var(--amber), 0 8px 20px rgb(23 63 53 / 22%);
  animation: tutorial-action-pulse 1.15s ease-in-out infinite;
}

.tutorial-next-action svg {
  animation: tutorial-arrow-nudge 700ms ease-in-out infinite alternate;
}

@keyframes tutorial-panel-pulse {
  0%,
  100% {
    box-shadow: 0 8px 24px rgb(23 63 53 / 8%);
  }
  50% {
    box-shadow: 0 0 0 5px rgb(233 196 106 / 20%), 0 12px 32px rgb(23 63 53 /
      18%);
  }
}

@keyframes tutorial-action-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

@keyframes tutorial-arrow-nudge {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(4px);
  }
}

@keyframes tutorial-nav-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.28);
  }
}

.tutorial-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
  border-top: 1px solid color-mix(in srgb, var(--green) 18%, var(--line));
}

.tutorial-skip {
  min-height: 36px;
  margin-top: 10px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  font-weight: 750;
}

.record-open-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green-dark);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.record-open-button:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.mobile-actions-cell {
  width: 1%;
  white-space: nowrap;
}

.game-clock {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.avatar {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
}

.topbar-popover {
  position: relative;
  display: grid;
  place-items: center;
}

.popover {
  position: absolute;
  z-index: 50;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgb(23 32 29 / 16%);
}

.popover > strong,
.popover > span {
  display: block;
  padding: 13px 15px;
}

.popover > strong {
  border-bottom: 1px solid var(--line);
  font-size: 17px;
}

.popover > span {
  color: var(--muted);
  font-size: 15px;
}

.popover button {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}

.popover button:last-child {
  border-bottom: 0;
}

.popover button:hover {
  background: var(--green-soft);
}

.popover button small {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.company-menu {
  width: 260px;
}

.company-menu > strong {
  padding-bottom: 4px;
  border-bottom: 0;
}

.company-menu > span {
  padding-top: 0;
}

.company-menu button {
  justify-content: flex-start;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface-soft);
}

.icon-button i {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border: 1px solid white;
  border-radius: 50%;
  background: var(--coral);
}

.workspace {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 29px 30px 60px;
}

.page-heading {
  display: flex;
  min-height: 72px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.page-heading span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
}

.page-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.primary,
.secondary,
.danger-button,
.text-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.primary {
  border: 1px solid var(--green);
  color: white;
  background: var(--green);
  box-shadow: 0 3px 8px rgb(31 102 84 / 15%);
}

.primary:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.primary:disabled {
  border-color: var(--line-strong);
  color: var(--faint);
  background: #e7ece9;
  box-shadow: none;
}

.dark-mode .primary:disabled {
  background: var(--surface-soft);
}

.secondary {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--surface);
}

.secondary:hover {
  border-color: #aebbb5;
  background: var(--surface-soft);
}

.danger-button {
  border: 1px solid #d98775;
  color: #9a3926;
  background: var(--coral-soft);
}

.text-button {
  min-height: auto;
  padding: 4px;
  border: 0;
  color: var(--green);
  background: transparent;
}

.full {
  width: 100%;
}

.view-actions,
.settings-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.secondary.active {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
}

.filter-bar {
  display: flex;
  min-height: 70px;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgb(23 32 29 / 3%);
}

.filter-bar label {
  display: grid;
  min-width: 190px;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.filter-bar label > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-bar select {
  height: 40px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  font-size: 17px;
}

.filter-bar .text-button {
  min-height: 40px;
}

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

.kpi {
  display: flex;
  min-height: 108px;
  align-items: flex-start;
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgb(23 32 29 / 3%);
}

.kpi-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: #53625c;
  background: #edf1ef;
}

.dark-mode .kpi-icon {
  color: var(--muted);
  background: var(--surface-soft);
}

.kpi-icon.positive {
  color: var(--green);
  background: var(--green-soft);
}

.kpi-icon.warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.kpi > div:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.kpi span,
.kpi small {
  color: var(--muted);
  font-size: 12px;
}

.kpi strong {
  overflow: hidden;
  font-size: 21px;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgb(23 32 29 / 3%);
}

.panel-heading,
.table-toolbar {
  display: flex;
  min-height: 59px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.settings-panel h2 {
  margin: 0;
  font-size: 15px;
}

.panel-heading span,
.table-toolbar span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.task-list,
.activity-list {
  display: grid;
}

.task-row {
  display: grid;
  min-height: 60px;
  grid-template-columns: 27px minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: 10px;
  padding: 10px 13px 10px 17px;
  border-bottom: 1px solid #edf0ee;
}

.task-row:last-child {
  border-bottom: 0;
}

.task-row > div {
  display: grid;
  gap: 2px;
}

.task-row strong {
  font-size: 13px;
}

.task-row span,
.task-row time {
  color: var(--muted);
  font-size: 12px;
}

.task-row time.overdue {
  color: var(--coral);
  font-weight: 700;
}

.task-check {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: transparent;
  background: var(--surface);
  cursor: pointer;
}

.task-check:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.activity-list {
  padding: 8px 17px 15px;
}

.activity-list > div {
  position: relative;
  display: grid;
  min-height: 50px;
  grid-template-columns: 13px minmax(0, 1fr);
  gap: 10px;
  padding-top: 11px;
}

.activity-list > div::before {
  position: absolute;
  top: 23px;
  bottom: -10px;
  left: 4px;
  width: 1px;
  content: "";
  background: var(--line);
}

.activity-list > div:last-child::before {
  display: none;
}

.activity-list i {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.activity-list span {
  display: grid;
  gap: 3px;
}

.activity-list strong {
  font-size: 13px;
  font-weight: 600;
}

.activity-list small {
  color: var(--faint);
  font-size: 11px;
}

.record-layout {
  display: grid;
  grid-template-columns: minmax(540px, 1fr) minmax(330px, 420px);
  align-items: start;
  gap: 14px;
}

.record-layout.single-panel {
  grid-template-columns: minmax(0, 1fr);
}

.table-panel {
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  height: 37px;
  padding: 8px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

td {
  min-width: 86px;
  height: 62px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
}

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

tbody tr:hover td,
tbody tr.selected td {
  background: var(--surface-soft);
}

tbody tr.selected td:first-child {
  box-shadow: inset 3px 0 var(--green);
}

.lead-table tbody tr:hover td,
.lead-table tbody tr.selected td,
.contacts-table tbody tr:hover td,
.contacts-table tbody tr.selected td {
  background: transparent;
}

td strong,
td small {
  display: block;
}

td strong {
  margin-bottom: 3px;
  color: var(--ink);
}

td small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 10px;
  color: #4c5a55;
  background: #edf1ef;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status.new,
.status.qualified {
  color: #245d91;
  background: #e9f3fb;
}

.status.contacted,
.status.discovery,
.status.evaluation,
.status.negotiation {
  color: #805510;
  background: var(--amber-soft);
}

.status.converted,
.status.won {
  color: var(--green);
  background: var(--green-soft);
}

.dark-mode .status {
  color: var(--muted);
  background: var(--surface-soft);
}

.dark-mode .status.new,
.dark-mode .status.qualified {
  color: #a9cff1;
  background: #25394a;
}

.dark-mode .status.contacted,
.dark-mode .status.discovery,
.dark-mode .status.evaluation,
.dark-mode .status.negotiation,
.dark-mode .status.paused {
  color: #f0d49b;
  background: var(--amber-soft);
}

.dark-mode .status.converted,
.dark-mode .status.won,
.dark-mode .status.active {
  color: var(--green-dark);
  background: var(--green-soft);
}

.dark-mode .status.disqualified,
.dark-mode .status.lost,
.dark-mode .status.cold {
  color: #efb3a7;
  background: var(--coral-soft);
}

.status.disqualified,
.status.lost,
.status.cold {
  color: #7f5147;
  background: #f7eae7;
}

.score {
  color: var(--green);
  font-size: 12px;
}

.meter,
.deal-progress {
  width: 72px;
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: #e6ebe8;
}

.meter i,
.deal-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.record-detail {
  position: sticky;
  top: 74px;
  overflow: hidden;
}

.detail-heading {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 32px;
  align-items: start;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-heading.company-heading {
  grid-template-columns: 46px minmax(0, 1fr);
}

.contact-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 7px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 13px;
  font-weight: 800;
}

.detail-heading span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-heading h2 {
  margin: 3px 0;
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
}

.detail-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.quick-actions button {
  display: grid;
  min-height: 59px;
  place-items: center;
  gap: 3px;
  padding: 8px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--green);
  background: var(--surface);
  cursor: pointer;
}

.quick-actions button:last-child {
  border-right: 0;
}

.quick-actions button:hover {
  background: var(--green-soft);
}

.dark-mode .quick-actions button {
  color: var(--green-dark);
}

.quick-actions span {
  font-size: 12px;
  font-weight: 700;
}

.record-section {
  padding: 16px 18px;
}

.record-section h3 {
  margin: 0 0 13px;
  font-size: 13px;
}

.record-section dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin: 0;
}

.record-section dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.record-section dd {
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.record-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.related-records {
  padding: 0 18px 18px;
}

.related-records h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.related-records > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 17px;
}

.related-records small {
  color: var(--muted);
  font-size: 15px;
  text-align: right;
}

.marketing-layout {
  display: grid;
  max-width: 1040px;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: start;
  gap: 16px;
}

.campaign-summary {
  display: grid;
  max-width: 1040px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.campaign-summary > div {
  display: grid;
  gap: 4px;
  padding: 15px 17px;
  background: var(--surface);
}

.campaign-summary span,
.campaign-list dt {
  color: var(--muted);
  font-size: 14px;
}

.campaign-summary strong {
  font-size: 22px;
}

.campaign-builder {
  padding: 20px;
}

.campaign-builder form {
  display: grid;
  gap: 14px;
}

.campaign-builder label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.campaign-builder input,
.campaign-builder select,
.campaign-builder textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.campaign-builder input,
.campaign-builder select {
  height: 42px;
  padding: 0 11px;
}

.campaign-builder textarea {
  min-height: 88px;
  padding: 10px 11px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.campaign-list-panel {
  grid-column: 1 / -1;
}

.campaign-list {
  display: grid;
}

.campaign-list > div {
  display: grid;
  min-height: 76px;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, auto) auto auto;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.campaign-list > div > span:first-child {
  display: grid;
  gap: 3px;
}

.campaign-list strong {
  font-size: 17px;
}

.campaign-list small {
  color: var(--muted);
  font-size: 14px;
}

.campaign-list dl {
  display: flex;
  gap: 22px;
  margin: 0;
}

.campaign-list dl > div {
  display: grid;
  gap: 2px;
}

.campaign-list dd {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.campaign-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.campaign-actions .secondary {
  min-width: 74px;
}

.campaign-outcome {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
}

.campaign-outcome strong {
  color: var(--text);
  font-size: 13px;
}

.campaign-report-panel {
  min-width: 0;
  grid-column: 1 / -1;
}

.campaign-report-panel .table-scroll {
  max-width: 100%;
}

.channel-report {
  min-width: 720px;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #e9eeeb;
}

.dark-mode .segmented-control {
  background: var(--surface-soft);
}

.segmented-control button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.segmented-control button.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 1px 3px rgb(23 32 29 / 15%);
}

.dark-mode .segmented-control button.active {
  background: var(--surface);
}

.pipeline-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line);
}

.pipeline-summary > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 15px 17px;
  background: var(--surface);
}

.advanced-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 20px;
}

.workflow-panel {
  margin-top: 16px;
  overflow: hidden;
}

.workflow-builder-form {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 13px;
  padding: 17px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.workflow-builder-form label {
  display: grid;
  grid-column: span 4;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.workflow-builder-form .workflow-name-field {
  grid-column: span 12;
}

.workflow-builder-form input,
.workflow-builder-form select {
  width: 100%;
  min-width: 0;
  height: 43px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.workflow-preview {
  display: flex;
  grid-column: span 9;
  min-width: 0;
  min-height: 43px;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  overflow: hidden;
  border: 1px solid #cfe0da;
  border-radius: 6px;
  background: white;
}

.workflow-preview > span {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.workflow-preview > strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-preview > svg {
  flex: 0 0 auto;
  color: var(--faint);
}

.workflow-publish {
  grid-column: span 3;
}

.workflow-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  background: #f6f8f7;
}

.workflow-card {
  display: grid;
  min-width: 0;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 1px 3px rgb(23 32 29 / 4%);
}

.workflow-card.paused {
  background: #fafbfa;
  opacity: 0.78;
}

.dark-mode .workflow-preview,
.dark-mode .workflow-card {
  border-color: var(--line-strong);
  background: var(--surface);
}

.dark-mode .workflow-list,
.dark-mode .workflow-card.paused {
  background: var(--surface-soft);
}

.workflow-card > header,
.workflow-card > header > div,
.workflow-card > footer,
.workflow-card > footer > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workflow-card > header,
.workflow-card > footer {
  justify-content: space-between;
}

.workflow-card > header strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-card > header small,
.workflow-card > footer > span {
  color: var(--muted);
  font-size: 12px;
}

.workflow-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.workflow-flow > span {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 9px;
  overflow: hidden;
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-flow small {
  color: var(--green);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.workflow-flow > svg {
  color: var(--faint);
}

.workflow-card > footer {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.workflow-remove {
  color: #8a4537;
}

.automation-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 18px;
  color: var(--muted);
}

.automation-empty > div {
  display: grid;
  gap: 3px;
}

.automation-empty strong {
  color: var(--ink);
}

.automation-empty span {
  font-size: 14px;
}

.pipeline-summary span {
  color: var(--muted);
  font-size: 14px;
}

.pipeline-summary strong {
  overflow: hidden;
  font-size: 22px;
  text-overflow: ellipsis;
}

.pipeline-table {
  min-width: 980px;
}

.pipeline-table td {
  cursor: default;
}

.pipeline-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.pipeline-advance {
  white-space: nowrap;
}

.close-risk,
.close-risk-inline {
  color: #9a432f;
  font-weight: 800;
}

.close-risk {
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid #e7b6aa;
  border-radius: 5px;
  background: var(--coral-soft);
  font-size: 13px;
  line-height: 1.4;
}

.close-risk-inline {
  align-self: center;
  white-space: nowrap;
}

.sales-team-panel {
  margin-bottom: 16px;
}

.hire-rep-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 15px 17px;
}

.quotes-panel {
  overflow: hidden;
}

.quote-builder {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.quote-builder-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 15px;
}

.quote-builder-heading > div {
  display: grid;
  gap: 2px;
}

.quote-builder-heading > div > strong {
  font-size: 17px;
}

.quote-builder-heading > div > span {
  color: var(--muted);
  font-size: 14px;
}

.quote-builder-icon,
.quote-identity > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--green);
  background: var(--green-soft);
}

.quote-builder-icon {
  width: 38px;
  height: 38px;
}

.quote-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: stretch;
  gap: 16px;
}

.quote-fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-content: start;
  gap: 13px;
}

.quote-fields label {
  display: grid;
  grid-column: span 4;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.quote-fields .quote-deal-field {
  grid-column: span 6;
}

.quote-fields .quote-plan-field {
  grid-column: span 4;
}

.quote-fields .quote-deal-field + .quote-plan-field + label {
  grid-column: span 2;
}

.quote-fields input,
.quote-fields select {
  width: 100%;
  min-width: 0;
  height: 43px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.input-suffix {
  position: relative;
}

.input-suffix input {
  padding-right: 48px;
}

.input-suffix > span {
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  transform: translateY(-50%);
}

.quote-preview {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 15px;
  border: 1px solid #b8d3c9;
  border-radius: 8px;
  background: var(--surface);
}

.dark-mode .quote-preview {
  border-color: var(--line-strong);
  background: var(--surface);
}

.quote-preview > span,
.quote-value > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quote-preview > strong {
  color: var(--green-dark);
  font-size: 28px;
  line-height: 1.05;
}

.quote-preview > strong small {
  color: var(--muted);
  font-size: 13px;
}

.quote-preview dl,
.quote-terms {
  margin: 0;
}

.quote-preview dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 3px 0 5px;
}

.quote-preview dl > div {
  display: grid;
  gap: 2px;
}

.quote-preview dt,
.quote-terms dt {
  color: var(--muted);
  font-size: 12px;
}

.quote-preview dd,
.quote-terms dd {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.quote-list {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: var(--surface-soft);
}

.quote-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(370px, 1.8fr) 145px auto;
  align-items: center;
  gap: 18px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(23 32 29 / 4%);
}

.quote-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.quote-identity > span {
  width: 36px;
  height: 36px;
}

.quote-identity > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.quote-identity strong,
.quote-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-identity strong {
  font-size: 16px;
}

.quote-identity small {
  color: var(--muted);
  font-size: 12px;
}

.quote-terms {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.quote-terms > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.quote-terms dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-value {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.quote-value > strong {
  color: var(--green-dark);
  font-size: 18px;
}

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.quote-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 18px;
  color: var(--muted);
}

.quote-empty > svg {
  color: #91a49c;
}

.quote-empty > div {
  display: grid;
  gap: 3px;
}

.quote-empty strong {
  color: var(--ink);
}

.quote-empty span {
  font-size: 14px;
}

.bulk-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bulk-actions select {
  min-width: 140px;
}

.customer-table {
  min-width: 1160px;
}

.customer-portfolio-scroll,
.support-ticket-scroll {
  max-height: min(68dvh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
}

.customer-portfolio-scroll th,
.support-ticket-scroll th {
  position: sticky;
  z-index: 1;
  top: 0;
}

.customer-table td:first-child span,
.customer-table td:first-child small {
  display: block;
}

.health-meter {
  width: 92px;
  height: 7px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.health-meter span {
  display: block;
  height: 100%;
  background: var(--green);
}

.status.at_risk {
  color: var(--coral);
  background: var(--coral-soft);
}

.customer-actions {
  display: flex;
  min-width: max-content;
  gap: 7px;
  justify-content: flex-end;
}

.success-hire-form,
.support-hire-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 15px 17px;
}

.success-hire-form label,
.support-hire-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.success-hire-form input,
.success-hire-form select,
.support-hire-form input,
.support-hire-form select,
.operations-manager-form input,
.operations-manager-form select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.operations-manager-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.7fr) auto;
  gap: 12px;
  align-items: end;
  padding: 15px 17px;
}

.operations-manager-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.operations-manager-list {
  display: grid;
  margin: 0 17px;
  border-top: 1px solid var(--line);
}

.operations-manager-list > div {
  display: grid;
  grid-template-columns:
    42px minmax(150px, 1.2fr) minmax(80px, 0.5fr)
    minmax(110px, 0.7fr) minmax(190px, 1.5fr) 36px;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.operations-manager-identity,
.operations-manager-metric,
.operations-manager-decision {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.operations-manager-list small {
  color: var(--muted);
  font-size: 12px;
}

.operations-manager-decision strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.operations-plan-grid > div {
  display: grid;
  gap: 4px;
  padding: 17px;
  border-right: 1px solid var(--line);
}

.operations-plan-grid > div:last-child {
  border-right: 0;
}

.operations-plan-grid span,
.operations-plan-grid small,
.operations-plan-note {
  color: var(--muted);
  font-size: 12px;
}

.operations-plan-grid strong {
  font-size: 22px;
}

.operations-plan-grid b {
  width: fit-content;
  font-size: 12px;
}

.operations-plan-grid .target-met b {
  color: var(--green-dark);
}

.operations-plan-grid .target-open b {
  color: var(--coral);
}

.operations-plan-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 17px;
}

@media (max-width: 900px) {
  .operations-manager-form {
    grid-template-columns: 1fr 1fr;
  }

  .operations-manager-form button {
    grid-column: 1 / -1;
  }

  .operations-manager-list > div {
    grid-template-columns: 42px minmax(130px, 1fr) auto 36px;
  }

  .operations-manager-metric:nth-of-type(3),
  .operations-manager-decision {
    grid-column: 2 / 4;
  }
}

@media (max-width: 600px) {
  .operations-manager-form {
    grid-template-columns: 1fr;
  }

  .operations-manager-form button {
    grid-column: auto;
  }

  .operations-manager-list > div {
    grid-template-columns: 42px minmax(0, 1fr) 36px;
  }

  .operations-manager-metric,
  .operations-manager-metric:nth-of-type(3),
  .operations-manager-decision {
    grid-column: 2 / 3;
  }

  .operations-plan-panel .panel-heading,
  .operations-plan-note {
    align-items: stretch;
    flex-direction: column;
  }

  .operations-plan-grid {
    grid-template-columns: 1fr;
  }

  .operations-plan-grid > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .operations-plan-grid > div:last-child {
    border-bottom: 0;
  }
}

.success-team-list,
.support-team-list {
  display: grid;
  margin: 0 17px;
  border-top: 1px solid var(--line);
}

.success-team-list > div,
.support-team-list > div {
  display: grid;
  grid-template-columns: 42px minmax(150px, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.success-team-list > div > span:nth-child(2),
.support-team-list > div > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.success-team-list small,
.support-team-list small {
  color: var(--muted);
}

.success-team-list .overloaded,
.support-team-list .overloaded {
  color: var(--coral);
  font-weight: 700;
}

.staff-fire {
  color: var(--coral);
}

.support-panel {
  margin-bottom: 16px;
}

.support-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-block: 1px solid var(--line);
  background: var(--line);
}

.support-summary > div {
  display: grid;
  gap: 3px;
  padding: 12px 17px;
  background: var(--surface);
}

.support-summary span,
.support-table small {
  color: var(--muted);
  font-size: 13px;
}

.support-summary strong {
  font-size: 20px;
}

.support-table {
  min-width: 1080px;
}

.support-table td:first-child strong,
.support-table td:first-child small {
  display: block;
}

.ticket-priority {
  font-weight: 800;
}

.ticket-priority.high,
.ticket-priority.urgent,
.sla-breached {
  color: var(--coral);
}

.ticket-actions {
  display: flex;
  min-width: max-content;
  gap: 7px;
  justify-content: flex-end;
}

.ticket-decision-list {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.negotiation-decisions {
  margin-bottom: 16px;
  overflow: hidden;
}

.negotiation-decision-list {
  display: grid;
}

.negotiation-decision-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.28fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 16px 17px;
  border-top: 1px solid var(--line);
}

.negotiation-decision-row:first-child {
  border-top: 0;
}

.negotiation-deal-context {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding-top: 2px;
}

.negotiation-deal-context > span {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.negotiation-deal-context > strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
}

.negotiation-deal-context > small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.negotiation-decisions .decision-fork {
  padding: 0;
  border: 0;
  background: transparent;
}

.decision-record-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.decision-fork {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.decision-fork > div:first-child {
  display: grid;
  gap: 3px;
}

.decision-fork > div:first-child span,
.decision-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.decision-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.decision-option {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 10px;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.decision-option:not(:disabled):hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.decision-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ticket-decision-list {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

@media (max-width: 760px) {
  .negotiation-decision-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .decision-options {
    grid-template-columns: 1fr;
  }
}

.incident-list {
  border-top: 1px solid var(--line);
}

.incident-list > div:not(.table-toolbar) {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(150px, auto) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 17px;
  border-top: 1px solid var(--line);
}

.incident-list > div > span:first-child {
  display: grid;
  gap: 2px;
}

.incident-list small {
  color: var(--muted);
}

.hire-rep-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.hire-rep-form input,
.hire-rep-form select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.sales-team-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.sales-team-list > div {
  display: grid;
  min-height: 74px;
  grid-template-columns: 42px minmax(150px, 1fr) minmax(400px, auto) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 17px;
  border-bottom: 1px solid var(--line);
}

.sales-team-list > div:last-child {
  border-bottom: 0;
}

.rep-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 6px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 14px;
  font-weight: 800;
}

.sales-team-list > div > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.sales-team-list small,
.sales-team-list dt {
  color: var(--muted);
  font-size: 14px;
}

.sales-team-list dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 1fr));
  gap: 18px;
  margin: 0;
}

.sales-team-list dd {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 800;
}

.sales-team-list dd.overloaded {
  color: var(--coral);
}

.rep-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-cancel {
  color: var(--muted);
}

.task-cancel:hover {
  color: var(--coral);
}

.deal-editor {
  margin-bottom: 16px;
}

.deal-editor form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 15px 17px;
}

.deal-editor label,
.deal-loss-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.deal-editor input,
.deal-editor select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.deal-loss-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  padding: 13px 17px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.deal-loss-controls label {
  width: min(240px, 100%);
}

.pipeline-deals {
  scroll-margin-top: 84px;
}

.pipeline-deals:focus {
  outline: none;
}

.acquisition-tool {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 18px;
  padding: 24px;
}

.acquisition-icon {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border-radius: 7px;
  color: var(--green-dark);
  background: var(--green-soft);
}

.acquisition-tool > div:nth-child(2) > span {
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.acquisition-tool h2 {
  margin: 4px 0 8px;
  font-size: 23px;
}

.acquisition-tool p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.acquisition-tool dl {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 4px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
}

.acquisition-tool dl > div {
  padding: 13px;
  background: var(--surface-soft);
}

.acquisition-tool dt {
  color: var(--muted);
  font-size: 14px;
}

.acquisition-tool dd {
  margin: 5px 0 0;
  font-size: 19px;
  font-weight: 800;
}

.acquisition-tool > button {
  grid-column: 1 / -1;
  min-height: 44px;
}

.acquisition-tool > .blocked-reason {
  grid-column: 1 / -1;
}

.referral-list {
  display: grid;
}

.referral-list button {
  display: grid;
  min-height: 68px;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: white;
  text-align: left;
  cursor: pointer;
}

.referral-list button:hover {
  background: var(--green-soft);
}

.referral-list span {
  display: grid;
  gap: 3px;
}

.referral-list strong {
  color: var(--ink);
  font-size: 17px;
}

.referral-list small {
  color: var(--muted);
  font-size: 15px;
}

.referral-list b {
  color: var(--green);
  font-size: 15px;
}

.deal-card {
  display: grid;
  gap: 10px;
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid #bbd4cb;
  border-radius: 7px;
  background: var(--green-soft);
}

.deal-card > div:first-child,
.deal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.deal-card span {
  color: var(--muted);
  font-size: 11px;
}

.deal-card strong {
  color: var(--green-dark);
  font-size: 13px;
}

.deal-progress {
  width: 100%;
  background: rgb(31 102 84 / 14%);
}

.deal-meta b {
  color: var(--green);
  font-size: 12px;
}

.detail-placeholder,
.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}

.detail-placeholder {
  min-height: 280px;
  gap: 7px;
}

.empty-state {
  min-height: 180px;
  gap: 8px;
  padding: 30px;
}

.detail-placeholder svg,
.empty-state svg {
  color: #91a49c;
}

.detail-placeholder strong,
.empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.detail-placeholder span,
.empty-state span {
  max-width: 300px;
  font-size: 12px;
  line-height: 1.5;
}

.settings-grid {
  display: grid;
  max-width: 900px;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.settings-panel {
  padding: 20px;
}

.settings-panel p {
  min-height: 54px;
  margin: 8px 0 17px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.settings-panel.danger {
  border-color: #efd0c8;
}

.palette-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(114px, 1fr));
  gap: 8px;
}

.palette-options button {
  display: grid;
  min-width: 114px;
  gap: 8px;
  justify-items: start;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.palette-options button strong {
  white-space: nowrap;
}

.palette-options button.active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.palette-swatch {
  display: grid;
  width: 100%;
  height: 28px;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border-radius: 4px;
}

.palette-swatch.emerald i:nth-child(1) {
  background: #173f35;
}
.palette-swatch.emerald i:nth-child(2) {
  background: #1f6654;
}
.palette-swatch.emerald i:nth-child(3) {
  background: #e8f3ef;
}
.palette-swatch.sapphire i:nth-child(1) {
  background: #163d49;
}
.palette-swatch.sapphire i:nth-child(2) {
  background: #19708b;
}
.palette-swatch.sapphire i:nth-child(3) {
  background: #e4f2f6;
}
.palette-swatch.ruby i:nth-child(1) {
  background: #501d29;
}
.palette-swatch.ruby i:nth-child(2) {
  background: #a32943;
}
.palette-swatch.ruby i:nth-child(3) {
  background: #f8e7eb;
}
.palette-swatch.pearl i:nth-child(1) {
  background: #4c454d;
}
.palette-swatch.pearl i:nth-child(2) {
  background: #a99da8;
}
.palette-swatch.pearl i:nth-child(3) {
  background: #f0eaef;
}
.palette-swatch.moonstone i:nth-child(1) {
  background: #344956;
}
.palette-swatch.moonstone i:nth-child(2) {
  background: #36747a;
}
.palette-swatch.moonstone i:nth-child(3) {
  background: #e2eff0;
}
.palette-swatch.onyx i:nth-child(1) {
  background: #29302e;
}
.palette-swatch.onyx i:nth-child(2) {
  background: #4f6f68;
}
.palette-swatch.onyx i:nth-child(3) {
  background: #e9efed;
}
.palette-swatch.citrine i:nth-child(1) {
  background: #493a2d;
}
.palette-swatch.citrine i:nth-child(2) {
  background: #b1661d;
}
.palette-swatch.citrine i:nth-child(3) {
  background: #f7ead8;
}
.palette-swatch.amethyst i:nth-child(1) {
  background: #403548;
}
.palette-swatch.amethyst i:nth-child(2) {
  background: #735b86;
}
.palette-swatch.amethyst i:nth-child(3) {
  background: #eee8f2;
}
.palette-swatch.obsidian i:nth-child(1) {
  background: #151918;
}
.palette-swatch.obsidian i:nth-child(2) {
  background: #416b61;
}
.palette-swatch.obsidian i:nth-child(3) {
  background: #e2ece8;
}

@media (max-width: 1180px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .palette-panel {
    margin-inline: -14px;
    padding: 14px 8px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .palette-options {
    grid-template-columns: repeat(3, minmax(90px, 1fr));
  }

  .palette-options button {
    min-width: 90px;
    padding: 8px 6px;
  }

  .palette-options button strong {
    font-size: 11px;
  }
}

.identity-panel {
  grid-column: 1 / -1;
}

.identity-panel p {
  min-height: 0;
}

.identity-form {
  display: grid;
  gap: 8px;
}

.identity-form > label {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.identity-form > div {
  display: flex;
  gap: 10px;
}

.identity-form input {
  width: min(520px, 100%);
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  font-size: 17px;
}

.identity-form input[aria-invalid="true"] {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.field-error {
  color: #9d3525;
  font-size: 14px;
  font-weight: 700;
}

.toggle-row {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
}

.toggle-row > span {
  display: grid;
  gap: 3px;
}

.toggle-row strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 17px;
}

.sound-panel .toggle-row + .toggle-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sound-volume {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sound-volume > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sound-volume strong,
.sound-volume output {
  font-size: 15px;
  font-weight: 700;
}

.sound-volume output {
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.sound-volume input {
  width: 100%;
  accent-color: var(--green);
  cursor: pointer;
}

.toggle-row small {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.toggle-row input {
  width: 46px;
  height: 25px;
  flex: 0 0 auto;
  accent-color: var(--green);
  cursor: pointer;
}

.file-button {
  cursor: pointer;
}

.file-button.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.toast {
  position: fixed;
  z-index: 60;
  right: 22px;
  bottom: 22px;
  display: flex;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 8px 9px 8px 14px;
  border: 1px solid #274e43;
  border-radius: 7px;
  color: white;
  background: #173f35;
  box-shadow: 0 10px 30px rgb(23 32 29 / 18%);
  font-size: 13px;
  animation: toast-in 180ms ease-out;
}

.toast button {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  border: 0;
  color: #cce0d9;
  background: transparent;
  cursor: pointer;
}

.narrative-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid #d6c798;
  border-left: 4px solid var(--amber);
  border-radius: 7px;
  background: linear-gradient(105deg, #fffaf0, #fffdf8);
}

.narrative-panel.complete {
  border-color: #9fc5b7;
  border-left-color: #2f7a64;
  background: linear-gradient(105deg, #f0faf6, #fbfefc);
}

.dark-mode .narrative-panel {
  border-color: #655634;
  border-left-color: var(--amber);
  background: linear-gradient(105deg, var(--amber-soft), var(--surface));
}

.dark-mode .narrative-panel.complete {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  border-left-color: var(--green-dark);
  background: linear-gradient(105deg, var(--green-soft), var(--surface));
}

.dark-mode .narrative-heading span {
  color: var(--amber);
}

.dark-mode .narrative-heading > b {
  color: #f0d49b;
  background: #493b22;
}

.dark-mode .narrative-open {
  color: #e3bd73;
}

.dark-mode .narrative-objectives > div {
  border-color: color-mix(in srgb, var(--amber) 28%, var(--line));
  background: color-mix(in srgb, var(--amber-soft) 45%, var(--surface));
}

.dark-mode .narrative-objectives i,
.dark-mode .campaign-objective-list i,
.dark-mode .chapter-entry > i {
  color: #f0d49b;
  background: #493b22;
}

.dark-mode .narrative-objectives .done,
.dark-mode .campaign-objective-list .done {
  color: var(--green-dark);
  background: var(--green-soft);
}

.dark-mode .narrative-objectives .done i,
.dark-mode .campaign-objective-list .done i,
.dark-mode .chapter-entry.complete > i {
  color: white;
  background: var(--green);
}

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

.narrative-heading > div {
  display: grid;
  gap: 3px;
}

.narrative-heading span,
.story-eyebrow {
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.narrative-heading strong {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 22px;
}

.narrative-heading > b {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 99px;
  color: #74551d;
  background: #f2e6c4;
  font-size: 12px;
}

.narrative-panel > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.narrative-open {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  color: #76581c;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.narrative-objectives {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 7px;
}

.narrative-objectives > div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 6px 9px;
  border: 1px solid #eadfbe;
  border-radius: 5px;
  background: rgb(255 255 255 / 72%);
  font-size: 13px;
}

.narrative-objectives i {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #8a671f;
  background: #f4e9c8;
}

.narrative-objectives b {
  color: var(--muted);
  font-size: 12px;
}

.narrative-objectives .done {
  color: #2f6657;
}

.narrative-objectives .done i {
  color: white;
  background: #2f7a64;
}

.story-eyebrow {
  display: block;
  margin: -5px 0 11px;
}

.story-copy {
  margin: 0 0 16px;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 18px;
  line-height: 1.6;
}

.story-directive {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 6px;
  color: color-mix(in srgb, var(--amber) 75%, var(--ink));
  background: var(--amber-soft);
}

.story-directive > span {
  display: grid;
  gap: 3px;
  line-height: 1.4;
}

.prologue-screen {
  position: relative;
  display: grid;
  min-height: 100dvh;
  margin: 0;
  place-items: center;
  overflow: hidden;
  padding: 34px 20px;
  background: #102c25;
}

.prologue-atmosphere {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background:
    radial-gradient(circle at 18% 15%, rgb(233 196 106 / 28%), transparent 28%),
    radial-gradient(circle at 82% 78%, rgb(77 143 124 / 24%), transparent 32%),
    linear-gradient(135deg, #173f35, #0c211c 72%);
}

.prologue-letter {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  padding: 34px 38px;
  border: 1px solid #dacda9;
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 35px 100px rgb(0 0 0 / 35%);
}

.prologue-letter > header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 18px 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.prologue-letter > header > div:nth-child(2),
.prologue-subject {
  display: grid;
  gap: 2px;
}

.prologue-letter small,
.prologue-letter time {
  color: var(--muted);
  font-size: 12px;
}

.prologue-subject h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 34px;
}

.prologue-copy {
  margin: 20px 0 24px;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 19px;
  line-height: 1.68;
}

.prologue-copy p {
  margin: 0 0 13px;
}

.letter-signoff {
  font-style: italic;
}

.prologue-stakes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--line);
}

.prologue-stakes > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: var(--surface-soft);
}

.prologue-stakes span {
  color: var(--muted);
  font-size: 11px;
}

.prologue-stakes strong {
  font-size: 14px;
}

.prologue-begin {
  width: 100%;
  min-height: 48px;
  justify-content: center;
}

.campaign-page-heading {
  margin-top: 4px;
}

.campaign-state {
  align-self: center;
  padding: 7px 10px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 800;
}

.campaign-state.active {
  color: #76581c;
  background: #f4e9c8;
}

.campaign-state.won {
  color: #285e4f;
  background: #dcefe8;
}

.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 16px;
}

.board-letter {
  padding: 24px;
}

.board-letter > header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: -4px 0 26px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.letter-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: #fff8e5;
  background: var(--sidebar);
  font-size: 13px;
  font-weight: 900;
}

.board-letter > header > div:not(.letter-avatar) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.board-letter > header span,
.chapter-entry small {
  color: var(--muted);
  font-size: 12px;
}

.board-letter > header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-letter > p {
  margin: 12px 0 20px;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 22px;
  line-height: 1.65;
}

.board-letter blockquote {
  margin: 0 0 24px;
  padding: 13px 15px;
  border-left: 3px solid var(--amber);
  color: color-mix(in srgb, var(--amber) 75%, var(--ink));
  background: var(--amber-soft);
  font-weight: 700;
  line-height: 1.5;
}

.campaign-objective-list {
  display: grid;
  gap: 7px;
  padding-top: 5px;
}

.campaign-objective-list > strong {
  margin-bottom: 3px;
}

.campaign-objective-list > div {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.campaign-objective-list i,
.chapter-entry > i {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #80601d;
  background: #f4e9c8;
}

.campaign-objective-list b {
  color: var(--muted);
  font-size: 13px;
}

.campaign-objective-list .done {
  color: #2f6657;
  background: #f4fbf8;
}

.campaign-objective-list .done i,
.chapter-entry.complete > i {
  color: white;
  background: #2f7a64;
}

.chapter-history {
  align-self: start;
  overflow: hidden;
}

.chapter-entry {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 65px;
  padding: 10px 17px;
  border-top: 1px solid var(--line);
}

.chapter-entry.current {
  background: var(--amber-soft);
}

.chapter-entry.locked {
  opacity: 0.58;
}

.chapter-entry > span {
  display: grid;
  gap: 3px;
}

.inline-alert {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px 24px 0;
  padding: 10px 12px 10px 16px;
  border: 1px solid #e2aea2;
  border-radius: 6px;
  color: #76291d;
  background: var(--coral-soft);
}

.inline-alert span {
  display: grid;
  gap: 2px;
  font-size: 15px;
}

.inline-alert .secondary {
  flex: 0 0 auto;
  border-color: #d99484;
  color: #76291d;
  background: white;
}

.blocked-reason {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--amber);
  font-size: 15px;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(18 28 25 / 54%);
  backdrop-filter: blur(3px);
}

.modal {
  width: min(470px, 100%);
  max-height: calc(100vh - 40px);
  padding: 20px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgb(10 24 19 / 25%);
  animation: modal-in 180ms ease-out;
}

.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.modal-heading h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 22px;
  letter-spacing: 0;
}

.modal-copy {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.summary-grid > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.summary-grid span {
  color: var(--muted);
  font-size: 11px;
}

.summary-grid strong {
  font-size: 14px;
}

.crisis-note,
.error-code {
  display: block;
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid #ead49e;
  border-radius: 6px;
  color: #704d17;
  background: var(--amber-soft);
  font-size: 12px;
  line-height: 1.55;
}

.error-code {
  overflow-wrap: anywhere;
  border-color: #efd0c8;
  color: #863c2c;
  background: var(--coral-soft);
}

/* Operational text stays readable on full-HD displays without browser zoom. */
.crm-app {
  font-size: 18px;
}

.brand strong {
  font-size: 18px;
}

.brand span,
.unlock-note strong,
.unlock-note span,
.save-state,
.game-clock {
  font-size: 15px;
}

.nav-heading,
.sidebar nav button b,
.page-heading span,
.panel-heading span,
.table-toolbar span,
.activity-list small,
th,
td small,
.status,
.detail-heading span,
.record-section dt,
.deal-card span,
.summary-grid span {
  font-size: 14px;
}

.sidebar nav button,
.settings-link,
.search input,
.primary,
.secondary,
.danger-button,
.text-button,
.kpi span,
.kpi small,
.task-row span,
.task-row time,
.detail-heading p,
.quick-actions span,
.record-section dd,
.deal-meta b,
.detail-placeholder span,
.empty-state span,
.settings-panel p,
.toast,
.modal-copy,
.crisis-note,
.error-code {
  font-size: 17px;
}

.page-heading p,
.task-row strong,
.activity-list strong,
table,
.record-section h3,
.detail-placeholder strong,
.empty-state strong {
  font-size: 18px;
}

.panel-heading h2,
.settings-panel h2 {
  font-size: 20px;
}

.detail-heading h2 {
  font-size: 24px;
}

.kpi strong {
  font-size: 27px;
}

.mobile-only {
  display: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
}

@media (min-width: 1101px) {
  .lead-table tbody tr:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: -2px;
  }

  .lead-record-layout {
    height: max(320px, calc(100dvh - 471px));
    align-items: stretch;
  }

  .lead-record-layout.filters-open {
    height: max(260px, calc(100dvh - 565px));
  }

  .lead-record-layout > .table-panel {
    display: grid;
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .lead-record-layout > .record-detail,
  .lead-record-layout > .detail-placeholder {
    height: 100%;
    max-height: 100%;
  }

  .lead-record-layout .table-scroll,
  .lead-record-layout > .record-detail {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .lead-record-layout th {
    position: sticky;
    z-index: 1;
    top: 0;
  }
}

@media (max-width: 1400px) {
  .quote-form {
    grid-template-columns: 1fr;
  }

  .quote-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quote-fields label,
  .quote-fields .quote-deal-field,
  .quote-fields .quote-plan-field,
  .quote-fields .quote-deal-field + .quote-plan-field + label {
    grid-column: auto;
  }

  .quote-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .quote-terms {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .quote-value {
    grid-column: 2;
    grid-row: 1;
  }

  .quote-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: flex-start;
  }
}

@media (max-width: 1220px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sales-team-list > div {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .sales-team-list dl {
    grid-column: 2 / -1;
  }

  .rep-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .record-layout {
    grid-template-columns: minmax(460px, 1fr) minmax(300px, 360px);
  }

  .game-clock {
    display: none;
  }
}

@media (max-width: 1100px) {
  .record-layout,
  .dashboard-grid,
  .marketing-layout {
    grid-template-columns: 1fr;
  }

  .hire-rep-form {
    grid-template-columns: 1fr 1fr;
  }

  .campaign-list > div {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .campaign-list dl {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .campaign-list > div > .status {
    grid-column: 2;
    grid-row: 1;
  }

  .campaign-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: flex-start;
  }

  .record-detail {
    position: static;
  }
}

@media (max-width: 860px) {
  .advanced-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mobile-only {
    display: inline-grid;
  }

  .sidebar {
    height: 100dvh;
    max-height: 100dvh;
    width: min(290px, 86vw);
    box-shadow: 18px 0 50px rgb(10 24 19 / 25%);
    transform: translateX(-105%);
    transition: transform 180ms ease-out;
  }

  .nav-scrim {
    position: fixed;
    z-index: 29;
    inset: 0;
    display: block;
    width: 100%;
    height: 100dvh;
    padding: 0;
    border: 0;
    background: rgb(10 24 19 / 45%);
    touch-action: none;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  main {
    margin-left: 0;
  }

  .crm-app + .site-footer {
    width: 100%;
    margin-left: 0;
  }

  .topbar {
    padding: 0 16px;
  }

  .search-shell {
    width: min(360px, 54vw);
  }

  .record-layout,
  .dashboard-grid,
  .story-layout {
    grid-template-columns: 1fr;
  }

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

  .deal-editor form {
    grid-template-columns: 1fr 1fr;
  }

  .success-hire-form,
  .support-hire-form {
    grid-template-columns: 1fr 1fr;
  }

  .success-hire-form button,
  .support-hire-form button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .workflow-list {
    grid-template-columns: 1fr;
  }

  .sales-team-list > div {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .sales-team-list dl {
    grid-column: 1 / -1;
  }

  .rep-actions {
    grid-column: 1 / -1;
    grid-row: auto;
    justify-self: start;
  }

  .record-detail {
    position: static;
  }
}

@media (max-width: 1100px) {
  .lead-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .lead-table thead {
    display: none;
  }

  .lead-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .lead-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .lead-table td {
    display: block;
    padding: 0;
    border: 0;
  }

  .lead-table td:nth-child(1),
  .lead-table td:nth-child(2) {
    grid-column: 1;
  }

  .lead-table td:nth-child(3),
  .lead-table td:nth-child(4) {
    grid-column: 2;
    text-align: right;
  }

  .lead-table td:nth-child(3) {
    grid-row: 1;
  }

  .lead-table td:nth-child(4) {
    grid-row: 2;
  }

  .lead-table td:nth-child(5),
  .lead-table td:nth-child(6) {
    grid-column: 1 / -1;
  }

  .lead-table .mobile-actions-cell {
    display: grid;
    width: auto;
    min-width: 0;
    height: auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 6px;
    white-space: normal;
  }

  .lead-table .record-open-button {
    width: 100%;
    min-width: 0;
    min-height: 48px;
  }

  .lead-table .mobile-contact-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
    min-width: 0;
  }

  .lead-table .mobile-contact-actions button {
    display: inline-flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--green-dark);
    background: var(--surface);
    font: inherit;
    font-weight: 700;
  }

  .record-layout > .lead-detail {
    position: fixed;
    z-index: 55;
    top: 50%;
    right: 14px;
    bottom: auto;
    left: 14px;
    max-height: calc(100dvh - 40px);
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    border-radius: 14px;
    box-shadow: 0 -18px 45px rgb(10 24 19 / 22%);
    transform: translateY(-50%);
  }

  .lead-detail-scrim {
    position: fixed;
    z-index: 54;
    inset: 0;
    display: block;
    width: 100%;
    height: 100dvh;
    padding: 0;
    border: 0;
    background: rgb(10 24 19 / 38%);
    touch-action: none;
  }
}

@media (max-width: 620px) {
  .guidance-card {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .guidance-card button {
    width: 100%;
    grid-column: 1 / -1;
  }

  .tutorial-panel {
    padding: 14px;
  }

  .tutorial-content {
    align-items: start;
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .tutorial-icon {
    width: 40px;
    height: 40px;
  }

  .tutorial-content > button {
    width: 100%;
    grid-column: 1 / -1;
  }

  .tutorial-skip {
    width: 100%;
  }

  .mobile-save-state small {
    display: none;
  }

  .workspace {
    padding: 20px 14px 50px;
  }

  .narrative-panel {
    margin-inline: -2px;
    padding: 14px;
  }

  .narrative-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .narrative-heading > b {
    align-self: flex-start;
  }

  .narrative-objectives {
    grid-template-columns: 1fr;
  }

  .narrative-open {
    min-height: 42px;
  }

  .campaign-state {
    align-self: flex-start;
  }

  .board-letter {
    padding: 18px;
  }

  .board-letter > header {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .board-letter > header > div:last-child {
    grid-column: 2;
  }

  .board-letter > p {
    font-size: 19px;
  }

  .prologue-screen {
    align-items: start;
    padding: 14px;
  }

  .prologue-letter {
    padding: 24px 20px;
  }

  .prologue-subject h1 {
    font-size: 29px;
  }

  .prologue-copy {
    font-size: 17px;
  }

  .prologue-stakes {
    grid-template-columns: 1fr;
  }

  .topbar {
    gap: 7px;
    padding: 0 10px;
  }

  .search-shell {
    flex: 1;
    width: auto;
  }

  .topbar-meta {
    display: none;
  }

  .mobile-save-state {
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 11px;
  }

  .mobile-topbar-overflow {
    position: relative;
    display: block;
    flex: 0 0 auto;
  }

  .mobile-topbar-overflow > summary {
    list-style: none;
  }

  .mobile-topbar-overflow > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-topbar-overflow[open] > summary {
    border-color: var(--line);
    color: var(--ink);
    background: var(--surface-soft);
  }

  .mobile-topbar-menu {
    position: absolute;
    z-index: 50;
    top: calc(100% + 10px);
    right: 0;
    display: grid;
    width: min(290px, calc(100vw - 20px));
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 16px 38px rgb(23 32 29 / 18%);
  }

  .mobile-topbar-clock,
  .mobile-speed-control {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 13px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-topbar-clock {
    justify-content: flex-start;
    color: var(--green);
  }

  .mobile-topbar-clock span {
    display: grid;
    gap: 2px;
  }

  .mobile-topbar-clock small,
  .mobile-speed-control > span {
    color: var(--muted);
    font-size: 11px;
  }

  .mobile-topbar-clock strong {
    color: var(--ink);
    font-size: 13px;
  }

  .mobile-topbar-menu > button {
    display: grid;
    min-height: 50px;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    background: var(--surface);
    text-align: left;
    cursor: pointer;
  }

  .mobile-topbar-menu > button:last-child {
    border-bottom: 0;
  }

  .mobile-topbar-menu > button svg {
    color: var(--green);
  }

  .mobile-topbar-menu > button b {
    min-width: 24px;
    padding: 2px 6px;
    border-radius: 10px;
    color: var(--green-dark);
    background: var(--green-soft);
    font-size: 11px;
    text-align: center;
  }

  .page-heading {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading h1 {
    font-size: 27px;
  }

  .view-actions {
    width: 100%;
  }

  .view-actions button {
    flex: 1;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar label {
    min-width: 0;
  }

  .kpi-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .kpi {
    min-height: 92px;
  }

  .table-panel {
    margin-inline: -14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  table {
    min-width: 680px;
  }

  .mobile-actions-heading,
  .mobile-actions-cell {
    display: table-cell;
  }

  .mobile-contact-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
    min-width: 0;
  }

  .mobile-contact-actions button {
    display: inline-flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--green-dark);
    background: var(--surface);
    font: inherit;
    font-weight: 700;
  }

  .lead-table .mobile-actions-cell,
  .contacts-table .mobile-actions-cell {
    display: grid;
    width: auto;
    gap: 8px;
    white-space: normal;
  }

  .record-open-button {
    width: 100%;
    min-height: 42px;
  }

  .lead-table,
  .contacts-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .lead-table thead,
  .contacts-table thead {
    display: none;
  }

  .lead-table tbody,
  .contacts-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .lead-table tr,
  .contacts-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .lead-table td,
  .contacts-table td {
    display: block;
    height: auto;
    padding: 0;
    border: 0;
  }

  .lead-table td:nth-child(1),
  .lead-table td:nth-child(2),
  .contacts-table td:nth-child(1),
  .contacts-table td:nth-child(2),
  .contacts-table td:nth-child(3) {
    grid-column: 1;
  }

  .lead-table td:nth-child(3),
  .lead-table td:nth-child(4),
  .contacts-table td:nth-child(4),
  .contacts-table td:nth-child(5) {
    grid-column: 2;
    text-align: right;
  }

  .lead-table td:nth-child(3),
  .contacts-table td:nth-child(4) {
    grid-row: 1;
  }

  .lead-table td:nth-child(4),
  .contacts-table td:nth-child(5) {
    grid-row: 2;
  }

  .lead-table td:nth-child(5),
  .lead-table td:nth-child(6),
  .contacts-table td:nth-child(6) {
    grid-column: 1 / -1;
  }

  .record-layout > .record-detail {
    position: fixed;
    z-index: 55;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(78dvh, 680px);
    margin: 0;
    overflow-y: auto;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -18px 45px rgb(10 24 19 / 22%);
  }

  .record-layout > .lead-detail {
    top: 50%;
    right: 14px;
    bottom: auto;
    left: 14px;
    max-height: calc(100dvh - 40px);
    overflow: hidden;
    overscroll-behavior: none;
    border-radius: 14px;
    transform: translateY(-50%);
  }

  .lead-detail-scrim {
    position: fixed;
    z-index: 54;
    inset: 0;
    display: block;
    width: 100%;
    height: 100dvh;
    padding: 0;
    border: 0;
    background: rgb(10 24 19 / 38%);
    touch-action: none;
  }

  .lead-detail .detail-heading {
    padding: 14px;
  }

  .lead-detail .quick-actions button {
    min-height: 52px;
  }

  .lead-detail .record-section {
    padding: 13px 14px;
  }

  .lead-detail .record-section h3 {
    margin-bottom: 10px;
  }

  .lead-detail .record-section dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
  }

  .lead-detail .record-footer {
    padding: 11px 14px;
  }

  .campaign-page-heading:focus {
    outline: none;
  }

  @media (hover: none) {
    tbody tr:hover td,
    tbody tr.selected td {
      background: transparent;
    }
  }

  .record-section dl {
    grid-template-columns: 1fr;
  }

  .task-row {
    grid-template-columns: 27px minmax(0, 1fr) auto;
  }

  .task-row > .icon-button {
    display: none;
  }

  .settings-actions,
  .modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-actions > *,
  .modal-actions > * {
    width: 100%;
  }

  .identity-form > div {
    align-items: stretch;
    flex-direction: column;
  }

  .identity-form button {
    width: 100%;
  }

  .inline-alert {
    align-items: stretch;
    flex-direction: column;
    margin: 12px 14px 0;
  }

  .acquisition-tool {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 18px;
  }

  .campaign-summary,
  .form-row {
    grid-template-columns: 1fr;
  }

  .pipeline-summary {
    grid-template-columns: 1fr;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1;
    justify-content: center;
  }

  .deal-editor form {
    grid-template-columns: 1fr;
  }

  .hire-rep-form {
    grid-template-columns: 1fr;
  }

  .success-hire-form,
  .support-hire-form,
  .success-team-list > div,
  .support-team-list > div,
  .incident-list > div:not(.table-toolbar) {
    grid-template-columns: 1fr;
  }

  .support-summary {
    grid-template-columns: 1fr;
  }

  .success-hire-form button {
    width: 100%;
  }

  .success-team-list .rep-avatar,
  .support-team-list .rep-avatar {
    display: none;
  }

  .quote-fields,
  .quote-row {
    grid-template-columns: 1fr;
  }

  .quote-builder {
    padding: 14px;
  }

  .quote-fields label,
  .quote-fields .quote-deal-field,
  .quote-fields .quote-plan-field,
  .quote-fields .quote-deal-field + .quote-plan-field + label {
    grid-column: 1;
  }

  .quote-list {
    padding: 10px;
  }

  .quote-terms {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: 1fr 1fr;
  }

  .quote-value {
    grid-column: 1;
    grid-row: auto;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .quote-actions {
    grid-column: 1;
    grid-row: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .quote-actions .close-risk-inline {
    grid-column: 1 / -1;
  }

  .workflow-builder-form {
    grid-template-columns: 1fr;
  }

  .workflow-builder-form label,
  .workflow-builder-form .workflow-name-field,
  .workflow-preview,
  .workflow-publish {
    grid-column: 1;
  }

  .workflow-preview {
    flex-wrap: wrap;
    overflow: visible;
  }

  .workflow-preview > svg {
    display: none;
  }

  .workflow-publish {
    width: 100%;
  }

  .workflow-flow {
    grid-template-columns: 1fr;
  }

  .workflow-flow > svg {
    display: none;
  }

  .workflow-card > footer {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-card > footer > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .workflow-card > footer button {
    justify-content: center;
  }

  .workflow-list {
    padding: 10px;
  }

  .quote-actions button {
    justify-content: center;
  }

  .sales-team-list dl {
    grid-template-columns: 1fr 1fr;
  }

  .deal-loss-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .deal-loss-controls label,
  .deal-loss-controls button {
    width: 100%;
  }

  .acquisition-tool dl {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
