/* ------------------------------------------------------------------
 * styles.css — Sandbox styling. One stylesheet for every page.
 * ------------------------------------------------------------------ */

:root {
  color-scheme: light;
  /* Data Marketing School brand palette */
  --bg: #f7f7f5;            /* warm off-white page */
  --surface: #ffffff;       /* cards */
  --surface-2: #f1efe9;     /* warm tint */
  --border: #e6e2d9;        /* warm hairline */
  --border-strong: #d8d2c6; /* hover borders */
  --hover: #e4eaf3;         /* row hover */
  --ink: #0a0f1f;           /* navy ink (hero/dark blocks) */
  --text: #0a0f1f;
  --muted: #5f6474;
  --brand: #1f58f5;
  --brand-dark: #1747c9;    /* button hover background */
  --brand-light: #7d9dff;
  --brand-tint: #e3eaff;
  --brand-ink: #1747c9;     /* brand-colored TEXT (keys, labels) */
  --accent: #1f58f5;        /* primary accent stays brand blue */
  --gold: #f5b301;          /* sparing amber highlight */
  --danger: #e5484d;
  --warn: #b7791f;
  --success-ink: #1a7f4b;
  --header-bg: rgba(247, 247, 245, 0.85);
  --backdrop: rgba(29, 45, 53, 0.45);
  --switch-off: #c8ccd6;
  /* JSON highlighting in the console cards */
  --code-text: #33424d;
  --j-key: #1f58f5;
  --j-str: #1a7f4b;
  --j-num: #b7791f;
  --j-bool: #b5179e;
  --j-null: #7c3aed;
  /* Consent section: ① default (amber) vs ② update (blue) */
  --c-default: #b7791f;
  --c-on-default: #ffffff;
  --c-default-bg: #fdf6e3;
  --c-default-line: #f1d898;
  --c-update: var(--brand);
  --c-update-bg: #f4f7ff;
  --c-update-line: #c9d6ff;
  --c-granted: #1a7f4b;
  --c-granted-bg: #e7f5ee;
  --c-denied: #c4383d;
  --c-denied-bg: #fcebeb;
  --radius: 16px;
  --radius-pill: 999px;
  --shadow: 0 10px 34px rgba(10, 15, 31, 0.1);
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Bricolage Grotesque", var(--font-body);
}

/* Dark theme. Applies when chosen in the header toggle
 * (data-theme="dark" on <html>, set by theme.js), or when the system
 * prefers dark and Light hasn't been forced. The two blocks hold the
 * same values. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020;
  --surface: #131a2c;
  --surface-2: #1b2438;
  --border: #273149;
  --border-strong: #36425f;
  --hover: #222c44;
  --ink: #e8ebf4;
  --text: #e8ebf4;
  --muted: #9aa3b8;
  --brand: #4672ff;
  --brand-dark: #3460f0;
  --brand-light: #6f8fff;
  --brand-tint: #1a2856;
  --brand-ink: #9db6ff;
  --accent: #4672ff;
  --danger: #f0646a;
  --warn: #e0a54a;
  --success-ink: #5fd39a;
  --header-bg: rgba(11, 16, 32, 0.85);
  --backdrop: rgba(0, 0, 0, 0.6);
  --switch-off: #3a4560;
  --code-text: #c8d3e0;
  --j-key: #7fb0ff;
  --j-str: #7ee0a3;
  --j-num: #f2b765;
  --j-bool: #ff8fa3;
  --j-null: #b69bff;
  --c-default: #e0a54a;
  --c-on-default: #1d1405;
  --c-default-bg: #221c10;
  --c-default-line: #5a4520;
  --c-update-bg: #16214a;
  --c-update-line: #2e3f78;
  --c-granted: #5fd39a;
  --c-granted-bg: #143326;
  --c-denied: #ff7b80;
  --c-denied-bg: #3a1a1d;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1020;
    --surface: #131a2c;
    --surface-2: #1b2438;
    --border: #273149;
    --border-strong: #36425f;
    --hover: #222c44;
    --ink: #e8ebf4;
    --text: #e8ebf4;
    --muted: #9aa3b8;
    --brand: #4672ff;
    --brand-dark: #3460f0;
    --brand-light: #6f8fff;
    --brand-tint: #1a2856;
    --brand-ink: #9db6ff;
    --accent: #4672ff;
    --danger: #f0646a;
    --warn: #e0a54a;
    --success-ink: #5fd39a;
    --header-bg: rgba(11, 16, 32, 0.85);
    --backdrop: rgba(0, 0, 0, 0.6);
    --switch-off: #3a4560;
    --code-text: #c8d3e0;
    --j-key: #7fb0ff;
    --j-str: #7ee0a3;
    --j-num: #f2b765;
    --j-bool: #ff8fa3;
    --j-null: #b69bff;
    --c-default: #e0a54a;
    --c-on-default: #1d1405;
    --c-default-bg: #221c10;
    --c-default-line: #5a4520;
    --c-update-bg: #16214a;
    --c-update-line: #2e3f78;
    --c-granted: #5fd39a;
    --c-granted-bg: #143326;
    --c-denied: #ff7b80;
    --c-denied-bg: #3a1a1d;
    --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 80px;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.page-title,
.site-header__logo {
  font-family: var(--font-head);
  letter-spacing: -0.015em;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ----------------------------- Header ----------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.site-header__logo .logo-mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
}
.site-header__logo span {
  color: var(--brand);
}
.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}
.site-nav > a {
  color: var(--muted);
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  transition: color 0.15s, background 0.15s;
}
.site-nav > a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.site-nav > a.is-active {
  color: var(--brand);
  background: var(--brand-tint);
}

/* Cart → bordered pill with a cart glyph + live badge */
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text) !important;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
}
.cart-link::before {
  content: "🛒";
  font-size: 14px;
  line-height: 1;
}
.cart-link:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.cart-link.is-active {
  color: var(--brand) !important;
  border-color: var(--brand-light);
  background: var(--brand-tint);
}
.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border-radius: 10px;
}

/* ----------------------------- Layout ----------------------------- */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px;
}
.page-title {
  margin: 0 0 4px;
  font-size: 26px;
}
.page-sub {
  margin: 0 0 24px;
  color: var(--muted);
}
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ----------------------------- Promo ------------------------------ */
.promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 30px;
  margin-bottom: 28px;
  border-radius: var(--radius);
  background: radial-gradient(120% 160% at 85% -20%, rgba(31, 88, 245, 0.55), transparent 55%),
    linear-gradient(120deg, #0a0f1f, #111a33);
  border: 1px solid rgba(125, 157, 255, 0.18);
  color: #fff;
  cursor: pointer;
}
.promo h2 {
  margin: 0 0 4px;
  color: #fff;
}
.promo p {
  margin: 0;
  color: #c3ccea;
}
.promo .btn--accent {
  background: var(--gold);
  border-color: var(--gold);
  color: #241a00;
}
.promo .btn--accent:hover {
  background: #ffc21f;
  border-color: #ffc21f;
}

/* ----------------------------- Search ----------------------------- */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}
.search-bar input {
  flex: 1;
}

/* ----------------------------- Grid ------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
}
.card__art {
  font-size: 56px;
  text-align: center;
  padding: 14px 0;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 14px;
}
.card__art img {
  display: block;
  width: 108px;
  height: 108px;
  margin: 0 auto;
}
.detail__art img {
  display: block;
  width: 72%;
  max-width: 240px;
  height: auto;
  margin: 0 auto;
}
.line__art img {
  display: block;
  width: 34px;
  height: 34px;
}
.card__name {
  font-weight: 600;
  margin: 0 0 2px;
}
.card__meta {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
}
.card__price {
  font-weight: 700;
  margin: 0 0 14px;
}
.card .btn {
  margin-top: auto;
}

/* ----------------------------- Buttons ---------------------------- */
.btn {
  display: inline-block;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active {
  transform: translateY(1px);
}
.btn:hover {
  background: var(--brand-dark);
  text-decoration: none;
}
.btn--block {
  display: block;
  width: 100%;
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--surface-2);
}
.btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--accent:hover {
  background: var(--brand-dark);
}
.btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn--danger:hover {
  background: rgba(229, 72, 77, 0.1);
}
.btn--sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* ----------------------------- Forms ------------------------------ */
input,
select,
textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 12px;
  font: inherit;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
}
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
}
.field {
  margin-bottom: 16px;
}
.row {
  display: flex;
  gap: 16px;
}
.row .field {
  flex: 1;
}

/* ----------------------------- Product detail --------------------- */
.detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.detail__art {
  font-size: 120px;
  text-align: center;
  padding: 50px 0;
  background: var(--surface-2);
  border-radius: var(--radius);
}
.detail__price {
  font-size: 24px;
  font-weight: 700;
  margin: 10px 0 18px;
}
.detail__actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* ----------------------------- Tables/cart ------------------------ */
.line {
  display: grid;
  grid-template-columns: 48px 1fr auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.line__art {
  font-size: 30px;
  text-align: center;
}
.line__name {
  font-weight: 600;
}
.line__meta {
  font-size: 13px;
  color: var(--muted);
}
.line input[type="number"] {
  width: 64px;
}
.summary {
  margin-top: 20px;
  text-align: right;
}
.summary__total {
  font-size: 22px;
  font-weight: 700;
}

/* ----------------------------- Panels ----------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
}
.panel h3 {
  margin-top: 0;
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 50px 0;
}
.note {
  font-size: 13px;
  color: var(--muted);
  background: var(--surface-2);
  border-left: 3px solid var(--brand);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 20px;
}

/* Checkout steps */
.steps {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 13px;
}
.steps span {
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--surface-2);
  color: var(--muted);
}
.steps span.is-active {
  background: var(--brand);
  color: #fff;
}
.steps span.is-done {
  background: rgba(31, 88, 245, 0.14);
  color: var(--accent);
}

/* Lead lifecycle */
.lifecycle {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 60;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

/* ----------------------------- Account ---------------------------- */
.account-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
/* Logged-out "Log in / Sign up" → ghost pill */
#auth-open {
  color: var(--text);
  font-weight: 600;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: background 0.15s, border-color 0.15s;
}
#auth-open:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  text-decoration: none;
}
#auth-logout {
  font-size: 13px;
  color: var(--muted);
}
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--brand-tint);
  border: 1px solid var(--brand-light);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
}

/* ----------------------------- Modal ------------------------------ */
.modal[hidden] {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(2px);
}
.modal__box {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.modal__x {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal__x:hover {
  color: var(--text);
}
.modal__tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.modal__tab {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 9px;
  border-radius: 9px;
  cursor: pointer;
}
.modal__tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.modal__pane[hidden] {
  display: none;
}

/* ---------------------------- Console ----------------------------- */
/* A full-height lateral drawer on the left. .dl-hidden slides it off
 * screen; the #dl-reopen tab on the left edge brings it back. */
.dl-console {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 420px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* the whole drawer scrolls: config + event feed */
  overscroll-behavior: contain;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 100;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  transform: translateX(0);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.dl-console.dl-hidden {
  transform: translateX(-100%);
  box-shadow: none;
}
.dl-console__bar {
  flex: 0 0 auto;
  position: sticky; /* keep the title bar in view while scrolling */
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.dl-console__hide {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  cursor: pointer;
}
.dl-console__hide:hover {
  color: var(--text);
  background: var(--surface-2);
}
/* Reopen tab: pinned to the left edge, only visible while hidden. */
.dl-console__reopen {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: none;
  align-items: center;
  gap: 6px;
  writing-mode: vertical-rl;
  padding: 14px 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 10px 10px 0;
  box-shadow: var(--shadow);
  color: var(--text);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  cursor: pointer;
}
.dl-console__reopen:hover {
  background: var(--surface-2);
}
.dl-console.dl-hidden + .dl-console__reopen {
  display: flex;
}
.dl-console__title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 12px 14px;
  text-align: left;
}
.dl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.dl-console__count {
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 10px;
  padding: 0 8px;
  font-size: 12px;
}
/* Active GTM container pill, shown on the console bar ("tab") */
.dl-gtm-badge {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.dl-gtm-badge--live {
  background: #1a7f4b;
  border-color: #1a7f4b;
  color: #fff;
}
.dl-console__clear {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.dl-console__clear:hover {
  color: var(--text);
}
.dl-console__feed {
  padding: 10px;
}

/* Foldable console section (dlMakeFold in datalayer.js): a <details>
 * with a clickable header and a padded body. */
.dl-fold {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.dl-fold__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.dl-fold__head::-webkit-details-marker {
  display: none;
}
.dl-fold__head:hover {
  background: var(--surface-2);
}
.dl-fold__head:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: -2px;
}
.dl-fold__chev {
  display: inline-block;
  transition: transform 0.15s ease;
}
.dl-fold[open] > .dl-fold__head .dl-fold__chev {
  transform: rotate(90deg);
}
.dl-fold__title {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-fold__title b {
  color: var(--text);
  font-weight: 600;
}
.dl-fold__meta {
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-fold__body {
  padding: 0 10px 10px;
}
/* The event feed fills the rest of the drawer; its cards bring their
 * own padding. */
.dl-fold--feed {
  flex: 1 0 auto;
  border-bottom: none;
}
.dl-fold--feed > .dl-fold__body {
  padding: 0;
}
.dl-fold--feed .dl-console__feed {
  padding: 0 10px 10px;
}

/* GTM container config (top of the console) */
.dl-gtm__row {
  display: flex;
  gap: 6px;
}
.dl-gtm__row input {
  flex: 1;
  padding: 6px 9px;
  font-size: 12px;
  font-family: inherit;
}
.dl-gtm__btn {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #fff;
  font: inherit;
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 7px;
  cursor: pointer;
}
.dl-gtm__btn:hover {
  background: var(--brand-dark);
}
.dl-gtm__btn--ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
.dl-gtm__btn--ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
.dl-gtm__status {
  margin-top: 7px;
  font-size: 11px;
  color: var(--accent);
}
.dl-gtm__status--error {
  color: var(--warn);
}
.dl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.dl-card--flash {
  animation: dl-flash 0.9s ease;
}
@keyframes dl-flash {
  from {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(31, 88, 245, 0.35);
  }
  to {
    border-color: var(--border);
    box-shadow: none;
  }
}
.dl-card__head {
  display: flex;
  align-items: center;
  background: var(--surface-2);
}
.dl-card__toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 10px;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dl-card__toggle:hover {
  background: var(--hover);
}
.dl-card__rerun {
  flex: none;
  margin-right: 8px;
  padding: 3px 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.dl-card__rerun:hover {
  color: var(--brand);
  border-color: var(--brand);
}
.dl-card__edit {
  flex: none;
  margin-right: 6px;
  padding: 3px 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.dl-card__edit:hover {
  color: var(--brand);
  border-color: var(--brand);
}
/* Centered editor popup (reuses the .modal scaffold) */
.modal__box--wide {
  max-width: 560px;
}
.dl-edit__title {
  margin: 0 0 4px;
  font-size: 18px;
}
.dl-edit__sub {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
}
/* Layered editor: a transparent textarea sits exactly on top of a
 * highlighted <pre>, so you see colors but type into the textarea.
 * Both layers MUST share identical font/padding/line-height to align. */
.dl-edit__wrap {
  position: relative;
  height: 60vh;
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0f1b2d;
  overflow: hidden;
}
.dl-edit__wrap:focus-within {
  border-color: var(--brand);
}
.dl-edit__hl,
.dl-edit__area {
  margin: 0;
  border: 0;
  width: 100%;
  height: 100%;
  padding: 14px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
.dl-edit__hl {
  position: absolute;
  inset: 0;
  color: #c8d3e0;
  background: transparent;
  pointer-events: none;
}
.dl-edit__hl code {
  font: inherit;
}
.dl-edit__area {
  position: relative;
  background: transparent;
  color: transparent;
  caret-color: #ffffff;
  resize: none;
}
.dl-edit__area:focus {
  outline: none;
}
.dl-edit__area::selection {
  background: rgba(31, 88, 245, 0.4);
}
/* JSON token colors */
.dl-edit__hl .j-key {
  color: #7fb0ff;
}
.dl-edit__hl .j-str {
  color: #7ee0a3;
}
.dl-edit__hl .j-num {
  color: #f2b765;
}
.dl-edit__hl .j-bool {
  color: #ff8fa3;
}
.dl-edit__hl .j-null {
  color: #b69bff;
}
.dl-edit__error {
  margin-top: 10px;
  padding: 8px 11px;
  font-size: 12px;
  color: var(--danger);
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid var(--danger);
  border-radius: 7px;
  white-space: pre-wrap;
  word-break: break-word;
}
.dl-edit__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.dl-card__chevron {
  color: var(--muted);
  font-size: 10px;
  transition: transform 0.15s;
}
.dl-card--open .dl-card__chevron {
  transform: rotate(90deg);
}
.dl-card__event {
  flex: 1;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
}
.dl-card__time {
  color: var(--muted);
  font-size: 11px;
}
.dl-card__body {
  display: none;
  margin: 0;
  padding: 10px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--code-text);
  white-space: pre-wrap;
  word-break: break-word;
}
.dl-card--open .dl-card__body {
  display: block;
}
/* JSON token colors tuned for the light card background */
.dl-card__body .j-key {
  color: var(--j-key);
  font-weight: 600;
}
.dl-card__body .j-str {
  color: var(--j-str);
}
.dl-card__body .j-num {
  color: var(--j-num);
}
.dl-card__body .j-bool {
  color: var(--j-bool);
}
.dl-card__body .j-null {
  color: var(--j-null);
}

/* ----------------------- Offline request builder ------------------ */
.rb {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.rb__row--preset {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.rb__row--preset label {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}
.rb__preset {
  max-width: 420px;
}
.rb__bar {
  display: flex;
  gap: 8px;
}
.rb__method {
  width: 108px;
  flex: none;
  font-weight: 700;
}
.rb__url {
  flex: 1;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
}
.rb__send {
  flex: none;
  padding-left: 26px;
  padding-right: 26px;
}
.rb__mode {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 2px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.rb__mode input {
  width: auto;
}
.rb__mode-hint {
  font-weight: 400;
  color: var(--muted);
}
/* Method colour-coding */
.rb__method {
  font-weight: 700;
}
.rb__method[data-m="GET"] {
  color: var(--success-ink);
}
.rb__method[data-m="POST"] {
  color: var(--brand);
}
.rb__method[data-m="PUT"],
.rb__method[data-m="PATCH"] {
  color: var(--warn);
}
.rb__method[data-m="DELETE"] {
  color: var(--danger);
}
.rb__method[data-m="HEAD"] {
  color: var(--muted);
}
.rb__send {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.rb__send:disabled {
  opacity: 0.7;
  cursor: default;
}
.rb__kbd {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
}

/* Custom-styled dropdowns (preset + method) */
.rb__preset,
.rb__method {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235f6474' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
  cursor: pointer;
}
.rb__preset:hover,
.rb__method:hover {
  border-color: var(--border-strong);
}
.rb__preset:focus,
.rb__method:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 88, 245, 0.15);
}
.rb__url:focus {
  box-shadow: 0 0 0 3px rgba(31, 88, 245, 0.15);
}

/* Key/value field polish: focus ring, dimmed when the row is off */
.rb-kv__on {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}
.rb-kv__row:focus-within .rb-kv__k,
.rb-kv__row:focus-within .rb-kv__v {
  border-color: var(--brand);
  background: var(--surface);
}
.rb-kv__row:has(.rb-kv__on:not(:checked)) .rb-kv__k,
.rb-kv__row:has(.rb-kv__on:not(:checked)) .rb-kv__v {
  opacity: 0.45;
}

/* Text/link buttons (cURL, copy) */
.rb__linkbtn {
  background: none;
  border: none;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 7px;
}
.rb__linkbtn:hover {
  background: var(--brand-tint);
}

/* Resolved URL preview */
.rb__resolved-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 2px 2px;
}
.rb__resolved {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.rb__resolved-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
}
.rb__resolved-row .rb__linkbtn {
  flex: none;
}

/* sGTM preview token field */
.rb__sgtm {
  display: block;
  margin: 12px 2px 2px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.rb__sgtm-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.rb__sgtm-hint {
  font-weight: 400;
  color: var(--muted);
}
.rb__sgtm-hint code {
  font-size: 11.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 5px;
}
.rb__sgtm-input {
  background: var(--surface);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
}
.rb__sgtm-input:focus {
  box-shadow: 0 0 0 3px rgba(31, 88, 245, 0.15);
}

/* Tab count badges */
.rb__tab-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  margin-left: 4px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
}
.rb__tab.is-active .rb__tab-badge {
  background: var(--brand-tint);
  color: var(--brand);
}

/* Spinner (send pending) */
.rb-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: rb-spin 0.7s linear infinite;
  vertical-align: -1px;
  margin-right: 4px;
}
@keyframes rb-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Response: request context line + copy */
.rb-res__for {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.rb-res__for-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
}
.rb-res__copy {
  margin-left: auto;
}

/* Tabs */
.rb__tabs {
  display: flex;
  gap: 6px;
  margin: 18px 0 14px;
  border-bottom: 1px solid var(--border);
}
.rb__tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  margin-bottom: -1px;
}
.rb__tab.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* Key/value tables */
.rb-kv__row {
  display: grid;
  grid-template-columns: 24px 1fr 1.4fr 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.rb-kv__on {
  width: auto;
}
.rb-kv__k,
.rb-kv__v {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  padding: 8px 10px;
}
.rb-kv__del {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 0;
}
.rb-kv__del:hover {
  color: var(--danger);
  border-color: var(--danger);
}
.rb-kv__add {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-pill);
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 14px;
  margin-top: 4px;
  cursor: pointer;
}
.rb-kv__add:hover {
  background: var(--brand-tint);
  border-style: solid;
}

/* Body: segmented type switch + code editor */
.rb__bodybar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.rb__bodytypes {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.rb__seg {
  position: relative;
  margin: 0;
}
.rb__seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rb__seg span {
  display: block;
  padding: 6px 15px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.rb__seg span:hover {
  color: var(--text);
}
.rb__seg input:checked + span {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(10, 15, 31, 0.12);
}
.rb__seg input:focus-visible + span {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

/* Layered JSON editor (transparent textarea over a highlighted <pre>) */
.rb__editor {
  position: relative;
  border: 1px solid #1d2d44;
  border-radius: 12px;
  background: #0f1b2d;
  overflow: hidden;
}
.rb__editor:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 88, 245, 0.18);
}
.rb__editor-hl,
.rb__editor-area {
  margin: 0;
  border: 0;
  width: 100%;
  padding: 14px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.rb__editor-hl {
  position: absolute;
  inset: 0;
  color: #c8d3e0;
  background: transparent;
  pointer-events: none;
  overflow: hidden;
}
.rb__editor-hl code {
  font: inherit;
}
.rb__editor-area {
  position: relative;
  display: block;
  height: auto;
  min-height: 56px;
  background: transparent;
  color: transparent;
  caret-color: #ffffff;
  resize: none;
  overflow: hidden;
}
.rb__editor-area:focus {
  outline: none;
}
.rb__editor-area::placeholder {
  color: #5b6b86;
}
.rb__editor-area::selection {
  background: rgba(31, 88, 245, 0.4);
}
.rb__editor-hl .j-key {
  color: #7fb0ff;
}
.rb__editor-hl .j-str {
  color: #7ee0a3;
}
.rb__editor-hl .j-num {
  color: #f2b765;
}
.rb__editor-hl .j-bool {
  color: #ff8fa3;
}
.rb__editor-hl .j-null {
  color: #b69bff;
}
.rb__body-err {
  margin-top: 10px;
  padding: 8px 11px;
  font-size: 12px;
  color: var(--danger);
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid var(--danger);
  border-radius: 7px;
}

/* Response */
.rb-res {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.rb-res--err {
  border-color: var(--danger);
}
.rb-res__pending {
  color: var(--muted);
  font-size: 13px;
}
.rb-res__status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.rb-res__badge {
  font-weight: 700;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  color: #fff;
}
.rb-res__badge--ok {
  background: #1a7f4b;
}
.rb-res__badge--redir {
  background: var(--warn);
}
.rb-res__badge--cerr {
  background: #d9480f;
}
.rb-res__badge--serr,
.rb-res__badge--err {
  background: var(--danger);
}
.rb-res__badge--opaque {
  background: var(--muted);
}
.rb-res__time,
.rb-res__size {
  font-size: 12px;
  color: var(--muted);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}
.rb-res__msg {
  color: var(--danger);
  font-size: 13px;
  margin: 4px 0;
  word-break: break-word;
}
.rb-res__hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}
.rb-res__headers {
  margin-bottom: 10px;
  font-size: 12px;
}
.rb-res__headers summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}
.rb-res__headers pre {
  margin: 8px 0 0;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 8px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.rb-res__body {
  background: var(--surface-2);
  border-radius: 8px;
  max-height: 420px;
  overflow: auto;
}

/* Outgoing request panel (shown above the response) */
.rb-sent {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.rb-sent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.rb-sent__label {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.rb-sent__line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  word-break: break-all;
}
.rb-sent__url {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--ink);
}
.rb-sent__section {
  margin-bottom: 10px;
  font-size: 12px;
}
.rb-sent__section:last-child {
  margin-bottom: 0;
}
.rb-sent__section summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}
.rb-sent__count {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
}
.rb-sent__headers,
.rb-sent__body {
  margin: 8px 0 0;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 8px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.rb-sent__body {
  max-height: 360px;
  overflow: auto;
}
.rb-sent__hk {
  color: var(--brand-ink);
  font-weight: 600;
}

/* Aligned 2-column header grid (shared by request + response panels) */
.rb-hgrid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 5px 18px;
  margin-top: 8px;
  padding: 11px 13px;
  background: var(--surface-2);
  border-radius: 8px;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}
.rb-hgrid__k {
  color: var(--brand-ink);
  font-weight: 600;
  white-space: nowrap;
}
.rb-hgrid__v {
  color: var(--ink);
  word-break: break-word;
}
.rb-hgrid__empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

/* History */
.rb-hist {
  margin-top: 26px;
}
.rb-hist__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.rb-hist__head h3 {
  margin: 0;
}
.rb-hist__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 8px;
  font: inherit;
  cursor: pointer;
}
.rb-hist__item:hover {
  background: var(--surface-2);
}
.rb-hist__method {
  flex: none;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  color: #fff;
  background: var(--muted);
}
.rb-hist__method--get {
  background: #1a7f4b;
}
.rb-hist__method--post {
  background: var(--brand);
}
.rb-hist__method--put,
.rb-hist__method--patch {
  background: var(--warn);
}
.rb-hist__method--delete {
  background: var(--danger);
}
.rb-hist__url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
}
.rb-hist__status {
  flex: none;
}
.rb-hist__time {
  flex: none;
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .detail {
    grid-template-columns: 1fr;
  }
  .dl-console {
    width: 100vw;
    border-top-right-radius: 0;
  }
  /* Header wraps: logo on top, nav on its own row */
  .site-header {
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 12px 16px;
  }
  .site-nav {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }
  .site-nav .cart-link {
    margin-left: auto;
  }
  /* Promo stacks so the CTA keeps its pill shape */
  .promo {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 22px;
  }
  .container {
    padding: 22px 16px;
  }
  .rb__bar {
    flex-wrap: wrap;
  }
  .rb__url {
    flex: 1 1 100%;
    order: 3;
  }
  .rb-kv__row {
    grid-template-columns: 24px 1fr 1.2fr 32px;
  }
}

/* ------------------------- Consent (in console) -------------------- */
/* Two steps that mirror the two Consent Mode commands:
 *   ① default (amber) — baseline pushed on page load, before GTM
 *   ② update  (blue)  — the visitor's choice, pushed on click */
.dl-fold__tag {
  margin-left: 4px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: 10px;
}

/* A step card, with a colored left rail. */
.dl-cstep {
  position: relative;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 10px;
}
.dl-cstep--default {
  background: var(--c-default-bg);
  border-color: var(--c-default-line);
  border-left-color: var(--c-default);
}
.dl-cstep--update {
  background: var(--surface);
  border-color: var(--c-update-line);
  border-left-color: var(--c-update);
}
/* Once an update has been sent, it is the state in force: lift it. */
.dl-cstep--update.dl-cstep--active {
  background: var(--c-update-bg);
  box-shadow: 0 2px 10px rgba(31, 88, 245, 0.12);
}

.dl-cstep__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.dl-cstep__num {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.dl-cstep--default .dl-cstep__num {
  background: var(--c-default);
  color: var(--c-on-default);
}
.dl-cstep--update .dl-cstep__num {
  background: var(--c-update);
}
.dl-cstep__titles {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dl-cstep__cmd {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dl-cstep--default .dl-cstep__cmd {
  color: var(--c-default);
}
.dl-cstep--update .dl-cstep__cmd {
  color: var(--c-update);
}
.dl-cstep__when {
  font-size: 10.5px;
  color: var(--muted);
}
.dl-cstep__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}
.dl-cstep__field {
  color: var(--text);
}
.dl-cstep__hint {
  margin: 8px 0 0;
  font-size: 10.5px;
  color: var(--muted);
}

/* Connector between the two steps. */
.dl-cstep__link {
  display: flex;
  justify-content: center;
  padding: 5px 0;
}
.dl-cstep__link span {
  font-size: 10.5px;
  color: var(--muted);
  padding: 1px 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
}

/* Update status pill. */
.dl-consent__state {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  border: 1px dashed var(--border);
  white-space: nowrap;
}
.dl-consent__state--set {
  background: var(--c-update);
  border: 1px solid var(--c-update);
  color: #fff;
}

/* Default baseline: segmented control (amber, so blue stays "update"). */
.dl-seg {
  display: inline-flex;
  border: 1px solid var(--c-default-line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.dl-seg__btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 5px 11px;
  cursor: pointer;
}
.dl-seg__btn + .dl-seg__btn {
  border-left: 1px solid var(--c-default-line);
}
.dl-seg__btn:hover {
  background: var(--c-default-bg);
  color: var(--text);
}
.dl-seg__btn--on,
.dl-seg__btn--on:hover {
  background: var(--c-default);
  color: var(--c-on-default);
}

/* Read-only value chips (signal → granted / denied). */
.dl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.dl-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  padding: 2px 4px 2px 7px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.dl-chip b {
  font-weight: 700;
  padding: 0 5px;
  border-radius: 4px;
}
.dl-chip--granted b {
  background: var(--c-granted-bg);
  color: var(--c-granted);
}
.dl-chip--denied b {
  background: var(--c-denied-bg);
  color: var(--c-denied);
}
.dl-chip--fixed {
  opacity: 0.7;
}

/* Update: category rows with a toggle switch each. */
.dl-consent__cats {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 8px;
}
.cookie-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  cursor: pointer;
}
.cookie-cat + .cookie-cat {
  border-top: 1px solid var(--border);
}
.cookie-cat:hover {
  background: var(--surface-2);
}
.cookie-cat__info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.cookie-cat__label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.cookie-cat__key {
  font-size: 11px;
  color: var(--muted);
}

/* The toggle switch: fixed-size wrapper, invisible checkbox on top,
 * absolutely positioned track + thumb so everything lines up exactly. */
.cookie-switch {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 22px;
}
.cookie-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.cookie-switch__track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: var(--switch-off);
  transition: background 0.18s ease;
}
.cookie-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(10, 15, 31, 0.3);
  transition: transform 0.18s ease;
}
.cookie-switch input:checked + .cookie-switch__track {
  background: var(--brand);
}
.cookie-switch input:checked + .cookie-switch__track .cookie-switch__thumb {
  transform: translateX(18px);
}
.cookie-switch input:focus-visible + .cookie-switch__track {
  outline: 2px solid var(--brand-light);
  outline-offset: 2px;
}

.dl-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dl-consent__actions .dl-gtm__btn--save {
  margin-left: auto;
}
.dl-consent__reset {
  margin-top: 8px;
  width: 100%;
  background: none;
  border: 1px dashed var(--border);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.dl-consent__reset:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* --------------------------- Theme toggle ------------------------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding: 7px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.theme-toggle:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.theme-toggle__icon {
  font-size: 15px;
  line-height: 1;
}
@media (max-width: 720px) {
  .theme-toggle__text {
    display: none; /* icon only on narrow screens */
  }
}

/* ------------------------- Cookies (in console) -------------------- */
.dl-cookies__list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.dl-ck {
  padding: 7px 10px;
}
.dl-ck + .dl-ck {
  border-top: 1px solid var(--border);
}
.dl-ck:hover {
  background: var(--surface-2);
}
.dl-ck__top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.dl-ck__name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-ck__vendor,
.dl-ck__cat,
.dl-ck__http {
  flex: 0 0 auto;
  font-size: 10px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.dl-ck__vendor {
  background: var(--brand-tint);
  color: var(--brand-ink);
  font-weight: 600;
}
.dl-ck__cat {
  border: 1px dashed var(--border-strong);
  color: var(--muted);
}
.dl-ck__http {
  background: var(--c-default-bg);
  border: 1px solid var(--c-default-line);
  color: var(--c-default);
  font-weight: 700;
}
.dl-ck__del:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.dl-ck__del:disabled:hover {
  color: var(--muted);
  border-color: transparent;
}
.dl-ck__del {
  margin-left: auto;
  flex: 0 0 auto;
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  line-height: 1;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
}
.dl-ck__del:hover {
  color: var(--danger);
  border-color: var(--danger);
}
.dl-ck__value {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dl-cookies__empty {
  padding: 10px;
  font-size: 11px;
  color: var(--muted);
}
.dl-cookies code,
.dl-cookies__note code {
  font-family: inherit;
}
.dl-cookies__note {
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--muted);
}

/* Consent header summary (visible while the section is folded). */
.dl-consent__summary {
  font-size: 10.5px;
}
.dl-consent__sum-d {
  color: var(--c-default);
}
.dl-consent__sum-u.is-set {
  color: var(--c-update);
  font-weight: 600;
}
/* Open: show the "Consent Mode v2" tag. Folded: show the state summary
 * instead (the details are hidden), so the two never fight for space. */
.dl-consent[open] > .dl-fold__head .dl-consent__summary,
.dl-consent:not([open]) > .dl-fold__head .dl-fold__tag {
  display: none;
}
