/* Aureviai — shared stylesheet (public site, gate pages and owner dashboard).
   CSP: style-src 'self'. No inline styles anywhere; everything lives here. */
:root {
  /* layered dark palette (luarmor-style), stepping darker section by section */
  --bg: #13151e;
  --bg-1: #0f1117;
  --bg-2: #0d0f16;
  --bg-3: #0b0d14;
  --bg-4: #080a0f;
  --bg-footer: #070809;
  --panel: #161923;
  --panel-2: #1b1f2b;
  --field: #0c0e15;
  --line: rgba(255, 255, 255, .06);
  --line-soft: rgba(255, 255, 255, .04);
  --line-strong: rgba(255, 255, 255, .11);
  --ink: #f3f5fa;
  --muted: #a1a7b8;
  --faint: #8088a0;
  /* Aureviai blue / teal / indigo identity */
  --indigo: #6b70ff;
  --cyan: #3bcaff;
  --teal: #2dd4bf;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --link: #818cf8;
  --link-hover: #a5b4fc;
  --grad-brand: linear-gradient(100deg, #6b70ff 0%, #3bcaff 50%, #2dd4bf 75%, #6b70ff 100%);
  --grad-btn: linear-gradient(135deg, #5458f0 0%, #2f6bf0 100%);
  --grad-card: linear-gradient(150deg, rgba(255, 255, 255, .045) 0%, rgba(255, 255, 255, .012) 55%, rgba(255, 255, 255, 0) 100%);
  --ok: #34d399;
  --danger: #f87171;
  --warn: #fbbf24;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --shadow-lg: 0 40px 120px rgba(0, 0, 0, .55);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.surface-public, body.surface-gate {
  background:
    radial-gradient(900px 520px at 50% -180px, rgba(107, 112, 255, .20), transparent 70%),
    radial-gradient(700px 420px at 92% 4%, rgba(59, 202, 255, .09), transparent 70%),
    radial-gradient(600px 380px at 4% 18%, rgba(45, 212, 191, .06), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}
body.surface-app {
  background:
    radial-gradient(900px 360px at 50% -200px, rgba(107, 112, 255, .10), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}
::selection { background: rgba(99, 102, 241, .45); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 3px; border-radius: 6px; }

a { color: var(--link); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--link-hover); }
p a, .prose a, li a, td a:not(.btn):not(.pill):not(.row-title) { text-decoration: underline; text-decoration-color: rgba(129, 140, 248, .45); text-underline-offset: 3px; }
p a:hover, li a:hover, td a:not(.btn):hover { text-decoration-color: currentColor; }

h1, h2, h3 { font-family: var(--font); font-weight: 800; letter-spacing: -0.025em; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(1.75rem, 3vw, 2.35rem); margin: 6px 0 16px; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 12px; letter-spacing: -0.015em; }
h3 { font-size: 1rem; font-weight: 700; margin: 16px 0 8px; letter-spacing: -0.01em; }
p { margin: 0 0 14px; }
img { max-width: 100%; }

code, pre, .mono { font-family: var(--mono); }
code {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: .86em;
  color: #dfe3ff;
  word-break: break-word;
}
pre.code, .terminal pre {
  background: var(--field);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .86rem;
  line-height: 1.6;
  color: #d9def0;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 8px 14px; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; color: #fff; }

/* ------------------------------------------------------------------ floating navbar */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 50;
  width: min(80%, 1200px);
  margin: 14px auto 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(28, 31, 44, .78) 0%, rgba(17, 19, 28, .78) 100%);
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .40), inset 0 1px 0 rgba(255, 255, 255, .04);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}
.topbar-inner {
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 12px 0 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
}
.brand:hover { color: #fff; }
.mark { width: 30px; height: 30px; display: block; flex: none; border-radius: 8px; }
.site-nav { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a, .site-nav .link {
  color: var(--muted);
  font-size: .92rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 10px;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.site-nav a:hover, .site-nav .link:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.site-nav a.btn { color: #fff; margin: 0 0 0 8px; padding: 8px 18px; }
.site-nav a.btn:hover { color: #fff; background: var(--grad-btn); }
.site-nav form.inline { margin: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); margin-left: 6px; }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-toggle-bar { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); transition: transform .2s var(--ease), opacity .2s var(--ease); }
.topbar.nav-open .nav-toggle-bar:nth-of-type(2) { transform: translateY(6px) rotate(45deg); }
.topbar.nav-open .nav-toggle-bar:nth-of-type(3) { opacity: 0; }
.topbar.nav-open .nav-toggle-bar:nth-of-type(4) { transform: translateY(-6px) rotate(-45deg); }

/* ------------------------------------------------------------------ page shells */
main { flex: 1 0 auto; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 40px 24px 72px; }
.container.container-bleed { max-width: none; padding: 0; }
.container-bleed > .flash-wrap { max-width: 1120px; margin: 24px auto 0; padding: 0 24px; }
body[data-path="/docs"] .container, body[data-path="/docs/api"] .container { max-width: 860px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.page-head { margin: 8px 0 26px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 12px; }
.page-head > p.muted { max-width: 70ch; font-size: 1.02rem; }

.subnav {
  display: flex;
  gap: 4px;
  padding: 6px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0 0 24px;
  align-items: center;
  flex-wrap: wrap;
}
.subnav strong { padding: 6px 12px; margin-right: 4px; font-weight: 700; letter-spacing: -0.01em; }
.subnav a { color: var(--muted); padding: 7px 12px; border-radius: 10px; font-size: .9rem; font-weight: 500; transition: background .18s var(--ease), color .18s var(--ease); }
.subnav a:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }

/* ------------------------------------------------------------------ cards, grids */
.card {
  position: relative;
  background: var(--grad-card), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  overflow-x: auto;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .18);
}
.card.current { border-color: rgba(99, 102, 241, .65); box-shadow: 0 0 0 1px rgba(99, 102, 241, .45), 0 18px 50px rgba(79, 70, 229, .18); }
.card h2 { margin-top: 0; }
.center { text-align: center; }
.narrow { max-width: 460px; margin: 48px auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-grid { margin-bottom: 8px; }
.form-grid fieldset { grid-row: span 3; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 6px 0 20px; }
.stat {
  background: var(--grad-card), rgba(22, 25, 35, .8);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 14px;
  color: var(--faint);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.stat:hover { border-color: rgba(99, 102, 241, .35); transform: translateY(-2px); }
.stat span {
  display: block;
  color: var(--ink);
  font-size: clamp(1.4rem, 1.8vw, 1.8rem);
  letter-spacing: -0.03em;
  font-weight: 800;
  text-transform: none;
  line-height: 1.15;
  margin-bottom: 4px;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ tables & forms */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--faint); font-weight: 600; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; }
tbody tr { transition: background .15s var(--ease); }
tbody tr:hover td { background: rgba(255, 255, 255, .02); }
table.kv th { width: 180px; color: var(--muted); text-transform: none; letter-spacing: 0; font-size: .88rem; }

label { display: block; margin: 12px 0; color: var(--muted); font-size: .88rem; font-weight: 500; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
label.inline { display: inline; color: var(--ink); font-weight: 600; }
input, select, textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input::placeholder, textarea::placeholder { color: #5f6679; }
textarea { font-family: var(--mono); font-size: .86rem; min-height: 96px; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0 6px 0 0; accent-color: var(--accent); }
input[type=file] { padding: 9px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, .22); outline: none; }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
legend { color: var(--ink); font-weight: 600; padding: 0 6px; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--grad-btn);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .10);
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-size: .94rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 4px 8px 4px 0;
  min-height: 42px;
  box-shadow: 0 8px 24px rgba(84, 88, 240, .28), inset 0 1px 0 rgba(255, 255, 255, .16);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.btn:hover { color: #fff; transform: translateY(-1px); filter: brightness(1.1); box-shadow: 0 12px 32px rgba(59, 130, 246, .38), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn:active { transform: translateY(0); }
.btn.small { padding: 6px 13px; min-height: 34px; font-size: .84rem; border-radius: 10px; }
.btn.btn-lg { padding: 13px 26px; min-height: 50px; font-size: 1rem; border-radius: 14px; }
.btn.btn-block { width: 100%; margin-right: 0; }
.btn.ghost, .btn.ghost:hover {
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: none;
  filter: none;
}
.btn.ghost:hover { background: rgba(255, 255, 255, .08); border-color: rgba(129, 140, 248, .5); }
.btn.danger, .btn.danger:hover { background: linear-gradient(135deg, #dc2626, #b91c1c); border-color: rgba(255, 255, 255, .1); color: #fff; box-shadow: 0 8px 24px rgba(220, 38, 38, .22); }
.btn.disabled { opacity: .45; pointer-events: none; }
button.link {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  padding: 8px 12px;
}
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; flex-wrap: wrap; }
form.inline input, form.inline select { width: auto; margin: 0; }

/* ------------------------------------------------------------------ alerts, tags */
.flash-wrap .alert:last-child { margin-bottom: 18px; }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; border: 1px solid; font-size: .94rem; }
.alert.success { border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); color: #a7f3d0; }
.alert.error { border-color: rgba(248, 113, 113, .38); background: rgba(248, 113, 113, .08); color: #fecaca; }
.alert.warn { border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .07); color: #fde68a; }
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .02em;
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.ok { background: rgba(52, 211, 153, .10); color: #6ee7b7; border-color: rgba(52, 211, 153, .3); }
.tag.danger { background: rgba(248, 113, 113, .10); color: #fca5a5; border-color: rgba(248, 113, 113, .3); }
.tag.info { background: rgba(59, 130, 246, .12); color: #93c5fd; border-color: rgba(59, 130, 246, .32); }
.tag.warn { background: rgba(251, 191, 36, .10); color: #fcd34d; border-color: rgba(251, 191, 36, .3); }
.muted { color: var(--muted); }
.price { font-size: 1.7rem; letter-spacing: -0.03em; font-weight: 800; margin: 4px 0 12px; }
.pager { display: flex; gap: 16px; margin-top: 12px; }
.actions form { margin-right: 8px; }
.danger-zone { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
ul { padding-left: 18px; }
hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }

/* ------------------------------------------------------------------ chart (CSP: heights via classes) */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.chart .fill { width: 100%; background: linear-gradient(180deg, var(--cyan), var(--indigo)); border-radius: 5px 5px 0 0; min-height: 2px; opacity: .9; }
.chart small { color: var(--faint); font-size: .7em; }
.chart small.n { color: var(--ink); font-family: var(--mono); }
.h0{height:0}.h5{height:5%}.h10{height:10%}.h15{height:15%}.h20{height:20%}.h25{height:25%}.h30{height:30%}.h35{height:35%}.h40{height:40%}.h45{height:45%}.h50{height:50%}.h55{height:55%}.h60{height:60%}.h65{height:65%}.h70{height:70%}.h75{height:75%}.h80{height:80%}.h85{height:85%}.h90{height:90%}.h95{height:95%}.h100{height:100%}

/* ------------------------------------------------------------------ shared marketing atoms */
.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.text-gradient {
  background: var(--grad-brand);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: grad-shift 8s ease-in-out infinite;
}
@keyframes grad-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cta-row .btn { margin: 0; }
.cta-center { justify-content: center; }
.wdot { width: 10px; height: 10px; border-radius: 50%; background: #2a2e3d; display: inline-block; }
.wdot:nth-child(1) { background: #ff5f57; }
.wdot:nth-child(2) { background: #febc2e; }
.wdot:nth-child(3) { background: #28c840; }

/* ------------------------------------------------------------------ home: hero */
.hero { padding: 88px 0 96px; text-align: center; position: relative; }
.hero-inner { display: flex; flex-direction: column; align-items: center; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  color: #c7ccff;
  background: rgba(107, 112, 255, .10);
  border: 1px solid rgba(107, 112, 255, .28);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(45, 212, 191, .18); }
.hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  max-width: 17ch;
  margin: 0 auto 20px;
}
.hero-sub {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  font-weight: 600;
  color: var(--muted);
  max-width: 58ch;
  margin: 0 auto 32px;
}

/* dashboard preview mockup (pure CSS, sample data, labelled as such) */
.preview {
  position: relative;
  width: 100%;
  max-width: 1020px;
  margin: 64px auto 0;
  text-align: left;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #171a25 0%, #10121a 100%);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, .4);
  overflow: hidden;
  isolation: isolate;
}
.preview::before {
  content: "";
  position: absolute;
  inset: -40% 10% auto;
  height: 70%;
  background: radial-gradient(closest-side, rgba(107, 112, 255, .22), transparent);
  z-index: -1;
  pointer-events: none;
}
.preview-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .02);
}
.preview-url {
  margin: 0 auto;
  padding: 3px 14px;
  border-radius: 8px;
  font-size: .74rem;
  color: var(--faint);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-soft);
}
.preview-tag { font-size: .7rem; font-weight: 600; color: #c7ccff; padding: 2px 8px; border-radius: 999px; background: rgba(107, 112, 255, .14); border: 1px solid rgba(107, 112, 255, .3); }
.preview-body { display: grid; grid-template-columns: 200px 1fr; min-height: 340px; }
.preview-side { display: flex; flex-direction: column; gap: 3px; padding: 16px 12px; border-right: 1px solid var(--line); background: rgba(0, 0, 0, .15); }
.ps-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .88rem; padding: 4px 8px 14px; }
.ps-brand img { border-radius: 6px; }
.ps-item { font-size: .82rem; color: var(--faint); padding: 7px 10px; border-radius: 9px; }
.ps-item.active { color: var(--ink); background: linear-gradient(90deg, rgba(107, 112, 255, .22), rgba(59, 202, 255, .06)); border: 1px solid rgba(107, 112, 255, .25); }
.preview-main { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pm-stat, .pm-card { background: var(--grad-card), rgba(255, 255, 255, .02); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.pm-stat small, .pm-card small { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; }
.pm-stat strong { display: block; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 2px; }
.pm-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; flex: 1; }
.pm-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; margin-top: 12px; }
.pm-chart span { flex: 1; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--cyan), var(--indigo)); opacity: .85; }
.pm-keys { list-style: none; margin: 10px 0 0; padding: 0; }
.pm-keys li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: .8rem; }
.pm-keys li:last-child { border-bottom: 0; }
.pm-keys code { background: none; border: 0; padding: 0; color: var(--muted); }

/* ------------------------------------------------------------------ home: bands */
.band { padding: 96px 0; border-top: 1px solid var(--line-soft); }
.band-1 { background: var(--bg-1); }
.band-2 { background: var(--bg-2); }
.band-3 { background: var(--bg-3); }
.band-4 { background: var(--bg-4); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head h2, .how-copy h2, .cta-panel h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 14px; }
.section-sub { color: var(--muted); font-size: 1.05rem; margin: 0; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  position: relative;
  padding: 26px 24px 24px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #171a26 0%, #10121a 60%, #0d0f16 100%);
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.feature:hover {
  transform: translateY(-4px);
  border-color: rgba(107, 112, 255, .32);
  box-shadow: 0 22px 48px rgba(0, 0, 0, .4), 0 0 0 1px rgba(107, 112, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  margin-bottom: 18px;
  border-radius: 13px;
  color: var(--accent-hover);
  background: linear-gradient(135deg, rgba(107, 112, 255, .20), rgba(59, 202, 255, .10));
  border: 1px solid rgba(107, 112, 255, .28);
  transition: color .25s var(--ease);
}
.feature:hover .feature-icon { color: var(--cyan); }
.feature h3 { font-size: 1.08rem; margin: 0 0 8px; }
.feature p { color: var(--muted); font-size: .95rem; margin: 0; }

.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
  padding: 28px 24px;
  text-align: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .025);
  border: 1px solid rgba(255, 255, 255, .07);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(59, 202, 255, .28); }
.stat-card strong { display: block; font-size: clamp(2rem, 3.6vw, 2.75rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 8px; }
.stat-card span { color: var(--muted); font-size: .92rem; }

.how { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.how > * { min-width: 0; }
.steps { list-style: none; margin: 26px 0 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 18px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; padding-top: 4px; }
.step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px;
  font-size: .8rem; font-weight: 700; font-family: var(--mono);
  color: #c7ccff;
  background: rgba(107, 112, 255, .12);
  border: 1px solid rgba(107, 112, 255, .28);
}
.steps strong { font-size: 1.05rem; font-weight: 700; }
.steps p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }

.terminal { margin: 0; min-width: 0; max-width: 100%; border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(255, 255, 255, .08); box-shadow: var(--shadow); background: #0a0c12; }
.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--faint);
  font-family: var(--mono);
  font-size: .76rem;
}
.wdots { display: inline-flex; gap: 7px; }
.term-file { margin-left: auto; }
.terminal pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 220px;
  padding: 20px;
  white-space: pre;
  word-break: normal;
  overflow-x: auto;
}
.terminal .c { color: #69708a; }
.terminal .k { color: #a5b4fc; }
.terminal .s { color: #5eead4; }
.terminal .ok { color: var(--ok); }

.cta-panel {
  text-align: center;
  padding: 56px 32px;
  border-radius: 20px;
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(107, 112, 255, .22), transparent 70%),
    linear-gradient(160deg, #141726 0%, #0c0e16 100%);
  border: 1px solid rgba(107, 112, 255, .22);
  box-shadow: var(--shadow-lg);
}
.cta-panel p { color: var(--muted); max-width: 56ch; margin: 0 auto 26px; }

/* ------------------------------------------------------------------ gate pages (login, restricted, ad-key, error) */
.surface-gate .container { display: flex; flex-direction: column; justify-content: center; }
.surface-gate .narrow, .gate-card { margin-top: 56px; padding: 34px 30px 26px; }
.gate-card {
  border-color: rgba(255, 255, 255, .08);
  background: linear-gradient(170deg, rgba(30, 34, 50, .85) 0%, rgba(16, 18, 27, .9) 100%);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.gate-card h1 { font-size: 1.7rem; margin: 6px 0 10px; }
.gate-mark { display: block; margin: 0 auto 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(43, 75, 224, .35); }
.gate-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 18px;
  color: var(--cyan);
  background: linear-gradient(135deg, rgba(107, 112, 255, .22), rgba(59, 202, 255, .10));
  border: 1px solid rgba(107, 112, 255, .32);
  box-shadow: 0 12px 34px rgba(59, 130, 246, .22);
}
.gate-form { text-align: left; margin-top: 8px; }
.gate-form .btn { margin-top: 6px; }
.gate-links { font-size: .92rem; margin-top: 18px; }
.gate-note { font-size: .85rem; margin-bottom: 0; }
.restricted .btn { margin: 10px 0 0; }

/* ------------------------------------------------------------------ pricing (/buy) */
.pricing-form { padding: 26px; }
.plan-grid { margin: 8px 0 18px; }
.plan-card { transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease); }
.plan-card:hover { transform: translateY(-3px); border-color: rgba(107, 112, 255, .3); }
.plan-card h2 { font-size: 1.2rem; }
.plan-card .price { background: var(--grad-brand); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.pay-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pay-row .btn { margin: 0; }
form.card > .grid3 > .card,
.grid3 > .card { margin-bottom: 0; }
.grid3 > .card:has(input[type=radio]:checked),
.grid3 > .card.current { border-color: rgba(99, 102, 241, .7); background: linear-gradient(160deg, rgba(99, 102, 241, .14), rgba(59, 202, 255, .04)), var(--panel); box-shadow: 0 0 0 1px rgba(99, 102, 241, .4), 0 18px 50px rgba(79, 70, 229, .2); }
.grid3 > .card ul { padding-left: 18px; color: var(--muted); }
.grid3 > .card li { margin: 5px 0; }
.grid3 > .card li::marker { color: var(--teal); }

/* ------------------------------------------------------------------ API reference (/docs/api) */
.endpoint-list { list-style: none; margin: 4px 0 0; padding: 0; }
.endpoint {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-areas: "method path" ". summary";
  gap: 4px 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.endpoint:first-child { border-top: 0; }
.method {
  grid-area: method;
  justify-self: start;
  min-width: 62px;
  padding: 3px 8px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  text-align: center;
  letter-spacing: .04em;
  border: 1px solid;
}
.method-get { color: #7dd3fc; background: rgba(59, 202, 255, .10); border-color: rgba(59, 202, 255, .3); }
.method-post { color: #6ee7b7; background: rgba(52, 211, 153, .10); border-color: rgba(52, 211, 153, .3); }
.method-patch, .method-put { color: #c7d2fe; background: rgba(107, 112, 255, .12); border-color: rgba(107, 112, 255, .32); }
.method-delete { color: #fca5a5; background: rgba(248, 113, 113, .10); border-color: rgba(248, 113, 113, .3); }
.endpoint-path { grid-area: path; background: none; border: 0; padding: 0; font-size: .86rem; color: var(--ink); word-break: break-all; }
.endpoint-summary { grid-area: summary; color: var(--muted); font-size: .9rem; }

/* ------------------------------------------------------------------ footer */
.footer {
  margin-top: auto;
  background: var(--bg-footer);
  border-top: 1px solid rgba(255, 255, 255, .06);
  color: var(--faint);
  font-size: .9rem;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 24px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand p { margin: 14px 0 0; max-width: 38ch; color: var(--faint); font-size: .9rem; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h2 { font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 6px 0 4px; }
.footer-col a { color: var(--faint); font-size: .9rem; width: fit-content; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  flex-wrap: wrap;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 26px;
  border-top: 1px solid rgba(255, 255, 255, .04);
  font-size: .82rem;
}
.footer-compact .footer-bottom { border-top: 0; }
.footer .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--teal); }

/* ------------------------------------------------------------------ language switch (EN / ES) */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(255, 255, 255, .03); }
.lang-switch a, .site-nav .lang-switch a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 28px;
  padding: 3px 8px; border-radius: 7px; font-size: .76rem; font-weight: 700; letter-spacing: .06em;
  color: var(--faint); text-decoration: none; transition: color .18s var(--ease), background .18s var(--ease);
}
.lang-switch a:hover, .site-nav .lang-switch a:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.lang-switch a.active, .site-nav .lang-switch a.active { color: #fff; background: rgba(99, 102, 241, .32); }
.lang-switch-nav { margin-left: 8px; }
.lang-switch-footer { margin-left: 6px; }

/* ------------------------------------------------------------------ payment method dialog */
.plan-buy { margin-top: 8px; }
.pay-modal {
  width: min(460px, calc(100% - 32px)); max-width: none; max-height: calc(100% - 32px);
  padding: 0; border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.pay-modal::backdrop { background: rgba(4, 5, 9, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.pay-modal[open] { animation: pay-in .2s var(--ease); }
@keyframes pay-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.pay-modal-panel { padding: 22px 22px 24px; }
.pay-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pay-modal-head h2 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.pay-modal-close {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none;
  padding: 0; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.pay-modal-close:hover { color: var(--ink); background: rgba(255, 255, 255, .07); }
.pay-modal-close:focus-visible, .pay-option:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.pay-notes { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; }
.pay-notes li { position: relative; padding-left: 16px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.pay-notes li::before { content: "*"; position: absolute; left: 0; top: 0; color: var(--faint); font-weight: 700; }
.pay-option {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 14px 18px;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .12); color: #fff; text-decoration: none;
  transition: transform .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.pay-option:hover { color: #fff; transform: translateY(-1px); }
.pay-option-store { background: linear-gradient(135deg, #c2611f, #b85c1e 55%, #a4511a); box-shadow: 0 10px 28px rgba(184, 92, 30, .3), inset 0 1px 0 rgba(255, 255, 255, .16); }
.pay-option-store:hover { background: linear-gradient(135deg, #b85c1e, #a4511a); box-shadow: 0 14px 34px rgba(184, 92, 30, .42), inset 0 1px 0 rgba(255, 255, 255, .16); }
.pay-option-icon { flex: none; }
.pay-option-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.pay-option-label { font-size: 1.05rem; font-weight: 700; }
.pay-option-hint { font-size: .8rem; color: rgba(255, 255, 255, .88); }
.pay-option-ext { flex: none; opacity: .9; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1024px) {
  .topbar { width: calc(100% - 32px); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-band { grid-template-columns: repeat(2, 1fr); }
  .how { grid-template-columns: 1fr; gap: 40px; }
  .footer-inner { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .topbar { top: 10px; margin-top: 10px; width: calc(100% - 20px); }
  .topbar-inner { padding: 0 10px 0 14px; min-height: 58px; flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 6px 0 12px;
    border-top: 1px solid var(--line);
  }
  .topbar.nav-open .site-nav { display: flex; }
  .site-nav a, .site-nav .link { padding: 11px 12px; font-size: 1rem; text-align: left; }
  .site-nav form.inline { display: block; }
  .site-nav form.inline .link { width: 100%; }
  .site-nav a.btn { margin: 8px 0 0; padding: 12px 18px; }
  .lang-switch-nav { margin: 10px 0 0; align-self: flex-start; }
  .site-nav .lang-switch a { padding: 6px 12px; min-height: 36px; font-size: .85rem; }
  .avatar { display: none; }
  .container { padding: 28px 16px 56px; }
  .wrap { padding: 0 18px; }
  .hero { padding: 56px 0 64px; }
  .band { padding: 68px 0; }
  .preview { margin-top: 44px; }
  .preview-body { grid-template-columns: 1fr; min-height: 0; }
  .preview-side { display: none; }
  .pm-stats { grid-template-columns: repeat(2, 1fr); }
  .pm-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .feature-grid, .stat-band, .grid2 { grid-template-columns: 1fr; }
  .stat-band { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 22px 14px; }
  .hero h1 { font-size: 2.2rem; }
  .cta-center .btn, .cta-row .btn { width: 100%; }
  .preview-url { display: none; }
  .preview-tag { margin-left: auto; }
  .pm-chart { height: 110px; }
  .section-head { margin-bottom: 34px; }
  .cta-panel { padding: 40px 20px; }
  .footer-inner { grid-template-columns: 1fr 1fr; padding: 48px 20px 28px; gap: 28px; }
  .steps li { grid-template-columns: 46px 1fr; }
  .btn { width: 100%; margin-right: 0; }
  .site-nav .btn, form.inline .btn, td .btn, .btn.small { width: auto; }
  .site-nav a.btn { width: 100%; }
  .surface-gate .narrow, .gate-card { margin-top: 28px; padding: 28px 20px 22px; }
  .narrow { margin: 28px auto; }
  .page-head h1 { font-size: 1.9rem; }
  .terminal pre { font-size: .78rem; padding: 16px; }
}
@media (max-width: 380px) {
  .stat-band, .pm-stats { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .feature:hover, .stat-card:hover, .stat:hover, .plan-card:hover, .btn:hover, .pay-option:hover { transform: none; }
}

/* ------------------------------------------------------------------ platform admin panel (/admin) */
.admin-head { margin-bottom: 18px; }
.admin-shortcuts { margin-bottom: 18px; }
.admin-tile { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.admin-tile:hover { border-color: rgba(99, 102, 241, .45); transform: translateY(-2px); color: var(--ink); }
.admin-tile strong { font-size: 1.05rem; }
.admin-newkey { border-color: rgba(52, 211, 153, .4); margin-bottom: 18px; }
.admin-keyline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-keyline code { font-size: 1rem; padding: 8px 12px; word-break: break-all; }
.admin-duration { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-duration legend { color: var(--muted); font-size: .88rem; padding: 0 4px; }
.admin-duration input[type=number] { width: 110px; margin: 0; }
.admin-search input { min-width: 220px; }
.table-wrap { width: 100%; overflow-x: auto; }
.admin-table td { vertical-align: top; }
.admin-actions { min-width: 260px; }
.admin-actions form.inline { margin: 0 0 6px; }
.admin-actions input[name=reason] { max-width: 150px; }
.admin-days { max-width: 80px; }
.admin-check { font-weight: 400; color: var(--muted); font-size: .85rem; }
.admin-detail { display: inline-block; max-width: 340px; word-break: break-word; color: var(--muted); }
.admin-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.site-nav a[aria-current="page"] { color: var(--ink); background: rgba(99, 102, 241, .14); }
.admin-table code { white-space: nowrap; }

/* ==================================================================
   OWNER DASHBOARD (app shell): fixed sidebar on desktop, slide-in drawer on mobile,
   sticky top bar with breadcrumb + EN/ES. Luarmor-style stat cards, pills and tables.
   Everything here is class-based (CSP: no inline styles). JS: public/js/app.js.
   ================================================================== */
:root { --sb-w: 264px; --top-h: 64px; }
body.has-shell { background: radial-gradient(1100px 420px at 70% -220px, rgba(107, 112, 255, .10), transparent 70%), var(--bg-1); background-repeat: no-repeat; }
.app-shell { display: flex; min-height: 100vh; width: 100%; }

/* ---- sidebar */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--sb-w);
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #12141d 0%, #0c0e15 100%);
  border-right: 1px solid var(--line);
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 18px 12px; }
.sb-head .mark { width: 32px; height: 32px; }
.sb-close { display: none; }
.sb-nav { display: flex; flex-direction: column; gap: 3px; padding: 6px 12px 12px; flex: 1 0 auto; }
.sb-label { margin: 8px 10px 8px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.sb-item {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 7px 10px; border-radius: 12px;
  color: var(--muted); font-weight: 600; font-size: .94rem; border: 1px solid transparent;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.sb-item:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.sb-item.active { color: #fff; background: linear-gradient(90deg, rgba(99, 102, 241, .22), rgba(59, 202, 255, .05)); border-color: rgba(107, 112, 255, .26); }
.sb-ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border-radius: 9px; background: rgba(255, 255, 255, .045); color: var(--muted); transition: background .18s var(--ease), color .18s var(--ease); }
.sb-item:hover .sb-ico { color: var(--ink); }
.sb-item.active .sb-ico { background: var(--grad-btn); color: #fff; box-shadow: 0 6px 18px rgba(84, 88, 240, .35); }
.sb-sub { display: flex; flex-direction: column; gap: 1px; margin: 4px 0 8px 25px; padding-left: 12px; border-left: 1px solid var(--line-strong); }
.sb-sub-title { margin: 4px 10px 4px; font-size: .74rem; font-weight: 700; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-subitem { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border-radius: 9px; color: var(--muted); font-size: .86rem; font-weight: 500; transition: color .18s var(--ease), background .18s var(--ease); }
.sb-subitem:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.sb-subitem.active { color: #fff; background: rgba(99, 102, 241, .16); }
.sb-foot { display: flex; flex-direction: column; gap: 12px; padding: 12px; border-top: 1px solid var(--line); }
.sb-plan { padding: 14px; border-radius: 14px; background: linear-gradient(160deg, rgba(99, 102, 241, .16), rgba(45, 212, 191, .04)); border: 1px solid rgba(107, 112, 255, .22); }
.sb-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sb-plan-link { font-size: .8rem; font-weight: 600; }
.sb-meter + .sb-meter { margin-top: 9px; }
.sb-meter-row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-size: .74rem; color: var(--muted); }
.sb-meter-row .mono { color: var(--ink); font-size: .7rem; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 2px 2px 0; }
.sb-avatar { width: 34px; height: 34px; flex: none; border-radius: 10px; object-fit: cover; }
.sb-initial { display: inline-flex; align-items: center; justify-content: center; background: var(--grad-btn); color: #fff; font-weight: 800; }
.sb-who { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.sb-who strong { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-who small { font-size: .72rem; color: var(--faint); }
.sb-logout { margin: 0; }

/* plan badge + meters */
.plan-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
  color: #e0e7ff; background: rgba(99, 102, 241, .22); border: 1px solid rgba(129, 140, 248, .42);
}
.plan-badge.plan-pro { color: #cffafe; background: rgba(59, 202, 255, .14); border-color: rgba(59, 202, 255, .42); }
.plan-badge.plan-premium { color: #fde68a; background: rgba(245, 158, 11, .14); border-color: rgba(245, 158, 11, .45); }
.plan-badge.plan-free { color: var(--muted); background: rgba(255, 255, 255, .05); border-color: var(--line-strong); }
.meter { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.meter.meter-lg { height: 8px; }
.meter-fill { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--indigo), var(--cyan)); }
.meter[class*="tone-"] { background: rgba(255, 255, 255, .07); box-shadow: none; }
.meter.tone-orange .meter-fill { background: linear-gradient(90deg, #fb923c, #f97316); }
.meter.tone-blue .meter-fill { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.meter.tone-purple .meter-fill { background: linear-gradient(90deg, #c084fc, #8b5cf6); }
.meter.meter-hot .meter-fill { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.w0{width:0}.w5{width:5%}.w10{width:10%}.w15{width:15%}.w20{width:20%}.w25{width:25%}.w30{width:30%}.w35{width:35%}.w40{width:40%}.w45{width:45%}.w50{width:50%}.w55{width:55%}.w60{width:60%}.w65{width:65%}.w70{width:70%}.w75{width:75%}.w80{width:80%}.w85{width:85%}.w90{width:90%}.w95{width:95%}.w100{width:100%}

/* ---- main column + top bar */
.app-main { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 100vh; margin-left: var(--sb-w); }
.app-top {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
  min-height: var(--top-h); padding: 0 28px;
  background: rgba(15, 17, 23, .8); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
}
.app-burger { display: none; }
.app-top-brand { display: none; }
.crumbs { flex: 1; min-width: 0; }
.crumbs ol { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; overflow: hidden; font-size: .9rem; }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--faint); white-space: nowrap; }
.crumbs li a { color: var(--muted); text-decoration: none; }
.crumbs li a:hover { color: var(--ink); }
.crumbs li.current { color: var(--ink); font-size: 1rem; font-weight: 700; overflow: hidden; }
.crumbs li.current span { overflow: hidden; text-overflow: ellipsis; }
.crumb-sep { flex: none; color: var(--faint); }
.app-top-right { display: flex; align-items: center; gap: 10px; }
.app-content { flex: 1 0 auto; width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 28px 56px; }
body.has-shell[data-path="/docs"] .app-content, body.has-shell[data-path="/docs/api"] .app-content { max-width: 920px; }
.has-shell .footer { margin-top: 0; background: transparent; border-top: 1px solid var(--line-soft); }
.has-shell .lang-switch-footer { display: none; }

/* icon buttons */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; padding: 0;
  border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .03); color: var(--muted); cursor: pointer;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.icon-btn:hover { color: var(--ink); background: rgba(255, 255, 255, .08); }
.icon-btn.icon-btn-sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.copied, .pill.copied { color: #a7f3d0; border-color: rgba(52, 211, 153, .5); }

/* ---- page head, chips */
.app-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 22px; }
.app-head > div:first-child { min-width: 0; }
.app-head h1 { margin: 0 0 6px; font-size: clamp(1.55rem, 2.4vw, 2rem); word-break: break-word; }
.app-head p.muted { margin: 0; max-width: 70ch; }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.head-actions .btn { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 3px 4px 3px 10px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); font-size: .8rem; }
.chip:not(:has(button)) { padding-right: 10px; }
.chip-k { color: var(--faint); font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.chip code { padding: 0; border: 0; background: none; }

/* ---- stat cards (Luarmor style: colored icon squares, big numbers) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0 0 18px; }
.kpis.kpis-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi {
  display: flex; align-items: center; gap: 14px; min-width: 0; padding: 18px;
  border-radius: var(--radius); background: var(--grad-card), var(--panel); border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .18);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.kpi:hover { border-color: rgba(99, 102, 241, .32); transform: translateY(-2px); }
.kpi-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border-radius: 13px; color: #fff; }
.kpi-body { min-width: 0; }
.kpi-label { margin: 0; color: var(--muted); font-size: .8rem; font-weight: 600; line-height: 1.3; }
.kpi-value { margin: 3px 0 0; color: var(--ink); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; white-space: nowrap; }
.kpi-value small { color: var(--faint); font-size: .95rem; font-weight: 700; }
.kpi-sub { margin: 3px 0 0; color: var(--faint); font-size: .75rem; line-height: 1.3; }
.tone-orange { background: linear-gradient(135deg, #fb923c, #ea580c); box-shadow: 0 8px 22px rgba(234, 88, 12, .28); }
.tone-blue { background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 8px 22px rgba(37, 99, 235, .28); }
.tone-purple { background: linear-gradient(135deg, #c084fc, #7c3aed); box-shadow: 0 8px 22px rgba(124, 58, 237, .28); }
.tone-red { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 8px 22px rgba(220, 38, 38, .28); }
.tone-teal { background: linear-gradient(135deg, #2dd4bf, #0d9488); box-shadow: 0 8px 22px rgba(13, 148, 136, .28); }
.tone-green { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 8px 22px rgba(5, 150, 105, .28); }
.tone-indigo { background: linear-gradient(135deg, #818cf8, #4f46e5); box-shadow: 0 8px 22px rgba(79, 70, 229, .28); }
.row-ico, .h-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; border-radius: 9px; color: #fff; box-shadow: none; }

/* ---- cards in the app */
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head > div { min-width: 0; }
.card-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.card-sub { margin: 5px 0 0; color: var(--muted); font-size: .86rem; }
.section-title { margin: 8px 0 14px; font-size: 1.15rem; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.dash-grid.dash-grid-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: start; }
.card-success { border-color: rgba(52, 211, 153, .38); }
.danger-card { border-color: rgba(248, 113, 113, .22); }
.danger-card .danger-zone { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0; padding: 0; border: 0; }
.danger-card .danger-zone label { flex: 1 1 260px; margin: 0; }
.danger-card .btn { margin: 0; }

/* ---- chart (server-rendered bars, 7/14-day toggle) */
.chart-card { display: flex; flex-direction: column; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .03); }
.seg-btn { min-height: 32px; padding: 5px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; transition: color .18s var(--ease), background .18s var(--ease); }
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"] { color: #fff; background: rgba(99, 102, 241, .32); }
.only-short { display: none; }
[data-range="7"] .only-short { display: inline; }
[data-range="7"] .only-long { display: none; }
[data-range="7"] .bar-col.older { display: none; }
.bars {
  display: flex; align-items: stretch; gap: 8px; height: 230px; margin-top: auto; padding: 4px 2px 0;
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 100% calc((100% - 26px) / 4); background-repeat: repeat-y;
}
.bar-col { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bar-n { height: 14px; color: var(--muted); font-family: var(--mono); font-size: .66rem; line-height: 14px; white-space: nowrap; }
.bar-track { display: flex; flex: 1; align-items: flex-end; width: 100%; max-width: 46px; }
.bar-fill { width: 100%; min-height: 3px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--cyan), var(--indigo)); box-shadow: 0 6px 18px rgba(59, 130, 246, .22); transition: filter .18s var(--ease); }
.bar-col:hover .bar-fill { filter: brightness(1.25); }
.bar-day { color: var(--faint); font-size: .66rem; white-space: nowrap; }

/* ---- usage card */
.usage-row + .usage-row { margin-top: 16px; }
.usage-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: var(--muted); font-size: .86rem; }
.usage-top .mono { color: var(--ink); font-size: .8rem; }
.small-note { margin: 16px 0 12px; font-size: .8rem; }
.usage-card .btn { margin: 0; }

/* ---- empty states */
.empty { display: flex; flex-direction: column; align-items: center; padding: 36px 16px; text-align: center; }
.empty.empty-compact { padding: 20px 12px; }
.empty-ico { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: 16px; color: var(--accent-hover); background: linear-gradient(135deg, rgba(107, 112, 255, .2), rgba(59, 202, 255, .08)); border: 1px solid rgba(107, 112, 255, .3); }
.empty-title { margin: 0 0 4px; color: var(--ink); font-size: 1.05rem; font-weight: 700; }
.empty-text { max-width: 46ch; margin: 0 0 16px; color: var(--muted); font-size: .92rem; }
.empty .btn { margin: 0; }

/* ---- buttons: green "add", colored action pills, loading state */
.btn .ico, .pill .ico { flex: none; }
.btn.btn-add { background: linear-gradient(135deg, #07805a, #047857); box-shadow: 0 8px 24px rgba(16, 185, 129, .22), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn.btn-add:hover { box-shadow: 0 12px 30px rgba(16, 185, 129, .32), inset 0 1px 0 rgba(255, 255, 255, .18); }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 12px;
  border-radius: 9px; border: 1px solid rgba(255, 255, 255, .1); color: #fff; font: inherit; font-size: .82rem; font-weight: 600;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: filter .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.pill:hover { color: #fff; filter: brightness(1.12); transform: translateY(-1px); }
.pill:active { transform: none; }
.pill.pill-lg { min-height: 44px; padding: 10px 16px; font-size: .9rem; border-radius: 11px; }
.pill-blue { background: linear-gradient(135deg, #2f6ff0, #2563eb); box-shadow: 0 6px 16px rgba(37, 99, 235, .25); }
.pill-red { background: linear-gradient(135deg, #e23b3b, #dc2626); box-shadow: 0 6px 16px rgba(220, 38, 38, .22); }
.pill-green { background: linear-gradient(135deg, #07805a, #047857); box-shadow: 0 6px 16px rgba(4, 120, 87, .25); }
.pill-teal { background: linear-gradient(135deg, #0f766e, #0e6a63); box-shadow: 0 6px 16px rgba(15, 118, 110, .25); }
.pill-orange { background: linear-gradient(135deg, #c2410c, #b13a0a); box-shadow: 0 6px 16px rgba(194, 65, 12, .25); }
.btn.is-loading, .pill.is-loading { position: relative; color: transparent !important; }
.btn.is-loading .ico, .pill.is-loading .ico { visibility: hidden; }
.btn.is-loading::after, .pill.is-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- tables in the app: stacked cards on phones */
.rtable td { vertical-align: middle; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions > * + * { margin-left: 6px; }
.cell-actions form.inline { display: inline-flex; }
.row-title { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.row-title > span:last-child { min-width: 0; }
.row-title strong { display: block; font-weight: 700; }
.row-title small { display: block; font-size: .74rem; }
.row-title:hover strong { color: var(--link-hover); }
.row-title code { background: none; border: 0; padding: 0; color: var(--ink); }
.copy-field { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.copy-field code, .copy-field small { display: inline-block; min-width: 0; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.copy-field.copy-field-block { display: flex; margin-top: 6px; }
.copy-field.copy-field-block code { flex: 1; max-width: none; padding: 8px 10px; }
.kv .copy-field code, .kv .copy-field small { max-width: 100%; white-space: normal; word-break: break-all; }
.detail { display: inline-block; max-width: 320px; color: var(--muted); word-break: break-word; }
.filter-empty { margin: 14px 0 0; text-align: center; }
.list-rows { margin: 0; padding: 0; list-style: none; }
.list-rows li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-rows li:last-child { border-bottom: 0; }
.list-main { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.list-main code { width: fit-content; }

/* ---- forms in the app */
.hint { display: block; margin: 6px 0 12px; color: var(--faint); font-size: .82rem; }
label .hint { margin-bottom: 0; font-weight: 400; }
.form-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 0 16px; align-items: end; }
.form-cols label { margin: 0 0 4px; }
.form-cols textarea { min-height: 46px; height: 46px; font-family: var(--font); font-size: .95rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.form-actions .btn { margin: 0; }
.span2 { grid-column: 1 / -1; }
.label-row { display: inline-flex; align-items: center; gap: 6px; }
.fieldset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; align-items: end; }
.public-link { margin: 6px 0 4px; font-size: .9rem; word-break: break-all; }
.file-drop { padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: rgba(255, 255, 255, .015); transition: border-color .18s var(--ease), background .18s var(--ease); }
.file-drop:hover, .file-drop:focus-within { border-color: rgba(129, 140, 248, .6); background: rgba(99, 102, 241, .05); }
.file-drop > span { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.file-drop input[type=file] { border-style: solid; }
.inline-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.inline-row input { flex: 1; min-width: 0; margin: 0; }
.inline-row .btn { flex: none; margin: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .btn, .btn-row form { margin: 0; }
.toolbar-card { padding: 14px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toolbar label { margin: 0; }
.toolbar .btn { margin: 0; }
.tb-search { flex: 1 1 260px; }
.tb-status select { margin: 0; min-width: 160px; }
.tb-filter { margin: 0; min-width: 220px; }
.input-ico { position: relative; display: block; }
.input-ico .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-ico input { margin: 0; padding-left: 38px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin-bottom: 16px; }
.mini-stats > div { padding: 10px 8px; border-radius: 12px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); text-align: center; }
.mini-n { display: block; color: var(--ink); font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.mini-n.ok { color: var(--ok); }
.mini-n.info { color: #7dd3fc; }
.mini-n.warn { color: var(--warn); }
.mini-n.danger { color: var(--danger); }
.mini-l { display: block; color: var(--faint); font-size: .66rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ban-form input { width: auto; min-width: 200px; margin: 0; }
.kill-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.profile { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile-avatar { width: 56px; height: 56px; flex: none; border-radius: 16px; font-size: 1.4rem; object-fit: cover; }
.profile-name, .profile-line { margin: 0; }
.profile-line { font-size: .88rem; }
.plan-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* plans (/billing) */
.plan-cards { margin-bottom: 18px; }
.plan-tile-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.plan-tile-head h3 { margin: 0; font-size: 1.15rem; text-transform: capitalize; }
.plan-tile-head .tag { margin-left: auto; }
.plan-tile .price { background: var(--grad-brand); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.grid3 > .card ul.check-list { display: grid; gap: 9px; margin: 0 0 18px; padding: 0; list-style: none; }
.check-list li { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--muted); font-size: .92rem; }
.check-list .ico { color: var(--teal); }
.plan-tile .plan-buy { margin: 0; }

/* project tabs */
.subnav.tabs { gap: 2px; }
.subnav.tabs a { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; }
.subnav.tabs a.active { color: #fff; background: rgba(99, 102, 241, .2); }

/* toasts (flash) */
.alert.toast { display: flex; align-items: flex-start; gap: 10px; }
.toast-ico { flex: none; margin-top: 1px; }
.toast-msg { flex: 1; min-width: 0; }
.toast-close { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 30px; min-height: 30px; margin: -4px -6px -4px 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: inherit; opacity: .75; cursor: pointer; }
.toast-close:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
.has-shell .flash-wrap .alert.toast { box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.has-shell .flash-wrap .alert.success { background: linear-gradient(rgba(52, 211, 153, .12), rgba(52, 211, 153, .12)), #12161c; }
.has-shell .flash-wrap .alert.error { background: linear-gradient(rgba(248, 113, 113, .12), rgba(248, 113, 113, .12)), #18131a; }
.has-shell .flash-wrap .alert.warn { background: linear-gradient(rgba(251, 191, 36, .10), rgba(251, 191, 36, .10)), #17161a; }
.has-shell .flash-wrap .alert[data-toast] { animation: toast-in .25s var(--ease); }
.alert.toast-hide { opacity: 0; transform: translateY(-6px); transition: opacity .25s var(--ease), transform .25s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* confirm dialog (built by app.js for [data-confirm]) */
.confirm-modal {
  width: min(420px, calc(100% - 32px)); max-width: none; padding: 0; border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--panel); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.confirm-modal::backdrop { background: rgba(4, 5, 9, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.confirm-modal[open] { animation: pay-in .2s var(--ease); }
.confirm-panel { padding: 24px 22px 20px; }
.confirm-ico { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin-bottom: 14px; border-radius: 13px; color: #fca5a5; background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .32); }
.confirm-panel h2 { margin: 0 0 8px; font-size: 1.15rem; }
.confirm-panel p { margin: 0 0 20px; color: var(--muted); font-size: .94rem; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.confirm-actions .btn { margin: 0; }

/* ---- responsive: drawer below 1024 px, stacked cards below 760 px */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .dash-grid.dash-grid-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .sidebar {
    width: min(304px, 86vw); visibility: hidden; transform: translateX(-102%);
    box-shadow: 30px 0 80px rgba(0, 0, 0, .55);
    transition: transform .26s var(--ease), visibility .26s var(--ease);
  }
  body.drawer-open .sidebar { visibility: visible; transform: none; }
  body.drawer-open { overflow: hidden; }
  .drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(4, 5, 9, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .26s var(--ease); }
  body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
  .sb-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .03); color: var(--muted); cursor: pointer; }
  .sb-item { min-height: 50px; font-size: 1rem; }
  .sb-subitem { min-height: 44px; font-size: .92rem; }
  .app-main { margin-left: 0; }
  .app-top { gap: 10px; padding: 0 14px; min-height: 60px; }
  .app-burger { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; padding: 0; border-radius: 12px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .03); color: var(--ink); cursor: pointer; }
  .app-top-brand { display: inline-flex; font-size: 1.05rem; }
  .crumbs { padding-left: 6px; border-left: 1px solid var(--line); }
  .crumbs li:not(.current) { display: none; }
  .app-content { padding: 22px 18px 48px; }
}
@media (max-width: 760px) {
  .app-top-brand span { display: none; }
  .app-content { padding: 18px 14px 40px; }
  .app-head { align-items: stretch; margin-bottom: 18px; }
  .app-head h1 { font-size: 1.5rem; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1 1 0; width: auto; }
  .kpis, .kpis.kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .kpi-ico { width: 40px; height: 40px; border-radius: 11px; }
  .kpi-value { font-size: 1.45rem; }
  .card { padding: 16px; border-radius: 14px; }
  .card:has(.rtable) { overflow-x: visible; }
  .bars { height: 190px; gap: 4px; }
  .bar-n { font-size: .58rem; }
  .bar-day { font-size: .58rem; }
  [data-range="14"] .bar-col:nth-child(odd) .bar-day, [data-range="14"] .bar-col .bar-n { visibility: hidden; }
  [data-range="7"] .bar-col .bar-n { visibility: visible; }
  .form-cols { grid-template-columns: minmax(0, 1fr); }
  .form-cols label { margin: 12px 0 0; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  input, select, textarea { font-size: 16px; } /* iOS: no zoom on focus */
  .subnav.tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .subnav.tabs::-webkit-scrollbar { display: none; }
  .subnav.tabs a { flex: none; }
  /* tables -> stacked cards */
  .rtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .02); }
  .rtable tr:last-child { margin-bottom: 0; }
  .rtable tbody tr:hover td { background: transparent; }
  .rtable td { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; padding: 5px 0; border: 0; text-align: right; }
  .rtable td::before { content: attr(data-label); flex: none; color: var(--faint); font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
  .rtable td > * { min-width: 0; }
  .rtable td.cell-main { display: block; margin-bottom: 4px; padding: 0 0 10px; border-bottom: 1px solid var(--line); text-align: left; }
  .rtable td.cell-main::before, .rtable td.cell-actions::before { display: none; }
  .rtable td.cell-actions { display: flex; flex-wrap: wrap; justify-content: stretch; gap: 8px; padding-top: 10px; white-space: normal; }
  .rtable td.cell-actions > * + * { margin-left: 0; }
  .rtable td.cell-actions > .pill, .rtable td.cell-actions > form { flex: 1 1 0; }
  .rtable td.cell-actions .pill { width: 100%; min-height: 44px; font-size: .88rem; }
  .copy-field code, .copy-field small { max-width: 52vw; }
  .pill { min-height: 40px; }
  .icon-btn.icon-btn-sm { width: 36px; height: 36px; }
  .toolbar .btn, .tb-status, .tb-status select { width: 100%; }
  .tb-filter { width: 100%; min-width: 0; }
  .inline-row { flex-wrap: wrap; }
  .inline-row .btn { width: 100%; }
  .action-row > form, .action-row .pill { width: 100%; }
  .ban-form { flex-wrap: wrap; }
  .ban-form input { width: 100%; min-width: 0; }
  .confirm-actions .btn { flex: 1 1 0; }
  .danger-card .btn { width: 100%; }
  .detail { max-width: 60vw; }
}
@media (prefers-reduced-motion: reduce) {
  .kpi:hover, .pill:hover { transform: none; }
  .btn.is-loading::after, .pill.is-loading::after { animation: none; }
}
.btn.disabled.is-loading, .pill.disabled.is-loading { opacity: .8; }

/* refinements */
.app-content input, .app-content textarea, .app-content select { display: block; }
.app-content label.check input { display: inline-block; }
.grid2.form-grid { gap: 0 18px; }
.form-cols textarea { resize: vertical; }
.rtable code { white-space: nowrap; }
input[type=file]::file-selector-button {
  margin-right: 12px; padding: 7px 14px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .06); color: var(--ink); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer;
  transition: background .18s var(--ease);
}
input[type=file]::file-selector-button:hover { background: rgba(255, 255, 255, .1); }
input[type=file] { color: var(--muted); }
/* only the flash toast floats; config warnings stay in the page flow */
.has-shell .flash-wrap { position: static; width: auto; }
.has-shell .flash-wrap .alert.toast { position: fixed; top: calc(var(--top-h) + 14px); right: 20px; z-index: 70; width: min(420px, calc(100% - 40px)); margin: 0; }
@media (max-width: 1023px) {
  .has-shell .flash-wrap .alert.toast { top: auto; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 24px); }
}

/* ==================================================================
   OWNER SHELL: Luarmor look (deep navy / dark grey, colored icon squares, colored action buttons).
   Overrides the generic shell rules above. Scoped to body.has-shell (+ the public reward page).
   Palette: bg #12141c, sidebar #0e1017, cards #1c1f2b, line rgba(255,255,255,.06).
   Tones: green #22c55e, blue #3b82f6, purple #a855f7, red #ef4444, orange #f97316, pink #ec4899, teal #14b8a6.
   ================================================================== */
body.has-shell {
  --lm-bg: #12141c; --lm-side: #0e1017; --lm-card: #1c1f2b; --lm-card-2: #232736; --lm-line: rgba(255, 255, 255, .06);
  --lm-green: #22c55e; --lm-blue: #3b82f6; --lm-purple: #a855f7; --lm-red: #ef4444; --lm-orange: #f97316; --lm-pink: #ec4899; --lm-teal: #14b8a6;
  background: var(--lm-bg);
}
.has-shell .sidebar { background: var(--lm-side); border-right-color: var(--lm-line); }
.has-shell .sb-item { min-height: 44px; border-radius: 10px; font-weight: 600; }
.has-shell .sb-item.active { color: #fff; background: rgba(59, 130, 246, .14); border-color: transparent; box-shadow: inset 3px 0 0 var(--lm-blue); }
.has-shell .sb-ico { width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .05); }
.has-shell .sb-item.active .sb-ico { background: var(--lm-blue); color: #fff; box-shadow: 0 6px 16px rgba(59, 130, 246, .35); }
.has-shell .sb-subitem.active { color: #fff; background: rgba(59, 130, 246, .12); }
.sb-new {
  margin-left: auto; padding: 2px 7px; border-radius: 6px; font-size: .62rem; font-weight: 800; letter-spacing: .06em;
  color: #fff; background: var(--lm-green, #22c55e); box-shadow: 0 0 0 1px rgba(34, 197, 94, .35), 0 4px 12px rgba(34, 197, 94, .25);
}
.sb-logout-form { margin: 2px 0 0; }
.sb-item-btn { width: 100%; background: none; font: inherit; text-align: left; cursor: pointer; }
.sb-item-btn:hover { color: #fca5a5; }
.has-shell .sb-plan { background: var(--lm-card); border: 1px solid var(--lm-line); border-radius: 12px; }
.has-shell .app-top { background: rgba(18, 20, 28, .92); border-bottom-color: var(--lm-line); }
.has-shell .crumbs .crumb-root a { color: var(--muted); font-weight: 600; }
.plan-pill {
  display: inline-flex; align-items: center; min-height: 30px; padding: 3px 12px; border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  color: #dbeafe; background: rgba(59, 130, 246, .18); border: 1px solid rgba(59, 130, 246, .45);
}
.plan-pill:hover { color: #fff; background: rgba(59, 130, 246, .28); }
.plan-pill.plan-free { color: var(--muted); background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14); }
.plan-pill.plan-pro { color: #d8b4fe; background: rgba(168, 85, 247, .16); border-color: rgba(168, 85, 247, .45); }
.plan-pill.plan-premium { color: #fde68a; background: rgba(245, 158, 11, .15); border-color: rgba(245, 158, 11, .45); }
.has-shell .top-ico { width: 38px; height: 38px; border-radius: 50%; background: var(--lm-card); border-color: var(--lm-line); }
.plan-banner { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: .9rem; }
.plan-banner svg { flex: none; }
.plan-banner a { color: #fff; text-decoration: underline; }
.plan-banner-red { color: #fff; background: #b91c1c; border: 1px solid #ef4444; }
.plan-banner-amber { color: #1c1408; background: #f59e0b; border: 1px solid #fbbf24; }
.plan-banner-amber a { color: #1c1408; }

/* cards */
.has-shell .card, .has-shell .kpi, .has-shell .proj-card { background: var(--lm-card); border: 1px solid var(--lm-line); box-shadow: none; border-radius: 14px; }
.has-shell .card-head h2 { font-size: 1.05rem; }

/* stat cards */
.scards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 18px; }
.scards.scards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scard { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px; border-radius: 14px; background: var(--lm-card, #1c1f2b); border: 1px solid rgba(255, 255, 255, .06); }
.scard-top { display: flex; align-items: center; gap: 14px; min-width: 0; }
.scard-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border-radius: 12px; color: #fff; }
.scard-main { display: flex; flex-direction: column; min-width: 0; }
.scard-label { color: var(--muted); font-size: .8rem; font-weight: 600; }
.scard-value { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.scard-bar { display: flex; flex-direction: column; gap: 6px; }
.scard-bar small { color: var(--muted); font-size: .72rem; }
.scard-sub { margin: 0; color: var(--faint); font-size: .76rem; }
.tone-green { background: #22c55e; } .tone-blue { background: #3b82f6; } .tone-purple { background: #a855f7; }
.tone-red { background: #ef4444; } .tone-orange { background: #f97316; } .tone-pink { background: #ec4899; } .tone-teal { background: #14b8a6; }
.scard-ico.tone-green { box-shadow: 0 8px 22px rgba(34, 197, 94, .28); } .scard-ico.tone-blue { box-shadow: 0 8px 22px rgba(59, 130, 246, .28); }
.scard-ico.tone-purple { box-shadow: 0 8px 22px rgba(168, 85, 247, .28); } .scard-ico.tone-red { box-shadow: 0 8px 22px rgba(239, 68, 68, .28); }
.scard-ico.tone-orange { box-shadow: 0 8px 22px rgba(249, 115, 22, .28); } .scard-ico.tone-pink { box-shadow: 0 8px 22px rgba(236, 72, 153, .28); }
.scard-ico.tone-teal { box-shadow: 0 8px 22px rgba(20, 184, 166, .28); }
.meter.tone-green .meter-fill, .has-shell .meter.tone-green .meter-fill { background: #22c55e; }
.meter.tone-blue .meter-fill, .has-shell .meter.tone-blue .meter-fill { background: #3b82f6; }
.meter.tone-purple .meter-fill, .has-shell .meter.tone-purple .meter-fill { background: #a855f7; }
.meter.tone-red .meter-fill { background: #ef4444; }
.meter.tone-orange .meter-fill, .has-shell .meter.tone-orange .meter-fill { background: #f97316; }
.meter.tone-pink .meter-fill { background: #ec4899; }
.meter.tone-teal .meter-fill { background: #14b8a6; }
.meter.meter-hot .meter-fill { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.has-shell .kpi-ico, .has-shell .h-ico { border-radius: 12px; }

/* colored buttons */
.has-shell .btn.btn-add, .has-shell .btn.btn-green, .btn.btn-green { background: #22c55e; color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(34, 197, 94, .22); }
.has-shell .btn.btn-add:hover, .has-shell .btn.btn-green:hover, .btn.btn-green:hover { background: #16a34a; color: #fff; filter: none; }
.has-shell .btn.btn-blue, .btn.btn-blue { background: #3b82f6; color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(59, 130, 246, .22); }
.has-shell .btn.btn-blue:hover, .btn.btn-blue:hover { background: #2563eb; color: #fff; filter: none; }
.has-shell .pill.pill-blue { color: #fff; background: #3b82f6; border-color: transparent; }
.has-shell .pill.pill-blue:hover { background: #2563eb; color: #fff; }
.has-shell .pill.pill-green { color: #fff; background: #22c55e; border-color: transparent; }
.has-shell .pill.pill-green:hover { background: #16a34a; color: #fff; }
.has-shell .pill.pill-red { color: #fff; background: #ef4444; border-color: transparent; }
.has-shell .pill.pill-red:hover { background: #dc2626; color: #fff; }
.has-shell .bar-fill { background: linear-gradient(90deg, #3b82f6, #22c55e); }
.has-shell .seg-btn[aria-pressed="true"] { color: #fff; background: #3b82f6; }
.has-shell .subnav.tabs a.active { color: #fff; background: rgba(59, 130, 246, .16); box-shadow: inset 0 -2px 0 #3b82f6; }
.has-shell .lang-switch a.active { color: #fff; background: #3b82f6; }
.txt-red { color: #f87171; } .txt-amber { color: #fbbf24; } .txt-green { color: #4ade80; }

/* live: server status + realtime chart */
.srv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 4px 0 10px; }
.srv-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px; border-radius: 12px; background: var(--lm-card-2, #232736); border: 1px solid rgba(255, 255, 255, .06); }
.srv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.srv-region { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; min-width: 0; }
.srv-id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .7rem; font-weight: 800; color: #4ade80; background: rgba(34, 197, 94, .14); border: 1px solid rgba(34, 197, 94, .4); }
.up-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); animation: up-pulse 2s infinite; }
@keyframes up-pulse { 50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); } }
.srv-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.srv-metrics div { min-width: 0; }
.srv-metrics dt { color: var(--faint); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.srv-metrics dd { margin: 2px 0 0; font-weight: 750; font-size: 1.05rem; }
.rt-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.poll-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .05); color: var(--muted); font-size: .75rem; }
.poll-pill code { padding: 0; border: 0; background: none; }
.rt-chart { position: relative; min-height: 240px; margin: 6px 0 8px; border-radius: 12px; background: rgba(0, 0, 0, .18); border: 1px solid rgba(255, 255, 255, .05); }
.rt-svg { display: block; width: 100%; height: 240px; }
.rt-empty { margin: 0; padding: 100px 16px; text-align: center; }
.rt-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.rt-leg { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .03); color: var(--ink); font: inherit; font-size: .78rem; cursor: pointer; }
.rt-leg.off { opacity: .45; text-decoration: line-through; }
.copy-field { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.copy-field code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.copy-field-block { display: flex; margin: 8px 0; padding: 6px 6px 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, .2); border: 1px solid rgba(255, 255, 255, .06); }
.copy-field-block code { flex: 1; border: 0; background: none; }

/* project cards (Luarmor "Projects") */
.pcards { display: flex; flex-direction: column; gap: 16px; margin: 0 0 18px; }
.pcard { padding: 18px; border-radius: 16px; background: var(--lm-card, #1c1f2b); border: 1px solid rgba(255, 255, 255, .06); }
.pcard-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pcard-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, #3b82f6, #a855f7); color: #fff; font-weight: 800; font-size: 1.1rem; }
.pcard-title { display: flex; flex-direction: column; flex: 1; min-width: 160px; }
.pcard-title h2 { margin: 0; font-size: 1.1rem; }
.pcard-title h2 a { color: var(--ink); text-decoration: none; }
.pcard-title h2 a:hover { color: #93c5fd; }
.pcard-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.act { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 14px; border-radius: 9px; color: #fff; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; border: 0; cursor: pointer; transition: filter .15s, transform .15s; }
.act:hover { color: #fff; filter: brightness(1.1); }
.act:active { transform: translateY(1px); }
.act-green { background: #22c55e; } .act-blue { background: #3b82f6; } .act-grey { background: #343949; color: #cbd5e1; }
.act-icon { width: 38px; padding: 0; }
.pcard-empty { margin: 14px 0 0; }
.pcard-scripts { margin-top: 16px; border-top: 1px solid rgba(255, 255, 255, .06); }
.pcard-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 140px; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.pcard-row:last-child { border-bottom: 0; }
.pcard-row-head { color: var(--faint); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; padding-top: 12px; }
.pcard-script { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.pcard-script:hover strong { color: #93c5fd; }
.pcard-sname { display: flex; flex-direction: column; min-width: 0; }
.pcard-sname strong, .pcard-sname small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lua-badge { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 38px; height: 26px; border-radius: 7px; background: rgba(59, 130, 246, .18); color: #93c5fd; font-size: .66rem; font-weight: 900; letter-spacing: .06em; }

/* toggle switches */
.toggle-form { margin: 0; }
.toggle-inline { display: inline-flex; align-items: center; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; border-radius: 999px; background: #3a3f52; transition: background .18s; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.switch input:checked + .switch-track { background: #22c55e; }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid #93c5fd; outline-offset: 2px; }
.switch-text { font-size: .85rem; font-weight: 650; color: var(--muted); }

/* users hub tabs */
.ptabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.ptabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; background: var(--lm-card, #1c1f2b); border: 1px solid rgba(255, 255, 255, .06); color: var(--muted); font-weight: 650; font-size: .86rem; text-decoration: none; }
.ptabs a:hover { color: var(--ink); }
.ptabs a.active { color: #fff; background: #3b82f6; border-color: transparent; }
.ptab-n { padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: .7rem; }

/* modals (dismissible info / edit dialogs) */
dialog.modal { width: min(560px, calc(100% - 24px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid rgba(255, 255, 255, .08); border-radius: 16px; background: #1c1f2b; color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
dialog.modal.modal-wide { width: min(860px, calc(100% - 24px)); }
dialog.modal::backdrop { background: rgba(5, 7, 12, .72); }
.modal-panel { padding: 20px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.modal-head h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 1.1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.feature-modal .modal-panel { text-align: center; padding: 28px 24px; }
.feature-modal .modal-actions { justify-content: center; }
.feature-ico { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 16px; color: #fff; margin-bottom: 10px; }

/* bottom toast (API is up and working!) */
.mini-toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 11px 16px; border-radius: 12px; transform: translateX(-50%); color: #fff; font-size: .88rem; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); animation: toast-in .25s ease-out; transition: opacity .4s, transform .4s; }
.mini-toast strong { font-weight: 800; }
.mini-toast-ok { background: #16a34a; } .mini-toast-err { background: #dc2626; }
.mini-toast-hide { opacity: 0; transform: translate(-50%, 10px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* rewards */
.rw-filter { margin: 0 0 16px; }
.rw-item { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.rw-item:last-of-type { border-bottom: 0; }
.rw-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rw-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rw-cb summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.cb-list { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: .84rem; }
.cp-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.cp { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .06); }
.cp.cp-done { border-color: rgba(34, 197, 94, .35); }
.cp.cp-next { border-color: rgba(59, 130, 246, .45); }
.cp .pill { justify-self: end; }
.cp-n { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: #ec4899; color: #fff; font-weight: 800; font-size: .8rem; }
.cp-label { font-size: .85rem; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.pie-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.pie { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 160px; height: 160px; border-radius: 50%; background: #ef4444; }
.pie::after { content: ""; position: absolute; inset: 26px; border-radius: 50%; background: var(--lm-card, #1c1f2b); }
.pie span { position: relative; z-index: 1; font-size: 1.4rem; font-weight: 800; }
.pie-legend { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.pie-legend li { display: flex; align-items: center; gap: 8px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.dot-green { background: #22c55e; } .dot-red { background: #ef4444; }
.block { display: block; } .block-sm { display: block; font-size: .8rem; }
.rw-public { max-width: 560px; margin: 32px auto; }
.rw-public .gate-card { background: #1c1f2b; }

/* key/value list (profile) */
.kv { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 0; margin: 0 0 14px; }
.kv > div { display: contents; }
.kv dt { padding: 9px 12px 9px 0; color: var(--muted); font-size: .82rem; font-weight: 600; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.kv dd { margin: 0; padding: 9px 0; font-weight: 600; border-bottom: 1px solid rgba(255, 255, 255, .05); min-width: 0; overflow-wrap: anywhere; }
/* default (primary) buttons inside the shell are Luarmor blue */
.has-shell .btn:not(.ghost):not(.danger):not(.btn-green):not(.btn-add) { background: #3b82f6; color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(59, 130, 246, .2); }
.has-shell .btn:not(.ghost):not(.danger):not(.btn-green):not(.btn-add):hover { background: #2563eb; filter: none; }
.has-shell .btn.danger { background: #ef4444; color: #fff; border-color: transparent; }
.has-shell .btn.danger:hover { background: #dc2626; }

/* footer links in shell */
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-links a { color: var(--muted); font-size: .84rem; }
.footer-links a:hover { color: var(--ink); }
.has-shell .footer { border-top-color: var(--lm-line); }

@media (max-width: 1100px) { .scards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .scards, .scards.scards-3 { grid-template-columns: minmax(0, 1fr); }
  .pcard-row { grid-template-columns: 56px minmax(0, 1fr); }
  .hide-sm { display: none; }
  .pcard-actions { width: 100%; }
  .pcard-actions .act:not(.act-icon) { flex: 1 1 auto; }
  .srv-grid { grid-template-columns: minmax(0, 1fr); }
  .plan-pill { display: none; }
  .has-shell .top-ico { display: none; }
  .rt-svg { height: 200px; }
  .rt-chart { min-height: 200px; }
}
@media (prefers-reduced-motion: reduce) { .up-dot, .mini-toast { animation: none; } }
.pie.p0 { background: #ef4444; }
.pie.p5 { background: conic-gradient(#22c55e 0 5%, #ef4444 5% 100%); }
.pie.p10 { background: conic-gradient(#22c55e 0 10%, #ef4444 10% 100%); }
.pie.p15 { background: conic-gradient(#22c55e 0 15%, #ef4444 15% 100%); }
.pie.p20 { background: conic-gradient(#22c55e 0 20%, #ef4444 20% 100%); }
.pie.p25 { background: conic-gradient(#22c55e 0 25%, #ef4444 25% 100%); }
.pie.p30 { background: conic-gradient(#22c55e 0 30%, #ef4444 30% 100%); }
.pie.p35 { background: conic-gradient(#22c55e 0 35%, #ef4444 35% 100%); }
.pie.p40 { background: conic-gradient(#22c55e 0 40%, #ef4444 40% 100%); }
.pie.p45 { background: conic-gradient(#22c55e 0 45%, #ef4444 45% 100%); }
.pie.p50 { background: conic-gradient(#22c55e 0 50%, #ef4444 50% 100%); }
.pie.p55 { background: conic-gradient(#22c55e 0 55%, #ef4444 55% 100%); }
.pie.p60 { background: conic-gradient(#22c55e 0 60%, #ef4444 60% 100%); }
.pie.p65 { background: conic-gradient(#22c55e 0 65%, #ef4444 65% 100%); }
.pie.p70 { background: conic-gradient(#22c55e 0 70%, #ef4444 70% 100%); }
.pie.p75 { background: conic-gradient(#22c55e 0 75%, #ef4444 75% 100%); }
.pie.p80 { background: conic-gradient(#22c55e 0 80%, #ef4444 80% 100%); }
.pie.p85 { background: conic-gradient(#22c55e 0 85%, #ef4444 85% 100%); }
.pie.p90 { background: conic-gradient(#22c55e 0 90%, #ef4444 90% 100%); }
.pie.p95 { background: conic-gradient(#22c55e 0 95%, #ef4444 95% 100%); }
.pie.p100 { background: #22c55e; }

/* ---------------------------------------------------------------- admin panel (staff) — Luarmor shell */
.brand-tag { margin-left: 6px; padding: 2px 6px; border-radius: 6px; font-size: .58rem; font-weight: 800; letter-spacing: .1em; color: #fff; background: #ef4444; vertical-align: middle; }
.sb-count { margin-left: auto; min-width: 22px; padding: 2px 7px; border-radius: 999px; font-size: .7rem; font-weight: 800; text-align: center; color: #fff; background: #ef4444; box-shadow: 0 4px 12px rgba(239, 68, 68, .3); }
.top-ico { position: relative; }
.dot-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: .64rem; font-weight: 800; line-height: 18px; text-align: center; color: #fff; background: #ef4444; }
.has-shell .top-ico-alert { color: #fca5a5; }
.plan-pill.role-owner { color: #fca5a5; background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .45); }
.plan-pill.role-admin { color: #93c5fd; background: rgba(59, 130, 246, .16); border-color: rgba(59, 130, 246, .45); }
.plan-pill.role-moderator { color: #d8b4fe; background: rgba(168, 85, 247, .16); border-color: rgba(168, 85, 247, .45); }
.plan-pill.role-support { color: #6ee7b7; background: rgba(34, 197, 94, .14); border-color: rgba(34, 197, 94, .42); }
span.plan-pill:hover { filter: none; }
.is-admin .card { background: var(--lm-card, #1c1f2b); border-color: rgba(255, 255, 255, .06); border-radius: 14px; }
.is-admin .page-head h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.is-admin .eyebrow a { color: inherit; text-decoration: none; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; margin: 8px 0 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.perm-grid legend { padding: 0 6px; color: var(--muted); font-size: .85rem; }
.perm-item { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; font-size: .86rem; }
.perm-item input { width: auto; margin: 0; }
.perm-item code { margin-left: auto; font-size: .7rem; color: var(--faint); }
.perm-details { margin: 6px 0 12px; }
.perm-details summary { cursor: pointer; color: var(--muted); }
.role-matrix th, .role-matrix td { text-align: center; padding: 6px 8px; }
.role-matrix td:first-child, .role-matrix th:first-child { text-align: left; }
.cell-yes { color: #4ade80; }
.cell-no { color: rgba(255, 255, 255, .2); }
.online-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: rgba(255, 255, 255, .18); vertical-align: middle; }
.online-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.row-muted td { opacity: .8; }
.stack-form { display: flex; flex-direction: column; gap: 4px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 16px 0 0; font-size: .88rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.ua { display: inline-block; max-width: 260px; color: var(--muted); word-break: break-word; }
.audit-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.audit-filters label { margin: 0; }
.audit-filter-btns { display: flex; gap: 8px; padding-bottom: 2px; }
.audit-export { margin: 12px 0 0; }
.diff summary { cursor: pointer; color: #93c5fd; font-size: .82rem; }
.diff pre { max-width: 360px; max-height: 220px; overflow: auto; margin: 4px 0; padding: 8px; font-size: .72rem; border-radius: 8px; background: rgba(0, 0, 0, .3); }
.code-hot { color: #fca5a5; }
.secret-box { padding: 12px; border-radius: 10px; background: rgba(0, 0, 0, .35); font-size: .9rem; white-space: pre-wrap; word-break: break-all; }
.settings-group { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0; }
.settings-group legend { padding: 0 6px; font-weight: 700; }
.settings-group label small { display: block; margin-top: 2px; font-weight: 400; }
.settings-form textarea { width: 100%; min-height: 280px; font-family: var(--mono, ui-monospace, monospace); font-size: .86rem; }
.settings-form .grid3 { margin-bottom: 14px; }
.rules-doc p { line-height: 1.65; }
.rules-accept { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.rules-accept label { margin: 0; }
.steps-list { margin: 0 0 12px; padding-left: 20px; color: var(--muted); }
code.wrap { word-break: break-all; white-space: normal; }
.note-form { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.note-form textarea { width: 100%; }
.note-form .btn { align-self: flex-start; }
.notes-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.note { padding: 12px 14px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.note-meta { display: flex; gap: 10px; align-items: baseline; }
.note-body { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; }
.grid2.tight { gap: 0 14px; }
.gate-alt { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.gate-alt summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.gate-alt .gate-form { margin-top: 12px; }
.admin-quota { margin-bottom: 14px; }
@media (max-width: 720px) {
  .kv { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: 1fr; }
  .ua { max-width: 160px; }
}
.alert.info { border-color: rgba(59, 130, 246, .35); background: rgba(59, 130, 246, .08); color: #bfdbfe; }
.audit-table { font-size: .84rem; }
.audit-table th, .audit-table td { padding: 9px 8px; }
.audit-table .nowrap, .admin-table td.nowrap { white-space: nowrap; }
.audit-table td:nth-child(4), .audit-table td:nth-child(5) { max-width: 220px; word-break: break-word; }
.diff[open] pre { max-width: 300px; }

/* ------------------------------------------------------------------ v5: executions, webhooks, assistant */
.ex-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ex-bars li { display: grid; grid-template-columns: minmax(110px, 180px) 1fr auto; align-items: center; gap: 6px 14px; }
.ex-bars .ex-name { font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-bars .ex-name:hover, .ex-bars .ex-name:focus-visible { color: var(--link-hover); text-decoration: underline; }
.ex-bars .meter { height: 8px; }
.ex-bars .ex-num { font-size: .86rem; color: var(--muted); white-space: nowrap; }
.ex-bars .ex-meta { grid-column: 2 / -1; margin-top: -4px; }
.wh-status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
.wh-status > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wh-hint { overflow-wrap: anywhere; font-size: .82rem; }
.wh-events { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 4px; margin: 0; display: grid; gap: 6px; }
.wh-events legend { padding: 0 6px; color: var(--muted); font-size: .85rem; }
.wh-events .check span, label.check span small { display: inline; }
.ai-card { display: flex; flex-direction: column; gap: 12px; }
.ai-log { min-height: 320px; max-height: min(62vh, 640px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 8px; overscroll-behavior: contain; }
.ai-welcome { margin: auto; text-align: center; max-width: 520px; display: grid; justify-items: center; gap: 6px; padding: 24px 8px; }
.ai-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.ai-chips .pill { white-space: normal; text-align: left; }
.ai-msg { display: flex; flex-direction: column; gap: 4px; max-width: min(760px, 92%); }
.ai-msg.ai-user { align-self: flex-end; align-items: flex-end; }
.ai-who { font-size: .75rem; color: var(--faint); letter-spacing: .02em; }
.ai-bubble { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); }
.ai-user .ai-bubble { background: rgba(99, 102, 241, .16); border-color: rgba(99, 102, 241, .35); }
.ai-note .ai-bubble { background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .25); font-size: .92rem; }
.ai-thinking { color: var(--muted); animation: ai-pulse 1.2s ease-in-out infinite; }
@keyframes ai-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .ai-thinking { animation: none; } }
.ai-status { align-self: flex-start; font-size: .8rem; color: var(--muted); padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--field); }
.ai-status.is-done { color: #6ee7b7; }
.ai-status.is-error { color: #fca5a5; border-color: rgba(248, 113, 113, .3); border-radius: 10px; padding: 8px 12px; line-height: 1.45; max-width: 100%; overflow-wrap: anywhere; }
.ai-confirm, .ai-secret { align-self: stretch; max-width: 760px; border: 1px solid rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .07); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.ai-confirm-danger { border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .07); }
.ai-confirm p { margin: 0; overflow-wrap: anywhere; }
.ai-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ai-confirm-actions .btn { margin: 0; }
.ai-confirm-result.is-ok { color: #6ee7b7; }
.ai-confirm-result.is-error { color: #fca5a5; }
.ai-secret { border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .06); }
.ai-secret-text { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.ai-secret .pill { justify-self: start; }
.ai-form { display: flex; gap: 10px; align-items: flex-end; }
.ai-form textarea { flex: 1; resize: vertical; min-height: 52px; max-height: 200px; }
.ai-form .btn { margin: 0; }
.ai-card.is-busy .ai-form textarea { opacity: .7; }
@media (max-width: 640px) {
  .ex-bars li { grid-template-columns: 1fr auto; }
  .ex-bars .meter { grid-column: 1 / -1; grid-row: 2; }
  .ex-bars .ex-meta { grid-column: 1 / -1; grid-row: 3; margin-top: 0; }
  .wh-status { grid-template-columns: 1fr; }
  .ai-log { max-height: 58vh; min-height: 260px; }
  .ai-msg { max-width: 100%; }
  .ai-form { flex-direction: column; align-items: stretch; }
  .ai-form .btn { width: 100%; justify-content: center; }
}
/* Admin AI assistant (/admin/ai) */
.ai-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ai-head form.inline { margin-top: 6px; }
.ai-secret-label { font-size: .8rem; color: var(--muted); }
.ai-status.is-trying { color: var(--muted); font-style: italic; }
@media (max-width: 640px) { .ai-head form.inline { width: 100%; } .ai-head form.inline .btn { width: 100%; justify-content: center; } }
