/* SLM Router — dark, Second Life–inspired palette: viewer charcoal, SL blue, teal, a little matrix green. */
:root {
  --bg: #07090c;
  --bg-2: #0b0e13;
  --surface: #0f141a;
  --surface-2: #151b23;
  --surface-3: #1c242e;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #e7edf3;
  --text-2: #b4c0cc;
  --muted: #7d8a97;
  --blue: #3a8ee6;          /* SL viewer highlight blue */
  --blue-2: #5aa6f5;
  --teal: #22d3c5;
  --green: #5dffb4;          /* matrix accent, used sparingly */
  --good: #3fd68f;
  --warn: #f2b84b;
  --bad: #ff6b6b;
  --glow: 0 0 0 1px rgba(34, 211, 197, .25), 0 0 32px rgba(34, 211, 197, .12);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--font);
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font); letter-spacing: -.005em;
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(58, 142, 230, .13), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(34, 211, 197, .08), transparent 60%);
  background-attachment: fixed;
}
a { color: var(--blue-2); text-decoration: none; }
a:hover { color: var(--teal); }
::selection { background: rgba(34, 211, 197, .3); }
code, pre, .mono { font-family: var(--mono); font-size: .88em; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px) saturate(140%);
  background: rgba(7, 9, 12, .72); border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 600 17px/1 var(--display); letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; filter: drop-shadow(0 0 10px rgba(34, 211, 197, .35)); }
.brand b { font-weight: 700; }
.brand span { color: var(--muted); font-weight: 500; }
.brand:hover { color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a, .nav-links button.linklike {
  color: var(--text-2); padding: 8px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
}
.nav-links a:hover, .nav-links button.linklike:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-links form { margin: 0; }
@media (max-width: 720px) {
  .nav .wrap { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 8px; }
  .nav-links { margin-left: 0; width: 100%; overflow-x: auto; }
  .nav-links a { padding: 6px 10px; white-space: nowrap; }
}

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: 600 14px/1 var(--font); cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.btn:hover { border-color: rgba(34, 211, 197, .5); color: var(--text); background: var(--surface-3); }
.btn-primary {
  border: 0; color: #03141a;
  background: linear-gradient(135deg, var(--teal), var(--blue) 120%);
  box-shadow: 0 6px 24px -6px rgba(34, 211, 197, .55), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { color: #03141a; filter: brightness(1.08); box-shadow: 0 8px 30px -6px rgba(34, 211, 197, .7); }
.btn-danger { border-color: rgba(255, 107, 107, .4); color: var(--bad); background: rgba(255, 107, 107, .06); }
.btn-danger:hover { border-color: var(--bad); color: #fff; background: rgba(255, 107, 107, .2); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-google { background: #fff; color: #1f1f1f; border: 0; }
.btn-google:hover { background: #f0f3f5; color: #1f1f1f; }
button.linklike { background: none; border: 0; cursor: pointer; font: inherit; }

label { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; margin: 14px 0 6px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 14px/1.5 var(--font); resize: vertical; }
textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(34, 211, 197, .18); }
input[type=text], input[type=password], input[type=email], input[type=number], input:not([type]), select {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font: 14px var(--font); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(34, 211, 197, .18); }
input.code-input { font: 600 22px var(--mono); letter-spacing: .18em; text-transform: uppercase; text-align: center; height: 56px; }

.alert { border-radius: 10px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert::before { font-weight: 700; }
.alert-error { background: rgba(255, 107, 107, .08); border: 1px solid rgba(255, 107, 107, .35); color: #ffb3b3; }
.alert-error::before { content: "!"; }
.alert-ok { background: rgba(63, 214, 143, .08); border: 1px solid rgba(63, 214, 143, .35); color: #a8f0cc; }
.alert-ok::before { content: "✓"; }

/* ---------- cards & panels ---------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, 0)), var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
}
.card-title { font: 600 15px var(--display); margin: 0 0 4px; letter-spacing: -.01em; }
.card-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; text-transform: uppercase; letter-spacing: .1em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-active { color: var(--good); border-color: rgba(63, 214, 143, .35); background: rgba(63, 214, 143, .07); }
.pill-disabled { color: var(--warn); border-color: rgba(242, 184, 75, .35); background: rgba(242, 184, 75, .07); }
.pill-deleted { color: var(--muted); }
.tag { display: inline-block; font: 500 12px var(--mono); padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }

/* ---------- auth pages ---------- */
.auth-shell { min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 48px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font: 700 26px/1.2 var(--display); letter-spacing: -.03em; margin: 0 0 6px; }
.auth-card .lede { color: var(--muted); margin: 0 0 22px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 14px; margin-top: 18px; }
.auth-logo { display: block; width: 56px; margin: 0 auto 18px; filter: drop-shadow(0 0 16px rgba(34, 211, 197, .45)); }

.device-chip { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; padding: 14px 16px; border-radius: 12px;
  background: var(--bg-2); border: 1px dashed rgba(34, 211, 197, .3); margin-bottom: 20px; font-size: 13.5px; }
.device-chip dt { color: var(--muted); }
.device-chip dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: 11px;
  border: 1px solid var(--line); margin-bottom: 4px; }
.tabs label { margin: 0; text-align: center; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.tab-radio { position: absolute; opacity: 0; pointer-events: none; }
#tab-login:checked ~ .tabs label[for=tab-login], #tab-signup:checked ~ .tabs label[for=tab-signup] { background: var(--surface-3); color: var(--text); }
.tab-panel { display: none; }
#tab-login:checked ~ .panel-login, #tab-signup:checked ~ .panel-signup { display: block; }

/* ---------- landing ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5;
  mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 20%, transparent 75%); }
.hero-grid { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: linear-gradient(180deg, #000, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-top: 84px; padding-bottom: 96px; }
@media (max-width: 920px) { .hero .wrap { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 56px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 500 12.5px var(--mono); color: var(--teal);
  padding: 6px 12px; border-radius: 99px; border: 1px solid rgba(34, 211, 197, .3); background: rgba(34, 211, 197, .06); }
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.hero h1 { font: 700 clamp(38px, 6vw, 66px)/1.02 var(--display); letter-spacing: -.045em; margin: 22px 0 18px; }
.grad { background: linear-gradient(100deg, var(--green), var(--teal) 40%, var(--blue-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lede { font-size: clamp(16px, 1.6vw, 19px); color: var(--text-2); max-width: 560px; margin: 0 0 30px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-ctas .btn { height: 48px; padding: 0 22px; font-size: 15px; }
.hero-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 30px; color: var(--muted); font-size: 13px; }
.hero-meta b { color: var(--text); font: 600 14px var(--mono); margin-right: 4px; }

.hero-visual { position: relative; }
.hero-dragon { position: absolute; width: 240px; right: -30px; top: -90px; opacity: .9; filter: drop-shadow(0 0 40px rgba(34, 211, 197, .35)); z-index: 0; }
@media (max-width: 920px) { .hero-dragon { width: 150px; top: -60px; right: -10px; } }
.terminal { position: relative; z-index: 1; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(11, 14, 19, .88);
  backdrop-filter: blur(10px); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), var(--glow); overflow: hidden; }
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-3); }
.terminal-bar span { margin-left: 8px; }
.terminal pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 12.5px; line-height: 1.75; color: var(--text-2); }
.k { color: var(--blue-2); } .s { color: var(--green); } .c { color: #5b6773; } .n { color: #f2b84b; } .f { color: var(--teal); }
.chat-lines { border-top: 1px solid var(--line); padding: 14px 18px 18px; font-size: 13.5px; display: grid; gap: 10px; }
.bubble { max-width: 88%; padding: 9px 13px; border-radius: 12px; }
.bubble.you { justify-self: end; background: var(--surface-3); border-bottom-right-radius: 4px; }
.bubble.bot { background: rgba(34, 211, 197, .1); border: 1px solid rgba(34, 211, 197, .25); border-bottom-left-radius: 4px; }
.bubble small { display: block; font: 11px var(--mono); color: var(--muted); margin-bottom: 2px; }
.typing::after { content: "▋"; color: var(--teal); animation: pulse 1s infinite; margin-left: 2px; }

.section { padding: 88px 0; border-bottom: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head .kicker { font: 500 12.5px var(--mono); color: var(--teal); text-transform: uppercase; letter-spacing: .14em; }
.section-head h2 { font: 700 clamp(28px, 4vw, 40px)/1.1 var(--display); letter-spacing: -.035em; margin: 10px 0 12px; }
.section-head p { color: var(--text-2); margin: 0; font-size: 16.5px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 920px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .features { grid-template-columns: 1fr; } }
.feature { position: relative; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); transition: border-color .2s, transform .2s; overflow: hidden; }
.feature:hover { border-color: rgba(34, 211, 197, .35); transform: translateY(-2px); }
.feature::after { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 120px at 0 0, rgba(34, 211, 197, .07), transparent); pointer-events: none; }
.feature .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(34, 211, 197, .18), rgba(58, 142, 230, .18)); border: 1px solid rgba(34, 211, 197, .3); color: var(--teal); }
.feature .ico svg { width: 20px; height: 20px; }
.feature h3 { font: 600 17px var(--display); margin: 0 0 6px; letter-spacing: -.015em; }
.feature p { margin: 0; color: var(--text-2); font-size: 14.5px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
@media (max-width: 920px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); position: relative; }
.step::before { counter-increment: step; content: "0" counter(step); font: 600 13px var(--mono); color: var(--teal);
  display: inline-block; padding: 4px 10px; border-radius: 6px; background: rgba(34, 211, 197, .08); border: 1px solid rgba(34, 211, 197, .25); margin-bottom: 14px; }
.step h3 { font: 600 18px var(--display); margin: 0 0 6px; }
.step p { margin: 0; color: var(--text-2); font-size: 14.5px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 920px) { .split { grid-template-columns: 1fr; } }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.checklist li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; color: var(--text-2); }
.checklist li::before { content: ""; width: 22px; height: 22px; border-radius: 6px; margin-top: 1px;
  background: rgba(63, 214, 143, .12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235dffb4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/14px no-repeat;
  border: 1px solid rgba(63, 214, 143, .3); }
.checklist b { color: var(--text); font-weight: 600; }

.cta-band { padding: 96px 0; text-align: center; position: relative; overflow: hidden; }
.cta-band::before { content: ""; position: absolute; left: 50%; top: 50%; width: 720px; height: 360px; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(34, 211, 197, .16), transparent); pointer-events: none; }
.cta-band h2 { position: relative; font: 700 clamp(30px, 4.5vw, 46px)/1.1 var(--display); letter-spacing: -.04em; margin: 0 0 14px; }
.cta-band p { position: relative; color: var(--text-2); margin: 0 0 28px; font-size: 17px; }

.footer { padding: 34px 0 48px; color: var(--muted); font-size: 13px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer .brand img { width: 24px; height: 24px; }
.footer .brand { font-size: 14px; }

/* ---------- app pages ---------- */
.page { padding: 36px 0 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font: 700 30px/1.15 var(--display); letter-spacing: -.035em; margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.crumb { font: 500 13px var(--mono); color: var(--muted); margin-bottom: 8px; display: inline-block; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 920px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--teal), transparent); opacity: .7; }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat .value { font: 600 28px/1.2 var(--display); letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 920px) { .grid-2, .grid-main { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 18px; }

/* chart */
.chart { position: relative; height: 200px; display: flex; align-items: flex-end; gap: 2px; padding-top: 8px;
  border-bottom: 1px solid var(--line-2); }
.chart .gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.chart .gridline span { position: absolute; right: 0; top: -16px; font: 11px var(--mono); color: var(--muted); }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; }
.bar i { display: block; width: 100%; min-height: 0; border-radius: 4px 4px 0 0; background: var(--teal); opacity: .85; transition: opacity .12s; }
.bar.zero i { background: var(--surface-3); height: 2px !important; border-radius: 1px; }
.bar:hover i, .bar:focus i { opacity: 1; box-shadow: 0 0 14px rgba(34, 211, 197, .5); }
.bar .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; font-size: 12px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .1s; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.bar:hover .tip, .bar:focus .tip { opacity: 1; }
.bar .tip b { display: block; font: 600 13px var(--mono); color: var(--text); }
.bar .tip span { color: var(--muted); }
.chart-axis { display: flex; justify-content: space-between; font: 11px var(--mono); color: var(--muted); margin-top: 8px; }
details.table-view { margin-top: 14px; font-size: 13px; }
details.table-view summary { cursor: pointer; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -22px -22px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 22px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 22px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }
.devname { font-weight: 600; color: var(--text); }
.devname small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.meter { width: 90px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: inline-block; vertical-align: middle; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--blue)); border-radius: 99px; }
.meter.hot i { background: linear-gradient(90deg, var(--warn), var(--bad)); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty img { width: 56px; opacity: .6; margin-bottom: 10px; }
.empty h3 { color: var(--text); font: 600 17px var(--display); margin: 0 0 6px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.danger { border-color: rgba(255, 107, 107, .25); }
.danger .card-title { color: #ffb3b3; }

.form-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.price { font: 12px var(--mono); color: var(--muted); }

/* docs */
.prose { max-width: 780px; }
.prose h2 { font: 700 24px var(--display); letter-spacing: -.03em; margin: 44px 0 10px; }
.prose h3 { font: 600 17px var(--display); margin: 26px 0 8px; }
.prose p, .prose li { color: var(--text-2); }
.prose pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; line-height: 1.7; }
.prose :not(pre) > code { background: var(--surface-3); padding: 2px 6px; border-radius: 5px; color: var(--text); }
.prose table { margin: 14px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: block; overflow-x: auto; }
.prose td, .prose th { padding: 9px 14px; white-space: normal; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* grid children must be allowed to shrink so wide tables scroll inside their card */
.stack > *, .grid-2 > *, .grid-main > *, .stats > * { min-width: 0; }

/* dragon perches on the terminal's top-left corner */
.hero-dragon { right: auto; left: -64px; top: -118px; width: 210px; z-index: 2; transform: scaleX(1); }
.hero-visual { margin-top: 70px; }
@media (max-width: 920px) { .hero-dragon { left: auto; right: -6px; top: -92px; width: 140px; } .hero-visual { margin-top: 80px; } }
.hero .wrap > * { min-width: 0; }

/* action allowlist */
.checks { display: grid; gap: 8px; }
label.check { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; margin: 0; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); cursor: pointer; color: var(--text); }
label.check input { margin-top: 3px; accent-color: var(--teal); }
label.check small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; margin-top: 2px; }

/* agent profile */
.agent-head { display: flex; align-items: center; gap: 16px; }
.agent-avatar { width: 56px; height: 56px; padding: 8px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid rgba(34, 211, 197, .3); filter: drop-shadow(0 0 12px rgba(34, 211, 197, .25)); }
.jump { position: sticky; top: 62px; z-index: 10; display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 0; margin: 6px 0 14px;
  background: rgba(7, 9, 12, .85); backdrop-filter: blur(10px); }
.jump a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 13px; font-weight: 500; }
.jump a:hover { border-color: var(--teal); color: var(--text); }
.checks-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .checks-2 { grid-template-columns: 1fr; } .jump { top: 0; } }
section[id], div[id] { scroll-margin-top: 130px; }

/* tabs */
.tabs-bar { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 4px 0 20px; }
.tabs-bar a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-bar a:hover { color: var(--text); }
.tabs-bar a.on { color: var(--text); border-bottom-color: var(--teal); }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-row .card-title { display: flex; align-items: center; margin: 0; }
.reset-form { margin: 0; }

/* linked page: "use my defaults" toggle (pure CSS) */
.ud-toggle { position: absolute; opacity: 0; pointer-events: none; }
.fake-box { width: 16px; height: 16px; margin-top: 3px; border-radius: 4px; border: 1.5px solid var(--line-2); background: var(--bg); }
.ud-toggle:checked + label .fake-box { background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2303141a' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/11px no-repeat; border-color: var(--teal); }
.ud-toggle:focus-visible + label { outline: 2px solid var(--teal); outline-offset: 2px; }
.ud-explain, .ud-custom { display: none; }
.ud-toggle:checked ~ .ud-explain { display: block; }
.ud-toggle:not(:checked) ~ .ud-custom { display: block; }

label.check.locked { opacity: .55; cursor: not-allowed; }

/* agent types */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.type-card { display: block; color: var(--text); transition: border-color .15s, transform .15s; }
a.type-card:hover { border-color: rgba(34, 211, 197, .45); color: var(--text); transform: translateY(-2px); }
.type-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.type-meta span { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.type-new { border-style: dashed; }
.type-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -8px 0 16px; }
.type-picker select { width: auto; min-width: 180px; height: 36px; }

/* pairing stepper */
.step-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 8px; }
.step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--mono);
  background: rgba(34, 211, 197, .12); border: 1px solid rgba(34, 211, 197, .4); color: var(--teal); }
.profiles { display: grid; gap: 8px; }
.pf-radio { position: absolute; opacity: 0; pointer-events: none; }
.fake-radio { width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--bg); }
.pf-radio:checked + label .fake-radio { border: 5px solid var(--teal); }
.pf-radio:checked + label { border-color: rgba(34, 211, 197, .5); }
.pf-radio:focus-visible + label { outline: 2px solid var(--teal); outline-offset: 2px; }
.profiles .ud-custom { display: none; }
.pf-custom:checked ~ .ud-custom { display: block; }

.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -6px 0 18px; }
.filters label { margin: 0; }
.filters select { width: auto; min-width: 170px; height: 36px; }

/* landing: audiences + plans */
.audiences, .plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 920px) { .audiences, .plans { grid-template-columns: 1fr; } }
.audience, .plan { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.audience h3 { font: 600 19px var(--display); margin: 0 0 4px; letter-spacing: -.015em; }
.plan-hot { border-color: rgba(34, 211, 197, .5); box-shadow: 0 0 0 1px rgba(34, 211, 197, .2), 0 10px 40px -20px rgba(34, 211, 197, .5); }
.plan-name { font: 700 20px var(--display); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-price { font: 700 32px var(--display); letter-spacing: -.03em; margin: 10px 0 16px; }
.plan-price s { color: var(--muted); font-size: 20px; font-weight: 500; margin-right: 4px; }
.plan-price small { font: 500 13px var(--font); color: var(--text-2); margin-left: 4px; letter-spacing: 0; }
.plan-after { margin: -8px 0 14px; font-size: 13px; color: var(--teal); }
.plan-solo { max-width: 560px; margin: 0 auto; padding: 30px; }
.plan-next { margin: 18px 0 20px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.plan-next > b { display: block; font: 600 14px var(--display); margin-bottom: 4px; }
.plan-next p { margin: 0; font-size: 14px; color: var(--text-2); }
.section-tight { padding-top: 40px; padding-bottom: 40px; }
.abilities-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 920px) { .abilities-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .abilities-row { grid-template-columns: 1fr; } }
.ability { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.ability .ico { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--teal); background: rgba(34, 211, 197, .08); }
.ability .ico svg { width: 17px; height: 17px; }
.ability b { display: block; font: 600 14.5px var(--display); }
.ability small { color: var(--text-2); font-size: 13px; }
.pill-pending { color: var(--blue-2); border-color: rgba(90, 166, 245, .35); background: rgba(90, 166, 245, .07); }
td.wrap { white-space: normal; min-width: 220px; max-width: 420px; }
.products-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 24px 26px; border-radius: var(--radius); border: 1px dashed rgba(34, 211, 197, .4); background: linear-gradient(120deg, rgba(34, 211, 197, .06), transparent 60%), var(--surface); }
.products-band h3 { font: 600 20px var(--display); margin: 6px 0 4px; }
.products-band p { margin: 0; color: var(--text-2); max-width: 620px; }
.task { padding: 16px 0; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 0; }
.task-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.task-result { margin: 10px 0 6px; white-space: pre-wrap; color: var(--text-2); }
.task-steps { margin: 8px 0 0; padding-left: 20px; font-size: 13px; color: var(--text-2); }
.task-report { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; margin-top: 8px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); max-height: 520px; overflow: auto; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 6px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 14px 16px; margin: 18px 0 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; }
.toc b { width: 100%; font: 600 13px var(--display); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.doc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0 8px; }
@media (max-width: 760px) { .doc-cards { grid-template-columns: 1fr; } }
.doc-card { display: block; padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: inherit; text-decoration: none; transition: border-color .2s, transform .2s; }
.doc-card:hover { border-color: rgba(34, 211, 197, .45); transform: translateY(-2px); }
.doc-card h3 { font: 700 22px var(--display); margin: 6px 0 8px; }
.doc-card p { color: var(--text-2); font-size: 14.5px; margin: 0 0 14px; }
.doc-go { color: var(--teal); font-weight: 600; font-size: 14px; }
.prose h3 { font: 600 18px var(--display); margin: 28px 0 8px; }
.prose td { white-space: normal; vertical-align: top; }
.prose td:first-child { white-space: nowrap; }
.prose td:nth-child(2) { min-width: 200px; }
.prose td code { overflow-wrap: anywhere; }
.prose td:nth-child(4) { min-width: 220px; }
.prose table.ref { display: table; width: 100%; table-layout: fixed; }
.prose table.ref th:nth-child(1) { width: 15%; } .prose table.ref th:nth-child(2) { width: 17%; }
.prose table.ref th:nth-child(3) { width: 42%; } .prose table.ref th:nth-child(4) { width: 26%; }
.prose table.ref td { min-width: 0 !important; white-space: normal !important; }
.prose table.ref small { color: var(--muted); font-size: 12px; }
/* docs: LSL-wiki style reference entries */
.lsl-entry { margin: 30px 0; padding: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; scroll-margin-top: 80px; }
.lsl-entry > *:not(.lsl-sig):not(pre):not(table) { margin-left: 20px; margin-right: 20px; }
.lsl-entry > pre, .lsl-entry > table { margin: 12px 20px; }
.lsl-sig { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px; background: rgba(58, 142, 230, .12); border-bottom: 1px solid rgba(58, 142, 230, .3); margin-bottom: 12px; }
.lsl-sig code { background: none; border: 0; padding: 0; font-size: 14px; color: var(--text); white-space: normal; }
.lsl-sig code b { color: var(--blue-2); }
.lsl-sig code u { text-decoration: none; color: var(--teal); }
.lsl-kind { font: 600 11px var(--display); text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; color: #fff; background: var(--blue); }
.lsl-kind.event { background: #7a5cd6; }
.lsl-num { margin-left: auto; font: 500 12px var(--mono); color: var(--muted); }
.lsl-params { list-style: none; padding: 0; margin-top: 10px; margin-bottom: 10px; }
.lsl-params li { padding: 4px 0; }
.lsl-params .t { display: inline-block; min-width: 56px; font: 500 13px var(--mono); color: var(--green); }
.lsl-entry h4 { font: 600 14px var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 18px; margin-bottom: 6px; }
.lsl-see { color: var(--text-2); font-size: 14px; margin-top: 14px; }
.lsl-entry.compact { margin: 16px 0; }
.lsl-entry > table { display: table; width: calc(100% - 40px); table-layout: fixed; }
.lsl-entry td, .lsl-entry th { min-width: 0 !important; white-space: normal !important; overflow-wrap: break-word; }
.lsl-entry td code { overflow-wrap: anywhere; }
.lsl-entry th:nth-child(1) { width: 24%; }
.lsl-entry th:nth-child(2) { width: 13%; }
.lsl-entry table.four th:nth-child(1) { width: 21%; } .lsl-entry table.four th:nth-child(3) { width: 19%; }
.lsl-entry table.errors th:nth-child(1) { width: 32%; } .lsl-entry table.errors th:nth-child(2) { width: 38%; }
.lsl-sig code { flex: 1 1 380px; }
.lsl-kind.action { background: #1e9e8f; }
.lsl-kind.http { background: #c2762a; }
.prose table.ref.two th:nth-child(1) { width: 14%; } .prose table.ref.two th:nth-child(2), .prose table.ref.two th:nth-child(3) { width: 43%; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 26px; }
.subtabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; text-decoration: none; }
.subtabs a:hover { border-color: var(--line-2); color: var(--text); }
.subtabs a.on { background: rgba(34, 211, 197, .1); border-color: rgba(34, 211, 197, .45); color: var(--teal); }
/* docs: sidebar layout */
.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 44px; align-items: start; }
.docs-main { min-width: 0; max-width: 820px; }
.docs-h1 { font: 700 36px/1.1 var(--display); letter-spacing: -.04em; margin: 4px 0 18px; }
.docs-main > .kicker { display: block; margin-top: 4px; }
.docs-side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 14px; }
.docs-menu > summary { display: none; }
.docs-side nav { display: flex; flex-direction: column; gap: 2px; }
.docs-link { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; }
.docs-link:hover { background: var(--surface); color: var(--text); }
.docs-link.on { background: rgba(34, 211, 197, .1); color: var(--teal); font-weight: 600; }
.docs-link.sub { padding-left: 16px; }
.docs-group { margin-top: 10px; }
.docs-group > summary { cursor: pointer; list-style: none; padding: 6px 10px; font: 600 12px var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; justify-content: space-between; }
.docs-group > summary::-webkit-details-marker { display: none; }
.docs-group > summary::after { content: "+"; font-size: 14px; }
.docs-group[open] > summary::after { content: "−"; }
.docs-onpage { list-style: none; margin: 2px 0 6px 16px; padding: 0 0 0 10px; border-left: 1px solid var(--line); }
.docs-onpage a { display: block; padding: 3px 6px; color: var(--muted); font-size: 13px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-onpage a:hover { color: var(--text); }
.docs-onpage a.mono { font-family: var(--mono); font-size: 12px; }
.docs-downloads { margin-top: 18px; padding: 12px 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.docs-downloads span { font: 600 12px var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 2px; }
.docs-downloads a { font: 500 12.5px var(--mono); color: var(--text-2); text-decoration: none; }
.docs-downloads a:hover { color: var(--teal); }
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 14px; }
  .docs-side { position: static; max-height: none; }
  .docs-menu { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
  .docs-menu > summary { display: block; cursor: pointer; padding: 10px 14px; font-weight: 600; }
  .docs-menu[open] > nav { padding: 0 8px 12px; }
}
.day-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.day-picks .check { padding: 6px 10px; }
.sched-form .grid-2 { margin-top: 4px; }

/* Account agreement window (templates/_agreement.html, static/agree.js) */
.agree-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(3, 5, 8, .78); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.agree-overlay[hidden] { display: none; }
.agree-panel { width: 100%; max-width: 680px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); }
.agree-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.agree-head h2 { margin: 0; font: 600 20px/1.2 var(--display); letter-spacing: -.02em; }
.agree-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.agree-x { background: none; border: 0; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.agree-x:hover { color: var(--text); }
.agree-body { overflow-y: auto; padding: 4px 20px 8px; outline: none; }
.agree-sec { padding: 16px 0; border-bottom: 1px solid var(--line); }
.agree-sec h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font: 600 15px/1.3 var(--font); }
.agree-n { flex: none; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px;
  background: rgba(34, 211, 197, .1); color: var(--teal); border: 1px solid rgba(34, 211, 197, .25); }
.agree-sec p { margin: 0 0 10px; color: var(--text-2); font-size: 14px; }
.agree-sec p b { color: var(--text); }
.agree-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.agree-tick { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; color: var(--text); font-size: 13.5px; }
.agree-tick input { width: 17px; height: 17px; margin: 2px 0 0; flex: none; accent-color: var(--teal); }
.agree-sign { border-bottom: 0; }
.agree-sign label { margin-top: 12px; }
.agree-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px;
  border-top: 1px solid var(--line); flex-wrap: wrap; }
.agree-status { color: var(--muted); font-size: 13px; }
.agree-foot .btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; box-shadow: none; }
.terms-sec { scroll-margin-top: 80px; padding-top: 8px; }
.terms-sec .summary { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text-2); }
@media (max-width: 560px) { .agree-foot .btn { width: 100%; } .agree-head, .agree-body, .agree-foot { padding-left: 16px; padding-right: 16px; } }

/* Invoices (templates/invoice.html) */
.invoice { padding: 28px; }
.inv-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 16px; }
.inv-head .brand img { width: 28px; height: 28px; }
.inv-meta { text-align: right; font-size: 13.5px; color: var(--text-2); }
.inv-meta h1 { margin: 0 0 4px; font: 700 24px/1.1 var(--display); color: var(--text); }
.inv-summary { font-size: 15.5px; line-height: 1.65; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.invoice h3 { font-size: 15px; margin: 18px 0 8px; }
.invoice .table-wrap { margin: 0 0 12px; }
.inv-total td { border-top: 1px solid var(--line-2); }
.inv-totals { max-width: 360px; margin-left: auto; }
@media (max-width: 560px) { .invoice { padding: 18px; } .inv-meta { text-align: left; } }
@media print {
  body { background: #fff; color: #111; }
  .nav, .footer, .no-print { display: none !important; }
  .invoice, .inv-summary { background: #fff; border-color: #ccc; box-shadow: none; color: #111; }
  .invoice .hint, .inv-meta, .table td, .table th { color: #333; }
}

/* Skills page */
.section-title { font: 600 18px/1.2 var(--display); margin: 28px 0 12px; }
.skill-v { border-top: 1px solid var(--line); padding: 10px 0; }
.skill-v summary { cursor: pointer; font-size: 14px; }
pre.code { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto;
  font: 12.5px/1.55 var(--mono); color: var(--text-2); margin: 10px 0; max-height: 420px; }

/* Textures page */
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; align-items: end; }
.grid-form label { margin: 0; }
.inline-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-edit input { height: 34px; }
