/* SlideGuru — единая палитра с Telegram WebApp */
:root {
  --sg-bg: #080d16;
  --sg-bg-input: #0a101c;
  --sg-card: #121a2c;
  --sg-border: #2a3548;
  --sg-border-soft: #1c2838;
  --sg-text: #f8fafc;
  --sg-muted: #9fb0c4;
  --sg-strong: #e8eef5;
  --sg-heading: #f1f5f9;
  --sg-accent: #3ec9c4;
  --sg-accent-dim: rgba(62, 201, 196, 0.12);
  --sg-link: #6dd4cf;
  --sg-link-hover: #8fe8e3;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--sg-text);
  background: radial-gradient(ellipse 100% 60% at 50% -15%, var(--sg-accent-dim) 0%, transparent 45%),
    var(--sg-bg);
  min-height: 100vh;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}
.site-header {
  margin-bottom: 8px;
}
.brand-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1 1 auto;
}
.brand-logo {
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--sg-border);
}
.brand-text h1 { margin: 0 0 4px; }
.brand-text p { margin: 0; color: var(--sg-muted); }
.header-cabinet {
  flex: 0 0 auto;
  text-align: right;
  max-width: min(100%, 320px);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--sg-border-soft);
  background: var(--sg-bg-input);
}
.header-cabinet-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sg-muted);
}
.header-cabinet-user {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}
.header-cabinet-actions {
  justify-content: flex-end;
  margin-bottom: 0;
  flex-wrap: wrap;
}
.header-cabinet-actions button {
  padding: 8px 10px;
  font-size: 13px;
}
@media (max-width: 640px) {
  .header-cabinet {
    max-width: 100%;
    width: 100%;
    text-align: left;
  }
  .header-cabinet-actions {
    justify-content: flex-start;
  }
}
.seo-lead {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--sg-muted);
  max-width: 72ch;
}
.seo-lead strong { color: var(--sg-strong); font-weight: 600; }
.seo-section-title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--sg-heading);
}
details.seo-accordion {
  margin-bottom: 12px;
}
details.seo-accordion > summary.seo-accordion-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 2px 0;
  user-select: none;
}
details.seo-accordion > summary.seo-accordion-summary::-webkit-details-marker {
  display: none;
}
details.seo-accordion > summary.seo-accordion-summary::marker {
  content: "";
}
details.seo-accordion > summary.seo-accordion-summary::after {
  content: "";
  width: 0.55em;
  height: 0.55em;
  margin-left: auto;
  border-right: 2px solid var(--sg-muted);
  border-bottom: 2px solid var(--sg-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
details.seo-accordion[open] > summary.seo-accordion-summary::after {
  transform: rotate(-135deg);
  margin-top: 0.2em;
}
details.seo-accordion > summary.seo-accordion-summary:focus-visible {
  outline: 2px solid var(--sg-accent);
  outline-offset: 3px;
  border-radius: 6px;
}
details.seo-accordion > .seo-accordion-panel {
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--sg-border-soft);
}
.seo-features .seo-feature-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--sg-muted);
  line-height: 1.55;
  font-size: 15px;
}
.seo-features .seo-feature-list li { margin-bottom: 8px; }
.seo-features .seo-feature-list strong { color: var(--sg-strong); }
.seo-faq-list { display: grid; gap: 14px; }
.seo-faq-item {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sg-border-soft);
}
.seo-faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.seo-faq-q {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--sg-strong);
  line-height: 1.35;
}
.seo-faq-a {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}
.small { font-size: 13px; line-height: 1.45; }
.legal-inline { margin-bottom: 12px; padding: 10px; border-radius: 10px; background: var(--sg-bg-input); border: 1px solid var(--sg-border-soft); }
.legal-inline-title { margin: 0 0 6px; font-weight: 600; color: var(--sg-strong); }
.legal-links { margin: 0; flex-wrap: wrap; }
.legal-links .sep { margin: 0 6px; color: var(--sg-muted); opacity: 0.75; }
.site-footer { margin-top: 8px; }
.footer-links { margin-bottom: 8px; }
.card {
  border: 1px solid var(--sg-border);
  border-radius: 12px;
  background: var(--sg-card);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.row.between { justify-content: space-between; }
input, button {
  border-radius: 8px;
  border: 1px solid var(--sg-border);
  background: var(--sg-bg-input);
  color: var(--sg-text);
  padding: 10px 12px;
}
input { width: 100%; }
button {
  cursor: pointer;
  white-space: nowrap;
}
button:hover { border-color: var(--sg-accent); opacity: 0.95; }
button.danger { border-color: #7f1d1d; color: #fecaca; }
.muted { color: var(--sg-muted); margin: 0; }
.hidden { display: none !important; }
.list { display: grid; gap: 8px; }
.item {
  border: 1px solid var(--sg-border);
  border-radius: 10px;
  padding: 10px;
  background: var(--sg-bg-input);
}
.status {
  display: inline-block;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--sg-border);
}
.status.generated { border-color: #166534; color: #bbf7d0; }
.status.failed { border-color: #991b1b; color: #fecaca; }
.status.processing, .status.queued { border-color: #854d0e; color: #fde68a; }
a { color: var(--sg-link); text-decoration: none; }
a:hover { color: var(--sg-link-hover); text-decoration: underline; }
#builderFrame {
  width: 100%;
  min-height: 950px;
  border: 1px solid var(--sg-border);
  border-radius: 10px;
  background: var(--sg-bg-input);
}
.sg-ent-block { display: grid; gap: 12px; margin-top: 4px; }
.sg-ent-block .sg-ent-row {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--sg-border-soft);
  background: var(--sg-bg-input);
  line-height: 1.45;
  font-size: 14px;
}
.sg-ent-block .sg-ent-row strong { color: var(--sg-strong); }
.sg-ent-block .sg-ent-meta { font-size: 13px; margin-top: 6px; }

.sg-builder-title { margin: 0 0 12px; font-size: 1.25rem; }
#sg-packages-card.sg-packages-highlight {
  outline: 2px solid var(--sg-accent);
  outline-offset: 4px;
  border-radius: 12px;
  transition: outline-color 0.25s ease;
}

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
}
