.xmpp-page { color: var(--text); }
.xmpp-page p { color: var(--muted); line-height: 1.75; }
.xmpp-page h2, .xmpp-page h3 { color: var(--text); }
.xmpp-page .section-title { max-width: 26ch; }
.xmpp-page .section-heading p { max-width: 74ch; }

.xmpp-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.xmpp-actions a { white-space: normal; text-align: center; }
.xmpp-page .xmpp-prose { max-width: 78ch; }
.xmpp-page .xmpp-prose p + p { margin-top: 16px; }

.xmpp-architecture, .xmpp-status {
    padding: clamp(24px, 4vw, 56px);
    border: 1px solid var(--border);
    border-radius: 30px;
    background:
        radial-gradient(ellipse at 25% 0, rgba(37, 99, 235, .13), transparent 65%),
        linear-gradient(145deg, var(--surface-2), var(--surface-soft));
}
.xmpp-architecture-flow { display: grid; gap: 0; margin: 32px 0; }
.xmpp-architecture-node {
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
}
.xmpp-architecture-node h3 { margin: 0 0 10px; font-size: clamp(1.2rem, 2vw, 1.7rem); }
.xmpp-architecture-node p { margin: 0; }
.xmpp-architecture-node--gateway {
    border-color: rgba(129, 140, 248, .65);
    background: linear-gradient(130deg, var(--surface-2), var(--surface-soft));
    box-shadow: 0 0 32px rgba(37, 99, 235, .08);
}
.xmpp-architecture-arrow {
    justify-self: center;
    padding: 8px 0;
    color: #818cf8;
    font-size: 1.8rem;
    line-height: 1;
}
.xmpp-architecture-note { margin: 0; font-size: .95rem; }
.xmpp-client-flow {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 98px 18px;
    margin: 0 auto;
    padding: 20px 0 44px;
    width: 100%;
    max-width: 900px;
    isolation: isolate;
}
.xmpp-flow-wires {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}
.xmpp-flow-route-0 { --client-color: #38bdf8; }
.xmpp-flow-route-1 { --client-color: #a78bfa; }
.xmpp-flow-route-2 { --client-color: #2dd4bf; }
.xmpp-flow-track, .xmpp-flow-signal {
    fill: none;
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
}
.xmpp-flow-track { stroke: var(--border-strong); stroke-width: 1.5; }
.xmpp-flow-signal {
    stroke: var(--client-color);
    stroke-width: 3;
    stroke-dasharray: 9 110;
    stroke-dashoffset: 10;
    filter: drop-shadow(0 0 4px var(--client-color));
    opacity: 0;
}
.xmpp-flow-signal--return { stroke-width: 2; }
.xmpp-flow-hub, .xmpp-flow-client {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    color: var(--text);
    text-align: center;
}
.xmpp-flow-hub {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    gap: 8px;
    width: min(100%, 320px);
    min-height: 100px;
    padding: 16px;
    border-color: rgba(129, 140, 248, .65);
    background: linear-gradient(130deg, var(--surface-2), var(--surface-soft));
    font-size: clamp(1rem, 2vw, 1.25rem);
}
.xmpp-flow-hub-icon { width: 30px; height: 30px; color: #818cf8; }
.xmpp-flow-client {
    grid-row: 2;
    gap: 10px;
    min-height: 126px;
    padding: 14px 8px;
    font-size: clamp(.8rem, 1.5vw, 1rem);
}
.xmpp-flow-device { width: 56px; max-width: 100%; height: 56px; color: var(--client-color); }
.xmpp-flow-glow {
    position: absolute;
    inset: -1px;
    border: 1px solid var(--client-color, #818cf8);
    border-radius: inherit;
    box-shadow: 0 0 24px color-mix(in srgb, var(--client-color, #818cf8) 25%, transparent);
    pointer-events: none;
    opacity: 0;
}
.xmpp-flow-toggle {
    position: absolute;
    right: 0;
    bottom: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 34px;
    height: 34px;
    justify-content: center;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .8rem;
    cursor: pointer;
}
.xmpp-flow-toggle[hidden] { display: none; }
.xmpp-flow-toggle:hover { color: var(--text); border-color: #818cf8; }
.xmpp-flow-toggle:focus-visible { outline: 2px solid #38bdf8; outline-offset: 4px; }
.xmpp-flow-caption { margin-top: 24px; }
.xmpp-flow-caption h3 { margin: 0 0 8px; font-size: 1.2rem; }
.xmpp-flow-caption p { margin: 0; }
.xmpp-page .xmpp-flow-capabilities {
    padding-top: 20px;
    margin: 24px 0 0;
    border-top: 1px solid var(--border);
    font-size: .9rem;
}
.xmpp-page .xmpp-card {
    min-height: 0;
    display: block;
    padding: clamp(24px, 3vw, 36px);
}
.xmpp-card h3 { margin: 0 0 16px; font-size: clamp(1.3rem, 2vw, 1.8rem); line-height: 1.25; }
.xmpp-card p { margin: 0; }
.xmpp-console-card { border-top: 2px solid rgba(129, 140, 248, .6); }
.xmpp-console-card h3 { letter-spacing: -.02em; }
.xmpp-page .xmpp-console-question {
    min-height: 3em;
    margin: 0 0 18px;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.45;
}
.xmpp-console-screenshot { margin: 0 0 20px; }
.xmpp-console-screenshot a {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
}
.xmpp-console-screenshot a:hover { border-color: #818cf8; }
.xmpp-console-screenshot a:focus-visible { outline: 2px solid #38bdf8; outline-offset: 4px; }
.xmpp-console-screenshot img { display: block; width: 100%; height: auto; }
.xmpp-console-screenshot a > span { display: block; padding: 10px 14px; background: var(--surface-soft); font-size: .85rem; }
.xmpp-page .xmpp-console-demo-note { margin: 0 0 22px; font-size: .92rem; }
.xmpp-console-demo-note > span {
    display: inline-block;
    margin: 0 8px 6px 0;
    padding: 4px 9px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text);
    font-size: .8rem;
}
.xmpp-screenshot-dialog {
    width: min(96vw, 1800px);
    max-width: 96vw;
    max-height: 94dvh;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    color: var(--text);
    background: var(--bg-2);
    box-shadow: var(--shadow-xl);
}
.xmpp-screenshot-dialog::backdrop { background: rgba(0, 0, 0, .8); }
.xmpp-screenshot-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 12px 8px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: .9rem;
}
.xmpp-screenshot-toolbar button {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}
.xmpp-screenshot-toolbar button:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.xmpp-screenshot-scroll { max-height: calc(94dvh - 58px); overflow: auto; overscroll-behavior: contain; }
.xmpp-screenshot-scroll img { display: block; width: auto; height: auto; max-width: none; }
.xmpp-page #operator-console { scroll-margin-top: 100px; }
.xmpp-status h2 { max-width: 28ch; }
.xmpp-ecosystem { display: flex; flex-wrap: wrap; gap: 12px; }
.xmpp-ecosystem a {
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    background: var(--surface-soft);
    text-decoration: none;
}
.xmpp-ecosystem a:hover, .xmpp-ecosystem a:focus-visible { border-color: #818cf8; }
.xmpp-page .v3-cta-panel { display: block; }
.xmpp-page .v3-cta-panel h2 {
    max-width: 26ch;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
}
.xmpp-page .v3-cta-panel p { max-width: 78ch; }
.xmpp-page .v3-cta-panel .xmpp-actions { margin-top: 28px; }

@media (max-width: 600px) {
    .xmpp-actions { align-items: stretch; flex-direction: column; }
    .xmpp-actions a { width: 100%; }
    .xmpp-architecture, .xmpp-status { border-radius: 22px; }
    .xmpp-page .section-title { overflow-wrap: anywhere; }
    .xmpp-client-flow { column-gap: 8px; }
    .xmpp-flow-client { border-radius: 14px; padding: 14px 4px; }
    .xmpp-flow-device { width: 46px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
    .xmpp-flow-signal, .xmpp-flow-glow { opacity: 0 !important; }
    .xmpp-flow-toggle { display: none; }
}
