.pwa-guide,
.pwa-promotion,
.pwa-install-launcher {
    --pwa-accent: var(--site-accent, #3367c1);
    --pwa-accent-hover: var(--site-accent-hover, #2556a8);
    --pwa-on-accent: var(--site-on-accent, #fff);
    --pwa-soft: var(--site-soft, #edf3fd);
    --pwa-border: var(--site-border, #dfe4ec);
    --pwa-heading: var(--site-heading, #222);
    --pwa-text: var(--site-text, #333);
    --pwa-muted: var(--site-muted, #647084);
    color: var(--pwa-text);
    font-family: inherit;
    text-align: left;
}

.pwa-guide *, .pwa-promotion *, .pwa-install-launcher { box-sizing: border-box; }
.pwa-guide [hidden], .pwa-promotion[hidden], .pwa-install-launcher[hidden] { display: none !important; }

.pwa-public-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    max-width: 100%;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--pwa-accent);
    color: var(--pwa-on-accent) !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none !important;
    transition: background .15s;
}
.pwa-public-button:hover { background: var(--pwa-accent-hover); color: var(--site-on-accent-hover, #fff) !important; }
.pwa-guide a:focus-visible, .pwa-guide summary:focus-visible,
.pwa-promotion a:focus-visible, .pwa-promotion button:focus-visible, .pwa-install-launcher:focus-visible {
    outline: 3px solid var(--pwa-accent);
    outline-offset: 4px;
}

.pwa-promotion {
    position: fixed;
    z-index: 1035;
    right: max(24px, env(safe-area-inset-right));
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 380px;
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 110px);
    overflow-y: auto;
    padding: 22px 20px;
    border: 2px dashed #c8cfd8;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 10px 36px rgba(22, 35, 56, .1);
    animation: pwa-promotion-appear .22s ease-out;
}
.pwa-promotion-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 0 12px 0 12px;
    background: transparent;
    color: var(--pwa-muted);
    font: 28px/1 Arial, sans-serif;
    cursor: pointer;
}
.pwa-promotion-close:hover { background: var(--pwa-soft); color: var(--pwa-heading); }
.pwa-promotion-icon {
    display: flex;
    flex: 0 0 56px;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    color: var(--pwa-accent);
}
.pwa-promotion-content { min-width: 0; }
.pwa-promotion h2 { margin: 0 12px 7px 0; color: var(--pwa-heading); font-size: 16px; font-weight: 600; line-height: 1.4; }
.pwa-promotion p { margin: 0 0 3px; font-size: 14px; font-weight: 400; line-height: 1.55; color: var(--pwa-muted); }
.pwa-promotion .pwa-promotion-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; color: var(--pwa-accent); font-size: 13px; font-weight: 500; line-height: 1.5; text-decoration: none; }
.pwa-promotion .pwa-promotion-link:hover { color: var(--pwa-accent-hover); text-decoration: underline; }
.pwa-promotion-link > span { flex-shrink: 0; }
.pwa-install-launcher {
    position: fixed;
    z-index: 1035;
    right: max(24px, env(safe-area-inset-right));
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: calc(100vw - 32px);
    min-height: 46px;
    padding: 10px 16px;
    border: 1px solid var(--pwa-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(22, 35, 56, .12);
    color: var(--pwa-accent);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
}
.pwa-install-launcher:hover { background: var(--pwa-soft); }
.pwa-install-launcher svg { flex-shrink: 0; }

.pwa-guide { width: min(1100px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 64px; overflow-wrap: anywhere; }
.pwa-guide-breadcrumb { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; font-size: 13px; color: var(--pwa-muted); }
.pwa-guide a:not(.pwa-public-button) { color: var(--pwa-accent); }
.pwa-guide-hero { display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; gap: 56px; padding: 28px 0 48px; }
.pwa-guide-eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--pwa-accent); }
.pwa-guide h1 { margin: 0 0 22px; font-size: clamp(32px, 4vw, 48px); font-weight: 700; line-height: 1.15; letter-spacing: -.025em; color: var(--pwa-heading); }
.pwa-guide-intro { margin: 0 0 24px; font-size: 17px; line-height: 1.7; }
.pwa-guide-caption { margin: 14px 0 0; color: var(--pwa-muted); font-size: 13px; line-height: 1.6; }
.pwa-guide-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 22px; font-size: 14px; }
.pwa-guide-nav a { padding: 5px 0; text-decoration: underline; text-underline-offset: 3px; }
.pwa-guide-overview { margin: 0; padding: 10px 24px; list-style: none; border: 1px solid var(--pwa-border); border-radius: 16px; background: var(--pwa-soft); }
.pwa-guide-overview li + li { border-top: 1px solid var(--pwa-border); }
.pwa-guide-overview a { display: flex; align-items: center; gap: 18px; padding: 22px 0; text-decoration: none; }
.pwa-guide-overview a > span { flex-shrink: 0; font-size: 24px; font-weight: 700; color: var(--pwa-accent); }
.pwa-guide-overview strong { display: block; margin-bottom: 4px; color: var(--pwa-heading); font-size: 16px; }
.pwa-guide-overview small { display: block; color: var(--pwa-muted); font-size: 13px; line-height: 1.5; }
.pwa-guide-section { margin-top: 24px; padding: 32px; border: 1px solid var(--pwa-border); border-radius: 16px; background: #fff; scroll-margin-top: 100px; }
.pwa-guide-telegram { border-top: 3px solid var(--pwa-accent); }
.pwa-guide-step { display: inline-block; margin-bottom: 12px; color: var(--pwa-accent); font-size: 13px; font-weight: 700; }
.pwa-guide h2 { margin: 0 0 16px; color: var(--pwa-heading); font-size: clamp(23px, 2.5vw, 29px); font-weight: 700; line-height: 1.3; }
.pwa-guide-section > p { margin-bottom: 18px; line-height: 1.7; }
.pwa-guide-instructions { margin: 18px 0; padding-left: 24px; line-height: 1.7; }
.pwa-guide-instructions li { padding-left: 5px; margin: 0 0 12px; }
.pwa-guide-instructions li::marker { color: var(--pwa-accent); font-weight: 700; }
.pwa-guide code { padding: 2px 6px; border-radius: 4px; background: var(--pwa-soft); color: var(--pwa-heading); font-size: .95em; }
.pwa-guide-important { padding: 16px 20px; border-left: 3px solid var(--pwa-accent); border-radius: 0 8px 8px 0; background: var(--pwa-soft); line-height: 1.7; }
.pwa-guide-devices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.pwa-guide-device { min-width: 0; padding: 0 20px 20px; border: 1px solid var(--pwa-border); border-radius: 12px; }
.pwa-guide-device:not([open]) { padding-bottom: 0; }
.pwa-guide-device summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; position: relative; padding: 20px 24px 20px 0; cursor: pointer; list-style: none; }
.pwa-guide-device summary::-webkit-details-marker { display: none; }
.pwa-guide-device summary::after { content: '+'; position: absolute; right: 0; top: 22px; color: var(--pwa-accent); font-size: 23px; line-height: 1; }
.pwa-guide-device[open] summary::after { content: '−'; }
.pwa-guide-device summary strong { display: block; color: var(--pwa-heading); font-size: 17px; }
.pwa-guide-device summary small { display: block; margin-top: 4px; color: var(--pwa-muted); font-size: 12px; line-height: 1.4; }
.pwa-guide-device-current { padding: 4px 7px; border-radius: 5px; background: var(--pwa-soft); color: var(--pwa-accent); font-size: 11px; font-weight: 600; }
.pwa-guide-device .pwa-guide-instructions { margin-top: 0; font-size: 14px; }
.pwa-guide-source { font-size: 12px; text-decoration: underline; }
.pwa-guide-sources { margin-bottom: 0; }
.pwa-guide-help { margin: 20px 0 24px; padding: 16px 0; border-top: 1px solid var(--pwa-border); border-bottom: 1px solid var(--pwa-border); }
.pwa-guide-help summary { cursor: pointer; font-weight: 600; color: var(--pwa-heading); }
.pwa-guide-help p { margin: 14px 0 0; line-height: 1.7; }
.pwa-guide-usage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-top: 24px; }
.pwa-guide-usage article { min-width: 0; padding: 22px; border-radius: 12px; background: var(--pwa-soft); }
.pwa-guide-usage h3 { margin: 0 0 12px; color: var(--pwa-heading); font-size: 17px; font-weight: 600; line-height: 1.4; }
.pwa-guide-usage p { margin: 0; font-size: 14px; font-weight: 400; line-height: 1.7; }
.pwa-guide-questions .pwa-guide-help { margin: 0; }
.pwa-guide-questions .pwa-guide-help + .pwa-guide-help { border-top: 0; }

@keyframes pwa-promotion-appear { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .pwa-promotion { animation: none; } .pwa-public-button { transition: none; } }
@media (max-width: 767px) {
    .pwa-guide { width: calc(100% - 32px); padding-top: 22px; padding-bottom: 40px; }
    .pwa-guide-breadcrumb { margin-bottom: 10px; }
    .pwa-guide-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 20px 0 10px; }
    .pwa-guide-overview { padding: 0 20px; }
    .pwa-guide-overview a { padding: 18px 0; }
    .pwa-guide-section { margin-top: 20px; padding: 22px 18px; }
    .pwa-guide-intro { font-size: 16px; }
    .pwa-guide-devices { grid-template-columns: minmax(0, 1fr); }
    .pwa-guide-usage { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .pwa-guide-usage article { padding: 18px; }
    .pwa-guide-important { padding: 14px; }
    .pwa-guide .pwa-public-button { width: 100%; }
    .pwa-promotion { right: max(16px, env(safe-area-inset-right)); gap: 12px; padding: 22px 18px 18px; }
    .pwa-install-launcher { right: max(16px, env(safe-area-inset-right)); }
    .pwa-promotion-icon { flex-basis: 48px; width: 48px; height: 48px; }
    .pwa-promotion-icon svg { width: 48px; height: 48px; }
    .pwa-promotion h2 { font-size: 15px; }
    .pwa-promotion p { font-size: 13px; }
}
