/* ══════════════════════════════════════════════════════════
   Subs Manager - app.css
   Font: Inter · Theme: dark slate (PicoCSS)
   ══════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --brand: #d8c6f5;
  --brand-hover: #c9b0ee;
  --brand-soft: #efe8fb;
  --brand-deep: #4a2d86;
  --brand-bg: #d8c6f5;
  --surface-raised: #241e38;
  --telegram-blue: #2AABEE;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Global ─────────────────────────────────────────────── */
body {
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 700px at 12% -10%, color-mix(in srgb, var(--brand-bg) 18%, transparent), transparent),
    radial-gradient(900px 500px at 92% 0%, color-mix(in srgb, var(--brand) 12%, transparent), transparent);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family);
  letter-spacing: -0.02em;
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  margin-top: auto;
  padding-block: 3rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ── Brand name text - Space Grotesk wherever "Subs Manager" is displayed ── */
.brand-name {
  font-family: 'Space Grotesk', var(--font-family);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.footer-logo {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.4rem;
  transform: translateY(-3px);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: var(--pico-muted-color);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--brand);
}

.footer-copy {
  color: var(--pico-muted-color);
}

/* ── Nav ────────────────────────────────────────────────── */
nav.container-fluid {
  border-bottom: 1px solid color-mix(in srgb, var(--brand-soft) 15%, var(--pico-muted-border-color));
  padding-block: 0.75rem;
  backdrop-filter: blur(6px);
}

/* ── Landing page header (replaces default nav) ─────────── */
.landing-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 1.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--pico-background-color) 60%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--brand-soft) 8%, transparent);
}

.landing-header-inner {
  max-width: 1200px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-block: 1rem;
}

.landing-header-links {
  display: flex;
  gap: 1.75rem;
  margin-left: auto;
}

.landing-header-links a {
  font-size: 0.88rem;
  color: var(--pico-muted-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
  letter-spacing: -0.01em;
}

.landing-header-links a:hover {
  color: var(--pico-color);
}

.landing-header-login {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s;
}

.landing-header-login:hover {
  color: var(--pico-color);
}

@media (max-width: 600px) {
  .landing-header-links { display: none; }
  .landing-header-login { display: none; }
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.1rem;
  text-decoration: none;
  color: inherit;
}

.nav-brand strong {
  font-family: 'Space Grotesk', var(--font-family);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.nav-logo {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  align-self: center;
  border-radius: 0.4rem;
  object-fit: contain;
  object-position: center;
  display: block;
  transform: translateY(-3px);
}

.nav-user {
  color: var(--pico-muted-color);
  font-size: 0.9rem;
}

.btn-telegram-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--telegram-blue);
  border-color: var(--telegram-blue);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--pico-border-radius);
  text-decoration: none;
  transition: background 0.15s;
}

.btn-telegram-nav:hover {
  background: #229ED9;
  border-color: #229ED9;
  color: #fff;
}

/* ── Shared button styles ───────────────────────────────── */
.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-deep);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 22%, transparent);
  transition: all 0.15s;
}

.btn-brand:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--brand-deep);
  transform: translateY(-1px);
}

.btn-block { width: 100%; text-align: center; }

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1.05rem;
}

.btn-telegram-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--telegram-blue);
  border-color: var(--telegram-blue);
  color: #fff;
  font-weight: 500;
  padding: 0.65rem 1.25rem;
  border-radius: var(--pico-border-radius);
  text-decoration: none;
  transition: background 0.15s;
}

.btn-telegram-inline:hover {
  background: #229ED9;
  border-color: #229ED9;
  color: #fff;
}

/* ── Utility ────────────────────────────────────────────── */
.text-brand { color: var(--brand); }
.muted-text { color: var(--pico-muted-color); font-size: 0.9rem; }
.muted      { color: var(--pico-muted-color); }

.section-label {
  display: inline-block;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  text-align: center;
  margin-bottom: 1rem;
}

.section-sub {
  text-align: center;
  color: var(--pico-muted-color);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 3rem;
}

/* ═══════════════════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════════════════ */

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding-block: 7rem 5rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.hero-badge-logo {
  display: block;
  height: 120px;
  width: auto;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.15;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--pico-muted-color);
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.hero-note {
  font-size: 0.82rem;
  color: var(--pico-muted-color);
}

/* ── Proof bar ──────────────────────────────────────────── */
.proof-bar {
  border-block: 1px solid var(--pico-muted-border-color);
  padding-block: 1.25rem;
  background: color-mix(in srgb, var(--surface-raised) 60%, transparent);
}

.proof-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

.proof-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.proof-tag {
  padding: 0.3em 0.75em;
  border-radius: 999px;
  font-size: 0.78rem;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  color: var(--brand);
}

/* ── Feature grid ───────────────────────────────────────── */
.features {
  padding-block: 5rem;
}

.features .section-label,
.features .section-title {
  text-align: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: color-mix(in srgb, var(--surface-raised) 80%, var(--brand-bg));
  border: 1px solid color-mix(in srgb, var(--brand-soft) 14%, var(--pico-muted-border-color));
  border-radius: 0.75rem;
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, transparent);
  transform: translateY(-2px);
}

.feature-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--pico-muted-color);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
}

/* ── How it works ───────────────────────────────────────── */
.how-it-works {
  padding-block: 5rem;
  background: color-mix(in srgb, var(--surface-raised) 70%, transparent);
}

.how-it-works .section-label,
.how-it-works .section-title {
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
  counter-reset: steps;
}

.step { text-align: center; }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--brand-deep);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 20%, transparent);
}

.step h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; }
.step p  { color: var(--pico-muted-color); font-size: 0.88rem; line-height: 1.5; margin: 0; }

/* ── Pricing ────────────────────────────────────────────── */
.pricing-section {
  padding-block: 5rem;
}

.pricing-section .section-label,
.pricing-section .section-title {
  text-align: center;
}

.pricing-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.25rem;
  margin-top: 1rem;
}

.pricing-scroll {
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.pricing-scroll::-webkit-scrollbar { display: none; }

.pricing-scroll-outer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pricing-arrow {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-raised) 90%, var(--brand-bg));
  border: 1px solid color-mix(in srgb, var(--brand-soft) 22%, var(--pico-muted-border-color));
  color: var(--pico-muted-color);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s;
  user-select: none;
}

.pricing-arrow:hover {
  background: color-mix(in srgb, var(--brand) 14%, var(--surface-raised));
  border-color: var(--brand);
  color: var(--brand);
}

@media (max-width: 540px) {
  .pricing-arrow { display: none; }
}

.pricing-scroll .price-card {
  min-width: 260px;
  max-width: 260px;
}

.price-card {
  background: color-mix(in srgb, var(--surface-raised) 85%, var(--brand-bg));
  border: 1px solid color-mix(in srgb, var(--brand-soft) 14%, var(--pico-muted-border-color));
  border-radius: 0.75rem;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.price-card.featured {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), 0 12px 32px color-mix(in srgb, var(--brand) 18%, transparent);
}

.price-badge {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: var(--brand-deep);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3em 0.9em;
  border-radius: 999px;
  white-space: nowrap;
}

.price-tier {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  margin-bottom: 0.75rem;
}

.price-amount {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.price-amount .currency { font-size: 1.75rem; vertical-align: super; margin-right: 0.1em; }
.price-amount .period   { font-size: 0.95rem; font-weight: 400; color: var(--pico-muted-color); }

.price-desc {
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.price-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  flex: 1;
}

.price-features li {
  padding: 0.35rem 0;
  font-size: 0.88rem;
  color: var(--pico-muted-color);
  padding-left: 1.5rem;
  position: relative;
}

.price-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 600;
}

/* ── Comparison table ───────────────────────────────────── */
.comparison-section {
  padding-block: 5rem;
  background: color-mix(in srgb, var(--surface-raised) 70%, transparent);
}

.comparison-section .section-label,
.comparison-section .section-title {
  text-align: center;
}

.comparison-table-wrap {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--brand-soft) 14%, var(--pico-muted-border-color));
  margin-bottom: 1.25rem;
}

.comparison-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  white-space: nowrap;
}

.comparison-table th,
.comparison-table td {
  padding: 0.85rem 1.25rem;
  text-align: left;
  font-size: 0.88rem;
}

.comparison-table thead th {
  background: color-mix(in srgb, var(--surface-raised) 90%, var(--brand-bg));
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--pico-muted-border-color);
  white-space: nowrap;
}

.comparison-table tbody tr {
  border-bottom: 1px solid color-mix(in srgb, var(--pico-muted-border-color) 50%, transparent);
}

.comparison-table tbody tr:last-child { border-bottom: none; }

.comparison-table .highlight {
  background: color-mix(in srgb, var(--brand) 6%, transparent);
  font-weight: 600;
}

.comparison-table thead .highlight {
  color: var(--brand);
}

.compare-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.compare-logo {
  width: 1rem;
  height: 1rem;
  border-radius: 0.2rem;
  transform: translateY(-3px);
}

.saving {
  color: #22c55e;
  font-weight: 600;
}

.neutral {
  color: var(--pico-muted-color);
}

.comparison-note {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  text-align: center;
  max-width: 600px;
  margin-inline: auto;
}

/* ── Custom bot highlight section ───────────────────────── */
.highlight-section {
  padding-block: 5rem;
}

.highlight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 768px) {
  .highlight-grid { grid-template-columns: 1fr; }
}

.highlight-text .section-label { text-align: left; }
.highlight-text h2 { text-align: left; font-size: 1.6rem; margin-bottom: 1rem; }
.highlight-text p { color: var(--pico-muted-color); line-height: 1.6; margin-bottom: 1rem; }

.check-list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}

.check-list li {
  padding: 0.4rem 0 0.4rem 1.5rem;
  position: relative;
  color: var(--pico-color);
  font-size: 0.92rem;
}

.check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

/* Mock bot UI */
.mock-bot {
  background: color-mix(in srgb, var(--surface-raised) 90%, var(--brand-bg));
  border: 1px solid color-mix(in srgb, var(--brand-soft) 18%, var(--pico-muted-border-color));
  border-radius: 0.75rem;
  padding: 1.5rem;
  max-width: 340px;
  margin-inline: auto;
}

.mock-bot-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.mock-bot-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 15%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.mock-bot-name { font-weight: 600; font-size: 0.92rem; }
.mock-bot-status { font-size: 0.75rem; color: #22c55e; }

.mock-msg {
  padding: 0.6rem 0.85rem;
  border-radius: 0.6rem;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
  max-width: 85%;
  line-height: 1.45;
}

.mock-msg.bot {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface-raised));
  border: 1px solid color-mix(in srgb, var(--brand) 15%, transparent);
}

.mock-msg.user {
  background: var(--telegram-blue);
  color: #fff;
  margin-left: auto;
}

.mock-btn {
  padding: 0.45rem 0.7rem;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-radius: 0.4rem;
  font-size: 0.78rem;
  margin-top: 0.35rem;
  text-align: center;
  cursor: default;
}

/* ── FAQ ────────────────────────────────────────────────── */
.faq-section {
  padding-block: 5rem;
  background: color-mix(in srgb, var(--surface-raised) 70%, transparent);
}

.faq-section .section-label,
.faq-section .section-title {
  text-align: center;
}

.faq-grid {
  max-width: 700px;
  margin-inline: auto;
  margin-top: 1rem;
}

.faq-item {
  border-bottom: 1px solid var(--pico-muted-border-color);
  padding: 0;
}

.faq-item summary {
  padding: 1.1rem 0;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--brand);
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  color: var(--pico-muted-color);
  font-size: 0.9rem;
  line-height: 1.6;
  padding-bottom: 1.1rem;
  margin: 0;
}

/* ── CTA ────────────────────────────────────────────────── */
.cta-banner {
  padding-block: 5rem;
}

.cta-inner {
  text-align: center;
}

.cta-inner h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

.cta-inner p {
  color: var(--pico-muted-color);
  margin-bottom: 2rem;
}


/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */

.login-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: color-mix(in srgb, var(--surface-raised) 90%, var(--brand-bg));
  border: 1px solid color-mix(in srgb, var(--brand-soft) 20%, var(--pico-muted-border-color));
  border-radius: 0.75rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-icon {
  margin-bottom: 1.25rem;
}

.login-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.login-card > p { color: var(--pico-muted-color); margin-bottom: 2rem; }

.telegram-btn-wrap {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.login-note {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--pico-muted-color);
}

.login-permission-hint {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: color-mix(in srgb, #f59e0b 12%, transparent);
  border-left: 3px solid #f59e0b;
  border-radius: 0.25rem;
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: left;
  color: var(--pico-color);
}

.login-msg {
  display: none;
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: left;
}
.login-msg.is-warning {
  background: color-mix(in srgb, #f59e0b 12%, transparent);
  border: 1px solid color-mix(in srgb, #f59e0b 35%, transparent);
  color: #92400e;
}
.login-msg.is-error {
  background: color-mix(in srgb, #ef4444 12%, transparent);
  border: 1px solid color-mix(in srgb, #ef4444 35%, transparent);
  color: #991b1b;
}
[data-theme="dark"] .login-msg.is-warning { color: #fcd34d; }
[data-theme="dark"] .login-msg.is-error   { color: #fca5a5; }
.login-msg.is-visible { display: block; }


/* ═══════════════════════════════════════════════════════════
   SUCCESS PAGE
   ═══════════════════════════════════════════════════════════ */

.success-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 4rem;
}

.success-card {
  background: color-mix(in srgb, var(--surface-raised) 90%, var(--brand-bg));
  border: 1px solid color-mix(in srgb, var(--brand-soft) 20%, var(--pico-muted-border-color));
  border-radius: 0.75rem;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 520px;
  text-align: center;
}

.success-icon { margin-bottom: 1.5rem; }

.success-card h1 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  color: #22c55e;
}

.success-sub {
  color: var(--pico-muted-color);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.success-steps {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.success-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.success-step-icon {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.success-step strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.success-step p {
  color: var(--pico-muted-color);
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.5;
}

.success-note {
  font-size: 0.82rem;
  color: var(--pico-muted-color);
  padding-top: 1.5rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.success-note code {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  padding: 0.15em 0.4em;
  border-radius: 0.3rem;
  font-size: 0.85em;
}


/* ═══════════════════════════════════════════════════════════
   GET STARTED PAGE
   ═══════════════════════════════════════════════════════════ */

.getstarted-wrap {
  padding-block: 4rem 5rem;
}

.getstarted-inner {
  max-width: 680px;
  margin-inline: auto;
}

.getstarted-header {
  text-align: center;
  margin-bottom: 3rem;
}

.getstarted-header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 1rem;
}

.getstarted-sub {
  color: color-mix(in srgb, var(--pico-color) 80%, var(--pico-muted-color));
  max-width: 520px;
  margin-inline: auto;
}

.bot-name-card {
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--brand-bg));
  border: 1px solid color-mix(in srgb, var(--brand-soft) 18%, var(--pico-muted-border-color));
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.bot-name-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.bot-link-preview {
  margin: 0.35rem 0 0.85rem;
  font-weight: 600;
  color: var(--brand);
  word-break: break-all;
}

.bot-name-status {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

.bot-name-status.is-ok {
  color: #22c55e;
}

.bot-name-status.is-error {
  color: #ef4444;
}

/* ── Get Started Wizard ─────────────────────────────── */

/* Progress bar */
.gs-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2.5rem;
  padding: 0 0.5rem;
}

.gs-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.gs-progress-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-raised) 90%, var(--brand-bg));
  border: 2px solid var(--pico-muted-border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pico-muted-color);
  transition: all 0.2s;
}

.gs-progress-step.active .gs-progress-dot {
  background: var(--brand-deep);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

.gs-progress-step.done .gs-progress-dot {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: var(--brand);
}

.gs-progress-step span {
  font-size: 0.72rem;
  color: var(--pico-muted-color);
  white-space: nowrap;
}

.gs-progress-step.active span {
  color: var(--brand);
  font-weight: 600;
}

.gs-progress-line {
  flex: 1;
  height: 2px;
  background: var(--pico-muted-border-color);
  margin-bottom: 1.2rem;
  min-width: 1rem;
}

/* Panels */
.gs-panel { display: none; }
.gs-panel.active { display: block; }

/* Notice */
.gs-notice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: color-mix(in srgb, #f59e0b 10%, transparent);
  border: 1px solid color-mix(in srgb, #f59e0b 35%, transparent);
  border-radius: 0.6rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: #f59e0b;
}

.gs-notice a { color: inherit; font-weight: 600; }

/* Guide card */
.gs-guide-card {
  background: color-mix(in srgb, var(--surface-raised) 85%, var(--brand-bg));
  border: 1px solid color-mix(in srgb, var(--brand-soft) 16%, var(--pico-muted-border-color));
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.gs-guide-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
}

.gs-guide-steps {
  padding-left: 1.25rem;
  margin: 0;
}

.gs-guide-steps li {
  padding: 0.45rem 0;
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--pico-color) 82%, var(--pico-muted-color));
  line-height: 1.55;
}

.gs-guide-steps code {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  padding: 0.1em 0.4em;
  border-radius: 0.3rem;
  font-size: 0.85em;
  color: var(--brand);
}

.token-example {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  padding: 0.15em 0.5em;
  border-radius: 0.3rem;
  font-family: monospace;
  font-size: 0.85em;
  color: var(--brand);
  letter-spacing: 0.02em;
}

.gs-tip {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  line-height: 1.5;
}

.gs-tip code {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  padding: 0.1em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.85em;
  color: var(--brand);
}

/* Field card */
.gs-field-card {
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--brand-bg));
  border: 1px solid color-mix(in srgb, var(--brand-soft) 16%, var(--pico-muted-border-color));
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.gs-field-card label {
  font-weight: 500;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.3rem;
}

.gs-field-card small {
  display: block;
  color: var(--pico-muted-color);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.gs-field-card small code {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  font-size: 0.85em;
  color: var(--brand);
}

/* URL preview */
.gs-url-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: color-mix(in srgb, var(--brand) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  border-radius: 0.5rem;
  font-size: 0.88rem;
  font-family: monospace;
}

.gs-url-label {
  color: var(--pico-muted-color);
  font-family: var(--font-family);
  font-size: 0.8rem;
  white-space: nowrap;
  font-family: var(--font-family);
}

.gs-url-value {
  color: var(--brand);
  word-break: break-all;
}

/* Nav row */
.gs-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

/* Products form */
.gs-product-block {
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--brand-bg));
  border: 1px solid color-mix(in srgb, var(--brand-soft) 16%, var(--pico-muted-border-color));
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.gs-product-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.gs-product-header strong { font-size: 0.9rem; }

.gs-remove-btn {
  background: none;
  border: none;
  color: var(--pico-muted-color);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem 0.4rem;
  border-radius: 0.3rem;
  line-height: 1;
  transition: color 0.15s;
}
.gs-remove-btn:hover { color: #ef4444; }

.gs-prices-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pico-muted-color);
  margin: 1rem 0 0.5rem;
}

.gs-price-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.price-amount-wrap {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.price-amount-wrap select {
  border-right: none;
  border-radius: var(--pico-border-radius) 0 0 var(--pico-border-radius);
  padding-inline: 0.5rem;
  width: auto;
  min-width: 3.5rem;
  flex-shrink: 0;
}

.price-amount-wrap input {
  border-radius: 0 var(--pico-border-radius) var(--pico-border-radius) 0;
  margin: 0;
}

.gs-add-price-btn {
  font-size: 0.82rem;
  padding: 0.35rem 0.75rem;
  margin-top: 0.35rem;
  width: auto;
}

/* Compact inputs inside price rows */
.gs-price-row input,
.gs-price-row select {
  font-size: 0.85rem;
  margin-bottom: 0;
  padding-block: 0.4rem;
}

.gs-price-row .price-name { min-width: 0; flex: 1; }
.gs-price-row .price-amount { width: 120px; min-width: 0; }

.gs-price-expiry-wrap {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 0.25rem;
}

.gs-price-expiry-wrap label {
  margin: 0;
  font-size: 0.8rem;
  white-space: nowrap;
  color: var(--pico-muted-color);
  font-weight: normal;
}

.gs-price-expiry-wrap input[type="date"] {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  width: auto;
  flex: 1;
  min-width: 130px;
}

.gs-stripe-link {
  display: inline-flex;
  align-items: center;
  margin-top: 1rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--pico-border-radius);
  background: #635bff20;
  border: 1px solid #635bff77;
  color: #b8b3ff;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.gs-stripe-link:hover {
  background: #635bff35;
  border-color: #635bffbb;
  color: #cbc8ff;
}

/* ── Stripe step: why-stripe grid ───────────────────── */
.gs-stripe-why {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 600px) {
  .gs-stripe-why { grid-template-columns: 1fr; }
}
.gs-stripe-why-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-card-border-color);
}
.gs-stripe-why-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.1rem;
}
.gs-stripe-why-item div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.gs-stripe-why-item strong {
  font-size: 0.875rem;
  font-weight: 600;
}
.gs-stripe-why-item span {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  line-height: 1.3;
}

/* ── Stripe step: no-account notice ─────────────────── */
.gs-no-account-notice {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border-radius: var(--pico-border-radius);
  background: #22c55e0d;
  border: 1px solid #22c55e33;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--pico-muted-color);
}
.gs-register-btn {
  padding: 0.4rem 0.9rem !important;
  font-size: 0.85rem !important;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .gs-progress-step span { display: none; }
  .gs-price-row { flex-direction: column; align-items: stretch; }
  .price-amount-wrap { width: 100%; }
}


/* ═══════════════════════════════════════════════════════════
   STOREFRONT
   ═══════════════════════════════════════════════════════════ */

.storefront-hero {
  text-align: center;
  padding-block: 4rem 2.5rem;
}

.storefront-badge {
  display: inline-block;
  border: 1px solid color-mix(in srgb, var(--brand) 32%, transparent);
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.76rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.storefront-hero h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.storefront-hero p {
  color: var(--pico-muted-color);
  max-width: 620px;
  margin: 0 auto 1.4rem;
}

.storefront-products {
  padding-bottom: 4rem;
}

.storefront-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.storefront-product-card {
  background: color-mix(in srgb, var(--sf-secondary) 18%, var(--pico-background-color, #fff));
  border: 1px solid color-mix(in srgb, var(--sf-secondary) 45%, var(--pico-muted-border-color));
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.storefront-product-card h3 {
  margin-bottom: 0.45rem;
}

.storefront-price-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.storefront-price-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--pico-muted-border-color);
  padding-top: 0.65rem;
  margin-top: 0.65rem;
}

.storefront-price-amount {
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
}

.storefront-settings-card {
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--brand-bg));
  border: 1px solid color-mix(in srgb, var(--brand-soft) 16%, var(--pico-muted-border-color));
  border-radius: 0.75rem;
  padding: 1.25rem;
}

/* ── Public storefront page (no nav) ────────────────────── */
.sf-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  --sf-primary: #2AABEE;
  --sf-secondary: #d8c6f5;
  --sf-background: transparent;
  --sf-text: inherit;
  background: var(--sf-background);
}

/* Sticky topbar: title left, auth state right */
.sf-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.5rem;
  background: color-mix(in srgb, var(--pico-background-color) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.sf-topbar-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--pico-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}

/* Small corner login button - uses custom primary colour */
.sf-corner-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--sf-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.38rem 0.85rem;
  border-radius: 0.45rem;
  text-decoration: none;
  transition: filter 0.15s;
  white-space: nowrap;
}

.sf-corner-btn:hover {
  filter: brightness(1.12);
  color: #fff;
}

/* Profile header */
.sf-profile-header {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  max-width: 680px;
  margin: 0 auto;
}

/* Round avatar */
.sf-avatar-wrap {
  margin: 0 auto 1.25rem;
  width: fit-content;
}

.sf-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--sf-secondary);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--sf-primary) 20%, transparent);
}

.sf-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  background: var(--sf-primary);
  border: none;
}

.sf-title {
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: var(--sf-text);
}

.sf-description {
  color: var(--sf-text);
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  line-height: 1.75;
  max-width: 60ch;
  margin: 0 auto;
  opacity: 0.8;
  white-space: pre-line;
}

/* Auth nudge above products for logged-out users */
.sf-auth-nudge {
  text-align: center;
  margin-bottom: 2.5rem;
}

.sf-telegram-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--sf-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.5rem;
  border-radius: 0.6rem;
  text-decoration: none;
  transition: filter 0.15s, transform 0.1s;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--sf-primary) 35%, transparent);
}

.sf-telegram-btn:hover {
  filter: brightness(1.12);
  color: #fff;
  transform: translateY(-1px);
}

.sf-logged-in {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: color-mix(in srgb, var(--sf-primary) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--sf-primary) 30%, transparent);
  color: var(--sf-primary);
  font-size: 0.82rem;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
}

/* Checkout button inside .sf-page overrides global btn-brand colour */
.sf-page .sf-subscribe-btn {
  background: var(--sf-primary) !important;
  border-color: var(--sf-primary) !important;
  color: #fff !important;
}

.sf-products {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  width: 100%;
}

.sf-login-hint {
  font-size: 0.78rem;
  color: var(--pico-muted-color);
  text-decoration: none;
}

.sf-login-hint:hover {
  color: var(--pico-color);
}

.sf-footer {
  margin-top: auto;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

.sf-footer-link {
  color: var(--pico-muted-color);
  text-decoration: none;
}

.sf-footer-link:hover {
  color: var(--brand);
}

/* ── Checkout loading overlay ────────────────────────────── */
#sf-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: #fff;
  font-size: .95rem;
}
#sf-loading-overlay.active { display: flex; }
.sf-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sf-spin .8s linear infinite;
}
@keyframes sf-spin { to { transform: rotate(360deg); } }

/* ── Dashboard storefront settings layout ────────────────── */
.sf-settings-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .sf-settings-layout { grid-template-columns: 1fr; }
}

/* ── Avatar upload (circular) ────────────────────────────── */
.sf-avatar-upload-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.sf-avatar-upload-circle {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-raised);
  flex-shrink: 0;
  border: 2px solid var(--pico-muted-border-color);
  cursor: pointer;
}

.sf-avatar-upload-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sf-avatar-upload-initial {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--pico-muted-color);
}

.sf-avatar-upload-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.sf-avatar-upload-circle:hover .sf-avatar-upload-overlay { opacity: 1; }

/* ── Colour picker row ───────────────────────────────────── */
.sf-color-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.sf-color-swatch {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 0.4rem;
  padding: 2px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}

.sf-color-hex {
  flex: 1;
  font-family: monospace;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.4rem;
  background: var(--pico-background-color);
  color: var(--pico-color);
}

/* ── Dashboard preview panel ─────────────────────────────── */
.sf-preview-wrap {
  position: sticky;
  top: 5rem;
}

.sf-preview {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--pico-background-color);
  font-size: 0.72rem;
  --sf-prev-primary: #2AABEE;
  --sf-prev-secondary: #d8c6f5;
  --sf-prev-text: inherit;
}

.sfp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  background: color-mix(in srgb, var(--pico-background-color) 90%, transparent);
}

.sfp-topbar-title {
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--pico-color);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}

.sfp-corner-btn {
  font-size: 0.62rem;
  font-weight: 600;
  background: var(--sf-prev-primary, #2AABEE);
  color: #fff;
  padding: 0.18rem 0.5rem;
  border-radius: 0.3rem;
  white-space: nowrap;
}

.sfp-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.75rem 0.75rem;
  gap: 0.4rem;
  text-align: center;
}

.sfp-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--sf-prev-secondary, #d8c6f5);
  overflow: hidden;
  background: color-mix(in srgb, var(--sf-prev-primary, #2AABEE) 25%, var(--surface-raised));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  margin-bottom: 0.2rem;
}

.sfp-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sfp-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sf-prev-text, var(--pico-color));
}

.sfp-desc {
  font-size: 0.68rem;
  color: var(--sf-prev-text, var(--pico-muted-color));
  line-height: 1.4;
  max-width: 26ch;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin: 0;
}

.sfp-cta-btn {
  display: inline-block;
  background: var(--sf-prev-primary, #2AABEE);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 0.4rem;
  margin-top: 0.2rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sfp-product {
  width: 100%;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--sf-prev-secondary, #d8c6f5) 30%, transparent);
  border: 1px solid color-mix(in srgb, var(--sf-prev-secondary, #d8c6f5) 60%, var(--pico-muted-border-color));
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
}

.sfp-product-name {
  font-size: 0.68rem;
  color: var(--pico-muted-color);
}

.sfp-subscribe-btn {
  font-size: 0.62rem;
  font-weight: 600;
  background: var(--sf-prev-primary, #2AABEE);
  color: #fff;
  padding: 0.18rem 0.5rem;
  border-radius: 0.3rem;
  white-space: nowrap;
}

/* ── Dashboard storefront image upload (legacy upload area removed) ─ */

/* ── Inline currency + amount input group ────────────────── */
.amount-input-group {
  display: flex;
  align-items: stretch;
  margin-top: 0.35rem;
}

.amount-input-group select {
  border-radius: 0.375rem 0 0 0.375rem;
  border-right: none;
  width: auto;
  min-width: 5rem;
  flex-shrink: 0;
  margin: 0;
  padding-inline: 0.5rem;
}

.amount-input-group input {
  border-radius: 0 0.375rem 0.375rem 0;
  flex: 1;
  margin: 0;
}



.dashboard-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  padding-block: 2rem;
  min-height: 70vh;
}

@media (max-width: 768px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--pico-border-radius);
  text-decoration: none;
  color: var(--pico-color);
  font-size: 0.95rem;
  transition: background 0.1s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: color-mix(in srgb, var(--surface-raised) 85%, var(--brand-bg));
}

.sidebar nav a .icon { font-size: 1.1rem; }

.sidebar-section {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pico-muted-color);
  padding: 1rem 0.75rem 0.25rem;
}

/* ── Stat cards ─────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--brand-bg));
  border: 1px solid color-mix(in srgb, var(--brand-soft) 16%, var(--pico-muted-border-color));
  border-radius: var(--pico-border-radius);
  padding: 1.25rem 1.5rem;
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--pico-muted-color);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
}

.table-wrap table {
  margin: 0;
  white-space: nowrap;
}

/* row with warning background (no-subscription channel member) */
.row-warn { background: rgba(239, 68, 68, .06); }

/* ── Subscriber modal ────────────────────────────────────── */
#subModal {
  max-width: min(92vw, 700px);
  max-height: 90dvh;
  margin: auto;
}
#subModal > article {
  overflow-y: auto;
  max-height: calc(90dvh - 2rem);
}
@media (max-width: 600px) {
  #subModal {
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
    align-self: flex-end;
  }
  #subModal > article {
    max-height: calc(100dvh - 1rem);
    border-radius: var(--pico-border-radius) var(--pico-border-radius) 0 0;
  }
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-active   { background: #22c55e22; color: #22c55e; border: 1px solid #22c55e55; }
.badge-cancel   { background: #f59e0b22; color: #f59e0b; border: 1px solid #f59e0b55; }
.badge-expired  { background: #ef444422; color: #ef4444; border: 1px solid #ef444455; }
.badge-past-due { background: #f9731622; color: #f97316; border: 1px solid #f9731655; }
.badge-none     { background: #6b728022; color: #9ca3af; border: 1px solid #6b728055; }

/* ── Subscriber portal ──────────────────────────────────── */
.sub-portal-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sub-portal-card {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.75rem;
  background: var(--pico-card-background-color);
}

.sub-portal-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.sub-portal-card__title {
  font-weight: 700;
  font-size: 1.05rem;
}

.sub-portal-card__detail {
  margin: 0.25rem 0;
  font-size: 0.88rem;
  color: var(--pico-muted-color);
}

.sub-portal-card__detail strong {
  color: var(--pico-color);
}

.sub-portal-card__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.sub-portal-card__link {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  text-decoration: none;
}

.sub-portal-card__link:hover {
  color: var(--brand);
}

.sub-portal-card__btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  background: var(--brand);
  color: #fff;
  border-radius: 0.4rem;
  text-decoration: none;
  font-weight: 600;
}

.sub-portal-card__btn:hover {
  opacity: 0.88;
}

.sub-portal-empty {
  padding: 2rem;
  text-align: center;
  border: 1px dashed var(--pico-muted-border-color);
  border-radius: 0.75rem;
  color: var(--pico-muted-color);
}

/* ── Section header ─────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-header h2 { margin: 0; font-size: 1.25rem; }

/* ── Sidebar footer ─────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar nav {
  flex: 1;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 0.75rem 0.75rem;
  border-top: 1px solid var(--pico-muted-border-color);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar-user {
  font-size: 0.82rem;
  color: var(--pico-muted-color);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  text-decoration: none;
}

.sidebar-logout:hover {
  color: #ef4444;
}

/* ── Info notice ─────────────────────────────────────────── */
.info-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--pico-primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--pico-primary) 25%, transparent);
  border-radius: var(--pico-border-radius);
  font-size: 0.875rem;
  color: var(--pico-color);
}

.info-notice svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--pico-primary);
}

/* ── Subscribers toolbar ────────────────────────────────── */
.subs-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  /* compact form elements to match pill nav height */
  --pico-form-element-spacing-vertical: 0.3rem;
  --pico-form-element-spacing-horizontal: 0.75rem;
}

.subs-toolbar input[type="search"] {
  flex: 1;
  min-width: 160px;
  margin: 0;
  height: auto;
  line-height: 1.2;
}

.subs-filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.subs-filter-group select {
  margin: 0;
  font-size: 0.875rem;
  padding: 0.3rem 0.6rem;
  width: auto;
}

/* ── Sortable table headers ─────────────────────────────── */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.sortable:hover {
  background: color-mix(in srgb, var(--surface-raised) 80%, var(--brand-bg));
}

.sort-icon {
  font-size: 0.75rem;
  opacity: 0.5;
  margin-left: 0.2rem;
}

/* ── Subscriber detail modal ────────────────────────────── */
#subModal {
  max-width: 680px;
  width: 90vw;
}

#subModal article {
  margin: 0;
  max-height: 80vh;
  overflow-y: auto;
}

#subModal h4 {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pico-muted-color);
  margin: 0 0 0.5rem;
}

.modal-grid {
  display: grid;
  gap: 0.25rem;
}

/* ── Channel card (details/summary) ─────────────────────── */
.channel-card {
  background: var(--pico-card-background-color, var(--surface-raised));
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 0;
}

.channel-card summary::-webkit-details-marker { display: none; }
.channel-card summary::marker { content: ''; }



/* ── Nav: prevent overflow on small screens ─────────────── */
nav.container-fluid {
  flex-wrap: wrap;
  gap: 0.5rem;
}

nav.container-fluid > ul {
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}

@media (max-width: 480px) {
  nav.container-fluid > ul:first-child {
    flex: 1 0 100%;
  }
  nav.container-fluid > ul:last-child {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .nav-user { display: none; }
}

/* ── Hero: tighter padding on mobile ───────────────────── */
@media (max-width: 640px) {
  .hero {
    padding-block: 4rem 3rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero-sub {
    font-size: 1rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  .hero-actions a, .hero-actions button {
    width: 100%;
    max-width: 300px;
    text-align: center;
    justify-content: center;
  }
}

/* ── Login/success cards: full width on tiny screens ────── */
@media (max-width: 480px) {
  .login-card {
    padding: 1.75rem 1.25rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
    max-width: 100%;
  }
  .login-wrap {
    align-items: flex-start;
    padding-top: 2rem;
  }
  .success-card {
    padding: 2rem 1.25rem;
    border-radius: 0.5rem;
  }
}

/* ── Dashboard sidebar: horizontal scrollable pill nav ──── */
@media (max-width: 768px) {
  .dashboard-layout {
    gap: 1rem;
    padding-block: 1rem;
    overflow-x: hidden;
  }
  .sidebar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.35rem;
    padding: 0.5rem 0;
    min-width: 0;
    max-width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar-section { display: none; }
  .sidebar nav {
    display: flex;
    flex-direction: row;
    gap: 0.35rem;
    width: max-content;
  }
  .sidebar nav a {
    white-space: nowrap;
    padding: 0.4rem 0.85rem;
    line-height: 1.2;
    border: 1px solid color-mix(in srgb, var(--brand-soft) 18%, var(--pico-muted-border-color));
    border-radius: 999px;
    font-size: 0.85rem;
    background: color-mix(in srgb, var(--surface-raised) 80%, transparent);
  }
  .sidebar nav a.active {
    background: color-mix(in srgb, var(--brand) 12%, var(--surface-raised));
    border-color: color-mix(in srgb, var(--brand) 40%, transparent);
    color: var(--brand);
  }
  .dashboard-layout > main {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }
  .sidebar-footer {
    display: none;
  }
}

/* ── Channel card: title always on its own line at the top ─ */
.ch-summary-title {
  flex-basis: 100%;
}

/* ── Dashboard stat grid: 2 columns on mobile ──────────── */
@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stat-card .value {
    font-size: 1.5rem;
  }
}

/* ── Dashboard buttons: auto-width and natural height ── */
.dashboard-layout main button,
.dashboard-layout main [type="submit"],
.dashboard-layout main [type="button"],
.dashboard-layout main [type="reset"] {
  width: auto;
  align-self: flex-start;
}

/* ── Tables: allow horizontal scroll + wrap long content ── */
.table-wrap {
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 640px) {
  .table-wrap table {
    font-size: 0.82rem;
  }
  .table-wrap th,
  .table-wrap td {
    padding: 0.5rem 0.65rem;
  }
}

/* ── Storefront grid: always single col on mobile ────────── */
@media (max-width: 480px) {
  .storefront-grid {
    grid-template-columns: 1fr;
  }
  .storefront-hero {
    padding-block: 2.5rem 1.5rem;
  }
}

/* ── Feature/step grids: single col on very small ─────── */
@media (max-width: 360px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .steps {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ── Footer: tighter on mobile ───────────────────────────── */
@media (max-width: 480px) {
  footer {
    padding-block: 2rem;
  }
  .footer-links {
    gap: 1rem;
  }
}

/* ── Get started: remove timeline line on mobile ─────────── */
@media (max-width: 480px) {
  .getstarted-steps::before { display: none; }
  .gs-step { gap: 0.75rem; padding: 1rem 0; }
  .gs-step-num { width: 2.25rem; height: 2.25rem; font-size: 0.9rem; }
}

/* ── Pricing scroll: hint at next card on mobile ─────────── */
@media (max-width: 640px) {
  .pricing-scroll .price-card {
    min-width: 240px;
  }
}

/* ── Comparison table: always scrollable ─────────────────── */
@media (max-width: 640px) {
  .comparison-table th,
  .comparison-table td {
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
  }
}
