/**
 * IjwiLab site system — marketing, studio chrome, developer, auth.
 * Voice / lake teal (not purple). Brand-first, calm surfaces.
 */
:root {
  --bg: #07110f;
  --bg-elevated: #0c1815;
  --surface: #12201c;
  --surface-2: #182822;
  --border: #243530;
  --border-strong: #334840;
  --muted: #8fa39a;
  --text: #e6efe9;
  --text-strong: #f5faf7;
  --accent: #14b8a6;
  --accent-2: #2dd4bf;
  --accent-soft: rgba(20, 184, 166, 0.14);
  --accent-glow: rgba(45, 212, 191, 0.22);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --danger-bg: #3f1212;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  --font: "Figtree", system-ui, sans-serif;
  --display: "Bricolage Grotesque", "Sora", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1120px;
  --nav-h: 4rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 100% 70% at 50% -20%, rgba(20, 184, 166, 0.18), transparent 55%),
    radial-gradient(ellipse 45% 40% at 100% 10%, rgba(16, 185, 129, 0.08), transparent 50%),
    linear-gradient(180deg, #07110f 0%, #0a1512 40%, #07110f 100%);
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #5eead4; }
img { max-width: 100%; height: auto; }
code, .mono { font-family: var(--mono); font-size: 0.9em; }
code.inline {
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent-2);
}

/* —— Nav —— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  backdrop-filter: blur(16px);
  background: rgba(7, 17, 15, 0.82);
  border-bottom: 1px solid var(--border);
}
.site-nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-strong);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.site-brand img {
  height: 36px;
  width: auto;
  display: block;
}
.site-brand-logo img {
  height: 42px;
  width: auto;
  max-width: min(200px, 52vw);
  object-fit: contain;
}
.site-brand span { color: var(--muted); font-weight: 500; font-size: 0.78rem; margin-left: 0.15rem; }
.site-nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav-links a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 550;
  text-decoration: none;
}
.site-nav-links a:hover,
.site-nav-links a.is-active { color: var(--text-strong); }
.site-nav-links .nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: var(--accent);
  color: #042f2e !important;
  font-weight: 700;
  font-size: 0.8125rem;
}
.site-nav-links .nav-cta:hover { filter: brightness(1.08); color: #042f2e !important; }

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-elevated);
}
.lang-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent-2);
}

.nav-account { display: flex; align-items: center; gap: 0.5rem; }
.nav-signin-btn,
.nav-profile-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-strong);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.nav-signin-btn:hover,
.nav-profile-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.nav-profile-wrap { position: relative; }
.nav-profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 0.4rem;
  display: none;
  z-index: 60;
}
.nav-profile-menu.is-open { display: block; }
.nav-profile-menu a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.8125rem;
  text-decoration: none;
}
.nav-profile-menu a:hover { background: var(--accent-soft); color: var(--text-strong); }

/* —— Buttons —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, background 0.15s, border-color 0.15s;
}
.btn-primary {
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #042f2e !important;
  border-color: transparent;
}
.btn-primary:hover { filter: brightness(1.08); color: #042f2e !important; }
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-strong) !important;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-2) !important; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8125rem; }
.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca !important;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* —— Layout —— */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}
.page-head h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-strong);
  margin: 0 0 0.35rem;
}
.page-head .sub { margin: 0; color: var(--muted); font-size: 0.95rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }

/* —— Marketing hero (landing) —— */
.hero-plane {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero-plane::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 70% 40%, rgba(20, 184, 166, 0.2), transparent 60%),
    radial-gradient(ellipse 50% 40% at 15% 70%, rgba(6, 95, 70, 0.35), transparent 55%),
    linear-gradient(180deg, transparent 0%, rgba(7, 17, 15, 0.55) 55%, var(--bg) 100%);
  pointer-events: none;
}
.hero-wave {
  position: absolute;
  inset: 12% 0 28%;
  width: 100%;
  height: auto;
  opacity: 0.55;
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.25rem;
}
.hero-brand-mark {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
  animation: rise 0.7s ease both;
}
.hero-brand-mark img {
  height: clamp(52px, 10vw, 72px);
  width: auto;
  filter: drop-shadow(0 8px 24px rgba(20, 184, 166, 0.25));
}
.hero-brand-mark strong {
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 3.35rem);
  font-weight: 750;
  letter-spacing: -0.05em;
  color: var(--text-strong);
  line-height: 1;
}
.hero-plane h1 {
  font-family: var(--display);
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 0.75rem;
  max-width: 18ch;
  animation: rise 0.7s ease 0.08s both;
}
.hero-plane .lede {
  margin: 0 0 1.5rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.125rem);
  animation: rise 0.7s ease 0.16s both;
}
.hero-plane .cta-row { animation: rise 0.7s ease 0.24s both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-brand-mark, .hero-plane h1, .hero-plane .lede, .hero-plane .cta-row { animation: none; }
}

/* —— Sections —— */
.section {
  padding: 3.25rem 0 1rem;
  border-top: 1px solid transparent;
}
.section-head {
  margin-bottom: 1.25rem;
}
.section-head h2 {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  letter-spacing: -0.03em;
  color: var(--text-strong);
  margin: 0 0 0.4rem;
}
.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 36rem;
  font-size: 0.975rem;
}

.api-strip {
  margin: 2.5rem 0 0;
  padding: 1.75rem 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.4fr auto;
  align-items: center;
}
@media (max-width: 720px) {
  .api-strip { grid-template-columns: 1fr; }
}
.api-strip h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
  color: var(--text-strong);
}
.api-strip p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.why-line {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
@media (max-width: 800px) {
  .why-line { grid-template-columns: 1fr; gap: 1.15rem; }
}
.why-line h3 {
  font-family: var(--display);
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}
.why-line p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* —— Developer surfaces —— */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 860px) { .stats { grid-template-columns: 1fr; } }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.stat-label { display: block; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-2);
  letter-spacing: -0.03em;
  margin: 0.2rem 0;
}
.stat-hint { font-size: 0.8rem; color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}
.panel h2 {
  font-family: var(--display);
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}
.panel .meta { margin: 0 0 1rem; color: var(--muted); font-size: 0.85rem; }
.card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}
.layout-2 {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) { .layout-2 { grid-template-columns: 1fr; } }

.field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.field-row { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 0.9rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-row input { flex: 1; min-width: 160px; width: auto; }

.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.list-item:last-child { border-bottom: 0; }
.list-item.empty { color: var(--muted); display: block; }
.item-meta { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }
.key-prefix { font-family: var(--mono); color: var(--accent-2); }
.key-reveal {
  display: block;
  margin-top: 0.55rem;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--text-strong);
}

.alert {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-warn {
  background: var(--warn-soft);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fde68a;
}
.alert-ok {
  background: var(--success-soft);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}
.alert-err {
  background: var(--danger-soft);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fecaca;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--muted);
}
.pill-live {
  border-color: rgba(52, 211, 153, 0.4);
  background: var(--success-soft);
  color: var(--success);
}

.hero-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(120deg, rgba(20, 184, 166, 0.12), transparent 55%),
    var(--surface);
}
.hero-banner h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  margin: 0 0 0.35rem;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}
.hero-banner p { margin: 0; color: var(--muted); font-size: 0.9rem; max-width: 40rem; }

.quick-grid { display: grid; gap: 0.45rem; }
.quick-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: inherit;
  text-decoration: none;
}
.quick-link:hover { border-color: var(--accent); }
.quick-link strong { display: block; color: var(--text-strong); font-size: 0.9rem; }
.quick-link span span { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }
.quick-link .arrow { color: var(--accent-2); }

.docs-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 860px) { .docs-grid { grid-template-columns: 1fr; } }
.docs-toc {
  position: sticky;
  top: calc(var(--nav-h) + 0.75rem);
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.docs-toc a {
  display: block;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}
.docs-toc a:hover { color: var(--text-strong); background: var(--accent-soft); }
.docs-body h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin: 1.75rem 0 0.65rem;
}
.docs-body h2:first-child { margin-top: 0; }
.docs-body p, .docs-body li { color: var(--muted); font-size: 0.95rem; }
.docs-body pre,
.code-block pre {
  background: #050a09;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #c8e6d8;
  line-height: 1.5;
  margin: 0;
}
.code-block {
  position: relative;
  margin: 0.75rem 0;
}
.code-block .copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 1;
}
.docs-main h2,
.docs-body h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin: 1.75rem 0 0.65rem;
}
.docs-main h2:first-child { margin-top: 0; }
.docs-main h3 {
  font-size: 0.95rem;
  color: var(--text-strong);
  margin: 1.1rem 0 0.5rem;
}
.docs-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 860px) { .docs-layout { grid-template-columns: 1fr; } }
.docs-toc a.is-active {
  color: var(--text-strong);
  background: var(--accent-soft);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0.5rem 0 1rem;
}
table.data th,
table.data td {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  vertical-align: top;
}
table.data th { color: var(--text-strong); font-weight: 650; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.method {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--mono);
}
.method-post { background: rgba(20, 184, 166, 0.15); color: #5eead4; }
.method-get { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; }
.pill-ok { border-color: rgba(52, 211, 153, 0.4); background: var(--success-soft); color: var(--success); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.15rem 1.25rem; margin-bottom: 0.75rem; }
.meta { color: var(--muted); font-size: 0.85rem; }

.price-grid { display: grid; gap: 1rem; }
.price-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 860px) {
  .price-cards { grid-template-columns: 1fr; }
}
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  min-height: 100%;
}
.price-card-free {
  border-color: rgba(52, 211, 153, 0.35);
  background:
    linear-gradient(160deg, rgba(52, 211, 153, 0.1), transparent 55%),
    var(--surface);
}
.price-card-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.price-card h2 {
  font-family: var(--display);
  font-size: 1.05rem;
  margin: 0 0 0.65rem;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}
.price-card-value {
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 750;
  color: var(--accent-2);
  margin: 0 0 0.55rem;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.price-card-value span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: 0.15rem;
}
.price-card-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}
.rate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.55rem;
}
.rate-pill {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.rate-pill strong {
  display: block;
  font-family: var(--display);
  color: var(--accent-2);
  font-size: 1rem;
  margin-bottom: 0.15rem;
}
.rate-pill span { font-size: 0.78rem; color: var(--muted); }
.bundles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.bundles-tight .bundle {
  text-align: center;
  padding: 1rem 0.75rem;
}
.bundle {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.8125rem;
}
.bundle strong {
  display: block;
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--accent-2);
  margin-bottom: 0.1rem;
}
.bundle span { color: var(--muted); font-size: 0.78rem; }
.bundle em {
  display: block;
  margin-top: 0.35rem;
  font-style: normal;
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 650;
}
.free-line { color: var(--success); font-weight: 600; margin: 0.35rem 0 0.75rem; }

/* —— Dashboard sidebar —— */
.dash-body { background: var(--bg); }
.dash-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}
.dash-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.15rem 1rem 1.25rem;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(20, 184, 166, 0.08), transparent 28%),
    var(--bg-elevated);
  z-index: 30;
}
.dash-brand img { height: 44px; max-width: 180px; }
.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}
.dash-nav a {
  display: block;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.dash-nav a:hover { color: var(--text-strong); background: var(--accent-soft); }
.dash-nav a.is-active {
  color: var(--text-strong);
  background: var(--accent-soft);
  border: 1px solid rgba(20, 184, 166, 0.25);
}
.dash-sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  display: grid;
  gap: 0.55rem;
}
.dash-user {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  word-break: break-all;
}
.dash-main { min-width: 0; }
.dash-top {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 17, 15, 0.9);
  position: sticky;
  top: 0;
  z-index: 20;
}
.dash-top-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.dash-menu-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-strong);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 650;
  cursor: pointer;
}
.dash-content {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.35rem 1.25rem 2.5rem;
}
.dash-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 25;
}
@media (max-width: 900px) {
  .dash-shell { grid-template-columns: 1fr; }
  .dash-top { display: flex; }
  .dash-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  body.dash-open .dash-sidebar { transform: none; }
  body.dash-open .dash-backdrop { display: block; }
}

.footer-note { margin-top: 2rem; color: var(--muted); font-size: 0.85rem; }

/* —— Site footer —— */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.25rem 1.25rem 2.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer .footer-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 0.65rem;
}
.site-footer .footer-logo { height: 28px; width: auto; opacity: 0.9; }
.site-footer a { color: var(--accent-2); }
.site-footer .footer-contact { margin: 0.85rem 0; }
.whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text) !important;
  text-decoration: none;
}
.whatsapp-link svg { width: 1.1rem; height: 1.1rem; color: #25d366; }
.footer-credit { margin-top: 0.75rem; font-size: 0.8rem; opacity: 0.8; }

/* —— Toasts / history (homepage) —— */
.toast-container {
  position: fixed;
  top: calc(var(--nav-h) + 0.75rem);
  right: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.85rem;
  animation: rise 0.25s ease both;
}
.toast.success { border-color: rgba(52, 211, 153, 0.35); background: #0f241c; }
.toast.error { border-color: rgba(248, 113, 113, 0.35); background: #2a1212; }
.toast.info { border-color: rgba(20, 184, 166, 0.35); }
.toast.toast-out { opacity: 0; transition: opacity 0.2s; }
.toast-icon { flex-shrink: 0; width: 1.1rem; height: 1.1rem; }
.toast-icon svg { width: 1.1rem; height: 1.1rem; display: block; }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.history-item a { color: var(--accent-2); }
.share-out-row a { color: var(--accent-2); }
.my-history h3 {
  font-family: var(--display);
  font-size: 1.1rem;
  color: var(--text-strong);
  margin: 0 0 0.75rem;
}
.low-credit-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  background: var(--warn-soft);
  border-bottom: 1px solid rgba(251, 191, 36, 0.25);
  color: #fde68a;
  font-size: 0.85rem;
}
.low-credit-banner.is-visible { display: flex; }
.low-credit-banner a { color: var(--text-strong); font-weight: 650; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 640px) {
  .site-nav-links a:not(.nav-cta):not(.is-active) { display: none; }
  .site-nav-links a[href="/docs/api.php"],
  .site-nav-links a[href="/account.php"],
  .site-nav-links a[href="/auth/login.php"] { display: inline-flex; }
}
