/* Loroute design system. One file of tokens + components shared by chat, studio and console.
   Page-specific layout lives in chat.css and admin.css. No external fonts, icons or scripts (strict CSP, works offline). */

/* ---------- tokens ---------- */
/* Theme-independent tokens. */
:root {
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-full: 999px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --bar-h: 56px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --brand: #ff3333;       /* the red of the "L" in the logo */
  --ring: 0 0 0 3px var(--accent-ring);   /* resolves per theme through --accent-ring */
}

/* Dark palette (default). theme.js sets <html data-theme="dark|light">; dark also applies if the script has not run. */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --logo-url: url("/img/loroute-logo-dark.png");
  --bg: #121212;          --surface: #1e1e24;      --surface-2: #25252c;     --surface-3: #2e2e36;
  --field-bg: #121212;
  --border: #2f2f38;      --border-strong: #43434d; --border-hover: #565662;
  --text: #f4f4f5;        --text-2: #a1a1aa;       --text-3: #85858f;

  --accent: var(--brand);                                   /* borders, rings, active states */
  --accent-btn: #e02b2b;  --accent-btn-hover: #c82525;      /* primary button fill (white text passes AA) */
  --accent-fg: #ffffff;
  --accent-text: #ff5a5a; --accent-text-hover: #ff8080;     /* links and accent-coloured text */
  --accent-soft: rgb(255 51 51 / .13); --accent-line: rgb(255 51 51 / .45); --accent-ring: rgb(255 51 51 / .38);

  --ok: #3fb68b;          --ok-soft: rgb(63 182 139 / .14);   --ok-line: rgb(63 182 139 / .32);
  --warn: #e5a93d;        --warn-soft: rgb(229 169 61 / .14); --warn-line: rgb(229 169 61 / .32);
  --danger: #f07178;      --danger-soft: rgb(240 113 120 / .14); --danger-line: rgb(240 113 120 / .35);
  --danger-fg: #1a0a0b;   --danger-hover: #f48a90;
  --info: #5fa8ff;        --info-soft: rgb(95 168 255 / .14);  --info-line: rgb(95 168 255 / .32);
  --ok-glow: rgb(63 182 139 / .6); --ok-glow-0: rgb(63 182 139 / 0);

  --bar-bg: rgb(18 18 18 / .86);
  --scrim: rgb(5 5 7 / .78);
  --term-bg: #0c0c0e;
  --hover-row: rgb(255 255 255 / .03);
  --meter-fill: #d4d4d8;
  --tag-l: 78%;
  --shadow-card: none;
  --shadow-pop: 0 12px 40px rgb(0 0 0 / .55), 0 0 0 1px var(--border-strong);
  --shadow-composer: 0 6px 24px rgb(0 0 0 / .35);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Light palette. */
:root[data-theme="light"] {
  color-scheme: light;
  --logo-url: url("/img/loroute-logo-light.png");
  --bg: #f8fafc;          --surface: #ffffff;      --surface-2: #f1f5f9;     --surface-3: #e2e8f0;
  --field-bg: #ffffff;
  --border: #e2e8f0;      --border-strong: #cbd5e1; --border-hover: #94a3b8;
  --text: #09090b;        --text-2: #64748b;       --text-3: #6b7a8f;

  --accent: var(--brand);
  --accent-btn: #e02b2b;  --accent-btn-hover: #c82525;
  --accent-fg: #ffffff;
  --accent-text: #d11a1a; --accent-text-hover: #a81212;
  --accent-soft: rgb(255 51 51 / .09); --accent-line: rgb(224 43 43 / .5); --accent-ring: rgb(255 51 51 / .30);

  --ok: #15803d;          --ok-soft: rgb(21 128 61 / .10);    --ok-line: rgb(21 128 61 / .30);
  --warn: #b45309;        --warn-soft: rgb(180 83 9 / .10);   --warn-line: rgb(180 83 9 / .30);
  --danger: #b91c1c;      --danger-soft: rgb(185 28 28 / .08); --danger-line: rgb(185 28 28 / .30);
  --danger-fg: #ffffff;   --danger-hover: #991b1b;
  --info: #1d4ed8;        --info-soft: rgb(29 78 216 / .08);   --info-line: rgb(29 78 216 / .28);
  --ok-glow: rgb(21 128 61 / .45); --ok-glow-0: rgb(21 128 61 / 0);

  --bar-bg: rgb(248 250 252 / .86);
  --scrim: rgb(15 23 42 / .42);
  --term-bg: #f1f5f9;
  --hover-row: rgb(15 23 42 / .035);
  --meter-fill: #3f3f46;
  --tag-l: 30%;
  --shadow-card: 0 1px 2px rgb(15 23 42 / .06), 0 1px 3px rgb(15 23 42 / .05);
  --shadow-pop: 0 12px 32px rgb(15 23 42 / .16), 0 0 0 1px var(--border-strong);
  --shadow-composer: 0 6px 24px rgb(15 23 42 / .10);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: 22px; } h2 { font-size: 16px; margin: var(--s-8) 0 var(--s-3); } h3 { font-size: 14px; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; } a:hover { color: var(--accent-text-hover); text-decoration: underline; }
code, kbd, .mono { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 1px 6px; word-break: break-all; }
::selection { background: var(--accent-ring); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.dim { color: var(--text-3); } .muted { color: var(--text-2); }
.grow { flex: 1 1 auto; } .n { text-align: right; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: var(--s-3); }
.inline { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------- top bar and navigation ---------- */
.bar {
  position: sticky; top: 0; z-index: 20; min-height: var(--bar-h); display: flex; align-items: center; gap: var(--s-4);
  padding: 0 var(--s-6); background: var(--bar-bg); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; letter-spacing: -.01em; color: var(--text); }
.logo:hover { color: var(--text); text-decoration: none; }
.logo::before {                                   /* brand mark: red-L logo, swaps with the theme via --logo-url */
  content: ""; flex: none; width: 28px; height: 28px;
  background: var(--logo-url) center / contain no-repeat;
}
.tabs { display: flex; gap: 2px; align-self: stretch; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; padding: 0 var(--s-3);
  color: var(--text-2); font-weight: 500; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.meta { margin-left: auto; display: flex; align-items: center; gap: var(--s-4); color: var(--text-2); font-size: 13px; }
.meta b { color: var(--text); font-weight: 600; }

main { max-width: 1180px; margin: 0 auto; padding: var(--s-8) var(--s-6) 80px; }
.view { display: none; animation: rise .25s var(--ease); } .view.on { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ph { margin-bottom: var(--s-6); } .ph p { color: var(--text-2); margin-top: 6px; max-width: 70ch; }

/* ---------- surfaces ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-4); }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-4); min-width: 0; box-shadow: var(--shadow-card); }
.box.hot { background: linear-gradient(180deg, var(--accent-soft), transparent 80%), var(--surface); border-color: var(--accent-line); }
.box h3 { margin-bottom: var(--s-3); }
.k { color: var(--text-3); font-size: 12px; font-weight: 500; }
.v { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; margin: 2px 0; }
.v.state { font-size: 24px; text-transform: capitalize; }
.model span:last-child { white-space: nowrap; }
.model { display: flex; justify-content: space-between; gap: var(--s-3); padding: 3px 0; font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; }
.hint { font-size: 12.5px; color: var(--text-3); margin-top: var(--s-2); max-width: 80ch; }
.empty { padding: var(--s-8) var(--s-4); text-align: center; color: var(--text-3); }

/* ---------- buttons ---------- */
.btn {
  --_bg: var(--surface-2); --_fg: var(--text); --_bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  font: 500 13.5px/1 var(--font-ui); color: var(--_fg); background: var(--_bg); border: 1px solid var(--_bd); border-radius: var(--r-sm);
  cursor: pointer; white-space: nowrap; user-select: none; position: relative;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s;
}
.btn:hover { --_bg: var(--surface-3); text-decoration: none; color: var(--_fg); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { --_bg: var(--accent-btn); --_fg: var(--accent-fg); --_bd: transparent; font-weight: 600; }
.btn.primary:hover { --_bg: var(--accent-btn-hover); }
.btn.ghost { --_bg: transparent; --_bd: transparent; --_fg: var(--text-2); }
.btn.ghost:hover { --_bg: var(--surface-2); --_fg: var(--text); }
.btn.danger { --_fg: var(--danger); } .btn.danger:hover { --_bg: var(--danger-soft); --_bd: var(--danger-line); }
.btn.primary.danger { --_bg: var(--danger); --_fg: var(--danger-fg); --_bd: transparent; } .btn.primary.danger:hover { --_bg: var(--danger-hover); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 36px; padding: 0; } .btn.sm.icon { width: 30px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn[aria-busy="true"] { pointer-events: none; color: transparent !important; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--text-2); border-top-color: transparent;
  animation: spin .7s linear infinite;
}
.btn.primary[aria-busy="true"]::after { border-color: var(--accent-fg); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .7s linear infinite; vertical-align: -2px; }

/* ---------- forms ---------- */
label { display: block; min-width: 0; }
label > span, .lbl { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; height: 36px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--text);
  background: var(--field-bg); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: var(--border-hover); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px var(--danger-line); }
select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background: var(--field-bg) var(--select-arrow) no-repeat right 11px center;
}
input[type=checkbox] { appearance: none; width: 16px; height: 16px; padding: 0; border-radius: 4px; display: inline-grid; place-content: center; vertical-align: -3px; margin-right: 8px; cursor: pointer; }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { content: ""; width: 8px; height: 4px; border: solid var(--accent-fg); border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); }
.row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; margin-bottom: var(--s-3); }
.row > label { flex: 1 1 220px; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; min-height: 0; }
.field-error:empty { display: none; }
.pw { position: relative; } .pw input { padding-right: 40px; }
.pw .btn { position: absolute; right: 3px; top: 3px; height: 30px; width: 30px; }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; margin-bottom: var(--s-3); }
.toolbar > label:not(.grow) { width: 190px; } .toolbar .chk { width: auto; padding-bottom: 8px; }

/* ---------- badges, status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 500; white-space: nowrap; color: var(--text-2); background: var(--surface-3); border: 1px solid var(--border);
}
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.badge.bad { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.badge.info { color: var(--info); background: var(--info-soft); border-color: var(--info-line); }
.badge.accent { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }
.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.led.ok { background: var(--ok); box-shadow: 0 0 0 0 var(--ok-glow); animation: pulse 2.4s ease-out infinite; }
.led.warn { background: var(--warn); } .led.bad { background: var(--danger); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px var(--ok-glow-0); } 100% { box-shadow: 0 0 0 0 var(--ok-glow-0); } }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: var(--r-full); background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
/* Category tags get a stable colour from their name (class h0-h11 chosen in app.js). */
.tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-sm); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  --h: 230; color: hsl(var(--h) 85% var(--tag-l)); background: hsl(var(--h) 70% 60% / .14); border: 1px solid hsl(var(--h) 70% 60% / .3); }
.tag.h0 { --h: 0; } .tag.h1 { --h: 30; } .tag.h2 { --h: 55; } .tag.h3 { --h: 90; } .tag.h4 { --h: 140; } .tag.h5 { --h: 170; }
.tag.h6 { --h: 195; } .tag.h7 { --h: 215; } .tag.h8 { --h: 250; } .tag.h9 { --h: 275; } .tag.h10 { --h: 305; } .tag.h11 { --h: 335; }

.meter { display: inline-block; width: 100%; height: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; vertical-align: middle; }
.meter > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--meter-fill); transition: width .4s var(--ease), background .2s; }
.meter.hot > i { background: var(--danger); }

/* ---------- tables ---------- */
.wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); max-height: 70vh; box-shadow: var(--shadow-card); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 10px 14px; background: var(--surface-2); color: var(--text-3); font-size: 12px; font-weight: 500; white-space: nowrap; border-bottom: 1px solid var(--border); }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; } tbody tr:hover { background: var(--hover-row); }
td.bad { color: var(--danger); }
th.n { text-align: right; }
td select { width: auto; height: 28px; padding: 0 28px 0 8px; font-size: 12.5px; }
td .meter { width: 110px; margin-right: 10px; }

/* ---------- banners, toasts, skeleton ---------- */
.banner { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--info-soft); border: 1px solid var(--info-line); margin-bottom: var(--s-4); }
.banner.warn { background: var(--warn-soft); border-color: var(--warn-line); }
.banner.bad { background: var(--danger-soft); border-color: var(--danger-line); }
.banner.ok { background: var(--ok-soft); border-color: var(--ok-line); }
.banner > .i { margin-top: 2px; } .banner .body { flex: 1; min-width: 0; }
.conn { position: sticky; top: var(--bar-h); z-index: 19; text-align: center; padding: 7px var(--s-4); font-size: 13px; background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn-line); }
.toasts { position: fixed; right: var(--s-4); bottom: var(--s-4); z-index: 100; display: flex; flex-direction: column; gap: var(--s-2); max-width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r-md); font-size: 13.5px;
  background: var(--surface-3); box-shadow: var(--shadow-pop); border-left: 3px solid var(--info); animation: toast-in .22s var(--ease);
}
.toast.ok { border-left-color: var(--ok); } .toast.bad { border-left-color: var(--danger); } .toast.warn { border-left-color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.skel { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; min-height: 14px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- dialogs, popover menu ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--s-4); background: var(--scrim); backdrop-filter: blur(8px); }
.card, dialog.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: var(--s-6); width: min(400px, 100%); color: var(--text); }
.card { display: flex; flex-direction: column; gap: var(--s-3); animation: rise .25s var(--ease); }
.card h1 { font-size: 20px; } .card p { color: var(--text-2); margin-bottom: var(--s-2); }
.err { color: var(--danger); font-size: 13px; min-height: 0; } .err:empty { display: none; }
dialog.modal { padding: var(--s-6); margin: auto; animation: rise .2s var(--ease); }
dialog.modal::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
dialog.modal h2 { margin: 0 0 var(--s-2); font-size: 17px; } dialog.modal p { color: var(--text-2); }
dialog.modal .actions { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-5); }
dialog.modal form { display: block; }
.menu { position: fixed; z-index: 90; min-width: 190px; padding: 5px; background: var(--surface-2); border-radius: var(--r-md); box-shadow: var(--shadow-pop); animation: rise .12s var(--ease); }
.menu button {
  all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; color: var(--text);
}
.menu button:hover, .menu button:focus-visible { background: var(--surface-3); outline: none; }
.menu button.danger { color: var(--danger); } .menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* ---------- console log terminal ---------- */
.term { height: 460px; overflow: auto; padding: var(--s-2) 0; font: 12px/1.65 var(--font-mono); background: var(--term-bg); border: 1px solid var(--border); border-radius: var(--r-md); }
.term .ln { display: grid; grid-template-columns: 96px 54px 90px 1fr; gap: 10px; padding: 0 var(--s-3); border-left: 2px solid transparent; }
.term .ln:hover { background: var(--hover-row); }
.term .t { color: var(--text-3); } .term .s { color: var(--text-2); } .term .m { overflow-wrap: anywhere; white-space: pre-wrap; }
.term .lv { font-weight: 600; color: var(--info); }
.term .ln.warn { border-left-color: var(--warn); } .term .ln.warn .lv { color: var(--warn); }
.term .ln.error { border-left-color: var(--danger); background: var(--danger-soft); } .term .ln.error .lv { color: var(--danger); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .bar { padding: 8px var(--s-4); flex-wrap: wrap; row-gap: 0; }
  .tabs { order: 3; width: 100%; margin: 0 calc(var(--s-1) * -1); }
  .tab { height: 40px; }
  .meta { gap: var(--s-3); }
  main { padding: var(--s-5) var(--s-4) 64px; }
  .term .ln { grid-template-columns: 1fr; gap: 0; padding: 4px var(--s-3); } .term .t, .term .s { display: inline; }
  .toasts { left: var(--s-4); right: var(--s-4); max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
