/* AiClipPilot — public pages (landing, guide). Loaded by PublicLayout only.
   Everything is scoped under .public so nothing leaks into the app shell.
   Builds on app.css tokens (--bg, --surface, --surface-2, --border, --text, --text-2,
   --text-3, --accent, --accent-strong, --accent-soft, --accent-ink, --danger, --ok). */

.public {
    --pub-violet: #5b3fe0;
    --pub-indigo: #4a2fc4;
    --pub-grad: #14112b;
    --pub-hero-ink: #ffffff;
    --pub-hero-ink-2: rgba(255, 255, 255, 0.82);
    --pub-hero-ink-3: rgba(255, 255, 255, 0.64);
    --pub-hero-line: rgba(255, 255, 255, 0.22);
    --pub-hero-chip: rgba(255, 255, 255, 0.14);
    --pub-indigo-soft: #ffe7e2;
    --pub-indigo-ink: #b13a27;
    --pub-warn: #a16207;
    --pub-warn-soft: #fef3c7;
    --pub-danger-soft: #fee4e2;
    --pub-ok-soft: #dcfce7;
    --pub-coral: #f45d48;
    --pub-tg-bubble: #ffffff;
    --pub-tg-bg: #e7ebf0;
    --pub-tg-ink: #141a22;
    --pub-tg-ink-2: #5b6573;
    --pub-ring: color-mix(in srgb, var(--accent) 35%, transparent);
    display: flex; flex-direction: column; min-height: 100vh;
    background: var(--bg);
}
.public .site-main { flex: 1; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .public {
        --pub-grad: #0f0d22;
        --pub-indigo-soft: #3a1c16;
        --pub-indigo-ink: #ffb3a5;
        --pub-warn: #facc15;
        --pub-warn-soft: #3b3111;
        --pub-danger-soft: #431a17;
        --pub-ok-soft: #10331c;
        --pub-tg-bubble: #1f2a36;
        --pub-tg-bg: #0f1720;
        --pub-tg-ink: #e6eaf0;
        --pub-tg-ink-2: #9aa5b4;
    }
}
:root[data-theme="dark"] .public {
    --pub-grad: #0f0d22;
    --pub-indigo-soft: #3a1c16;
    --pub-indigo-ink: #ffb3a5;
    --pub-warn: #facc15;
    --pub-warn-soft: #3b3111;
    --pub-danger-soft: #431a17;
    --pub-ok-soft: #10331c;
    --pub-tg-bubble: #1f2a36;
    --pub-tg-bg: #0f1720;
    --pub-tg-ink: #e6eaf0;
    --pub-tg-ink-2: #9aa5b4;
}

/* ---------- Shared ---------- */

.public .pub-section { padding: 56px 0; }
.public .pub-section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.public .pub-head { max-width: 62ch; margin-bottom: 32px; }
.public .pub-head h2 { margin-bottom: 8px; }
.public .pub-head p { color: var(--text-2); font-size: 1.05rem; margin: 0; }
.public .pub-head.center { margin-inline: auto; text-align: center; }
.public .pub-eyebrow {
    display: inline-block; margin-bottom: 14px; padding: 4px 10px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent-strong); font-size: 0.78rem; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
}
.public .pub-eyebrow.indigo { background: var(--pub-indigo-soft); color: var(--pub-indigo-ink); }
.public .pub-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.public .btn-hero { background: #fff; color: var(--pub-indigo); border-color: #fff; }
.public .btn-hero:hover { background: #f1edff; border-color: #f1edff; }
.public .btn-hero-ghost { background: transparent; color: var(--pub-hero-ink); border-color: var(--pub-hero-line); }
.public .btn-hero-ghost:hover { background: var(--pub-hero-chip); }

/* ---------- Hero ---------- */

.public .pub-hero {
    position: relative; overflow: hidden; isolation: isolate;
    background: var(--pub-grad); color: var(--pub-hero-ink);
    padding: 56px 0 56px;
}
/* The logo mark, very large and faint, bleeding off the right edge. */
.public .pub-hero::before {
    content: ""; position: absolute; right: -6%; top: 50%; width: 46%; aspect-ratio: 1; transform: translateY(-50%);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='%23ff7a63'%3E%3Crect x='1.2' y='12.5' width='3' height='7' rx='1.5'/%3E%3Crect x='5.7' y='9' width='3' height='14' rx='1.5'/%3E%3Crect x='10.2' y='5.5' width='3' height='21' rx='1.5'/%3E%3C/g%3E%3Cpath fill='%23a594ff' d='M17.6 6.2 29.4 14.4a2 2 0 0 1 0 3.2L17.6 25.8a1.6 1.6 0 0 1-2.5-1.3V7.5a1.6 1.6 0 0 1 2.5-1.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0.07; pointer-events: none; z-index: -1;
}
.public .pub-hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 85%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 85%);
}
.public .pub-hero .container { display: grid; gap: 40px; align-items: center; }
.public .pub-hero h1 { color: var(--pub-hero-ink); max-width: 16ch; margin-bottom: 18px; }
.public .pub-hero .pub-eyebrow { background: var(--pub-hero-chip); color: var(--pub-hero-ink); border: 1px solid var(--pub-hero-line); }
.public .pub-hero .lede { font-size: 1.15rem; color: var(--pub-hero-ink-2); max-width: 48ch; }
.public .pub-hero .cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.public .pub-hero .fine { margin: 18px 0 0; color: var(--pub-hero-ink-3); font-size: 0.9rem; }
.public .pub-hero .fine b { color: var(--pub-hero-ink-2); font-weight: 600; }

/* Product mock: dashboard remote view */
.public .pub-mock {
    margin: 0; width: 100%; border-radius: var(--radius-lg); overflow: hidden;
    background: var(--surface); color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 30px 60px -20px rgba(6, 12, 40, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.public .pub-mock-bar {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 0.78rem; color: var(--text-3);
}
.public .pub-mock-dots { display: flex; gap: 5px; }
.public .pub-mock-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); display: block; }
.public .pub-mock-url {
    flex: 1; min-width: 0; padding: 4px 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 0.72rem;
}
.public .pub-mock-live { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent-strong); white-space: nowrap; }
.public .pub-mock-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: block; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.public .pub-mock-body { padding: 14px 14px 12px; position: relative; }
.public .pub-mock-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.public .pub-mock-title strong { font-size: 0.95rem; }
.public .pub-mock-title span { font-size: 0.75rem; color: var(--text-3); }
.public .pub-mock-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; table-layout: fixed; }
.public .pub-mock-table th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 8px; background: var(--surface-2); }
.public .pub-mock-table td { padding: 8px; border-top: 1px solid var(--border); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.public .pub-mock-table th:first-child, .public .pub-mock-table td:first-child { width: 20%; font-weight: 600; color: var(--text); }
.public .pub-mock-table th:nth-child(3), .public .pub-mock-table td:nth-child(3) { width: 24%; }
.public .pub-mock-table th:last-child, .public .pub-mock-table td:last-child { width: 16%; text-align: right; }
.public .pub-mock-table tr.hi td { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--text); }
.public .pub-mock-table tr.hi:first-of-type td { border-top-color: transparent; }
.public .pub-mock-table tr.hi td:first-child { border-radius: 6px 0 0 6px; }
.public .pub-mock-table tr.hi td:last-child { border-radius: 0 6px 6px 0; }
.public .pub-mock-table .key { display: inline-flex; align-items: center; gap: 4px; }
.public .pub-mock-table .key::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.public .pub-mock-chip {
    position: absolute; right: 18px; top: 48px; display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 600;
    background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.4);
}
.public .pub-mock-chip svg { width: 12px; height: 12px; }
.public .pub-mock-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.72rem; color: var(--text-3); }
.public .pub-mock-foot b { color: var(--text-2); font-weight: 600; }
.public .pub-mock-cursor { position: absolute; width: 16px; height: 20px; left: 52%; top: 118px; fill: var(--text); stroke: var(--surface); stroke-width: 1.5; pointer-events: none; }

/* ---------- Trust strip ---------- */

.public .pub-trust { border-bottom: 1px solid var(--border); background: var(--surface); }
.public .pub-trust .container { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; padding-block: 18px; }
.public .pub-trust div { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 500; color: var(--text-2); }
.public .pub-trust svg { width: 18px; height: 18px; flex: none; color: var(--accent); }

/* ---------- Feature grid ---------- */

.public .pub-features { display: grid; gap: 16px; }
.public .pub-feature { padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.public .pub-feature-icon {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px;
    background: var(--accent-soft); color: var(--accent-strong);
}
.public .pub-feature:nth-child(even) .pub-feature-icon { background: var(--pub-indigo-soft); color: var(--pub-indigo-ink); }
.public .pub-feature-icon svg { width: 22px; height: 22px; }
.public .pub-feature h3 { font-size: 1.02rem; margin-bottom: 6px; }
.public .pub-feature p { margin: 0; color: var(--text-2); font-size: 0.95rem; }

/* ---------- How it works ---------- */

.public .pub-steps { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.public .pub-step { position: relative; padding: 26px 24px 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.public .pub-step::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--pub-grad); }
.public .pub-step-num {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-bottom: 14px;
    border-radius: 11px; background: var(--pub-grad); color: #fff; font-weight: 700; font-size: 1rem;
}
.public .pub-step h3 { margin-bottom: 6px; font-size: 1.1rem; }
.public .pub-step p { margin: 0; color: var(--text-2); }
.public .pub-step small { display: block; margin-top: 12px; color: var(--text-3); font-size: 0.82rem; }

/* ---------- Example alert (Telegram style) ---------- */

.public .pub-example { display: grid; gap: 28px; align-items: center; }
.public .pub-example ol { margin: 0; padding-left: 22px; color: var(--text-2); }
.public .pub-example li { margin-bottom: 8px; }
.public .pub-example li b { color: var(--text); font-weight: 600; }
.public .pub-tg {
    width: 100%; max-width: 440px; justify-self: center; border-radius: 18px; padding: 16px;
    background: var(--pub-tg-bg); border: 1px solid var(--border);
    background-image: radial-gradient(color-mix(in srgb, var(--pub-coral) 12%, transparent) 1px, transparent 1px);
    background-size: 14px 14px;
}
.public .pub-tg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--pub-tg-ink); font-size: 0.9rem; }
.public .pub-tg-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--pub-coral); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; flex: none; }
.public .pub-tg-head strong { display: block; line-height: 1.2; }
.public .pub-tg-head span { font-size: 0.75rem; color: var(--pub-tg-ink-2); }
.public .pub-tg-msg {
    position: relative; background: var(--pub-tg-bubble); color: var(--pub-tg-ink); border-radius: 14px 14px 14px 4px;
    padding: 10px 12px 8px; font-size: 0.9rem; line-height: 1.45; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.public .pub-tg-msg + .pub-tg-msg { margin-top: 8px; }
.public .pub-tg-msg .title { font-weight: 600; display: block; margin-bottom: 4px; }
.public .pub-tg-msg .line { display: block; color: var(--pub-tg-ink-2); font-family: var(--mono); font-size: 0.8rem; }
.public .pub-tg-msg .link { display: block; margin-top: 6px; color: var(--pub-coral); font-size: 0.82rem; word-break: break-all; }
.public .pub-tg-msg .meta { display: block; text-align: right; margin-top: 4px; font-size: 0.72rem; color: var(--pub-tg-ink-2); }
.public .pub-tg-shot { margin: 8px -4px 4px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.public .pub-tg-shot svg { width: 100%; height: auto; display: block; }

/* ---------- FAQ ---------- */

.public .pub-faq { display: grid; gap: 10px; max-width: 780px; margin-inline: auto; }
.public .pub-faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 0 18px; }
.public .pub-faq details[open] { border-color: var(--pub-ring); }
.public .pub-faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.public .pub-faq summary::-webkit-details-marker { display: none; }
.public .pub-faq summary::after { content: "+"; color: var(--text-3); font-size: 1.3rem; line-height: 1; flex: none; width: 1em; text-align: center; }
.public .pub-faq details[open] summary::after { content: "\2013"; }
.public .pub-faq details p { color: var(--text-2); margin: 0 0 16px; }

/* ---------- CTA band ---------- */

.public .pub-cta { padding: 48px 0 64px; }
.public .pub-cta .pub-cta-box {
    position: relative; overflow: hidden; text-align: center; padding: 48px 24px; border-radius: 24px;
    background: var(--pub-grad); color: var(--pub-hero-ink);
}
.public .pub-cta h2 { color: var(--pub-hero-ink); margin-bottom: 8px; }
.public .pub-cta p { color: var(--pub-hero-ink-2); margin-bottom: 24px; }
.public .pub-cta .cta-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

/* ---------- Footer additions ---------- */

.public .site-footer .brand + p { max-width: 36ch; }

/* ---------- Guide ---------- */

.public .pub-guide-hero { padding: 48px 0 32px; background: var(--surface); border-bottom: 1px solid var(--border); }
.public .pub-guide-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 10px; }
.public .pub-guide-hero p { color: var(--text-2); font-size: 1.1rem; max-width: 60ch; margin: 0; }
.public .pub-guide-hero .pub-tagline { display: block; margin-top: 10px; font-size: 0.95rem; color: var(--text-3); }

.public .pub-guide { display: grid; gap: 32px; padding: 32px 0 72px; align-items: start; }
.public .pub-toc { position: static; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.public .pub-toc h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 10px; }
.public .pub-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.public .pub-toc a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--text-2); font-size: 0.92rem; font-weight: 500; }
.public .pub-toc a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.public .pub-toc .sub a { padding-left: 22px; font-weight: 400; font-size: 0.86rem; }
.public .pub-toc .pub-toc-cta { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 0.86rem; color: var(--text-3); }

.public .pub-doc { min-width: 0; max-width: 72ch; }
.public .pub-doc > section { padding: 8px 0 32px; margin-bottom: 24px; border-bottom: 1px solid var(--border); scroll-margin-top: 84px; }
.public .pub-doc > section:last-child { border-bottom: 0; }
.public .pub-doc h2 { font-size: 1.55rem; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.public .pub-doc h2 .num { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--pub-grad); color: #fff; font-size: 0.95rem; font-weight: 700; }
.public .pub-doc h3 { font-size: 1.12rem; margin: 26px 0 8px; scroll-margin-top: 84px; }
.public .pub-doc p, .public .pub-doc li { color: var(--text-2); }
.public .pub-doc p.intro { font-size: 1.05rem; color: var(--text-2); }
.public .pub-doc b, .public .pub-doc strong { color: var(--text); font-weight: 600; }
.public .pub-doc ul { list-style: disc; padding-left: 22px; margin: 0 0 1em; }
.public .pub-doc ul li { margin-bottom: 6px; }
.public .pub-doc kbd {
    display: inline-block; padding: 1px 8px; border-radius: 6px; font: inherit; font-size: 0.88em; font-weight: 500;
    background: var(--surface); border: 1px solid var(--border); border-bottom-width: 2px; color: var(--text); white-space: nowrap;
}
.public .pub-doc code { white-space: nowrap; }

.public .pub-num { counter-reset: guidestep; list-style: none; margin: 0 0 1em; padding: 0; display: grid; gap: 10px; }
.public .pub-num > li { position: relative; padding-left: 44px; counter-increment: guidestep; }
.public .pub-num > li::before {
    content: counter(guidestep); position: absolute; left: 0; top: 0;
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: 0.85rem;
}
.public .pub-num > li > p { margin: 0; }

.public .pub-note {
    display: grid; grid-template-columns: auto 1fr; gap: 12px; margin: 16px 0 1em; padding: 14px 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
}
.public .pub-note svg { width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.public .pub-note strong { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent-strong); margin-bottom: 2px; }
.public .pub-note p { margin: 0; }
.public .pub-note.warn { border-left-color: var(--pub-warn); }
.public .pub-note.warn svg, .public .pub-note.warn strong { color: var(--pub-warn); }
.public .pub-note.indigo { border-left-color: var(--pub-indigo); }
.public .pub-note.indigo svg, .public .pub-note.indigo strong { color: var(--pub-indigo-ink); }

.public .pub-fig { margin: 20px 0 24px; padding: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.public .pub-fig svg { width: 100%; height: auto; max-width: 520px; margin-inline: auto; display: block; }
.public .pub-fig figcaption { margin-top: 10px; text-align: center; font-size: 0.85rem; color: var(--text-3); }
.public .pub-fig text { font-family: var(--font); }
.public .pub-fig .f-bg { fill: var(--surface-2); }
.public .pub-fig .f-paper { fill: var(--surface); stroke: var(--border); }
.public .pub-fig .f-line { stroke: var(--border); }
.public .pub-fig .f-ink { fill: var(--text); }
.public .pub-fig .f-ink2 { fill: var(--text-2); }
.public .pub-fig .f-ink3 { fill: var(--text-3); }
.public .pub-fig .f-hi { fill: var(--accent-soft); stroke: var(--accent); }
.public .pub-fig .f-acc { fill: var(--accent); }
.public .pub-fig .f-acc-ink { fill: var(--accent-ink); }
.public .pub-fig .f-acc-stroke { stroke: var(--accent); }
.public .pub-fig .f-indigo { fill: var(--pub-indigo); }
.public .pub-fig .f-cursor { fill: var(--text); stroke: var(--surface); }
.public .pub-fig .f-tg { fill: var(--pub-coral); }
.public .pub-fig .f-tgbg { fill: var(--pub-tg-bg); }
.public .pub-fig .f-bubble { fill: var(--pub-tg-bubble); }
.public .pub-fig .f-tgink { fill: var(--pub-tg-ink); }
.public .pub-fig .f-tgink2 { fill: var(--pub-tg-ink-2); }

/* Health badges (guide and landing, own class names so pages.css .badge never collides) */
.public .pub-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.public .pub-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; border: 1px solid transparent; }
.public .pub-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.public .pub-badge.new { background: var(--accent-soft); color: var(--accent-strong); }
.public .pub-badge.ok { background: var(--pub-ok-soft); color: var(--ok); }
.public .pub-badge.healed { background: var(--pub-warn-soft); color: var(--pub-warn); }
.public .pub-badge.broken { background: var(--pub-danger-soft); color: var(--danger); }
.public .pub-badge.paused { background: var(--surface-2); color: var(--text-3); border-color: var(--border); }
.public .pub-badge-list { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 10px; }
.public .pub-badge-list li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.public .pub-badge-list li p { margin: 0; }

.public .pub-trouble { display: grid; gap: 12px; margin: 0 0 1em; }
.public .pub-trouble details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 0 16px; }
.public .pub-trouble summary { cursor: pointer; list-style: none; padding: 14px 0; font-weight: 600; color: var(--text); display: flex; justify-content: space-between; gap: 12px; }
.public .pub-trouble summary::-webkit-details-marker { display: none; }
.public .pub-trouble summary::after { content: "+"; color: var(--text-3); font-size: 1.2rem; line-height: 1; flex: none; }
.public .pub-trouble details[open] summary::after { content: "\2013"; }
.public .pub-trouble details > *:not(summary) { margin-top: 0; }
.public .pub-trouble details p:last-child, .public .pub-trouble details ul:last-child { margin-bottom: 14px; }

.public .pub-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 0 0 1em; }
.public .pub-table th, .public .pub-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-2); }
.public .pub-table th { color: var(--text); font-weight: 600; background: var(--surface-2); }
.public .pub-table td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }

/* ---------- Responsive ---------- */

@media (min-width: 640px) {
    .public .pub-trust .container { grid-template-columns: repeat(4, 1fr); }
    .public .pub-features { grid-template-columns: repeat(2, 1fr); }
    .public .pub-steps { grid-template-columns: repeat(3, 1fr); }
    .public .pub-hero { padding: 72px 0 64px; }
}

@media (min-width: 900px) {
    .public .pub-hero { padding: 88px 0 80px; }
    .public .pub-hero .container { grid-template-columns: 1.05fr 1fr; gap: 56px; }
    .public .pub-features { grid-template-columns: repeat(3, 1fr); }
    .public .pub-example { grid-template-columns: 1.15fr 1fr; }
    .public .pub-cta .pub-cta-box { padding: 64px 48px; }

    .public .pub-guide { grid-template-columns: 240px minmax(0, 1fr); gap: 48px; }
    .public .pub-toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
}

@media (max-width: 639px) {
    .public .pub-mock-table th:nth-child(3), .public .pub-mock-table td:nth-child(3) { display: none; }
    .public .pub-mock-chip { top: 44px; right: 14px; }
    .public .pub-badge-list li { grid-template-columns: 1fr; gap: 4px; }
    .public .pub-doc h2 { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: no-preference) {
    .public .pub-mock-live i { animation: pub-pulse 2s ease-in-out infinite; }
    @keyframes pub-pulse {
        0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
        50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 10%, transparent); }
    }
}

/* Fixes from visual review */
.public .pub-toc .pub-toc-cta a { display: inline; padding: 0; margin: 0; color: var(--accent); font-weight: 600; background: none; }
@media (max-width: 639px) {
  .public .pub-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .public .pub-table td:first-child { white-space: normal; }
}

/* The guide lives inside the signed-in app shell: drop the public page frame around it. */
.public.guide-in-app { display: block; min-height: 0; background: none; }
.guide-in-app .container { max-width: none; padding-inline: 0; margin: 0; }
.guide-in-app .pub-guide { padding-top: 0; }
@media (min-width: 900px) {
    .guide-in-app .pub-toc { top: 72px; max-height: calc(100vh - 88px); }
}
.guide-in-app section[id], .guide-in-app h3[id] { scroll-margin-top: 72px; }

/* ---------- AiClipPilot: editor mock in the hero ---------- */

.public .pub-ed { display: grid; grid-template-columns: 92px minmax(0, 1fr); grid-template-rows: auto auto; gap: 8px; padding: 10px; background: var(--surface); }
.public .pub-ed-bin { grid-row: 1; display: grid; gap: 6px; align-content: start; }
.public .pub-ed-bin i { display: block; aspect-ratio: 16 / 10; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.public .pub-ed-bin i:first-child { background: linear-gradient(135deg, var(--accent-soft), var(--pub-indigo-soft)); border-color: var(--accent); }
.public .pub-ed-monitor {
    position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
    background: linear-gradient(180deg, #f3f1fb 0 14%, #ffffff 14%); border: 1px solid var(--border);
}
.public .pub-ed-monitor .bar { position: absolute; inset: 0 0 auto 0; height: 14%; display: flex; align-items: center; gap: 4px; padding-left: 6%; }
.public .pub-ed-monitor .bar b { width: 12%; height: 30%; border-radius: 3px; background: #ddd8f0; display: block; }
.public .pub-ed-monitor .row { position: absolute; left: 6%; height: 7%; border-radius: 3px; background: #ebe8f6; }
.public .pub-ed-monitor .btn-fake { position: absolute; left: 58%; top: 52%; width: 22%; height: 12%; border-radius: 5px; background: #5b3fe0; box-shadow: 0 0 0 4px rgba(91, 63, 224, 0.25); }
.public .pub-ed-monitor .ring { position: absolute; left: 66%; top: 55%; width: 9%; aspect-ratio: 1; border-radius: 50%; border: 2px solid #f45d48; transform: translate(-50%, -50%); }
.public .pub-ed-monitor .cursor { position: absolute; left: 68%; top: 58%; width: 6%; fill: #17142a; stroke: #fff; stroke-width: 1.2; }
.public .pub-ed-monitor .cap {
    position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); white-space: nowrap;
    padding: 3px 9px; border-radius: 5px; background: rgba(15, 10, 35, 0.82); color: #fff; font-size: 0.66rem; font-weight: 500;
}
.public .pub-ed-tl { grid-column: 1 / -1; display: grid; gap: 4px; padding: 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); position: relative; }
.public .pub-ed-ruler { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.58rem; color: var(--text-3); padding-left: 34px; }
.public .pub-ed-track { display: flex; align-items: center; gap: 4px; height: 18px; }
.public .pub-ed-track > span:first-child { width: 30px; flex: none; font-size: 0.58rem; font-weight: 700; color: var(--text-3); letter-spacing: 0.04em; }
.public .pub-ed-clip { height: 100%; border-radius: 4px; display: block; }
.public .pub-ed-clip.v { background: repeating-linear-gradient(90deg, #7b63ef 0 14px, #6d55e8 14px 15px); }
.public .pub-ed-clip.n { background: linear-gradient(90deg, #f45d48, #f9826f); position: relative; overflow: hidden; }
.public .pub-ed-clip.n::after { content: ""; position: absolute; inset: 25% 6px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.75) 0 2px, transparent 2px 4px); mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.public .pub-ed-clip.c { background: var(--accent-soft); border: 1px solid var(--accent); }
.public .pub-ed-gap { flex: none; display: block; }
.public .pub-ed-head { position: absolute; top: 4px; bottom: 4px; left: 52%; width: 2px; background: #f45d48; border-radius: 2px; }
.public .pub-ed-head::before { content: ""; position: absolute; top: -2px; left: -4px; border: 5px solid transparent; border-top-color: #f45d48; }
:root[data-theme="dark"] .public .pub-ed-monitor { filter: brightness(0.92); }

/* ---------- Highlights ---------- */

.public .pub-hl { display: grid; gap: 18px; }
.public .pub-hl-card { position: relative; padding: 26px 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.public .pub-hl-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
.public .pub-hl-card:nth-child(2)::after { background: radial-gradient(circle, color-mix(in srgb, var(--pub-coral) 18%, transparent), transparent 70%); }
.public .pub-hl-num { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-strong); }
.public .pub-hl-num svg { width: 22px; height: 22px; padding: 4px; border-radius: 8px; background: var(--pub-grad); color: #fff; box-sizing: content-box; }
.public .pub-hl-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.public .pub-hl-card p { color: var(--text-2); margin-bottom: 14px; }
.public .pub-hl-card ul { display: grid; gap: 6px; font-size: 0.9rem; color: var(--text-2); }
.public .pub-hl-card ul li { padding-left: 18px; position: relative; }
.public .pub-hl-card ul li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; border-radius: 50%; background: var(--pub-grad); }

/* Voice gallery chips */
.public .pub-voices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.public .pub-voice { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 0.85rem; font-weight: 500; }
.public .pub-voice i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-style: normal; font-size: 0.65rem; }
.public .pub-voice small { color: var(--text-3); font-weight: 400; }

/* Script template sample */
.public .pub-script {
    margin: 0; padding: 18px 20px; border-radius: var(--radius-lg); overflow-x: auto;
    background: #15122a; color: #e7e3ff; border: 1px solid #2b2650; font-family: var(--mono); font-size: 0.82rem; line-height: 1.65;
    box-shadow: 0 24px 50px -24px rgba(20, 10, 60, 0.6);
}
.public .pub-script .k { color: #ff9b8a; }
.public .pub-script .h { color: #b7a8ff; font-weight: 700; }
.public .pub-script .c { color: #7f7aa3; }
.public .pub-script .s { color: #9be7c4; }

@media (min-width: 900px) {
    .public .pub-hl { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
    .public .pub-ed { grid-template-columns: minmax(0, 1fr); }
    .public .pub-ed-bin { display: none; }
}

/* ---------- Flat brand pass: violet + coral, no gradients ---------- */
.public .pub-hero { border-bottom: 3px solid var(--pub-coral, #f45d48); }
.public .pub-hero h1 em, .public .pub-hero h1 .accent { font-style: normal; color: #ff8a75; }
.public .pub-hl-card::after { display: none; }
.public .pub-ed-clip.n { background: #f45d48; }
.public .pub-ed-clip.v { background: repeating-linear-gradient(90deg, #6c52f0 0 14px, #5b44dc 14px 15px); }
.public .pub-ed-bin i:first-child { background: var(--accent-soft); }
.public .pub-step::before { background: var(--pub-coral, #f45d48); }
.public .pub-step-num, .public .pub-doc h2 .num, .public .pub-hl-num svg { background: var(--accent); }
.public .pub-hl-card ul li::before { background: var(--pub-coral, #f45d48); }
.public .pub-cta .pub-cta-box { border-bottom: 3px solid var(--pub-coral, #f45d48); }

/* ---------- Guide v2: hero with quick start, sticky contents, section cards ---------- */
.guide-v2 { margin: -24px -24px 0; }
@media (max-width: 720px) { .guide-v2 { margin: -16px -16px 0; } }
.guide-v2 .gd-hero { background: var(--ink, #14112b); color: #fff; padding: 40px 32px 28px; border-bottom: 3px solid var(--pub-coral, #f45d48); position: relative; overflow: hidden; }
.guide-v2 .gd-hero::after { content: ""; position: absolute; right: -60px; top: -30px; width: 340px; height: 340px; opacity: .06; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg fill='%23ff7a63'%3E%3Crect x='1.2' y='12.5' width='3' height='7' rx='1.5'/%3E%3Crect x='5.7' y='9' width='3' height='14' rx='1.5'/%3E%3Crect x='10.2' y='5.5' width='3' height='21' rx='1.5'/%3E%3C/g%3E%3Cpath fill='%23a594ff' d='M17.6 6.2 29.4 14.4a2 2 0 0 1 0 3.2L17.6 25.8a1.6 1.6 0 0 1-2.5-1.3V7.5a1.6 1.6 0 0 1 2.5-1.3Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.guide-v2 .gd-hero-inner { max-width: 760px; position: relative; z-index: 1; }
.guide-v2 .gd-kicker { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #ff8a75; margin-bottom: 8px; }
.guide-v2 .gd-hero h1 { color: #fff; font-size: clamp(1.6rem, 3.2vw, 2.3rem); letter-spacing: -.02em; margin: 0 0 8px; }
.guide-v2 .gd-hero p { color: rgba(255, 255, 255, .78); font-size: 1.02rem; margin: 0 0 18px; max-width: 62ch; }
.guide-v2 .gd-search { display: flex; align-items: center; gap: 10px; max-width: 560px; padding: 0 14px; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .7); }
.guide-v2 .gd-search:focus-within { border-color: #a594ff; background: rgba(255, 255, 255, .12); }
.guide-v2 .gd-search input { flex: 1; height: 44px; border: 0; background: transparent; color: #fff; font: 15px Inter, system-ui, sans-serif; outline: none; }
.guide-v2 .gd-search input::placeholder { color: rgba(255, 255, 255, .5); }
.guide-v2 .gd-quick { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; position: relative; z-index: 1; }
.guide-v2 .gd-quick a { position: relative; display: grid; gap: 4px; height: 100%; padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); color: #fff; text-decoration: none; transition: background .15s, border-color .15s, transform .15s; }
.guide-v2 .gd-quick a:hover { background: rgba(255, 255, 255, .1); border-color: #a594ff; transform: translateY(-2px); }
.guide-v2 .gd-q-num { position: absolute; right: 14px; top: 12px; font: 700 12px Inter, sans-serif; color: rgba(255, 255, 255, .35); }
.guide-v2 .gd-q-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(139, 116, 255, .25); color: #c4b8ff; margin-bottom: 6px; }
.guide-v2 .gd-quick li:nth-child(even) .gd-q-icon { background: rgba(255, 122, 99, .2); color: #ffb3a5; }
.guide-v2 .gd-quick strong { font-size: .98rem; }
.guide-v2 .gd-quick span:last-child { font-size: .84rem; color: rgba(255, 255, 255, .66); line-height: 1.4; }
@media (max-width: 980px) { .guide-v2 .gd-quick { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .guide-v2 .gd-quick { grid-template-columns: 1fr; } .guide-v2 .gd-hero { padding: 28px 16px 20px; } }

.guide-v2 .pub-guide { padding: 28px 24px 72px; max-width: 1180px; }
@media (min-width: 980px) { .guide-v2 .pub-guide { grid-template-columns: 250px minmax(0, 1fr); } }
.guide-v2 .pub-toc { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.guide-v2 .pub-toc a { display: flex; align-items: center; gap: 9px; position: relative; }
.guide-v2 .gd-toc-icon { display: inline-grid; color: var(--text-3); }
.guide-v2 .pub-toc a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.guide-v2 .pub-toc a.active .gd-toc-icon { color: var(--accent); }
.guide-v2 .pub-toc .sub a { padding-left: 35px; }
.guide-v2 .pub-toc .sub a.active { background: transparent; box-shadow: inset 2px 0 0 var(--accent); border-radius: 0; }
.guide-v2 .gd-toc-help { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--text-3); }

.guide-v2 .pub-doc { max-width: 820px; }
.guide-v2 .pub-doc > section.gd-sec { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px 28px 18px; margin-bottom: 18px; box-shadow: var(--shadow-xs); scroll-margin-top: 80px; }
.guide-v2 .pub-doc > section.gd-sec:last-of-type { border-bottom: 1px solid var(--border); }
.guide-v2 .gd-sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.guide-v2 .gd-sec-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.guide-v2 .gd-sec:nth-of-type(even) .gd-sec-icon { background: var(--vivid-soft); color: var(--vivid); }
.guide-v2 .gd-sec-step { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.guide-v2 .gd-sec-head h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.01em; }
.guide-v2 .pub-doc h3 { font-size: 1.05rem; margin: 22px 0 8px; padding-left: 10px; border-left: 3px solid var(--vivid); }
.guide-v2 .pub-doc p.intro { font-size: 1.04rem; color: var(--text); }
.guide-v2 .pub-doc p, .guide-v2 .pub-doc li { line-height: 1.65; }
.guide-v2 .pub-doc ul { list-style: none; padding-left: 0; }
.guide-v2 .pub-doc ul > li { position: relative; padding-left: 20px; }
.guide-v2 .pub-doc ul > li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--vivid); }
.guide-v2 .pub-num > li::before { background: var(--accent-soft); color: var(--accent); }
.guide-v2 .pub-note { border-radius: 12px; }
.guide-v2 .pub-table, .guide-v2 .pub-doc table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-size: .92rem; margin: 8px 0 14px; }
.guide-v2 .pub-doc table th { background: var(--surface-2); text-align: left; font-weight: 600; color: var(--text); }
.guide-v2 .pub-doc table th, .guide-v2 .pub-doc table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.guide-v2 .pub-doc table tr:last-child td { border-bottom: 0; }
.guide-v2 .pub-doc table tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.guide-v2 .pub-doc code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: .88em; color: var(--accent); }
.guide-v2 .pub-script { border-radius: 12px; }
.guide-v2 .pub-script code { background: none; border: 0; padding: 0; color: inherit; }
.guide-v2 mark.gd-hit { background: color-mix(in srgb, var(--vivid) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.guide-v2 .gd-noresults { padding: 28px; text-align: center; color: var(--text-3); border: 1px dashed var(--border-strong); border-radius: 14px; }
/* Bleed the guide hero to the edges of the app's main column, whatever its padding. */
.guide-v2 { margin: -24px calc(-1 * var(--gutter)) 0; }
@media (min-width: 900px) { .guide-v2 { margin: -32px -32px 0; } }
