/* ── design tokens ────────────────────────────────────────────────────────── */
:root {
    --bg-body:     #0d0d1a;
    --bg-card:     #13132b;
    --bg-card-alt: #1a1a35;
    --bg-input:    #111126;
    --bg-msg-own:  #2d1f6e;
    --bg-msg-peer: #1c1c3c;
    --bg-sys:      transparent;

    --accent:      #7c3aed;
    --accent-h:    #6d28d9;
    --accent-lite: #a78bfa;

    --text-pri:  #e2e8f0;
    --text-sec:  #94a3b8;
    --text-acc:  #a78bfa;

    --border:    #252546;
    --success:   #10b981;
    --error:     #ef4444;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* ── reset / base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-pri);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--accent-lite); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── utility ──────────────────────────────────────────────────────────────── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
}
.btn--primary:hover { background: var(--accent-h); }
.btn--primary:active { transform: scale(0.97); }

.btn--outline {
    background: transparent;
    color: var(--accent-lite);
    border: 1px solid var(--accent);
}
.btn--outline:hover { background: rgba(124,58,237,.15); }

.btn--ghost {
    background: transparent;
    color: var(--text-sec);
    padding: 8px 12px;
}
.btn--ghost:hover { color: var(--text-pri); }

.btn--icon {
    background: transparent;
    color: var(--text-sec);
    padding: 8px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
}
.btn--icon:hover { color: var(--text-pri); background: rgba(255,255,255,.07); }

/* ── ═══════════════════  HOME PAGE  ═══════════════════ ──────────────── */
.landing {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 60px 16px 48px;
    gap: 56px;
    overflow-y: auto;
}

/* hero */
.hero { text-align: center; }

.hero__logo {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--accent-lite) 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__tagline {
    margin-top: 10px;
    color: var(--text-sec);
    font-size: 1.05rem;
}

/* cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 680px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.card__icon { font-size: 2rem; line-height: 1; }
.card__title { font-size: 1.15rem; font-weight: 700; }
.card__desc { color: var(--text-sec); font-size: 0.9rem; flex: 1; }

/* join input */
.join-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-pri);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-sec); }

/* error banner */
.error-banner {
    background: rgba(239,68,68,.12);
    border: 1px solid var(--error);
    color: var(--error);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: 14px;
    max-width: 680px;
    width: 100%;
    text-align: center;
}

/* footer note */
.landing__note {
    color: var(--text-sec);
    font-size: 0.8rem;
    text-align: center;
}

/* sessions-created stat – hero footer */
.sessions-stat {
    margin: 0.6rem auto 0;
    font-size: 0.82rem;
    color: var(--text-sec);
    text-align: center;
}

.sessions-stat__count {
    font-weight: 700;
    color: var(--accent);
}

/* ── SRI panel – home page ────────────────────────────────────────────────── */
.sri-panel {
    width: 100%;
    max-width: 680px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
}

.sri-panel__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-pri);
    margin-bottom: 10px;
}

.sri-panel__subtitle {
    font-size: 0.82rem;
    color: var(--text-sec);
    margin-bottom: 16px;
    line-height: 1.6;
}

.sri-panel__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.sri-panel__table th {
    text-align: left;
    color: var(--text-sec);
    font-weight: 600;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}

.sri-panel__table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    vertical-align: top;
}

.sri-panel__table td:first-child {
    color: var(--text-acc);
    font-family: monospace;
    white-space: nowrap;
    padding-right: 16px;
}

.sri-panel__table td:last-child {
    font-family: monospace;
    color: var(--text-sec);
    word-break: break-all;
}

/* ── Server public key transparency panel ─────────────────────────────────── */
.pubkey-panel {
    margin-bottom: 16px;
}

.pubkey-panel__label {
    color: var(--text-acc);
    font-family: monospace;
    white-space: nowrap;
    padding-right: 16px;
    vertical-align: top;
    width: 220px;
}

.pubkey-panel__value {
    font-family: monospace;
    color: var(--accent-lite);
    word-break: break-all;
    user-select: all;
    font-size: 0.72rem;
    line-height: 1.6;
}

.pubkey-panel__ephemeral {
    display: block;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-sec);
}


.sri-warning {
    background: rgba(239,68,68,.12);
    border: 1px solid var(--error);
    color: var(--error);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin: 12px 16px 0;
    font-size: 0.88rem;
    line-height: 1.5;
}

.sri-warning__title {
    font-weight: 700;
    margin-bottom: 4px;
}

/* ── SRI ok badge – session page topbar ─────────────────────────────────── */
.sri-ok-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--success);
    padding: 2px 8px;
    border: 1px solid var(--success);
    border-radius: 100px;
    white-space: nowrap;
    opacity: 0.85;
}

/* ── section shared ──────────────────────────────────────────────────────── */
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-pri);
    margin-bottom: 24px;
}

/* ── features grid ───────────────────────────────────────────────────────── */
.features {
    width: 100%;
    max-width: 800px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.feature-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-icon  { font-size: 1.8rem; line-height: 1; }
.feature-title { font-size: 0.95rem; font-weight: 700; }
.feature-desc  { color: var(--text-sec); font-size: 0.85rem; line-height: 1.55; }

/* ── how it works ────────────────────────────────────────────────────────── */
.how-it-works {
    width: 100%;
    max-width: 800px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.step {
    background: var(--bg-card-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.step__title { font-size: 0.95rem; font-weight: 700; }
.step__desc  { color: var(--text-sec); font-size: 0.85rem; line-height: 1.55; }
.step__desc code {
    background: rgba(255,255,255,.07);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.8rem;
}

/* ── comparison table ────────────────────────────────────────────────────── */
.comparison {
    width: 100%;
    max-width: 800px;
}

.comparison__intro {
    text-align: center;
    color: var(--text-sec);
    font-size: 0.9rem;
    margin-top: -12px;
    margin-bottom: 20px;
}

.comparison-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 480px;
}

.comparison-table th,
.comparison-table td {
    padding: 10px 14px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    text-align: left;
    color: var(--text-sec);
    min-width: 180px;
}

.comparison-table thead th {
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-sec);
    background: var(--bg-card);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table tbody tr:hover td { background: rgba(255,255,255,.02); }

.col-us { background: rgba(124,58,237,.08); }
.comparison-table thead th.col-us {
    background: rgba(124,58,237,.18);
    color: var(--accent-lite);
}

.cmp-yes    { color: var(--success); font-weight: 700; }
.cmp-no     { color: var(--error); opacity: 0.75; }
.cmp-partial { color: #f59e0b; font-weight: 700; }

/* ── ═══════════════════  SESSION PAGE  ═══════════════════ ──────────────── */

/* Prevent body-level scroll on the session page (e.g. from virtual keyboard or browser chrome). */
.session-body {
    overflow: hidden;
    height: 100%;
}

.session-layout {
    display: flex;
    flex-direction: column;
    height: var(--session-layout-height, 100dvh);
    position: fixed;
    top: var(--session-layout-top, 0px);
    left: 0;
    right: 0;
    overflow: hidden;
}

/* top bar */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.topbar__brand {
    font-weight: 800;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--accent-lite), #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.topbar__session-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-sec);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__peers {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--text-acc);
    white-space: nowrap;
}

/* share bar – two-row layout (link row + controls row) stacked on mobile;
   on wider screens the inner rows become transparent (`display: contents`)
   so all buttons flow into a single flex line, preserving the desktop look. */
.sharebar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card-alt);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sharebar__link-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sharebar__ctrl-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* on wider screens collapse both rows into a single flex line */
@media (min-width: 641px) {
    .sharebar {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    .sharebar__link-row,
    .sharebar__ctrl-row {
        display: contents; /* transparent to the parent flex container */
    }
}

.sharebar__label {
    font-size: 0.78rem;
    color: var(--text-sec);
    white-space: nowrap;
}

.sharebar__input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.78rem;
    color: var(--text-sec);
    font-family: monospace;
    outline: none;
    min-width: 0;
}

.sharebar__copy {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 0.78rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s;
}
.sharebar__copy:hover { background: var(--accent-h); }

/* Refresh invite link button – neutral (secondary) style */
.sharebar__refresh {
    background: var(--bg-card);
    color: var(--text-sec);
    border: 1px solid var(--border);
}
.sharebar__refresh:hover { background: rgba(124,58,237,.15); color: var(--text-pri); border-color: var(--accent); }
.sharebar__refresh[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Privacy mode button: neutral (off) and active (on) states */
.sharebar__privacy {
    background: var(--bg-card);
    color: var(--text-sec);
    border: 1px solid var(--border);
}
.sharebar__privacy:hover { background: rgba(124,58,237,.15); color: var(--text-pri); border-color: var(--accent); }
.sharebar__privacy--active {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.sharebar__privacy--active:hover { background: #0d9e6e; border-color: #0d9e6e; }
.sharebar__privacy--pending {
    background: #b45309;
    color: #fff;
    border-color: #b45309;
    opacity: 0.85;
    cursor: wait;
}
.sharebar__privacy--pending:hover { background: #92400e; border-color: #92400e; }

/* Verify button – neutral until handshake completes, then accent */
.sharebar__verify {
    background: var(--bg-card);
    color: var(--text-sec);
    border: 1px solid var(--border);
}
.sharebar__verify:not([disabled]):hover { background: rgba(124,58,237,.15); color: var(--text-pri); border-color: var(--accent); }
.sharebar__verify[disabled] { opacity: 0.45; cursor: not-allowed; }
.sharebar__verify--ready {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.sharebar__verify--ready:hover { background: var(--accent-h) !important; }

.sharebar__lock {
    background: var(--bg-card);
    color: var(--text-sec);
    border: 1px solid var(--border);
}
.sharebar__lock:hover { background: rgba(220,38,38,.12); color: #ef4444; border-color: #ef4444; }
.sharebar__lock--locked {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    cursor: default;
}
.sharebar__lock--locked:hover { background: #b91c1c; border-color: #b91c1c; }

/* chat area */
#chat-area {
    flex: 1;
    min-height: 0; /* critical: allows flex child to shrink below content size */
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

/* scrollbar */
#chat-area::-webkit-scrollbar { width: 6px; }
#chat-area::-webkit-scrollbar-track { background: transparent; }
#chat-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* messages */
.msg {
    display: flex;
    flex-direction: column;
    max-width: 72%;
}
.msg--own { align-self: flex-end; align-items: flex-end; }
.msg--peer { align-self: flex-start; align-items: flex-start; }

.msg__bubble {
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    font-size: 0.93rem;
    line-height: 1.5;
    word-break: break-word;
}
.msg--own  .msg__bubble { background: var(--bg-msg-own);  border-bottom-right-radius: var(--radius-sm); }
.msg--peer .msg__bubble { background: var(--bg-msg-peer); border-bottom-left-radius: var(--radius-sm); }

.msg__meta {
    font-size: 0.72rem;
    color: var(--text-sec);
    margin-top: 3px;
    padding: 0 4px;
}

/* system messages */
.sys-msg {
    align-self: center;
    font-size: 0.78rem;
    color: var(--text-sec);
    background: rgba(255,255,255,.04);
    border-radius: 100px;
    padding: 4px 14px;
    text-align: center;
}

/* fatal error */
.fatal-error {
    align-self: center;
    background: rgba(239,68,68,.12);
    border: 1px solid var(--error);
    color: var(--error);
    border-radius: var(--radius-md);
    padding: 20px 28px;
    margin: auto;
    text-align: center;
    font-size: 0.95rem;
    max-width: 480px;
}

/* file cards */
.file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    min-width: 0;
    max-width: 100%;
}

.file-card__icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }

.file-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.file-card__name {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card__size { font-size: 0.78rem; color: var(--text-sec); }

.file-card__dl {
    flex-shrink: 0;
    padding: 6px 14px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}
.file-card__dl:hover { background: var(--accent-h); text-decoration: none; }

/* file upload progress bar (shown while sending) */
.file-card__progress-wrap {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.file-card__progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.15s ease;
}

/* file offer accept/decline buttons */
.file-card__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

.file-card__accept {
    padding: 6px 14px;
    background: var(--success);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s;
}
.file-card__accept:hover { filter: brightness(1.1); }

.file-card__decline {
    padding: 6px 14px;
    background: transparent;
    color: var(--text-sec);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.file-card__decline:hover { border-color: var(--error); color: var(--error); }

/* cancel button for in-progress transfers and pending offers */
.file-card__cancel {
    flex-shrink: 0;
    background: transparent;
    color: var(--text-sec);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 9px;
    font-size: 0.78rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.file-card__cancel:hover { border-color: var(--error); color: var(--error); }

/* ads – home page */
.ads-section {
    width: 100%;
    max-width: 680px;
}

.ads-section__title {
    margin-bottom: 12px;
}

.ads-section__copy {
    text-align: center;
    color: var(--text-sec);
    font-size: 0.85rem;
    line-height: 1.55;
    margin-bottom: 16px;
}

.ads-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
}

.ads-grid__unit {
    min-height: 90px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* input bar */
.inputbar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

#msg-input {
    flex: 1;
    resize: none;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-pri);
    font-size: 0.93rem;
    font-family: inherit;
    outline: none;
    min-height: 42px;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
    transition: border-color 0.15s;
    field-sizing: content; /* modern auto-resize (Chrome 123+) */
}
#msg-input:focus { border-color: var(--accent); }
#msg-input::placeholder { color: var(--text-sec); }

#send-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1.5;
}
#send-btn:hover { background: var(--accent-h); }

#attach-btn {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-sec);
    font-size: 1.2rem;
    padding: 8px 12px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s, border-color 0.15s;
}
#attach-btn:hover { color: var(--text-pri); border-color: var(--accent); }

/* ── QR code modal ────────────────────────────────────────────────────────── */
.qr-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

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

.qr-modal__box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    max-height: 90vh;
    overflow-y: auto;
    width: 92%;
}

.qr-modal__hint {
    font-size: 0.85rem;
    color: var(--text-sec);
    text-align: center;
}

.qr-modal__canvas {
    border-radius: var(--radius-sm);
    display: block;
    max-width: 100%;
    height: auto;
}

.qr-modal__close {
    padding: 7px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-sec);
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.qr-modal__close:hover { border-color: var(--accent); color: var(--text-pri); }

/* ── Key verification modal ────────────────────────────────────────────────── */
.verify-modal__box {
    max-width: 400px;
    width: 96%;
    max-height: 90vh;
    overflow-y: auto;
}

.verify-modal__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-pri);
    text-align: center;
}

.verify-modal__number {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent-lite);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    user-select: all;
}

.verify-modal__qr-hint {
    font-size: 0.78rem;
    margin-top: -8px;
}

.verify-modal__keys {
    width: 100%;
    margin-top: 12px;
}

.verify-modal__keys-label {
    font-size: 0.78rem;
    color: var(--text-sec);
    margin: 8px 0 4px;
    text-align: left;
}

.verify-modal__keys-label--peer {
    margin-top: 12px;
}

.verify-modal__pubkey {
    font-family: monospace;
    font-size: 0.72rem;
    word-break: break-all;
    color: var(--accent-lite);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    user-select: all;
    text-align: left;
    line-height: 1.6;
}

/* ── responsive tweaks ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .msg { max-width: 92%; }
    .topbar__session-id { display: none; }
    .sharebar { padding: 6px 10px; gap: 4px; }
    .sharebar__label { display: none; }
    .sharebar__ctrl-row { gap: 4px; }
    .sharebar__ctrl-row .sharebar__copy { padding: 5px 9px; font-size: 0.74rem; }
    .inputbar { padding: 8px 10px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); gap: 6px; }

    /* file cards: wrap action buttons beneath the file info on narrow screens */
    .file-card { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
    .file-card__actions { width: 100%; justify-content: flex-end; }
    .file-card__dl { align-self: flex-end; }

    /* modals: reduce padding on very narrow screens */
    .qr-modal__box { padding: 20px 16px 16px; }
    .verify-modal__number { font-size: 1.2rem; padding: 10px 12px; }
}

/* ── Cryptographic details modal ────────────────────────────────────────────── */
.crypto-modal__box {
    max-width: 420px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
}

.crypto-modal__content {
    width: 100%;
    text-align: left;
}

.crypto-modal__dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    margin: 0;
    font-size: 0.82rem;
}

.crypto-modal__dl dt {
    color: var(--text-sec);
    white-space: nowrap;
    align-self: start;
    padding-top: 2px;
}

.crypto-modal__dl dd {
    color: var(--text-pri);
    margin: 0;
    font-weight: 500;
}

.crypto-modal__mono {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--accent-lite);
}

.crypto-modal__pubkey {
    word-break: break-all;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    user-select: all;
    line-height: 1.6;
}
