/* Scoped to .sg-shell (not :root/body) so these tokens and resets don't
   leak into the shared sidebar/header layout from style.css, which
   defines its own --bg, --border, etc. on :root/body. */
   .sg-shell {
    --sg-bg: #0b0e14;
    --sg-bg-panel: #12161f;
    --sg-bg-panel-2: #171c27;
    --sg-border: #232938;
    --text-primary: #f1f5f9;
    --text-muted: #8b93a7;
    --accent-1: #667eea;
    --accent-2: #764ba2;
    --accent-grad: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    --good: #34d399;
    --warn: #f59e0b;
    --bad: #f87171;
    font-family: 'Cabinet Grotesk', 'Segoe UI', sans-serif;
    line-height: 1.5;
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    background: var(--sg-bg);
    color: var(--text-primary);
}
.sg-shell *, .sg-shell *::before, .sg-shell *::after { box-sizing: border-box; }
.sg-shell h1, .sg-shell h2, .sg-shell h3 { font-family: 'Cormorant Garamond', serif; font-weight: 700; margin: 0 0 .4rem; }
.sg-shell .mono { font-family: 'DM Mono', monospace; }
.sg-shell a { color: inherit; }
.sg-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.sg-header h1 { font-size: 2.1rem; }
.sg-header p { color: var(--text-muted); font-size: .95rem; margin: 4px 0 0; }
.sg-badge { font-family: 'DM Mono', monospace; font-size: .72rem; color: var(--text-muted); border: 1px solid var(--sg-border); padding: 4px 10px; border-radius: 999px; }

.sg-grid { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }
@media (max-width: 980px) { .sg-grid { grid-template-columns: 1fr; } }

.sg-panel { background: var(--sg-bg-panel); border: 1px solid var(--sg-border); border-radius: 16px; padding: 20px; }
.sg-panel + .sg-panel { margin-top: 18px; }
.sg-panel h2 { font-size: 1.15rem; }
.sg-label { display: block; font-family: 'DM Mono', monospace; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin: 14px 0 6px; }
textarea, select, input[type=text], input[type=number] {
    width: 100%; background: var(--sg-bg-panel-2); border: 1px solid var(--sg-border); border-radius: 10px;
    color: var(--text-primary); padding: 10px 12px; font-family: inherit; font-size: .92rem;
}
textarea { min-height: 92px; resize: vertical; }
.sg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sg-chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sg-chip { font-family: 'DM Mono', monospace; font-size: .78rem; border: 1px solid var(--sg-border); background: var(--sg-bg-panel-2); color: var(--text-muted); padding: 7px 12px; border-radius: 999px; cursor: pointer; transition: .15s; }
.sg-chip.active, .sg-chip:hover { border-color: var(--accent-1); color: var(--text-primary); }

.sg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 10px; padding: 12px 18px; font-weight: 600; font-size: .92rem; cursor: pointer; width: 100%; margin-top: 18px; background: var(--accent-grad); color: #fff; }
.sg-btn:disabled { opacity: .6; cursor: not-allowed; }
.sg-btn-outline { background: transparent; border: 1px solid var(--sg-border); color: var(--text-primary); }
.sg-btn-row { display: flex; gap: 10px; margin-top: 10px; }
.sg-btn-row .sg-btn { margin-top: 0; }

.sg-model-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-height: 220px; overflow-y: auto; }
.sg-model-opt { display: flex; align-items: center; gap: 8px; border: 1px solid var(--sg-border); border-radius: 10px; padding: 9px 11px; cursor: pointer; font-size: .88rem; }
.sg-model-opt.active { border-color: var(--accent-1); background: rgba(102,126,234,.08); }
.sg-model-opt small { color: var(--text-muted); font-family: 'DM Mono', monospace; margin-left: auto; }

.sg-preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sg-deck-title { font-size: 1.05rem; color: var(--text-muted); }

.sg-empty { border: 1px dashed var(--sg-border); border-radius: 16px; padding: 60px 20px; text-align: center; color: var(--text-muted); }

.sg-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.sg-slide { aspect-ratio: 16/9; border-radius: 14px; padding: 22px; position: relative; overflow: hidden; border: 1px solid var(--sg-border); background: var(--sg-bg-panel-2); display: flex; flex-direction: column; }
.sg-slide .sg-slide-num { position: absolute; top: 10px; right: 14px; font-family: 'DM Mono', monospace; font-size: .7rem; color: var(--text-muted); }
.sg-slide-thumb { float: right; width: 84px; height: 84px; object-fit: cover; border-radius: 8px; margin: 0 0 8px 10px; border: 1px solid var(--sg-border); }
.sg-img-regen-btn { position: absolute; top: 10px; left: 14px; background: rgba(0,0,0,.35); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 3px 10px; font-size: .68rem; font-family: 'DM Mono', monospace; cursor: pointer; }
.sg-img-regen-btn:disabled { opacity: .6; cursor: not-allowed; }
.sg-slide h3 { font-size: 1.15rem; margin-bottom: 8px; }
.sg-slide p, .sg-slide li { font-size: .82rem; color: var(--text-muted); }
.sg-slide.layout-title, .sg-slide.layout-closing { justify-content: center; align-items: flex-start; background: var(--accent-grad); }
.sg-slide.layout-title h3, .sg-slide.layout-closing h3 { color: #fff; font-size: 1.6rem; }
.sg-slide.layout-title p, .sg-slide.layout-closing p { color: rgba(255,255,255,.85); }
.sg-slide ul { margin: 0; padding-left: 18px; }
.sg-slide li { margin-bottom: 4px; }
.sg-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 6px; }
.sg-stat { background: rgba(255,255,255,.04); border-radius: 10px; padding: 8px 10px; }
.sg-stat .val { font-family: 'DM Mono', monospace; font-size: 1.1rem; color: var(--accent-1); }
.sg-stat .lbl { font-size: .72rem; color: var(--text-muted); }
.sg-chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; margin-top: 8px; }
.sg-chart-bars div { flex: 1; background: var(--accent-grad); border-radius: 4px 4px 0 0; min-height: 4px; }
.sg-timeline { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.sg-timeline .step { display: flex; gap: 8px; align-items: flex-start; font-size: .78rem; }
.sg-timeline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-1); margin-top: 4px; flex-shrink: 0; }
.sg-quote { font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; font-style: italic; margin-top: 10px; }
.sg-table { width: 100%; border-collapse: collapse; font-size: .74rem; margin-top: 6px; }
.sg-table th, .sg-table td { border: 1px solid var(--sg-border); padding: 4px 6px; text-align: left; }

.sg-history-item { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--sg-border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; font-size: .85rem; }
.sg-history-item:hover { border-color: var(--accent-1); }
.sg-history-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-history-item small { color: var(--text-muted); font-family: 'DM Mono', monospace; }

.sg-status { font-family: 'DM Mono', monospace; font-size: .82rem; color: var(--text-muted); margin-top: 10px; min-height: 18px; }
.sg-status.error { color: var(--bad); }
.sg-status.ok { color: var(--good); }

.sg-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 50; }
.sg-modal-backdrop.open { display: flex; }
.sg-modal { background: var(--sg-bg-panel); border: 1px solid var(--sg-border); border-radius: 16px; padding: 24px; max-width: 440px; width: 90%; }
.sg-modal ol { padding-left: 20px; color: var(--text-muted); font-size: .88rem; }
.sg-modal ol li { margin-bottom: 6px; }

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

/* SEO / EEAT supporting content */
.sg-seo { margin-top: 34px; padding-top: 28px; border-top: 1px solid var(--sg-border); }
.sg-seo h2 { font-size: 1.5rem; margin-bottom: 12px; }
.sg-seo p { color: var(--text-muted); font-size: .92rem; line-height: 1.65; max-width: 860px; }
.sg-seo-steps { color: var(--text-muted); font-size: .92rem; line-height: 1.7; padding-left: 22px; max-width: 780px; }
.sg-seo-steps li { margin-bottom: 6px; }
.sg-seo-steps strong { color: var(--text-primary); }
.sg-seo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 6px; }
.sg-seo-grid article { background: var(--sg-bg-panel); border: 1px solid var(--sg-border); border-radius: 14px; padding: 16px 18px; }
.sg-seo-grid h3 { font-family: 'DM Mono', monospace; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-primary); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.sg-seo-grid p { font-size: .85rem; margin: 0; }
.sg-faq { max-width: 860px; }
.sg-faq details { border: 1px solid var(--sg-border); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; background: var(--sg-bg-panel); }
.sg-faq summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--text-primary); }
.sg-faq p { margin: 10px 0 0; font-size: .86rem; }
.sg-eeat-byline { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--sg-border); font-size: .78rem; color: var(--text-muted); }
.sg-eeat-byline a { text-decoration: underline; }