/* Social Growth Engine — Native social.ir Design Tokens + Full-Width Desktop & Sticky Sidebar */
body.sge-page .sc-prose {
  max-width: none !important;
  width: 100%;
}

body.sge-page .sc-page-hero {
  padding: clamp(18px, 2.6vw, 34px) 0 clamp(14px, 2vw, 22px) !important;
}

body.sge-page .sc-page-hero h1 {
  max-width: 34ch !important;
  font-size: clamp(1.75rem, 1.25rem + 2vw, 2.75rem) !important;
  line-height: 1.3 !important;
  margin-bottom: 10px !important;
}

body.sge-page .sc-plain {
  padding-top: 0 !important;
}

body.sge-page .sc-prose > p:first-child {
  max-width: 74ch;
  font-size: 1.03rem;
  color: var(--muted, #686A72);
  margin: 0 0 22px;
  line-height: 1.8;
}

/* 2-Column Desktop Layout (Main Tool + Sticky Left Sidebar) */
.sge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: start;
}

.sge-main {
  min-width: 0;
}

.sge-side {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.sge-side-card {
  background: var(--surface, #FFFCF7);
  border: 1px solid var(--border, #E6E0D6);
  border-radius: 16px;
  padding: 15px;
}

.sge-side-card--dark {
  background: var(--night, #1D263C);
  color: var(--on-ink, #F5F0E7);
  border-color: rgba(245, 240, 231, .14);
}

.sge-side-card--dark h3 {
  color: #F5F0E7 !important;
}

.sge-side-card--dark p {
  color: #C4C8D4 !important;
}

.sge-side-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink, #1D263C);
}

.sge-side-card p {
  margin: 0 0 12px;
  font-size: .85rem;
  line-height: 1.7;
  color: var(--muted, #686A72);
}

.sge-side-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin-bottom: 12px;
}

.sge-side-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sge-side-list li {
  margin: 0 !important;
}

.sge-side-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--paper, #F5F0E7);
  border: 1px solid var(--border, #E6E0D6);
  color: var(--ink, #1D263C) !important;
  text-decoration: none !important;
  font-size: .85rem;
  font-weight: 500;
  transition: border-color .15s ease, color .15s ease;
}

.sge-side-list a:hover {
  border-color: var(--lapis, #344E8B);
  color: var(--lapis, #344E8B) !important;
}

.sge-side-bio-input {
  display: flex;
  align-items: center;
  direction: ltr;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 10px;
  padding: 0 10px;
  margin-bottom: 10px;
}

.sge-side-bio-input span {
  font-size: .84rem;
  color: #E0A644;
  font-weight: 700;
}

.sge-side-bio-input input {
  border: 0;
  background: transparent;
  color: #fff;
  padding: 9px 4px;
  font-size: .88rem;
  width: 100%;
  outline: none;
  direction: ltr;
}

.sge-side-bio-input input::placeholder {
  color: rgba(255, 255, 255, .55);
}

@media (max-width: 980px) {
  .sge-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .sge-side {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .sge-side-thumb {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 760px) {
  .sge-toast {
    bottom: 84px !important;
  }
  .sge-btn--sm {
    min-height: 42px;
    padding: 9px 14px;
    font-size: .86rem;
  }
  .sge-pill {
    min-height: 40px;
    padding: 8px 14px;
  }
  .sge-field {
    max-width: 100% !important;
  }
}

.sge-wrap {
  margin: 0 auto 36px;
  font-family: var(--ff, "Vazirmatn", Tahoma, sans-serif);
  color: var(--text, #242631);
  max-width: 100%;
  overflow-x: hidden;
}

/* Fix Persian descender underline bug on /bio/ and tool links */
a {
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

.sge-panel {
  background: var(--surface, #FFFCF7);
  border: 1px solid var(--border, #E6E0D6);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 24px;
}

.sge-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.sge-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 760px) {
  .sge-grid-2, .sge-grid-3 {
    grid-template-columns: 1fr;
  }
  .sge-panel {
    padding: 16px;
  }
}

.sge-head-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--lapis, #344E8B);
  background: var(--saffron-soft, #F6E3BC);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

[data-theme="dark"] .sge-head-badge {
  color: var(--saffron, #E0A644);
  background: rgba(224, 166, 68, .14);
}

.sge-title-sm {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ink, #1D263C);
}

.sge-sub {
  font-size: .92rem;
  color: var(--muted, #686A72);
  margin: 0 0 18px;
  line-height: 1.7;
}

/* Copyable Template Cards */
.sge-card {
  background: var(--paper, #F5F0E7);
  border: 1px solid var(--border, #E6E0D6);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  transition: border-color .18s ease, transform .18s ease;
}

.sge-card:hover {
  border-color: var(--lapis, #344E8B);
}

.sge-card__tag {
  font-size: .78rem;
  font-weight: 600;
  color: var(--lapis, #344E8B);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sge-card__body {
  white-space: pre-line;
  font-size: .95rem;
  line-height: 1.85;
  color: var(--ink, #1D263C);
  margin: 0;
  word-break: break-word;
}

.sge-card__body.is-ltr {
  direction: ltr;
  text-align: left;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.sge-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--border, #E6E0D6);
}

.sge-count {
  font-size: .78rem;
  color: var(--muted, #686A72);
}

.sge-count.is-over {
  color: var(--pome, #AF4D50);
  font-weight: 700;
}

/* Buttons */
.sge-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--btn, #344E8B);
  color: #fff !important;
  border: 0;
  border-radius: 10px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  transition: opacity .15s ease, transform .15s ease;
}

.sge-btn:hover {
  opacity: .92;
}

.sge-btn--ghost {
  background: transparent;
  color: var(--lapis, #344E8B) !important;
  border: 1px solid var(--border, #E6E0D6);
}

.sge-btn--ghost:hover {
  border-color: var(--lapis, #344E8B);
}

.sge-btn--saffron {
  background: var(--saffron, #E0A644);
  color: #1D263C !important;
}

.sge-btn--sm {
  padding: 6px 12px;
  font-size: .82rem;
  border-radius: 8px;
}

/* Form Controls */
.sge-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sge-field label {
  font-size: .84rem;
  font-weight: 600;
  color: var(--ink, #1D263C);
}

.sge-input, .sge-select, .sge-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--paper, #F5F0E7);
  color: var(--ink, #1D263C);
  border: 1px solid var(--border, #E6E0D6);
  border-radius: 11px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: .92rem;
  outline: none;
}

.sge-input:focus, .sge-select:focus, .sge-textarea:focus {
  border-color: var(--lapis, #344E8B);
}

.sge-input.is-ltr {
  direction: ltr;
  text-align: left;
}

.sge-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.sge-input-row .sge-input {
  flex: 1 1 220px;
}

.sge-apply-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.sge-ready-msg {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ok, #2F6B4F);
  background: rgba(47, 107, 79, .12);
  border: 1px solid rgba(47, 107, 79, .3);
  padding: 7px 14px;
  border-radius: 10px;
}

[data-theme="dark"] .sge-ready-msg {
  color: #6EE7B7;
  background: rgba(110, 231, 183, .12);
  border-color: rgba(110, 231, 183, .28);
}

.sge-ready-msg.is-show {
  display: inline-flex;
}

.sge-pulse {
  animation: sgePulse .65s ease;
}

@keyframes sgePulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 166, 68, .55); }
  100% { box-shadow: 0 0 0 12px rgba(224, 166, 68, 0); }
}

.sge-preview-box {
  background: var(--paper, #F5F0E7);
  border: 1.5px solid var(--lapis, #344E8B);
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
}

.sge-preview-out {
  white-space: pre-line;
  font-size: .98rem;
  line-height: 1.85;
  color: var(--ink, #1D263C);
  min-height: 54px;
  word-break: break-word;
}

.sge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

/* Hashtag & Emoji Pills */
.sge-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.sge-pill {
  background: var(--paper, #F5F0E7);
  color: var(--ink, #1D263C);
  border: 1px solid var(--border, #E6E0D6);
  border-radius: 999px;
  padding: 6px 13px;
  font-family: inherit;
  font-size: .86rem;
  cursor: pointer;
  transition: all .15s ease;
}

.sge-pill:hover {
  border-color: var(--lapis, #344E8B);
}

.sge-pill.is-selected {
  background: var(--btn, #344E8B);
  color: #fff;
  border-color: var(--btn, #344E8B);
}

/* Viral Bio Funnel Banner */
.sge-bio-funnel {
  background: linear-gradient(135deg, rgba(52, 78, 139, .14), rgba(224, 166, 68, .12));
  border: 1px solid var(--lapis, #344E8B);
  border-radius: 18px;
  padding: 20px 22px;
  margin: 26px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sge-bio-funnel__txt {
  flex: 1 1 280px;
}

.sge-bio-funnel__txt h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  color: var(--ink, #1D263C);
}

.sge-bio-funnel__txt p {
  margin: 0;
  font-size: .88rem;
  color: var(--muted, #686A72);
  line-height: 1.65;
}

.sge-bio-funnel__form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 0 1 360px;
}

.sge-bio-funnel__inputwrap {
  display: flex;
  align-items: center;
  direction: ltr;
  background: var(--surface, #FFFCF7);
  border: 1px solid var(--border, #E6E0D6);
  border-radius: 10px;
  padding: 0 10px;
  flex: 1 1 180px;
}

.sge-bio-funnel__prefix {
  font-size: .86rem;
  color: var(--muted, #686A72);
  font-weight: 600;
  user-select: none;
}

.sge-bio-funnel__input {
  border: 0;
  background: transparent;
  color: var(--ink, #1D263C);
  padding: 10px 4px;
  font-size: .9rem;
  width: 100%;
  outline: none;
  direction: ltr;
}

/* Cross-Link Mesh */
.sge-cross {
  background: var(--surface, #FFFCF7);
  border: 1px solid var(--border, #E6E0D6);
  border-radius: 18px;
  padding: 20px 22px;
  margin: 24px 0;
}

.sge-cross h2, .sge-cross h3 {
  font-size: 1.08rem;
  margin: 0 0 12px;
  color: var(--ink, #1D263C);
}

.sge-link-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.sge-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  background: var(--paper, #F5F0E7);
  border: 1px solid var(--border, #E6E0D6);
  color: var(--ink, #1D263C) !important;
  text-decoration: none !important;
  font-size: .86rem;
  font-weight: 500;
  transition: border-color .15s ease, color .15s ease;
}

.sge-link-chip:hover {
  border-color: var(--lapis, #344E8B);
  color: var(--lapis, #344E8B) !important;
}

.sge-link-chip.is-accent {
  border-color: var(--saffron, #E0A644);
  background: var(--saffron-soft, #F6E3BC);
  color: #1D263C !important;
  font-weight: 600;
}

[data-theme="dark"] .sge-link-chip.is-accent {
  background: rgba(224, 166, 68, .15);
  color: var(--saffron, #E0A644) !important;
}

/* FAQ Accordion */
.sge-faq details {
  border: 1px solid var(--border, #E6E0D6);
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 10px;
  background: var(--paper, #F5F0E7);
}

.sge-faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .95rem;
  color: var(--ink, #1D263C);
  list-style: none;
}

.sge-faq summary::before {
  content: "+ ";
  color: var(--lapis, #344E8B);
  margin-left: 6px;
}

.sge-faq details[open] summary::before {
  content: "− ";
}

.sge-faq p {
  margin: 10px 0 0;
  font-size: .9rem;
  line-height: 1.75;
  color: var(--text, #242631);
}

/* Tips List */
.sge-tips {
  margin: 0;
  padding: 0 20px 0 0;
  line-height: 1.9;
  font-size: .93rem;
}

.sge-tips li {
  margin-bottom: 6px;
}

/* QR Box */
.sge-qr-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
}

.sge-qr-preview {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border, #E6E0D6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  min-height: 170px;
}

/* Toast Notification */
.sge-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1D263C;
  color: #F5F0E7;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 99999;
}

.sge-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Hub Cards Grid */
.sge-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 28px;
}

@media (max-width: 820px) {
  .sge-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .sge-hub-grid {
    grid-template-columns: 1fr;
  }
}

.sge-hub-card {
  display: block;
  background: var(--surface, #FFFCF7);
  border: 1px solid var(--border, #E6E0D6);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none !important;
  color: inherit !important;
  transition: border-color .16s ease, transform .16s ease;
}

.sge-hub-card:hover {
  border-color: var(--lapis, #344E8B);
  transform: translateY(-2px);
}

.sge-hub-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--ink, #1D263C);
}

.sge-hub-card p {
  margin: 0;
  font-size: .84rem;
  color: var(--muted, #686A72);
  line-height: 1.6;
}
