:root {
  color-scheme: light;
  --font-sans: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --paper: #f7f6f2;
  --paper-2: #f1efe9;
  --paper-3: #fffdf8;
  --paper-4: #ebe6d9;
  --ink: #16140f;
  --ink-2: #4a4740;
  --ink-3: #837d72;
  --ink-4: #b5ad9e;
  --rule: #d8d3c4;
  --rule-soft: #e6e2d6;
  --vermillion: #c4482b;
  --vermillion-dark: #9f3824;
  --vermillion-soft: #efe0d8;
  --indigo: #2b3a55;
  --indigo-soft: #dee4ee;
  --mustard: #a87312;
  --mustard-soft: #efe3c9;
  --bg-base: var(--paper);
  --bg-app: var(--paper);
  --bg-surface: var(--paper-3);
  --bg-sunken: var(--paper-2);
  --glass-1: var(--paper);
  --glass-2: var(--paper-3);
  --glass-3: var(--paper-3);
  --fg: var(--ink);
  --fg-secondary: var(--ink-2);
  --fg-tertiary: var(--ink-3);
  --fg-quaternary: var(--ink-4);
  --border: var(--rule);
  --border-soft: var(--rule-soft);
  --accent: var(--vermillion);
  --accent-hover: var(--vermillion-dark);
  --accent-soft: var(--vermillion-soft);
  --success: var(--indigo);
  --success-soft: var(--indigo-soft);
  --warn: var(--mustard);
  --warn-soft: var(--mustard-soft);
  --danger: #a1332a;
  --danger-soft: #efd9d6;
  --shadow-sm: 0 1px 0 rgb(22 20 15 / 0.06);
  --shadow-md: 0 1px 0 rgb(22 20 15 / 0.08), 0 10px 28px rgb(22 20 15 / 0.05);
  --shadow-card: 0 1px 0 rgb(22 20 15 / 0.08);
  --shadow-glass: 0 1px 0 rgb(22 20 15 / 0.08);
  --radius: 0;
  --r-sm: 0;
  --r-md: 0;
  --r-lg: 0;
  --r-full: 999px;
  --glass-stroke: var(--rule);
  --shadow-focus: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-base);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body.is-pipeline-dragging {
  cursor: grabbing;
  user-select: none;
}

body.is-pipeline-dragging * {
  user-select: none;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

kbd,
.mono {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
}

kbd {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 0.5px solid var(--border);
  border-radius: 4px;
  background: var(--bg-sunken);
  color: var(--fg-tertiary);
}

[hidden] {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--bg-base);
}

.auth-panel {
  width: min(780px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 0.5px solid var(--border);
  border-radius: 0;
  background: var(--bg-surface);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-brand,
.auth-toggle,
.plan-picker-head {
  display: flex;
  align-items: center;
}

.auth-brand {
  gap: 8px;
}

.auth-brand > div:last-child {
  display: grid;
  gap: 1px;
}

.auth-brand span,
.auth-copy p,
.auth-note,
.plan-card em,
.plan-card li {
  color: var(--fg-tertiary);
}

.auth-copy h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 560px;
  margin: 6px 0 0;
  font-size: 13px;
}

.auth-toggle {
  width: fit-content;
  gap: 2px;
  padding: 0;
  border: 0.5px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.auth-toggle button {
  min-height: 28px;
  border: 0;
  border-radius: 0;
  padding: 0 12px;
  background: transparent;
  color: var(--fg-secondary);
  font-weight: 650;
}

.auth-toggle button.active {
  background: var(--fg);
  color: var(--bg-surface);
  box-shadow: none;
}

.auth-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.auth-form label,
.plan-picker {
  display: grid;
  gap: 5px;
}

.auth-form label span,
.plan-picker-head span {
  color: var(--fg-tertiary);
  font-size: 11px;
  font-weight: 650;
}

.auth-form input {
  width: 100%;
}

.plan-picker,
.auth-form .modal-actions {
  grid-column: 1 / -1;
}

/* SSO buttons (Google / LinkedIn / Apple) */
.auth-sso {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 4px;
}

.auth-sso-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-base, #fff);
  color: var(--fg, #16140f);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 120ms ease, background 120ms ease;
}

.auth-sso-button:hover {
  border-color: var(--fg, #16140f);
  background: var(--bg-soft, #f1efe9);
}

.auth-sso-apple {
  background: var(--fg, #16140f);
  color: var(--bg-base, #f7f6f2);
  border-color: var(--fg, #16140f);
}

.auth-sso-apple:hover {
  background: #000;
  border-color: #000;
}

.auth-sso-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 2px 4px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-tertiary, #8a857b);
}

.auth-sso-divider::before,
.auth-sso-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Forgot-password link + flash messages */
.auth-extra {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--accent, #c4482b);
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.auth-flash {
  background: color-mix(in srgb, var(--accent, #c4482b) 8%, transparent);
  border: 0.5px solid color-mix(in srgb, var(--accent, #c4482b) 35%, transparent);
  color: var(--fg, #16140f);
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.plan-picker-head {
  justify-content: space-between;
}

.plan-picker-head strong {
  color: var(--success);
  font-size: 12px;
}

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

.plan-card {
  min-height: 168px;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 0.5px solid var(--border);
  border-radius: 0;
  padding: 12px;
  background: var(--bg-surface);
  color: var(--fg);
  text-align: left;
}

.plan-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 64%, var(--bg-surface));
  box-shadow: inset 3px 0 0 var(--accent);
}

.plan-card span,
.plan-card ul {
  display: grid;
  gap: 4px;
}

.plan-card strong {
  font-size: 13px;
}

.plan-card em {
  font-size: 11px;
  font-style: normal;
}

.plan-card small {
  width: fit-content;
  border-radius: 0;
  padding: 2px 8px;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 750;
}

.plan-card ul {
  margin: 0;
  padding-left: 16px;
  font-size: 11px;
}

.auth-note {
  border-top: 0.5px solid var(--border-soft);
  padding-top: 12px;
  font-size: 11px;
}

.quartet-app {
  --sidebar-width: 232px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) minmax(288px, 304px);
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  background: var(--bg-app);
}

.quartet-app[data-sidebar-collapsed="true"] {
  --sidebar-width: 64px;
}

.quartet-app[data-current-view="pipeline"] {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) minmax(320px, 360px);
}

.quartet-app[data-detail-rail-collapsed="true"] {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.quartet-app[data-current-view="pipeline"][data-detail-rail-collapsed="true"] {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.quartet-app[data-current-view="pipeline"] .detail-rail {
  display: block;
}

.quartet-app[data-detail-rail-collapsed="true"] .detail-rail {
  display: none;
}

.quartet-app[data-current-view="pipeline"] .main-shell {
  background: var(--bg-app);
}

.sidebar,
.detail-rail {
  min-height: 0;
  background: var(--bg-base);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border-right: 0.5px solid #d8d3c4;
  padding: 28px 22px 0;
  background: #f7f6f2;
  transition: width 160ms ease;
}

.detail-rail {
  border-left: 0.5px solid var(--border);
  overflow-y: auto;
}

.rail-chrome {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg-base);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.rail-chrome > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rail-chrome span {
  color: var(--fg-quaternary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.rail-chrome strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.rail-hide-button {
  min-width: 54px;
  min-height: 32px;
  border: 0.5px solid var(--border-soft);
  background: transparent;
}

.rail-reveal-button {
  position: fixed;
  top: 86px;
  right: 12px;
  z-index: 30;
  min-height: 34px;
  padding: 0 12px;
  border: 0.5px solid var(--border);
  border-radius: 0;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  color: var(--accent);
  font-weight: 800;
}

.rail-reveal-button:hover {
  background: var(--accent-soft);
}

.workspace-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
}

.sidebar-toggle {
  width: 28px;
  min-height: 28px;
  padding: 0;
  margin-left: auto;
  color: var(--fg-tertiary, #8a857b);
  background: transparent;
  border: 0;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}

.sidebar-toggle:hover {
  background: rgba(22, 20, 15, 0.05);
  color: var(--fg, #16140f);
}

.sidebar-toggle .svg-icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
}

.brand-bars {
  width: 14px;
  height: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  flex: 0 0 auto;
}

.brand-bars span {
  display: block;
  width: 14px;
  height: 3px;
  border-radius: 0;
  background: #16140f;
}

.brand-bars span:nth-child(1),
.brand-bars span:nth-child(5) {
  width: 8px;
}

.brand-bars span:nth-child(2),
.brand-bars span:nth-child(4) {
  width: 12px;
}

.brand-bars span:nth-child(3) {
  background: #c4482b;
}

/* ── Quartet ring mark ──────────────────────────────────────────────────
   Three-quarter ink ring closed by a vermillion quarter (top-right).
   Used in the sidebar, the auth screen, and the marketing pages. */
.brand-mark-q {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: #16140f;
  overflow: visible;
  transition: transform 700ms cubic-bezier(0.65, 0, 0.35, 1);
  transform-origin: 50% 50%;
}

.brand-mark-q-ring,
.brand-mark-q-arc {
  transition: stroke 240ms ease;
}

/* Spin once when the sidebar collapses; spin back on expand. */
.quartet-app[data-sidebar-collapsed="true"] .workspace-mark .brand-mark-q {
  transform: rotate(360deg);
}

.brand-glyph {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: 12px;
}

.brand-copy,
.sidebar-footer > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-copy strong,
.sidebar-footer strong {
  color: #16140f;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
}

.brand-copy span,
.sidebar-footer span {
  color: #8a857b;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

.command-trigger,
.primary-action,
.ghost-button,
.nav-item,
.link-button,
.icon-button {
  min-height: 30px;
  border: 0;
  border-radius: var(--r-md);
}

.command-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 0.5px solid #d8d3c4;
  border-radius: 0;
  background: transparent;
  color: #8a857b;
  box-shadow: none;
  font-size: 12.5px;
}

.command-trigger > span:not(.command-icon) {
  flex: 1;
  text-align: left;
}

.command-trigger kbd {
  margin-left: auto;
  color: #8a857b;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
}

.command-icon,
.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: currentColor;
}

.svg-icon {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 0.5px solid var(--fg);
  background: var(--fg);
  color: var(--bg-surface);
  font-weight: 650;
  box-shadow: none;
}

.primary-action:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.sidebar .primary-action {
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 10px 0;
  border: 0;
  border-bottom: 0.5px solid #16140f;
  border-radius: 0;
  background: transparent;
  color: #16140f;
  font-size: 13px;
  font-weight: 550;
  box-shadow: none;
}

.sidebar .primary-action::after {
  content: "＋";
  font-size: 16px;
  line-height: 1;
}

.sidebar .primary-action:hover {
  background: transparent;
  color: #c4482b;
}

.nav-group {
  display: grid;
  gap: 0;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 0;
  padding: 9px 0;
  border-bottom: 0.5px solid #e6e2d6;
  border-radius: 0;
  background: transparent;
  color: #4a4740;
  font-size: 13px;
  text-align: left;
  transition: color 120ms ease;
}

.nav-item:hover {
  background: transparent;
  color: #16140f;
}

.nav-item.active {
  background: transparent;
  color: #16140f;
  box-shadow: none;
  font-weight: 550;
}

.nav-item::before {
  content: "";
  width: 4px;
  height: 4px;
  margin-left: -14px;
  margin-right: 0;
  flex: 0 0 auto;
}

.nav-item.active::before {
  border-radius: 50%;
  background: #c4482b;
}

.nav-item .nav-icon + span {
  flex: 1;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--fg-tertiary, #8a857b);
  transition: color 120ms ease;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  color: var(--fg, #16140f);
}

.nav-icon .svg-icon {
  stroke-width: 1.6;
}

/* Hide the bullet "::before" dot when an icon is present, since the icon
   already serves as the visual anchor. The accent ring in
   .nav-item.active::before still applies via outline. */
.nav-item:has(.nav-icon)::before {
  display: none;
}

/* Active state ring around the icon (replaces the bullet) */
.nav-item.active .nav-icon {
  position: relative;
}

.nav-item.active .nav-icon::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  width: 3px;
  height: 14px;
  margin-top: -7px;
  background: #c4482b;
  border-radius: 2px;
}

/* Collapsed sidebar: hide the command-icon (search trigger) shows; reuse */
.quartet-app:not([data-sidebar-collapsed="true"]) .command-icon,
.quartet-app:not([data-sidebar-collapsed="true"]) .sidebar .primary-action .svg-icon {
  display: none;
}

.nav-count {
  margin-left: auto;
  min-width: 0;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #8a857b;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 450;
  letter-spacing: 0;
}

.sidebar-label {
  padding: 0 0 4px;
  margin-bottom: -20px;
  color: #8a857b;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.data-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
  padding: 2px;
  border: 0.5px solid #d8d3c4;
  border-radius: 0;
  background: transparent;
}

.data-mode-toggle button {
  min-height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8a857b;
  font-size: 11.5px;
  font-weight: 550;
  letter-spacing: 0;
}

.data-mode-toggle button.active {
  background: #16140f;
  color: #f7f6f2;
  box-shadow: none;
}

.data-mode-toggle button:disabled {
  cursor: progress;
  opacity: 0.62;
}

.sidebar-footer {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  margin-left: -22px;
  margin-right: -22px;
  padding: 12px 22px 22px;
  border-top: 0.5px solid #d8d3c4;
  background: #f7f6f2;
}

.logout-button {
  width: 30px;
  padding: 0;
  margin-left: auto;
}

.quartet-app[data-sidebar-collapsed="true"] .sidebar {
  align-items: center;
  gap: 10px;
  padding: 14px 8px;
}

.quartet-app[data-sidebar-collapsed="true"] .workspace-mark {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 4px 0 8px;
}

.quartet-app[data-sidebar-collapsed="true"] .brand-bars {
  align-items: center;
}

.quartet-app[data-sidebar-collapsed="true"] .sidebar-toggle {
  margin-left: 0;
}

.quartet-app[data-sidebar-collapsed="true"] .brand-copy,
.quartet-app[data-sidebar-collapsed="true"] .command-trigger > span:not(.command-icon),
.quartet-app[data-sidebar-collapsed="true"] .command-trigger kbd,
.quartet-app[data-sidebar-collapsed="true"] .sidebar-label,
.quartet-app[data-sidebar-collapsed="true"] .data-mode-toggle,
.quartet-app[data-sidebar-collapsed="true"] .sidebar-footer > div,
.quartet-app[data-sidebar-collapsed="true"] .nav-item > span:not(.nav-icon):not(.nav-count),
.quartet-app[data-sidebar-collapsed="true"] .nav-item kbd {
  display: none;
}

.quartet-app[data-sidebar-collapsed="true"] .command-trigger,
.quartet-app[data-sidebar-collapsed="true"] .nav-item,
.quartet-app[data-sidebar-collapsed="true"] .sidebar .primary-action {
  width: 38px;
  justify-content: center;
  min-height: 38px;
  padding: 0;
  border-bottom: 0;
  border-radius: 0;
}

.quartet-app[data-sidebar-collapsed="true"] .sidebar .primary-action {
  font-size: 0;
}

.quartet-app[data-sidebar-collapsed="true"] .sidebar .primary-action::after {
  display: none;
}

.quartet-app[data-sidebar-collapsed="true"] .sidebar .primary-action .svg-icon {
  display: block;
}

.quartet-app[data-sidebar-collapsed="true"] .nav-icon,
.quartet-app[data-sidebar-collapsed="true"] .command-icon {
  display: inline-grid;
}

.quartet-app[data-sidebar-collapsed="true"] .nav-group {
  width: 100%;
  justify-items: center;
}

.quartet-app[data-sidebar-collapsed="true"] .nav-count {
  position: absolute;
  transform: translate(12px, -9px);
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: #efe3d8;
  color: #c4482b;
  font-size: 9px;
}

.quartet-app[data-sidebar-collapsed="true"] .sidebar-footer {
  width: 100%;
  justify-content: center;
  margin-inline: 0;
  padding: 8px 0 0;
}

.quartet-app[data-sidebar-collapsed="true"] .logout-button {
  margin-left: 0;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 750;
}

.main-shell {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
}

.view-header {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px 14px;
  background: var(--bg-base);
  border-bottom: 0.5px solid var(--border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.view-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 650;
}

.view-header p {
  margin: 2px 0 0;
  color: var(--fg-tertiary);
  font-size: 12px;
}

.quartet-app[data-current-view="today"] .view-header,
.quartet-app[data-current-view="inbox"] .view-header,
.quartet-app[data-current-view="cadence"] .view-header {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Per-view top-right Search + Refresh in the global view-header are
   redundant with the sidebar's command palette (⌘K) and per-view
   refresh buttons (e.g. Today's topbar). Hide on every view. */
.view-header .header-actions {
  display: none;
}

.search-input,
input,
select,
textarea {
  min-height: 30px;
  border: 0.5px solid var(--border);
  border-radius: 0;
  background: var(--bg-surface);
  color: var(--fg);
  outline: 0;
  padding: 0 10px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-color: var(--bg-surface);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--fg) 50%),
    linear-gradient(135deg, var(--fg) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 50%,
    calc(100% - 11px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  font-weight: 650;
}

select:hover {
  border-color: color-mix(in oklab, var(--fg) 35%, var(--border));
}

select option {
  background: var(--bg-base);
  color: var(--fg);
  font-weight: 650;
}

.search-input {
  width: 280px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ghost-button,
.link-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--fg-secondary);
}

.ghost-button:hover,
.link-button:hover,
.icon-button:hover {
  background: var(--bg-sunken);
}

.entity-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 36%, transparent);
  text-underline-offset: 3px;
}

.entity-link:hover {
  color: var(--accent);
}

.pill-button {
  border: 0;
  cursor: pointer;
}

.pill-button:hover {
  filter: saturate(1.08);
  box-shadow: inset 0 0 0 0.5px currentColor;
}

.view-pane {
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.scroll {
  overflow: auto;
}

.today-layout {
  height: 100%;
  overflow-y: auto;
  padding: 20px 24px;
}

.today-inner {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.today-combined-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.today-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: 14px;
  align-items: start;
}

.today-conversations {
  min-height: 680px;
  overflow: hidden;
  border: 0.5px solid var(--border);
  border-radius: 0;
  background: var(--bg-surface);
  box-shadow: none;
}

.today-conversations .inbox-layout {
  min-height: 680px;
}

.jp-today {
  --jp-paper: #f7f6f2;
  --jp-paper-2: #f1efe9;
  --jp-ink: #16140f;
  --jp-ink-2: #4a4740;
  --jp-ink-3: #8a857b;
  --jp-ink-4: #c5c0b3;
  --jp-rule: #d8d3c4;
  --jp-rule-soft: #e6e2d6;
  --jp-vermillion: #c4482b;
  --jp-indigo: #2b3a55;
  --jp-kiiro: #a87312;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--jp-paper);
  color: var(--jp-ink);
  font-family: var(--font-sans);
}

.quartet-app[data-current-view="today"] .main-shell {
  background: var(--jp-paper);
}

.quartet-app[data-current-view="today"] .sidebar {
  border-right-color: var(--jp-rule);
  background: var(--jp-paper);
  box-shadow: none;
}

.quartet-app[data-current-view="today"] .nav-item.active {
  background: transparent;
  box-shadow: none;
  color: var(--jp-ink);
}

.quartet-app[data-current-view="today"] .nav-item.active::before {
  background: var(--jp-vermillion);
}

.jp-topbar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 24px;
  border-bottom: 0.5px solid var(--jp-rule);
}

.jp-topbar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 28px;
}

.jp-eyebrow,
.jp-topbar-sep,
.jp-topbar-date {
  flex: 0 0 auto;
  white-space: nowrap;
}

.jp-topbar-sep {
  color: var(--jp-ink-4);
  font-family: var(--font-mono);
  font-size: 11px;
}

.jp-topbar-date {
  color: var(--jp-ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.jp-topbar-greeting {
  margin: 0;
  color: var(--jp-ink);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.jp-topbar-greeting em {
  font-style: normal;
  font-weight: 650;
  color: var(--jp-vermillion);
}

.jp-topbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.jp-topbar .jp-search {
  width: 180px;
}

.jp-signal-body {
  display: grid;
  gap: 4px;
}

.jp-counter-label,
.jp-section-left span,
.jp-signal-unit {
  color: var(--jp-ink-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.jp-counter-foot,
.jp-section-head em,
.jp-row-num,
.jp-signal-num,
.jp-signal-meta,
.jp-sch-time,
.jp-footer {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0;
}

.jp-counter-foot,
.jp-section-head em,
.jp-row-num,
.jp-signal-num,
.jp-sch-sub,
.jp-footer {
  color: var(--jp-ink-3);
}

.jp-search {
  width: 240px;
  min-height: 30px;
  padding: 6px 0;
  border: 0;
  border-bottom: 0.5px solid var(--jp-ink-3);
  border-radius: 0;
  background: transparent;
  color: var(--jp-ink);
  box-shadow: none;
}

.jp-search:focus {
  border-color: var(--jp-ink);
  box-shadow: none;
}

.jp-action,
.jp-row-link,
.jp-entity-link,
.jp-signal-title,
.jp-signal-meta,
.jp-sch-title {
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

.jp-action,
.jp-row-link {
  color: var(--jp-ink-3);
  font-size: 12px;
  letter-spacing: 0;
}

.jp-action:hover,
.jp-row-link:hover,
.jp-entity-link:hover,
.jp-signal-title:hover,
.jp-signal-meta:hover,
.jp-sch-title:hover {
  color: var(--jp-vermillion);
}

.jp-counters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 0.5px solid var(--jp-rule);
}

.jp-counter {
  display: grid;
  gap: 10px;
  padding: 32px 36px;
  border-right: 0.5px solid var(--jp-rule);
}

.jp-counter:last-child {
  border-right: 0;
}

.jp-counter-value {
  color: var(--jp-ink);
  font-size: 44px;
  font-weight: 200;
  letter-spacing: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.jp-counter-value sup {
  position: relative;
  top: -10px;
  margin-right: 4px;
  color: var(--jp-ink-3);
  font-size: 16px;
  font-weight: 300;
}

.jp-dual {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 1fr);
}

.jp-col {
  min-width: 0;
  padding: 32px 48px 48px;
}

@media (max-width: 1280px) {
  .jp-col {
    padding: 24px 28px 32px;
  }
}

.jp-col + .jp-col {
  border-left: 0.5px solid var(--jp-rule);
}

.jp-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
  padding-bottom: 12px;
  border-bottom: 0.5px solid var(--jp-ink);
}

.jp-section-head.small {
  margin-top: 8px;
}

.jp-section-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap;
}

.jp-section-left h2 {
  margin: 0;
  color: var(--jp-ink);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jp-section-head.small .jp-section-left h2 {
  font-size: 15px;
}

.jp-section-head em {
  flex: 0 1 auto;
  font-style: normal;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* On narrow rails, drop the JP subtitle so the English h2 + meta have room */
@media (max-width: 1280px) {
  .jp-section-head { gap: 4px 12px; }
  .jp-section-left h2 { font-size: 17px; }
  .jp-section-left > span { display: none; }
  .jp-section-head em { font-size: 10.5px; }
}

.jp-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 0.5px solid var(--jp-rule-soft);
}

.jp-row:hover,
.jp-signal:hover {
  background: var(--jp-paper-2);
}

.jp-row-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.jp-row-title,
.jp-entity-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--jp-ink);
  font-size: 14.5px;
  font-weight: 550;
  letter-spacing: 0;
  text-align: left;
}

.jp-entity-link.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
}

.jp-row-sub {
  max-width: 560px;
  color: var(--jp-ink-2);
  font-size: 12px;
  line-height: 1.5;
}

.jp-row-sub.muted {
  color: var(--jp-ink-3);
}

.jp-row-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--jp-ink-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0;
  white-space: nowrap;
}

.jp-row-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--jp-ink-3);
}

.jp-row-tag.deal {
  color: var(--jp-indigo);
}

.jp-row-tag.deal::before {
  background: var(--jp-indigo);
}

.jp-row-tag.imsg {
  color: var(--jp-kiiro);
}

.jp-row-tag.imsg::before {
  background: var(--jp-kiiro);
}

.jp-row-tag span {
  margin-left: 4px;
  color: var(--jp-ink-3);
}

.jp-signal {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: flex-start;
  padding: 22px 0;
  border-bottom: 0.5px solid var(--jp-rule-soft);
}

.jp-signal-num {
  padding-top: 4px;
}

.jp-signal-title {
  padding: 0;
  color: var(--jp-ink);
  font-size: 14.5px;
  font-weight: 550;
  text-align: left;
}

.jp-signal-sub {
  color: var(--jp-ink-2);
  font-size: 12px;
  line-height: 1.5;
}

.jp-signal-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  padding: 0;
  color: var(--jp-ink);
  font-variant-numeric: tabular-nums;
}

.jp-signal-meta span {
  font-size: 11px;
}

.jp-signal-meta em {
  color: var(--jp-ink-3);
  font-style: normal;
  font-size: 9.5px;
  text-transform: uppercase;
}

.jp-schedule {
  margin-top: 36px;
}

.jp-sch-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--jp-rule-soft);
}

.jp-sch-time {
  color: var(--jp-ink);
  font-variant-numeric: tabular-nums;
}

.jp-sch-title {
  padding: 0;
  color: var(--jp-ink);
  font-size: 13px;
  font-weight: 550;
  text-align: left;
}

.jp-sch-sub {
  margin-top: 2px;
  font-size: 11.5px;
}

.jp-sch-mark {
  width: 4px;
  height: 18px;
  background: var(--jp-rule);
}

.jp-sch-mark.now {
  background: var(--jp-vermillion);
}

.jp-schedule-empty,
.jp-empty {
  display: grid;
  gap: 8px;
  padding: 18px 0;
  color: var(--jp-ink-3);
  font-size: 12px;
}

.jp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 48px;
  border-top: 0.5px solid var(--jp-rule);
}

.jp-seal {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 0.5px solid var(--jp-vermillion);
  color: var(--jp-vermillion);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
}

.hero-copy {
  display: grid;
  gap: 4px;
  margin-bottom: 4px;
}

.hero-copy span {
  color: var(--fg-tertiary);
}

.hero-copy strong {
  font-size: 28px;
  line-height: 1.14;
}

.glass-card,
.stat-strip,
.deal-card,
.account-preview,
.activity-card,
.record-card,
.modal-card,
.command-card {
  background: var(--bg-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0.5px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.stat {
  padding: 14px 16px;
  background: transparent;
  border-right: 0.5px solid var(--border-soft);
}

.stat:last-child {
  border-right: 0;
}

.stat span {
  display: block;
  color: var(--fg-quaternary);
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--border-soft);
}

.section-head strong {
  font-size: 12px;
}

.section-head span,
.muted {
  color: var(--fg-tertiary);
}

.priority-list,
.activity-list,
.record-list {
  display: grid;
}

.priority-row,
.activity-row,
.record-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-top: 0.5px solid var(--border-soft);
}

.priority-row:first-child,
.activity-row:first-child,
.record-row:first-child {
  border-top: 0;
}

.rank {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: var(--bg-sunken);
  color: var(--fg-secondary);
  font-weight: 750;
  font-size: 11px;
}

.row-title {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.row-subtitle {
  color: var(--fg-tertiary);
  font-size: 11.5px;
  margin-top: 1px;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 1px 8px;
  border-radius: 0;
  background: var(--bg-sunken);
  color: var(--fg-secondary);
  font-size: 11px;
  font-weight: 650;
}

.pill.accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.pill.success {
  background: var(--success-soft);
  color: var(--success);
}

.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.inbox-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.thread-list {
  border-right: 0.5px solid var(--border);
  overflow-y: auto;
  background: var(--bg-base);
}

.conversation-list-head {
  display: flex;
  align-items: center;
  min-height: 70px;
  padding: 14px 18px 10px;
  background: var(--bg-base);
  border-bottom: 0.5px solid var(--border-soft);
}

.conversation-list-head strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.conversation-list-head span {
  display: block;
  margin-top: 3px;
  color: var(--fg-tertiary);
  font-size: 11.5px;
}

.thread-filters {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 4px;
  padding: 8px 14px 10px;
  overflow-x: auto;
  background: var(--bg-base);
  backdrop-filter: none;
  border-bottom: 0.5px solid var(--border);
}

.filter-chip {
  min-height: 26px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg-tertiary);
  padding: 0 10px;
  white-space: nowrap;
}

.filter-chip.active {
  background: var(--fg);
  color: var(--bg-surface);
  font-weight: 650;
}

.account-preview {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 16px;
  border: 0;
  border-bottom: 0.5px solid var(--border-soft);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  text-align: left;
}

.account-preview.active {
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--bg-base));
  box-shadow: inset 2px 0 0 var(--accent);
}

.account-preview .avatar {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

.account-preview-head {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.account-preview-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
}

.account-preview-head time {
  margin-left: auto;
  color: var(--fg-tertiary);
  font-size: 10.5px;
}

.account-subtitle {
  display: block;
  margin-top: 1px;
  color: var(--fg-tertiary);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-snippet {
  margin-top: 5px;
  color: var(--fg-secondary);
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.account-preview-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--fg-tertiary);
  font-size: 10.5px;
}

.channel-tag,
.channel-chip {
  --channel-color: var(--fg-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 19px;
  border-radius: 0;
  padding: 1px 7px;
  border: 0.5px solid color-mix(in srgb, var(--channel-color) 24%, transparent);
  background: color-mix(in srgb, var(--channel-color) 12%, white);
  color: color-mix(in srgb, var(--channel-color) 78%, black);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.channel-source-button {
  cursor: pointer;
}

.channel-source-button:hover {
  filter: saturate(1.12);
  box-shadow: inset 0 0 0 0.5px currentColor;
}

.channel-tag.phone,
.channel-chip.phone,
.channel-mark.phone,
.message-row.phone {
  --channel-color: var(--accent);
}

.channel-tag.mail,
.channel-chip.mail,
.channel-mark.mail,
.message-row.mail {
  --channel-color: var(--indigo);
}

.channel-tag.social,
.channel-chip.social,
.channel-mark.social,
.message-row.social {
  --channel-color: #5d4f76;
}

.channel-tag.chat,
.channel-chip.chat,
.channel-mark.chat,
.message-row.chat {
  --channel-color: var(--success);
}

.channel-tag.note,
.channel-chip.note,
.channel-mark.note,
.message-row.note {
  --channel-color: var(--warn);
}

.channel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--channel-color);
}

.stage-mini,
.unread-dot {
  min-height: 19px;
  display: inline-flex;
  align-items: center;
  border-radius: 0;
  padding: 1px 7px;
  background: var(--bg-sunken);
  color: var(--fg-secondary);
  font-size: 10px;
  font-weight: 700;
}

.unread-dot {
  min-width: 19px;
  justify-content: center;
  background: var(--accent);
  color: white;
  padding: 0 6px;
}

.account-detail {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-app);
}

.account-thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 86px;
  padding: 16px 22px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg-base);
}

.account-thread-head .rail-profile {
  display: flex;
  align-items: center;
  justify-items: initial;
  text-align: left;
  gap: 10px;
  flex: 1;
}

.account-thread-head .rail-profile .avatar {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.account-thread-head h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.thread-channel-line {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--fg-tertiary);
  font-size: 11px;
}

.ai-summary {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  margin: 16px 22px 0;
  padding: 12px 14px;
  border: 0.5px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 0;
  background: var(--accent-soft);
}

.summary-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: var(--bg-surface);
  color: var(--accent);
}

.ai-summary strong,
.ai-summary span {
  display: block;
}

.ai-summary strong {
  font-size: 12.5px;
}

.ai-summary span {
  margin-top: 2px;
  color: var(--fg-secondary);
  font-size: 11.5px;
}

.deal-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 22px 0;
}

.account-context {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) minmax(140px, 0.8fr);
  gap: 1px;
  border-bottom: 0.5px solid var(--border);
  background: var(--border-soft);
}

.account-context > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px 16px;
  background: var(--bg-surface);
}

.account-context span {
  color: var(--fg-quaternary);
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
}

.account-context strong {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 12px;
}

.account-timeline {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 22px 24px;
}

.timeline-inner {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  align-content: start;
  gap: 0;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.timeline-day {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--bg-surface);
  color: var(--fg-tertiary);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.timeline-day::before,
.timeline-day::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border-soft);
}

.message-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 16px;
  border-top: 0.5px solid var(--border-soft);
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--channel-color) 28%, transparent);
}

.timeline-day + .message-row {
  border-top: 0;
}

.message-row.outbound {
  background: color-mix(in srgb, var(--paper-2) 54%, var(--bg-surface));
}

.message-avatar {
  width: 28px;
  height: 28px;
  font-size: 10px;
  background: color-mix(in srgb, var(--channel-color) 82%, black);
}

.message-content {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.message-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--fg-tertiary);
  font-size: 11.5px;
}

.message-meta strong {
  color: var(--fg);
}

.message-subject {
  font-weight: 700;
}

.message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13.5px;
  line-height: 1.55;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.message-attachments span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 0;
  padding: 1px 8px;
  background: var(--bg-sunken);
  color: var(--fg-secondary);
  font-size: 11px;
  font-weight: 650;
}

.reply-composer {
  display: grid;
  gap: 10px;
  padding: 12px 22px 16px;
  border-top: 0.5px solid var(--border-soft);
  background: var(--bg-base);
}

.composer-channels,
.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-channel {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.composer-channel.active {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.reply-composer textarea {
  width: 100%;
  min-height: 54px;
  resize: vertical;
  border: 0.5px solid var(--border);
  border-radius: 0;
  background: var(--bg-surface);
  color: var(--fg);
  outline: 0;
  padding: 10px 12px;
  font: inherit;
}

.reply-composer textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.composer-status {
  flex: 1;
  color: var(--fg-tertiary);
  font-size: 11px;
}

.pipeline-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pipeline-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 14px 24px 0;
}

.pipeline-picker {
  min-width: 260px;
  display: grid;
  gap: 5px;
}

.pipeline-picker > span,
.settings-field span,
.stage-editor label span,
.email-compose-form label span {
  color: var(--fg-tertiary);
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
}

.pipeline-picker select {
  min-height: 32px;
  background-color: var(--bg-surface);
  font-weight: 650;
}

.custom-select {
  position: relative;
  min-width: 260px;
}

.custom-select-button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  padding: 0 42px 0 14px;
  border: 0.5px solid var(--border);
  border-radius: 0;
  background: var(--bg-surface);
  color: var(--fg);
  font-size: 14px;
  font-weight: 760;
  text-align: left;
}

.custom-select-button::before,
.custom-select-button::after {
  content: "";
  position: absolute;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--fg);
  border-bottom: 2px solid var(--fg);
  opacity: 0.86;
}

.custom-select-button::before {
  top: 12px;
  transform: rotate(225deg);
}

.custom-select-button::after {
  bottom: 12px;
  transform: rotate(45deg);
}

.custom-select-button:hover {
  border-color: color-mix(in oklab, var(--fg) 35%, var(--border));
}

.custom-select[data-select-open="true"] .custom-select-button,
.custom-select-button:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: 0;
}

.custom-select-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  border: 0.5px solid var(--border-strong);
  border-radius: 0;
  background: var(--bg-base);
  box-shadow: 0 18px 38px rgb(28 25 20 / 18%);
}

.custom-select[data-select-open="true"] .custom-select-menu {
  display: grid;
}

.custom-select-option {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-size: 14px;
  font-weight: 720;
  text-align: left;
}

.custom-select-option::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1px solid var(--border-strong);
  background: transparent;
}

.custom-select-option:hover,
.custom-select-option:focus {
  background: var(--bg-sunken);
  outline: 0;
}

.custom-select-option[aria-selected="true"] {
  background: var(--fg);
  color: var(--bg-base);
}

.custom-select-option[aria-selected="true"]::before {
  border-color: currentColor;
  background: currentColor;
  box-shadow: inset 0 0 0 2px var(--fg);
}

.pipeline-settings {
  display: grid;
  gap: 12px;
  max-height: 42vh;
  overflow-y: auto;
  margin: 12px 24px 0;
  padding: 14px;
  border: 0.5px solid var(--border);
  border-radius: 0;
  background: var(--bg-surface);
  box-shadow: none;
}

.settings-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-head > div {
  flex: 1;
  display: grid;
  gap: 2px;
}

.settings-head span {
  color: var(--fg-tertiary);
  font-size: 11.5px;
}

.settings-field {
  display: grid;
  gap: 6px;
}

.stage-editor-list {
  display: grid;
  gap: 10px;
}

.stage-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 0.5px solid var(--border-soft);
  border-radius: 0;
  background: var(--bg-base);
}

.stage-editor-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 0.7fr) minmax(120px, 0.6fr);
  gap: 10px;
}

.stage-editor-grid.wide {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.stage-editor label {
  display: grid;
  gap: 5px;
}

.stage-editor textarea,
.email-compose-form textarea {
  resize: vertical;
}

.stage-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipeline-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg-base);
}

.pipeline-stat {
  min-width: 150px;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 0.5px solid var(--border-soft);
  border-radius: 0;
  background: var(--bg-surface);
  box-shadow: none;
}

.pipeline-stat span {
  color: var(--fg-tertiary);
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
}

.pipeline-stat strong {
  font-size: 17px;
}

.pipeline-stat em {
  color: var(--fg-quaternary);
  font-size: 10.5px;
  font-style: normal;
}

.pipeline-new {
  min-width: 104px;
}

.pipeline-status {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  color: var(--fg-tertiary);
  font-size: 11px;
}

.pipeline-inline-detail {
  display: none;
}

.pipeline-board {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scroll-behavior: auto;
  padding: 18px 24px 22px;
}

.stage-track {
  display: flex;
  gap: 12px;
  height: 100%;
  min-width: max-content;
}

.stage-column {
  width: 304px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.stage-column.drag-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--bg-surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.stage-header {
  display: grid;
  gap: 9px;
  padding: 13px 14px 12px;
  background: var(--bg-surface);
  border-bottom: 0.5px solid var(--border);
}

.stage-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-dot {
  width: 9px;
  height: 9px;
  border-radius: 0;
  background: var(--accent);
}

.stage-title strong {
  flex: 1;
  font-size: 14px;
}

.stage-add-deal {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 0.5px solid var(--border-soft);
  background: var(--bg-surface);
  color: var(--fg-tertiary);
  font-size: 16px;
  line-height: 1;
}

.stage-add-deal:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.stage-note {
  color: var(--fg-tertiary);
  font-size: 11.5px;
  line-height: 1.4;
}

.stage-note span {
  color: var(--fg);
  font-weight: 700;
}

.stage-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--fg-quaternary);
  font-size: 10.5px;
}

.stage-summary strong {
  color: var(--fg-secondary);
}

.deal-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  scroll-behavior: auto;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.deal-card {
  display: grid;
  gap: 11px;
  padding: 13px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  box-shadow: none;
  position: relative;
  cursor: pointer;
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.deal-card:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  transform: translateY(-1px);
}

.deal-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.deal-card.dragging {
  opacity: 0.48;
  cursor: grabbing;
  transform: rotate(0.5deg) scale(0.985);
  box-shadow: none;
}

/* While a deal is sliding to its new stage column (FLIP animation): lift
   it slightly so it reads as "in motion" above the rest of the board. */
.deal-card.deal-card-moving {
  box-shadow: 0 12px 32px -8px rgba(22, 20, 15, 0.28);
  pointer-events: none;
}

/* On landing, a brief vermillion flash confirms "I just arrived here". */
@keyframes dealCardLanded {
  0%   { box-shadow: 0 0 0 0 rgba(196, 72, 43, 0.55); background-color: rgba(196, 72, 43, 0.06); }
  60%  { box-shadow: 0 0 0 4px rgba(196, 72, 43, 0.0); background-color: rgba(196, 72, 43, 0.04); }
  100% { box-shadow: 0 0 0 0 rgba(196, 72, 43, 0); background-color: transparent; }
}

.deal-card.deal-card-flash {
  animation: dealCardLanded 600ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .deal-card.deal-card-moving { box-shadow: none; }
  .deal-card.deal-card-flash { animation: none; outline: 1.5px solid var(--accent); outline-offset: -1px; }
}

.deal-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 0;
  background: var(--accent);
}

.deal-card.selected::before {
  width: 4px;
}

.deal-drag-handle {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg-quaternary);
  cursor: grab;
}

.deal-drag-handle:hover {
  background: var(--bg-sunken);
  color: var(--fg-secondary);
}

.deal-drag-handle:active {
  cursor: grabbing;
}

.quartet-app.is-pipeline-dragging .pipeline-board,
.quartet-app.is-pipeline-dragging .deal-list {
  overscroll-behavior: none;
}

.deal-card-head {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-right: 22px;
}

.deal-card-head .avatar {
  width: 30px;
  height: 30px;
  background: var(--indigo);
}

.deal-title strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.25;
}

.deal-title span,
.deal-meta,
.checklist-label {
  color: var(--fg-tertiary);
  font-size: 11.5px;
}

.deal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.deal-card select {
  width: 100%;
  min-height: 32px;
  background-color: var(--bg-surface);
  font-weight: 650;
}

.deal-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 0;
  background: var(--bg-sunken);
}

.deal-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.checklist {
  display: grid;
  gap: 7px;
}

.checklist-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.checklist-row input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.checklist-note-input {
  grid-column: 2;
  width: 100%;
  min-height: 28px;
  margin-top: -2px;
  background: var(--bg-surface);
  border-style: dashed;
  color: var(--fg-secondary);
  opacity: 0;
  transform: translateY(-2px);
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.checklist-row:hover .checklist-note-input,
.checklist-row:focus-within .checklist-note-input,
.checklist-note-input:not(:placeholder-shown) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.empty-state,
.empty-column {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: var(--fg-tertiary);
  border: 0.5px dashed var(--border);
  border-radius: 0;
  padding: 16px;
  text-align: center;
}

.empty-column {
  min-height: 132px;
  font-size: 12px;
  background: var(--bg-base);
  border-color: var(--border-soft);
}

.empty-add-deal {
  width: 100%;
  cursor: pointer;
  color: var(--fg-tertiary);
}

.empty-add-deal strong,
.empty-add-deal span {
  display: block;
}

.empty-add-deal strong {
  color: var(--fg-secondary);
  font-size: 13px;
}

.empty-add-deal span {
  margin-top: 4px;
  font-size: 11.5px;
}

.empty-add-deal:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.activity-view,
.records-view,
.settings-view {
  height: 100%;
  overflow-y: auto;
  padding: 20px 24px;
}

.email-workspace {
  height: 100%;
  overflow-y: auto;
  padding: 20px 24px;
  display: grid;
  align-content: start;
  grid-template-columns: minmax(360px, 0.86fr) minmax(500px, 1.14fr);
  gap: 18px;
}

.settings-inner {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.email-connect,
.email-compose-card {
  align-self: start;
}

.email-list-card,
.email-compose-card {
  overflow: hidden;
}

.email-list-card .section-head,
.email-compose-card .section-head {
  align-items: flex-start;
  justify-content: space-between;
}

.email-list-card .section-head span,
.email-compose-card .section-head span {
  max-width: 520px;
  line-height: 1.35;
}

.mail-provider-grid,
.mailbox-list,
.email-message-list,
.email-compose-form {
  display: grid;
  gap: 10px;
}

.mail-provider-card,
.mailbox-row,
.email-message-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 0.5px solid var(--border-soft);
  border-radius: 0;
  background: var(--bg-surface);
}

.mail-provider-card {
  grid-template-columns: 34px minmax(0, 1fr);
}

.mail-provider-card input,
.mail-provider-card button,
.mail-provider-card .form-status {
  grid-column: 1 / -1;
}

.mail-provider-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 0;
  background: var(--accent-soft);
  color: var(--accent);
}

.mail-provider-card strong,
.mail-provider-card span,
.mailbox-row strong,
.mailbox-row span,
.email-message-row strong,
.email-message-row span {
  min-width: 0;
}

.mail-provider-card > div:nth-child(3),
.mailbox-row > div,
.email-message-row > div:first-child {
  display: grid;
  gap: 2px;
}

.mail-provider-card span,
.mailbox-row span,
.email-message-row span {
  color: var(--fg-tertiary);
  font-size: 11.5px;
}

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

.mailbox-row .mono {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  color: var(--fg-secondary);
}

.email-compose-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.email-compose-form label {
  display: grid;
  gap: 8px;
}

.email-compose-form {
  padding: 16px;
}

.email-compose-form input,
.email-compose-form select,
.email-compose-form textarea {
  width: 100%;
}

.email-compose-form textarea {
  min-height: 220px;
  padding-top: 10px;
}

.email-tracking-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 0;
  background: var(--bg-sunken);
}

.email-list-card {
  min-height: 0;
}

.email-inbox-list {
  max-height: calc(100vh - 166px);
  overflow-y: auto;
}

.email-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 16px;
  border-bottom: 0.5px solid var(--border-soft);
  background: var(--bg-surface);
}

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

.email-row-main,
.email-row-meta {
  min-width: 0;
}

.email-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.email-row-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.email-row-head time {
  margin-left: auto;
  color: var(--fg-tertiary);
  font-size: 10.5px;
}

.email-row-meta {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  max-width: none;
}

.email-list-row .latest-snippet {
  max-width: none;
  margin-top: 10px;
}

.activity-inner,
.records-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.records-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.records-toolbar > div:first-child {
  display: grid;
  gap: 2px;
}

.records-toolbar strong {
  font-size: 15px;
}

.records-toolbar span {
  color: var(--fg-tertiary);
}

.records-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.contact-cadence-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.contacts-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 280px;
  min-width: 200px;
  max-width: 420px;
  padding: 0 8px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg-base);
  color: var(--fg-tertiary);
  transition: border-color 120ms ease;
}

.contacts-search:focus-within {
  border-color: var(--fg-secondary);
}

.contacts-search .svg-icon {
  flex: 0 0 auto;
  color: var(--fg-tertiary);
}

.contacts-search-input {
  flex: 1 1 auto;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  padding: 8px 4px;
  color: var(--fg);
  min-width: 0;
}

.contacts-search-input::placeholder {
  color: var(--fg-tertiary);
}

.contacts-search-input::-webkit-search-cancel-button {
  display: none;
}

.contacts-search-clear {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--fg-tertiary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contacts-search-clear:hover {
  background: rgba(22, 20, 15, 0.06);
  color: var(--fg);
}

.contact-cadence-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0.5px solid var(--border);
  background: transparent;
  color: var(--fg-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 999px;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.contact-cadence-chip em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-tertiary);
}

.contact-cadence-chip:hover {
  border-color: var(--fg-secondary);
  color: var(--fg);
}

.contact-cadence-chip.active {
  background: var(--fg);
  color: var(--bg-base);
  border-color: var(--fg);
}

.contact-cadence-chip.active em {
  color: var(--bg-base);
  opacity: 0.7;
}

.contacts-bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: #fff8e0;
  border: 0.5px solid #d8c074;
  border-radius: 8px;
  flex-wrap: wrap;
}

.contacts-bulk-count {
  font-size: 13px;
}

.contacts-bulk-cadence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--fg-secondary);
}

.contacts-bulk-cadence select {
  min-height: 30px;
  padding: 4px 8px;
  border: 0.5px solid var(--border);
  background: var(--bg-base);
  font-size: 12px;
}

.danger-button {
  color: #b03030;
  border-color: #d8a0a0;
}

.danger-button:hover {
  background: #fff0f0;
  border-color: #b03030;
  color: #8a1f1f;
}

.contacts-table-checkbox-cell {
  width: 38px;
  text-align: center;
  padding: 0 4px;
}

.contacts-table-checkbox-cell input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.contact-row.is-bulk-checked {
  background: #fff8e0;
}

.record-card.is-bulk-checked {
  outline: 2px solid #d8a200;
  outline-offset: -2px;
}

.record-card-select {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.record-card-select input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.contact-cadence-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  background: #f1efe9;
  color: #4a4740;
}

.contact-cadence-tag.jp-cad-weekly {
  background: #e2ebef;
  color: #2b3a55;
}

.contact-cadence-tag.jp-cad-monthly {
  background: #ece4d2;
  color: #6b5424;
}

.contact-cadence-tag.jp-cad-quarterly {
  background: #e6dde9;
  color: #4d3367;
}

.contact-cadence-tag.contact-cadence-tag-overdue {
  background: #fde2d6;
  color: #8a3a14;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  padding: 0;
  border: 0.5px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.segmented-control button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg-tertiary);
  font-weight: 750;
}

.segmented-control button.active {
  background: var(--fg);
  color: var(--bg-surface);
  box-shadow: none;
}

.camera-import-button {
  width: 34px;
  min-height: 34px;
  border: 0.5px solid var(--border-soft);
  background: var(--bg-surface);
  color: var(--accent);
}

.contact-import-panel {
  overflow: hidden;
}

.contact-import-actions {
  padding: 12px 12px 0;
}

.camera-import-action {
  width: 100%;
  min-height: 34px;
  border: 0.5px solid var(--border-soft);
  background: var(--bg-surface);
  color: var(--accent);
  font-weight: 800;
}

.contact-provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.contact-provider-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 0.5px solid var(--border-soft);
  border-radius: 0;
  background: var(--bg-surface);
}

.contact-provider-card input,
.contact-provider-card button,
.contact-provider-card .form-status {
  grid-column: 1 / -1;
}

.contact-provider-card > div:nth-child(3) {
  display: grid;
  gap: 2px;
}

.contact-provider-card span,
.contact-sync-row {
  color: var(--fg-tertiary);
  font-size: 11.5px;
}

.contact-sync-list {
  display: grid;
  gap: 1px;
  padding: 0 12px 12px;
}

.contact-sync-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 0;
  background: var(--bg-sunken);
}

.contact-sync-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
}

.contact-sync-row em {
  font-style: normal;
}

.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.record-card {
  padding: 14px;
  position: relative;
}

.record-card h3 {
  margin: 0 0 3px;
  font-size: 14px;
}

.records-table-wrap {
  overflow: auto;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.records-table th,
.records-table td {
  padding: 11px 12px;
  border-bottom: 0.5px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
}

.records-table th {
  color: var(--fg-quaternary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.records-table tbody tr:hover {
  background: var(--bg-sunken);
}

.records-table td {
  color: var(--fg-secondary);
}

.records-table td:first-child,
.records-table td:nth-child(4) {
  color: var(--fg);
}

.table-person {
  display: grid;
  grid-template-columns: 26px minmax(140px, 1fr);
  gap: 8px;
  align-items: center;
}

.table-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.rail-section {
  padding: 16px 18px;
  border-bottom: 0.5px solid var(--border);
}

.rail-deal-hero {
  position: relative;
  display: grid;
  gap: 14px;
  background: color-mix(in srgb, var(--accent-soft) 54%, var(--bg-base));
}

.rail-close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  min-height: 28px;
  padding: 0;
  color: var(--fg-quaternary);
}

.rail-detail-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding-right: 28px;
}

.rail-detail-head .avatar {
  width: 46px;
  height: 46px;
  background: var(--indigo);
}

.rail-eyebrow,
.rail-checklist-heading {
  color: var(--fg-quaternary);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.rail-deal-name {
  display: block;
  margin: 1px 0 2px;
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.2;
}

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

.rail-metrics > div {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 0.5px solid var(--border-soft);
  border-radius: 0;
  background: var(--bg-surface);
}

.rail-metrics span,
.rail-select-row > span {
  color: var(--fg-tertiary);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.rail-metrics strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.rail-progress {
  background: var(--bg-sunken);
}

.rail-select-row {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.rail-select-row select {
  width: 100%;
  min-height: 32px;
  background-color: var(--bg-surface);
  font-weight: 650;
}

.rail-title {
  color: var(--fg-quaternary);
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.rail-profile {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.rail-profile .avatar {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.rail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}

.rail-row span:first-child {
  color: var(--fg-tertiary);
}

.rail-row strong {
  min-width: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.rail-channel-row,
.signal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 0.5px solid var(--border-soft);
}

.rail-message {
  padding: 8px 0;
  border-top: 0.5px solid var(--border-soft);
}

.rail-message:first-child {
  border-top: 0;
  padding-top: 0;
}

.rail-message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-tertiary);
  margin-bottom: 3px;
}

.rail-message-from {
  color: var(--fg);
  font-weight: 600;
}

.rail-message-time {
  margin-left: auto;
}

.rail-message-snippet {
  font-size: 12px;
  color: var(--fg-secondary);
  line-height: 1.4;
}

.rail-empty {
  font-size: 12px;
  color: var(--fg-tertiary);
  padding: 4px 0;
}

.rail-channel-row:first-of-type,
.signal-row:first-of-type {
  border-top: 0;
}

.rail-channel-row strong,
.signal-row strong {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11px;
}

.rail-wide-button {
  width: 100%;
  margin-top: 12px;
  box-shadow: inset 0 0 0 0.5px var(--border-soft);
}

.rail-checklist-heading {
  margin: 12px 0 6px;
}

.rail-checklist-heading:first-child {
  margin-top: 0;
}

.rail-checklist-row {
  padding: 5px 0;
}

.rail-event-list {
  display: grid;
  gap: 8px;
}

.rail-event {
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border: 0.5px solid var(--border-soft);
  border-radius: 0;
  background: var(--bg-surface);
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--channel-color) 36%, transparent);
}

.rail-event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--fg-quaternary);
  font-size: 10.5px;
}

.rail-event strong {
  font-size: 12px;
}

.rail-event > span {
  color: var(--fg-secondary);
  font-size: 11.5px;
  line-height: 1.42;
}

.signal-row span {
  color: var(--fg-tertiary);
}

.latest-snippet {
  margin-top: 10px;
  padding: 10px 11px;
  border-radius: 0;
  background: var(--bg-sunken);
  color: var(--fg-secondary);
  font-size: 11.5px;
  line-height: 1.45;
}

.rail-form {
  display: grid;
  gap: 10px;
}

.rail-form label,
.modal-card label {
  display: grid;
  gap: 5px;
}

.rail-form label span,
.modal-card label span {
  color: var(--fg-tertiary);
  font-size: 11px;
  font-weight: 650;
}

.form-status {
  min-height: 18px;
  color: var(--fg-tertiary);
  font-size: 11px;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(22 20 15 / 0.28);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.modal-card {
  width: min(560px, 100%);
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--glass-3);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-head h2 {
  margin: 0;
  font-size: 15px;
}

.modal-head .icon-button {
  margin-left: auto;
  width: 30px;
  padding: 0;
}

.modal-actions {
  justify-content: flex-end;
}

.modal-actions .form-status {
  margin-right: auto;
}

.business-card-modal {
  width: min(720px, 100%);
  max-height: min(860px, 92vh);
  overflow-y: auto;
}

.camera-stage {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border: 0.5px solid var(--border-soft);
  border-radius: 0;
  background: var(--bg-sunken);
}

.camera-stage video,
.camera-stage canvas {
  width: 100%;
  min-height: 210px;
  display: block;
  object-fit: cover;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--fg-tertiary);
  font-weight: 700;
}

.camera-actions,
.business-card-grid {
  display: grid;
  gap: 10px;
}

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

.file-capture-button {
  cursor: pointer;
}

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

.command-card {
  width: min(560px, 92vw);
  overflow: hidden;
  background: var(--glass-3);
}

.command-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--border-soft);
}

.command-input-row input {
  flex: 1;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.command-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 4px;
}

.command-result {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  padding: 0 10px;
  text-align: left;
}

.command-result:hover {
  background: var(--accent-soft);
}

@media (max-width: 1120px) {
  .quartet-app {
    --sidebar-width: 220px;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .quartet-app[data-current-view="pipeline"] {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .quartet-app[data-detail-rail-collapsed="true"],
  .quartet-app[data-current-view="pipeline"][data-detail-rail-collapsed="true"] {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .detail-rail {
    display: none;
  }

  .quartet-app[data-current-view="pipeline"] .detail-rail {
    display: none;
  }

  .rail-reveal-button {
    display: none;
  }

  .email-workspace {
    grid-template-columns: 1fr;
  }

  .email-inbox-list {
    max-height: none;
  }

  .jp-dual {
    grid-template-columns: 1fr;
  }

  .jp-col + .jp-col {
    border-left: 0;
    border-top: 0.5px solid var(--jp-rule);
  }

  .stage-editor-grid,
  .stage-editor-grid.wide {
    grid-template-columns: 1fr 1fr;
  }

  .pipeline-inline-detail:not(:empty) {
    display: grid;
    max-height: 46vh;
    overflow-y: auto;
    margin: 0 24px;
    border: 0.5px solid var(--border);
    border-radius: 0;
    background: var(--bg-surface);
    box-shadow: none;
  }

  .pipeline-inline-detail .rail-section:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  .auth-shell {
    place-items: stretch;
    padding: 14px;
  }

  .auth-panel {
    align-self: center;
    padding: 16px;
  }

  .auth-copy h1 {
    font-size: 23px;
  }

  .auth-form,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .plan-card {
    min-height: 0;
  }

  .quartet-app {
    grid-template-columns: 1fr;
  }

  .quartet-app[data-current-view="pipeline"] {
    grid-template-columns: 1fr;
  }

  .quartet-app[data-detail-rail-collapsed="true"],
  .quartet-app[data-current-view="pipeline"][data-detail-rail-collapsed="true"] {
    grid-template-columns: 1fr;
  }

  .main-shell {
    min-height: 0;
    padding-bottom: 64px;
  }

  .view-pane {
    min-height: 0;
  }

  .jp-topbar,
  .jp-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .jp-topbar {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .jp-eyebrow,
  .jp-topbar-sep,
  .jp-topbar-date {
    display: none;
  }

  .jp-topbar-row {
    min-height: 34px;
  }

  .jp-topbar-greeting {
    font-size: 18px;
  }

  .jp-topbar .jp-search {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    min-height: 34px;
    padding: 6px 0;
  }

  .jp-topbar-actions {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0;
  }

  .jp-action {
    min-height: 34px;
    padding: 0 8px;
  }

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

  .jp-counter {
    min-width: 0;
    padding: 20px 16px;
  }

  .jp-counter:nth-child(2) {
    border-right: 0;
  }

  .jp-counter:nth-child(1),
  .jp-counter:nth-child(2) {
    border-bottom: 0.5px solid var(--jp-rule);
  }

  .jp-counter-value {
    font-size: clamp(28px, 10vw, 36px);
  }

  .jp-counter-foot {
    white-space: normal;
  }

  .jp-col {
    padding: 24px 16px 34px;
  }

  .jp-section-head,
  .jp-section-left,
  .jp-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .jp-row {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 9px 12px;
    padding: 16px 0;
  }

  .jp-row-tag,
  .jp-row-link {
    grid-column: 2;
    justify-self: start;
  }

  .jp-row-title,
  .jp-entity-link {
    white-space: normal;
  }

  .jp-row-sub {
    max-width: 100%;
  }

  .jp-signal,
  .jp-sch-row {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .jp-signal-meta,
  .jp-sch-mark {
    grid-column: 2;
    justify-self: start;
  }

  .pipeline-inline-detail:not(:empty) {
    margin: 0 14px;
  }

  .pipeline-board {
    padding: 14px;
  }

  .stage-track {
    gap: 10px;
  }

  .stage-column {
    width: min(82vw, 320px);
  }

  .pipeline-stats {
    align-items: stretch;
    flex-wrap: wrap;
    padding: 12px 14px;
  }

  .pipeline-stat {
    min-width: calc(50% - 5px);
    flex: 1 1 calc(50% - 5px);
  }

  .pipeline-new {
    width: 100%;
  }

  .email-workspace,
  .activity-view,
  .records-view,
  .settings-view {
    padding: 14px;
    padding-bottom: 86px;
  }

  .email-workspace {
    gap: 12px;
  }

  .email-compose-form {
    padding: 14px;
  }

  .email-compose-form textarea {
    min-height: 160px;
  }

  .pipeline-toolbar,
  .settings-head,
  .records-toolbar,
  .today-top-grid,
  .email-list-row,
  .contact-provider-grid,
  .camera-actions,
  .business-card-grid,
  .email-compose-grid {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .segmented-control {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .email-row-meta {
    justify-content: flex-start;
    max-width: none;
  }

  .pipeline-toolbar {
    padding: 14px 14px 0;
    flex-wrap: wrap;
    gap: 8px;
  }

  .pipeline-toolbar .pipeline-picker {
    flex: 1 1 100%;
    min-width: 0;
  }

  .pipeline-settings {
    margin: 12px 14px 0;
  }

  .stage-editor-grid,
  .stage-editor-grid.wide {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 35;
    display: block;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    min-height: 0;
    overflow: visible;
    padding: 0 0 env(safe-area-inset-bottom, 0px);
    border-top: 0.5px solid var(--border);
    border-right: 0;
    background: var(--bg-base);
  }

  .workspace-mark,
  .command-trigger,
  .sidebar > .primary-action,
  .sidebar-label,
  .sidebar nav[aria-label="Records"],
  .data-mode-toggle,
  .sidebar-footer {
    display: none;
  }

  .sidebar nav[aria-label="Main navigation"] {
    height: 60px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .quartet-app[data-sidebar-collapsed="true"] .sidebar {
    align-items: stretch;
    gap: 0;
    padding: 0;
  }

  .quartet-app[data-sidebar-collapsed="true"] .nav-group {
    width: 100%;
    justify-items: stretch;
  }

  /* Bottom-nav tab: icon over label, active state in vermillion. */
  .sidebar nav[aria-label="Main navigation"] .nav-item {
    min-width: 0;
    width: auto;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 6px 4px 8px;
    border-bottom: 0;
    border-right: 0;
    font-size: 10.5px;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--fg-tertiary, #8a857b);
    position: relative;
  }

  .sidebar nav[aria-label="Main navigation"] .nav-item.active {
    color: var(--accent, #c4482b);
    font-weight: 600;
  }

  .sidebar nav[aria-label="Main navigation"] .nav-item .nav-icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
  }

  .sidebar nav[aria-label="Main navigation"] .nav-item .nav-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
  }

  .sidebar nav[aria-label="Main navigation"] .nav-item.active .nav-icon {
    color: var(--accent, #c4482b);
  }

  /* Replace the left-bar active indicator with a top dot above the icon. */
  .sidebar nav[aria-label="Main navigation"] .nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 0;
    margin: 0;
    transform: none;
    background: transparent;
  }

  .sidebar nav[aria-label="Main navigation"] .nav-item.active::before {
    width: 24px;
    height: 2px;
    transform: translateX(-50%);
    background: var(--accent, #c4482b);
  }

  .sidebar nav[aria-label="Main navigation"] .nav-item kbd {
    display: none;
  }

  .sidebar nav[aria-label="Main navigation"] .nav-item .nav-count {
    position: absolute;
    top: 6px;
    right: 18%;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--accent, #c4482b);
    color: var(--bg-base, #f7f6f2);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 9.5px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
  }

  .sidebar nav[aria-label="Main navigation"] .nav-item .nav-count:empty,
  .sidebar nav[aria-label="Main navigation"] .nav-item .nav-count[data-count="0"] {
    display: none;
  }

  .quartet-app[data-sidebar-collapsed="true"] .sidebar nav[aria-label="Main navigation"] .nav-item > span:not(.nav-icon):not(.nav-count) {
    display: inline;
  }

  .main-shell {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .view-header {
    align-items: stretch;
    flex-direction: column;
    min-height: auto;
    padding: 14px;
  }

  .header-actions {
    margin-left: 0;
  }

  .search-input {
    width: 100%;
  }

  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .account-context {
    grid-template-columns: 1fr;
  }

  .account-thread-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-thread-head .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .account-thread-head .header-actions .primary-action {
    flex: 1;
  }

  .thread-list {
    max-height: 320px;
    border-right: 0;
    border-bottom: 0.5px solid var(--border);
  }

  .timeline-inner {
    border-radius: var(--r-md);
  }

  .message-row {
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 14px;
  }

  .reply-composer {
    padding: 12px 14px 14px;
  }

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

  /* ── Cadence: full-width tray docked above the bottom nav ──────────── */
  .cadence-page {
    padding-bottom: 0;
  }

  .cad-tray {
    left: 0;
    right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    z-index: 36;
  }

  .cad-tray.is-collapsed {
    transform: translateY(calc(100% - 44px));
  }

  .cad-tray-head {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .cad-tray-head-l {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1 1 auto;
  }

  .cad-tray-title {
    font-size: 14px;
  }

  .cad-tray-eyebrow,
  .cad-tray-sub {
    font-size: 10px;
  }

  .cad-tray-toggle {
    flex: 0 0 auto;
    padding: 6px 10px;
  }

  .cad-tray-body {
    padding: 12px 16px 14px;
    gap: 10px 12px;
    max-height: 200px;
  }

  .cad-tray.is-expanded .cad-tray-body {
    max-height: calc(70vh - 60px);
  }

  .cad-tray-filters {
    flex-wrap: wrap;
    width: 100%;
  }

  /* ── Cadence main body on mobile ────────────────────────────────────── */
  .cad-page-head {
    padding: 24px 16px 16px;
  }

  .cad-cohort {
    padding: 16px;
  }

  .cad-card {
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .cad-card-suggest {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  /* ── Pipeline header collapses extra controls on mobile ─────────────── */
  .pipeline-toolbar #pipelineSettingsToggle,
  .pipeline-toolbar #pipelineDuplicate {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Pipedrive import is desktop-only — mobile users won't have a CSV. */
  .pipeline-toolbar #pipelinePipedriveImport {
    display: none;
  }

  /* ── Today header: keep eyebrow + date on a single line on mobile ──── */
  .today-v3 .today-header-line {
    flex-wrap: nowrap;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
  }

  .today-v3 .today-header-eyebrow,
  .today-v3 .today-header-date {
    flex: 0 0 auto;
  }

  /* The JP gloss eats horizontal room on phones — drop it under 760px. */
  .today-v3 .today-header-eyebrow .jp,
  .today-v3 .today-section-jp {
    display: none;
  }

  /* ── Correspondence: master/detail push on mobile ───────────────────── */
  .email-shell {
    grid-template-columns: 1fr;
  }

  .email-shell[data-mobile-pane="reader"] .email-list {
    display: none;
  }

  .email-shell[data-mobile-pane="list"] .email-read {
    display: none;
  }

  .correspondence-back {
    display: inline-flex;
  }
}

@media (max-width: 420px) {
  .jp-counters {
    grid-template-columns: 1fr;
  }

  .jp-counter,
  .jp-counter:nth-child(2) {
    border-right: 0;
  }

  .jp-counter:not(:last-child) {
    border-bottom: 0.5px solid var(--jp-rule);
  }

  .pipeline-stat {
    min-width: 100%;
    flex-basis: 100%;
  }

  .sidebar nav[aria-label="Main navigation"] .nav-item {
    font-size: 10.5px;
  }
}

/* ── Cadence kanban ── */
.cadence-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 16px 24px 32px;
  align-items: start;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cadence-column {
  background: var(--surface, #fff);
  border: 0.5px solid var(--rule, #e5e2d8);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  overflow: hidden;
}

.cadence-suggest-row {
  padding: 0 18px 10px;
}

.cadence-suggest-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 10px;
}

.cadence-suggest-panel {
  margin: 0 14px 12px;
  padding: 12px;
  background: #fbfaf6;
  border: 0.5px solid #d8d3c4;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cadence-suggest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cadence-suggest-tone-tabs {
  display: inline-flex;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-base);
}

.cadence-suggest-tone {
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  color: var(--fg-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cadence-suggest-tone.active {
  background: var(--fg);
  color: var(--bg-base);
}

.cadence-suggest-close {
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  padding: 2px 8px;
  cursor: pointer;
  color: var(--fg-tertiary);
}

.cadence-suggest-body {
  min-height: 80px;
}

.cadence-suggest-loading,
.cadence-suggest-empty {
  font-size: 12px;
  color: var(--fg-tertiary);
  padding: 8px 0;
}

.cadence-suggest-empty .link-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent, #c4482b);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

.cadence-suggest-message {
  margin: 0;
  padding: 10px 12px;
  background: var(--bg-base);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg);
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 320px;
  overflow-y: auto;
}

.cadence-suggest-error {
  margin-top: 8px;
  font-size: 12px;
  color: #b03030;
  background: #fff0f0;
  padding: 6px 10px;
  border-radius: 6px;
}

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

.cadence-config-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cadence-config-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cadence-config-form label > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-secondary);
}

.cadence-config-form small {
  font-size: 11px;
  color: var(--fg-tertiary);
}

.cadence-config-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.cadence-column-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 0.5px solid var(--rule, #e5e2d8);
  gap: 12px;
}

.cadence-column-head h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

.cadence-column-counts {
  display: flex;
  gap: 6px;
  align-items: center;
}

.cadence-column-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  flex: 1;
  min-height: 100px;
}

.cadence-column-body.cadence-dropzone-active {
  background: rgba(196, 72, 43, 0.05);
  outline: 1.5px dashed rgba(196, 72, 43, 0.45);
  outline-offset: -6px;
  border-radius: 10px;
}

.cadence-card {
  background: var(--surface-soft, #faf9f5);
  border: 0.5px solid var(--rule, #e5e2d8);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: grab;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.cadence-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 18, 30, 0.06);
}

.cadence-card.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.cadence-card-overdue {
  border-color: rgba(196, 72, 43, 0.55);
  background: rgba(196, 72, 43, 0.04);
}

.cadence-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cadence-card-head strong {
  font-size: 13.5px;
  font-weight: 600;
}

.cadence-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-3, #8a857b);
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.04em;
}

.cadence-flag {
  color: #c4482b;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
}

.cadence-empty {
  border: 0.5px dashed var(--rule, #e5e2d8);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  color: var(--ink-3, #8a857b);
  font-size: 12px;
}

.cadence-pill-weekly {
  background: rgba(196, 72, 43, 0.12);
  color: #c4482b;
  border: 0.5px solid rgba(196, 72, 43, 0.35);
}

.cadence-pill-monthly {
  background: rgba(43, 58, 85, 0.1);
  color: #2b3a55;
  border: 0.5px solid rgba(43, 58, 85, 0.3);
}

.cadence-pill-quarterly {
  background: rgba(94, 117, 81, 0.12);
  color: #5e7551;
  border: 0.5px solid rgba(94, 117, 81, 0.35);
}

.cadence-pill-overdue {
  background: rgba(196, 72, 43, 0.16);
  color: #c4482b;
  border: 0.5px solid rgba(196, 72, 43, 0.5);
}

@media (max-width: 1080px) {
  .cadence-board {
    grid-template-columns: 1fr;
    padding: 16px;
  }
}

/* ── Contact detail rail ── */
.record-card { cursor: pointer; transition: border-color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease; }
.record-card:hover { border-color: var(--ink-3, #8a857b); }
.record-card.is-selected { border-color: #c4482b; box-shadow: 0 6px 18px rgba(196, 72, 43, 0.12); }
.contact-row { cursor: pointer; }
.contact-row:hover { background: rgba(15, 18, 30, 0.03); }
.contact-row.is-selected { background: rgba(196, 72, 43, 0.06); }
.cadence-card.is-selected { border-color: #c4482b; box-shadow: 0 6px 18px rgba(196, 72, 43, 0.12); }

.contact-rail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-rail-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-secondary, #4a4740);
}

.contact-rail-list li strong {
  font-weight: 600;
}

.contact-rail-thread {
  border-top: 0.5px solid var(--border, #e5e2d8);
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-rail-thread:first-child {
  border-top: none;
  padding-top: 0;
}

.contact-rail-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.contact-rail-events {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-rail-event {
  background: var(--bg-surface, #faf9f5);
  border: 0.5px solid var(--border, #e5e2d8);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-rail-event.is-outbound {
  background: rgba(43, 58, 85, 0.05);
  border-color: rgba(43, 58, 85, 0.2);
}

.contact-rail-event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.contact-rail-event-head strong {
  font-weight: 600;
}

.contact-rail-event-head time {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  color: var(--fg-quaternary, #8a857b);
}

.contact-rail-event-body {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg-secondary, #4a4740);
}

.contact-rail-event-more {
  font-size: 11px;
  color: var(--fg-quaternary, #8a857b);
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.04em;
}

/* ── Customer Accounts ── */
.customer-accounts-view {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 24px 32px;
}

.customer-accounts-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.customer-accounts-banner {
  background: rgba(196, 72, 43, 0.06);
  border: 0.5px dashed rgba(196, 72, 43, 0.4);
  color: #4a4740;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.02em;
}

.customer-accounts-empty {
  background: var(--bg-surface, #faf9f5);
  border: 0.5px solid var(--border, #e5e2d8);
  border-radius: 14px;
  padding: 36px;
  text-align: center;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.customer-accounts-empty strong {
  font-size: 16px;
  font-weight: 650;
}

.customer-accounts-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--fg-tertiary, #4a4740);
  max-width: 520px;
}

.account-card {
  background: var(--bg-surface, #faf9f5);
  border: 0.5px solid var(--border, #e5e2d8);
  border-radius: 14px;
  padding: 22px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.account-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.account-card-head h2 {
  margin: 4px 0 4px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.account-card-stage {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5e7551;
}

.account-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-connect {
  font-size: 12px;
}

.account-card-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  border-top: 0.5px solid var(--border, #e5e2d8);
  border-bottom: 0.5px solid var(--border, #e5e2d8);
  padding: 14px 0;
}

.account-card-stats > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-card-stats strong {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.account-card-stats span {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-quaternary, #8a857b);
}

.account-card-users {
  width: 100%;
  font-size: 13px;
}

.account-card-users th {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-quaternary, #8a857b);
  padding-bottom: 8px;
  text-align: left;
  font-weight: 500;
}

.account-card-users td {
  padding: 10px 8px;
  border-top: 0.5px solid var(--border, #e5e2d8);
  vertical-align: middle;
}

.account-card-users td:first-child {
  padding-left: 0;
}

.account-card-users td:last-child {
  padding-right: 0;
  text-align: right;
}

.account-user-row.is-stale td {
  color: var(--fg-quaternary, #8a857b);
}

@media (max-width: 1080px) {
  .account-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-card-users {
    font-size: 12px;
  }
}

/* ── Email view (refactored to match design v2) ── */
.email-shell {
  display: grid;
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.email-list {
  border-right: 0.5px solid var(--border, #d8d3c4);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-base);
}

.email-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 24px;
  border-bottom: 0.5px solid var(--border, #d8d3c4);
  background: var(--bg-base);
}

.correspondence-channel-tabs {
  display: inline-flex;
  border: 0.5px solid var(--border, #d8d3c4);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-base);
}

.correspondence-channel-tab {
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-secondary, #4a4740);
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.correspondence-channel-tab .n {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  color: var(--fg-tertiary);
  font-weight: 500;
}

.correspondence-channel-tab.active {
  background: var(--ink, #16140f);
  color: var(--bg-base);
}

.correspondence-channel-tab.active .n {
  color: var(--bg-base);
  opacity: 0.7;
}

.email-imsg-notice {
  margin: 6px 28px 14px;
  padding: 10px 14px;
  background: var(--bg-soft, #f1efe9);
  border: 0.5px dashed var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--fg-secondary);
}

.correspondence-row .correspondence-channel-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.correspondence-thread-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-soft, #efe9d9);
  color: var(--fg-secondary);
  border-radius: 999px;
  margin-left: 4px;
}

.correspondence-row.active .correspondence-thread-count {
  background: var(--ink, #16140f);
  color: var(--bg-base);
}

.correspondence-read-context {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Back-to-list button only relevant on mobile master/detail; hidden on desktop. */
.correspondence-back {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-right: 4px;
  border: 0.5px solid var(--border);
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--fg-secondary);
  cursor: pointer;
  border-radius: 6px;
}

.correspondence-back:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.correspondence-read-name {
  font-size: 16px;
  font-weight: 650;
  color: var(--fg);
}

.correspondence-read-meta {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--fg-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.correspondence-read-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.correspondence-read-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.correspondence-read-body .msg-bubble-row + .msg-bubble-row {
  margin-top: -8px;
}

.correspondence-read-body .msg-bubble-row.msg-out + .msg-bubble-row.msg-in,
.correspondence-read-body .msg-bubble-row.msg-in + .msg-bubble-row.msg-out {
  margin-top: 0;
}

/* Hide the "Zak · 2m ago" line on every bubble except the last one in a
   same-direction cluster, so repeated outbound or inbound messages don't
   stamp the sender name on each one. */
.correspondence-read-body .msg-bubble-row.msg-out:has(+ .msg-bubble-row.msg-out) .msg-bubble-meta,
.correspondence-read-body .msg-bubble-row.msg-in:has(+ .msg-bubble-row.msg-in) .msg-bubble-meta {
  display: none;
}

.correspondence-email-card {
  border: 0.5px solid var(--border);
  background: var(--bg-base);
  border-radius: 10px;
  padding: 14px 16px;
}

.correspondence-email-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.correspondence-email-from {
  flex: 1 1 auto;
  min-width: 0;
}

.correspondence-email-from-name {
  font-weight: 650;
  font-size: 13px;
  color: var(--fg);
}

.correspondence-email-subject {
  font-size: 12px;
  color: var(--fg-secondary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.correspondence-email-when {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--fg-tertiary);
  white-space: nowrap;
}

.correspondence-email-body {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg);
}

.correspondence-email-body p {
  margin: 0 0 10px;
}

.correspondence-email-body p:last-child {
  margin-bottom: 0;
}

.msg-bubble-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 75%;
}

.msg-bubble-row.msg-out {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-bubble-row.msg-in {
  align-self: flex-start;
  align-items: flex-start;
}

.msg-bubble {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.3;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg-bubble-row.msg-out .msg-bubble {
  background: #2b80ff;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-bubble-row.msg-in .msg-bubble {
  background: #ece9e0;
  color: var(--fg);
  border-bottom-left-radius: 4px;
}

.msg-bubble-meta {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  color: var(--fg-tertiary);
  padding: 0 4px;
}

.distill-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
  background: #fbf7e8;
  border: 0.5px solid #e2d6a4;
  border-radius: 8px;
}

.correspondence-email-card .distill-banner {
  margin: -2px 0 12px;
}

.msg-bubble-row .distill-banner {
  max-width: 320px;
  background: #fbf7e8;
  border-color: #e2d6a4;
}

.msg-bubble-row.msg-out .distill-banner {
  align-self: flex-end;
}

.distill-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.distill-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b5424;
}

.distill-label svg {
  stroke: #6b5424;
  fill: none;
  stroke-width: 2;
}

.distill-section ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg);
}

.distill-section ul li {
  margin: 2px 0;
}

.distill-promises .distill-label {
  color: #8a3a14;
}

.distill-promises .distill-label svg {
  stroke: #8a3a14;
}

.email-avatar-add {
  position: relative;
  background: #ece9e0;
  color: var(--fg);
  cursor: pointer;
  border: 0.5px solid var(--border);
  transition: transform 120ms ease, border-color 120ms ease;
}

.email-avatar-add:hover {
  border-color: var(--accent, #c4482b);
  transform: scale(1.05);
}

.email-avatar-add-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #c4482b);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 1px solid var(--bg-base);
}

.correspondence-email-from-link {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.correspondence-email-from-link:hover {
  color: var(--accent, #c4482b);
}

.link-identity-hint {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, #c4482b);
  border: 0.5px solid var(--accent, #c4482b);
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.correspondence-email-card.has-unresolved-sender:hover .link-identity-hint,
.correspondence-email-from-link:focus-visible .link-identity-hint {
  opacity: 1;
}

.identity-link-modal {
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.identity-link-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg-soft, #f1efe9);
  border: 0.5px solid var(--border);
  border-radius: 8px;
}

.identity-link-type {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
}

.identity-link-summary strong {
  font-size: 14px;
  word-break: break-all;
}

.email-list-compose {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink, #16140f);
  background: var(--bg-soft, #efe9d9);
  border: 0.5px solid var(--border, #d8d3c4);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.email-list-compose:hover {
  background: var(--ink, #16140f);
  color: var(--paper, #fffdf8);
  border-color: var(--ink, #16140f);
}

.email-list-compose svg {
  display: block;
}

.email-list-filters {
  flex: 1;
  display: flex;
  gap: 18px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-x: auto;
  scrollbar-width: thin;
  min-width: 0;
}

.email-list-filter {
  background: transparent;
  border: none;
  padding: 6px 0;
  color: var(--fg-tertiary, #837d72);
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.email-list-filter .n {
  font-variant-numeric: tabular-nums;
  color: var(--fg-quaternary, #b5ad9e);
}

.email-list-filter.on {
  color: var(--ink, #16140f);
  border-bottom-color: var(--vermillion, #c4482b);
}

.email-list-filter.on .n {
  color: var(--ink-2, #4a4740);
}

.email-list-rows {
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
}

.email-row {
  display: grid;
  gap: 4px;
  padding: 14px 24px;
  border-bottom: 0.5px solid var(--rule-soft, #e6e2d6);
  cursor: pointer;
  position: relative;
}

.email-row:hover {
  background: var(--paper-2, #f1efe9);
}

.email-row.active {
  background: var(--paper-2, #f1efe9);
}

.email-row.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--vermillion, #c4482b);
}

.email-row-line1 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.email-from {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink, #16140f);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-row.unread .email-from {
  font-weight: 600;
}

.email-when {
  margin-left: auto;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  color: var(--fg-tertiary, #837d72);
  white-space: nowrap;
}

.ch-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3, #837d72);
  flex-shrink: 0;
}

.ch-dot.email { background: var(--indigo, #2b3a55); }
.ch-dot.imsg { background: var(--mustard, #a87312); }
.ch-dot.li { background: #5e7551; }

.email-subject {
  font-size: 13px;
  color: var(--ink, #16140f);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-row:not(.unread) .email-subject {
  color: var(--ink-2, #4a4740);
}

.email-snippet {
  font-size: 12px;
  color: var(--fg-tertiary, #837d72);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-flags {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
  flex-wrap: wrap;
}

.email-flag {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--vermillion, #c4482b);
}

.email-flag.deal {
  color: var(--ink-3, #837d72);
}

.email-flag.deal::before {
  content: "·";
  margin-right: 6px;
  color: var(--ink-4, #b5ad9e);
}

/* Reading pane */
.email-read {
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  background: var(--bg-base);
}

.email-read-empty {
  margin: 64px auto;
  text-align: center;
  display: grid;
  gap: 8px;
  justify-items: center;
  max-width: 420px;
}

.email-read-empty strong {
  font-size: 16px;
  font-weight: 650;
}

.email-read-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--fg-tertiary, #837d72);
}

.email-read-head {
  display: flex;
  align-items: center;
  padding: 12px 28px;
  border-bottom: 0.5px solid var(--border, #d8d3c4);
  gap: 4px;
  position: sticky;
  top: 0;
  background: var(--bg-base);
  z-index: 2;
}

.email-read-bottom {
  position: sticky;
  bottom: 0;
  background: var(--bg-base);
  z-index: 3;
  border-top: 0.5px solid var(--border, #d8d3c4);
  box-shadow: 0 -8px 24px -16px rgba(22, 20, 15, 0.18);
}

.email-read-foot {
  display: flex;
  align-items: center;
  padding: 10px 28px;
  border-top: 0.5px solid var(--border, #d8d3c4);
  gap: 4px;
  background: var(--bg-base);
  flex-wrap: wrap;
}

.email-read-context-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 28px;
  border-bottom: 0.5px solid var(--border, #d8d3c4);
  background: var(--bg-base);
  flex-wrap: wrap;
  min-height: 36px;
}

.email-read-context-line:empty {
  display: none;
}

.email-read-status {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 2px;
  border: 0.5px solid var(--border, #d8d3c4);
  color: var(--fg-tertiary, #837d72);
  background: transparent;
}

.email-read-status-flagged {
  color: var(--vermillion, #c4482b);
  border-color: var(--vermillion, #c4482b);
}

.email-read-status-archived {
  color: var(--fg-tertiary, #837d72);
  background: var(--bg-soft, #efe9d9);
}

.email-read-status-snoozed {
  color: var(--ink-2, #4a4740);
  border-color: var(--ink-2, #4a4740);
}

.email-read-action {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--ink-2, #4a4740);
  cursor: pointer;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  background: transparent;
  border: none;
  border-radius: 3px;
  transition: background 120ms ease, color 120ms ease;
}

.email-read-action:hover:not(:disabled) {
  color: var(--vermillion, #c4482b);
  background: var(--bg-soft, #efe9d9);
}

.email-read-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.email-read-action.is-on {
  color: var(--vermillion, #c4482b);
  background: rgba(196, 72, 43, 0.08);
}

.email-read-action kbd {
  border: none;
  background: transparent;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  color: var(--fg-tertiary, #837d72);
  padding: 0;
  min-width: 0;
  height: auto;
}

.email-read-action.primary {
  color: var(--ink, #16140f);
  font-weight: 500;
}

.email-read-spacer {
  flex: 1;
}

.email-read-context {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  color: var(--fg-tertiary, #837d72);
  letter-spacing: 0.04em;
}

.email-read-inner {
  padding: 36px 56px 28px;
  max-width: 760px;
  margin: 0 auto;
}

.email-read-subject {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 24px;
}

.email-sender {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 0.5px solid var(--ink, #16140f);
  border-bottom: 0.5px solid var(--border, #d8d3c4);
}

.email-sender-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: end;
}

.email-msg-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}

.email-msg-action {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0.5px solid transparent;
  border-radius: 4px;
  color: var(--fg-tertiary, #837d72);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.email-msg-action:hover:not(:disabled) {
  color: var(--ink, #16140f);
  background: var(--bg-soft, #efe9d9);
  border-color: var(--border, #d8d3c4);
}

.email-msg-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.email-msg-action.is-on {
  color: var(--vermillion, #c4482b);
  background: rgba(196, 72, 43, 0.08);
  border-color: rgba(196, 72, 43, 0.25);
}

.email-msg-action.is-on:hover:not(:disabled) {
  background: rgba(196, 72, 43, 0.14);
}

.email-msg-action svg {
  display: block;
}

.email-avatar {
  width: 40px;
  height: 40px;
  background: var(--paper-3, #fffdf8);
  border: 0.5px solid var(--border, #d8d3c4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink, #16140f);
  letter-spacing: 0;
}

.email-sender-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.email-sender-detail {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--fg-tertiary, #837d72);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.email-sender-when {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--fg-tertiary, #837d72);
  letter-spacing: 0.04em;
  text-align: right;
}

.email-summary {
  padding: 18px 0;
  border-bottom: 0.5px solid var(--border, #d8d3c4);
  margin-bottom: 28px;
}

.email-summary-label {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 9.5px;
  color: var(--vermillion, #c4482b);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.email-summary-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink, #16140f);
  margin: 0;
  max-width: 620px;
}

.email-body-text {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink, #16140f);
  max-width: 620px;
  padding-top: 8px;
}

.email-body-text p {
  margin: 0 0 16px;
}

.email-attachments {
  display: flex;
  gap: 12px;
  margin: 28px 0;
  flex-wrap: wrap;
}

.email-attachment {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 0.5px solid var(--border, #d8d3c4);
  cursor: pointer;
  min-width: 220px;
}

.email-attachment:hover {
  border-color: var(--ink, #16140f);
}

.email-attachment-icon {
  width: 28px;
  height: 34px;
  border: 0.5px solid var(--ink-3, #837d72);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 8px;
  color: var(--ink-3, #837d72);
  letter-spacing: 0.04em;
}

.email-attachment-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.email-attachment-size {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  color: var(--fg-tertiary, #837d72);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.email-thread {
  margin-top: 12px;
  max-width: 620px;
}

.email-thread-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-tertiary, #837d72);
  cursor: pointer;
  border: none;
  border-bottom: 0.5px solid var(--border, #d8d3c4);
  width: 100%;
  background: transparent;
}

.email-thread-toggle:hover {
  color: var(--ink, #16140f);
}

.email-thread-toggle .chev {
  transition: transform 120ms ease;
  display: inline-block;
}

.email-thread-toggle .count {
  color: var(--ink, #16140f);
  font-weight: 500;
}

.email-thread-list {
  display: none;
}

.email-thread.open .email-thread-list {
  display: block;
}

.email-thread.open .email-thread-toggle .chev {
  transform: rotate(90deg);
}

.email-thread-msg {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--rule-soft, #e6e2d6);
}

.email-thread-when {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  color: var(--fg-tertiary, #837d72);
  padding-top: 2px;
}

.email-thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.email-thread-head .who {
  font-size: 13px;
  font-weight: 500;
}

.email-thread-snippet {
  font-size: 12.5px;
  color: var(--ink-2, #4a4740);
  line-height: 1.55;
}

.email-reply {
  margin: 0;
  padding: 8px 28px 14px;
  max-width: none;
  transition: padding 160ms ease;
}

.email-reply-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 0 solid var(--border, #d8d3c4);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 160ms ease, opacity 140ms ease, margin-bottom 160ms ease, border-bottom-color 160ms ease;
}

.email-reply:hover .email-reply-tabs,
.email-reply:focus-within .email-reply-tabs {
  max-height: 40px;
  opacity: 1;
  margin-bottom: 10px;
  border-bottom-color: var(--border, #d8d3c4);
  border-bottom-width: 0.5px;
}

.email-reply-tab {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-tertiary, #837d72);
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 120ms ease, border-color 120ms ease;
}

.email-reply-tab:hover {
  color: var(--ink, #16140f);
}

.email-reply-tab.is-active {
  color: var(--ink, #16140f);
  border-bottom-color: var(--vermillion, #c4482b);
  font-weight: 600;
}

.email-reply-tab kbd {
  border: none;
  background: transparent;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  color: var(--fg-tertiary, #837d72);
  padding: 0;
  min-width: 0;
  height: auto;
}

.email-reply-box {
  border: 0.5px solid var(--border, #d8d3c4);
  padding: 14px 16px;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.email-reply-text {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink, #16140f);
  min-height: 32px;
  max-height: 32px;
  line-height: 1.6;
  outline: none;
  border: none;
  resize: none;
  background: transparent;
  width: 100%;
  transition: min-height 160ms ease, max-height 160ms ease;
}

.email-reply:hover .email-reply-text,
.email-reply:focus-within .email-reply-text {
  min-height: 96px;
  max-height: none;
  resize: vertical;
}

.email-reply-text:disabled {
  color: var(--fg-tertiary, #837d72);
  background: transparent;
}

.email-reply-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0;
  border-top: 0 solid var(--border, #d8d3c4);
  gap: 12px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 160ms ease, padding-top 160ms ease, opacity 140ms ease, border-top-width 160ms ease;
}

.email-reply:hover .email-reply-foot,
.email-reply:focus-within .email-reply-foot {
  max-height: 80px;
  padding-top: 10px;
  border-top-width: 0.5px;
  opacity: 1;
}

.email-reply-via {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--fg-tertiary, #837d72);
  letter-spacing: 0.04em;
}

.email-reply-status {
  margin-left: auto;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--fg-tertiary, #837d72);
}

.email-reply-send {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.email-reply-send kbd {
  border: 0.5px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
}

@media (max-width: 1024px) {
  .email-shell {
    grid-template-columns: 1fr;
  }
  .email-list {
    border-right: none;
    border-bottom: 0.5px solid var(--border);
    max-height: 320px;
  }
  .email-read-inner {
    padding: 24px 24px 80px;
  }
}

/* ── Phase 0 superadmin ── */
.admin-view {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 24px 32px;
  display: grid;
  gap: 18px;
}

.admin-blocked {
  margin: 64px auto;
  text-align: center;
  display: grid;
  gap: 8px;
  justify-items: center;
  max-width: 420px;
}

.admin-blocked strong {
  font-size: 16px;
  font-weight: 650;
}

.admin-list-section {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-list-head strong {
  font-size: 13px;
  font-weight: 650;
}

.admin-workspaces-table {
  width: 100%;
  font-size: 12.5px;
}

.admin-workspaces-table th,
.admin-table th {
  text-align: left;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-quaternary);
  border-bottom: 0.5px solid var(--border);
}

.admin-workspaces-table td,
.admin-table td {
  padding: 10px;
  border-top: 0.5px solid var(--border-soft);
  vertical-align: middle;
}

.admin-workspace-row {
  cursor: pointer;
}

.admin-workspace-row:hover {
  background: var(--bg-sunken);
}

.admin-workspace-row.is-selected {
  background: rgba(196, 72, 43, 0.06);
}

.admin-lifecycle {
  text-transform: capitalize;
}

.admin-lifecycle-signed_up { background: var(--mustard-soft); color: var(--mustard); border-color: rgba(168, 115, 18, 0.4); }
.admin-lifecycle-onboarding { background: var(--paper-2); color: var(--ink-2); border-color: var(--rule); }
.admin-lifecycle-activated { background: var(--indigo-soft); color: var(--indigo); border-color: rgba(43, 58, 85, 0.35); }
.admin-lifecycle-at_risk { background: var(--vermillion-soft); color: var(--vermillion); border-color: rgba(196, 72, 43, 0.45); }
.admin-lifecycle-churned { background: rgba(15, 18, 30, 0.06); color: var(--fg-tertiary); border-color: var(--rule); }
.admin-lifecycle-power_user { background: rgba(94, 117, 81, 0.16); color: #5e7551; border-color: rgba(94, 117, 81, 0.45); }

.admin-detail-empty {
  margin: 24px;
  text-align: center;
  color: var(--fg-tertiary);
}

.admin-detail {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px 24px;
  display: grid;
  gap: 18px;
}

.admin-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-detail-head h2 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 4px 0 4px;
}

.admin-detail-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-quaternary);
}

.admin-detail-actions {
  display: flex;
  gap: 8px;
}

.admin-detail-section {
  display: grid;
  gap: 10px;
}

.admin-detail-section h3 {
  margin: 0;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  font-weight: 600;
}

.admin-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-counts > div {
  background: var(--bg-base);
  border: 0.5px solid var(--border-soft);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-counts strong {
  font-size: 18px;
  font-weight: 650;
}

.admin-counts span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-quaternary);
}

.admin-kv {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-kv > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 0.5px solid var(--border-soft);
  background: var(--bg-base);
}

.admin-kv span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-quaternary);
}

.admin-kv strong {
  font-size: 13px;
  font-weight: 600;
}

.admin-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.admin-events li {
  display: grid;
  grid-template-columns: 90px 90px 110px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-base);
  border: 0.5px solid var(--border-soft);
  font-size: 12.5px;
}

.admin-event-source,
.admin-event-direction,
.admin-event-time {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--fg-tertiary);
}

.admin-event-target {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-raw {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  padding: 14px 16px;
  border-radius: 6px;
  max-height: 480px;
  overflow: auto;
  white-space: pre;
}

@media (max-width: 1080px) {
  .admin-counts,
  .admin-kv {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-events li {
    grid-template-columns: 1fr;
  }
}

/* ── Today redesign: counters + Quiet list ── */
.jp-counters-compact {
  padding: 14px 32px;
  border-bottom: 0.5px solid var(--jp-rule);
}

.jp-counters-compact .jp-counter {
  padding: 12px 18px;
}

.jp-counters-compact .jp-counter-value {
  font-size: 36px;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.jp-counters-compact .jp-counter-value sup {
  font-size: 16px;
  top: -0.7em;
}

.jp-counters-compact .jp-counter-label {
  font-size: 9.5px;
  letter-spacing: 0.16em;
}

.jp-counters-compact .jp-counter-foot {
  font-size: 10px;
  margin-top: 4px;
}

/* Quiet list */
.jp-quiet-list {
  padding: 0 0 16px;
  display: flex;
  flex-direction: column;
}

.jp-quiet-empty {
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  color: var(--jp-ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.jp-quiet-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--jp-rule-soft);
}

.jp-quiet-row:first-child {
  border-top: 0.5px solid var(--jp-rule);
}

.jp-quiet-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--jp-ink-3);
  letter-spacing: 0.06em;
  padding-top: 4px;
}

.jp-quiet-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.jp-quiet-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.jp-quiet-title {
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--jp-ink);
  cursor: pointer;
  text-align: left;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jp-quiet-title:hover {
  color: var(--jp-vermillion);
}

.jp-quiet-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--jp-ink-3);
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.jp-quiet-sub em.jp-cad-tag {
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  padding: 1px 5px;
  border: 0.5px solid var(--jp-rule);
  white-space: nowrap;
  display: inline-block;
}

.jp-quiet-sub em.jp-cad-weekly {
  color: var(--jp-vermillion);
  border-color: var(--jp-vermillion);
}

.jp-quiet-sub em.jp-cad-monthly {
  color: var(--jp-indigo);
  border-color: var(--jp-indigo);
}

.jp-quiet-sub em.jp-cad-quarterly {
  color: #5e7551;
  border-color: #5e7551;
}

.jp-quiet-overdue {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--jp-vermillion);
  padding: 2px 6px;
  border: 0.5px solid var(--jp-vermillion);
  letter-spacing: 0.04em;
  white-space: nowrap;
  align-self: center;
}

.jp-quiet-action {
  justify-self: end;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--jp-ink);
  cursor: pointer;
  padding: 4px 0 0;
  white-space: nowrap;
}

.jp-quiet-action:hover {
  color: var(--jp-vermillion);
}

@media (max-width: 880px) {
  .jp-topbar-greeting {
    font-size: 14px;
  }
}

/* ── vCard import ── */
.vcard-import {
  background: var(--bg-base);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 14px 0;
}

.vcard-import-head { display: grid; gap: 4px; }
.vcard-import-head strong { font-size: 13px; font-weight: 650; }
.vcard-import-head code { font-family: var(--font-mono); font-size: 11px; padding: 1px 5px; background: var(--bg-sunken); border: 0.5px solid var(--border); border-radius: 3px; }

.vcard-dropzone {
  border: 1px dashed var(--ink-3, #837d72);
  background: var(--bg-sunken);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
}

.vcard-dropzone:hover,
.vcard-dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(196, 72, 43, 0.04);
  color: var(--ink);
}

.vcard-preview { display: grid; gap: 12px; }
.vcard-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vcard-preview-head strong { font-size: 12.5px; font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-tertiary); }
.vcard-preview-list { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.vcard-preview-row { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; padding: 8px 10px; border: 0.5px solid var(--border-soft); background: var(--bg-base); }
.vcard-preview-row strong { font-size: 13px; font-weight: 600; }
.vcard-preview-row .avatar { width: 36px; height: 36px; }
.vcard-preview-channels { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-quaternary); letter-spacing: 0.04em; margin-top: 4px; }
.vcard-preview-more { padding: 6px 0; }
.vcard-preview-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 6px; border-top: 0.5px solid var(--border-soft); }

/* ── Contacts toolbar import button + inline panel ── */
.records-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.contacts-import-wrap {
  margin: 0 0 16px;
}

.contacts-import-wrap .vcard-import {
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Contact page — unified timeline view per person                          */
/* ─────────────────────────────────────────────────────────────────────── */

.contact-page {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  min-height: 0;
}

.contact-page-head {
  padding: 28px 56px 24px;
  border-bottom: 0.5px solid var(--border, #d8d3c4);
  background: var(--bg-base);
}

.contact-page-back {
  background: transparent;
  border: none;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg-tertiary, #837d72);
  cursor: pointer;
  padding: 0 0 14px;
  text-transform: uppercase;
}

.contact-page-back:hover {
  color: var(--ink, #16140f);
}

.contact-page-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: start;
}

.contact-page-hero .avatar.lg {
  width: 64px;
  height: 64px;
  font-size: 22px;
  background: var(--accent, #c4482b);
}

.contact-page-hero-text h1 {
  font-size: 30px;
  font-weight: 350;
  letter-spacing: -0.025em;
  margin: 0 0 4px;
  line-height: 1.1;
}

.contact-page-account {
  font-size: 13px;
  color: var(--ink-2, #4a4740);
  margin-bottom: 12px;
}

.contact-page-identities {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
}

.contact-page-identity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px;
  color: var(--ink-2, #4a4740);
  letter-spacing: 0.02em;
}

.contact-page-deals {
  min-width: 240px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-page-deals-label {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-tertiary, #837d72);
}

.contact-page-deal {
  text-align: left;
  background: var(--bg-soft, #efe9d9);
  border: 0.5px solid var(--border, #d8d3c4);
  border-radius: 4px;
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
  color: var(--ink, #16140f);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 120ms ease, border-color 120ms ease;
}

.contact-page-deal:hover {
  background: var(--bg-base);
  border-color: var(--ink, #16140f);
}

.contact-page-deal strong {
  font-size: 13px;
  font-weight: 600;
}

.contact-page-deal span {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  color: var(--fg-tertiary, #837d72);
  letter-spacing: 0.04em;
}

.contact-page-deal em {
  font-size: 11px;
  color: var(--ink-2, #4a4740);
  font-style: normal;
  margin-top: 2px;
}

/* Timeline */
.contact-timeline {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 56px 48px;
  min-height: 0;
}

.contact-day-group {
  margin-bottom: 32px;
}

.contact-day-label {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-tertiary, #837d72);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 0.5px solid var(--border, #d8d3c4);
  position: sticky;
  top: 0;
  background: var(--bg-base);
  z-index: 1;
}

.contact-event {
  position: relative;
  padding: 14px 16px 12px;
  margin-bottom: 8px;
  border: 0.5px solid var(--border, #d8d3c4);
  border-radius: 4px;
  background: var(--bg-base);
  transition: background 120ms ease, border-color 120ms ease;
}

.contact-event.is-outbound {
  background: rgba(196, 72, 43, 0.04);
  border-color: rgba(196, 72, 43, 0.2);
}

.contact-event-head {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  width: 100%;
  text-align: left;
  cursor: default;
  font: inherit;
  color: inherit;
}

.contact-event.is-collapsible .contact-event-head {
  cursor: pointer;
}

.contact-event-icon {
  flex: 0 0 auto;
}

.contact-event-sender {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #16140f);
}

.contact-event-channel {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-tertiary, #837d72);
}

.contact-event-when {
  margin-left: auto;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  color: var(--fg-tertiary, #837d72);
  letter-spacing: 0.04em;
}

.contact-event-subject {
  font-size: 14px;
  font-weight: 600;
  margin: 8px 0 6px;
  color: var(--ink, #16140f);
  letter-spacing: -0.01em;
}

.contact-event-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink, #16140f);
  max-height: 180px;
  overflow: hidden;
}

.contact-event-body p {
  margin: 0 0 8px;
}

.contact-event-body p:last-child {
  margin-bottom: 0;
}

.contact-event.is-collapsible .contact-event-body {
  max-height: 100px;
}

.contact-event.is-collapsible.open .contact-event-body {
  max-height: none;
}

.contact-event-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  height: 32px;
  background: linear-gradient(to bottom, rgba(255, 253, 248, 0), var(--bg-base));
  pointer-events: none;
}

.contact-event.is-outbound .contact-event-fade {
  background: linear-gradient(to bottom, rgba(196, 72, 43, 0), rgba(196, 72, 43, 0.04));
}

.contact-event.open .contact-event-fade {
  display: none;
}

.contact-event.is-collapsible::after {
  content: 'Click to expand';
  position: absolute;
  right: 14px;
  bottom: 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 9.5px;
  color: var(--fg-tertiary, #837d72);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-event.is-collapsible.open::after {
  content: 'Click to collapse';
}

/* Reply form */
.contact-reply {
  border-top: 0.5px solid var(--border, #d8d3c4);
  padding: 16px 56px 20px;
  background: var(--bg-base);
  box-shadow: 0 -8px 24px -16px rgba(22, 20, 15, 0.18);
}

.contact-reply-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.contact-reply-head strong {
  font-size: 13px;
  font-weight: 600;
}

.contact-reply-hint {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  color: var(--fg-tertiary, #837d72);
  letter-spacing: 0.02em;
}

.contact-reply-disabled {
  border-top: 0.5px solid var(--border, #d8d3c4);
  padding: 18px 56px;
  background: var(--bg-base);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px;
  color: var(--fg-tertiary, #837d72);
  letter-spacing: 0.02em;
}

/* Email reading-pane: clickable sender (links to contact page) */
.email-avatar.email-avatar-link,
.email-sender-name.email-sender-name-link {
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}

.email-avatar.email-avatar-link {
  border-color: transparent;
  background: var(--paper-3, #fffdf8);
}

.email-avatar.email-avatar-link:hover {
  border-color: var(--vermillion, #c4482b);
  color: var(--vermillion, #c4482b);
}

.email-sender-name.email-sender-name-link {
  background: transparent;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
}

.email-sender-name.email-sender-name-link:hover {
  color: var(--vermillion, #c4482b);
  text-decoration: underline;
  text-decoration-color: rgba(196, 72, 43, 0.4);
  text-underline-offset: 3px;
}

@media (max-width: 1024px) {
  .contact-page-head { padding: 20px 28px; }
  .contact-timeline { padding: 18px 28px 36px; }
  .contact-reply { padding: 14px 28px 18px; }
  .contact-page-hero { grid-template-columns: 1fr; }
  .contact-page-deals { max-width: none; }
}

/* Manual mode for the businessCardModal — hide the camera scaffolding so it
   becomes a clean "+ New contact" form. */
#businessCardModal[data-mode="manual"] .camera-stage,
#businessCardModal[data-mode="manual"] .camera-actions {
  display: none;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Contact page — iMessage chat bubbles + compact reply + deal actions      */
/* ─────────────────────────────────────────────────────────────────────── */

.contact-chat-run {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0 14px;
}

.chat-bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  margin: 0;
}

.chat-bubble-row.is-start {
  margin-top: 6px;
}

.chat-bubble-row.is-continuation {
  margin-top: 1px;
}

.chat-bubble-row.chat-out {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-bubble-row.chat-in {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-bubble-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 0 4px 3px;
}

.chat-bubble-sender {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2, #4a4740);
}

.chat-bubble-when {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 9.5px;
  color: var(--fg-tertiary, #837d72);
  letter-spacing: 0.04em;
}

.chat-bubble {
  padding: 8px 13px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
}

.chat-bubble-row.chat-out .chat-bubble {
  background: var(--vermillion, #c4482b);
  color: #fffdf8;
  border-bottom-right-radius: 6px;
}

.chat-bubble-row.chat-out.has-continuation .chat-bubble {
  border-bottom-right-radius: 18px;
}

.chat-bubble-row.chat-out.is-continuation .chat-bubble {
  border-top-right-radius: 6px;
}

.chat-bubble-row.chat-in .chat-bubble {
  background: var(--bg-soft, #efe9d9);
  color: var(--ink, #16140f);
  border: 0.5px solid var(--border, #d8d3c4);
  border-bottom-left-radius: 6px;
}

.chat-bubble-row.chat-in.has-continuation .chat-bubble {
  border-bottom-left-radius: 18px;
}

.chat-bubble-row.chat-in.is-continuation .chat-bubble {
  border-top-left-radius: 6px;
}

/* Compact reply row — single-line by default, auto-grows on input */
.contact-reply-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  border: 0.5px solid var(--border, #d8d3c4);
  background: var(--paper-3, #fffdf8);
  border-radius: 22px;
  padding: 6px 6px 6px 16px;
  max-width: 920px;
  margin: 0 auto;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.contact-reply-row:focus-within {
  border-color: var(--ink, #16140f);
  box-shadow: 0 0 0 3px rgba(22, 20, 15, 0.04);
}

.contact-reply-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink, #16140f);
  padding: 8px 0;
  min-height: 24px;
  max-height: 200px;
  overflow-y: auto;
}

.contact-reply-input::placeholder {
  color: var(--fg-tertiary, #837d72);
}

.contact-reply-send {
  border-radius: 18px;
  padding: 8px 16px;
  font-size: 12px;
  white-space: nowrap;
}

.contact-reply-send kbd {
  margin-left: 6px;
}

/* Deal actions on contact page rail */
.contact-page-deal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.contact-page-deal-cta {
  font-size: 11px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.contact-page-deal-cta svg {
  display: block;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Hover-revealed edit button on contact list rows + contact page header    */
/* ─────────────────────────────────────────────────────────────────────── */

.has-hover-actions {
  position: relative;
}

.hover-action-edit {
  background: var(--bg-base, #fffdf8);
  border: 0.5px solid var(--border, #d8d3c4);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-tertiary, #837d72);
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.hover-action-edit:hover {
  color: var(--ink, #16140f);
  background: var(--bg-soft, #efe9d9);
  border-color: var(--ink, #16140f);
}

.hover-action-edit svg {
  display: block;
}

/* Position on grid card */
.record-card .hover-action-edit {
  position: absolute;
  top: 12px;
  right: 12px;
}

.record-card.has-hover-actions:hover .hover-action-edit,
.record-card.has-hover-actions:focus-within .hover-action-edit {
  opacity: 1;
}

/* Position on table row */
.hover-action-edit-row {
  margin-left: 10px;
  vertical-align: middle;
}

.contact-row.has-hover-actions:hover .hover-action-edit,
.contact-row.has-hover-actions:focus-within .hover-action-edit {
  opacity: 1;
}

/* Contact page header pencil — always visible (vs hover) since the user is
   already focused on this one person */
.contact-page-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin-left: 10px;
  background: transparent;
  border: 0.5px solid var(--border, #d8d3c4);
  border-radius: 4px;
  color: var(--fg-tertiary, #837d72);
  cursor: pointer;
  vertical-align: middle;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.contact-page-edit:hover {
  color: var(--ink, #16140f);
  background: var(--bg-soft, #efe9d9);
  border-color: var(--ink, #16140f);
}

.contact-page-edit svg {
  display: block;
}

.contact-page-hero-text h1 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Edit-mode for the businessCardModal — same chrome as manual mode (no
   camera) but the "Card text" textarea also hides since edit doesn't make
   sense to paste a business card OCR. */
#businessCardModal[data-mode="edit"] .camera-stage,
#businessCardModal[data-mode="edit"] .camera-actions,
#businessCardModal[data-mode="edit"] textarea[name="cardText"],
#businessCardModal[data-mode="edit"] textarea[name="cardText"] + span,
#businessCardModal[data-mode="edit"] label:has(textarea[name="cardText"]) {
  display: none;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* Identity chips (edit-contact modal) — see + remove existing identities  */
/* ─────────────────────────────────────────────────────────────────────── */

.identity-chip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.identity-chip-list-label {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-tertiary, #837d72);
}

.identity-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.identity-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 10px;
  font-size: 12px;
  background: var(--bg-soft, #efe9d9);
  border: 0.5px solid var(--border, #d8d3c4);
  border-radius: 14px;
  color: var(--ink, #16140f);
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.01em;
  max-width: 100%;
}

.identity-chip-icon {
  color: var(--fg-tertiary, #837d72);
  font-size: 10px;
}

.identity-chip-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.identity-chip-remove {
  background: transparent;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  color: var(--fg-tertiary, #837d72);
  cursor: pointer;
  padding: 0;
  transition: background 120ms ease, color 120ms ease;
}

.identity-chip-remove:hover {
  background: var(--vermillion, #c4482b);
  color: var(--paper, #fffdf8);
}

.identity-chip-help {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  color: var(--fg-tertiary, #837d72);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

/* In manual mode (new contact, not edit), there are no existing identities,
   so the chip list section never shows. The [hidden] attribute handles it. */


/* ── Cadence redesign (Quartet Cadence handoff) ──────────────────────────── */
.cadence-page {
  --cad-paper: #f7f6f2;
  --cad-paper-2: #f1efe9;
  --cad-paper-3: #ebe7da;
  --cad-ink: #16140f;
  --cad-ink-2: #4a4740;
  --cad-ink-3: #8a857b;
  --cad-ink-4: #c5c0b3;
  --cad-rule: #d8d3c4;
  --cad-rule-soft: #e6e2d6;
  --cad-vermillion: #c4482b;
  --cad-vermillion-soft: #fbe9e2;
  --cad-indigo: #2b3a55;
  --cad-moss: #5e7551;
  --cad-amber: #c89a3a;
  --cad-weekly: #c4482b;
  --cad-monthly: #c89a3a;
  --cad-quarterly: #5e7551;
  background: var(--cad-paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(22, 20, 15, 0.07) 1px, transparent 0);
  background-size: 16px 16px;
  color: var(--cad-ink);
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 280px;
  font-family: 'Inter Tight', var(--font-sans, system-ui), sans-serif;
  position: relative;
}

.cad-page-head {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 32px 22px;
  display: flex;
  align-items: end;
}

.cad-page-title {
  font-size: 44px;
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1;
  margin: 0 0 8px;
}

.cad-page-meta {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--cad-ink-3);
  letter-spacing: 0.04em;
}

.cad-page-meta strong {
  color: var(--cad-ink);
  font-weight: 500;
}

.cad-page-due {
  color: var(--cad-vermillion);
  font-weight: 500;
}

.cad-cols {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.cad-col {
  background: var(--cad-paper);
  border: 0.5px solid var(--cad-rule);
  padding: 24px 20px 20px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 150ms ease, border-color 150ms ease;
}

.cad-col.drop-target {
  background: var(--cad-paper-2);
  border-color: var(--cad-ink);
}

.cad-col.drop-target-weekly {
  border-color: var(--cad-weekly);
  background: rgba(196, 72, 43, 0.04);
}

.cad-col.drop-target-monthly {
  border-color: var(--cad-monthly);
  background: rgba(200, 154, 58, 0.05);
}

.cad-col.drop-target-quarterly {
  border-color: var(--cad-quarterly);
  background: rgba(94, 117, 81, 0.04);
}

.cad-col-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 0.5px solid var(--cad-rule);
}

.cad-col-name {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.015em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.cad-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translateY(-2px);
}

.cad-col-dot-weekly { background: var(--cad-weekly); }
.cad-col-dot-monthly { background: var(--cad-monthly); }
.cad-col-dot-quarterly { background: var(--cad-quarterly); }

.cad-col-counts {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--cad-ink-3);
  letter-spacing: 0.04em;
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.cad-col-count-total {
  background: var(--cad-paper-3);
  padding: 3px 9px;
  color: var(--cad-ink);
  font-weight: 500;
}

.cad-col-count-due {
  background: var(--cad-vermillion);
  color: var(--cad-paper);
  padding: 3px 9px;
  font-weight: 500;
}

.cad-col-rule {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--cad-ink-3);
  letter-spacing: 0.04em;
  margin-top: -6px;
}

.cad-col-suggest {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--cad-vermillion);
  cursor: pointer;
  padding: 4px 0;
  border: 0;
  border-bottom: 0.5px dashed transparent;
  background: transparent;
  align-self: flex-start;
  font-family: inherit;
}

.cad-col-suggest:hover {
  border-bottom-color: var(--cad-vermillion);
}

.cad-col-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.cad-card {
  background: var(--cad-paper-2);
  border: 0.5px solid var(--cad-rule);
  padding: 14px;
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  align-items: start;
  cursor: grab;
  user-select: none;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.cad-card:hover {
  transform: translateY(-1px);
  box-shadow: 2px 2px 0 var(--cad-paper-3);
  border-color: var(--cad-ink-3);
}

.cad-card.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.cad-card.cad-card-due {
  border-color: var(--cad-vermillion);
  background: var(--cad-vermillion-soft);
}

.cad-card-avatar {
  grid-row: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cad-paper);
}

.cad-card-avatar[data-tone="indigo"] { background: var(--cad-indigo); }
.cad-card-avatar[data-tone="moss"] { background: var(--cad-moss); }
.cad-card-avatar[data-tone="amber"] { background: var(--cad-amber); color: var(--cad-ink); }
.cad-card-avatar[data-tone="vermillion"] { background: var(--cad-vermillion); }
.cad-card-avatar[data-tone="ink"] { background: var(--cad-ink); }

.cad-card-body {
  grid-row: 1;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cad-card-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--cad-ink);
}

.cad-card-account {
  font-size: 12.5px;
  color: var(--cad-ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cad-card-foot {
  grid-row: 2;
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 0.5px solid var(--cad-rule-soft);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--cad-ink-3);
  text-transform: lowercase;
}

.cad-card-past {
  color: var(--cad-vermillion);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.cad-col-empty {
  border: 1px dashed var(--cad-ink-4);
  padding: 60px 20px;
  text-align: center;
  color: var(--cad-ink-3);
  font-size: 13px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Tray ────────────────────────────────────────── */
.cad-tray {
  position: fixed;
  left: var(--sidebar-width, 232px);
  right: 0;
  bottom: 0;
  background: rgba(247, 246, 242, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 0.5px solid var(--cad-ink, #16140f);
  box-shadow: 0 -8px 24px rgba(22, 20, 15, 0.04);
  z-index: 50;
  transition: left 160ms ease, transform 250ms ease, background 200ms ease, border-top-color 200ms ease;
}

.cad-tray.is-collapsed {
  transform: translateY(calc(100% - 56px));
}

.cad-tray.drop-target,
.cad-tray.drop-target-clear {
  border-top-color: var(--cad-vermillion, #c4482b);
  background: rgba(196, 72, 43, 0.06);
}

.cad-tray-head {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 0.5px solid var(--cad-rule, #d8d3c4);
  cursor: pointer;
}

.cad-tray-head-l {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.cad-tray-eyebrow {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cad-vermillion, #c4482b);
}

.cad-tray-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cad-tray-sub {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--cad-ink-3, #8a857b);
  letter-spacing: 0.04em;
}

.cad-tray-sub strong {
  color: var(--cad-ink, #16140f);
  font-weight: 500;
}

.cad-tray-toggle {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--cad-ink-3, #8a857b);
  padding: 6px 12px;
  border: 0.5px solid var(--cad-rule, #d8d3c4);
  cursor: pointer;
  background: var(--cad-paper, #f7f6f2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cad-tray-toggle:hover {
  border-color: var(--cad-ink, #16140f);
  color: var(--cad-ink, #16140f);
}

.cad-tray-arrow {
  display: inline-block;
  transition: transform 200ms ease;
}

.cad-tray.is-collapsed .cad-tray-arrow {
  transform: rotate(180deg);
}

.cad-tray-filters {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 0.5px solid var(--cad-rule-soft, #e6e2d6);
  flex-wrap: wrap;
}

.cad-tray-filter-label {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cad-ink-3, #8a857b);
}

.cad-tray-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cad-tray-chip {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--cad-ink-2, #4a4740);
  padding: 5px 11px;
  border: 0.5px solid var(--cad-rule, #d8d3c4);
  background: var(--cad-paper, #f7f6f2);
  cursor: pointer;
  transition: all 120ms ease;
}

.cad-tray-chip:hover {
  border-color: var(--cad-ink, #16140f);
  color: var(--cad-ink, #16140f);
}

.cad-tray-chip.is-active {
  background: var(--cad-ink, #16140f);
  color: var(--cad-paper, #f7f6f2);
  border-color: var(--cad-ink, #16140f);
}

.cad-tray-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0.5px solid var(--cad-rule, #d8d3c4);
  background: var(--cad-paper, #f7f6f2);
  padding: 6px 10px;
  min-width: 220px;
}

.cad-tray-search svg {
  stroke: var(--cad-ink-3, #8a857b);
  fill: none;
  stroke-width: 1.4;
  flex-shrink: 0;
}

.cad-tray-search input {
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--cad-ink, #16140f);
  width: 100%;
  padding: 0;
  min-height: 0;
}

.cad-tray-body {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 32px 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
  max-height: 280px;
  overflow-y: auto;
  transition: max-height 250ms ease;
}

.cad-tray.is-expanded .cad-tray-body {
  max-height: 56vh;
}

.cad-tray-body::-webkit-scrollbar {
  width: 6px;
}

.cad-tray-body::-webkit-scrollbar-thumb {
  background: var(--cad-rule, #d8d3c4);
}

.cad-tray-empty {
  width: 100%;
  text-align: center;
  padding: 20px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--cad-ink-3, #8a857b);
  letter-spacing: 0.04em;
}

.cad-tray-overflow {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--cad-ink-3, #8a857b);
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border: 0.5px solid var(--cad-rule, #d8d3c4);
  background: var(--cad-paper-2, #f1efe9);
  cursor: pointer;
}

.cad-tray-overflow:hover {
  color: var(--cad-ink, #16140f);
  border-color: var(--cad-ink, #16140f);
}

.cad-tray-overflow strong {
  color: var(--cad-ink, #16140f);
  font-weight: 600;
}

/* ── Blob avatars ────────────────────────────────── */
.cad-blob {
  position: relative;
  width: 88px;
  height: 88px;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
  transition: transform 200ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

.cad-blob:hover {
  transform: translateY(-2px) scale(1.04);
  z-index: 2;
}

.cad-blob:active {
  cursor: grabbing;
  transform: scale(0.97);
}

.cad-blob.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.cad-blob svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

.cad-blob-ring {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 7.2px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  fill: var(--cad-ink-2, #4a4740);
  transition: fill 150ms ease;
}

.cad-blob:hover .cad-blob-ring {
  fill: var(--cad-ink, #16140f);
}

.cad-blob-disc {
  transition: filter 150ms ease, stroke 150ms ease;
  filter: drop-shadow(0 0 0.5px rgba(22, 20, 15, 0.25));
}

.cad-blob:hover .cad-blob-disc {
  filter: drop-shadow(0 4px 10px rgba(22, 20, 15, 0.18));
}

.cad-blob-init {
  font-family: var(--font-sans, 'Inter Tight', system-ui, sans-serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-anchor: middle;
  dominant-baseline: central;
  fill: var(--cad-paper, #f7f6f2);
}

.cad-blob[data-tone="indigo"] .cad-blob-disc { fill: var(--cad-indigo, #2b3a55); }
.cad-blob[data-tone="moss"] .cad-blob-disc { fill: var(--cad-moss, #5e7551); }
.cad-blob[data-tone="amber"] .cad-blob-disc { fill: var(--cad-amber, #c89a3a); }
.cad-blob[data-tone="amber"] .cad-blob-init { fill: var(--cad-ink, #16140f); }
.cad-blob[data-tone="vermillion"] .cad-blob-disc { fill: var(--cad-vermillion, #c4482b); }
.cad-blob[data-tone="ink"] .cad-blob-disc { fill: var(--cad-ink, #16140f); }
.cad-blob[data-no-account="true"] .cad-blob-disc {
  fill: var(--cad-paper-3, #ebe7da);
  stroke: var(--cad-rule, #d8d3c4);
  stroke-width: 0.5;
}
.cad-blob[data-no-account="true"] .cad-blob-init { fill: var(--cad-ink-2, #4a4740); }
.cad-blob[data-no-account="true"]:hover .cad-blob-disc { fill: var(--cad-ink, #16140f); }
.cad-blob[data-no-account="true"]:hover .cad-blob-init { fill: var(--cad-paper, #f7f6f2); }

/* ── Drag hint banner ───────────────────────────── */
.cad-drag-hint {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--cad-ink, #16140f);
  color: var(--cad-paper, #f7f6f2);
  padding: 10px 18px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  z-index: 100;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

body.cad-dragging .cad-drag-hint {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.cad-dragging {
  cursor: grabbing !important;
}

@media (max-width: 980px) {
  .cad-cols {
    grid-template-columns: 1fr;
  }
  .cad-page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* ── Cadence dismiss zone (vertical divider on right of tray dock) ──── */
.cad-tray-dock {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0;
  align-items: stretch;
}

.cad-tray-dock > .cad-tray-body {
  padding: 0;
  /* Two rows only when collapsed: 88px blob × 2 + 14px gap = 190 + a touch. */
  max-height: 192px;
  min-height: 192px;
  overflow: hidden;
  align-content: flex-start;
}

.cad-tray.is-expanded .cad-tray-dock > .cad-tray-body {
  max-height: 56vh;
  min-height: 0;
  overflow-y: auto;
}

.cad-dismiss-zone {
  align-self: stretch;
  width: 180px;
  min-height: 100%;
  border: 0;
  border-left: 1.5px dashed color-mix(in srgb, var(--cad-vermillion, #c4482b) 55%, transparent);
  background: transparent;
  border-radius: 0;
  padding: 8px 18px;
  margin-left: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--cad-vermillion, #c4482b);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: border-color 180ms ease, background 180ms ease;
  flex-shrink: 0;
  user-select: none;
}

.cad-dz-icon {
  font-size: 32px;
  line-height: 1;
  opacity: 0.5;
  transform-origin: 50% 50%;
  transition: transform 300ms ease, opacity 180ms ease;
}

.cad-dz-label {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  opacity: 0.75;
}

.cad-dz-sub {
  font-size: 10px;
  color: var(--cad-ink-3, #8a857b);
  letter-spacing: 0.08em;
  text-transform: none;
  font-weight: 400;
  max-width: 140px;
  text-align: center;
  line-height: 1.3;
  opacity: 0.85;
}

body.cad-dragging .cad-dismiss-zone {
  border-left-color: var(--cad-vermillion, #c4482b);
}

body.cad-dragging .cad-dismiss-zone .cad-dz-icon,
body.cad-dragging .cad-dismiss-zone .cad-dz-label {
  opacity: 1;
}

.cad-dismiss-zone.drop-target,
.cad-dismiss-zone.drop-target-clear {
  border-left-color: var(--cad-vermillion, #c4482b);
  background: linear-gradient(to right,
    transparent 0,
    color-mix(in srgb, var(--cad-vermillion, #c4482b) 14%, transparent) 12px,
    color-mix(in srgb, var(--cad-vermillion, #c4482b) 18%, transparent) 100%);
}

.cad-dismiss-zone.drop-target .cad-dz-icon,
.cad-dismiss-zone.drop-target-clear .cad-dz-icon {
  transform: rotate(-12deg) scale(1.18);
  opacity: 1;
}

.cad-dismiss-zone.drop-target .cad-dz-label,
.cad-dismiss-zone.drop-target .cad-dz-sub,
.cad-dismiss-zone.drop-target-clear .cad-dz-label,
.cad-dismiss-zone.drop-target-clear .cad-dz-sub {
  color: var(--cad-vermillion, #c4482b);
  opacity: 1;
}

/* Vortex animation when something is dismissed */
@keyframes cadDismissVortex {
  0%   { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; filter: blur(0); }
  35%  { transform: translate(var(--cad-vortex-dx, 0), var(--cad-vortex-dy, 0)) rotate(220deg) scale(0.55); opacity: 0.85; filter: blur(0.4px); }
  70%  { transform: translate(var(--cad-vortex-dx, 0), var(--cad-vortex-dy, 0)) rotate(540deg) scale(0.18); opacity: 0.4; filter: blur(1.2px); }
  100% { transform: translate(var(--cad-vortex-dx, 0), var(--cad-vortex-dy, 0)) rotate(720deg) scale(0); opacity: 0; filter: blur(2px); }
}

.cad-dismissing {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  animation: cadDismissVortex 620ms cubic-bezier(0.5, 0.05, 0.7, 0.2) forwards;
}

@keyframes cadVoidPulse {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; }
}

.cad-void-pulse {
  position: fixed;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 1.5px solid var(--cad-vermillion, #c4482b);
  pointer-events: none;
  z-index: 70;
  animation: cadVoidPulse 550ms ease-out forwards;
}

/* ── Per-card Suggest message + tone tabs ────────────────────────────── */
.cad-card-suggest {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0.5px dashed var(--cad-rule-soft, #e6e2d6);
}

.cad-cc-suggest-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--cad-vermillion, #c4482b);
  background: none;
  border: 0.5px solid color-mix(in srgb, var(--cad-vermillion, #c4482b) 40%, transparent);
  padding: 4px 8px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.cad-cc-suggest-btn:hover {
  border-color: var(--cad-vermillion, #c4482b);
  background: color-mix(in srgb, var(--cad-vermillion, #c4482b) 8%, transparent);
}

.cad-cc-suggest-btn[disabled] {
  cursor: progress;
  opacity: 0.7;
}

.cad-cc-suggest-btn svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
}

.cad-cc-tone {
  display: inline-flex;
  border: 0.5px solid var(--cad-rule, #d8d3c4);
  margin-left: auto;
}

.cad-cc-tone button {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cad-ink-3, #8a857b);
  background: none;
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
  border-right: 0.5px solid var(--cad-rule, #d8d3c4);
}

.cad-cc-tone button:last-child {
  border-right: 0;
}

.cad-cc-tone button:hover {
  color: var(--cad-ink, #16140f);
}

.cad-cc-tone button.is-active {
  background: var(--cad-ink, #16140f);
  color: var(--cad-paper, #f7f6f2);
}

/* Hold-to-dismiss countdown ───────────────────────────────── */
.cad-card,
.cad-blob {
  position: relative;
}

.cad-card.is-holding,
.cad-blob.is-holding {
  /* No outline — the centered countdown ring is the only indicator. */
}

.cad-hold-countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(22, 20, 15, 0.85);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  font-family: var(--font-sans, system-ui);
  box-shadow: 0 4px 16px rgba(196, 72, 43, 0.3);
  pointer-events: none;
  /* Conic gradient ring shows progress (var --cad-hold-progress is 0→1) */
  background-image: conic-gradient(var(--cad-vermillion, #c4482b) calc(var(--cad-hold-progress, 0) * 360deg), transparent 0deg);
  /* Use the conic as a ring by overlaying the dark inner with mask trick: */
}

.cad-hold-countdown::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: rgba(22, 20, 15, 0.9);
  z-index: -1;
}

/* Per-message delete button ──────────────────────────────── */
.msg-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border: 0.5px solid rgba(22, 20, 15, 0.18);
  background: var(--bg-base);
  color: var(--fg-tertiary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
  padding: 0;
}

.msg-delete svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.msg-bubble {
  position: relative;
}

.msg-bubble:hover .msg-delete,
.msg-bubble:focus-within .msg-delete,
.correspondence-email-card:hover .msg-delete,
.correspondence-email-card:focus-within .msg-delete {
  opacity: 1;
}

.msg-delete:hover {
  color: #b03030;
  border-color: #b03030;
  transform: scale(1.08);
}

/* Email card variant: place delete in the header row instead of overlapping */
.correspondence-email-head .msg-delete {
  position: static;
  margin-left: 8px;
}

/* ── Sidebar user button + popover menu ─────────────────────────────────── */
/* Existing .sidebar-footer already has position: sticky, which acts as the
   positioning context for the absolutely-positioned menu below. We just need
   it to lay out as a single column instead of the previous avatar | info |
   logout-button row. */
.sidebar-footer {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  transition: background 120ms ease;
  font-family: inherit;
}

.sidebar-user:hover {
  background: rgba(22, 20, 15, 0.04);
}

.sidebar-user[aria-expanded="true"] {
  background: rgba(22, 20, 15, 0.06);
}

.sidebar-user .avatar {
  flex: 0 0 auto;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}

.sidebar-user-info strong {
  font-size: 13px;
  color: var(--fg, #16140f);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-info span {
  font-size: 11px;
  color: var(--fg-tertiary, #8a857b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-chev {
  font-size: 10px;
  color: var(--fg-tertiary, #8a857b);
  transition: transform 160ms ease;
  flex: 0 0 auto;
}

.sidebar-user[aria-expanded="true"] .sidebar-user-chev {
  transform: rotate(180deg);
}

.quartet-app[data-sidebar-collapsed="true"] .sidebar-user-info,
.quartet-app[data-sidebar-collapsed="true"] .sidebar-user-chev {
  display: none;
}

.sidebar-user-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 8px;
  right: 8px;
  width: auto;
  max-width: calc(100vw - 24px);
  background: var(--bg-base);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(22, 20, 15, 0.14);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 60;
}

.quartet-app[data-sidebar-collapsed="true"] .sidebar-user-menu {
  left: 8px;
  right: auto;
  width: 216px;
  min-width: 200px;
}

.sidebar-user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--fg, #16140f);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background 120ms ease, color 120ms ease;
}

.sidebar-user-menu-item:hover {
  background: rgba(22, 20, 15, 0.05);
}

.sidebar-user-menu-item .nav-icon {
  color: var(--fg-tertiary, #8a857b);
}

.sidebar-user-menu-item:hover .nav-icon {
  color: var(--fg, #16140f);
}

.sidebar-user-menu-section {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-tertiary, #8a857b);
  padding: 8px 10px 4px;
}

.sidebar-user-menu-divider {
  height: 0.5px;
  background: var(--border);
  margin: 4px -2px;
}

.sidebar-user-menu .data-mode-toggle {
  margin: 0 4px 4px;
  padding: 2px;
  background: var(--bg-soft, #efe9d9);
  border-radius: 6px;
  display: flex;
  gap: 2px;
}

.sidebar-user-menu .data-mode-toggle button {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  color: var(--fg-secondary, #4a4740);
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.sidebar-user-menu .data-mode-toggle button.active {
  background: var(--bg-base);
  color: var(--fg, #16140f);
  font-weight: 600;
}

/* ── Billing stub ───────────────────────────────────────────────────────── */
.billing-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.billing-plan-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.billing-plan-meta {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--fg-tertiary, #8a857b);
  margin-top: 4px;
}

.billing-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.billing-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--fg-tertiary, #8a857b);
}

/* ── Deal modal: side-by-side fields ───────────────────────────────────── */
.deal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 540px) {
  .deal-form-row {
    grid-template-columns: 1fr;
  }
}

/* Edit button in the deal rail header */
.rail-detail-head {
  position: relative;
}

.rail-deal-edit {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 6px;
  min-height: 0;
  border: 0.5px solid transparent;
  background: transparent;
  color: var(--fg-tertiary, #8a857b);
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rail-deal-edit:hover {
  border-color: var(--border);
  color: var(--fg, #16140f);
}

.rail-deal-edit svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

/* ── Pipedrive import modal ────────────────────────────────────────────── */
.pipedrive-import-modal {
  max-width: 720px;
  width: min(720px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 86vh;
  overflow-y: auto;
}

.pipedrive-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pipedrive-step[hidden] {
  display: none;
}

.pipedrive-help {
  margin: 0;
  font-size: 13px;
  color: var(--fg-secondary, #4a4740);
}

.pipedrive-dropzone {
  display: block;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-soft, #f1efe9);
  transition: background 120ms ease, border-color 120ms ease;
}

.pipedrive-dropzone:hover,
.pipedrive-dropzone.is-active {
  background: var(--bg-base);
  border-color: var(--accent, #c4482b);
}

.pipedrive-dropzone-label {
  font-size: 13px;
  color: var(--fg-secondary);
}

.pipedrive-status {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px;
  color: var(--fg-tertiary);
  min-height: 16px;
}

.pipedrive-summary {
  font-size: 14px;
  font-weight: 500;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 0.5px solid var(--border);
  border-radius: 6px;
}

.pipedrive-pipeline-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pipedrive-pipeline-row > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-secondary);
  min-width: 140px;
}

.pipedrive-pipeline-row > select {
  flex: 1;
}

.pipedrive-stage-section {
  border: 0.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.pipedrive-stage-head,
.pipedrive-stage-row {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr 70px;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
}

.pipedrive-stage-head {
  background: var(--bg-soft);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  border-bottom: 0.5px solid var(--border);
}

.pipedrive-stage-row {
  border-top: 0.5px solid var(--border);
  font-size: 13px;
}

.pipedrive-stage-row:first-child {
  border-top: 0;
}

.pipedrive-stage-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipedrive-stage-count {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px;
  color: var(--fg-tertiary);
  text-align: right;
}

.pipedrive-preview-details {
  font-size: 12px;
  color: var(--fg-secondary);
}

.pipedrive-preview-details summary {
  cursor: pointer;
  padding: 6px 0;
  font-weight: 500;
}

.pipedrive-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pipedrive-preview-table th,
.pipedrive-preview-table td {
  padding: 6px 8px;
  border-bottom: 0.5px solid var(--border);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.pipedrive-preview-table th {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
}

.pipedrive-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pipedrive-progress-bar {
  height: 8px;
  background: var(--bg-soft);
  border: 0.5px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.pipedrive-progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent, #c4482b);
  transition: width 200ms ease;
}

.pipedrive-progress-status {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px;
  color: var(--fg-secondary);
}

.pipedrive-progress-errors {
  font-size: 12px;
  color: var(--fg);
  padding: 10px 12px;
  background: #fff0f0;
  border: 0.5px solid #d8a0a0;
  border-radius: 6px;
}

.pipedrive-progress-errors ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

/* ── Sidebar music row + stop button ──────────────────────────────────── */
.sidebar-music-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 0;
}

.sidebar-music-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  font: inherit;
  color: var(--fg, #16140f);
  transition: background 120ms ease;
}

.sidebar-music-main:hover {
  background: rgba(22, 20, 15, 0.05);
}

.sidebar-music-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--fg-tertiary, #8a857b);
  transition: color 120ms ease;
}

.sidebar-music-row.is-on .sidebar-music-icon {
  color: var(--accent, #c4482b);
}

.sidebar-music-icon svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.sidebar-music-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}

.sidebar-music-title {
  font-size: 13px;
  color: var(--fg, #16140f);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-music-state {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--fg-tertiary, #8a857b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-music-row.is-on .sidebar-music-state {
  color: var(--accent, #c4482b);
}

.sidebar-music-eq {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
  flex: 0 0 auto;
}

.sidebar-music-row.is-on .sidebar-music-eq {
  display: inline-flex;
}

.sidebar-music-eq span {
  width: 2.5px;
  background: var(--accent, #c4482b);
  border-radius: 1px;
  animation: quartetMusicEq 1s ease-in-out infinite;
}

.sidebar-music-eq span:nth-child(1) { animation-delay: 0s; }
.sidebar-music-eq span:nth-child(2) { animation-delay: 0.18s; }
.sidebar-music-eq span:nth-child(3) { animation-delay: 0.36s; }
.sidebar-music-eq span:nth-child(4) { animation-delay: 0.12s; }

@keyframes quartetMusicEq {
  0%, 100% { height: 4px; }
  50% { height: 16px; }
}

.sidebar-music-stop {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0.5px solid var(--accent, #c4482b);
  background: transparent;
  color: var(--accent, #c4482b);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  border-radius: 4px;
  transition: background 120ms ease, color 120ms ease;
}

.sidebar-music-stop:hover {
  background: var(--accent, #c4482b);
  color: var(--bg-base, #f7f6f2);
}

/* ── Music theme picker ──────────────────────────────────────────────── */
.sidebar-music-themes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 0 4px;
}

.sidebar-music-theme {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 2px;
  border: 0.5px solid var(--border);
  background: var(--bg-base);
  cursor: pointer;
  font-family: inherit;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--fg-secondary, #4a4740);
  border-radius: 4px;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
  min-width: 0;
  overflow: hidden;
}

.sidebar-music-theme:hover {
  border-color: var(--fg-secondary, #4a4740);
  color: var(--fg, #16140f);
}

.sidebar-music-theme.is-active {
  border-color: var(--accent, #c4482b);
  color: var(--fg, #16140f);
  background: color-mix(in srgb, var(--accent, #c4482b) 6%, transparent);
}

.sidebar-music-theme-glyph {
  display: block;
  width: 28px;
  height: 14px;
  position: relative;
  color: var(--fg-secondary, #4a4740);
}

.sidebar-music-theme.is-active .sidebar-music-theme-glyph {
  color: var(--accent, #c4482b);
}

/* Drift — flat sine line, suggesting calm, beat-less drone */
.sidebar-music-theme-glyph-drift::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 0.5px);
  height: 1px;
  background: currentColor;
  opacity: 0.85;
}

.sidebar-music-theme-glyph-drift::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 30%;
  height: 40%;
  border: 1px solid currentColor;
  border-bottom: 0;
  border-left: 0;
  border-right: 0;
  border-top-left-radius: 14px 12px;
  border-top-right-radius: 14px 12px;
  opacity: 0.5;
}

/* Pulse — three dots, evenly spaced, suggesting steady kick */
.sidebar-music-theme-glyph-pulse::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%);
  box-shadow: 8px 0 0 currentColor, 16px 0 0 currentColor;
}

/* Lift — ascending stair bars, suggesting brighter, optimistic motion */
.sidebar-music-theme-glyph-lift {
  display: grid;
  grid-template-columns: repeat(4, 4px);
  gap: 2px;
  align-items: end;
  justify-content: center;
}

.sidebar-music-theme-glyph-lift::before,
.sidebar-music-theme-glyph-lift::after {
  content: '';
  background: currentColor;
  width: 4px;
}

.sidebar-music-theme-glyph-lift::before {
  height: 30%;
  box-shadow:
    6px 0 0 currentColor,
    6px 4px 0 currentColor;
}

.sidebar-music-theme-glyph-lift::after {
  height: 100%;
  margin-left: 12px;
  box-shadow: -6px 4px 0 currentColor, -6px 6px 0 currentColor;
}

/* ── Theme: Dusk (warm dark) ──────────────────────────────────────────── */
:root[data-theme="dusk"] {
  color-scheme: dark;
  --paper:   #1d1a14;
  --paper-2: #25211a;
  --paper-3: #2b261e;
  --paper-4: #34302a;
  --ink:     #f0ebde;
  --ink-2:   #c5c0b3;
  --ink-3:   #8a857b;
  --ink-4:   #5e574c;
  --rule:        #34302a;
  --rule-soft:   #2a261f;
  --vermillion:      #d97c5a;
  --vermillion-dark: #c4482b;
  --vermillion-soft: #3a261d;
  --indigo:       #6a85c2;
  --indigo-soft:  #232a3a;
  --mustard:      #d3a55a;
  --mustard-soft: #3a2f1a;
  --bg-base:    var(--paper);
  --bg-app:     #181510;
  --bg-surface: var(--paper-2);
  --bg-sunken:  #16130d;
  --glass-1: var(--paper);
  --glass-2: var(--paper-2);
  --glass-3: var(--paper-3);
  --fg:           var(--ink);
  --fg-secondary: var(--ink-2);
  --fg-tertiary:  var(--ink-3);
  --fg-quaternary: var(--ink-4);
  --border:       var(--rule);
  --border-soft:  var(--rule-soft);
  --accent:       var(--vermillion);
  --accent-hover: #f08966;
  --accent-soft:  var(--vermillion-soft);
  --shadow-sm: 0 1px 0 rgb(0 0 0 / 0.4);
  --shadow-md: 0 1px 0 rgb(0 0 0 / 0.5), 0 10px 28px rgb(0 0 0 / 0.4);
  --shadow-card: 0 1px 0 rgb(0 0 0 / 0.4);
  --shadow-glass: 0 1px 0 rgb(0 0 0 / 0.4);
}

/* ── Theme: Indigo (cool light) ───────────────────────────────────────── */
:root[data-theme="indigo"] {
  --paper:   #f4f2f7;
  --paper-2: #ecebf2;
  --paper-3: #ffffff;
  --paper-4: #dedaeb;
  --ink:   #161425;
  --ink-2: #3d3b56;
  --ink-3: #7a7798;
  --ink-4: #aeacc4;
  --rule:        #d2d0e0;
  --rule-soft:   #e2e0ed;
  --vermillion:      #2b3a55;
  --vermillion-dark: #1d2a40;
  --vermillion-soft: #dee4ee;
  --accent:       var(--vermillion);
  --accent-hover: var(--vermillion-dark);
  --accent-soft:  var(--vermillion-soft);
}

/* ── Cadence draft (mini email) modal ──────────────────────────────────── */
.cadence-draft-modal {
  max-width: 580px;
  width: min(580px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 86vh;
  overflow-y: auto;
}

.cadence-draft-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cadence-draft-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--fg-secondary, #4a4740);
  background: var(--bg-soft, #f1efe9);
  border: 0.5px solid var(--border);
  border-radius: 999px;
}

.cadence-draft-chip-cadence {
  background: var(--accent, #c4482b);
  color: var(--bg-base, #f7f6f2);
  border-color: var(--accent, #c4482b);
}

.cadence-draft-chip-tone {
  background: var(--fg, #16140f);
  color: var(--bg-base, #f7f6f2);
  border-color: var(--fg, #16140f);
}

.cadence-draft-modal label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cadence-draft-modal label > span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-tertiary, #8a857b);
}

.cadence-draft-body-label textarea {
  font-family: var(--font-sans, system-ui);
  font-size: 13.5px;
  line-height: 1.55;
  resize: vertical;
  min-height: 200px;
}

.cadence-draft-body-label textarea:disabled {
  background: var(--bg-soft, #f1efe9);
  color: var(--fg-tertiary);
}

.cadence-draft-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cadence-draft-actions .form-status {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--fg-tertiary, #8a857b);
}

/* ── Pipeline deal card: hover-revealed edit button ─────────────────────── */
.deal-card-edit {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0.5px solid transparent;
  background: transparent;
  color: var(--fg-tertiary);
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 120ms ease, color 120ms ease, border-color 120ms ease, background 120ms ease;
  z-index: 2;
}

.deal-card-edit svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.deal-card:hover .deal-card-edit,
.deal-card:focus-within .deal-card-edit,
.deal-card.selected .deal-card-edit {
  opacity: 1;
}

.deal-card-edit:hover {
  color: var(--fg);
  border-color: var(--border);
  background: var(--bg-base);
}

/* ── Cadence multi-select ─────────────────────────────────────────────── */
.cad-card.is-multi-selected,
.cad-blob.is-multi-selected {
  outline: 1.5px solid var(--cad-vermillion, #c4482b);
  outline-offset: 2px;
}

.cad-blob.is-multi-selected {
  outline-offset: -2px;
  outline-style: solid;
  outline-width: 2px;
}

.cad-blob.is-multi-selected .cad-blob-disc {
  filter: drop-shadow(0 0 0.5px var(--cad-vermillion, #c4482b)) drop-shadow(0 4px 14px rgba(196, 72, 43, 0.35));
}

.cad-selection-bar {
  position: fixed;
  bottom: 240px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--cad-ink, #16140f);
  color: var(--cad-paper, #f7f6f2);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(22, 20, 15, 0.18);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.cad-selection-bar[hidden] {
  display: none;
}

.cad-selection-count strong {
  background: var(--cad-vermillion, #c4482b);
  color: var(--cad-paper, #f7f6f2);
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 700;
  margin-right: 6px;
}

.cad-selection-hint {
  opacity: 0.75;
  letter-spacing: 0.04em;
  text-transform: none;
}

.cad-selection-action {
  border: 0.5px solid rgba(247, 246, 242, 0.4);
  background: transparent;
  color: var(--cad-paper, #f7f6f2);
  font-family: inherit;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.cad-selection-action:hover {
  background: rgba(247, 246, 242, 0.08);
  border-color: rgba(247, 246, 242, 0.7);
}

.cad-selection-action-clear:hover {
  background: var(--cad-vermillion, #c4482b);
  border-color: var(--cad-vermillion, #c4482b);
}

/* Show drag count badge over the cursor when dragging multiple */
body.cad-dragging[data-cad-drag-count]:not([data-cad-drag-count="1"])::after {
  content: attr(data-cad-drag-count);
  position: fixed;
  pointer-events: none;
  background: var(--cad-vermillion, #c4482b);
  color: var(--cad-paper, #f7f6f2);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
}

/* ── iMessage bubble: unresolved sender link ───────────────────────────── */
.msg-bubble-from-link {
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent, #c4482b);
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.msg-bubble-from-link:hover {
  color: var(--accent-hover, #9f3824);
}

.msg-bubble-from-add {
  display: inline-grid;
  place-items: center;
  width: 12px;
  height: 12px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
  background: var(--accent, #c4482b);
  color: var(--bg-base, #f7f6f2);
}

/* ── Correspondence: Create deal button ─────────────────────────────── */
.correspondence-link-deal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
}

.correspondence-link-deal svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

/* ── Today v2: priorities cards + ask anything ─────────────────────────── */
.jp-today.today-v2 {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px 32px 60px;
  height: 100%;
  overflow-y: auto;
}

.today-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.today-header-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg-tertiary, #8a857b);
}

.today-header-eyebrow {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-secondary, #4a4740);
}

.today-header-sep {
  color: var(--fg-quaternary, #c5c0b3);
}

.today-header-date {
  text-transform: uppercase;
}

.today-header-greeting {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--fg, #16140f);
  line-height: 1.2;
}

.today-header-greeting em {
  font-style: normal;
  font-weight: 650;
  color: var(--accent, #c4482b);
}

.today-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid var(--border);
}

.today-section-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg, #16140f);
}

.today-section-jp {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-tertiary, #8a857b);
}

.today-section-meta {
  margin-left: auto;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-tertiary, #8a857b);
}

/* Priorities — horizontal card rail */
.today-priority-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-gutter: stable;
}

.today-priority-rail::-webkit-scrollbar { height: 6px; }
.today-priority-rail::-webkit-scrollbar-thumb { background: var(--border); }

.today-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 12px;
  background: var(--bg-base);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  position: relative;
  outline: none;
  min-height: 132px;
}

.today-card:hover,
.today-card:focus-visible {
  border-color: var(--fg-tertiary, #8a857b);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(22, 20, 15, 0.06);
}

.today-card-num {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--fg-tertiary, #8a857b);
}

.today-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--fg-secondary, #4a4740);
}

.today-card-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #c4482b);
}

.today-card-tag-dot-deal { background: var(--accent, #c4482b); }
.today-card-tag-dot-imsg { background: #2b3a55; }

.today-card-tag-amount {
  margin-left: auto;
  color: var(--fg-tertiary, #8a857b);
}

.today-card-title {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--fg, #16140f);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.today-card-sub {
  font-size: 12.5px;
  color: var(--fg-secondary, #4a4740);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.today-card-action {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--accent, #c4482b);
  margin-top: auto;
}

.today-priority-empty {
  padding: 24px;
  text-align: center;
  color: var(--fg-tertiary);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

/* Ask anything */
.today-ask {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.today-ask-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-base);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px 12px;
  box-shadow: 0 1px 0 rgba(22, 20, 15, 0.06);
}

.today-ask-input {
  border: 0;
  outline: none;
  background: transparent;
  resize: vertical;
  min-height: 36px;
  font-family: var(--font-sans, system-ui);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--fg, #16140f);
  width: 100%;
  padding: 0;
}

.today-ask-input::placeholder {
  color: var(--fg-tertiary, #8a857b);
}

.today-ask-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.today-ask-status {
  flex: 1;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--fg-tertiary, #8a857b);
}

.today-ask-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.today-ask-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 50vh;
  overflow-y: auto;
}

.today-ask-turn {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.55;
}

.today-ask-turn-user {
  align-self: flex-end;
  max-width: 75%;
  background: var(--fg, #16140f);
  color: var(--bg-base, #f7f6f2);
  white-space: pre-wrap;
}

.today-ask-turn-assistant {
  align-self: flex-start;
  max-width: 90%;
  background: var(--bg-soft, #f1efe9);
  color: var(--fg, #16140f);
  border: 0.5px solid var(--border);
}

.today-ask-turn-assistant p {
  margin: 0 0 6px;
}

.today-ask-turn-assistant p:last-child {
  margin: 0;
}

.today-ask-turn-loading {
  font-style: italic;
  color: var(--fg-tertiary, #8a857b);
  letter-spacing: 0.4em;
}

/* ── Command palette: Create contact CTA ──────────────────────────────── */
.command-result-create {
  border: 0.5px solid color-mix(in srgb, var(--accent, #c4482b) 50%, transparent);
  background: color-mix(in srgb, var(--accent, #c4482b) 5%, var(--bg-base));
  color: var(--fg, #16140f);
}

.command-result-create:hover {
  background: color-mix(in srgb, var(--accent, #c4482b) 10%, var(--bg-base));
  border-color: var(--accent, #c4482b);
}

.command-result-create .rank {
  color: var(--accent, #c4482b);
  font-weight: 700;
}

.command-results .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
}

.command-results .empty-state p {
  margin: 0;
  color: var(--fg-tertiary);
  font-size: 13px;
}

/* ── Today v2: Latest correspondence rail ─────────────────────────────── */
.today-latest-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-gutter: stable;
}

.today-latest-rail::-webkit-scrollbar { height: 6px; }
.today-latest-rail::-webkit-scrollbar-thumb { background: var(--border); }

.today-latest-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg-base);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  outline: none;
  min-height: 116px;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.today-latest-card:hover,
.today-latest-card:focus-visible {
  border-color: var(--fg-tertiary);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(22, 20, 15, 0.06);
}

.today-latest-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--fg-tertiary);
}

.today-latest-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.today-latest-dot-email { background: var(--accent, #c4482b); }
.today-latest-dot-imsg { background: #2b80ff; }

.today-latest-channel {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--fg-secondary);
}

.today-latest-direction {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.today-latest-when {
  margin-left: auto;
}

.today-latest-from {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-latest-subject {
  font-size: 12px;
  color: var(--fg-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-latest-snippet {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* ── Today v3 — checklist + side panel ─────────────────────────────────── */
.jp-today.today-v3 {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 32px 60px;
  height: 100%;
  overflow-y: auto;
}

.today-v3 .today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.today-v3 .today-main {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}

.today-v3 .today-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  max-height: calc(100vh - 56px);
}

.today-v3 .today-side-head {
  margin-bottom: 6px;
  flex: 0 0 auto;
}

.today-latest-list-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  scrollbar-gutter: stable;
}

/* Checklist */
.today-checklist-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.today-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.today-todo-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 12px 4px 12px 0;
  border-bottom: 0.5px solid var(--border);
  align-items: start;
}

.today-todo-row:last-child {
  border-bottom: none;
}

.today-todo-check {
  appearance: none;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  border: 1px solid var(--fg-tertiary, #8a857b);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-base, #f7f6f2);
  padding: 0;
  transition: background 120ms ease, border-color 120ms ease;
  flex: 0 0 auto;
}

.today-todo-check:hover {
  border-color: var(--fg, #16140f);
}

.today-todo-row.is-done .today-todo-check {
  background: var(--accent, #c4482b);
  border-color: var(--accent, #c4482b);
}

.today-todo-body {
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: inherit;
}

.today-todo-body:hover .today-todo-title {
  color: var(--accent, #c4482b);
}

.today-todo-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--fg-secondary, #4a4740);
}

.today-todo-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #c4482b);
}

.today-todo-tag-amount {
  margin-left: auto;
  color: var(--fg-tertiary, #8a857b);
}

.today-todo-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg, #16140f);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 120ms ease;
}

.today-todo-sub {
  font-size: 12.5px;
  color: var(--fg-secondary, #4a4740);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.today-todo-row.is-done .today-todo-title,
.today-todo-row.is-done .today-todo-sub,
.today-todo-row.is-done .today-todo-head {
  text-decoration: line-through;
  color: var(--fg-tertiary, #8a857b);
}

.today-todo-row.is-done .today-todo-body:hover .today-todo-title {
  color: var(--fg-tertiary, #8a857b);
}

.today-checklist-empty {
  padding: 16px 0;
  font-size: 13px;
  color: var(--fg-tertiary, #8a857b);
  font-style: italic;
}

.today-done-group {
  margin-top: 14px;
  border-top: 0.5px dashed var(--border);
  padding-top: 10px;
}

.today-done-summary {
  cursor: pointer;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-tertiary, #8a857b);
  padding: 4px 0;
  list-style: none;
}

.today-done-summary::-webkit-details-marker { display: none; }

.today-done-summary::before {
  content: '▸';
  display: inline-block;
  width: 12px;
  margin-right: 4px;
  transition: transform 120ms ease;
  font-size: 10px;
}

.today-done-group[open] .today-done-summary::before {
  transform: rotate(90deg);
}

/* Side panel: latest messages */
.today-latest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.today-latest-list > li + li {
  border-top: 0.5px solid var(--border);
}

.today-latest-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 12px 10px;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: background 120ms ease;
}

.today-latest-row:hover {
  background: rgba(22, 20, 15, 0.04);
}

.today-latest-row .today-latest-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--fg-tertiary);
}

.today-latest-row .today-latest-from {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-latest-row .today-latest-subject {
  font-size: 12px;
  color: var(--fg-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.today-latest-row .today-latest-snippet {
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.today-latest-empty {
  padding: 16px 10px;
  font-size: 12.5px;
  color: var(--fg-tertiary, #8a857b);
  font-style: italic;
}

@media (max-width: 1080px) {
  .today-v3 .today-grid {
    grid-template-columns: 1fr;
  }
  .today-v3 .today-side {
    position: static;
  }
}

/* ── Signup multi-step + perks ─────────────────────────────────────────── */
.auth-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
}

.auth-step {
  padding: 4px 10px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
}

.auth-step.is-active {
  background: var(--fg);
  color: var(--bg-base);
  border-color: var(--fg);
}

.auth-step.is-done {
  border-color: var(--fg-tertiary);
  color: var(--fg-secondary);
}

.auth-step-sep {
  flex: 1;
  height: 0.5px;
  background: var(--border);
}

.auth-ref-banner {
  font-size: 12px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--accent, #c4482b) 8%, var(--bg-base));
  border: 0.5px solid color-mix(in srgb, var(--accent, #c4482b) 35%, transparent);
  border-radius: 6px;
  color: var(--fg-secondary);
}

.auth-ref-banner strong {
  color: var(--accent, #c4482b);
}

.auth-perk {
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-perk-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-perk-eyebrow {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-secondary);
}

.auth-perk-tag {
  margin-left: auto;
  background: var(--accent, #c4482b);
  color: var(--bg-base);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
}

.auth-perk-copy {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg-secondary);
}

.auth-perk-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.auth-perk-chev {
  font-size: 12px;
  color: var(--fg-tertiary);
  transition: transform 160ms ease;
}

.auth-perk-vc.is-expanded .auth-perk-chev {
  transform: rotate(180deg);
}

.auth-perk-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 0.5px solid var(--border);
}

.auth-perk-body label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-perk-body label > span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
}

.auth-vc-hint {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  min-height: 14px;
  color: var(--fg-tertiary);
}

.auth-vc-hint[data-state="ok"] { color: #2f6b3e; }
.auth-vc-hint[data-state="warn"] { color: #8a6712; }

.auth-vc-checkbox {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-secondary);
}

.auth-vc-checkbox input { margin: 0; }

.auth-step2-actions {
  align-items: center;
  gap: 8px;
}

.auth-step2-actions .form-status {
  flex: 1;
  text-align: right;
}

/* ── Signup welcome modal ─────────────────────────────────────────────── */
.signup-welcome-modal {
  max-width: 520px;
  width: min(520px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 88vh;
  overflow-y: auto;
}

.signup-welcome-lead {
  margin: 0;
  font-size: 14px;
  color: var(--fg-secondary);
}

.signup-welcome-section {
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.signup-welcome-section p {
  margin: 0;
  font-size: 13px;
  color: var(--fg-secondary);
  line-height: 1.5;
}

.signup-welcome-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.signup-welcome-eyebrow {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-secondary);
}

.signup-welcome-tag {
  margin-left: auto;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  background: var(--accent, #c4482b);
  color: var(--bg-base);
}

.signup-welcome-tag.is-ok { background: #2f6b3e; }
.signup-welcome-tag.is-pending { background: var(--mustard, #c89a3a); color: var(--ink, #16140f); }

.signup-welcome-link {
  display: flex;
  gap: 6px;
}

.signup-welcome-link input {
  flex: 1;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  padding: 8px 10px;
  border: 0.5px solid var(--border);
  background: var(--bg-soft);
  color: var(--fg);
  border-radius: 4px;
}

.signup-welcome-share {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.signup-welcome-share .ghost-button {
  font-size: 12px;
  padding: 6px 12px;
}
