/* ============================================================================
   Ads Manager Tools — design system
   Modern, premium, sober analytics-SaaS. Navy ink + electric blue.
   Display: Sora · Body: Figtree · Numeric: JetBrains Mono
   ========================================================================== */

:root {
  /* Brand */
  --ink: #15233f;            /* navy — sidebar, headings */
  --ink-2: #1d2c4d;
  --brand: #2f6bff;          /* electric blue — primary */
  --brand-600: #2257e6;
  --brand-700: #1b46bf;
  --brand-100: #e8efff;
  --brand-50: #f3f7ff;
  --sky: #5b8cff;

  /* Neutrals (cool) */
  --bg: #f6f8fc;             /* app background */
  --surface: #ffffff;
  --surface-2: #fbfcfe;
  --line: #e7ebf3;
  --line-2: #dde3ee;
  --muted: #6b7691;
  --muted-2: #8b95ad;
  --text: #1f2840;

  /* Status */
  --ok: #1f9d6b;   --ok-bg: #e7f6ef;
  --warn: #c77d12;  --warn-bg: #fcf2dd;
  --danger: #d23f4a; --danger-bg: #fdeaec;
  --idle: #8b95ad; --idle-bg: #eef1f6;

  /* Effects */
  --radius: 12px;
  --radius-lg: 18px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(21,35,63,.06), 0 1px 3px rgba(21,35,63,.05);
  --shadow: 0 4px 14px rgba(21,35,63,.07), 0 2px 6px rgba(21,35,63,.05);
  --shadow-lg: 0 18px 50px -12px rgba(21,35,63,.22);
  --ring: 0 0 0 3px rgba(47,107,255,.20);
  --sidebar-w: 256px;

  --font-display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); font-weight: 600; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .4em; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
.num, .mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 600; font-size: .92rem; line-height: 1;
  padding: .68rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -6px rgba(47,107,255,.6); }
.btn-primary:hover { background: var(--brand-600); color: #fff; box-shadow: 0 8px 22px -8px rgba(47,107,255,.7); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: #c8d1e2; background: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--brand-50); color: var(--brand-700); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #f4c9cd; }
.btn-danger:hover { background: #fbdde0; }
.btn-block { width: 100%; }
.btn-lg { padding: .85rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: .45rem .7rem; font-size: .82rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---- Cards ------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 1.4rem 1.5rem; }
.card-head { padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.05rem; }
.card-title { font-size: 1.05rem; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Stat card */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; inset: 0 0 auto auto; width: 90px; height: 90px; background: radial-gradient(circle at top right, var(--brand-50), transparent 70%); pointer-events: none; }
.stat .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); font-weight: 600; }
.stat .value { font-family: var(--font-mono); font-size: 1.85rem; font-weight: 600; color: var(--ink); letter-spacing: -.02em; margin-top: .25rem; }
.stat .delta { font-size: .82rem; font-weight: 600; }
.delta.up { color: var(--ok); } .delta.down { color: var(--danger); }
/* Plain-language definition shown under a stat tile's value/label. */
.stat .stat-def { font-size: .72rem; font-weight: 400; line-height: 1.35; color: var(--muted-2); margin-top: .45rem; }

/* ---- Status pills ----------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; padding: .26rem .6rem; border-radius: 999px; line-height: 1; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--ok); background: var(--ok-bg); }
.pill-warn { color: var(--warn); background: var(--warn-bg); }
.pill-danger { color: var(--danger); background: var(--danger-bg); }
.pill-idle { color: var(--idle); background: var(--idle-bg); }
.badge { display:inline-flex; align-items:center; gap:.35rem; font-size:.72rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; padding:.2rem .5rem; border-radius:6px; background:var(--brand-50); color:var(--brand-700); }

/* ---- Forms ------------------------------------------------------------ */
.field { margin-bottom: 1.05rem; }
.field > label, label.lbl { display: block; font-weight: 600; font-size: .88rem; color: var(--ink); margin-bottom: .4rem; }
.input, input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%; font-family: var(--font-body); font-size: .95rem; color: var(--text);
  padding: .62rem .8rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface-2); transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: var(--ring); }
.help { font-size: .82rem; color: var(--muted); margin-top: .35rem; }
.field-error, .form-error { color: var(--danger); font-size: .84rem; margin-top: .35rem; }

/* ---- Alerts / flash --------------------------------------------------- */
.alert { display:flex; gap:.6rem; align-items:flex-start; padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .9rem; border:1px solid; margin-bottom: 1rem; }
.alert-success { background: var(--ok-bg); border-color:#bfe6d2; color:#176c4c; }
.alert-error { background: var(--danger-bg); border-color:#f4c9cd; color:#a02a34; }
.alert-warning { background: var(--warn-bg); border-color:#f0dcae; color:#8a5808; }
.alert-info { background: var(--brand-50); border-color:#cfe0ff; color: var(--brand-700); }

/* ---- Tables ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.data td { padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--brand-50); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--font-mono); }

/* Responsive: on small screens a .data-stack table becomes stacked cards (no horizontal scroll). */
@media (max-width: 640px) {
  .table-wrap-stack { overflow: visible; border: 0; background: transparent; }
  table.data-stack thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
  table.data-stack, table.data-stack tbody, table.data-stack tr, table.data-stack td { display: block; width: auto; }
  table.data-stack tr { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); margin-bottom: .8rem; overflow: hidden; }
  table.data-stack tbody tr:hover { background: var(--surface); }
  table.data-stack td { border: 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem .9rem; text-align: right; }
  table.data-stack td::before { content: attr(data-label); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); font-weight: 600; text-align: left; white-space: nowrap; }
  table.data-stack td.num { text-align: right; }
  table.data-stack td.actions-cell { display: block; border-bottom: 0; padding: .7rem .9rem; background: var(--surface-2); }
  table.data-stack td.actions-cell::before { content: none; }
  table.data-stack td.actions-cell .row { justify-content: stretch !important; flex-wrap: wrap; }
  table.data-stack td.actions-cell .row > a, table.data-stack td.actions-cell .row > form { flex: 1 1 auto; }
  table.data-stack td.actions-cell .btn { width: 100%; text-align: center; }
}

/* ---- Empty state ------------------------------------------------------ */
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty .icon { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 14px; background: var(--brand-50); display: grid; place-items: center; color: var(--brand); }
.empty h3 { color: var(--ink); }

/* ---- App shell -------------------------------------------------------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
.sidebar {
  background: linear-gradient(180deg, #16243f 0%, #11203b 100%);
  color: #c9d2e6; padding: 1.1rem .8rem; display: flex; flex-direction: column; gap: .3rem;
  position: sticky; top: 0; height: 100vh; border-right: 1px solid #0d1a30;
}
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: .4rem .55rem 1rem; }
.sidebar .brand img { height: 26px; width: 26px; border-radius: 7px; }
.sidebar .brand .name { color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: -.01em; }
.nav-sec { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #6b7aa0; font-weight: 700; padding: .9rem .65rem .35rem; }
.nav-link { display: flex; align-items: center; gap: .65rem; padding: .58rem .65rem; border-radius: 9px; color: #b7c2dc; font-weight: 500; font-size: .92rem; transition: background .14s, color .14s; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: rgba(47,107,255,.18); color: #fff; box-shadow: inset 2px 0 0 var(--sky); }
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.sidebar .spacer { flex: 1; }
.sidebar .side-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: .6rem; margin-top: .4rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(246,248,252,.85); backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line); padding: .7rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.topbar .ws { display: flex; align-items: center; gap: .55rem; }
.ws-chip { display:inline-flex; align-items:center; gap:.5rem; background:var(--surface); border:1px solid var(--line-2); border-radius:999px; padding:.34rem .8rem; font-weight:600; font-size:.86rem; color:var(--ink); box-shadow: var(--shadow-sm); }
.ws-chip .dot { width:8px;height:8px;border-radius:50%; background: var(--brand); }
.content { padding: 1.6rem 1.5rem 3rem; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-head { margin-bottom: 1.4rem; }
.page-head h1 { font-size: 1.6rem; margin-bottom: .2rem; }
.page-head .sub { color: var(--muted); }
.hamburger { display:none; }

/* grids */
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.row { display:flex; gap:1rem; align-items:center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}
.mb-0{margin-bottom:0}.mb-2{margin-bottom:1rem}

/* ---- Auth layout ------------------------------------------------------ */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1.2rem;
  background:
    radial-gradient(1100px 500px at 8% -10%, #eaf0ff 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 110%, #e9f7f1 0%, transparent 55%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 2rem 1.9rem; }
.auth-logo { display:block; height: 34px; margin-bottom: 1.4rem; }
.auth-card h1 { font-size: 1.35rem; }
.auth-foot { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); display:flex; flex-direction:column; gap:.4rem; }
.honeypot { position:absolute; left:-5000px; width:1px; height:1px; overflow:hidden; }

/* ---- Connector cards -------------------------------------------------- */
.conn-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1rem; }
.conn-card { display:flex; flex-direction:column; gap:.85rem; }
.conn-top { display:flex; align-items:center; justify-content:space-between; gap:.6rem; }
.conn-logo { width:40px;height:40px;border-radius:10px; display:grid;place-items:center; background:var(--brand-50); color:var(--brand-700); font-weight:700; flex-shrink:0; }
.conn-name { font-weight:600; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.conn-ident { display:flex; align-items:center; gap:.7rem; min-width:0; }
.conn-ident-text { min-width:0; }
.conn-meta { font-size:.8rem; color:var(--muted); margin:.1rem 0 0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.conn-error { font-size:.8rem; color:var(--danger); background:var(--danger-bg); margin:0; padding:.45rem .6rem; border-radius:8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.conn-actions { display:flex; gap:.45rem; justify-content:flex-end; align-items:center; border-top:1px solid var(--line); padding-top:.7rem; margin-top:auto; }
.conn-actions form { margin:0; }
.provider-tile { display:flex; align-items:center; gap:.7rem; padding:.9rem 1rem; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); transition: border-color .14s, box-shadow .14s, transform .12s; }
.provider-tile:hover { border-color:#c8d4ec; box-shadow:var(--shadow); transform: translateY(-1px); }

/* =========================================================================
   Landing page
   ========================================================================= */
.lp { color: var(--text); }
.lp-nav { position: sticky; top:0; z-index: 30; backdrop-filter: blur(8px); background: rgba(255,255,255,.8); border-bottom:1px solid var(--line); }
.lp-nav .inner, .lp-section .inner, .lp-foot .inner { max-width: 1140px; margin: 0 auto; padding: 0 1.4rem; }
.lp-nav .inner { display:flex; align-items:center; justify-content:space-between; height: 66px; }
.lp-nav .logo { height: 30px; }
.lp-nav .links { display:flex; align-items:center; gap:1.4rem; }
.lp-nav .links a { color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.lp-nav .links a:hover { color: var(--brand-700); }

.lp-hero { position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 560px at 15% -20%, #e7efff 0%, transparent 60%),
    radial-gradient(1000px 500px at 95% 0%, #eafaf3 0%, transparent 55%),
    #fff;
  border-bottom: 1px solid var(--line); }
.lp-hero .inner { max-width: 1140px; margin: 0 auto; padding: 5rem 1.4rem 4.5rem; }
.lp-eyebrow { display:inline-flex; align-items:center; gap:.5rem; background:#fff; border:1px solid var(--line-2); border-radius:999px; padding:.35rem .8rem; font-weight:600; font-size:.82rem; color:var(--brand-700); box-shadow:var(--shadow-sm); }
.lp-hero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); letter-spacing:-.03em; max-width: 14ch; margin: 1.1rem 0 .8rem; }
.lp-hero h1 .grad { background: linear-gradient(100deg, var(--brand), #7aa2ff 60%, #34c79a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-hero .lead { font-size: 1.18rem; color: var(--muted); max-width: 52ch; }
.lp-cta { display:flex; gap:.8rem; flex-wrap:wrap; margin-top: 1.8rem; }
.lp-trust { margin-top: 1.6rem; color: var(--muted-2); font-size:.85rem; display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.lp-hero-art { margin-top: 3rem; border-radius: 16px; border:1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-lg); padding: 1rem; }

.lp-section { padding: 4.5rem 0; }
.lp-section.alt { background: var(--surface-2); border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.lp-section .head { text-align:center; max-width: 56ch; margin: 0 auto 2.6rem; }
.lp-section .head h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); }
.lp-section .head p { color: var(--muted); font-size: 1.05rem; }
.feature-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.feature { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm); transition: transform .14s, box-shadow .14s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature .ic { width:44px;height:44px;border-radius:11px; background: linear-gradient(135deg, var(--brand), #6b9bff); color:#fff; display:grid;place-items:center; margin-bottom: 1rem; }
.feature h3 { font-size: 1.12rem; }
.feature p { color: var(--muted); margin: 0; }
.logos { display:flex; flex-wrap:wrap; gap: .7rem 1rem; justify-content:center; }
.logos .chip { background:#fff; border:1px solid var(--line-2); border-radius:10px; padding:.5rem .9rem; font-weight:600; color:var(--ink-2); font-size:.9rem; box-shadow:var(--shadow-sm); }
.steps { display:grid; grid-template-columns: repeat(3,1fr); gap: 1.4rem; counter-reset: step; }
.step { position:relative; padding-left: .2rem; }
.step .n { width:34px;height:34px;border-radius:10px; background:var(--ink); color:#fff; font-family:var(--font-mono); font-weight:600; display:grid;place-items:center; margin-bottom:.8rem; }
.cta-band { background: linear-gradient(115deg, #16243f, #21407f); border-radius: var(--radius-lg); color:#fff; padding: 3rem 2.5rem; text-align:center; }
.cta-band h2 { color:#fff; font-size: clamp(1.7rem,3.5vw,2.3rem); }
.cta-band p { color:#c6d2ec; max-width: 48ch; margin: .5rem auto 1.6rem; }
.lp-foot { border-top:1px solid var(--line); padding: 2.4rem 0; color: var(--muted); font-size:.9rem; }
.lp-foot .inner { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:1rem; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .feature-grid, .steps { grid-template-columns: 1fr; }
  .lp-nav .links a:not(.btn) { display:none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60; width: 280px; height: 100vh;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after { content:""; position:fixed; inset:0; background:rgba(15,25,45,.45); z-index: 50; }
  .hamburger { display:inline-grid; place-items:center; width:40px;height:40px;border-radius:9px; border:1px solid var(--line-2); background:var(--surface); cursor:pointer; }
  .content { padding: 1.2rem 1rem 2.5rem; }
}
@media (max-width: 560px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .card-head { flex-direction: column; align-items: flex-start; }
  .auth-card { padding: 1.5rem 1.25rem; }
  .lp-cta { flex-direction: column; }
  .lp-cta .btn { width: 100%; }
}
.menu-toggle { display:none; }

/* workspace switcher */
.ws-menu > summary::-webkit-details-marker { display:none; }
.ws-menu > summary { list-style: none; }
.ws-switch-item { display:flex; width:100%; align-items:center; gap:.5rem; background:none; border:0; padding:.5rem .6rem; border-radius:8px; cursor:pointer; font:inherit; font-size:.9rem; color:var(--ink); text-align:left; }
.ws-switch-item:hover { background: var(--brand-50); }
.ws-dot { width:7px; height:7px; border-radius:50%; background: var(--line-2); }

/* ============================================================
   Legal pages (privacy, terms, data deletion) — readable prose
   ============================================================ */
.legal-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.legal-top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.85); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--line); }
.legal-top .inner { max-width: 820px; margin: 0 auto; padding: .8rem 1.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.legal-brand { display: flex; align-items: center; gap: .55rem; font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.legal-brand img { height: 26px; width: 26px; border-radius: 7px; }
.legal-lang { display: flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 600; color: var(--muted-2); }
.legal-lang a { color: var(--muted); }
.legal-lang a.active { color: var(--brand-700); }

.legal { max-width: 820px; width: 100%; margin: 0 auto; padding: 2.6rem 1.4rem 3.5rem; color: var(--text); flex: 1; }
.legal h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -.02em; margin: .2rem 0 .3rem; }
.legal h2 { font-size: 1.2rem; margin: 2.2rem 0 .6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--ink); }
.legal h3 { font-size: 1.02rem; margin: 1.4rem 0 .4rem; color: var(--ink-2); }
.legal p, .legal li { color: var(--muted); line-height: 1.7; }
.legal ul, .legal ol { padding-left: 1.3rem; margin: .6rem 0; }
.legal li { margin: .3rem 0; }
.legal a { color: var(--brand-700); text-decoration: underline; text-underline-offset: 2px; }
.legal code { font-family: var(--font-mono); font-size: .85em; background: var(--surface-2); padding: .1rem .35rem; border-radius: 5px; color: var(--ink-2); }
.legal-eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-700); margin: 0 0 .2rem; }
.legal-updated { color: var(--muted-2); font-size: .9rem; margin: 0 0 1.4rem; }
.legal-todo { color: var(--danger); font-weight: 600; background: var(--danger-bg); padding: .05rem .35rem; border-radius: 5px; }
.legal-authority { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1.1rem; }
.legal-table { width: 100%; border-collapse: collapse; margin: .8rem 0; font-size: .92rem; }
.legal-table th, .legal-table td { text-align: left; padding: .6rem .8rem; border: 1px solid var(--line); vertical-align: top; }
.legal-table th { background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.legal-table td { color: var(--muted); }
.legal-cross { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); font-size: .9rem; font-weight: 600; }
.legal-foot { border-top: 1px solid var(--line); background: var(--surface); }
.legal-foot .inner { max-width: 820px; margin: 0 auto; padding: 1.2rem 1.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--muted-2); font-size: .88rem; }

/* Brand connector logos + connection count badge */
.conn-logo.brand { background: #fff; border: 1px solid var(--line); }
.conn-logo.brand svg { display: block; }

/* =========================================================================
   Campaign creation wizard
   ========================================================================= */

/* -- Stepper ---------------------------------------------------------------- */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  max-width: 640px;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex: 0 0 auto;
}
.wizard-step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 700;
  flex: none;
  background: var(--bg);
  color: var(--muted);
  border: 1.5px solid var(--line-2);
  transition: background .15s, color .15s, border-color .15s;
}
.wizard-step.is-active .wizard-step-badge {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-100);
}
.wizard-step.is-done .wizard-step-badge {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok);
}
.wizard-step-label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.wizard-step.is-active .wizard-step-label { color: var(--ink); }
.wizard-step.is-done .wizard-step-label { color: var(--ok); }
.wizard-step-connector {
  flex: 1;
  min-width: 1.25rem;
  height: 1.5px;
  background: var(--line-2);
  margin: 0 .5rem;
}

/* -- Channel choice cards -------------------------------------------------- */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: .5rem;
  margin-bottom: .5rem;
}
.choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 1.6rem 1rem;
  border: 2px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
  user-select: none;
}
.choice-card:hover {
  border-color: var(--brand);
  background: var(--brand-50);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
/* Highlight when associated hidden radio is checked */
.choice-card:has(+ input:checked),
input[type="radio"]:checked + .choice-card,
.choice-card.is-selected {
  border-color: var(--brand);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px var(--brand-100), var(--shadow);
}
.choice-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.choice-card-icon svg { display: block; width: 26px; height: 26px; }
.choice-card-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
}

/* -- Campaign select list -------------------------------------------------- */
.select-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-bottom: .5rem;
}
.select-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.select-row:hover {
  border-color: var(--brand);
  background: var(--brand-50);
  box-shadow: var(--shadow-sm);
}
.select-row:has(.select-row-radio:checked) {
  border-color: var(--brand);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.select-row-radio {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  flex: none;
}
.select-row-name {
  flex: 1;
  font-weight: 600;
  color: var(--ink);
  font-size: .95rem;
}

/* -- Step 3 recap panel ---------------------------------------------------- */
.wizard-recap {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}
.wizard-recap-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  flex: none;
}
.wizard-recap-icon svg { display: block; width: 22px; height: 22px; }
.wizard-recap-text {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  font-size: .92rem;
  color: var(--ink);
}
.wizard-recap-campaign {
  font-size: .85rem;
  color: var(--muted);
}

/* Wizard responsive */
@media (max-width: 560px) {
  .choice-grid { grid-template-columns: 1fr; }
  .wizard-steps { padding: .75rem 1rem; }
  .wizard-step-label { display: none; }
  .wizard-step-connector { min-width: .6rem; }
}
