:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1f1f1f;
  --muted: #5f6368;
  --line: #e0e3e7;
  --blue: #1a73e8;
  --green: #188038;
  --orange: #e37400;
  --red: #c5221f;
  --mono: "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--blue); }

header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
}

header h1 { margin: 0; font-size: 20px; font-weight: 500; }

header nav a { margin-right: 16px; text-decoration: none; }

/* "Switch to the other site" links rendered by demo.js into nav .switch. */
header nav .switch-link {
  display: inline-block;
  margin: 2px 8px 2px 0;
  padding: 4px 12px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: #fff;
}
header nav .switch-link:hover { background: #e8f0fe; }

.meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 12px;
  background: #eef1f5;
  color: var(--muted);
}

.badge.mode-off { background: #fde7c3; color: #7a4a00; }
.badge.mode-manual { background: #d8f0dd; color: #0d5c2b; }
.badge.mode-auto { background: #d6e7ff; color: #174ea6; }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.card h2 { margin: 0 0 12px; font-size: 16px; font-weight: 500; }

.note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.product { border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.product .name { font-weight: 500; }
.product .price { color: var(--muted); margin: 4px 0 12px; }

button, .button {
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  margin: 0 8px 8px 0;
}

button.secondary { background: #fff; color: var(--blue); }
button.danger { background: #fff; color: var(--red); border-color: var(--red); }
button.green { background: var(--green); border-color: var(--green); }

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.log {
  font-family: var(--mono);
  font-size: 12px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fafbfc;
}

.log .row { padding: 4px 0; border-bottom: 1px dashed var(--line); word-break: break-all; }
.log .row:last-child { border-bottom: 0; }
.log .time { color: var(--muted); margin-right: 6px; }

.pill {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 6px;
  font-weight: 700;
  color: #fff;
}

.pill.p1 { background: var(--green); }
.pill.p3 { background: var(--orange); }

.counts { font-size: 13px; margin-bottom: 8px; }
.counts span { margin-right: 16px; }

form.lead { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
form.lead label { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
form.lead input, form.lead select {
  font: inherit;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
form.lead .actions { grid-column: 1 / -1; }

.consent-state td { padding: 4px 12px 4px 0; font-family: var(--mono); font-size: 13px; }
.consent-state td.granted { color: var(--green); font-weight: 700; }
.consent-state td.denied { color: var(--red); }

/* Consent flags (gcs / gcd / npa / gcu) extracted from each hit. */
.consent-flags {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 4px;
  background: #e8f0fe;
  color: #174ea6;
  font-size: 11px;
}

/* Advanced consent mode banner rendered by consent.js. */
.consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  font-size: 14px;
}

.consent-banner .consent-text { flex: 1 1 420px; color: var(--muted); }
.consent-banner .consent-text b { color: #202124; }
.consent-banner .consent-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.consent-banner button { margin: 0; }

.toast {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #e6f4ea;
  color: #0d5c2b;
  font-size: 14px;
}

.toast.show { display: block; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; }
