/* ============================================================
   Logger — UI design system
   Single stylesheet for every surface: public site, docs,
   auth and the log workspace. Modern dev-tool SaaS language.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
    color-scheme: light;

    --bg: #ffffff;
    --bg-soft: #f7f8fa;
    --bg-sunken: #f1f2f5;
    --surface: #ffffff;
    --surface-hover: #fafbfc;
    --border: #e5e7eb;
    --border-strong: #d3d6dc;

    --text: #111318;
    --text-secondary: #565b66;
    --text-muted: #8b909b;

    --accent: #5b5bd6;
    --accent-hover: #4b4bc4;
    --accent-soft: #eeeefe;
    --accent-ring: rgba(91, 91, 214, .22);
    --on-accent: #ffffff;

    --green: #16a34a;
    --green-soft: #e8f7ee;
    --red: #dc2626;
    --red-soft: #fdecec;
    --amber: #d97706;
    --amber-soft: #fdf3e4;

    --code-bg: #0e1014;
    --code-surface: #16181e;
    --code-border: #262a33;
    --code-text: #e6e8ee;
    --code-muted: #7d8494;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    --shadow-xs: 0 1px 2px rgba(17, 19, 24, .05);
    --shadow-sm: 0 1px 3px rgba(17, 19, 24, .07), 0 1px 2px rgba(17, 19, 24, .04);
    --shadow-md: 0 8px 24px -8px rgba(17, 19, 24, .16), 0 2px 6px rgba(17, 19, 24, .05);
    --shadow-lg: 0 24px 60px -20px rgba(17, 19, 24, .28), 0 6px 18px rgba(17, 19, 24, .08);

    --container: 1160px;
    --nav-h: 64px;
    --ease: cubic-bezier(.4, 0, .2, 1);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: 'Fira Code', 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
}

html[data-theme='dark'] {
    color-scheme: dark;

    --bg: #0a0b0d;
    --bg-soft: #101114;
    --bg-sunken: #08090b;
    --surface: #131417;
    --surface-hover: #191b1f;
    --border: #23252b;
    --border-strong: #33363e;

    --text: #f3f4f6;
    --text-secondary: #b6bac2;
    --text-muted: #7f848e;

    --accent: #a5a5ff;
    --accent-hover: #b8b8ff;
    --accent-soft: #1a1b2b;
    --accent-ring: rgba(165, 165, 255, .25);
    --on-accent: #0b0b12;

    --green: #4ade80;
    --green-soft: #10231a;
    --red: #f87171;
    --red-soft: #2a1416;
    --amber: #fbbf24;
    --amber-soft: #2a2110;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
    --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .75);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; color: var(--text); }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
code, kbd, pre { font-family: var(--mono); }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }

::selection { background: var(--accent-ring); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 200;
    padding: 10px 16px; background: var(--accent); color: var(--on-accent);
    border-radius: var(--radius); font-size: 14px; font-weight: 600;
    transition: top .18s var(--ease);
}
.skip-link:focus { top: 16px; color: var(--on-accent); }

/* ---------- Navigation ---------- */
.nav-wrapper {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; gap: 24px;
    height: var(--nav-h);
    padding: 0 max(24px, calc((100vw - var(--container)) / 2));
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    display: inline-flex; align-items: center; gap: 2px;
    font-family: var(--mono); font-size: 17px; font-weight: 600;
    color: var(--text); letter-spacing: -.02em; white-space: nowrap;
}
.brand-logo:hover { color: var(--accent); }
.brand-brace { color: var(--accent); }

.nav-links {
    display: flex; align-items: center; gap: 4px;
    margin-left: auto; list-style: none;
}
.nav-links li { display: flex; align-items: center; }
.nav-links a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; color: var(--text-secondary);
    transition: color .16s var(--ease), background-color .16s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--bg-soft); }
.nav-links a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.nav-links .nav-access {
    margin-left: 8px; padding: 8px 14px;
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    color: var(--text); font-weight: 600;
}
.nav-links .nav-access:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.nav-links .nav-access.active { border-color: var(--accent); color: var(--accent); }

.nav-links .user-info {
    display: inline-flex; align-items: center; gap: 8px;
    margin-left: 8px; padding: 7px 14px;
    background: var(--accent-soft); color: var(--accent);
    border-radius: var(--radius-pill); font-size: 14px; font-weight: 600;
}
.nav-links .user-info:hover { background: var(--accent); color: var(--on-accent); }
.consumer-key-hint { display: inline-flex; opacity: .7; }

.theme-switch { margin-left: 4px; }
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: 1px solid transparent; border-radius: var(--radius);
    background: transparent; color: var(--text-secondary);
    transition: color .16s var(--ease), background-color .16s var(--ease), border-color .16s var(--ease);
}
.theme-toggle:hover { color: var(--text); background: var(--bg-soft); border-color: var(--border); }
.theme-toggle .light-icon { display: none; }
.theme-toggle .dark-icon { display: inline; }
html[data-theme='dark'] .theme-toggle .light-icon { display: inline; }
html[data-theme='dark'] .theme-toggle .dark-icon { display: none; }

.mobile-menu-toggle {
    display: none; margin-left: auto;
    width: 40px; height: 40px; padding: 9px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); flex-direction: column; justify-content: space-between;
}
.mobile-menu-toggle span { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px; transition: transform .2s var(--ease), opacity .2s var(--ease); }
.mobile-menu-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.action {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 18px; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; line-height: 1.2;
    border: 1px solid transparent; text-decoration: none;
    transition: transform .16s var(--ease), background-color .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.action small { display: block; font-size: 11px; font-weight: 500; opacity: .75; margin-top: 2px; }
.action.primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-sm); }
.action.primary:hover { background: var(--accent-hover); color: var(--on-accent); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.action.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.action.secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.action svg { width: 20px; height: 20px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 20px; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
    transition: background-color .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-hover); }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.btn-danger:hover { color: var(--on-accent); background: var(--red); border-color: var(--red); }

.text-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }

/* ---------- Shared bits ---------- */
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 12px; font-weight: 500;
    letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.lead { font-size: 18px; line-height: 1.7; color: var(--text-secondary); max-width: 640px; }
.terminal-cursor { color: var(--accent); animation: cursor-blink 1.3s ease-in-out infinite; }
@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .15; }
}

/* ---------- Landing ---------- */
.public-page main { display: block; }
.landing { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

.hero {
    display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
    padding: 88px 0 80px;
}
.hero-copy { min-width: 0; }
.hero h1 {
    font-size: clamp(38px, 4.6vw, 60px); font-weight: 700; line-height: 1.06;
    letter-spacing: -.035em; margin: 22px 0 22px;
}
.hero h1 span { color: var(--accent); }
.hero .lead { font-size: 18px; }
.hero-notes { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.hero-notes span { display: inline-flex; align-items: center; gap: 7px; }
.hero-notes span::before { content: '✓'; color: var(--green); font-weight: 700; }

.signal-preview {
    margin: 0; background: var(--code-bg); color: var(--code-text);
    border: 1px solid var(--code-border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); font-family: var(--mono); font-size: 13px; overflow: hidden;
}
.signal-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--code-border); color: var(--code-muted); font-size: 12px; }
.sample-label { padding: 2px 8px; border: 1px solid var(--code-border); border-radius: var(--radius-pill); letter-spacing: .06em; }
.signal-request { padding: 14px 16px 0; color: var(--code-muted); }
.signal-request .signal-prompt { color: var(--green); margin-right: 6px; }
.signal-request span:not(.signal-prompt) { color: var(--code-text); }
.signal-code { margin: 0; padding: 12px 16px; white-space: pre; overflow-x: auto; line-height: 1.6; font-size: 12.5px; }
.signal-route { display: flex; align-items: center; gap: 12px; padding: 0 16px 12px; color: var(--code-muted); font-size: 11px; }
.signal-preview figcaption { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--code-border); background: var(--code-surface); }
.signal-preview figcaption strong { display: block; font-size: 13px; font-weight: 600; }
.signal-preview figcaption span { display: block; font-size: 11px; color: var(--code-muted); }
.signal-check { color: var(--green); font-weight: 700; }
.signal-caret { margin-left: auto; color: var(--code-muted); }

.syntax-dim { color: var(--code-muted); }
.syntax-key { color: #8fb3ff; }
.syntax-value { color: #9ae6b4; }
.syntax-number { color: #f0b37e; }

.section { padding: 72px 0; border-top: 1px solid var(--border); }
.section-heading { max-width: 720px; margin-bottom: 36px; }
.section h2, .closing h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 700; letter-spacing: -.03em; margin-top: 14px; }
.section-heading p { margin-top: 14px; font-size: 16px; line-height: 1.75; color: var(--text-secondary); }

.flow {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
    border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
    background: var(--surface);
}
.flow li { padding: 30px 28px; border-left: 1px solid var(--border); }
.flow li:first-child { border-left: 0; }
.flow .step { display: inline-block; font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 14px; }
.flow h3 { font-size: 16px; margin-bottom: 8px; overflow-wrap: break-word; }
.flow p { font-size: 14px; line-height: 1.7; color: var(--text-secondary); overflow-wrap: break-word; }
.flow code, .privacy code { font-size: .88em; background: var(--bg-sunken); border: 1px solid var(--border); padding: 1px 6px; border-radius: var(--radius-sm); color: var(--text); }

.privacy {
    display: flex; gap: 16px; align-items: flex-start;
    margin-top: 24px; padding: 22px 24px;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.privacy-icon { color: var(--accent); font-size: 20px; line-height: 1; }
.privacy h3 { font-size: 15px; margin-bottom: 6px; }
.privacy p { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }

.screenshot { margin: 0; }
.screenshot > a { display: block; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-soft); box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease); }
.screenshot > a:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.screenshot img { width: 100%; }
.screenshot figcaption { margin-top: 14px; font-size: 13px; color: var(--text-muted); display: flex; gap: 8px; align-items: baseline; }
.screenshot figcaption h3 { font-size: 15px; }
.screenshot figcaption p { margin-top: 4px; color: var(--text-secondary); }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }
.gallery-link-card {
    display: flex; flex-direction: column; gap: 12px;
    padding: 30px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    text-decoration: none; color: var(--text);
    transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.gallery-link-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-md); color: var(--text); }
.gallery-link-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); font-size: 18px;
}
.gallery-link-card h3 { font-size: 18px; letter-spacing: -.3px; }
.gallery-link-card p { font-size: 14px; line-height: 1.65; color: var(--text-secondary); }
.gallery-link-more {
    margin-top: auto; display: inline-flex; align-items: center; gap: 8px;
    color: var(--accent); font-weight: 600; font-size: 14px;
}

.gallery .screenshot figcaption { display: block; }
.gallery .screenshot figcaption span { color: var(--accent); font-size: 13px; }

.export-info { margin-top: 56px; }
.export-info .flow { grid-template-columns: repeat(3, 1fr); }

.closing {
    display: flex; align-items: center; justify-content: space-between; gap: 32px;
    margin: 24px 0 72px; padding: 44px 40px;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-xl);
}
.closing h2 { margin: 12px 0 8px; }
.closing p { color: var(--text-secondary); }

.public-footer {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 40px 72px;
    max-width: var(--container);
    margin: 0 auto;
    padding: 48px 24px 28px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}
.footer-brand { display: grid; align-content: start; gap: 10px; }
.public-footer .brand-logo { font-size: 15px; }
.public-footer p { max-width: 260px; color: var(--text-muted); line-height: 1.65; }
.footer-links { display: flex; flex-wrap: wrap; gap: 32px 56px; }
.footer-group { display: grid; align-content: start; gap: 8px; min-width: 120px; }
.footer-title {
    margin-bottom: 4px;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.footer-links a { color: var(--text-secondary); font-size: 13.5px; line-height: 1.4; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .02em;
    color: var(--text-muted);
}

/* Screenshot lightbox */
.photo-viewer {
    border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
    color: var(--text);
}
.photo-viewer::backdrop { background: rgba(8, 9, 12, .82); backdrop-filter: blur(4px); }
.photo-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 8px; color: #fff; font-size: 13px; }
.photo-stage { position: relative; display: flex; align-items: center; justify-content: center; }
.photo-full { max-width: min(92vw, 1600px); max-height: 78vh; border-radius: var(--radius); }
.photo-control {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius);
    background: rgba(255,255,255,.08); color: #fff; font-size: 20px; line-height: 1;
}
.photo-control:hover { background: rgba(255,255,255,.18); }
.photo-prev, .photo-next { position: absolute; top: 50%; transform: translateY(-50%); }
.photo-prev { left: -56px; }
.photo-next { right: -56px; }
#photo-caption { padding: 12px 8px; color: #fff; font-size: 13px; text-align: center; }

/* ---------- Docs ---------- */
.docs-layout {
    display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px;
    max-width: var(--container); margin: 0 auto; padding: 48px 24px 80px;
}
.docs-sidebar { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; }
.docs-back { display: inline-flex; gap: 6px; font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.docs-back:hover { color: var(--accent); }
.docs-sidebar nav { display: grid; gap: 2px; margin-top: 16px; border-left: 1px solid var(--border); }
.docs-sidebar nav a { display: flex; gap: 10px; padding: 8px 0 8px 16px; margin-left: -1px; border-left: 2px solid transparent; font-size: 14px; color: var(--text-secondary); }
.docs-sidebar nav a:hover { color: var(--text); border-left-color: var(--border-strong); }
.docs-sidebar nav a span { color: var(--text); }
.docs-aside-note { margin-top: 28px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); font-family: var(--mono); font-size: 12px; color: var(--text-secondary); }
.docs-aside-note p { margin-top: 6px; color: var(--text); }

.docs-container { min-width: 0; }
.docs-header { padding-bottom: 32px; margin-bottom: 40px; border-bottom: 1px solid var(--border); }
.docs-header h1 { font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -.035em; margin: 16px 0 18px; }
.docs-header p { font-size: 17px; line-height: 1.75; color: var(--text-secondary); max-width: 720px; }

.docs-section { padding: 40px 0; border-top: 1px solid var(--border); }
.docs-section:first-of-type { border-top: 0; }
.docs-section h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(21px, 2.4vw, 28px); margin-bottom: 18px; }
.docs-section h2 i { color: var(--accent); font-size: .85em; }
.docs-section h3 { font-size: 16px; margin: 28px 0 12px; }
.docs-section > p { font-size: 15px; line-height: 1.8; color: var(--text-secondary); max-width: 760px; }

.note {
    display: flex; gap: 12px; align-items: flex-start;
    margin: 20px 0; padding: 16px 18px;
    background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
    border-radius: var(--radius); font-size: 14px; line-height: 1.7;
}
.note i { color: var(--accent); margin-top: 3px; }

.endpoint {
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
    padding: 14px 16px; margin: 8px 0 8px;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
    font-family: var(--mono); font-size: 14px;
}
.endpoint .method { padding: 3px 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.endpoint .method.post { background: var(--green-soft); color: var(--green); }
.endpoint .path { font-weight: 600; color: var(--text); }
.endpoint .description { color: var(--text-muted); font-family: var(--font); font-size: 13px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.param-table { width: 100%; min-width: 520px; border-collapse: collapse; margin: 16px 0; font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.param-table th { text-align: left; padding: 12px 16px; background: var(--bg-soft); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.param-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: top; }
.param-table tr:last-child td { border-bottom: 0; }
.param-table code { font-size: .88em; background: var(--bg-sunken); border: 1px solid var(--border); padding: 1px 6px; border-radius: var(--radius-sm); color: var(--text); }

.lang-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 16px 0 0; padding: 4px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); width: fit-content; max-width: 100%; }
.lang-tab { padding: 7px 14px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.lang-tab:hover { color: var(--text); }
.lang-tab.active { background: var(--surface); color: var(--accent); font-weight: 600; box-shadow: var(--shadow-xs); }

.code-block { position: relative; margin: 16px 0; background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--radius); overflow: hidden; }
.code-block pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-size: 13px; line-height: 1.65; color: var(--code-text); }
.copy-btn {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: 1px solid var(--code-border); border-radius: var(--radius-sm);
    background: var(--code-surface); color: var(--code-muted); font-size: 13px;
}
.copy-btn:hover { color: var(--code-text); border-color: var(--code-muted); }
.copy-btn.copy-success { color: var(--green); border-color: var(--green); }
.copy-btn.copy-error { color: var(--red); border-color: var(--red); }
.copy-btn.right-pos { right: 10px; }

.response-example pre { margin: 0; padding: 18px 20px; background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--radius); overflow-x: auto; font-size: 13px; line-height: 1.65; color: var(--code-text); }
.json-key { color: #8fb3ff; }
.json-string { color: #9ae6b4; }
.json-number { color: #f0b37e; }
.json-boolean { color: #d8b4fe; }
.json-null { color: var(--code-muted); }

/* Code modal (fullscreen viewer built by app.js) */
.fullscreen-modal-overlay { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 32px; background: rgba(8,9,12,.7); backdrop-filter: blur(4px); }
.fullscreen-modal-content { width: min(1000px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.fullscreen-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.fullscreen-modal-title { font-size: 14px; font-weight: 600; }
.fullscreen-modal-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-secondary); }
.fullscreen-modal-close:hover { color: var(--text); border-color: var(--border-strong); }
.fullscreen-modal-body { padding: 0; overflow: auto; background: var(--code-bg); }
.fullscreen-pre { margin: 0; padding: 20px; font-size: 13px; line-height: 1.65; color: var(--code-text); overflow-x: auto; }
.fullscreen-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }
.fullscreen-modal-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-size: 14px; font-weight: 500; }
.fullscreen-modal-btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.fullscreen-code-block { padding: 0; }

/* ---------- SEO pages (integrations / alternatives) ---------- */
.seo-page .landing { padding-bottom: 24px; }
.seo-hero { grid-template-columns: 1fr; max-width: 900px; padding: 52px 0 40px; }
.seo-hero .lead { max-width: 760px; }
.seo-breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; font-size: 13px; color: var(--text-muted); }
.seo-breadcrumbs a { color: var(--text-muted); }
.seo-breadcrumbs a:hover { color: var(--accent); }
.seo-breadcrumbs span[aria-current] { color: var(--text); font-weight: 600; }

.seo-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.seo-card {
    display: flex; flex-direction: column; gap: 10px;
    padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--surface); color: var(--text);
    transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.seo-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-md); color: var(--text); }
.seo-card i { font-size: 20px; color: var(--accent); }
.seo-card h3 { font-size: 16px; }
.seo-card p { font-size: 14px; line-height: 1.65; color: var(--text-secondary); }
.seo-card span[aria-hidden] { margin-top: auto; color: var(--accent); font-weight: 600; }

.faq-list { display: grid; gap: 10px; max-width: 820px; }
.faq-item { padding: 18px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.faq-item summary { position: relative; padding-right: 30px; font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: 0; top: -2px; font-size: 20px; font-weight: 400; color: var(--accent); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin-top: 12px; font-size: 14px; line-height: 1.75; color: var(--text-secondary); }

.seo-table-wrap { overflow-x: auto; }
.seo-table td { font-size: 14px; }
.seo-table td strong { color: var(--accent); font-weight: 600; }
.seo-disclaimer { margin-top: 14px; font-size: 12px; color: var(--text-muted); max-width: 760px; }
.seo-two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.seo-column { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.seo-column h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; margin-bottom: 14px; }
.seo-column h3 i { color: var(--green); }
.seo-list { display: grid; gap: 10px; padding-left: 18px; list-style: disc; }
.seo-list li { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }

/* ---------- Auth ---------- */
.auth-wrapper {
    display: grid; grid-template-columns: 1.1fr .9fr; gap: 64px; align-items: center;
    max-width: var(--container); margin: 0 auto; padding: 72px 24px 96px;
}
.auth-intro h1 { font-size: clamp(34px, 4vw, 52px); letter-spacing: -.035em; margin: 18px 0 22px; }
.auth-intro h1 em { color: var(--accent); font-style: normal; }
.auth-intro p { font-size: 16px; line-height: 1.75; color: var(--text-secondary); max-width: 460px; }
.auth-command { display: inline-flex; align-items: center; gap: 8px; margin: 22px 0 18px; padding: 10px 16px; font-family: var(--mono); font-size: 13px; color: var(--code-text); background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--radius); }
.auth-intro > a { font-size: 14px; font-weight: 600; }

.auth-card { padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-md); }
.auth-title { font-size: 22px; margin-bottom: 6px; }
.auth-description { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.input-field { width: 100%; padding: 12px 14px; font-size: 15px; color: var(--text); background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius); transition: border-color .16s var(--ease), box-shadow .16s var(--ease); }
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 8px; }
.auth-toggle { margin-top: 20px; font-size: 14px; color: var(--text-secondary); text-align: center; }
.toggle-link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; }
.toggle-text { display: block; }

/* ---------- Error page ---------- */
.error-page { max-width: 720px; margin: 0 auto; padding: 96px 24px; text-align: center; }
.error-code { font-family: var(--mono); font-size: clamp(72px, 14vw, 140px); font-weight: 700; line-height: 1; color: var(--accent); letter-spacing: -.04em; }
.error-page h1 { font-size: clamp(24px, 3vw, 34px); margin: 20px 0 14px; }
.error-page p { color: var(--text-secondary); }
.error-terminal { display: inline-flex; gap: 10px; margin: 24px 0 28px; padding: 10px 16px; font-family: var(--mono); font-size: 13px; color: var(--code-text); background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--radius); }
.error-terminal span { color: var(--green); }
.error-page .actions { justify-content: center; }

/* ---------- Workspace (app) ---------- */
.index-page { background: var(--bg-soft); }
.index-page .workspace-heading,
.index-page .row,
.index-page .container { max-width: 1440px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.index-page .workspace-heading { padding-top: 40px; padding-bottom: 8px; }
.index-page .row { padding-top: 24px; padding-bottom: 20px; }
.index-page .container { padding-bottom: 64px; }

.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 40px 0 8px; }
.workspace-heading h1 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -.03em; margin: 12px 0 8px; }
.workspace-heading p { color: var(--text-secondary); font-size: 15px; }
.workspace-help { font-size: 14px; font-weight: 600; white-space: nowrap; }

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 24px; padding-bottom: 20px; }
.search-container { position: relative; flex: 1 1 260px; max-width: 420px; }
.search-input { width: 100%; padding: 11px 40px 11px 14px; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); }
.search-clear:hover { color: var(--text); background: var(--bg-soft); }

.container { display: flex; flex-direction: column; gap: 14px; padding-bottom: 64px; }
.row .btn:last-child { margin-left: auto; }

.msg { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.msg:hover { border-color: var(--border-strong); }
.msg-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.msg-module { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: var(--radius-pill); }
.msg-time { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.msg-controls { display: flex; align-items: center; gap: 6px; margin-left: auto; opacity: 0; transition: opacity .16s var(--ease); }
.msg:hover .msg-controls, .msg:focus-within .msg-controls { opacity: 1; }
.pin-btn, .copy-btn.msg-copy, .expand-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-muted); }
.pin-btn:hover, .expand-btn:hover { color: var(--accent); border-color: var(--accent); }
.pin-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.code-container { position: relative; }
.code { margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: 13px; line-height: 1.65; color: var(--code-text); background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--radius); overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.pre-code { margin: 0; }
.json-container { display: block; }
.language-json { color: var(--code-text); }

.pinned-count { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--accent); color: var(--on-accent); border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-md); }
.pinned-divider { display: flex; align-items: center; gap: 12px; margin: 8px 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.pinned-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.pinned-message { border-color: color-mix(in srgb, var(--amber) 40%, var(--border)); }
.pin-indicator { color: var(--amber); }

.msg-appear { animation: msgIn .28s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.empty-search, .empty-prompt, .empty-docs { padding: 48px 24px; text-align: center; color: var(--text-muted); font-size: 15px; }
.empty-docs { display: inline-flex; gap: 8px; color: var(--accent); font-weight: 600; }
.current-badge { padding: 2px 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--green); background: var(--green-soft); border-radius: var(--radius-pill); }

.top-btn { position: fixed; right: 24px; bottom: 76px; z-index: 60; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.top-btn:hover { color: var(--accent); border-color: var(--accent); }

.loading-indicator { position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(3px); color: var(--text-secondary); font-size: 14px; }
.spinner { width: 26px; height: 26px; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fa-spin { animation: spin 1.4s linear infinite; }

.socketio-error { margin: 16px 0; padding: 16px 18px; background: var(--red-soft); border: 1px solid color-mix(in srgb, var(--red) 35%, var(--border)); border-radius: var(--radius); color: var(--red); font-size: 14px; }

/* ---------- Modals (profile & sessions) ---------- */
.modal-overlay, .sessions-modal-overlay, .confirm-dialog-overlay { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(8,9,12,.55); backdrop-filter: blur(3px); }
.modal-overlay.show, .sessions-modal-overlay.show { display: flex; }
.confirm-dialog-overlay.show { display: flex; }

.modal { width: min(440px, 100%); max-height: 90vh; overflow-y: auto; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.key-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 16px; font-size: 18px; color: var(--accent); background: var(--accent-soft); border-radius: var(--radius); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.modal-title { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.modal-close { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-secondary); }
.modal-close:hover { color: var(--text); border-color: var(--border-strong); }
.modal-info { display: flex; gap: 10px; align-items: center; margin: 16px 0; padding: 12px 14px; font-size: 13px; color: var(--text-secondary); background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); }
.modal-info i { color: var(--accent); }
.modal-content { position: relative; padding: 16px; font-family: var(--mono); font-size: 13px; word-break: break-all; color: var(--code-text); background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--radius); cursor: pointer; }
.copy-hint { display: block; margin-bottom: 8px; font-size: 11px; color: var(--code-muted); }
.modal-session-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 0; }
.modal-footer { display: flex; gap: 10px; margin-top: 16px; }
.modal-footer .modal-btn { flex: 1; justify-content: center; }
.modal-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; transition: background-color .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease); }
.modal-btn:hover { border-color: var(--accent); color: var(--accent); }
.modal-btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.modal-btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.modal-btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--border)); }
.modal-btn-danger:hover { background: var(--red); color: var(--on-accent); border-color: var(--red); }
.modal-btn-fullwidth { width: 100%; margin-top: 12px; justify-content: center; }

.sessions-modal-content { width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.sessions-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.sessions-modal-close { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-secondary); }
.sessions-list { display: grid; gap: 12px; padding: 18px 22px; overflow-y: auto; }
.session-info { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.session-device, .session-ip, .session-time { font-size: 13px; color: var(--text-secondary); display: flex; gap: 8px; align-items: center; }
.session-device { color: var(--text); font-weight: 600; margin-bottom: 6px; }
.session-ip i, .session-time i { color: var(--text-muted); }
.session-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; }
.session-terminate-btn { margin-top: 12px; padding: 7px 12px; font-size: 13px; color: var(--red); background: transparent; border: 1px solid color-mix(in srgb, var(--red) 35%, var(--border)); border-radius: var(--radius-sm); }
.session-terminate-btn:hover { background: var(--red); color: var(--on-accent); }
.no-sessions { padding: 40px 22px; text-align: center; color: var(--text-muted); }

.confirm-dialog { width: min(380px, 100%); padding: 28px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.confirm-dialog > i { font-size: 22px; color: var(--amber); }
.confirm-dialog h3 { font-size: 18px; margin: 14px 0 8px; }
.confirm-dialog p { font-size: 14px; color: var(--text-secondary); }
.confirm-dialog-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.confirm-dialog-btn { padding: 10px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-size: 14px; font-weight: 500; }
.confirm-dialog-btn-no:hover { border-color: var(--text-muted); }
.confirm-dialog-btn-yes { background: var(--red); color: var(--on-accent); border-color: var(--red); }
.confirm-dialog-btn-yes:hover { background: color-mix(in srgb, var(--red) 85%, #000); }

/* ---------- Toasts ---------- */
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 600; max-width: 360px; padding: 13px 18px; font-size: 14px; background: var(--text); color: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: opacity .22s var(--ease), transform .22s var(--ease); }
.toast.show { opacity: 1; transform: none; }
.toast.success { background: var(--green); color: #fff; }
.toast.error { background: var(--red); color: #fff; }

/* ---------- Page modifiers & message meta ---------- */
.home-page, .documentation-page, .login-page { background: var(--bg); }
.index-page .nav-wrapper { background: color-mix(in srgb, var(--bg-soft) 85%, transparent); }

.modal-module { display: inline-flex; align-items: center; padding: 2px 9px; margin-right: 8px; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: var(--radius-pill); }
.modal-time { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.fullscreen-modal-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }

.modal-btn-secondary { background: var(--surface); color: var(--text-secondary); }
.modal-btn-secondary:hover { color: var(--accent); border-color: var(--accent); background: var(--surface); }

.pin-btn.pinned, .pin-btn.active { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); background: var(--amber-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hero { grid-template-columns: 1fr; gap: 40px; padding: 64px 0 56px; }
    .gallery { grid-template-columns: 1fr; }
    .auth-wrapper { grid-template-columns: 1fr; gap: 40px; padding: 48px 24px 64px; }
    .docs-layout { grid-template-columns: 1fr; gap: 32px; }
    .docs-sidebar { position: static; }
    .docs-sidebar nav { display: flex; flex-wrap: wrap; gap: 6px; border-left: 0; }
    .docs-sidebar nav a { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); margin-left: 0; }
    .docs-aside-note { display: none; }
    .flow { grid-template-columns: 1fr; }
    /* .export-info .flow задаёт 3 колонки с большей специфичностью — на мобильных
       возвращаем одну колонку, иначе «OpenAPI (Swagger)» обрезается. */
    .export-info .flow { grid-template-columns: 1fr; }
    .flow li { border-left: 0; border-top: 1px solid var(--border); }
    .flow li:first-child { border-top: 0; }
}

@media (max-width: 768px) {
    .nav-wrapper { gap: 12px; padding: 0 16px; }
    .mobile-menu-toggle { display: flex; }
    .nav-links {
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 2px;
        margin: 0; padding: 12px 16px 16px;
        background: var(--bg); border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        display: none;
    }
    .nav-links.active { display: flex; }
    .nav-links a { padding: 12px 12px; font-size: 15px; }
    .nav-links .nav-access, .nav-links .user-info { margin-left: 0; justify-content: center; }
    .theme-switch { justify-content: flex-start; padding-top: 6px; }
    .landing { padding: 0 18px; }
    .section { padding: 48px 0; }
    .closing { flex-direction: column; align-items: flex-start; padding: 28px 22px; margin-bottom: 48px; }
    .workspace-heading { flex-direction: column; align-items: flex-start; gap: 12px; }
    .row .btn:last-child { margin-left: 0; }
    .photo-prev { left: 8px; }
    .photo-next { right: 8px; }
    .modal, .sessions-modal-content, .confirm-dialog { padding: 22px; }
    .public-footer { grid-template-columns: 1fr; gap: 28px; padding: 36px 18px 24px; }
    .footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 6px; padding-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Коллаборации: выбор источника логов, модалка управления,
   страница-приглашение.
   ============================================================ */

.log-source {
    display: flex;
    align-items: stretch;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 24px 0;
}

.log-source .btn {
    align-self: stretch;
}

.source-picker {
    position: relative;
}

.source-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    transition: border-color .15s var(--ease), background .15s var(--ease);
}

.source-toggle:hover {
    border-color: var(--border-strong);
    background: var(--surface-hover);
}

.source-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}

.source-dot.is-collab {
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.source-caption {
    display: block;
    font-size: 10.5px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.source-name {
    display: block;
    margin-top: 1px;
    font-size: 14px;
    font-weight: 600;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 240;
    min-width: 320px;
    max-width: min(420px, 88vw);
    max-height: 60vh;
    overflow-y: auto;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.source-menu[hidden] {
    display: none;
}

.source-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    text-align: left;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.source-item:hover {
    background: var(--surface-hover);
}

.source-item.is-active {
    background: var(--accent-soft);
}

.source-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.source-item-title i {
    color: var(--accent);
}

.source-item-meta {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-muted);
}

.source-badge {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: var(--radius-pill);
}

.source-sep {
    height: 1px;
    margin: 6px 4px;
    background: var(--border);
}

.source-item-action {
    font-size: 13px;
}

/* ---------- Модалка управления ---------- */

.collab-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 350;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 9, 12, .55);
    backdrop-filter: blur(3px);
}

.collab-modal-overlay[hidden] {
    display: none;
}

.collab-modal {
    width: min(680px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.collab-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.collab-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
}

.collab-modal-header h3 i {
    color: var(--accent);
}

.collab-modal-lead {
    margin: 10px 0 18px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.collab-create {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.collab-create .input-field {
    flex: 1;
}

.collab-create .btn {
    white-space: nowrap;
}

.collab-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.collab-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

.collab-empty i {
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.collab-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.collab-row.is-active {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background: var(--accent-soft);
}

.collab-row-main {
    flex: 1;
    min-width: 0;
}

.collab-row-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.collab-row-meta {
    margin-top: 3px;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collab-role {
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-sunken);
    border-radius: var(--radius-pill);
}

.collab-role.is-owner {
    color: var(--accent);
    background: var(--accent-soft);
}

.collab-details {
    margin-top: 18px;
    padding: 18px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.collab-details-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.collab-key-label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.collab-key-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.collab-key-row .collab-key-label {
    width: 100%;
}

.collab-key-value {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--code-text);
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    white-space: nowrap;
}

.collab-invite {
    margin-bottom: 14px;
}

.collab-invite-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.collab-invite-row .input-field {
    flex: 1;
    min-width: 200px;
    font-family: var(--mono);
    font-size: 12px;
}

.collab-members {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.collab-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.collab-member-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 500;
}

.collab-member-name i {
    color: var(--text-muted);
}

.collab-details-actions {
    display: flex;
    justify-content: flex-end;
}

.collab-details-actions .btn-danger,
.collab-remove {
    color: var(--red);
    border-color: color-mix(in srgb, var(--red) 40%, var(--border));
}

.collab-details-actions .btn-danger:hover,
.collab-remove:hover {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
}

/* ---------- Страница-приглашение ---------- */

.join-page .join-wrapper {
    display: flex;
    justify-content: center;
    padding: 64px 24px 96px;
}

.join-card {
    width: min(560px, 100%);
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.join-title {
    margin: 14px 0 10px;
    font-size: clamp(26px, 4vw, 34px);
    letter-spacing: -.02em;
}

.join-description {
    margin-bottom: 22px;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.join-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 26px;
}

.join-meta > div {
    padding: 12px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.join-meta dt {
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.join-meta dd {
    margin-top: 4px;
    font-weight: 600;
}

.join-meta dd i {
    color: var(--accent);
    margin-right: 6px;
}

.join-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.join-accept {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
}

.join-accept:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--on-accent);
}

.join-hint {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .log-source {
        padding: 14px 16px 0;
    }

    .source-toggle {
        width: 100%;
    }

    .source-menu {
        min-width: 0;
        width: 100%;
    }

    .log-source .btn {
        flex: 1;
        justify-content: center;
    }

    .collab-modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .collab-modal {
        max-height: 92vh;
        padding: 20px;
        border-radius: var(--radius-lg);
    }

    .collab-create {
        flex-direction: column;
    }

    .collab-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .join-card {
        padding: 26px 22px;
    }

    .join-meta {
        grid-template-columns: 1fr;
    }
}

/* ---------- Инфографика коллабораций на главной ---------- */

.collab-diagram {
    margin: 6px 0 30px;
    padding: 28px 24px 22px;
    background:
        radial-gradient(120% 140% at 50% 0%, var(--accent-soft) 0%, transparent 62%),
        var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.collab-diagram-stage {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 18px;
}

.collab-diagram-node {
    position: relative;
    display: flex;
    flex: 0 1 220px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 18px 18px 16px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.collab-diagram-node strong {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.collab-diagram-node.is-accent {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-sm);
}

.collab-diagram-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 2px;
    font-size: 16px;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: var(--radius);
}

.collab-diagram-meta {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--text-muted);
}

.collab-diagram-arrow {
    align-self: center;
    flex: none;
    font-size: 22px;
    line-height: 1;
    color: var(--accent);
    opacity: .75;
}

.collab-diagram-avatars {
    display: flex;
    margin-bottom: 2px;
}

.collab-diagram-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: -9px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border: 2px solid var(--surface);
    border-radius: 50%;
}

.collab-diagram-avatar:first-child {
    margin-left: 0;
}

.collab-diagram-pulse {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    animation: collabPulse 2.2s ease-out infinite;
}

@keyframes collabPulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); }
    70% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--green) 0%, transparent); }
    100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 0%, transparent); }
}

.collab-diagram figcaption {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

@media (max-width: 720px) {
    .collab-diagram {
        padding: 20px 16px 18px;
    }

    .collab-diagram-stage {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .collab-diagram-node {
        flex: none;
        width: 100%;
        padding: 14px;
    }

    .collab-diagram-icon {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .collab-diagram-arrow {
        align-self: center;
        transform: rotate(90deg);
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .collab-diagram-pulse {
        animation: none;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent);
    }
}

/* ---------- Разделители продуктовых групп на главной ---------- */

.product-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 56px;
}

.product-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: var(--radius-pill);
}

.product-badge i {
    font-size: 12px;
}

.product-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.product-note {
    font-size: 12.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Первая секция группы: линия есть у разделителя, дубль не нужен. */
.section.section-group-start {
    border-top: 0;
    padding-top: 30px;
}

@media (max-width: 720px) {
    .product-divider {
        padding-top: 40px;
    }

    .product-note {
        display: none;
    }

    .section.section-group-start {
        padding-top: 24px;
    }
}

/* Синхронизация проектов: блок внутри группы «Конструктор REST API» */
.sync-info .privacy {
    margin-top: 24px;
}

.sync-info .flow .step {
    font-size: 18px;
}

.footer-links .footer-mail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 12.5px;
}

/* ---------- Кнопка скачивания с выбором платформы ---------- */

.download-split {
    position: relative;
    display: inline-flex;
    align-items: stretch;
}

.download-split .download-main {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.download-split .download-main:hover {
    transform: none;
}

.download-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    padding: 0;
    font-size: 12px;
    color: var(--on-accent);
    background: var(--accent);
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, .3);
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
    transition: background-color .16s var(--ease);
}

.download-toggle:hover,
.download-toggle[aria-expanded="true"] {
    background: var(--accent-hover);
}

.download-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 120;
    min-width: 250px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.download-menu[hidden] {
    display: none;
}

.download-menu-title {
    padding: 6px 10px;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.download-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.download-menu a:hover {
    background: var(--surface-hover);
}

.download-menu a small {
    display: block;
    margin-top: 1px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
}

.download-check {
    display: none;
    color: var(--accent);
    font-weight: 700;
}

.download-menu a.is-current {
    background: var(--accent-soft);
}

.download-menu a.is-current .download-check {
    display: inline;
}

.download-menu a.is-current small {
    color: var(--accent);
}

@media (max-width: 640px) {
    .download-menu {
        min-width: min(280px, calc(100vw - 48px));
    }
}

/* Ссылки в подписях к скриншотам */
.screenshot figcaption h3 a { color: inherit; }
.screenshot figcaption h3 a:hover { color: var(--accent); }

/* Шесть пунктов меню не помещаются на средних ширинах — переключаемся на
   компактное меню раньше, чем наступает общий мобильный брейкпоинт. */
@media (max-width: 980px) {
    .nav-wrapper { gap: 12px; padding: 0 16px; }
    .mobile-menu-toggle { display: flex; }
    .nav-links {
        position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 2px;
        margin: 0; padding: 12px 16px 16px;
        background: var(--bg); border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        display: none;
    }
    .nav-links.active { display: flex; }
    .nav-links a { padding: 12px 12px; font-size: 15px; }
    .nav-links .nav-access, .nav-links .user-info { margin-left: 0; justify-content: center; }
    .theme-switch { justify-content: flex-start; padding-top: 6px; }
}

/* Футер: на средних ширинах три колонки ссылок не помещаются в одну строку. */
@media (max-width: 900px) {
    .public-footer { grid-template-columns: 1fr; gap: 28px; padding: 36px 18px 24px; }
    .footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
    .footer-group:last-child { grid-column: 1 / -1; }
    .footer-bottom { flex-direction: column; gap: 6px; padding-top: 20px; }
}
