/* Relying-party ("motorsports.com") styling — hand-rolled, self-contained. */

:root {
  --bg: #0b0d10;
  --panel: #14181d;
  --panel-2: #1c222a;
  --ink: #eef2f6;
  --muted: #9aa6b2;
  --line: #2a323c;
  --accent: #e10600; /* motorsport red */
  --accent-2: #ff2b25;
  --ok: #37d67a;
  --err: #ff5c5c;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.hero {
  padding: 28px 24px 20px;
  background: linear-gradient(120deg, #17191d, #0b0d10 60%),
    repeating-linear-gradient(
      45deg,
      transparent 0 18px,
      rgba(225, 6, 0, 0.05) 18px 36px
    );
  border-bottom: 2px solid var(--accent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chequered {
  width: 26px;
  height: 26px;
  background-image: linear-gradient(45deg, #fff 25%, transparent 25%),
    linear-gradient(-45deg, #fff 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #fff 75%),
    linear-gradient(-45deg, transparent 75%, #fff 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  background-color: #111;
  border-radius: 4px;
}
.brand-name {
  font-weight: 900;
  font-size: 24px;
  letter-spacing: 0.04em;
}
.brand-name .dot {
  color: var(--accent);
}
.tagline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 20px 24px;
  max-width: 1080px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.panel.wide {
  grid-column: 1 / -1;
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}
.hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
button {
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
button:hover {
  border-color: #3a4450;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
button.primary:hover {
  background: var(--accent-2);
}

.status {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  min-height: 1em;
}
.status.ok {
  color: var(--ok);
}
.status.err {
  color: var(--err);
}

.result pre {
  margin: 10px 0 0;
  padding: 10px;
  background: #0c0f13;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-all;
  color: #c9d4df;
}

/* Policy editor */
.policy fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
}
.policy legend {
  color: var(--muted);
  font-size: 12px;
  padding: 0 6px;
}
.checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.chk {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink);
}
.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}
.range-fields,
.policy label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: var(--muted);
  gap: 3px;
}
.range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.policy input,
.policy select {
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
}

/* Timing table */
.timings {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.timings th,
.timings td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}
.timings th {
  color: var(--muted);
  font-weight: 600;
}
.timings td {
  font-family: var(--mono);
}

.reserved details {
  color: var(--muted);
}
.reserved summary {
  cursor: pointer;
  font-size: 14px;
}

@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Predicate rows (policy editor) */
.pred-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.pred-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pred-row select, .pred-row input { padding: 4px 6px; }
.pred-row .p-bound-const { width: 7em; }
.pred-row .p-k { width: 4em; }
.pred-row .p-k-label { display: flex; align-items: center; gap: 4px; font-size: 0.85em; }
.pred-row .p-del { padding: 2px 8px; }
