:root {
  color-scheme: light;
  --ink: #182033;
  --muted: #647084;
  --line: #e4e8f0;
  --surface: #ffffff;
  --page: #f5f7fb;
  --blue: #3a5bdb;
  --blue-dark: #2947bc;
  --violet: #6b55d9;
  --green: #16794b;
  --amber: #a76112;
  --red: #b23d3d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 76px);
  background: #111827;
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #65718a;
  border-radius: 10px;
  color: #dce4ff;
  font-size: 17px;
}

.brand-light { color: #aab7d4; font-weight: 500; }

.environment-badge, .status-pill, .small-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.environment-badge {
  padding: 8px 11px;
  border: 1px solid #465169;
  color: #d8e2f8;
  background: #1e293b;
}

.pulse { width: 7px; height: 7px; border-radius: 50%; background: #f2b75b; }

.page-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }

.intro { padding: 48px 0 25px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 0.13em; }
.intro h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -0.045em; }
.intro-copy { max-width: 660px; margin: 14px 0 0; color: var(--muted); font-size: 16px; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 18px;
  border: 1px solid #eeddb9;
  border-radius: 12px;
  background: #fffaf0;
  color: #684e22;
}

.notice-icon { flex: 0 0 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #f3d99c; color: #624614; font-size: 12px; font-weight: 800; }
.notice p { margin: 0; font-size: 13px; }

.panel {
  margin-top: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 5px 24px rgb(24 32 51 / 3%);
}

.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading h2 { margin: 0; font-size: 20px; letter-spacing: -0.025em; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.panel-copy { margin: 10px 0 18px; color: var(--muted); font-size: 13px; }

.status-pill { padding: 6px 10px; font-size: 10px; letter-spacing: 0.06em; }
.status-idle { background: #eef1f6; color: #566176; }
.status-ready { background: #e6f5ed; color: var(--green); }
.status-error { background: #fff0ef; color: var(--red); }

.auth-row { margin-top: 18px; }
.field-label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.input-and-button { display: flex; gap: 10px; }
input {
  min-width: 0;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d6dce7;
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
input:focus { border-color: #7187ed; box-shadow: 0 0 0 3px rgb(58 91 219 / 12%); }
input::placeholder { color: #99a2b1; }
.field-hint { margin: 7px 0 0; color: #7a8596; font-size: 11px; }

.button {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: 0.52; }
.button-primary { background: var(--blue); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--blue-dark); }
.button-secondary { background: #edf0ff; color: #334dc2; border-color: #dce2ff; }
.button-secondary:hover:not(:disabled) { background: #e2e7ff; }
.button-quiet { border-color: var(--line); background: #fff; color: #46536b; }
.button-quiet:hover:not(:disabled) { background: #f7f8fb; }
.button-outline { border-color: #d5cffa; background: #fff; color: #5a48c4; }
.button-outline:hover:not(:disabled) { background: #f7f5ff; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 17px; }
.metric-card { min-height: 118px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.metric-label, .metric-foot { display: block; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin: 8px 0 2px; font-size: 27px; letter-spacing: -0.04em; line-height: 1; }
.metric-foot { color: #8b95a5; font-size: 10px; }

.small-tag { padding: 6px 9px; background: #f2f0ff; color: #6250c7; font-size: 9px; }
.demo-controls { display: flex; flex-wrap: wrap; gap: 9px; }
.owner-test { display: grid; grid-template-columns: minmax(190px, 0.8fr) minmax(300px, 1.2fr); align-items: center; gap: 20px; margin-top: 21px; padding-top: 18px; border-top: 1px solid #edf0f5; }
.owner-copy strong, .owner-copy span { display: block; }
.owner-copy strong { font-size: 12px; }
.owner-copy span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.owner-input { align-items: center; }
.result-box { margin-top: 15px; padding: 13px 15px; border: 1px solid #d7e8df; border-radius: 10px; background: #f4fbf7; color: #235c40; font-size: 12px; }
.result-box[data-kind="error"] { border-color: #f0d7d5; background: #fff7f6; color: #8c3632; }
.result-box strong { display: block; margin-bottom: 4px; }
.result-box code { color: inherit; font-size: 11px; }

.logs-heading { align-items: center; margin-bottom: 15px; }
.empty-state { min-height: 156px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; border: 1px dashed #dce1ea; border-radius: 12px; color: #647084; text-align: center; }
.empty-state strong { color: #364156; font-size: 13px; }
.empty-state span:last-child { max-width: 420px; padding: 0 12px; font-size: 11px; }
.empty-mark { width: 28px; height: 28px; display: grid; place-items: center; margin-bottom: 2px; border-radius: 8px; background: #eef1fb; color: var(--blue); font-size: 18px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; min-width: 770px; border-collapse: collapse; text-align: left; }
th { padding: 10px 12px; background: #f8f9fc; color: #758095; font-size: 9px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
td { max-width: 260px; padding: 12px; border-top: 1px solid #edf0f5; color: #3d485d; font-size: 11px; vertical-align: top; }
td:first-child { white-space: nowrap; color: #687489; }
.classification-chip { display: inline-flex; padding: 4px 7px; border-radius: 6px; background: #fff3df; color: #965d17; font-size: 10px; font-weight: 700; white-space: nowrap; }
.classification-chip.unclassified { background: #edf1f7; color: #647084; }
.classification-chip.bypass { background: #efeaff; color: #604bc0; }
.signal-text, .ua-text { display: block; overflow: hidden; color: #657186; text-overflow: ellipsis; }
.payment-text { color: #176e47; font-weight: 700; }
.payment-text.muted { color: #798397; font-weight: 500; }

.footer { display: flex; justify-content: space-between; gap: 16px; padding: 18px 3px 32px; color: #8992a2; font-size: 10px; }

@media (max-width: 760px) {
  .topbar { height: 62px; padding: 0 18px; }
  .brand-light { display: none; }
  .page-shell { width: min(100% - 28px, 600px); }
  .intro { padding-top: 35px; }
  .panel { padding: 18px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .owner-test { grid-template-columns: 1fr; gap: 11px; }
  .footer { flex-direction: column; gap: 3px; }
}

@media (max-width: 470px) {
  .input-and-button { flex-direction: column; align-items: stretch; }
  .button { min-height: 42px; }
  .demo-controls { flex-direction: column; }
  .panel-heading { gap: 10px; }
  .small-tag { white-space: nowrap; }
}
