:root {
    --ink: #182125;
    --muted: #5a6870;
    --paper: #f7f4ec;
    --panel: #fffdf8;
    --line: #d9d2c3;
    --teal: #157a77;
    --sea: #bfe4de;
    --coral: #d95d39;
    --amber: #edb34f;
    --green: #2f8f5b;
    --shadow: 0 20px 50px rgba(24, 33, 37, 0.18);
}

.satisfaction-feedback {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 700px;
    margin: 0 auto 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
}
.satisfaction-feedback[hidden],
.satisfaction-feedback [hidden],
body.text-fullscreen .satisfaction-feedback { display: none !important; }
.satisfaction-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.satisfaction-heading h2 { margin: 0; font-size: 1.05rem; }
.satisfaction-feedback p { margin: 8px 0; line-height: 1.45; }
.satisfaction-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.satisfaction-choices button {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    min-width: 0; min-height: 84px; padding: 10px 4px; border: 1px solid var(--line);
    border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; font-size: .85rem;
    overflow-wrap: anywhere; cursor: pointer;
}
.satisfaction-choices button[aria-pressed="true"] { border-color: var(--teal); background: #e8f4ef; }
.satisfaction-choices button:focus-visible, .satisfaction-link:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.satisfaction-choices button:disabled { cursor: default; }
.satisfaction-choices svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.satisfaction-choices [data-rating="good"] svg { color: var(--green); }
.satisfaction-choices [data-rating="neutral"] svg { color: var(--muted); }
.satisfaction-choices [data-rating="bad"] svg { color: var(--coral); }
.satisfaction-link { border: 0; padding: 4px 0; background: none; color: var(--teal); font: inherit; text-decoration: underline; cursor: pointer; }
.satisfaction-status { min-height: 1.4em; color: var(--muted); }
.satisfaction-feedback form { display: grid; gap: 8px; margin-top: 10px; }
.satisfaction-feedback textarea { width: 100%; min-height: 90px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 16px; }
.satisfaction-feedback form button { justify-self: start; }
.satisfaction-privacy, .satisfaction-full { font-size: .8rem; color: var(--muted); }
.satisfaction-full { display: inline-block; margin-top: 10px; }

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

html.text-fullscreen {
    width: 100%;
    height: 100%;
    max-width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: "IcyZip Inter Variable", "IcyZip Inter", sans-serif;
    background:
        linear-gradient(135deg, rgba(21, 122, 119, 0.18), rgba(217, 93, 57, 0.08) 42%, rgba(237, 179, 79, 0.14)),
        repeating-linear-gradient(90deg, rgba(24, 33, 37, 0.045) 0, rgba(24, 33, 37, 0.045) 1px, transparent 1px, transparent 42px),
        repeating-linear-gradient(0deg, rgba(24, 33, 37, 0.035) 0, rgba(24, 33, 37, 0.035) 1px, transparent 1px, transparent 42px),
        var(--paper);
}

html.text-fullscreen body,
body.text-fullscreen {
    width: 100%;
    height: 100%;
    max-width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body.text-fullscreen .pair-panel {
    overflow: hidden;
    overflow: clip;
    backdrop-filter: none;
}

body.text-fullscreen .transfer-rail {
    display: none;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background:
        linear-gradient(110deg, transparent 0 12%, rgba(255, 255, 255, 0.44) 12% 13%, transparent 13% 100%),
        linear-gradient(72deg, transparent 0 55%, rgba(21, 122, 119, 0.15) 55% 56%, transparent 56% 100%),
        linear-gradient(155deg, transparent 0 74%, rgba(217, 93, 57, 0.12) 74% 75%, transparent 75% 100%);
}

.icyzip-shell {
    width: min(1180px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 0 24px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
}

.topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.language-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.language-select {
    min-height: 36px;
    max-width: 132px;
    padding: 6px 28px 6px 10px;
    color: var(--ink);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 800;
    background: rgba(255, 253, 248, 0.82);
    border: 1px solid rgba(24, 33, 37, 0.14);
    border-radius: 7px;
    box-shadow: 0 10px 30px rgba(24, 33, 37, 0.08);
}

.language-select:focus {
    border-color: var(--teal);
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 122, 119, 0.14);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: #fffdf8;
    font-weight: 800;
    background:
        linear-gradient(140deg, var(--teal), #244f5f 54%, var(--coral));
    border: 1px solid rgba(24, 33, 37, 0.16);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(21, 122, 119, 0.24);
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 800;
}

.state-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 132px;
    justify-content: center;
    padding: 10px 14px;
    color: var(--muted);
    background: rgba(255, 253, 248, 0.72);
    border: 1px solid rgba(24, 33, 37, 0.12);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(24, 33, 37, 0.08);
}

.state-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(237, 179, 79, 0.16);
}

body[data-ws-state="ready"] .state-dot,
body[data-ws-state="connected"] .state-dot {
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(47, 143, 91, 0.16);
}

body[data-ws-state="error"] .state-dot,
body[data-ws-state="unavailable"] .state-dot,
body[data-ws-state="expired"] .state-dot,
body[data-ws-state="disconnected"] .state-dot,
body[data-ws-state="key-missing"] .state-dot,
body[data-ws-state="key-mismatch"] .state-dot {
    background: var(--coral);
    box-shadow: 0 0 0 4px rgba(217, 93, 57, 0.16);
}

.app-purpose {
    margin: 16px 0 0;
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.35;
}

.app-purpose + .workspace {
    margin-top: 16px;
}

body.text-fullscreen .app-purpose {
    display: none;
}

.workspace {
    display: block;
    margin-top: 36px;
}

.pair-panel {
    background: rgba(255, 253, 248, 0.88);
    border: 1px solid rgba(24, 33, 37, 0.12);
    border-radius: 8px;
    box-shadow: var(--shadow);
    /* Moving media otherwise repaints this large software blur every frame. */
    backdrop-filter: none;
}

.pair-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(230px, 0.7fr) minmax(340px, 1fr);
    grid-template-areas:
        "copy exchange"
        "rail exchange"
        "messages exchange";
    gap: 24px;
    overflow: hidden;
    overflow: clip;
    min-height: 560px;
    padding: 28px;
}

.pair-copy {
    position: relative;
    z-index: 1;
    grid-area: copy;
}

.pair-panel::after {
    position: absolute;
    right: -70px;
    bottom: -80px;
    width: 240px;
    height: 240px;
    content: "";
    background:
        repeating-linear-gradient(45deg, rgba(21, 122, 119, 0.18) 0 8px, transparent 8px 18px),
        linear-gradient(135deg, rgba(237, 179, 79, 0.3), rgba(217, 93, 57, 0.22));
    border: 1px solid rgba(24, 33, 37, 0.06);
    border-radius: 50%;
    opacity: 0.55;
}

.section-kicker {
    margin-bottom: 10px;
    color: var(--coral);
    font-size: 0.82rem;
    font-weight: 800;
}

h1 {
    margin: 0 0 12px;
    font-size: 3.1rem;
    line-height: 1;
}

.pair-subtitle {
    max-width: 27rem;
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
}

.source-review {
    max-width: 30rem;
    margin: 0 0 20px;
    padding: 14px 16px;
    color: var(--ink);
    background: rgba(191, 228, 222, 0.35);
    border: 1px solid rgba(21, 122, 119, 0.24);
    border-left: 4px solid var(--teal);
    border-radius: 8px;
    overflow-wrap: break-word;
}

.source-review h2 {
    margin: 0 0 8px;
    font-size: 1.04rem;
    line-height: 1.3;
}

.source-review p {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.source-review-links a {
    display: inline-block;
    max-width: 100%;
    margin-right: 12px;
    padding: 5px 0;
    color: #126664;
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.4;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.source-review-links a:hover {
    color: var(--ink);
}

.source-review-links a:focus {
    outline: 2px solid var(--teal);
    outline-offset: 3px;
}

.flow-visual {
    position: relative;
    z-index: 1;
    margin: 0 0 18px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(191, 228, 222, 0.78), rgba(255, 253, 248, 0.82) 52%, rgba(237, 179, 79, 0.24));
    border: 1px solid rgba(24, 33, 37, 0.12);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.flow-visual img,
.flow-visual video {
    display: block;
    width: 100%;
    height: auto;
}

.flow-visual [hidden] {
    display: none;
}

.qr-frame {
    position: relative;
    z-index: 1;
    grid-area: exchange;
    display: grid;
    min-height: 540px;
    place-items: center;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 253, 248, 0.66)),
        var(--sea);
    border: 1px solid rgba(24, 33, 37, 0.12);
    border-radius: 8px;
}

.qr-frame > * {
    grid-area: 1 / 1;
}

.pairing-start,
.pair-qr-intro {
    display: grid;
    width: min(100%, 520px);
    justify-items: center;
    gap: 18px;
}

.pair-scan-intro {
    display: none;
    width: 100%;
    justify-items: center;
    gap: 12px;
}

.pair-scan-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 8px;
    color: var(--teal);
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pair-scan-intro .pair-link-action {
    width: 100%;
    min-height: 48px;
}

body[data-pair-view="scan"] .pair-scan-intro {
    display: grid;
}

body[data-pair-view="scan"] .pair-qr-intro {
    display: none;
}

.pairing-instruction {
    max-width: 370px;
    text-align: center;
}

.pairing-instruction h2 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 1.24rem;
    line-height: 1.2;
}

.pairing-instruction p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.35;
}

.pairing-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
}

.pair-link-action {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    color: #fffdf8;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 850;
    background: var(--teal);
    border: 0;
    border-radius: 7px;
    box-shadow: 0 8px 18px rgba(21, 122, 119, 0.18);
    cursor: pointer;
}

.pair-link-action:hover,
.pair-link-action:focus {
    background: #244f5f;
    outline: none;
}

.pair-link-action:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 3px;
}

.pair-link-action:disabled {
    color: rgba(255, 253, 248, 0.76);
    background: rgba(24, 33, 37, 0.38);
    box-shadow: none;
    cursor: not-allowed;
}

.pair-scan-action,
.connection-scan-action {
    color: var(--teal);
    background: rgba(255, 253, 248, 0.92);
    border: 1px solid rgba(21, 122, 119, 0.38);
}

.pair-scan-action:hover,
.pair-scan-action:focus,
.connection-scan-action:hover,
.connection-scan-action:focus {
    color: #fffdf8;
    background: var(--teal);
}

.connection-scan-action {
    margin: 18px auto 0;
}

.qr-target {
    display: grid;
    min-width: 256px;
    min-height: 256px;
    place-items: center;
    color: var(--teal);
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
}

body[data-ws-state="connecting"] .qr-target,
body[data-ws-state="open"] .qr-target,
body[data-ws-state="connected"] .qr-target,
body[data-ws-state="peer-offline"] .qr-target,
body[data-ws-state="unavailable"] .qr-target,
body[data-ws-state="expired"] .qr-target,
body[data-ws-state="disconnected"] .qr-target,
body[data-ws-state="replaced"] .qr-target,
body[data-ws-state="key-missing"] .qr-target,
body[data-ws-state="key-mismatch"] .qr-target {
    display: none;
}

body[data-ws-state="connecting"] .pairing-start,
body[data-ws-state="open"] .pairing-start,
body[data-ws-state="connected"] .pairing-start,
body[data-ws-state="peer-offline"] .pairing-start,
body[data-ws-state="unavailable"] .pairing-start,
body[data-ws-state="expired"] .pairing-start,
body[data-ws-state="disconnected"] .pairing-start,
body[data-ws-state="replaced"] .pairing-start,
body[data-ws-state="key-missing"] .pairing-start,
body[data-ws-state="key-mismatch"] .pairing-start {
    display: none;
}

.qr-target canvas,
.qr-target img {
    display: block;
    width: 256px;
    height: 256px;
    background: #fff;
    border: 12px solid #fff;
    border-radius: 6px;
    box-shadow: 0 18px 32px rgba(24, 33, 37, 0.16);
}

.connection-notice {
    display: none;
    max-width: 360px;
    padding: 26px;
    text-align: center;
}

body[data-ws-state="connecting"] .connection-notice,
body[data-ws-state="open"] .connection-notice,
body[data-ws-state="error"] .connection-notice,
body[data-ws-state="unavailable"] .connection-notice,
body[data-ws-state="expired"] .connection-notice,
body[data-ws-state="disconnected"] .connection-notice,
body[data-ws-state="replaced"] .connection-notice,
body[data-ws-state="key-missing"] .connection-notice,
body[data-ws-state="key-mismatch"] .connection-notice {
    display: block;
}

body[data-ws-state="replaced"] .connection-scan-action {
    display: none;
}

.connection-wait {
    color: #394b57;
    font-size: .875rem;
    flex: 0 0 auto;
}

.connection-wait:not(:empty) {
    margin-block: .375rem;
}

/* In fullscreen only the editor region is visible, including in its file view. */
body:not(.text-fullscreen):not([data-ws-state="connected"]) #editorConnectionWait {
    display: none;
}

.connection-notice-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    color: var(--teal);
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.connection-notice h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.connection-notice p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.qr-scanner {
    position: relative;
    z-index: 4;
    display: grid;
    width: min(100%, 420px);
    justify-items: center;
    gap: 14px;
    padding: 18px;
    text-align: center;
    background: rgba(255, 253, 248, 0.98);
    border: 1px solid rgba(24, 33, 37, 0.16);
    border-radius: 9px;
    box-shadow: 0 18px 42px rgba(24, 33, 37, 0.2);
}

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

body:not([data-ws-state="ready"]) #qrScannerShowQr,
.qr-scanner video[hidden] {
    display: none;
}

.qr-scanner h2,
.qr-scanner p {
    margin: 0;
}

.qr-scanner p {
    color: var(--muted);
    font-weight: 700;
}

.qr-scanner video {
    display: block;
    width: min(100%, 340px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #172024;
    border-radius: 8px;
}

.scanner-report {
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid rgba(24, 33, 37, 0.16);
    overflow-wrap: anywhere;
}

.scanner-report summary { cursor: pointer; }
.scanner-report p { margin: 10px 0; font-weight: 400; font-size: 0.875rem; }

body[data-qr-scanner="active"] .pairing-start,
body[data-qr-scanner="active"] .connection-notice {
    visibility: hidden;
    pointer-events: none;
}

.transfer-rail {
    position: relative;
    z-index: 1;
    grid-area: rail;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 26px;
}

.transfer-rail span {
    display: block;
    height: 9px;
    background: var(--line);
    border-radius: 999px;
}

.transfer-rail span:nth-child(1) {
    background: var(--teal);
}

.transfer-rail span:nth-child(2) {
    background: var(--sea);
}

.transfer-rail span:nth-child(3) {
    background: var(--amber);
}

.transfer-rail span:nth-child(4) {
    background: var(--coral);
}

.transfer-rail span:nth-child(5) {
    background: var(--green);
}

.messages {
    position: relative;
    z-index: 1;
    grid-area: messages;
    min-height: 34px;
    margin-top: 22px;
    color: var(--muted);
}

.text-panel {
    position: relative;
    z-index: 1;
    display: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

body[data-ws-state="connected"] .text-panel,
body[data-ws-state="peer-offline"] .text-panel {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

body[data-ws-state="connected"] .pair-panel,
body[data-ws-state="peer-offline"] .pair-panel {
    grid-template-columns: minmax(150px, 0.28fr) minmax(0, 1fr);
    grid-template-areas:
        "copy exchange"
        "messages exchange";
    gap: 18px;
}

body[data-ws-state="connected"] .pair-subtitle,
body[data-ws-state="connected"] .source-review,
body[data-ws-state="connected"] .flow-visual,
body[data-ws-state="connected"] .transfer-rail,
body[data-ws-state="peer-offline"] .pair-subtitle,
body[data-ws-state="peer-offline"] .source-review,
body[data-ws-state="peer-offline"] .flow-visual,
body[data-ws-state="peer-offline"] .transfer-rail {
    display: none;
}

body[data-ws-state="connected"] .pair-copy h1,
body[data-ws-state="peer-offline"] .pair-copy h1 {
    margin-bottom: 0;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    line-height: 1.05;
}

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

.text-label {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
}

.text-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.text-action-status {
    margin: 0 0 10px;
    padding: 9px 11px;
    color: #244f5f;
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.35;
    background: rgba(21, 122, 119, 0.1);
    border: 1px solid rgba(21, 122, 119, 0.24);
    border-radius: 7px;
}

.text-action-status[hidden] {
    display: none;
}

.text-action-status[data-tone="success"] {
    color: #285b42;
    background: rgba(73, 139, 87, 0.12);
    border-color: rgba(73, 139, 87, 0.28);
}

.text-action-status[data-tone="warning"] {
    color: #6a3f13;
    background: rgba(237, 179, 79, 0.16);
    border-color: rgba(237, 179, 79, 0.36);
}

.text-connection-notice {
    display: none;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 9px 11px;
    color: #6a3f13;
    font-size: 0.9rem;
    font-weight: 800;
    background: rgba(237, 179, 79, 0.16);
    border: 1px solid rgba(237, 179, 79, 0.34);
    border-radius: 7px;
}

body[data-ws-state="peer-offline"] .text-connection-notice {
    display: flex;
}

.text-connection-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.text-action {
    min-height: 34px;
    padding: 7px 11px;
    color: var(--ink);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(247, 244, 236, 0.88));
    border: 1px solid rgba(24, 33, 37, 0.18);
    border-radius: 7px;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(24, 33, 37, 0.08);
}

.text-action[hidden] {
    display: none;
}

.text-action:disabled {
    color: rgba(24, 33, 37, 0.48);
    cursor: not-allowed;
    background: rgba(236, 233, 225, 0.72);
    border-color: rgba(24, 33, 37, 0.12);
    box-shadow: none;
}

.text-action:disabled:hover,
.text-action:disabled:focus,
.text-action:disabled:active {
    border-color: rgba(24, 33, 37, 0.12);
    outline: none;
    box-shadow: none;
    transform: none;
}

.text-action:hover,
.text-action:focus {
    border-color: var(--teal);
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 122, 119, 0.14);
}

.text-action:active {
    transform: translateY(1px);
}

.text-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding-right: 9px;
    padding-left: 9px;
}

.action-icon {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.text-action-fullscreen .fullscreen-icon-exit,
.text-action-fullscreen.is-fullscreen-active .fullscreen-icon-enter {
    display: none;
}

.text-action-fullscreen.is-fullscreen-active .fullscreen-icon-exit {
    display: block;
}

.text-action-danger {
    color: #fffdf8;
    background:
        linear-gradient(180deg, rgba(217, 93, 57, 0.95), rgba(150, 55, 38, 0.92));
    border-color: rgba(112, 38, 26, 0.34);
}

.text-action-danger:hover,
.text-action-danger:focus {
    border-color: rgba(112, 38, 26, 0.72);
    box-shadow: 0 0 0 3px rgba(217, 93, 57, 0.16);
}

.text-action-file-toggle,
.file-text-toggle {
    display: none;
}

#textArea {
    width: 100%;
    min-height: 290px;
    flex: 1;
    resize: vertical;
    padding: 24px;
    color: var(--ink);
    font: 1.05rem/1.55 ui-monospace, monospace;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.92), rgba(247, 244, 236, 0.88));
    border: 1px solid rgba(24, 33, 37, 0.18);
    border-radius: 8px;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

#textArea:focus {
    border-color: var(--teal);
    box-shadow:
        0 0 0 4px rgba(21, 122, 119, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

#textArea::placeholder {
    color: var(--muted);
    opacity: 1;
}

body.text-fullscreen .text-panel {
    --fullscreen-pad: clamp(10px, 2.2vw, 28px);

    position: fixed;
    top: var(--text-viewport-top, 0px);
    right: auto;
    bottom: auto;
    left: var(--text-viewport-left, 0px);
    z-index: 1000;
    width: var(--text-viewport-width, 100vw);
    max-width: var(--text-viewport-width, 100vw);
    height: var(--text-viewport-height, 100vh);
    max-height: var(--text-viewport-height, 100vh);
    min-height: 0;
    padding: var(--fullscreen-pad);
    padding:
        calc(var(--fullscreen-pad) + env(safe-area-inset-top))
        calc(var(--fullscreen-pad) + env(safe-area-inset-right))
        calc(var(--fullscreen-pad) + env(safe-area-inset-bottom))
        calc(var(--fullscreen-pad) + env(safe-area-inset-left));
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(247, 244, 236, 0.96));
}

@supports (height: 100dvh) {
    body.text-fullscreen .text-panel {
        height: var(--text-viewport-height, 100dvh);
        max-height: var(--text-viewport-height, 100dvh);
    }
}

body.text-fullscreen .section-kicker,
body.text-fullscreen .file-panel {
    display: none;
}

body.text-fullscreen .text-panel-head {
    flex: 0 0 auto;
}

body.text-fullscreen #textArea {
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    resize: none;
}

body.text-fullscreen.text-viewport-short .text-panel {
    --fullscreen-pad: 6px;
}

body.text-fullscreen.text-viewport-short .text-panel-head {
    gap: 6px;
    margin-bottom: 6px;
}

body.text-fullscreen.text-viewport-short #textArea {
    padding-top: 6px;
    padding-bottom: 6px;
}

body[data-file-transfer="enabled"].text-fullscreen .text-action-file-toggle,
body.text-fullscreen[data-fullscreen-panel="file"] .file-text-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.text-fullscreen[data-fullscreen-panel="file"] .text-panel-head,
body.text-fullscreen[data-fullscreen-panel="file"] #textArea {
    display: none;
}

body[data-file-transfer="enabled"].text-fullscreen[data-fullscreen-panel="file"] .file-panel {
    display: flex;
    max-width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    margin-top: 0;
    overflow: hidden;
}

body.text-fullscreen[data-fullscreen-panel="file"] .file-panel-head,
body.text-fullscreen[data-fullscreen-panel="file"] .file-progress-row,
body.text-fullscreen[data-fullscreen-panel="file"] .file-download {
    flex: 0 0 auto;
}

.file-panel {
    display: none;
    margin-top: 14px;
    padding: 14px;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.94), rgba(247, 244, 236, 0.88));
    border: 1px solid rgba(24, 33, 37, 0.14);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body[data-file-transfer="enabled"] .file-panel {
    display: block;
}

body[data-file-transfer="enabled"].text-fullscreen[data-fullscreen-panel="text"] .file-panel {
    display: none;
}

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

.file-label {
    font-size: 1rem;
    font-weight: 800;
}

.file-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.file-input {
    max-width: 230px;
    color: var(--ink);
    font: inherit;
    font-size: 0.82rem;
}

.file-progress-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(120px, auto);
    align-items: center;
    gap: 12px;
}

#fileProgress {
    width: 100%;
    height: 14px;
    accent-color: var(--teal);
}

#fileStatus {
    min-width: 120px;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-align: right;
}

.file-download {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin-top: 12px;
    padding: 7px 11px;
    color: #fffdf8;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
    background:
        linear-gradient(180deg, rgba(47, 143, 91, 0.95), rgba(32, 104, 68, 0.92));
    border: 1px solid rgba(24, 84, 52, 0.34);
    border-radius: 7px;
    box-shadow: 0 8px 18px rgba(24, 33, 37, 0.08);
}

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

.help-section {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(24, 33, 37, 0.12);
}

body.text-fullscreen .help-section {
    display: none;
}

.help-section h2 {
    max-width: 44rem;
    margin: 0 0 12px;
    font-size: 1.42rem;
    line-height: 1.18;
}

.help-list {
    display: grid;
    gap: 0;
    border-top: 1px solid rgba(24, 33, 37, 0.12);
}

.help-item {
    padding: 14px 0;
    border-bottom: 1px solid rgba(24, 33, 37, 0.12);
}

.help-item summary {
    cursor: pointer;
    font-weight: 850;
    line-height: 1.35;
}

.help-item p {
    max-width: 54rem;
    margin: 10px 0 0;
    color: var(--muted);
    font-weight: 650;
    line-height: 1.55;
}

.help-pair-pictures {
    margin-top: 12px;
}

.help-pair-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 26px;
    margin: 12px 0 0;
    padding-left: 24px;
}

.help-pair-steps img {
    display: block;
    width: 100%;
    max-width: 560px;
    height: auto;
    border-radius: 8px;
}

@media (max-width: 740px) {
    .help-pair-steps {
        grid-template-columns: minmax(0, 1fr);
    }
}

.storage-action {
    margin-top: 12px;
    max-width: 100%;
    white-space: normal;
}

.forum-invitation {
    max-width: 54rem;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.forum-invitation a {
    color: var(--teal);
    font-weight: 700;
    text-underline-offset: 0.15em;
}

.legal-links {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-top: 18px;
    padding: 10px 14px;
    background: rgba(255, 253, 248, 0.78);
    border: 1px solid rgba(24, 33, 37, 0.12);
    border-radius: 999px;
    backdrop-filter: blur(10px);
}

.legal-links a {
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.legal-links a:hover,
.legal-links a:focus {
    color: var(--coral);
}

.powered-link {
    border-left: 1px solid rgba(24, 33, 37, 0.16);
    padding-left: 14px;
}

.managed-notice[hidden],
body.text-fullscreen .managed-notice {
    display: none;
}

.managed-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 20px auto 12px;
    padding: 12px 14px;
    max-width: 760px;
    color: var(--muted);
    background: rgba(255, 253, 248, 0.78);
    border: 1px solid rgba(24, 33, 37, 0.12);
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.managed-notice-content { min-width: 0; overflow-wrap: anywhere; }
.managed-notice-content > * { margin-right: 0.35em; }
.managed-notice-label { font-size: 0.75rem; }
.managed-notice a { color: var(--teal); font-weight: 700; }
.managed-notice button {
    flex: 0 0 auto;
    padding: 6px 8px;
    min-height: 36px;
    font: inherit;
    color: var(--ink);
    background: transparent;
    border: 1px solid rgba(24, 33, 37, 0.2);
    border-radius: 6px;
    cursor: pointer;
}
.managed-notice a:focus-visible, .managed-notice button:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 3px;
}

.recommendation {
    max-width: min(28rem, 100%);
    color: var(--ink);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.recommendation summary {
    cursor: pointer;
    font-weight: 700;
}

.recommendation p {
    margin: 0.7em 0;
    line-height: 1.5;
}

.recommendation button {
    margin: 0.7em;
    padding: 8px 12px;
    font: inherit;
    cursor: pointer;
}

.recommendation summary:focus-visible,
.recommendation button:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 3px;
}

#recommendStatus:empty {
    display: none;
}

@media (max-width: 700px) {
    .icyzip-shell {
        width: min(100% - 20px, 560px);
        padding-top: 16px;
        padding-bottom: 18px;
    }

    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .topbar-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .language-label {
        display: none;
    }

    .workspace {
        margin-top: 20px;
    }

    .pair-panel {
        grid-template-columns: 1fr;
        grid-template-areas:
            "exchange"
            "copy"
            "rail"
            "messages";
        gap: 16px;
        min-height: auto;
        padding: 20px;
    }

    body[data-ws-state="connected"] .pair-panel,
    body[data-ws-state="peer-offline"] .pair-panel {
        grid-template-areas:
            "exchange"
            "copy"
            "messages";
    }

    body[data-ws-state="key-missing"] .pair-panel,
    body[data-ws-state="key-mismatch"] .pair-panel {
        grid-template-areas:
            "exchange"
            "messages";
    }

    body[data-ws-state="key-missing"] .pair-copy,
    body[data-ws-state="key-mismatch"] .pair-copy,
    body[data-ws-state="key-missing"] .transfer-rail,
    body[data-ws-state="key-mismatch"] .transfer-rail {
        display: none;
    }

    body[data-ws-state="key-missing"] .qr-frame,
    body[data-ws-state="key-mismatch"] .qr-frame {
        min-height: 260px;
    }

    h1 {
        font-size: 2.4rem;
    }

    .qr-frame {
        min-height: 380px;
        padding: 14px;
    }

    .pairing-start {
        gap: 14px;
        align-self: start;
    }

    body:not([data-ws-state="connected"]):not([data-ws-state="peer-offline"]) .text-panel {
        display: none;
    }

    body:not([data-pair-view="qr"]) .pair-scan-intro {
        display: grid;
    }

    body:not([data-pair-view="qr"]) .pair-qr-intro {
        display: none;
    }

    .pairing-instruction h2 {
        font-size: 1.08rem;
    }

    .pairing-instruction p {
        margin-bottom: 10px;
        font-size: 0.88rem;
    }

    .qr-target {
        min-width: 216px;
        min-height: 216px;
    }

    .qr-target canvas,
    .qr-target img {
        width: 216px;
        height: 216px;
    }

    .text-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .text-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .text-action {
        min-width: 0;
        flex: 1 1 calc(50% - 8px);
    }

    body.text-fullscreen .text-panel {
        --fullscreen-pad: 10px;
    }

    body.text-fullscreen .text-panel-head {
        min-width: 0;
        gap: 8px;
        margin-bottom: 8px;
    }

    body.text-fullscreen .text-label {
        font-size: 0.95rem;
        line-height: 1.2;
    }

    body.text-fullscreen .text-actions {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    body.text-fullscreen .text-action {
        min-width: 0;
        min-height: 32px;
        padding: 7px 5px;
        overflow: hidden;
        font-size: 0.76rem;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #textArea {
        min-height: 240px;
        padding: 18px;
    }

    body.text-fullscreen #textArea {
        min-height: 0;
        padding: 12px;
        font-size: 16px;
        line-height: 1.45;
    }

    .file-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .file-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .file-input {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        flex: 1 1 100%;
    }

    .file-progress-row {
        grid-template-columns: 1fr;
    }

    #fileStatus {
        text-align: left;
    }

    .legal-links {
        display: flex;
        justify-content: center;
    }

    .powered-link {
        width: 100%;
        border-left: 0;
        padding-left: 0;
        text-align: center;
    }

    .help-section {
        margin-top: 22px;
        padding-top: 18px;
    }

    .help-section h2 {
        font-size: 1.18rem;
    }

    .help-item {
        padding: 13px 0;
    }
}
.pair-security {
    flex: 0 0 auto;
    font-size: 0.8rem;
}
.pair-security-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.pair-security-panel {
    max-height: 40vh;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0.5rem;
}
.pair-security-panel p { margin: 0 0 0.5rem; }
#pairSecurityCode {
    display: block;
    max-width: 29ch;
    margin: 0.5rem 0;
    font-family: monospace;
    font-size: 1rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
    user-select: all;
}
.pair-security[hidden], .pair-security-panel[hidden] { display: none; }
