/* ─────────────────────────────────────────────────────────────────────────
 * UTMward — shared light visual system
 * Marketing workspace, not ops console. Warm off-white canvas, one teal accent,
 * friendly product sans, mono reserved for the finished URL string only.
 * (User brief explicitly overrides the Linear dark/indigo design system.)
 * ───────────────────────────────────────────────────────────────────────── */

:root {
  /* Surfaces — warm neutral, light */
  --bg:         #f8f6f2;   /* warm off-white canvas */
  --surface:    #ffffff;   /* cards, composer, rows */
  --surface-2:  #f3f0ea;   /* soft warm gray — insets, chips */
  --surface-3:  #edeae2;   /* pressed / hover on soft */

  /* Foreground — warm near-black, not pure */
  --fg:    #211f1c;
  --fg-2:  #56524b;        /* body text */
  --muted: #8b867d;        /* metadata, placeholders */
  --meta:  #a8a299;        /* faintest labels */

  /* Borders — warm hairlines */
  --border:      #e7e2d9;
  --border-soft: #efebe3;
  --border-strong:#dcd6ca;

  /* Accent — clear teal (single chromatic voice) */
  --accent:        #0e8c7f;
  --accent-hover:  #0a7468;
  --accent-active: #086154;
  --accent-on:     #ffffff;
  --accent-soft:   #e6f3f0;   /* tinted fill */
  --accent-line:   #bfe0d9;   /* tinted border */

  /* Quiet status (dots + lowercase labels — never billboard pills) */
  --ok:      #4f9d69;
  --needsfix:#c8674a;   /* warm coral, not neon red */
  --drift:   #b8892f;

  /* Type */
  --font-display: "Plus Jakarta Sans", "Inter", -apple-system, system-ui, "Segoe UI", sans-serif;
  --font-body:    "Inter", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Radius — soft-medium */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* Spacing rhythm */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px;

  /* Elevation — soft, warm, low */
  --shadow-sm: 0 1px 2px rgba(33,31,28,0.04), 0 1px 1px rgba(33,31,28,0.03);
  --shadow-md: 0 4px 16px rgba(33,31,28,0.06), 0 1px 3px rgba(33,31,28,0.04);
  --shadow-lg: 0 12px 40px rgba(33,31,28,0.10), 0 2px 8px rgba(33,31,28,0.05);

  --maxw: 1200px;
  --focus: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 72%);
}

* { box-sizing: border-box; }

html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; color: var(--fg); margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--accent-soft); color: var(--accent-active); }

/* ─── Layout primitives ──────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-8); }

/* ─── App top bar (Screens 2–5, no left rail) ────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in oklab, var(--bg), white 40%);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto;
  display: flex; align-items: center; gap: var(--sp-6);
  padding: 0 var(--sp-8); height: 60px;
}
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.mark {
  width: 26px; height: 26px; display: block; flex-shrink: 0;
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }

.ws-switch {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 8px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13.5px; color: var(--fg-2); font-weight: 500; cursor: pointer;
}
.ws-switch:hover { background: var(--surface-2); }
.ws-dot { width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(140deg,#f0b46b,#e08a4c); display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.nav a {
  padding: 7px 12px; border-radius: var(--r-sm);
  color: var(--fg-2); font-size: 14px; font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a.active { background: var(--accent-soft); color: var(--accent-active); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  font-weight: 600; font-size: 12.5px; color: var(--fg-2);
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-on); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); }
.btn-ghost { background: var(--surface); color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-quiet { background: transparent; color: var(--fg-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--fg); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }

/* ─── Selects & inputs ───────────────────────────────────────────────── */
.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; letter-spacing: 0.01em; }
.input, .select {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--fg); font-family: var(--font-body);
  font-size: 15px; transition: border-color .12s, box-shadow .12s;
}
.input::placeholder { color: var(--meta); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.select {
  appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b867d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.field-hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.lock-ico { width: 13px; height: 13px; color: var(--muted); }

/* ─── Chips / channel tags (quiet, not severity pills) ───────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  background: var(--surface-2); color: var(--fg-2); border: 1px solid var(--border);
}
.chip-email  { background: #eef3fb; color: #3f6396; border-color: #dce6f5; }
.chip-paid   { background: #f3eefb; color: #6b5296; border-color: #e6dcf5; }
.chip-social { background: #eef7f2; color: #3f7d5c; border-color: #d9ece1; }
.chip-organic{ background: #fbf5ea; color: #96702f; border-color: #f2e6cd; }

/* ─── Quiet status (dot + lowercase word) ────────────────────────────── */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.ok .dot { background: var(--ok); }
.status.needsfix { color: var(--needsfix); }
.status.needsfix .dot { background: var(--needsfix); }
.status.drift { color: var(--drift); }
.status.drift .dot { background: var(--drift); }

/* ─── Cards ──────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }

/* ─── The URL preview (mono, the ONE mono surface) ───────────────────── */
.url-preview {
  font-family: var(--font-mono); font-size: 14px; line-height: 1.7;
  color: var(--fg); word-break: break-all; user-select: all;
}
.url-preview .u-base { color: var(--fg); }
.url-preview .u-key  { color: var(--muted); }
.url-preview .u-val  { color: var(--accent-active); font-weight: 600; }
.url-preview .u-punc { color: var(--meta); }

/* ─── Toast ──────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(14px);
  background: var(--fg); color: #fff; padding: 11px 18px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; z-index: 80;
  display: flex; align-items: center; gap: 9px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .t-tick { width: 16px; height: 16px; color: #6fe0b0; }

/* ─── Utility ────────────────────────────────────────────────────────── */
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
