/**
 * SM-CAMPAIGNS-01 — Shared prototype design system
 * Foundation: SendMatico HSL tokens (index.css). Concept-only; not application code.
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Serif:wght@500;600&display=swap');

:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --primary: 221.2 83.2% 53.3%;
  --primary-fg: 210 40% 98%;
  --secondary: 210 40% 96%;
  --muted: 210 40% 96%;
  --muted-fg: 215.4 16.3% 46.9%;
  --border: 214.3 31.8% 91.4%;
  --destructive: 0 84.2% 60.2%;
  --success: 142 71% 45%;
  --success-muted: 142 76% 94%;
  --success-fg: 142 64% 24%;
  --warning: 38 92% 50%;
  --warning-muted: 48 96% 89%;
  --warning-fg: 32 80% 29%;
  --info: 217 91% 60%;
  --info-muted: 214 95% 93%;
  --info-fg: 224 64% 33%;
  --radius: 0.5rem;
  --sidebar-w: 220px;
  --chrome-h: auto;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --font-display: "IBM Plex Serif", Georgia, serif;
  --shadow-sm: 0 1px 2px hsl(222 47% 11% / 0.04);
  --shadow-md: 0 4px 16px hsl(222 47% 11% / 0.06);
  --app-bg: linear-gradient(160deg, #f8fafc 0%, #eef4ff 42%, #f7f9fc 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: hsl(var(--foreground));
  background: var(--app-bg);
  min-height: 100vh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: hsl(var(--primary)); text-decoration: none; }
a:hover { text-decoration: underline; }

/* —— Prototype banner —— */
.proto-banner {
  position: sticky; top: 0; z-index: 100;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  padding: 0.45rem 1rem;
  background: hsl(222 47% 11%);
  color: #e2e8f0;
  font-size: 0.78rem;
}
.proto-banner strong { color: #fff; }
.proto-banner .tag {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.15rem 0.45rem; border-radius: 999px;
  background: hsl(38 92% 50% / 0.2); color: #fcd34d; font-weight: 600;
}
.proto-nav-links { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-left: auto; }
.proto-nav-links a {
  color: #94a3b8; padding: 0.2rem 0.55rem; border-radius: 4px;
  text-decoration: none; border: 1px solid transparent;
}
.proto-nav-links a:hover, .proto-nav-links a.active {
  color: #fff; background: hsl(221 83% 53% / 0.25); border-color: hsl(221 83% 53% / 0.4);
}

/* —— Honesty labels —— */
.label-pill {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase; padding: 0.15rem 0.4rem; border-radius: 4px;
  white-space: nowrap;
}
.label-existing { background: hsl(210 40% 96%); color: hsl(215 16% 35%); }
.label-approved { background: hsl(var(--info-muted)); color: hsl(var(--info-fg)); }
.label-phased { background: hsl(280 60% 95%); color: hsl(280 45% 35%); }
.label-verify { background: hsl(var(--warning-muted)); color: hsl(var(--warning-fg)); }
.label-separate { background: hsl(0 80% 96%); color: hsl(0 60% 40%); }
.label-illustrative { background: hsl(38 92% 92%); color: hsl(32 80% 29%); border: 1px dashed hsl(38 70% 55%); }

/* —— Layout shell —— */
.app-shell { display: flex; min-height: calc(100vh - 36px); }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: linear-gradient(180deg, rgba(37,99,235,0.07), rgba(59,130,246,0.03));
  border-right: 1px solid hsl(var(--border));
  padding: 1.25rem 0.85rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}
.sidebar .brand {
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
  color: hsl(221 83% 40%); padding: 0.25rem 0.5rem 1rem;
  letter-spacing: -0.02em;
}
.sidebar .nav-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.65rem; border-radius: 6px;
  color: hsl(var(--muted-fg)); font-size: 0.88rem; font-weight: 500;
  border: none; background: transparent; cursor: pointer; text-align: left; width: 100%;
}
.sidebar .nav-item:hover { background: hsl(221 83% 53% / 0.08); color: hsl(var(--foreground)); }
.sidebar .nav-item.active { background: hsl(221 83% 53% / 0.12); color: hsl(221 83% 40%); }
.sidebar .nav-item .badge {
  margin-left: auto; font-size: 0.68rem; font-weight: 700;
  background: hsl(var(--warning-muted)); color: hsl(var(--warning-fg));
  padding: 0.1rem 0.35rem; border-radius: 999px;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* —— Campaign chrome —— */
.campaign-chrome {
  background: hsl(var(--card) / 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--border));
  padding: 1rem 1.5rem 0;
  position: sticky; top: 36px; z-index: 40;
}
.chrome-top {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.75rem 1.25rem;
  margin-bottom: 0.85rem;
}
.chrome-title-block { flex: 1; min-width: 200px; }
.chrome-title-block h1 {
  margin: 0; font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.chrome-title-block .edit-hint {
  font-size: 0.75rem; color: hsl(var(--muted-fg)); font-weight: 400;
}
.chrome-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.metrics-strip {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
  padding: 0.55rem 0; border-top: 1px solid hsl(var(--border));
  font-size: 0.82rem;
}
.metrics-strip .metric { display: flex; flex-direction: column; gap: 0.05rem; }
.metrics-strip .metric .val { font-weight: 600; font-size: 0.95rem; }
.metrics-strip .metric .lbl { color: hsl(var(--muted-fg)); font-size: 0.72rem; }
.metrics-strip .def-link {
  font-size: 0.72rem; color: hsl(var(--primary)); background: none; border: none;
  cursor: pointer; padding: 0; align-self: flex-end; margin-bottom: 0.1rem;
}

.secondary-nav {
  display: flex; gap: 0; overflow-x: auto; margin: 0 -0.25rem;
  border-bottom: 1px solid transparent;
}
.secondary-nav button {
  flex-shrink: 0; padding: 0.65rem 0.9rem; border: none; background: none;
  color: hsl(var(--muted-fg)); font-weight: 500; font-size: 0.86rem;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.secondary-nav button:hover { color: hsl(var(--foreground)); }
.secondary-nav button.active {
  color: hsl(221 83% 40%); border-bottom-color: hsl(var(--primary));
}
.secondary-nav button .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: hsl(var(--warning)); margin-left: 0.3rem; vertical-align: middle;
}

/* —— Status pills —— */
.status-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 0.2rem 0.55rem; border-radius: 999px;
}
.status-pending { background: hsl(210 40% 94%); color: hsl(215 20% 40%); }
.status-active { background: hsl(var(--success-muted)); color: hsl(var(--success-fg)); }
.status-paused { background: hsl(var(--warning-muted)); color: hsl(var(--warning-fg)); }
.status-completed { background: hsl(var(--info-muted)); color: hsl(var(--info-fg)); }
.status-cancelled { background: hsl(0 0% 92%); color: hsl(0 0% 40%); }

/* —— Buttons —— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.45rem 0.85rem; border-radius: 6px; font-weight: 500; font-size: 0.86rem;
  border: 1px solid transparent; cursor: pointer; transition: background 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-fg)); }
.btn-primary:hover:not(:disabled) { background: hsl(221 83% 46%); box-shadow: var(--shadow-sm); }
.btn-secondary { background: hsl(var(--secondary)); color: hsl(var(--foreground)); border-color: hsl(var(--border)); }
.btn-secondary:hover:not(:disabled) { background: hsl(210 40% 92%); }
.btn-ghost { background: transparent; color: hsl(var(--muted-fg)); border-color: hsl(var(--border)); }
.btn-ghost:hover:not(:disabled) { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.btn-danger { background: hsl(var(--destructive)); color: #fff; }
.btn-danger-outline { background: transparent; color: hsl(var(--destructive)); border-color: hsl(0 84% 80%); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }
.btn-lg { padding: 0.6rem 1.1rem; font-size: 0.95rem; }

/* —— Content area —— */
.content-area {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  flex: 1;
}
.content-area.with-rail {
  grid-template-columns: 1fr minmax(240px, 280px);
}
.content-main { padding: 1.25rem 1.5rem 2.5rem; min-width: 0; }
.status-rail {
  border-left: 1px solid hsl(var(--border));
  background: hsl(0 0% 100% / 0.55);
  padding: 1.1rem 1rem;
  font-size: 0.82rem;
}
.status-rail h3 {
  margin: 0 0 0.75rem; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: hsl(var(--muted-fg)); font-weight: 600;
}
.rail-factor {
  display: flex; gap: 0.5rem; align-items: flex-start;
  padding: 0.55rem 0; border-bottom: 1px solid hsl(var(--border));
}
.rail-factor:last-child { border-bottom: none; }
.rail-factor .icon {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 0.65rem; font-weight: 700; margin-top: 1px;
}
.rail-factor.ok .icon { background: hsl(var(--success-muted)); color: hsl(var(--success-fg)); }
.rail-factor.block .icon { background: hsl(0 80% 95%); color: hsl(var(--destructive)); }
.rail-factor.warn .icon { background: hsl(var(--warning-muted)); color: hsl(var(--warning-fg)); }
.rail-factor .txt { flex: 1; min-width: 0; }
.rail-factor .txt strong { display: block; font-size: 0.82rem; }
.rail-factor .txt span { color: hsl(var(--muted-fg)); font-size: 0.75rem; }
.rail-factor .jump {
  font-size: 0.72rem; color: hsl(var(--primary)); background: none; border: none;
  cursor: pointer; padding: 0; margin-top: 0.15rem;
}

/* —— Panels / surfaces —— */
.panel {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel-pad { padding: 1.1rem 1.25rem; }
.panel-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.panel-head h2 {
  margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; flex: 1;
}
.panel-head .sub {
  width: 100%; margin: 0; color: hsl(var(--muted-fg)); font-size: 0.84rem; font-weight: 400;
}
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }

/* —— Factor cards (readiness) —— */
.factor-card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.factor-card:hover { border-color: hsl(221 83% 70%); box-shadow: var(--shadow-sm); }
.factor-card.block { border-left: 3px solid hsl(var(--destructive)); }
.factor-card.warn { border-left: 3px solid hsl(var(--warning)); }
.factor-card.ok { border-left: 3px solid hsl(var(--success)); }
.factor-card .fc-top { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.factor-card .fc-top strong { flex: 1; font-size: 0.9rem; }
.factor-card p { margin: 0; font-size: 0.8rem; color: hsl(var(--muted-fg)); }
.factor-card .fc-action { margin-top: 0.55rem; }

/* —— Sequence timeline —— */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 2px; background: hsl(var(--border));
}
.tl-step {
  position: relative; margin-bottom: 0.75rem;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  background: #fff; overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.tl-step.active-step {
  border-color: hsl(221 83% 70%);
  box-shadow: 0 0 0 3px hsl(221 83% 53% / 0.12);
}
.tl-step::before {
  content: ""; position: absolute; left: -1.5rem; top: 1.1rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: hsl(var(--primary)); border: 2px solid #fff;
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.3);
}
.tl-step.followup::before { background: hsl(var(--info)); box-shadow: 0 0 0 2px hsl(var(--info) / 0.3); }
.tl-delay {
  position: relative; margin: 0.35rem 0 0.35rem -0.25rem;
  font-size: 0.75rem; color: hsl(var(--muted-fg));
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.2rem 0.55rem; background: hsl(var(--muted)); border-radius: 999px;
}
.tl-step-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem; cursor: pointer; user-select: none;
}
.tl-step-head:hover { background: hsl(210 40% 98%); }
.tl-step-body {
  display: none; padding: 0 1rem 1rem;
  border-top: 1px solid hsl(var(--border));
}
.tl-step.expanded .tl-step-body { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.65rem;
  padding-bottom: 0.55rem; border-bottom: 1px solid hsl(var(--border));
}
.field { margin-bottom: 0.75rem; }
.field label {
  display: block; font-size: 0.75rem; font-weight: 600;
  color: hsl(var(--muted-fg)); margin-bottom: 0.3rem; text-transform: uppercase; letter-spacing: 0.03em;
}
.field input, .field textarea, .field select {
  width: 100%; padding: 0.5rem 0.65rem;
  border: 1px solid hsl(var(--border)); border-radius: 6px;
  background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(221 83% 53% / 0.15);
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.field .hint { font-size: 0.72rem; color: hsl(var(--muted-fg)); margin-top: 0.25rem; }
.var-token {
  display: inline-block; padding: 0.05rem 0.3rem; border-radius: 3px;
  background: hsl(var(--info-muted)); color: hsl(var(--info-fg));
  font-family: ui-monospace, monospace; font-size: 0.85em;
}

/* —— Tables —— */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 0.84rem;
}
table.data th {
  text-align: left; padding: 0.55rem 0.7rem; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.04em; color: hsl(var(--muted-fg));
  border-bottom: 1px solid hsl(var(--border)); font-weight: 600; white-space: nowrap;
}
table.data td {
  padding: 0.65rem 0.7rem; border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle;
}
table.data tr:hover td { background: hsl(210 40% 98%); }
table.data tr.clickable { cursor: pointer; }

/* —— Modals / drawers —— */
.overlay {
  position: fixed; inset: 0; background: hsl(222 47% 11% / 0.45);
  z-index: 200; display: none; align-items: flex-end; justify-content: center;
  padding: 0; backdrop-filter: blur(2px);
}
.overlay.open { display: flex; animation: fadeIn 0.15s ease; }
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 1.5rem; }
}
.modal {
  background: #fff; border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 640px; max-height: 92vh; overflow: auto;
  box-shadow: var(--shadow-md); animation: slideUp 0.22s ease;
}
@media (min-width: 640px) {
  .modal { border-radius: calc(var(--radius) + 2px); }
}
.modal.wide { max-width: 820px; }
.modal.drawer {
  margin-left: auto; margin-right: 0; max-width: 420px; height: 100%;
  max-height: 100%; border-radius: 0; align-self: stretch;
  animation: slideLeft 0.22s ease;
}
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideLeft { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 1.1rem 1.25rem; border-bottom: 1px solid hsl(var(--border));
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-head h2 { margin: 0; font-size: 1.1rem; flex: 1; }
.modal-body { padding: 1.15rem 1.25rem; }
.modal-foot {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end;
  padding: 0.85rem 1.25rem; border-top: 1px solid hsl(var(--border));
  position: sticky; bottom: 0; background: #fff;
}

/* —— Callouts —— */
.callout {
  padding: 0.75rem 0.9rem; border-radius: 6px; font-size: 0.84rem;
  border: 1px solid transparent; display: flex; gap: 0.65rem; align-items: flex-start;
}
.callout-info { background: hsl(var(--info-muted)); border-color: hsl(214 80% 85%); color: hsl(var(--info-fg)); }
.callout-warn { background: hsl(var(--warning-muted)); border-color: hsl(45 80% 70%); color: hsl(var(--warning-fg)); }
.callout-ok { background: hsl(var(--success-muted)); border-color: hsl(142 50% 75%); color: hsl(var(--success-fg)); }
.callout-danger { background: hsl(0 80% 96%); border-color: hsl(0 70% 85%); color: hsl(0 60% 35%); }
.callout-neutral { background: hsl(var(--muted)); border-color: hsl(var(--border)); color: hsl(var(--foreground)); }
.callout .callout-body { flex: 1; }
.callout .callout-body strong { display: block; margin-bottom: 0.15rem; }

/* —— Progress / ops —— */
.progress-bar {
  height: 8px; background: hsl(var(--muted)); border-radius: 999px; overflow: hidden;
}
.progress-bar > span {
  display: block; height: 100%; background: hsl(var(--primary));
  border-radius: 999px; transition: width 0.4s ease;
}
.stat-tile {
  padding: 0.85rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  background: #fff;
}
.stat-tile .num { font-size: 1.45rem; font-weight: 650; letter-spacing: -0.02em; }
.stat-tile .lbl { font-size: 0.75rem; color: hsl(var(--muted-fg)); margin-top: 0.15rem; }
.stat-tile .def {
  font-size: 0.7rem; color: hsl(var(--primary)); background: none; border: none;
  cursor: pointer; padding: 0; margin-top: 0.35rem;
}

/* —— Activity —— */
.activity-item {
  display: flex; gap: 0.75rem; padding: 0.65rem 0;
  border-bottom: 1px solid hsl(var(--border)); font-size: 0.84rem;
}
.activity-item .time { color: hsl(var(--muted-fg)); font-size: 0.75rem; min-width: 72px; }
.activity-item.phased { opacity: 0.85; }

/* —— Skeleton / empty —— */
.skeleton {
  background: linear-gradient(90deg, hsl(var(--muted)) 25%, hsl(210 40% 98%) 50%, hsl(var(--muted)) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 4px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-line { height: 12px; margin-bottom: 0.5rem; }
.skel-block { height: 80px; margin-bottom: 0.75rem; }
.empty-state {
  text-align: center; padding: 2.5rem 1.5rem;
  border: 1px dashed hsl(var(--border)); border-radius: var(--radius);
}
.empty-state h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.empty-state p { margin: 0 0 1rem; color: hsl(var(--muted-fg)); font-size: 0.88rem; }

/* —— Lifecycle demo switcher —— */
.lifecycle-switcher {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  padding: 0.65rem 1.5rem; background: hsl(222 47% 11% / 0.04);
  border-bottom: 1px dashed hsl(var(--border));
  align-items: center;
}
.lifecycle-switcher .ls-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: hsl(var(--muted-fg)); margin-right: 0.35rem;
}
.lifecycle-switcher button {
  padding: 0.3rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 500;
  border: 1px solid hsl(var(--border)); background: #fff; cursor: pointer;
}
.lifecycle-switcher button.active {
  background: hsl(var(--primary)); color: #fff; border-color: hsl(var(--primary));
}

/* —— Unsaved bar —— */
.unsaved-bar {
  display: none; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.55rem 1rem; background: hsl(var(--warning-muted));
  border-bottom: 1px solid hsl(45 80% 70%); font-size: 0.84rem;
  color: hsl(var(--warning-fg));
}
.unsaved-bar.visible { display: flex; }
.unsaved-bar strong { font-weight: 600; }

/* —— Preview steps —— */
.preview-step {
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  margin-bottom: 0.75rem; overflow: hidden;
}
.preview-step-head {
  padding: 0.55rem 0.85rem; background: hsl(var(--muted));
  font-size: 0.8rem; font-weight: 600; display: flex; gap: 0.5rem; align-items: center;
}
.preview-step-body { padding: 0.85rem; font-size: 0.88rem; }
.preview-step-body .subj { font-weight: 600; margin-bottom: 0.5rem; }
.missing-var {
  background: hsl(0 80% 95%); color: hsl(0 60% 40%);
  padding: 0.05rem 0.25rem; border-radius: 3px; font-family: ui-monospace, monospace; font-size: 0.85em;
}

/* —— Hub page —— */
.hub {
  max-width: 920px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem;
}
.hub h1 {
  font-family: var(--font-display); font-size: 1.85rem; font-weight: 600;
  letter-spacing: -0.03em; margin: 0 0 0.5rem;
}
.hub .lead { color: hsl(var(--muted-fg)); font-size: 1.05rem; margin: 0 0 2rem; max-width: 58ch; }
.hub-card {
  display: block; padding: 1.35rem 1.5rem; margin-bottom: 1rem;
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px);
  background: #fff; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.hub-card:hover {
  border-color: hsl(221 83% 70%); box-shadow: var(--shadow-md);
  transform: translateY(-1px); text-decoration: none;
}
.hub-card h2 { margin: 0 0 0.35rem; font-size: 1.15rem; color: hsl(221 83% 38%); }
.hub-card p { margin: 0; color: hsl(var(--muted-fg)); font-size: 0.9rem; }
.hub-card .meta { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* —— Sender row —— */
.sender-row {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
  padding: 0.85rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  margin-bottom: 0.55rem; background: #fff;
}
.sender-row .sr-main { flex: 1; min-width: 160px; }
.sender-row .sr-main strong { display: block; font-size: 0.9rem; }
.sender-row .sr-main span { font-size: 0.75rem; color: hsl(var(--muted-fg)); }
.health-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 0.25rem;
}
.health-ok { background: hsl(var(--success)); }
.health-warn { background: hsl(var(--warning)); }
.health-bad { background: hsl(var(--destructive)); }

/* —— Day chips —— */
.day-chip {
  display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center;
  border-radius: 6px; border: 1px solid hsl(var(--border)); font-size: 0.75rem; font-weight: 600;
  cursor: pointer; background: #fff;
}
.day-chip.on { background: hsl(var(--primary)); color: #fff; border-color: hsl(var(--primary)); }
.day-chip:disabled { opacity: 0.5; cursor: not-allowed; }

/* —— Toast —— */
.toast-host {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 300;
  display: flex; flex-direction: column; gap: 0.5rem; max-width: 360px;
}
.toast {
  padding: 0.75rem 1rem; background: hsl(222 47% 11%); color: #fff;
  border-radius: 6px; font-size: 0.84rem; box-shadow: var(--shadow-md);
  animation: slideUp 0.2s ease;
}

/* —— Mobile —— */
.menu-toggle {
  display: none; border: 1px solid hsl(var(--border)); background: #fff;
  padding: 0.35rem 0.55rem; border-radius: 6px; cursor: pointer;
}
@media (max-width: 900px) {
  .content-area.with-rail { grid-template-columns: 1fr; }
  .status-rail {
    border-left: none; border-top: 1px solid hsl(var(--border));
    order: -1;
  }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .sidebar {
    position: fixed; inset: 36px auto 0 0; z-index: 90;
    transform: translateX(-105%); transition: transform 0.2s ease;
    height: calc(100vh - 36px); box-shadow: var(--shadow-md);
  }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-flex; }
  .campaign-chrome { padding: 0.85rem 1rem 0; top: 36px; }
  .content-main { padding: 1rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .chrome-top { flex-direction: column; }
  .metrics-strip { gap: 0.75rem; }
  .timeline { padding-left: 1.1rem; }
}

/* Focus visible */
:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
