/* ==========================================================================
   WebVNC — light application shell, dark viewport
   ========================================================================== */

:root {
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #eef2f8;
    --border: #e4e9f1;
    --border-strong: #d3dbe7;
    --text: #16202e;
    --text-2: #56677c;
    --text-3: #8b9cb0;
    --brand: #3b6ef5;
    --brand-ink: #2a56d6;
    --brand-soft: #eaf1ff;
    --danger: #e5484d;
    --danger-soft: #fdecec;
    --success: #12a150;
    --success-soft: #e8f8ee;
    --warn: #b7791f;
    --warn-soft: #fdf5e5;
    --stage: #0b0e14;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;

    --shadow-1: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow-2: 0 2px 4px rgba(16, 24, 40, .05), 0 12px 28px -14px rgba(16, 24, 40, .22);
    --shadow-3: 0 18px 48px -18px rgba(16, 24, 40, .32);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --topbar-h: 56px;
}

* { box-sizing: border-box; }

/*
 * The UA rule for [hidden] is only `display: none` at zero specificity, so any
 * class that sets a display value (.chip, .field, .card …) silently wins and
 * the element stays visible. This is the one place `!important` earns its keep.
 */
[hidden] { display: none !important; }

html, body {
    height: 100%;
    margin: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

kbd {
    font-family: var(--mono);
    font-size: 11px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 1px 5px;
    color: var(--text-2);
}

code { font-family: var(--mono); font-size: 12.5px; }

/* ---------------------------------------------------------------- layout */

.app {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 30;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: linear-gradient(145deg, var(--brand), #6f95ff);
    color: #fff;
    box-shadow: 0 4px 12px -4px rgba(59, 110, 245, .6);
}
.brand-mark svg { width: 17px; height: 17px; stroke-width: 2; }

.brand-name { font-weight: 680; letter-spacing: -.01em; font-size: 15px; }
.brand-sub {
    color: var(--text-3);
    font-size: 12px;
    padding-left: 10px;
    border-left: 1px solid var(--border);
    margin-left: 2px;
    white-space: nowrap;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: var(--r-pill);
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 550;
    white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; }
.chip-quiet { background: transparent; border-color: transparent; color: var(--text-3); }
.chip.is-ok { background: var(--success-soft); border-color: #c5ecd4; color: #0d7d3f; }
.chip.is-bad { background: var(--danger-soft); border-color: #f8d4d4; color: #c02b30; }

.main { flex: 1; min-height: 0; display: flex; }

.view { flex: 1; min-width: 0; min-height: 0; }
.view[hidden] { display: none; }

/* ------------------------------------------------------- connect view */

.view-connect { overflow-y: auto; padding: 32px 20px 64px; }

.connect-wrap {
    max-width: 620px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
    padding: 24px;
}

.card-head { margin-bottom: 18px; }
.card-head h1 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 680;
    letter-spacing: -.015em;
}
.card-head h2 { margin: 0; font-size: 14px; font-weight: 640; }
.card-head p { margin: 0; color: var(--text-2); font-size: 13px; }
.card-head.compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field.grow { flex: 1; min-width: 0; }
.field.port { width: 118px; flex: none; }
.field-row { display: flex; gap: 12px; }

.field-label {
    font-size: 12.5px;
    font-weight: 580;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 6px;
}
.field-label em { font-style: normal; color: var(--text-3); font-weight: 500; font-size: 11.5px; }
.field-label output {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--brand-ink);
    background: var(--brand-soft);
    padding: 0 6px;
    border-radius: 5px;
}

input[type="text"], input[type="password"], input[type="number"], select, textarea {
    width: 100%;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    padding: 9px 11px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; }

input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
    background: var(--surface);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(59, 110, 245, .16);
}

input[type="range"] {
    width: 100%;
    height: 22px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    padding: 0;
    border: 0;
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
    background: var(--border-strong);
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px; height: 15px;
    margin-top: -5.5px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--brand);
    box-shadow: var(--shadow-1);
    cursor: pointer;
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border-strong); }
input[type="range"]::-moz-range-thumb {
    width: 15px; height: 15px; border-radius: 50%;
    background: #fff; border: 2px solid var(--brand); cursor: pointer;
}

.hint { font-size: 11.5px; color: var(--text-3); }

/* details */
.advanced {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface-2);
    margin-bottom: 18px;
    overflow: hidden;
}
.advanced > summary {
    cursor: pointer;
    list-style: none;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 580;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary:hover { color: var(--text); background: var(--surface-3); }
.sum-icon { width: 15px; height: 15px; }
.advanced[open] > summary { border-bottom: 1px solid var(--border); }
.advanced-body { padding: 16px 14px 4px; }

/* switches */
.switch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    margin-bottom: 14px;
}
.switch {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
    flex: none;
    position: relative;
    width: 34px; height: 20px;
    margin-top: 1px;
    border-radius: var(--r-pill);
    background: var(--border-strong);
    transition: background .18s;
}
.switch .track::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .25);
    transition: transform .18s;
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(59, 110, 245, .22); }
.switch-text { display: flex; flex-direction: column; line-height: 1.35; color: var(--text); }
.switch-text em { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.switch-inline { margin: 0; align-items: center; font-size: 12.5px; }
.switch-inline .switch-text { flex-direction: row; }

/* buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 15px;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 570;
    cursor: pointer;
    white-space: nowrap;
    transition: background .14s, border-color .14s, box-shadow .14s, color .14s, transform .06s;
}
.btn:active { transform: translateY(.5px); }
.btn svg { width: 16px; height: 16px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(59, 110, 245, .25); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .1), 0 8px 18px -10px rgba(59, 110, 245, .8);
}
.btn-primary:hover { background: var(--brand-ink); }

.btn-secondary {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text-2);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--danger-soft); color: #c02b30; border-color: #f6cfd0; }
.btn-danger:hover { background: #fbdcdd; }

.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-icon { width: 34px; height: 34px; padding: 0; }

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 4px;
}
.form-actions .btn-primary { min-width: 132px; }

/* notice */
.notice {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 11px 13px;
    border-radius: var(--r-md);
    font-size: 12.8px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.notice svg { width: 16px; height: 16px; margin-top: 1px; }
.notice.is-error { background: var(--danger-soft); border-color: #f8d4d4; color: #a8232a; }
.notice.is-warn { background: var(--warn-soft); border-color: #f3e0bb; color: #8a5b12; }
.notice.is-ok { background: var(--success-soft); border-color: #c5ecd4; color: #0d7d3f; }
.notice code { background: rgba(0, 0, 0, .05); padding: 1px 5px; border-radius: 4px; }

/* saved connections */
.saved-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.saved-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 4px;
    border-top: 1px solid var(--border);
}
.saved-list li:first-child { border-top: 0; }
.saved-list .s-main { flex: 1; min-width: 0; }
.saved-list .s-name { font-weight: 560; font-size: 13px; }
.saved-list .s-meta { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }

/* tips */
.tips-card { background: var(--surface); }
.tips-text { margin: 0 0 12px; color: var(--text-2); font-size: 13px; }
.tips-text.dim { color: var(--text-3); font-size: 12.5px; margin: 12px 0 0; }
.code {
    margin: 0;
    background: #0f1420;
    color: #dfe7f5;
    border-radius: var(--r-md);
    padding: 14px 16px;
    overflow-x: auto;
    font-size: 12.2px;
    line-height: 1.7;
}

/* -------------------------------------------------------- viewer view */

.view-viewer {
    display: flex;
    flex-direction: column;
    background: var(--stage);
}
.view-viewer[hidden] { display: none; }

.toolbar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 20;
}
.toolbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.toolbar-center { display: flex; align-items: center; gap: 8px; }
.toolbar-right { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: flex-end; }

.conn-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 560;
    color: var(--text-2);
    font-family: var(--mono);
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.conn-chip .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-3);
    flex: none;
    transition: background .2s;
}
.conn-chip .dot.is-connecting { background: var(--warn); animation: pulse 1.1s ease-in-out infinite; }
.conn-chip .dot.is-connected { background: var(--success); box-shadow: 0 0 0 3px rgba(18, 161, 80, .16); }
.conn-chip .dot.is-failed, .conn-chip .dot.is-disconnected { background: var(--danger); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 8px;
    border-radius: var(--r-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 12.5px;
}
.tool-select {
    border: 0;
    background: transparent;
    padding: 0;
    height: auto;
    width: auto;
    font-size: 12.5px;
    font-weight: 550;
    color: var(--text-2);
    box-shadow: none;
}
.tool-slider input[type="range"] { width: 72px; height: 16px; }
.tool-slider svg { width: 15px; height: 15px; }

.menu-wrap { position: relative; }
.menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 168px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-3);
    padding: 5px;
    z-index: 40;
}
.menu[hidden] { display: none; }
.menu button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}
.menu button:hover { background: var(--surface-3); }
.menu button svg { width: 15px; height: 15px; color: var(--text-2); }

/* stage */
.stage {
    position: relative;
    flex: 1;
    min-height: 0;
    background: var(--stage);
    overflow: hidden;
}
.screen-host { position: absolute; inset: 0; }

.stage-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(11, 14, 20, .82);
    color: #e6edf8;
    font-size: 13.5px;
    z-index: 10;
    backdrop-filter: blur(2px);
}
.stage-overlay[hidden] { display: none; }
.stage-overlay p { margin: 0; max-width: 70%; text-align: center; line-height: 1.6; }

.spinner {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, .18);
    border-top-color: var(--brand);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* statusbar */
.statusbar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 18px;
    height: 28px;
    padding: 0 14px;
    background: #0f1420;
    border-top: 1px solid #1c2534;
    color: #7d8ea6;
    font-family: var(--mono);
    font-size: 11.5px;
    overflow: hidden;
}
.stat { white-space: nowrap; }
.stat.is-ok { color: #56d38b; }
.stat.is-bad { color: #f2787c; }
.stat-right { margin-left: auto; color: #56677c; }

/* fullscreen */
.view-viewer:fullscreen { background: var(--stage); }
.view-viewer:fullscreen .toolbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: rgba(17, 22, 32, .88);
    border-bottom-color: #232c3c;
    backdrop-filter: blur(8px);
    transform: translateY(-100%);
    transition: transform .2s ease;
}
.view-viewer:fullscreen .toolbar .conn-chip { color: #c2cede; }
.view-viewer:fullscreen .toolbar .btn-ghost { color: #b3c0d2; }
.view-viewer:fullscreen .toolbar .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.view-viewer:fullscreen .toolbar .chip { background: rgba(255, 255, 255, .08); border-color: transparent; color: #c2cede; }
.view-viewer:fullscreen .toolbar .tool { background: rgba(255, 255, 255, .06); border-color: transparent; color: #b3c0d2; }
.view-viewer:fullscreen .toolbar .tool-select { color: #b3c0d2; }
.view-viewer:fullscreen .toolbar .tool-select option { color: #16202e; }
.view-viewer:fullscreen .statusbar { position: absolute; bottom: 0; left: 0; right: 0; }
.view-viewer:fullscreen:hover .toolbar { transform: translateY(0); }

/* ---------------------------------------------------------- drawer */

.drawer {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    bottom: 0;
    width: 372px;
    max-width: 92vw;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -18px 0 40px -24px rgba(16, 24, 40, .3);
    display: flex;
    flex-direction: column;
    z-index: 25;
    animation: slideIn .18s ease;
}
.drawer[hidden] { display: none; }
@keyframes slideIn { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }

.drawer-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.tabs { display: flex; gap: 3px; background: var(--surface-3); padding: 3px; border-radius: var(--r-sm); flex: 1; }
.tab {
    flex: 1;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 12.5px;
    font-weight: 560;
    color: var(--text-2);
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
}
.tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

.drawer-body { flex: 1; overflow-y: auto; padding: 16px; }
.tabpane { display: none; }
.tabpane.is-active { display: block; }

.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }

.kv { margin: 0; display: flex; flex-direction: column; }
.kv > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12.8px;
}
.kv dt { color: var(--text-3); white-space: nowrap; }
.kv dd { margin: 0; font-family: var(--mono); font-size: 12.2px; text-align: right; word-break: break-all; }

.keylist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.keylist li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.keylist li span { flex-basis: 100%; color: var(--text-3); font-size: 12px; }

/* ---------------------------------------------------------- modal */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 40, .42);
    display: grid;
    place-items: center;
    z-index: 60;
    padding: 20px;
    animation: fadeIn .14s ease;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-3);
    padding: 22px;
    animation: pop .16s ease;
    max-height: 86vh;
    overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal#modal-help { max-width: 620px; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head { margin-bottom: 16px; }
.modal-head h3 { margin: 0 0 4px; font-size: 16px; font-weight: 660; }
.modal-head p { margin: 0; color: var(--text-2); font-size: 12.8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-body { font-size: 13px; color: var(--text-2); }
.modal-body h4 { margin: 18px 0 6px; font-size: 13.5px; color: var(--text); }
.modal-body h4:first-child { margin-top: 0; }
.modal-body ul { margin: 0 0 10px; padding-left: 18px; }
.modal-body li { margin-bottom: 5px; }
.modal-body pre {
    background: #0f1420; color: #dfe7f5; border-radius: var(--r-md);
    padding: 12px 14px; overflow-x: auto; font-size: 12px; margin: 8px 0;
}

/* ---------------------------------------------------------- toasts */

.toasts {
    position: fixed;
    bottom: 42px;
    right: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
    z-index: 70;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: 480px;
    padding: 10px 14px;
    border-radius: var(--r-pill);
    background: #1b2330;
    color: #eef2f8;
    font-size: 12.8px;
    box-shadow: var(--shadow-3);
    animation: toastIn .18s ease;
}
.toast svg { width: 15px; height: 15px; }
.toast.is-error { background: #4a1518; color: #ffd9da; }
.toast.is-ok { background: #0e3a24; color: #d7f5e3; }
.toast.is-warn { background: #45330f; color: #fbeccb; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------- responsive */

@media (max-width: 900px) {
    .brand-sub { display: none; }
    .toolbar-center { display: none; }
}

@media (max-width: 680px) {
    .view-connect { padding: 20px 12px 48px; }
    .card { padding: 18px; border-radius: var(--r-md); }
    .field-row { flex-direction: column; gap: 0; }
    .field.port { width: 100%; }
    .switch-grid { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .toolbar { height: 44px; padding: 0 8px; gap: 4px; }
    .toolbar-right .btn-icon { width: 30px; height: 30px; }
    .toolbar-right .btn-icon:nth-child(n+5) { display: none; }
    .statusbar { gap: 12px; font-size: 11px; }
    .stat-right { display: none; }
    .drawer { width: 100%; max-width: none; }
    .toast { max-width: 92vw; border-radius: var(--r-md); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
