/* ==========================================================================
   pokalbiai.konvo.lt — application stylesheet
   ========================================================================== */

/* --------------------------------------------------------------- typography */

/* Self-hosted so the browser needs no third-party DNS lookup, TLS handshake or
   render-blocking stylesheet from fonts.googleapis.com before it can paint.
   One variable file covers 400–700; unicode-range keeps the larger latin-ext
   file out of the critical path until a Lithuanian glyph actually appears. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/assets/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/assets/fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
        U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
        U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------------------------------------------- tokens */

:root {
    --bg-color: #09090b;
    --surface: #18181b;
    --surface-2: #1f1f23;
    --border: #27272a;
    --border-strong: #3f3f46;

    --text-primary: #f8fafc;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft: rgba(59, 130, 246, 0.12);

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --message-user: #2563eb;
    --message-partner: #27272a;

    --font-main: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --transition: 160ms ease;

    --shell-max: 900px;
    --app-height: 100vh;
}

@supports (height: 100dvh) {
    :root {
        --app-height: 100dvh;
    }
}

/* -------------------------------------------------------------------- reset */

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

* {
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-wrap: break-word;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: var(--accent-hover);
}

button,
input,
textarea {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
}

.icon--sm {
    width: 1rem;
    height: 1rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 200;
    padding: 0.75rem 1rem;
    background: var(--accent);
    color: #fff;
    border-radius: 0 0 var(--radius) var(--radius);
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
    color: #fff;
}

.app-container {
    width: 100%;
    max-width: var(--shell-max);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* ------------------------------------------------------------- site chrome */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    max-width: var(--shell-max);
    margin-inline: auto;
    padding: 1.25rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.brand__mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.brand__text span {
    color: var(--accent);
}

.site-nav {
    display: flex;
    gap: 1.25rem;
    font-size: 0.95rem;
}

.site-nav a {
    color: var(--text-secondary);
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--text-primary);
}

/* --------------------------------------------------------------------- hero */

.hero {
    display: grid;
    gap: 2.5rem;
    padding: 2rem 0 3rem;
}

.hero h1 {
    font-size: clamp(2rem, 5.5vw, 2.75rem);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    text-wrap: balance;
}

.hero__lead {
    color: var(--text-secondary);
    font-size: 1.075rem;
    max-width: 46ch;
}

.hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    list-style: none;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.hero__badges li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero__badges .icon {
    color: var(--accent);
}

@media (min-width: 860px) {
    .hero {
        grid-template-columns: 1fr minmax(360px, 420px);
        align-items: start;
        gap: 3rem;
        padding-top: 3rem;
    }
}

/* --------------------------------------------------------------------- form */

.onboarding-form {
    background: var(--surface);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.onboarding-form__title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    border: 0;
}

.form-group--captcha {
    display: flex;
    justify-content: center;
}

.form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.625rem;
    padding: 0;
}

.form-hint {
    margin-top: 0.5rem;
    font-size: 0.825rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    background: var(--bg-color);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    outline: none;
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-error {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.925rem;
}

.form-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.card-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), background var(--transition), color var(--transition);
    background: var(--bg-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.radio-card:hover .card-content {
    border-color: var(--border-strong);
}

.radio-card input:checked + .card-content {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.radio-card input:focus-visible + .card-content {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ buttons */

.btn-start {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1.25rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.btn-start:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-start:active {
    transform: translateY(1px);
}

.btn-start--inline {
    width: auto;
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    padding: 0.625rem 1.125rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-danger {
    background: var(--danger);
    border: 1px solid var(--danger);
    color: #fff;
    padding: 0.625rem 1.125rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-find-next {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 500;
    transition: background var(--transition);
}

.btn-find-next:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}

/* ----------------------------------------------------------------- sections */

.section {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
}

.section > h2 {
    font-size: clamp(1.35rem, 3.5vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 1.75rem;
}

.prose {
    color: var(--text-secondary);
    max-width: 68ch;
    margin-bottom: 1rem;
}

.prose-list {
    color: var(--text-secondary);
    max-width: 68ch;
    padding-left: 1.25rem;
    margin-bottom: 1.25rem;
}

.prose-list li {
    margin-bottom: 0.625rem;
}

.steps {
    display: grid;
    gap: 1rem;
    list-style: none;
    counter-reset: step;
}

@media (min-width: 700px) {
    .steps {
        grid-template-columns: repeat(4, 1fr);
    }
}

.step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.step__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.step__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.step__text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.features {
    display: grid;
    gap: 1rem;
    list-style: none;
}

@media (min-width: 640px) {
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
}

.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.feature__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 0.875rem;
}

.feature__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.feature__text {
    font-size: 0.925rem;
    color: var(--text-secondary);
}

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

.faq__item {
    border-bottom: 1px solid var(--border);
}

.faq__item:first-child {
    border-top: 1px solid var(--border);
}

.faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.125rem 0;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    color: var(--text-primary);
}

.faq__question::-webkit-details-marker {
    display: none;
}

.faq__marker {
    color: var(--text-muted);
    transition: transform var(--transition);
}

.faq__item[open] .faq__marker {
    transform: rotate(45deg);
    color: var(--accent);
}

.faq__answer {
    padding-bottom: 1.25rem;
    color: var(--text-secondary);
    max-width: 68ch;
}

/* ------------------------------------------------------------------- legal */

.breadcrumbs {
    padding: 0.5rem 0 1.5rem;
    font-size: 0.875rem;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    color: var(--text-muted);
}

.breadcrumbs li + li::before {
    content: '/';
    margin-right: 0.5rem;
    color: var(--border-strong);
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.legal {
    padding-bottom: 3rem;
}

.legal h1 {
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.legal h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
}

.legal__meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

/* -------------------------------------------------------------- error page */

.error-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 1.25rem;
    gap: 0.75rem;
}

.error-page__code {
    font-size: clamp(3.5rem, 14vw, 6rem);
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    opacity: 0.35;
}

.error-page__title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 600;
}

.error-page__text {
    color: var(--text-secondary);
    max-width: 42ch;
}

.error-page__actions {
    margin-top: 1rem;
}

.error-page__links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

/* ------------------------------------------------------------------ footer */

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 2.5rem 0 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.site-footer__inner {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .site-footer__inner {
        grid-template-columns: 1fr auto;
        align-items: start;
    }
}

.site-footer__brand p {
    margin-top: 0.5rem;
    color: var(--text-muted);
    max-width: 40ch;
}

.site-footer__nav {
    display: grid;
    gap: 0.625rem;
}

.site-footer__nav a {
    color: var(--text-secondary);
    text-decoration: none;
}

.site-footer__nav a:hover {
    color: var(--text-primary);
}

.site-footer__legal {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.825rem;
}

/* ------------------------------------------------------------- matchmaking */

.matchmaking-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 1.5rem;
}

.loader {
    text-align: center;
}

.loader__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.loader__hint {
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------- chat */

.page--chat {
    overflow: hidden;
}

.chat-interface {
    display: flex;
    flex-direction: column;
    height: var(--app-height);
    max-width: var(--shell-max);
    width: 100%;
    margin-inline: auto;
    background: var(--bg-color);
    position: relative;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    padding-top: max(0.875rem, env(safe-area-inset-top));
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex: none;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--success);
    flex: none;
}

.status-dot--offline {
    background: var(--text-muted);
    box-shadow: none;
}

.partner-info {
    min-width: 0;
}

.partner-info__name {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.partner-info__status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.btn-disconnect {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    flex: none;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn-disconnect:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.chat-messages {
    flex: 1;
    min-height: 0;
    padding: 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
}

.chat-messages:focus {
    outline: none;
}

.system-alert {
    align-self: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0.5rem 0;
    max-width: 46ch;
}

.system-alert--warning {
    color: var(--warning);
}

.message {
    max-width: min(80%, 34rem);
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-lg);
    line-height: 1.45;
    animation: message-in 180ms ease-out;
}

@keyframes message-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.message--user {
    align-self: flex-end;
    background: var(--message-user);
    border-bottom-right-radius: 0.25rem;
}

.message--partner {
    align-self: flex-start;
    background: var(--message-partner);
    border-bottom-left-radius: 0.25rem;
}

.message__meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-bottom: 0.125rem;
}

.message__sender {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14ch;
}

.message__text {
    white-space: pre-wrap;
}

.chat-end-actions {
    align-self: center;
    margin: 0.5rem 0 1rem;
}

.typing-indicator {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--message-partner);
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.typing-indicator__name {
    font-weight: 600;
    max-width: 14ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dots {
    display: inline-flex;
    gap: 3px;
}

.dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    animation: blink 1.4s infinite both;
}

.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 100% { opacity: 0.2; }
    20% { opacity: 1; }
}

.scroll-bottom {
    position: absolute;
    right: 1.25rem;
    bottom: 6.5rem;
    z-index: 5;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.scroll-bottom:hover {
    background: var(--border);
}

/* ----------------------------------------------------------------- composer */

.chat-input-area {
    flex: none;
    padding: 0.875rem 1.25rem;
    padding-bottom: max(0.875rem, env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.composer {
    display: flex;
    align-items: flex-end;
    gap: 0.625rem;
}

.composer__field {
    position: relative;
    flex: 1;
    min-width: 0;
}

.composer__input {
    width: 100%;
    display: block;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 0.7rem 1rem;
    resize: none;
    outline: none;
    max-height: 40vh;
    overflow-y: auto;
    line-height: 1.4;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.composer__input::placeholder {
    color: var(--text-muted);
}

.composer__input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.composer__input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.composer__counter {
    position: absolute;
    right: 0.875rem;
    bottom: -1.1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.composer__counter--limit {
    color: var(--warning);
    font-weight: 600;
}

.composer__hint {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.composer__hint kbd {
    font-family: inherit;
    font-size: 0.7rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 0.25rem;
}

/* Keyboard hints are meaningless on touch-only devices. */
@media (hover: none) and (pointer: coarse) {
    .composer__hint {
        display: none;
    }
}

.btn-send {
    flex: none;
    background: var(--accent);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), opacity var(--transition);
}

.btn-send:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.btn-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ------------------------------------------------------------------ dialog */

.dialog {
    /* The universal `margin: 0` reset above defeats the auto-centring the UA
       stylesheet gives a modal <dialog>; restore it explicitly. */
    inset: 0;
    margin: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text-primary);
    padding: 1.5rem;
    max-width: 24rem;
    width: calc(100% - 2.5rem);
}

.dialog::backdrop {
    background: rgba(0, 0, 0, 0.65);
}

.dialog__title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dialog__text {
    color: var(--text-secondary);
    font-size: 0.925rem;
    margin-bottom: 1.5rem;
}

.dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
}

/* --------------------------------------------------------------- noscript */

.noscript-notice {
    max-width: 34rem;
    margin: 4rem auto;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.noscript-notice p + p {
    margin-top: 0.75rem;
}

/* ------------------------------------------------------------- small screens */

@media (max-width: 640px) {
    .site-header {
        padding: 1rem 1.25rem;
    }

    .onboarding-form {
        padding: 1.375rem;
    }

    .message {
        max-width: 88%;
    }

    .btn-disconnect span {
        display: none;
    }

    .scroll-bottom {
        bottom: 5.75rem;
    }
}

/* -------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .chat-messages {
        scroll-behavior: auto;
    }
}
