/*
 * ASHTON.Email visual system
 *
 * An original, task-first identity for a dense outreach product: graphite rather
 * than corporate navy, periwinkle for deliberate actions, amber for the brand
 * signal, and mint only for provider-confirmed healthy states.  This file loads
 * last so legacy page components inherit one coherent system without changing
 * their behavior or route ownership.
 */

:root {
  color-scheme: dark;
  --ashton-bg: #08090f;
  --ashton-sidebar: #0b0c12;
  --ashton-surface: #11131c;
  --ashton-elevated: #171a25;
  --ashton-surface-strong: #1c202c;
  --ashton-border: #2a2e3b;
  --ashton-border-soft: rgba(174, 183, 214, .12);
  --ashton-primary: #5260c9;
  --ashton-primary-hover: #5f6dd3;
  --ashton-primary-soft: rgba(101, 115, 230, .14);
  --ashton-link: #aab3ff;
  --ashton-copy: #f5f6fa;
  --ashton-muted: #a0a4b2;
  --ashton-dim: #737887;
  --ashton-highlight: #c1c6ff;
  --ashton-success: #43d2ae;
  --ashton-warning: #f2b85f;
  --ashton-danger: #ff7188;
  --ashton-brand-warm: #ffb33e;
  --ashton-font: "Inter", "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ashton-type-body: .875rem;
  --ashton-type-caption: .72rem;
  --ashton-type-label: .75rem;
  --ashton-type-control: .875rem;
  --ashton-type-heading-1: 1.75rem;
  --ashton-type-heading-2: 1.15rem;
  --ashton-type-heading-3: .98rem;
  --ashton-weight-regular: 450;
  --ashton-weight-medium: 560;
  --ashton-weight-semibold: 650;
  --ashton-weight-bold: 700;
  --ashton-control-height: 2.5rem;
  --ashton-control-radius: .65rem;
  --ashton-radius-sm: .65rem;
  --ashton-radius-md: .85rem;
  --ashton-radius-lg: 1rem;
  --ashton-page-max: 82rem;
  --ashton-shadow-card: 0 1px 0 rgba(255, 255, 255, .025) inset, 0 18px 40px rgba(0, 0, 0, .14);
  --ashton-shadow-float: 0 24px 72px rgba(0, 0, 0, .42);
}

html {
  max-width: 100%;
  overflow-x: hidden;
  background: var(--ashton-bg);
}

body {
  max-width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% -12%, rgba(101, 115, 230, .08), transparent 30rem),
    var(--ashton-bg);
  color: var(--ashton-copy);
  font-family: var(--ashton-font);
  font-size: var(--ashton-type-body);
  font-weight: var(--ashton-weight-regular);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(101, 115, 230, .38); color: #fff; }
* { scrollbar-color: #353a4c transparent; }
*, *::before, *::after { box-sizing: border-box; }
img, svg, video, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, a, summary, input, select, textarea { -webkit-tap-highlight-color: transparent; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid #aab3ff;
  outline-offset: 2px;
}

a { color: var(--ashton-link); text-underline-offset: .18em; }
a:hover { color: #ced2ff; }

/* Brand lockup */
.brand-lockup { display: inline-flex; align-items: center; gap: .68rem; min-width: 0; }
.brand-details { display: inline-flex; align-items: baseline; min-width: 0; line-height: 1; }
.brand-wordmark,
.brand-product {
  font-family: var(--ashton-font);
  font-size: .88rem;
  font-weight: 760;
  letter-spacing: .075em;
  line-height: 1;
  text-transform: none;
}
.brand-wordmark { color: #fff; }
.brand-product { margin: 0; color: #9da7ff; letter-spacing: -.015em; }
.brand-mark {
  flex: 0 0 auto;
  border: 1px solid rgba(132, 145, 255, .28);
  border-radius: .72rem;
  box-shadow: 0 0 0 3px rgba(101, 115, 230, .06), 0 .55rem 1.4rem rgba(0, 0, 0, .2);
}

/* Authentication: a self-contained command deck, distinct from the public sites. */
.auth-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100svh;
  width: 100%;
  place-items: center;
  overflow: hidden;
  padding: clamp(1rem, 3vw, 2rem);
  background:
    linear-gradient(rgba(128, 139, 190, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 139, 190, .035) 1px, transparent 1px),
    #08090f;
  background-size: 44px 44px, 44px 44px, auto;
}
.auth-screen::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at 14% 8%, rgba(101, 115, 230, .2), transparent 28rem);
  content: "";
}
.auth-glow { position: absolute; z-index: -1; border-radius: 999px; filter: blur(1px); opacity: .75; pointer-events: none; }
.auth-glow-one { top: 11%; right: 6%; width: 18rem; height: 18rem; border: 1px solid rgba(101, 115, 230, .16); box-shadow: 0 0 0 4rem rgba(101, 115, 230, .018), 0 0 0 8rem rgba(101, 115, 230, .012); }
.auth-glow-two { right: 28%; bottom: -5rem; width: 12rem; height: 12rem; background: rgba(255, 179, 62, .045); filter: blur(55px); }
.auth-stage {
  width: min(100%, 68rem);
  overflow: hidden;
  border: 1px solid rgba(174, 183, 214, .17);
  border-radius: 1.35rem;
  background: rgba(13, 15, 23, .94);
  box-shadow: var(--ashton-shadow-float), 0 1px 0 rgba(255, 255, 255, .035) inset;
  backdrop-filter: blur(22px);
}
.auth-stage-header,
.auth-stage-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.auth-stage-header { min-height: 4.75rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--ashton-border-soft); }
.auth-stage-brand { color: inherit; text-decoration: none; }
.auth-stage-brand:hover { color: inherit; }
.auth-private-status {
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  min-height: 2rem;
  padding: .38rem .68rem;
  border: 1px solid var(--ashton-border-soft);
  border-radius: 999px;
  color: var(--ashton-muted);
  font-size: .72rem;
  font-weight: 600;
}
.auth-private-status i { width: .42rem; height: .42rem; border-radius: 999px; background: var(--ashton-success); box-shadow: 0 0 0 4px rgba(67, 210, 174, .08); }
.auth-stage-body { display: grid; grid-template-columns: minmax(20rem, .86fr) minmax(0, 1.14fr); min-height: 30rem; }
.auth-card {
  width: auto;
  max-width: none;
  align-self: center;
  margin: clamp(1.35rem, 4vw, 3.2rem);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.auth-card-kicker,
.auth-signal-kicker {
  color: var(--ashton-brand-warm);
  font-size: .69rem;
  font-weight: 760;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-card h1 { margin-top: .75rem; color: #fff; font-size: clamp(1.72rem, 3vw, 2.2rem); font-weight: var(--ashton-weight-bold); letter-spacing: -.035em; line-height: 1.1; }
.auth-card-copy { max-width: 28rem; margin: .72rem 0 1.65rem; color: var(--ashton-muted); line-height: 1.55; }
.auth-alert { margin: -.55rem 0 1rem; padding: .72rem .78rem; border: 1px solid rgba(255, 113, 136, .35); border-radius: .68rem; background: rgba(255, 113, 136, .08); color: #ffc1cb; font-size: .78rem; line-height: 1.45; }
.auth-alert.hidden { display: none; }
.auth-password-label { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; }
.auth-password-label a { color: var(--ashton-link); font-size: .75rem; font-weight: 600; }
.auth-submit { display: flex; justify-content: space-between !important; padding-inline: 1rem; }
.auth-submit span:last-child { font-size: 1.05rem; transition: transform .16s ease; }
.auth-submit:hover span:last-child { transform: translateX(.18rem); }
.auth-card-footnote { display: flex; align-items: center; justify-content: center; gap: .42rem; margin-top: 1rem; color: var(--ashton-dim); font-size: .7rem; }
.auth-card-footnote span { color: var(--ashton-success); font-size: .48rem; }
.auth-signal-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
  overflow: hidden;
  border-left: 1px solid var(--ashton-border-soft);
  background:
    radial-gradient(circle at 85% 0%, rgba(101, 115, 230, .18), transparent 18rem),
    linear-gradient(145deg, rgba(101, 115, 230, .09), rgba(255, 179, 62, .025) 58%, transparent);
}
.auth-signal-panel::after {
  position: absolute;
  right: -7rem;
  bottom: -8rem;
  z-index: -1;
  width: 23rem;
  height: 23rem;
  border: 1px solid rgba(157, 167, 255, .1);
  border-radius: 999px;
  box-shadow: 0 0 0 3.5rem rgba(157, 167, 255, .025), 0 0 0 7rem rgba(157, 167, 255, .015);
  content: "";
}
.auth-signal-panel h2 { max-width: 31rem; margin-top: .85rem; color: #f7f7fb; font-size: clamp(1.75rem, 3.2vw, 2.75rem); font-weight: 680; letter-spacing: -.045em; line-height: 1.08; }
.auth-signal-panel > p { max-width: 30rem; margin-top: .9rem; color: var(--ashton-muted); line-height: 1.55; }
.auth-signal-path { position: relative; display: grid; gap: .72rem; margin-top: 1.7rem; padding: 0; list-style: none; }
.auth-signal-path::before { position: absolute; top: 1.15rem; bottom: 1.15rem; left: 1.06rem; width: 1px; background: linear-gradient(var(--ashton-primary), rgba(255, 179, 62, .5)); content: ""; }
.auth-signal-path li { position: relative; display: grid; grid-template-columns: 2.15rem minmax(0, 1fr); align-items: center; gap: .78rem; min-width: 0; }
.auth-signal-path li > span { z-index: 1; display: grid; width: 2.15rem; height: 2.15rem; place-items: center; border: 1px solid rgba(137, 148, 248, .34); border-radius: .65rem; background: #121520; color: #bec5ff; font-size: .65rem; font-weight: 760; }
.auth-signal-path b,
.auth-signal-path small { display: block; }
.auth-signal-path b { color: #f3f4f9; font-size: .82rem; font-weight: 650; }
.auth-signal-path small { margin-top: .08rem; color: var(--ashton-dim); font-size: .72rem; line-height: 1.35; }
.auth-signal-note { display: flex; align-items: center; gap: .7rem; margin-top: 1.6rem; padding: .75rem .82rem; border: 1px solid rgba(67, 210, 174, .18); border-radius: .8rem; background: rgba(67, 210, 174, .055); }
.auth-signal-pulse { width: .58rem; height: .58rem; flex: 0 0 auto; border-radius: 999px; background: var(--ashton-success); box-shadow: 0 0 0 5px rgba(67, 210, 174, .08); }
.auth-signal-note b,
.auth-signal-note small { display: block; }
.auth-signal-note b { color: #e8fff8; font-size: .76rem; }
.auth-signal-note small { margin-top: .12rem; color: #8fb8ac; font-size: .69rem; }
.auth-stage-footer { min-height: 3.2rem; padding: .7rem 1.25rem; border-top: 1px solid var(--ashton-border-soft); color: var(--ashton-dim); font-size: .68rem; }
.auth-stage-footer span:first-child { color: #b4b9c7; font-weight: 650; }

/* Existing one-step auth/setup screens use the same shell language. */
.auth-screen:not(.auth-login-screen) .auth-card {
  width: min(100%, 30rem);
  margin: 0;
  padding: clamp(1.35rem, 3vw, 2rem);
  border: 1px solid var(--ashton-border);
  border-radius: var(--ashton-radius-lg);
  background: rgba(17, 19, 28, .97);
  box-shadow: var(--ashton-shadow-float);
}
.auth-screen:not(.auth-login-screen) .auth-brand { margin-bottom: 1rem; }
.auth-overline { color: #9da7ff; }
.connection-note { border-color: rgba(101, 115, 230, .3); background: var(--ashton-primary-soft); color: #dfe2ff; }

/* Shell and navigation */
.app-shell { grid-template-columns: 14.5rem minmax(0, 1fr); min-height: 100svh; background: var(--ashton-bg); }
.app-workspace,
#content-region { min-width: 0; max-width: 100%; background: transparent; }
.app-workspace { position: relative; isolation: isolate; }
.app-workspace::before { position: fixed; top: -12rem; right: 7%; z-index: -1; width: 34rem; height: 25rem; border-radius: 999px; background: rgba(101, 115, 230, .055); filter: blur(70px); pointer-events: none; content: ""; }
.sidebar {
  border-color: var(--ashton-border-soft);
  background: rgba(11, 12, 18, .97);
  box-shadow: 1px 0 0 rgba(255, 255, 255, .018);
  backdrop-filter: blur(20px);
}
.sidebar-brand-row { margin-bottom: .65rem; }
#side-nav .brand-home { min-height: 3.5rem; padding: .55rem .62rem; border-radius: .78rem; }
#side-nav .brand-home:hover { background: rgba(255, 255, 255, .035); }
#side-nav .brand-mark { width: 2.35rem; height: 2.35rem; border-radius: .78rem; }
.nav-workflow { gap: .72rem; }
.nav-group { gap: .16rem; }
.nav-group-label { padding: .38rem .72rem .28rem; color: #8c91a1; font-size: .64rem; letter-spacing: .12em; }
.nav-link,
.nav-advanced summary,
.sidebar-collapse {
  min-height: 2.65rem;
  border: 1px solid transparent;
  border-radius: .68rem;
  color: #979ba9;
  font-size: .84rem;
  font-weight: 560;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.nav-link svg,
.nav-advanced summary svg,
.sidebar-collapse svg { color: #777c8c; }
.nav-link:hover,
.nav-advanced summary:hover,
.sidebar-collapse:hover { border-color: rgba(174, 183, 214, .08); background: rgba(255, 255, 255, .035); color: #f5f6fa; }
.nav-link.active { border-color: rgba(101, 115, 230, .2); background: rgba(101, 115, 230, .13); color: #fff; }
.nav-link.active::before { top: .55rem; bottom: .55rem; left: -.05rem; width: 3px; background: #8290ff; box-shadow: 0 0 12px rgba(101, 115, 230, .45); }
.nav-link.active svg { color: #b8bfff; }
.nav-advanced { border-radius: .75rem; }
.nav-advanced[open] { background: rgba(255, 255, 255, .018); }
.nav-advanced-links { padding-bottom: .3rem; }
.sidebar-footer { border-top-color: var(--ashton-border-soft); }
.sidebar-footer #logout { color: #bd7d88; }
.sidebar-footer #logout:hover { color: #ffd0d7; }
.mobile-topbar { border-color: var(--ashton-border-soft); background: rgba(11, 12, 18, .96); backdrop-filter: blur(20px); }
.mobile-topbar .brand-wordmark,
.mobile-topbar .brand-product { font-size: .76rem; }

.safety-strip {
  min-height: 2.35rem;
  border-color: var(--ashton-border-soft);
  background: rgba(12, 14, 21, .92);
  color: #9da1af;
  backdrop-filter: blur(18px);
}
.safety-strip::before { background: #747a8b; }
.safety-live { background: rgba(8, 28, 24, .86); color: #bfe9dd; }
.safety-live::before { background: var(--ashton-success); box-shadow: 0 0 0 4px rgba(67, 210, 174, .08); }
.safety-dry-run { background: rgba(26, 24, 44, .88); color: #d5d8ff; }
.safety-dry-run::before { background: #8995ff; }

.app-main { width: min(100%, var(--ashton-page-max)); max-width: 100%; padding: clamp(1.25rem, 2.2vw, 1.9rem) clamp(1rem, 2.6vw, 2.25rem) 3.25rem; }
.page-header { align-items: center; margin-bottom: 1.05rem; }
.page-header-copy h1,
#view h1 { color: #f8f8fb; font-size: var(--ashton-type-heading-1); font-weight: var(--ashton-weight-bold); letter-spacing: -.035em; }
.page-header-copy p { max-width: 44rem; margin-top: .28rem; color: var(--ashton-muted); font-size: .82rem; line-height: 1.45; }
.page-header-actions { gap: .55rem; }

/* Controls */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
  min-height: var(--ashton-control-height);
  padding: .56rem .88rem;
  border: 1px solid transparent;
  border-radius: var(--ashton-control-radius);
  font-size: var(--ashton-type-control);
  font-weight: 650;
  line-height: 1.2;
  box-shadow: none;
  transition: transform .12s ease, background-color .14s ease, border-color .14s ease, color .14s ease, opacity .14s ease;
}
.btn-primary { border-color: rgba(157, 167, 255, .2); background: var(--ashton-primary); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 .45rem 1.15rem rgba(65, 76, 190, .17); }
.btn-primary:hover { background: var(--ashton-primary-hover); color: #fff; }
.btn-primary:active:not(:disabled),
.btn-secondary:active:not(:disabled),
.btn-ghost:active:not(:disabled) { transform: translateY(1px); }
.btn-secondary,
.btn-ghost { border-color: var(--ashton-border-soft); background: #181b25; color: #e8e9ef; }
.btn-secondary:hover,
.btn-ghost:hover { border-color: #3a3f50; background: #202430; color: #fff; }
.btn-danger { border-color: rgba(255, 113, 136, .24); background: rgba(255, 113, 136, .11); color: #ffb4c0; }
.btn-danger:hover { background: rgba(255, 113, 136, .18); color: #ffd2d9; }
button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled { cursor: not-allowed; opacity: .5; }

.label { display: block; margin-bottom: .38rem; color: #b5b8c4; font-size: var(--ashton-type-label); font-weight: 620; letter-spacing: .012em; }
.input {
  min-height: var(--ashton-control-height);
  border: 1px solid #303442;
  border-radius: var(--ashton-control-radius);
  background: #0d0f17;
  color: #f4f5f8;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .018) inset;
}
.input:hover:not(:focus) { border-color: #414657; }
.input:focus { border-color: #8490ff; box-shadow: 0 0 0 3px rgba(101, 115, 230, .17); }
.input::placeholder { color: #7d8291; }
select.input { color-scheme: dark; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ashton-primary); }

/* Surfaces and data */
.card,
.stat,
.table-wrap,
.campaign-sheet,
.conversation-workspace,
.health-disclosure {
  border-color: var(--ashton-border-soft);
  border-radius: var(--ashton-radius-lg);
  background: rgba(17, 19, 28, .92);
  box-shadow: var(--ashton-shadow-card);
}
.card,
.stat { padding: 1.05rem; }
.stat { min-width: 0; }
.stat-num { color: #fff; font-size: clamp(1.45rem, 2vw, 1.85rem); letter-spacing: -.035em; }
.stat-label,
.eyebrow { color: #8a8f9f; font-size: .67rem; letter-spacing: .105em; }
.table-wrap { max-width: 100%; overflow: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th { border-bottom: 1px solid var(--ashton-border-soft); background: #0e1018; color: #848999; }
.table-wrap td { border-bottom-color: rgba(174, 183, 214, .08); color: #dfe1e8; }
.table-wrap tbody tr:hover { background: rgba(101, 115, 230, .035); }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-action { color: var(--ashton-link); }

.tab { position: relative; border-bottom-color: transparent; color: #8f94a3; }
.tab:hover { color: #d7d9e1; }
.tab.active,
.tab.tab-active { border-bottom-color: #8793ff; color: #fff; }
.tab.active::after,
.tab.tab-active::after { position: absolute; right: .65rem; bottom: -1px; left: .65rem; height: 2px; border-radius: 999px; background: #8793ff; box-shadow: 0 0 12px rgba(101, 115, 230, .42); content: ""; }
.badge,
.chip,
.pill-safe,
.pill-warn,
.pill-stop { border: 1px solid var(--ashton-border-soft); border-radius: 999px; background: rgba(255, 255, 255, .035); color: #c5c8d1; }
.pill-safe { border-color: rgba(67, 210, 174, .2); background: rgba(67, 210, 174, .1); color: #89e7cf; }
.pill-warn { border-color: rgba(242, 184, 95, .22); background: rgba(242, 184, 95, .1); color: #f6ce8f; }
.pill-stop { border-color: rgba(255, 113, 136, .22); background: rgba(255, 113, 136, .1); color: #ffafbb; }

details > summary { border-radius: .65rem; }
details > summary:hover { background: rgba(255, 255, 255, .025); }
.calm-details > summary { color: #eceef3; }
.calm-details-body { border-top: 1px solid var(--ashton-border-soft); padding-top: 1rem; }
.flow-step,
.overview-secondary-grid > section,
.team-access-summary > div { border-color: var(--ashton-border-soft); background: var(--ashton-elevated); }

/* Campaign workflow: one calm, scan-friendly operating surface. */
.campaign-service-hub,
.campaign-preparation-summary,
.campaign-ai-coach,
.cadence-editor-card,
.campaign-audience-presets,
.campaign-csv-preview,
.campaign-start-time { border-color: var(--ashton-border-soft); background: #141720; }
.campaign-service-hub > summary:hover { background: rgba(101, 115, 230, .035); }
.campaign-service-hub-open,
.campaign-workflow-edit,
.ai-step-link { color: var(--ashton-link); }
.campaign-action-center { border-color: rgba(101, 115, 230, .2); background: linear-gradient(110deg, rgba(101, 115, 230, .105), rgba(17, 19, 28, .92) 52%); }
.campaign-action-center > div:first-child > span { color: #aab3ff; }
.campaign-action-steps b { border-color: #43485a; background: #11131c; }
.campaign-action-steps li.is-current b { border-color: #8793ff; background: var(--ashton-primary); }
.campaign-action-steps li.is-done b { border-color: rgba(67, 210, 174, .45); background: rgba(67, 210, 174, .1); color: #8ae9d0; }
.campaign-card { border-color: var(--ashton-border-soft); }
.campaign-sheet { overflow: clip; }
.campaign-sheet-heading { border-color: var(--ashton-border-soft); background: #10121a; }
.campaign-sheet-heading > div:first-child > span { color: #aab3ff; }
.campaign-sheet-intro { margin-block: .7rem .55rem; padding: .35rem .1rem; border: 0; background: transparent; }
.campaign-sheet-steps { border-color: var(--ashton-border-soft); background: #0d0f16; }
.campaign-sheet .campaign-workflow-step,
.campaign-sheet .campaign-workflow-step[open] { border-color: var(--ashton-border-soft); background: transparent; }
.campaign-sheet .campaign-workflow-step > summary:hover { background: rgba(255, 255, 255, .025); }
.campaign-sheet .campaign-workflow-step[open] > summary { background: rgba(101, 115, 230, .055); }
.campaign-workflow-number { border-color: #6976e4; color: #c9ceff; }
.campaign-workflow-step[open] .campaign-workflow-number { background: var(--ashton-primary); color: #fff; }
.campaign-sheet .campaign-workflow-step[data-state="ready"] .campaign-workflow-number { border-color: rgba(67, 210, 174, .45); background: rgba(67, 210, 174, .1); color: #8ae9d0; }
.campaign-sheet .campaign-workflow-step[data-state="attention"] .campaign-workflow-number { border-color: rgba(242, 184, 95, .45); color: #f4c984; }
.campaign-sheet .campaign-workflow-body { background: rgba(255, 255, 255, .012); }
.campaign-sheet .campaign-workflow-body .stat,
.campaign-sheet .campaign-guide-more,
.campaign-toggle,
.campaign-insurance,
.campaign-audience-preset,
.cadence-delay-control,
.cadence-delay-fixed,
.coach-evidence-grid > div,
.coach-message,
.coach-locked-note,
.campaign-reporting-note { border-color: var(--ashton-border-soft); background: #171a24; }
.campaign-goal,
.campaign-choice,
.campaign-audience-preset { border-color: var(--ashton-border-soft); background: #141720; }
.campaign-goal:hover,
.campaign-choice:hover,
.campaign-audience-preset:hover { border-color: rgba(135, 147, 255, .4); background: #191c28; }
.campaign-goal.is-selected,
.campaign-choice.is-selected,
.campaign-audience-preset.is-selected,
.cadence-touch-tab.is-active { border-color: rgba(135, 147, 255, .55); background: var(--ashton-primary-soft); box-shadow: none; }
.campaign-recommendation-empty,
.campaign-recommendation-result { border-color: rgba(101, 115, 230, .28); background: rgba(101, 115, 230, .07); }
.campaign-recommendation-stats div { background: rgba(9, 10, 16, .58); }
.campaign-guide-actions { border-color: var(--ashton-border-soft); background: #10121a; }
.campaign-saved-touch { border-color: var(--ashton-border-soft); background: #131620; }
.campaign-saved-touch > summary:hover { background: rgba(101, 115, 230, .035); }
.campaign-sheet-launchbar { border-color: var(--ashton-border-soft); background: rgba(11, 12, 18, .94); box-shadow: 0 -1rem 2rem rgba(0, 0, 0, .18); backdrop-filter: blur(18px); }
.sender-pool-actions { border-color: var(--ashton-border-soft); background: rgba(17, 19, 28, .95); backdrop-filter: blur(18px); }
.sender-pool-scroll thead,
.audit-feed-scroll thead { background: #0e1018; }

.ai-composer-shell { border-color: var(--ashton-border-soft); background: #0d0f17; }
.ai-composer-shell:focus-within { border-color: #8490ff; box-shadow: 0 0 0 3px rgba(101, 115, 230, .16); }
.ai-context-item,
.ai-context-review { border-color: var(--ashton-border-soft); background: #141720; }
.ai-example { border-color: var(--ashton-border-soft); background: #171a24; color: #cbd0ff; }
.ai-example:hover { border-color: rgba(135, 147, 255, .4); background: #1d202c; }

/* Inbox and messages */
.inbox-summary-strip { border-color: var(--ashton-border-soft); background: rgba(17, 19, 28, .92); }
.inbox-summary-strip > div { border-color: var(--ashton-border-soft); }
.conversation-list-panel,
.conversation-detail-panel,
.conversation-list-head,
.thread-pane-head { border-color: var(--ashton-border-soft); background: #11131c; }
.conversation-row { border-bottom-color: rgba(174, 183, 214, .08); }
.conversation-row:hover { background: rgba(255, 255, 255, .025); }
.conversation-row.is-selected { border-left-color: #8793ff; background: rgba(101, 115, 230, .095); }
.conversation-subject,
.thread-message-label { color: #d8dcff; }
.conversation-status { color: #b1b8ff; }
.conversation-status.is-inbound { color: #75dfc4; }
.thread-context-card,
.thread-record,
.thread-compose { border-color: var(--ashton-border-soft); background: #151821; }
.thread-message { border-color: var(--ashton-border-soft); background: #151821; }
.thread-message.is-inbound { border-color: rgba(67, 210, 174, .25); background: rgba(67, 210, 174, .055); }
.thread-message.is-outbound { border-color: rgba(101, 115, 230, .28); background: rgba(101, 115, 230, .06); }
.thread-message.is-campaign { background: #171a24; }
.thread-message.is-inbound .thread-message-label { color: #7ce2c8; }
.thread-message.is-outbound .thread-message-label,
.thread-turning-point { color: #b8beff; }
.thread-turning-point::before,
.thread-turning-point::after { background: rgba(101, 115, 230, .35); }

/* Notifications stay quiet and scannable; full operational detail lives in one place. */
.notification-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding: .9rem 1rem;
  border: 1px solid rgba(242, 184, 95, .25);
  border-radius: .85rem;
  background: rgba(242, 184, 95, .055);
  color: #f4c984;
}
.notification-shortcut:hover { border-color: rgba(242, 184, 95, .42); background: rgba(242, 184, 95, .08); }
.notification-shortcut span:first-child { display: grid; gap: .12rem; min-width: 0; }
.notification-shortcut b { color: #f5dfb9; }
.notification-shortcut small { color: var(--ashton-muted); }
.notification-list { display: grid; gap: .75rem; }
.notification-card {
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--ashton-border-soft);
  border-left-width: 3px;
  border-radius: .85rem;
  background: var(--ashton-surface);
}
.notification-card.notification-critical { border-left-color: #ff7188; }
.notification-card.notification-warning { border-left-color: #f2b85f; }
.notification-card.notification-info { border-left-color: #8793ff; }
.notification-card-head,
.notification-actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.notification-severity { color: var(--ashton-muted); font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.notification-time { color: var(--ashton-muted); font-size: .76rem; }
.notification-card h2 { margin-top: .45rem; color: var(--ashton-copy); font-size: 1rem; font-weight: 650; }
.notification-card p { margin-top: .35rem; color: var(--ashton-muted); font-size: .875rem; line-height: 1.55; overflow-wrap: anywhere; }
.notification-actions { justify-content: flex-start; margin-top: .85rem; }
.notification-empty { display: flex; align-items: center; gap: .9rem; padding: 1.2rem; border: 1px solid var(--ashton-border-soft); border-radius: .85rem; background: var(--ashton-surface); }
.notification-empty h2 { color: var(--ashton-copy); font-size: 1rem; font-weight: 650; }
.notification-empty p,
.notification-footnote { color: var(--ashton-muted); font-size: .82rem; }
.notification-footnote { margin-top: .8rem; }
.notification-clear-mark { display: grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 auto; border-radius: 999px; background: rgba(67, 210, 174, .1); color: #75dfc4; }

/* Honest feedback, errors, and overlays. */
.campaign-source-error,
.campaign-exact-error { border-color: rgba(255, 113, 136, .35); background: rgba(255, 113, 136, .075); color: #ffc3cc; }
.campaign-service-error,
.campaign-readiness-issues { border-color: rgba(242, 184, 95, .3); background: rgba(242, 184, 95, .07); }
#toasts > * { border: 1px solid var(--ashton-border-soft); border-radius: .78rem; box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .36); }
.fixed.inset-0.bg-black\/60,
.drawer-bg { background: rgba(4, 5, 9, .72); backdrop-filter: blur(7px); }
[role="dialog"].card { border-color: #353a4a; background: #12141d; box-shadow: var(--ashton-shadow-float); }
.fixed.inset-0.z-40 > [role="dialog"] { border-color: #353a4a; background: #11131c; box-shadow: var(--ashton-shadow-float); }
.fixed.inset-0.z-40 > [role="dialog"] > .sticky { border-bottom: 1px solid var(--ashton-border-soft); background: rgba(17, 19, 28, .95); backdrop-filter: blur(16px); }
/* These widths are supplied dynamically by the dialog helper and therefore are
   not present in the small precompiled utility bundle. */
.card.max-w-sm { max-width: 34rem; }
.card.max-w-md { max-width: 28rem; }
.card.max-w-lg { max-width: 34rem; }
.card.max-w-xl { max-width: 40rem; }
.card.max-w-2xl { max-width: 42rem; }
.card.max-w-4xl { max-width: 56rem; }
.fixed.inset-0 > [role="dialog"].card { max-height: min(85svh, 52rem); overflow-y: auto; }

/* Responsive containment: only data tables scroll horizontally. */
#view,
.page-header,
.page-header-copy,
.page-header-actions,
.card,
.stat,
.campaign-sheet,
.campaign-workflow-step,
.campaign-workflow-body,
.conversation-workspace { min-width: 0; max-width: 100%; }
.page-header-actions,
.campaign-sheet-toolbar-actions,
.campaign-action-buttons { flex-wrap: wrap; }
.campaign-filter-detail span,
.campaign-exact-error dd,
.coach-message,
.thread-record,
.campaign-sent-email { overflow-wrap: anywhere; }

@media (min-width: 768px) {
  .app-shell { align-items: stretch; }
  .app-shell.sidebar-collapsed { grid-template-columns: 4.65rem minmax(0, 1fr); }
  .app-workspace { grid-column: 2; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 14.5rem;
    height: 100svh;
    overflow: hidden;
    transition: width .18s ease, padding .18s ease;
  }
  .app-shell.sidebar-collapsed .sidebar { width: 4.65rem; }
  .sidebar-brand-row,
  .sidebar-footer { flex: 0 0 auto; }
  .sidebar .nav-workflow {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(174, 183, 214, .2) transparent;
  }
}

@media (max-width: 900px) {
  .auth-stage-body { grid-template-columns: 1fr; }
  .auth-signal-panel { border-top: 1px solid var(--ashton-border-soft); border-left: 0; }
  .auth-signal-path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-signal-path::before { display: none; }
}

@media (max-height: 760px) and (min-width: 901px) {
  .auth-screen { padding: .75rem; }
  .auth-stage-header { min-height: 4rem; padding-block: .7rem; }
  .auth-stage-footer { min-height: 2.55rem; padding-block: .5rem; }
  .auth-card { margin-block: 1.6rem; }
  .auth-card-copy { margin-bottom: 1.15rem; }
  .auth-signal-panel { padding: 1.7rem 3.2rem; }
  .auth-signal-panel h2 { margin-top: .6rem; font-size: 2.15rem; }
  .auth-signal-panel > p { margin-top: .6rem; }
  .auth-signal-path { gap: .38rem; margin-top: 1rem; }
  .auth-signal-path li > span { width: 1.9rem; height: 1.9rem; }
  .auth-signal-path::before { top: 1rem; bottom: 1rem; left: .94rem; }
  .auth-signal-note { margin-top: .85rem; padding-block: .6rem; }
}

@media (max-width: 767px) {
  .app-main { padding: 1.15rem 1rem 2.5rem; }
  .sidebar { background: rgba(11, 12, 18, .99); }
  .sidebar:not(.is-open) { display: none; }
  .sidebar.is-open { display: flex; }
  .mobile-topbar { min-height: 3.75rem; padding-inline: .85rem; }
  .page-header { align-items: stretch; }
  .page-header-actions > * { min-width: 0; }
  .campaign-sheet .campaign-workflow-body { padding-left: 1rem; }
  .campaign-sheet-launchbar { align-items: stretch; flex-direction: column; }
  .campaign-sheet-launchbar .btn-primary,
  .campaign-sheet-launchbar .btn-danger { width: 100%; min-width: 0; }
}

@media (max-width: 600px) {
  .auth-screen { display: block; padding: .75rem; overflow-y: auto; }
  .auth-stage { min-height: calc(100svh - 1.5rem); border-radius: 1rem; }
  .auth-stage-header { min-height: 4rem; padding: .8rem .9rem; }
  .auth-private-status { padding-inline: .55rem; font-size: .66rem; }
  .auth-card { margin: 1.7rem 1.1rem 2rem; }
  .auth-card h1 { font-size: 1.72rem; }
  .auth-signal-panel { padding: 1.6rem 1.1rem; }
  .auth-signal-panel h2 { font-size: 1.55rem; }
  .auth-signal-path { grid-template-columns: 1fr; }
  .auth-stage-footer { align-items: flex-start; flex-direction: column; gap: .15rem; padding: .8rem .9rem; }
  .page-header-actions { display: grid; grid-template-columns: 1fr; }
  .page-header-actions > * { width: 100%; }
  .page-header-actions > .sr-only { width: 1px; max-width: 1px; }
  .campaign-sheet-toolbar { align-items: stretch; flex-direction: column; }
  .campaign-sheet-toolbar-actions { justify-content: stretch; }
  .campaign-sheet-toolbar-actions > * { flex: 1; }
  .campaign-action-center { align-items: stretch; flex-direction: column; }
  .campaign-action-buttons { display: grid; grid-template-columns: 1fr; width: 100%; }
  .campaign-action-buttons > * { width: 100%; justify-content: center; }
  .fixed.inset-0 > [role="dialog"].card { width: 100%; max-height: calc(100svh - 1.5rem); }
}

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

/* ASHTON.Email PWA install control */
.pwa-install {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ashton-border-soft);
  text-align: center;
}
.pwa-install-eyebrow {
  display: block;
  margin-bottom: .5rem;
  color: var(--ashton-dim);
  font-size: .64rem;
  font-weight: 760;
  letter-spacing: .1em;
}
.pwa-install-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .52rem;
  min-height: 2.6rem;
  padding: .65rem .9rem;
  border: 1px solid rgba(157, 167, 255, .5);
  border-radius: .72rem;
  background: rgba(157, 167, 255, .1);
  color: #e7eaff;
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.pwa-install-button:hover,
.pwa-install-button:focus-visible {
  border-color: var(--ashton-primary);
  background: rgba(157, 167, 255, .18);
  outline: none;
  transform: translateY(-1px);
}
.pwa-install-button:focus-visible { box-shadow: 0 0 0 3px rgba(157, 167, 255, .24); }
.pwa-install-button:disabled { cursor: wait; opacity: .72; transform: none; }
.pwa-install-icon { font-size: 1.05rem; line-height: 1; }
.pwa-install-note { margin: .48rem auto 0; color: var(--ashton-dim); font-size: .72rem; line-height: 1.45; }
.pwa-installed .pwa-install-note { color: var(--ashton-success); }
