/* Customer SaaS only. Load last; /welcome and the operator never opt in.
   Match the landing identity without changing its logo, font assets or layout. */
html.or-workspace-dark {
  font-family: "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  --canvas: #111113;
  --panel: #18181b;
  --surface: #18181b;
  --ink: #f4f4f1;
  --muted: #a1a1aa;
  --border: #2a2a2e;
  --brand: #f97316;
  --brand-hover: #fb8f47;
  --raised: #202024;
  --hover: #252529;
  --field: #111113;
  --control-border: #71717a;
  --focus: #fdba74;
  --accent: #e4e4e7;
  --accent-hover: #ffffff;
  --accent-soft: #242428;
  --accent-border: #414148;
  --pink: #d4d4d8;
  --pink-soft: #242428;
  --primary: #f97316;
  --primary-hover: #fb8f47;
  --navy: #111113;
  --on-dark: #d4d4d8;
  --dark-muted: #a1a1aa;
  --dark-border: #2a2a2e;
  --dark-accent: #e4e4e7;
  --selection: #2e231b;
  --success: #86d6a5;
  --success-bg: #15231c;
  --success-border: #3d7253;
  --warning: #f1d082;
  --warning-bg: #2a2417;
  --warning-border: #79663b;
  --danger: #f5a5ac;
  --danger-bg: #2d1c21;
  --danger-border: #86505b;
  --info: #b7cae5;
  --info-bg: #1b2330;
  --info-border: #526780;
  --radius: 12px;
  color-scheme: dark;
  background: var(--canvas);
  color: var(--ink);
}

/* Canvas, shell and quiet raised surfaces. No translucent or photographic layers. */
html.or-workspace-dark body,
html.or-workspace-dark .cs-workspace,
html.or-workspace-dark .cs-content,
html.or-workspace-dark .cs-public-header,
html.or-workspace-dark .cs-topbar,
html.or-workspace-dark .cs-footer {
  background: var(--canvas);
  color: var(--ink);
}
html.or-workspace-dark body { min-height: 100vh; min-height: 100dvh; }
html.or-workspace-dark .cs-sidebar { border-right: 1px solid var(--border); }
html.or-workspace-dark .cs-sidebar .cs-wordmark,
html.or-workspace-dark .cs-sidebar .cs-wordmark:hover,
html.or-workspace-dark .cs-workspace-label,
html.or-workspace-dark .cs-topbar-brand,
html.or-workspace-dark .cs-wordmark,
html.or-workspace-dark .cs-footer-orbit { color: var(--ink); }
html.or-workspace-dark .cs-wordmark small,
html.or-workspace-dark .cs-footer { color: var(--muted); }
html.or-workspace-dark .cs-nav a:hover { background: var(--raised); color: var(--ink); }
html.or-workspace-dark .cs-nav a.is-active { background: var(--selection); color: var(--ink); }
html.or-workspace-dark .cs-nav a.is-active::before { content: none; }
html.or-workspace-dark .cs-nav a.is-active svg { color: var(--brand); }
html.or-workspace-dark .cs-user-avatar { background: var(--raised); color: var(--ink); }
html.or-workspace-dark .cs-security-dot { background: var(--muted); }
html.or-workspace-dark .cs-mobile-menu > div {
  background: var(--panel);
  box-shadow: 0 12px 30px #00000040;
}
html.or-workspace-dark :is(.card, .stat-card, .panel, .acquisition-result) {
  background: var(--panel);
  border-color: var(--border);
  box-shadow: none;
}
html.or-workspace-dark .cs-content .eyebrow { color: var(--muted); letter-spacing: .035em; }
html.or-workspace-dark .cs-content .eyebrow::before { content: none; }
html.or-workspace-dark .cs-content .page-header { text-align: left; }
html.or-workspace-dark .cs-content h1 {
  font-size: clamp(1.6rem, 2.3vw, 2rem);
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -.04em;
  text-align: left;
}

/* Links remain neutral. Only explicit primary actions carry the brand fill. */
html.or-workspace-dark a[href] {
  display: inline-flex;
  align-items: center;
  min-height: 44px !important;
  min-width: 44px;
  color: var(--accent);
  text-underline-offset: .22em;
}
html.or-workspace-dark a[href]:hover { color: var(--ink); }
html.or-workspace-dark :is(button, .button, summary, [role="button"]) {
  min-height: 44px !important;
  min-width: 44px;
  touch-action: manipulation;
}
html.or-workspace-dark :is(button, .button) {
  background: var(--raised);
  border-color: var(--control-border);
  color: var(--ink);
  box-shadow: none;
}
html.or-workspace-dark :is(button, .button):hover {
  background: var(--hover);
  border-color: var(--muted);
  color: var(--ink);
}
html.or-workspace-dark .button.primary,
html.or-workspace-dark .cs-authenticated .journey-focus .button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--canvas);
}
html.or-workspace-dark .button.primary:hover,
html.or-workspace-dark .cs-authenticated .journey-focus .button.primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--canvas);
}
html.or-workspace-dark :is(.button.secondary, button.secondary) {
  background: var(--panel);
  border-color: var(--control-border);
  color: var(--ink);
}
html.or-workspace-dark :is(.button.secondary, button.secondary):hover {
  background: var(--hover);
  border-color: var(--muted);
  color: var(--ink);
}
html.or-workspace-dark :is(.button.ghost, button.ghost, .cs-logout) {
  background: transparent;
  border-color: var(--border);
  color: var(--on-dark);
}
html.or-workspace-dark :is(.button.ghost, button.ghost, .cs-logout):hover {
  background: var(--raised);
  border-color: var(--control-border);
  color: var(--ink);
}
html.or-workspace-dark .pagination :is(a, span) { min-width: 44px; min-height: 44px; }
html.or-workspace-dark .pagination [aria-current="page"] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--canvas);
  font-weight: 700;
}

/* Explicit field borders identify controls even without a light panel. */
html.or-workspace-dark :is(input, select, textarea) {
  background: var(--field);
  border-color: var(--control-border);
  color: var(--ink);
  caret-color: var(--ink);
}
html.or-workspace-dark :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select) {
  min-height: 44px;
}
html.or-workspace-dark :is(input, textarea)::placeholder { color: var(--muted); opacity: 1; }
html.or-workspace-dark :is(input, select, textarea):focus { border-color: var(--focus); }
html.or-workspace-dark option { background: var(--panel); color: var(--ink); }
html.or-workspace-dark :is(input[type="checkbox"], input[type="radio"]),
html.or-workspace-dark .cs-authenticated .targets-table-compact input[name="target_ids"] { accent-color: var(--brand); }
html.or-workspace-dark label:has(> :is(input[type="checkbox"], input[type="radio"])) {
  min-height: 44px;
  cursor: pointer;
}
html.or-workspace-dark input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--field) inset;
}
html.or-workspace-dark input::file-selector-button {
  min-height: 44px;
  margin-right: .75rem;
  padding: .5rem .75rem;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: var(--raised);
  color: var(--ink);
  font: inherit;
}
/* Intentional priority: older journey/sidebar rules must never hide keyboard focus. */
html.or-workspace-dark :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus) !important;
  outline-offset: 3px;
}
html.or-workspace-dark .table-wrap:focus-visible { outline-offset: -3px; }
html.or-workspace-dark .outreach-metric-link:focus-visible::after { outline-color: var(--focus); }
html.or-workspace-dark ::selection { background: var(--brand); color: var(--canvas); }

/* Preserve the existing responsive table/card switch; change paint, not display. */
html.or-workspace-dark th,
html.or-workspace-dark .account-summary-stats { background: var(--raised); color: var(--muted); }
html.or-workspace-dark td { color: var(--ink); }
html.or-workspace-dark tbody tr:hover,
html.or-workspace-dark .cs-authenticated .targets-table-compact tbody tr:hover { background: var(--raised); }
html.or-workspace-dark .cs-authenticated .targets-table tbody tr:has(input[name="target_ids"]:checked) {
  background: var(--selection);
}
html.or-workspace-dark .targets-table tbody tr:has(input[name="target_ids"]:checked) .targets-profile-link {
  text-decoration: underline;
  text-decoration-color: var(--brand);
}
html.or-workspace-dark .cs-authenticated .journey-compose-bar {
  background: var(--panel);
  border-color: var(--control-border);
  box-shadow: 0 -8px 20px #00000026;
}
html.or-workspace-dark:has(.journey-compose-bar) { scroll-padding-bottom: 9rem; }
html.or-workspace-dark .cs-authenticated .journey-steps [aria-current="step"] .journey-step-number {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--canvas);
}
html.or-workspace-dark .cs-authenticated .journey-steps .is-past .journey-step-number {
  background: var(--raised);
  border-color: var(--control-border);
  color: var(--ink);
}
html.or-workspace-dark .cs-authenticated .targets-search-page .journey-compose-bar .targets-selection-count strong { color: var(--ink); }

/* Disabled states stay legible; no opacity stacking against a dark canvas. */
html.or-workspace-dark :is(button:disabled, .button[aria-disabled="true"], input:disabled, select:disabled, textarea:disabled) {
  background: var(--accent-soft) !important;
  border-color: var(--accent-border) !important;
  color: var(--muted) !important;
  -webkit-text-fill-color: var(--muted);
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}
html.or-workspace-dark :is(.button.danger, button.danger) {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}
html.or-workspace-dark :is(.button.danger, button.danger):hover {
  background: #3a2229;
  border-color: var(--danger);
  color: var(--ink);
}

/* Preserve the rendered status words: completion, pause, rejection and cancellation
   must never be communicated through a colored dot alone. */
html.or-workspace-dark :is(.badge, .badge.neutral) {
  background: var(--raised);
  border-color: var(--accent-border);
  color: var(--on-dark);
}
html.or-workspace-dark :is(.badge.success, .notice.success) {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}
html.or-workspace-dark .notice {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}
html.or-workspace-dark :is(.badge.warning, .notice.warning) {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning);
}
html.or-workspace-dark :is(.badge.danger, .notice.danger) {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}
html.or-workspace-dark :is(.badge.info, .notice.info) {
  background: var(--info-bg);
  border-color: var(--info-border);
  color: var(--info);
}
html.or-workspace-dark .badge.info::before { background: currentColor; }
html.or-workspace-dark .notice :is(p, .hint, strong, a:not(.button)) { color: inherit; }
html.or-workspace-dark :is(.table-error, .targets-error, .overdue, .outreach-warning) { color: var(--danger); }
html.or-workspace-dark .notice a:not(.button) { text-decoration: underline; }

/* Extraction, message preview and delivery monitoring use neutral surfaces. */
html.or-workspace-dark .cs-authenticated :is(.journey-focus, .journey-inflight, .journey-status, .journey-no-link),
html.or-workspace-dark :is(.wf-accent-card, .wf-control-card) {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
}
html.or-workspace-dark .cs-authenticated .journey-focus { padding: 1.5rem; }
html.or-workspace-dark .cs-authenticated .journey-focus :is(h2, .eyebrow) { color: var(--ink); }
html.or-workspace-dark .cs-authenticated .journey-focus p:not(.eyebrow) { color: var(--muted); }
html.or-workspace-dark .cs-authenticated .journey-recipient-list > li { background: var(--panel); color: var(--ink); }
html.or-workspace-dark .cs-authenticated .journey-timeline [aria-current="step"]::before {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--canvas);
}
html.or-workspace-dark .cs-authenticated .journey-timeline .journey-timeline-done::before {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}
html.or-workspace-dark .cs-authenticated .journey-timeline .journey-timeline-stopped::before {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}
html.or-workspace-dark :is(pre, .outreach-message, .wf-confirmation, .outreach-confirmation) {
  background: var(--field);
  color: var(--ink);
  border-color: var(--border);
}
html.or-workspace-dark progress {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--brand);
  accent-color: var(--brand);
}
html.or-workspace-dark progress::-webkit-progress-bar { background: var(--accent-soft); border-radius: 99px; }
html.or-workspace-dark progress::-webkit-progress-value { background: var(--brand); border-radius: 99px; }
html.or-workspace-dark progress::-moz-progress-bar { background: var(--brand); border-radius: 99px; }

/* Auth keeps the existing split layout. --panel is a surface, never story ink. */
html.or-workspace-dark .cs-auth-layout {
  background: var(--panel);
  border-color: var(--border);
  box-shadow: none;
}
html.or-workspace-dark .cs-auth-story { background: var(--canvas); }
html.or-workspace-dark .cs-auth-story h2,
html.or-workspace-dark .cs-auth-steps strong { color: var(--ink); }
html.or-workspace-dark .cs-auth-story h2 { font-size: clamp(1.6rem, 2.1vw, 1.9rem); }
html.or-workspace-dark .cs-auth-story .cs-pill {
  background: var(--raised);
  border-color: var(--border);
  color: var(--on-dark);
}
html.or-workspace-dark .cs-auth-story .cs-pill::before { content: none; }
html.or-workspace-dark .cs-auth-card { background: var(--panel); }
html.or-workspace-dark .cs-auth-card h1 { font-size: 1.75rem; }
html.or-workspace-dark .cs-auth-card .eyebrow { color: var(--muted); letter-spacing: .04em; }
html.or-workspace-dark .cs-auth-form label { font-size: .875rem; }
html.or-workspace-dark .cs-auth-form input { font-size: 1rem; }

/* Billing templates intentionally use ordinary panel markup, not a new layout. */
html.or-workspace-dark .cs-content > header { margin-bottom: 1.5rem; }
html.or-workspace-dark .cs-content > header > p {
  margin-block: .5rem;
  color: var(--muted);
  font-size: .875rem;
}
html.or-workspace-dark .panel { padding: 1.5rem; }
html.or-workspace-dark .panel h2 { margin-bottom: .75rem; font-size: 1.125rem; }
html.or-workspace-dark .panel :is(p, li) { font-size: .875rem; line-height: 1.8; }
html.or-workspace-dark .panel p { margin-block: .75rem; color: var(--muted); }
html.or-workspace-dark .panel strong { color: var(--ink); }
html.or-workspace-dark .panel form { max-width: 46rem; }
html.or-workspace-dark .panel ul { list-style: none; margin: 1rem 0 0; padding: 0; }
html.or-workspace-dark .panel li { padding-block: .75rem; border-top: 1px solid var(--border); }
html.or-workspace-dark .panel li:first-child { border-top: 0; }
html.or-workspace-dark .panel [role="status"] {
  padding: .875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--raised);
  color: var(--on-dark);
}
html.or-workspace-dark .panel [role="alert"] {
  padding: .875rem 1rem;
  border: 1px solid var(--danger-border);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
}

/* Operate first: one work queue, quiet metadata and inline next actions. */
html.or-workspace-dark .task-workbench { gap: 1.25rem; }
html.or-workspace-dark .task-workbench .page-header { margin: 0; gap: 1rem; }
html.or-workspace-dark .task-overview {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 2rem;
  margin: 0;
  padding: .875rem 0;
  border-block: 1px solid var(--border);
}
html.or-workspace-dark .task-overview > div { display: flex; align-items: baseline; gap: .625rem; }
html.or-workspace-dark .task-overview dt { color: var(--muted); font-size: .8125rem; }
html.or-workspace-dark .task-overview dd {
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
html.or-workspace-dark .task-search-inline { display: flex; align-items: end; gap: .625rem; min-width: 0; }
html.or-workspace-dark .task-search-inline > input { flex: 1 1 0; margin: 0; }
html.or-workspace-dark .task-search-inline > label:not(.sr-only) { flex: 1 1 0; margin: 0; }
html.or-workspace-dark .task-search-inline > button { flex: 0 0 auto; }
html.or-workspace-dark .task-filter-tabs { display: flex; flex-wrap: wrap; gap: .25rem .5rem; border-bottom: 1px solid var(--border); }
html.or-workspace-dark .task-filter-tabs a {
  padding: .5rem .875rem;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-size: .875rem;
  text-decoration: none;
}
html.or-workspace-dark .task-filter-tabs a:hover { color: var(--ink); background: var(--raised); }
html.or-workspace-dark .task-filter-tabs [aria-current="page"] { border-bottom-color: var(--brand); color: var(--ink); font-weight: 650; }
html.or-workspace-dark .task-section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
}
html.or-workspace-dark .task-section-heading h2 { font-size: 1.0625rem; font-weight: 650; }
html.or-workspace-dark .task-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .875rem; min-width: 0; }
html.or-workspace-dark .task-card {
  min-width: 0;
  padding: 1.375rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
html.or-workspace-dark .task-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem 1.5rem; }
html.or-workspace-dark .task-card-heading > div { min-width: 0; }
html.or-workspace-dark .task-card-heading h3 { font-size: 1.125rem; font-weight: 650; letter-spacing: -.025em; }
html.or-workspace-dark .task-card-heading > .badge { flex: 0 0 auto; margin-top: .25rem; }
html.or-workspace-dark .task-card-meta { margin: 0 0 .375rem; color: var(--muted); font-size: .75rem; line-height: 1.7; }
html.or-workspace-dark .task-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin: 1.125rem 0 0;
  padding: 1rem 0;
  border-block: 1px solid var(--border);
  list-style: none;
}
html.or-workspace-dark .task-stage { min-width: 0; }
html.or-workspace-dark .task-stage dt { color: var(--muted); font-size: .75rem; }
html.or-workspace-dark .task-stage dd { margin: .375rem 0 0; color: var(--ink); font-size: .875rem; font-weight: 600; }
html.or-workspace-dark .task-stage dd strong { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
html.or-workspace-dark .task-stage dd > span { color: var(--muted); font-weight: 400; }
html.or-workspace-dark .task-stage small { margin-top: .25rem; font-size: .75rem; line-height: 1.7; }
html.or-workspace-dark .task-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: 1rem; }
html.or-workspace-dark .task-card-actions > form { display: inline-flex; min-width: 0; margin: 0; }
html.or-workspace-dark .task-card-actions a:not(.button) { font-size: .8125rem; text-decoration: underline; }
html.or-workspace-dark .task-card-actions .hint { margin-left: auto; font-size: .75rem; }
html.or-workspace-dark .task-new-badge {
  display: inline-flex;
  max-width: 100%;
  width: fit-content;
  margin: .875rem 0 0;
  padding: .25rem .625rem;
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  background: var(--raised);
  color: var(--ink);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.7;
}
html.or-workspace-dark .task-empty {
  padding: 2rem;
  border: 1px dashed var(--accent-border);
  border-radius: var(--radius);
  background: var(--panel);
  text-align: left;
}
html.or-workspace-dark .task-empty h2 { font-size: 1.125rem; }
html.or-workspace-dark .task-empty p { max-width: 44rem; margin: .625rem 0 1.25rem; color: var(--muted); font-size: .875rem; line-height: 1.8; }
html.or-workspace-dark .task-notice {
  margin: 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--accent-border);
  border-radius: 9px;
  background: var(--raised);
  color: var(--ink);
  font-size: .8125rem;
  line-height: 1.75;
}
html.or-workspace-dark .task-notice p { margin-top: .375rem; color: var(--muted); }
html.or-workspace-dark .task-notice :is(form, .button) { margin-top: .75rem; }
html.or-workspace-dark .task-card .task-notice { margin-top: 1rem; }
html.or-workspace-dark .task-linked-history { margin-top: 1rem; border-top: 1px solid var(--border); }
html.or-workspace-dark .task-linked-history > summary { padding-block: .625rem; color: var(--muted); font-size: .8125rem; }
html.or-workspace-dark .task-linked-history ul { list-style: none; margin: 0; padding: 0; }
html.or-workspace-dark .task-linked-history li + li { border-top: 1px solid var(--border); }
html.or-workspace-dark .task-linked-history a { padding-block: .5rem; font-size: .8125rem; }
/* Polling sets hidden on refresh notices. Component display must never defeat it. */
html.or-workspace-dark [hidden] { display: none !important; }

@media (min-width: 801px) {
  /* The touch-target rule must not reveal the mobile-only duplicate brand. */
  html.or-workspace-dark a.cs-topbar-brand { display: none; }
}

@media (max-width: 640px) {
  html.or-workspace-dark .outreach-shell :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) { font-size: 16px; }
  html.or-workspace-dark .cs-content { padding-inline: 16px; }
  html.or-workspace-dark .cs-public .cs-content { padding-inline: 16px; }
  html.or-workspace-dark :is(.task-card, .task-empty, .panel) { padding: 1rem; }
  html.or-workspace-dark .task-card-heading { flex-wrap: wrap; gap: .5rem; }
  html.or-workspace-dark .task-card-heading > div { flex: 1 1 100%; }
  html.or-workspace-dark .task-stages { grid-template-columns: minmax(0, 1fr); gap: .875rem; }
  html.or-workspace-dark .task-stage { display: grid; grid-template-columns: 5rem minmax(0, 1fr); column-gap: .75rem; align-items: baseline; }
  html.or-workspace-dark .task-stage dd { margin: 0; }
  html.or-workspace-dark .task-stage small { grid-column: 2; }
  html.or-workspace-dark .task-card-actions > form,
  html.or-workspace-dark .task-card-actions > .button { flex: 1 1 100%; }
  html.or-workspace-dark .task-card-actions > form > button { width: 100%; }
  html.or-workspace-dark .task-card-actions .hint { flex: 1 1 100%; margin-left: 0; }
}

