/* 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: #1b6e37;
  --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: #6fd48d;
    --danger: #ff9188;
  }
}

body { margin: 0; font: var(--text-base) / 1.5 system-ui, sans-serif; }
h1, h2, p { margin: 0; }
input, button { font: inherit; border-radius: var(--radius); }
button { border: 0; cursor: pointer; }
button.border { border: 1px solid var(--border); }
input[type="text"], input:not([type]), input[type="number"] { border: 1px solid var(--border); }
fieldset { border: 0; margin: 0; padding: 0; }
legend { padding: 0; margin-bottom: var(--space-2); }
:focus-visible { outline: 3px 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); font-weight: 600; }
.text-danger { color: var(--danger); font-weight: 600; }
.font-bold { font-weight: 600; }
.border { border: 1px solid; }
.border-b { border-bottom: 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); max-width: 40rem; }
.wide { max-width: 64rem; }
.wide > * { min-width: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.scroll { overflow-x: auto; }
.diagram { width: 100%; height: auto; max-width: 44rem; color: var(--foreground); }
.card { border-radius: var(--radius); }
ol, ul { margin: 0; padding-inline-start: var(--space-6); }
li + li { margin-top: var(--space-2); }

.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; }
.scroll th, .scroll td { min-width: 6rem; }

svg.logo { width: 1.25rem; height: 1.25rem; fill: currentColor; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 2rem; height: 2rem; border: 1px solid var(--border); border-radius: 50%; background: var(--background); font-size: var(--text-sm); vertical-align: middle; }
.cols { display: grid; gap: var(--space-4); }
.cols > * { min-width: 0; align-content: start; }
@media (min-width: 48rem) { .cols { grid-template-columns: 1fr 1fr; } }
.chat { display: grid; gap: var(--space-2); align-content: start; min-height: 12rem; max-height: 22rem; overflow-y: auto; }
.msg { display: flex; gap: var(--space-2); align-items: flex-start; }
.msg-body { min-width: 0; }
.bubble { background: var(--background); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-2); overflow-wrap: anywhere; }
.notice { border: 1px dashed var(--border); border-radius: var(--radius); padding: var(--space-2); color: var(--muted-foreground); text-align: center; }
.dots span { display: inline-block; width: 0.4rem; height: 0.4rem; margin-inline-end: 0.2rem; border-radius: 50%; background: var(--muted-foreground); animation: blink 1s infinite; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 50% { opacity: 0.2; } }
.code { margin: 0; padding: var(--space-2); max-height: 22rem; overflow: auto; background: var(--background); border: 1px solid var(--border); border-radius: var(--radius); font: var(--text-sm) / 1.4 ui-monospace, monospace; }
.node { fill: var(--card); stroke: currentColor; stroke-width: 2; transition: stroke 0.3s; }
.node.on { stroke: var(--primary); stroke-width: 4; }
.node.trust { stroke: var(--danger); stroke-width: 4; }
.node.drop { stroke: var(--success); stroke-width: 4; }
.node.dim { opacity: 0.4; }
.arrow { stroke: currentColor; stroke-width: 2; fill: none; opacity: 0.35; }
.arrow.on { stroke: var(--primary); opacity: 1; stroke-dasharray: 7 5; animation: flow 0.8s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -12; } }
footer { margin-top: var(--space-6); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
