/* Design tokens. Change the look here: the page uses only these. */
:root {
  --background: #ffffff;
  --foreground: #1a1c23;
  --card: #f6f7f9;
  --primary: #3451c7;
  --primary-foreground: #ffffff;
  --muted-foreground: #5b6070;
  --border: #d7dae2;
  --success: #17703f;
  --danger: #b3261e;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-2xl: 1.75rem;
  --space-2: 0.5rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --radius: 0.5rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #14161c;
    --foreground: #eceef3;
    --card: #1e212a;
    --primary: #8ea2ff;
    --primary-foreground: #14161c;
    --muted-foreground: #a3a8b8;
    --border: #353a47;
    --success: #6fd49c;
    --danger: #ff8f86;
  }
}

body { margin: 0; font: var(--text-base) / 1.5 system-ui, sans-serif; }
h1, h2, h3, p { margin: 0; }
input, button, select { font: inherit; border-radius: var(--radius); max-width: 100%; }
button { border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }

.bg-background { background: var(--background); }
.bg-card { background: var(--card); }
.bg-primary { background: var(--primary); }
.text-foreground { color: var(--foreground); }
.text-primary { color: var(--primary); }
.text-primary-foreground { color: var(--primary-foreground); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.border { border: 1px solid; }
.border-b { border-bottom: 1px solid; }
.border-t { border-top: 1px solid; }
.border-border { border-color: var(--border); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); font-weight: 600; }
.text-2xl { font-size: var(--text-2xl); font-weight: 700; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.stack { display: grid; gap: var(--space-2); min-width: 0; }
.card { border-radius: var(--radius); }

.tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.tabs [role="tab"] { background: none; color: var(--muted-foreground); padding: var(--space-2); }
.tabs [aria-selected="true"] { color: var(--primary); box-shadow: inset 0 -2px var(--primary); }
table { border-collapse: collapse; width: 100%; }
caption { text-align: start; padding-bottom: var(--space-2); }
th, td { text-align: start; padding: var(--space-2); border-bottom: 1px solid var(--border); }
tfoot { font-weight: 600; }

.cols { display: grid; gap: var(--space-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.btn { background: var(--background); color: var(--foreground); border: 1px solid var(--border); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.list { list-style: none; margin: 0; padding: 0; }
.steps { margin: 0; padding-inline-start: var(--space-6); }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); margin: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0 var(--space-2); margin: 0; font-size: var(--text-sm); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
.ring { width: 2.75rem; height: 2.75rem; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .track { stroke: var(--border); }
.ring .fill { stroke: var(--primary); stroke-linecap: round; }
.row { display: flex; align-items: center; gap: var(--space-2); }
.receipt { border-bottom: 1px solid var(--border); padding: var(--space-2) 0; font-size: var(--text-sm); overflow-wrap: anywhere; }
.receipt-denied { border-inline-start: 4px dashed var(--danger); padding-inline-start: var(--space-2); }
.receipt-event { border-inline-start: 4px dotted var(--border); padding-inline-start: var(--space-2); }
.receipt-allowed { border-inline-start: 4px solid var(--success); padding-inline-start: var(--space-2); }
.diagram { width: 100%; max-width: 26rem; height: auto; color: var(--foreground); }
@media (prefers-reduced-motion: no-preference) {
  .ring .fill { transition: stroke-dashoffset 0.4s linear; }
}

#export-out { width: 100%; box-sizing: border-box; font-family: ui-monospace, monospace; font-size: var(--text-sm); }

button:disabled { opacity: 0.5; cursor: default; }
.sprite { position: absolute; width: 0; height: 0; }
.logo { width: 1.25rem; height: 1.25rem; flex: none; }
.chat { height: 26rem; overflow: auto; padding: var(--space-2); display: flex; flex-direction: column; gap: var(--space-2); border-radius: var(--radius); }
.msg { display: flex; gap: var(--space-2); align-items: flex-start; }
.msg-you { flex-direction: row-reverse; }
.msg-sys { justify-content: center; }
.avatar { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; font-size: var(--text-sm); font-weight: 700; background: var(--primary); color: var(--primary-foreground); }
.bubble { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-2); display: grid; gap: var(--space-2); min-width: 0; max-width: min(100%, 30rem); overflow-wrap: anywhere; }
.msg-you .bubble { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.meta { color: var(--muted-foreground); }
.msg-you .meta { color: inherit; }
.notice { display: flex; gap: var(--space-2); align-items: center; border: 1px dashed var(--border); border-radius: var(--radius); padding: var(--space-2); color: var(--muted-foreground); overflow-wrap: anywhere; min-width: 0; }
.json { margin: 0; max-height: 14rem; overflow: auto; font: var(--text-sm) / 1.4 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: var(--radius); }
.feed { max-height: 24rem; overflow: auto; }
.receipt .row { flex-wrap: wrap; }
.st { color: var(--foreground); opacity: 0.2; }
.st.on { opacity: 1; }
.st.now { color: var(--primary); }
@keyframes pop { from { opacity: 0; transform: translateY(0.5rem); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: no-preference) {
  .msg, .receipt.fresh { animation: pop 0.3s ease-out; }
  .typing { animation: blink 1s infinite; }
  .st { transition: opacity 0.4s; }
}
