/* botenv ui — clean, smooth, quicksand (single-story a) */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&display=swap');

:root,
html[data-theme="light"] {
  --bg: #eef0f4;
  --bg2: #e4e7ec;
  --card: #ffffff;
  --chip: #f1f3f6;
  --border: #e4e7ec;
  --border-soft: #ebedf1;
  --text: #16191d;
  --muted: #6b7280;
  --btn: #1c1f24;
  --btn-fg: #ffffff;
  --nav: #ffffff;
  --accent: #e11d48;
  --accent-soft: rgba(225, 29, 72, 0.1);
  --blue: #2563eb;
  --green: #15803d;
  --green-soft: rgba(21, 128, 61, 0.12);
  --orange: #ea580c;
  --red: #dc2626;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 8px 30px rgba(16, 24, 40, 0.1);
  --radius: 16px;
  --radius-sm: 12px;
  --font: 'Quicksand', system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #0f1115;
  --bg2: #161a20;
  --card: #1a1e26;
  --chip: #222733;
  --border: #2a303c;
  --border-soft: #232833;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --btn: #f3f4f6;
  --btn-fg: #111827;
  --nav: #14181f;
  --accent: #fb7185;
  --accent-soft: rgba(251, 113, 133, 0.15);
  --blue: #60a5fa;
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.12);
  --orange: #fb923c;
  --red: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
  /* Disable text selection / long-press blue highlight on UI */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
/* Global: no selection highlight on interactive / static UI */
button,
a,
label,
span,
p,
h1, h2, h3, h4, h5, h6,
li,
div,
svg,
img,
.side-link,
.side-sublink,
.side-parent,
.config-tab,
.switch,
.switch-row,
.status-pill,
.chip,
.card,
.field > label {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
/* Hide selection color if browser still draws it */
::selection {
  background: transparent;
  color: inherit;
}
::-moz-selection {
  background: transparent;
  color: inherit;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }

/* Re-enable text selection only where needed (inputs / forms / codes / editable) */
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
textarea,
code,
.pairing-code,
[contenteditable="true"],
[contenteditable=""],
.allow-select {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default;
}
/* Selection highlight inside form fields / codes remains visible */
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"])::selection,
textarea::selection,
code::selection,
.pairing-code::selection,
.allow-select::selection {
  background: rgba(37, 99, 235, 0.35);
  color: inherit;
}
input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"])::-moz-selection,
textarea::-moz-selection,
code::-moz-selection,
.pairing-code::-moz-selection,
.allow-select::-moz-selection {
  background: rgba(37, 99, 235, 0.35);
  color: inherit;
}

/* ——— brand ——— */
.brand {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.15em;
  text-decoration: none;
  background: linear-gradient(
    110deg,
    var(--text) 0%,
    var(--text) 35%,
    #7c9cff 50%,
    var(--text) 65%,
    var(--text) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: brand-shimmer 5s ease-in-out infinite;
  filter: drop-shadow(0 0 12px color-mix(in srgb, #7c9cff 28%, transparent));
  transition: filter 0.25s ease, transform 0.2s ease;
}
.brand:hover {
  filter: drop-shadow(0 0 18px color-mix(in srgb, #7c9cff 45%, transparent));
  transform: translateY(-0.5px);
}
@keyframes brand-shimmer {
  0%, 100% { background-position: 100% 50%; }
  50% { background-position: 0% 50%; }
}
.brand-box {
  /* legacy helper – keep for any leftover markup */
  background: var(--btn);
  color: var(--btn-fg);
  padding: 0.15em 0.45em;
  border-radius: 0.4em;
  font-weight: 700;
  -webkit-text-fill-color: var(--btn-fg);
  color: var(--btn-fg);
  background-clip: border-box;
  -webkit-background-clip: border-box;
}

/* ——— nav ——— */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--nav) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.25s var(--ease);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}
.nav-links a {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 0.6rem; }

.icon-btn {
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:hover { color: var(--text); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  border: none;
  background: var(--btn);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), opacity 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--chip); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ——— landing ——— */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.hero {
  padding: 4.5rem 0 3rem;
  text-align: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--chip);
  border: 1px solid var(--border);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.badge svg { width: 16px; height: 16px; color: var(--green); }
.hero h1 {
  font-size: clamp(1.85rem, 4.5vw, 2.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  max-width: 18ch;
  margin: 0 auto 1rem;
}
.hero h1 .hl { color: var(--green); }
.hero .sub {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 500;
  max-width: 36rem;
  margin: 0 auto 1.75rem;
}
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.section { padding: 3rem 0; }
.section-head { text-align: center; margin-bottom: 2rem; }
.section-head h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.section-head p { color: var(--muted); font-weight: 500; }

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
.tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tile svg { display: block; width: 28px; height: 28px; margin: 0 auto 0.65rem; color: var(--text); }
.tile span { font-weight: 700; font-size: 0.9rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--chip);
  display: grid; place-items: center;
  margin-bottom: 0.9rem;
}
.card-icon svg { width: 20px; height: 20px; }
.card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem; }
.card p { color: var(--muted); font-size: 0.92rem; font-weight: 500; }


/* ——— pricing ——— */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 960px;
  margin: 0 auto;
}
.price-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.35rem 1.4rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.price-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.price-card.featured {
  border-color: color-mix(in srgb, var(--text) 35%, var(--border));
  box-shadow: var(--shadow-lg);
}
.price-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
}
.price-tier {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.price-amount {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.35rem;
}
.price-amount span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}
.price-desc {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
.price-features {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  flex: 1;
}
.price-features li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.35rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border-soft);
}
.price-features li:last-child { border-bottom: none; }
.price-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}
@media (max-width: 800px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; }
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-q {
  width: 100%;
  text-align: left;
  padding: 1rem 1.15rem;
  background: none;
  border: none;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq-q svg { width: 18px; height: 18px; transition: transform 0.25s var(--ease); flex-shrink: 0; }
.faq-item.open .faq-q svg { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}
.faq-item.open .faq-a { max-height: 200px; }
.faq-a p {
  padding: 0 1.15rem 1.1rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.94rem;
}

.footer {
  padding: 3rem 0 2rem;
  text-align: center;
  border-top: 1px solid var(--border-soft);
  margin-top: 2rem;
}
.footer-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.footer-desc { color: var(--muted); font-weight: 500; max-width: 28rem; margin: 0 auto 1.25rem; font-size: 0.95rem; }
.footer-links { display: flex; gap: 1.25rem; justify-content: center; margin-bottom: 1.25rem; }
.footer-links a { font-weight: 600; color: var(--muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }
.footer-copy {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
  margin-top: 0.25rem;
}
.copy-legacy-footer { color: var(--muted); font-size: 0.82rem; font-weight: 500; }

/* fade */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.6s var(--ease) forwards;
}
@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}

/* ——— app shell ——— */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100dvh;
}
.sidebar {
  background: var(--nav);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.sidebar .brand { margin-bottom: 1.5rem; padding: 0 0.5rem; }
.side-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.2s, color 0.2s;
}
.side-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-link:hover { background: var(--chip); color: var(--text); }
.side-link.active { background: var(--chip); color: var(--text); }

.side-group { display: flex; flex-direction: column; }
.side-parent { position: relative; }
.side-caret {
  margin-left: auto;
  width: 15px !important;
  height: 15px !important;
  transition: transform 0.2s var(--ease);
}
.side-parent.expanded .side-caret { transform: rotate(90deg); }
.side-submenu {
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s var(--ease);
}
.side-submenu.open { max-height: 220px; }
.side-sublink {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.6rem;
  border: none;
  background: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  position: relative;
}
.side-sublink::before {
  content: '';
  position: absolute;
  left: 1.35rem;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transform: translateY(-50%);
}
.side-sublink:hover { background: var(--chip); color: var(--text); }
.side-sublink.active { background: var(--chip); color: var(--text); }
.side-sublink.active::before { background: var(--text); }
.side-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border-soft); }

.config-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.1rem;
}
.config-tab {
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.config-tab:hover { color: var(--text); }
.config-tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.side-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem 0.85rem;
}
.side-theme-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
}
.side-theme-label svg { width: 18px; height: 18px; flex-shrink: 0; }

.main {
  padding: 0 0 3rem;
  max-width: none;
  min-width: 0;
}
.main-inner {
  padding: 1.25rem 1.5rem 0;
  max-width: 960px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.page-sub { color: var(--muted); font-weight: 500; margin-bottom: 1.5rem; font-size: 0.95rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 1.25rem;
}
.toolbar .spacer { flex: 1; }

/* form */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-weight: 500;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent);
}
.field textarea { min-height: 90px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-soft);
}
.switch-row:last-child { border-bottom: none; }
.switch-row span { font-weight: 600; font-size: 0.92rem; }
.switch {
  width: 44px; height: 26px;
  border-radius: 999px;
  background: var(--bg2);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.switch.on { background: var(--green); border-color: var(--green); }
.switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s var(--ease);
}
.switch.on::after { transform: translateX(18px); }

/* session cards */
.session-grid {
  display: grid;
  gap: 0.85rem;
}
.session-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  transition: transform 0.2s var(--ease);
}
.session-card:hover { transform: translateY(-1px); }
.session-name { font-weight: 700; font-size: 1rem; }
.session-meta { color: var(--muted); font-size: 0.85rem; font-weight: 500; margin-top: 0.2rem; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: lowercase;
}
.status-pill::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status-CONNECTED { background: var(--green-soft); color: var(--green); }
.status-QR, .status-PAIRING, .status-CONNECTING, .status-RECONNECTING {
  background: color-mix(in srgb, var(--orange) 15%, transparent);
  color: var(--orange);
}
.status-DISCONNECTED, .status-STOPPED, .status-ERROR, .status-CREATING {
  background: var(--chip); color: var(--muted);
}
.session-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }

/* modal */
.overlay {
  position: fixed; inset: 0;
  background: rgba(15, 17, 21, 0.55);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  width: min(420px, 100%);
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.3s var(--ease);
}
.overlay.show .modal { transform: none; }
.modal h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.35rem; }
.modal .modal-sub { color: var(--muted); font-size: 0.9rem; font-weight: 500; margin-bottom: 1.15rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.25rem; }
.qr-box {
  background: #fff;
  border-radius: 12px;
  padding: 0.75rem;
  display: grid;
  place-items: center;
  margin: 0.75rem 0;
}
.qr-box img { width: 220px; height: 220px; }
.pairing-code-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.75rem 0;
}
.pairing-code {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
  padding: 0.75rem 1rem;
  background: var(--chip);
  border-radius: 12px;
  /* pairing code must be selectable / copyable */
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default;
  cursor: text;
  flex: 1;
  min-width: 0;
}
.pairing-code::selection {
  background: rgba(37, 99, 235, 0.35);
  color: inherit;
}
.pairing-code::-moz-selection {
  background: rgba(37, 99, 235, 0.35);
  color: inherit;
}

/* Icon copy button (pairing code) — adapted from Uiverse.io / Galahhad */
.copy {
  --button-bg: var(--chip);
  --button-hover-bg: var(--border);
  --button-text-color: var(--muted);
  --button-hover-text-color: var(--text);
  --button-border-radius: 10px;
  --button-diameter: 40px;
  --tooltip-bg: var(--text);
  --tooltip-border-radius: 6px;
  --tooltip-font-size: 11px;
  --tooltip-text-color: var(--bg);
  --tooltip-padding-x: 8px;
  --tooltip-padding-y: 6px;
  --tooltip-offset: 8px;
  box-sizing: border-box;
  width: var(--button-diameter);
  height: var(--button-diameter);
  border-radius: var(--button-border-radius);
  background: var(--button-bg);
  color: var(--button-text-color);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  outline: none;
  flex-shrink: 0;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.copy .tooltip {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: var(--tooltip-font-size);
  font-weight: 600;
  font-family: var(--font);
  color: var(--tooltip-text-color);
  background: var(--tooltip-bg);
  padding: var(--tooltip-padding-y) var(--tooltip-padding-x);
  border-radius: var(--tooltip-border-radius);
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s, top 0.2s;
  z-index: 5;
}
.copy .tooltip::before {
  content: attr(data-text-initial);
}
.copy .tooltip::after {
  content: "";
  position: absolute;
  bottom: -3px;
  width: 6px;
  height: 6px;
  background: inherit;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  z-index: -1;
}
.copy-icons {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}
.copy svg {
  grid-area: 1 / 1;
  display: block;
}
.copy .checkmark {
  display: none;
}
.copy:hover .tooltip,
.copy.copied .tooltip {
  opacity: 1;
  visibility: visible;
  top: calc((100% + var(--tooltip-offset)) * -1);
}
.copy.copied .tooltip::before {
  content: attr(data-text-end);
}
.copy.copied .clipboard {
  display: none;
}
.copy.copied .checkmark {
  display: block;
}
.copy:hover,
.copy:focus-visible {
  background: var(--button-hover-bg);
  color: var(--button-hover-text-color);
}
.copy:active {
  transform: scale(0.96);
}

.pairing-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* toast — polished, matches site tokens */
.toast-wrap {
  position: fixed;
  bottom: 1.35rem;
  right: 1.35rem;
  left: auto;
  z-index: 300;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.6rem;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 1.5rem));
}
.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem 1rem 1rem;
  box-shadow: var(--shadow-lg), 0 12px 40px rgba(16, 24, 40, 0.08);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.4;
  max-width: 100%;
  min-width: 240px;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.94);
  transition:
    opacity 0.38s var(--ease),
    transform 0.42s var(--ease);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.toast.show {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}
.toast.hide {
  opacity: 0;
  transform: translate3d(12px, 0, 0) scale(0.96);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}
.toast-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.toast-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.toast-msg {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  color: var(--text);
  letter-spacing: -0.01em;
}
.toast-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  opacity: 0.65;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.toast-close svg {
  width: 14px;
  height: 14px;
}
.toast-close:hover {
  opacity: 1;
  color: var(--text);
  background: var(--chip);
}
.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  transform-origin: left center;
  animation: toastProgress linear forwards;
  border-radius: 0 0 16px 16px;
  opacity: 0.9;
}
.toast-success .toast-progress { animation-duration: 2.8s; }
.toast-info .toast-progress { animation-duration: 2.8s; }
.toast-warning .toast-progress { animation-duration: 2.8s; }
.toast-error .toast-progress { animation-duration: 3.8s; }
@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* toast type colors — soft tint + icon chip */
.toast-success {
  border-color: color-mix(in srgb, var(--green) 28%, var(--border));
  background: color-mix(in srgb, var(--green) 7%, var(--card));
}
.toast-success .toast-icon {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 16%, transparent);
}
.toast-success .toast-progress { background: var(--green); }

.toast-error {
  border-color: color-mix(in srgb, var(--red) 32%, var(--border));
  background: color-mix(in srgb, var(--red) 7%, var(--card));
}
.toast-error .toast-icon {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 14%, transparent);
}
.toast-error .toast-progress { background: var(--red); }

.toast-warning {
  border-color: color-mix(in srgb, var(--orange) 32%, var(--border));
  background: color-mix(in srgb, var(--orange) 7%, var(--card));
}
.toast-warning .toast-icon {
  color: var(--orange);
  background: color-mix(in srgb, var(--orange) 14%, transparent);
}
.toast-warning .toast-progress { background: var(--orange); }

.toast-info {
  border-color: color-mix(in srgb, var(--blue) 26%, var(--border));
  background: color-mix(in srgb, var(--blue) 6%, var(--card));
}
.toast-info .toast-icon {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 14%, transparent);
}
.toast-info .toast-progress { background: var(--blue); }

@media (max-width: 480px) {
  .toast-wrap {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 1rem;
    align-items: stretch;
    max-width: none;
  }
  .toast {
    min-width: 0;
    width: 100%;
  }
}

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-weight: 500;
}
.empty svg { display: block; width: 48px; height: 48px; margin: 0 auto 0.75rem; opacity: 0.5; }

.login-card {
  max-width: 440px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem 1.35rem;
  box-shadow: var(--shadow-lg);
}
.login-card h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  text-align: center;
}
.login-card .sub {
  text-align: center;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
}

/* auth tabs */
.auth-tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 0.3rem;
  margin-bottom: 1.25rem;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.55rem 0.5rem;
  border-radius: calc(var(--radius-sm) - 4px);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.auth-tab.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.auth-form h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  text-align: center;
}
.auth-error {
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 1.1rem;
  margin: -0.35rem 0 0.75rem;
  text-align: center;
}

/* email verification banner (dashboard) */
.verify-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  background: rgba(234, 88, 12, 0.1);
  color: var(--orange);
  border: 1px solid rgba(234, 88, 12, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 1rem;
}
.verify-banner svg { width: 18px; height: 18px; flex: none; }
.verify-banner-btn {
  border: 1px solid rgba(234, 88, 12, 0.35);
  background: transparent;
  color: var(--orange);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.verify-banner-btn:hover { background: rgba(234, 88, 12, 0.12); }
.verify-banner-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.verify-banner-msg { font-size: 0.78rem; font-weight: 600; opacity: 0.85; }

/* plugin editor */


.plugin-tags { color: var(--muted); font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em; }
.chip-mini { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 0.1em 0.45em; border-radius: 999px; background: var(--chip); color: var(--muted); vertical-align: middle; }

/* account / api key */
.hint { color: var(--muted); font-weight: 500; font-size: 0.78rem; }
.apikey-row { display: flex; gap: 0.5rem; align-items: center; }
.apikey-row input { flex: 1; font-family: monospace; letter-spacing: 0.02em; }

/* mobile */
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 85vw);
    z-index: 60;
    transform: translateX(-105%);
    transition: transform 0.3s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .side-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .side-backdrop.show { opacity: 1; pointer-events: auto; }
  .main { padding: 0 0 2.5rem; }
  .nav-links { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .session-card { grid-template-columns: 1fr; }
  .session-actions { justify-content: flex-start; }
}
@media (min-width: 769px) {
  .side-backdrop { display: none; }
}

/* ——— plugins page ——— */
.plugin-folder {
  margin-bottom: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow: hidden;
}
.plugin-folder-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  text-align: left;
}
.plugin-folder-toggle:hover {
  background: color-mix(in srgb, var(--chip) 50%, transparent);
}
.plugin-folder-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.folder-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.2s var(--ease);
}
.plugin-folder.open .folder-chevron {
  transform: rotate(90deg);
}
.plugin-folder-name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}
.plugin-folder-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.plugin-folder-body {
  display: none;
  padding: 0;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.plugin-folder.open .plugin-folder-body {
  display: block;
}
.plugin-card {
  padding: 1rem 1rem 1.1rem;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none !important;
  background: transparent !important;
  border-bottom: 1px solid var(--border-soft);
  transform: none !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.plugin-card:hover {
  transform: none !important;
  box-shadow: none !important;
}
.plugin-card:last-child {
  border-bottom: none;
}
.plugin-card .field,
.plugin-card .field input,
.plugin-card .field textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.plugin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}
.plugin-head-text { min-width: 0; flex: 1; }
.plugin-name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
}
.plugin-tags {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 0.12rem;
  word-break: break-word;
}
.perm-list {
  margin-top: 0.35rem;
}
.perm-list-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin: 0.35rem 0 0.1rem;
}
.perm-list .switch-row {
  padding: 0.8rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-soft);
  width: 100%;
}
.perm-list .switch-row:last-child {
  border-bottom: none;
}
.perm-list .switch-row span {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}
.plugin-actions {
  margin-top: 0.75rem;
  gap: 0.45rem;
  flex-wrap: wrap;
  display: flex;
}
.plugin-responses {
  margin-top: 0.55rem;
}
.plugin-responses .field {
  margin-bottom: 0.5rem;
}
.plugin-responses textarea {
  min-height: 3.5rem;
  width: 100%;
}
.session-pick {
  margin-bottom: 0.9rem;
}



/* ——— admin panel ——— */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.admin-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  text-align: center;
}
.admin-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.admin-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.15rem;
}
.admin-section { margin-bottom: 1.5rem; }
.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}
.admin-h2 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}
.admin-search {
  max-width: 200px;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  font-family: inherit;
  font-weight: 500;
}
.admin-user-card, .admin-session-card {
  padding: 1rem 1.1rem;
  margin-bottom: 0.65rem;
}
.admin-user-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
}
.admin-user-row label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}
.admin-user-row select,
.admin-user-row input {
  max-width: 140px;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  font-family: inherit;
  font-weight: 500;
}
.hint { color: var(--muted); }


/* auth switch links */
.auth-switch {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
}
.auth-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}
.auth-link:hover { opacity: 0.85; }
.auth-form h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}
.auth-form .sub {
  margin-bottom: 1.15rem;
}


/* ——— auth page sticky header + outline fields ——— */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.auth-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--nav) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.25s var(--ease);
}
.auth-topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.auth-topbar .brand {
  font-size: 1.2rem;
}
.auth-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--card);
  transition: background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}
.auth-back:hover {
  background: var(--chip);
}
.auth-back svg {
  width: 18px;
  height: 18px;
}
.auth-page-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem 2rem;
  width: 100%;
}
.auth-page-body .login-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.login-card {
  max-width: 440px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem 1.35rem;
  box-shadow: var(--shadow-lg);
}

/* Outline label field — legend-style */
.outline-field {
  position: relative;
  margin: 0 0 1.15rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.outline-field:focus-within {
  border-color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent);
}
.outline-field label {
  position: absolute;
  top: 0;
  left: 0.85rem;
  transform: translateY(-50%);
  padding: 0 0.35rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  color: var(--muted);
  background: var(--card);
  pointer-events: none;
  z-index: 1;
}
.outline-field input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 1.05rem 0.95rem 0.9rem;
  font-family: inherit;
  font-weight: 500;
  font-size: 1rem;
  color: var(--text);
  border-radius: 14px;
}
.outline-field input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

@media (max-width: 480px) {
  .auth-page-body {
    padding: 1rem 0.85rem 1.75rem;
    align-items: flex-start;
  }
  .login-card {
    padding: 1.5rem 1.1rem;
    border-radius: 18px;
  }
  .auth-page-body .login-card {
    max-width: 100%;
  }
}


/* password show/hide */
.outline-field.has-toggle input {
  padding-right: 2.75rem;
}
.pw-toggle {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 10px;
  padding: 0;
}
.pw-toggle:hover {
  color: var(--text);
}
.pw-toggle svg {
  width: 18px;
  height: 18px;
}
.pw-toggle .hidden {
  display: none;
}


.side-theme {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.5rem;
}

/* dashboard sticky topbar */
.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  margin-bottom: 0.5rem;
  background: color-mix(in srgb, var(--nav) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.dash-topbar .brand {
  font-size: 1.2rem;
}
.dash-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.dash-topbar .icon-btn {
  width: 40px;
  height: 40px;
}
.main > section,
.main > .toolbar {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.main > section {
  max-width: 960px;
}
@media (max-width: 768px) {
  .main > section {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .dash-topbar {
    padding: 0.85rem 1rem;
  }
}


/* ——— dashboard pricing / checkout ——— */
.pay-current {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  font-weight: 500;
}
.dash-pricing {
  max-width: none;
  margin-bottom: 1.25rem;
}
.checkout-panel {
  margin-top: 0.5rem;
}
.checkout-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow);
  max-width: 420px;
}
.checkout-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.qris-wrap {
  display: flex;
  justify-content: center;
  margin: 0.85rem 0;
  padding: 0.75rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.qris-img {
  width: 220px;
  height: 220px;
  display: block;
}
.pay-status {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--chip);
  color: var(--muted);
}
.pay-status.wait {
  background: color-mix(in srgb, var(--orange) 18%, transparent);
  color: var(--orange);
}
.pay-status.ok {
  background: color-mix(in srgb, var(--green) 18%, transparent);
  color: var(--green);
}
.pay-status.bad {
  background: color-mix(in srgb, var(--red) 16%, transparent);
  color: var(--red);
}


/* feature lock */
.feature-lock { margin: 1rem 0; }
.lock-card {
  text-align: center;
  padding: 2rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 360px;
  margin: 0 auto;
}
.lock-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.85rem;
  color: var(--muted);
}
.lock-icon svg { width: 100%; height: 100%; }
.lock-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.35rem; }
.lock-card p { color: var(--muted); font-weight: 500; margin-bottom: 1rem; font-size: 0.92rem; }

/* dashboard overview */
.dash-overview { margin-bottom: 1.25rem; }
.ov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.65rem;
}
.ov-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
}
.ov-label { font-size: 0.72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 0.25rem; }
.ov-value { font-weight: 700; font-size: 0.95rem; word-break: break-word; }
.ov-cta { display: flex; flex-direction: column; justify-content: space-between; gap: 0.5rem; }

/* payment page */
.pay-page-card { max-width: 440px; }
.pay-status-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.85rem; }
.pay-status-text { font-weight: 800; font-size: 1.05rem; }
.pay-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.pay-countdown {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.65rem;
  color: var(--text);
}
.pay-anim {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
}
.pay-anim svg {
  width: 44px;
  height: 44px;
}
.pay-anim circle {
  stroke: currentColor;
  stroke-width: 2;
  stroke-dasharray: 150;
  stroke-dashoffset: 150;
  animation: pay-circle 0.45s ease forwards;
}
.pay-anim path {
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: pay-check 0.35s 0.25s ease forwards;
}
.pay-anim.ok { color: var(--green); }
.pay-anim.wait { color: var(--orange); }
.pay-anim.bad { color: var(--red); }
@keyframes pay-circle {
  to { stroke-dashoffset: 0; }
}
@keyframes pay-check {
  to { stroke-dashoffset: 0; }
}
.btn-spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}




/* upgrade promo modal */
.upgrade-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 18, 25, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.upgrade-overlay.hidden { display: none; }
.upgrade-modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.22);
  animation: up-pop 0.28s ease;
}
@keyframes up-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.upgrade-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.upgrade-head {
  background: #141414;
  color: #fff;
  text-align: center;
  padding: 1.5rem 1.25rem 1.25rem;
}
.upgrade-crown {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.65rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.upgrade-crown svg { width: 24px; height: 24px; color: #fff; }
.upgrade-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.3rem;
}
.upgrade-head p {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.8;
  font-weight: 500;
}
.upgrade-body { padding: 1.1rem 1.15rem 1.15rem; }
.upgrade-benefits {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.upgrade-benefits li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.55rem;
  line-height: 1.35;
  color: var(--text);
}
.ub-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 22%, transparent);
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}
.upgrade-plans {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.upgrade-plan {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.upgrade-plan.selected {
  border-color: var(--text);
  background: var(--card);
}
.upgrade-plan strong { display: block; font-size: 0.95rem; }
.up-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 0.15rem;
}
.up-price {
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
}
.up-price span {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
}
.upgrade-cta {
  width: 100%;
  justify-content: center;
  margin-bottom: 0.65rem;
}
.upgrade-channel {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.45rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.upgrade-channel:hover { opacity: 0.8; }
.upgrade-later {
  display: block;
  width: 100%;
  border: none;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.4rem;
  cursor: pointer;
}
.upgrade-later:hover { color: var(--text); }


/* locked feature gate — preview blurred, lock card centered */
.feature-gate {
  position: relative;
  min-height: 420px;
}
.feature-gate.is-locked .feature-content {
  filter: blur(4px);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}
.feature-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  background: color-mix(in srgb, var(--bg) 30%, transparent);
}
.feature-lock-overlay.hidden { display: none !important; }
.lock-card {
  text-align: center;
  padding: 1.5rem 1.35rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 300px;
  width: 100%;
}
.lock-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.75rem;
  color: var(--muted);
}
.lock-icon svg { width: 100%; height: 100%; }
.lock-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3rem; }
.lock-card p { color: var(--muted); font-weight: 500; margin-bottom: 1rem; font-size: 0.9rem; line-height: 1.4; }

/* upgrade promo modal (free users on dashboard) */
.upgrade-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 18, 25, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.upgrade-backdrop.hidden { display: none; }
.upgrade-modal {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: upgrade-in 0.28s ease;
}
@keyframes upgrade-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.upgrade-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.upgrade-close svg { width: 16px; height: 16px; }
.upgrade-head {
  background: #151515;
  color: #fff;
  text-align: center;
  padding: 1.5rem 1.25rem 1.25rem;
}
.upgrade-crown {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.65rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.upgrade-crown svg { width: 24px; height: 24px; }
.upgrade-head h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 0 0.3rem;
  letter-spacing: -0.02em;
}
.upgrade-head p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.8;
  font-weight: 500;
}
.upgrade-body { padding: 1rem 1.15rem 1.2rem; }
.upgrade-benefits {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.upgrade-benefits li {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.35rem 0;
  line-height: 1.35;
  color: var(--text);
}
.upgrade-benefits li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--green);
}
.upgrade-plan {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.15s ease;
}
.upgrade-plan.selected {
  border-color: var(--text);
  background: var(--card);
}
.upgrade-plan-name { font-weight: 700; font-size: 0.92rem; }
.upgrade-plan-meta { font-size: 0.75rem; color: var(--muted); font-weight: 500; margin-top: 0.15rem; }
.upgrade-plan-price { font-weight: 800; font-size: 0.95rem; text-align: right; white-space: nowrap; }
.upgrade-plan-price span { display: block; font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.upgrade-actions { margin-top: 0.85rem; }
.upgrade-actions .btn { width: 100%; justify-content: center; }
.upgrade-later {
  display: block;
  width: 100%;
  margin-top: 0.55rem;
  border: none;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.45rem;
}
.upgrade-channel {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.upgrade-channel p {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 0.5rem;
}
.upgrade-channel a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: #128C7E;
}
.upgrade-channel a svg { width: 18px; height: 18px; }


/* ——— payment page polish ——— */
.pay-page-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 1.25rem 1.15rem 1.35rem;
  border: 1px solid var(--border);
  box-shadow: none;
}
.pay-status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.pay-status-text {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.pay-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pay-badge svg {
  width: 20px;
  height: 20px;
}
.pay-badge.ok {
  background: color-mix(in srgb, var(--green) 16%, transparent);
  color: var(--green);
}
.pay-badge.wait {
  background: color-mix(in srgb, var(--orange, #e8a317) 16%, transparent);
  color: var(--orange, #c4841d);
}
.pay-badge.bad {
  background: color-mix(in srgb, var(--red) 14%, transparent);
  color: var(--red);
}
.pay-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
}
.pay-meta .hint {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pay-countdown {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 1rem;
  text-align: center;
}
.qris-box {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 0.85rem;
  padding: 0.85rem;
  background: #fff;
  border-radius: 14px;
  width: fit-content;
  max-width: 100%;
}
.qris-img {
  width: min(300px, 78vw);
  height: auto;
  aspect-ratio: 1;
  display: block;
  border: none;
  outline: none;
  box-shadow: none;
  image-rendering: pixelated;
}
.qris-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 0.9rem;
}
.qris-actions .btn {
  border-radius: 999px;
}
#paymentRoot .toolbar {
  justify-content: stretch;
}
#paymentRoot .toolbar .btn {
  flex: 1;
  justify-content: center;
}
@media (max-width: 400px) {
  .pay-meta { grid-template-columns: 1fr; }
  .qris-img { width: min(280px, 85vw); }
}


/* pending clock animation */
.pay-badge-pulse {
  animation: pay-pulse 1.6s ease-in-out infinite;
}
.pay-clock-hand {
  transform-origin: 12px 12px;
  animation: pay-hand 2s linear infinite;
}
@keyframes pay-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.88; }
}
@keyframes pay-hand {
  to { transform: rotate(360deg); }
}

/* pay check overlay */
.pay-check-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 24, 32, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: upgrade-in 0.2s ease;
}
.pay-check-overlay.hidden { display: none; }
.pay-check-card {
  background: var(--card);
  border-radius: 16px;
  padding: 1.5rem 1.4rem 1.35rem;
  min-width: 220px;
  max-width: 300px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.pay-check-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pay-check-icon svg {
  width: 64px;
  height: 64px;
}
.pay-check-icon.success { color: var(--green); }
.pay-check-icon.pending,
.pay-check-icon.error { color: var(--red); }
.pay-check-icon.success circle,
.pay-check-icon.pending circle,
.pay-check-icon.error circle {
  stroke: currentColor;
  stroke-width: 2;
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: pay-circle 0.45s ease forwards;
}
.pay-check-icon.success path,
.pay-check-icon.pending path,
.pay-check-icon.error path {
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: pay-check 0.35s 0.22s ease forwards;
}
.pay-check-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid color-mix(in srgb, var(--muted) 35%, transparent);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.pay-check-msg {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.35;
}
