/* ============================================================
   Canary Alert — Premium Monochrome Design System
   Black & White · Lucide icons · No emoji · Responsive
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
    /* Type */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, monospace;

    /* Spacing scale (4px base) */
    --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
    --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

    /* Radii — unified */
    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --r-xl: 20px;
    --r-full: 999px;

    /* Motion — restrained */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur: 160ms;
    --dur-slow: 240ms;

    /* Semantic accents — used sparingly for status only */
    --success: #1f9d57;
    --success-soft: rgba(31, 157, 87, 0.10);
    --warning: #c2820a;
    --warning-soft: rgba(194, 130, 10, 0.10);
    --danger: #d6453d;
    --danger-soft: rgba(214, 69, 61, 0.10);

    --icon-stroke: 1.75;
}

/* ---------- Light theme (paper) ---------- */
[data-theme="light"] {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --surface-3: #ececed;
    --border: #e8e8ea;
    --border-strong: #d6d6da;
    --text: #0b0b0c;
    --text-secondary: #54545c;
    --text-muted: #9a9aa2;
    --ink: #0b0b0c;
    --ink-contrast: #ffffff;
    --shadow-sm: 0 1px 2px rgba(11, 11, 12, 0.04), 0 1px 3px rgba(11, 11, 12, 0.05);
    --shadow-md: 0 4px 14px rgba(11, 11, 12, 0.06), 0 2px 4px rgba(11, 11, 12, 0.04);
    --shadow-lg: 0 20px 45px rgba(11, 11, 12, 0.10);
    --ring: rgba(11, 11, 12, 0.12);
}

/* ---------- Dark theme (ink) ---------- */
[data-theme="dark"] {
    --bg: #0a0a0b;
    --surface: #141416;
    --surface-2: #1c1c1f;
    --surface-3: #26262a;
    --border: #262629;
    --border-strong: #38383d;
    --text: #f4f4f5;
    --text-secondary: #a8a8b0;
    --text-muted: #6c6c74;
    --ink: #f4f4f5;
    --ink-contrast: #0a0a0b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 50px rgba(0, 0, 0, 0.55);
    --ring: rgba(244, 244, 245, 0.14);
}

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

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 14px;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* Lucide icon sizing */
svg.lucide {
    width: 1.25em;
    height: 1.25em;
    stroke-width: var(--icon-stroke);
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

::selection { background: var(--ink); color: var(--ink-contrast); }

/* ---------- App shell ---------- */
.app {
    display: grid;
    grid-template-columns: 264px 1fr;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--s-8);
    padding: var(--s-8) var(--s-5);
    border-right: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: 0 var(--s-2);
}

.brand-chip {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: var(--r-sm);
    background: var(--ink);
    color: var(--ink-contrast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}
.brand-mark { width: 22px; height: 22px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -0.02em; }
.brand-sub { font-size: 11.5px; color: var(--text-muted); }

.nav { display: flex; flex-direction: column; gap: var(--s-1); }

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    width: 100%;
    padding: var(--s-3) var(--s-3);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
    position: relative;
}
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
    background: var(--surface-2);
    color: var(--text);
    box-shadow: inset 2px 0 0 var(--text);
}

.sidebar-foot { margin-top: auto; }
.security-note {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-3);
    font-size: 12px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface-2);
}
.security-note svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Main column ---------- */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-5) var(--s-10);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar-titles { min-width: 0; }
.eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.page-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 2px;
}

.topbar-actions { display: flex; align-items: center; gap: var(--s-3); }
.version {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    background: var(--surface);
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }

.content {
    flex: 1;
    width: 100%;
    max-width: 824px;
    margin: 0 auto;
    padding: var(--s-8) var(--s-10) var(--s-12);
}

/* ---------- Panels ---------- */
.panel { display: none; animation: fadeUp var(--dur-slow) var(--ease-out); }
.panel.active { display: block; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-8);
    margin-bottom: var(--s-6);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover { border-color: var(--border-strong); }

.card-head { margin-bottom: var(--s-4); }
.card-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--s-2);
}
.card-eyebrow svg { width: 14px; height: 14px; }
.card-title { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }

.description {
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 1.7;
    margin-bottom: var(--s-6);
}
.description strong { color: var(--text); font-weight: 600; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: var(--s-5); }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--s-2);
}
.req { color: var(--danger); font-weight: 600; }

.field { position: relative; display: flex; align-items: center; }
.field-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}
.field input[type="password"],
.field input[type="text"] {
    width: 100%;
    padding: 12px 44px 12px 44px;
}
.field-toggle {
    position: absolute;
    right: 8px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.field-toggle:hover { color: var(--text); background: var(--surface-2); }
.field-toggle svg { width: 17px; height: 17px; }

input[type="password"],
input[type="text"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
textarea {
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.55;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 3px var(--ring);
}
::placeholder { color: var(--text-muted); }

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a9aa2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 38px;
    cursor: pointer;
}

/* File dropzone */
.file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: var(--s-8) var(--s-4);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--r);
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.file-drop:hover { border-color: var(--text); background: var(--surface-2); color: var(--text); }
.file-drop svg { width: 22px; height: 22px; }
.file-drop-text { font-size: 13px; }
.file-drop code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: 4px;
}
.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Password strength ---------- */
.strength-meter {
    height: 5px;
    background: var(--surface-2);
    border-radius: var(--r-full);
    margin-top: var(--s-3);
    overflow: hidden;
}
.strength-bar {
    height: 100%;
    width: 0%;
    background: var(--text-muted);
    border-radius: var(--r-full);
    transition: width var(--dur-slow) var(--ease), background var(--dur-slow) var(--ease);
}
.strength-bar.weak { width: 25%; background: var(--danger); }
.strength-bar.fair { width: 50%; background: var(--warning); }
.strength-bar.good { width: 75%; background: var(--success); }
.strength-bar.strong { width: 100%; background: var(--success); }

.hint { font-size: 12px; color: var(--text-muted); margin-top: var(--s-2); }

.req-list {
    list-style: none;
    margin-top: var(--s-3);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--s-2);
}
.req-list li {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 12px;
    color: var(--text-muted);
    transition: color var(--dur) var(--ease);
}
.req-mark {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: var(--r-full);
    border: 1.5px solid var(--border-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.req-mark svg { width: 10px; height: 10px; color: var(--ink-contrast); opacity: 0; transition: opacity var(--dur) var(--ease); }
.req-list li.met { color: var(--text); }
.req-list li.met .req-mark { background: var(--text); border-color: var(--text); }
.req-list li.met .req-mark svg { opacity: 1; }

/* ---------- Notes & callouts ---------- */
.note {
    display: flex;
    gap: var(--s-3);
    padding: var(--s-4);
    border-radius: var(--r);
    margin: var(--s-6) 0;
    border: 1px solid var(--border);
    background: var(--surface-2);
}
.note svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.note h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.note p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.note-warning { border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); background: var(--warning-soft); }
.note-warning > svg { color: var(--warning); }
.note-warning h3 { color: var(--warning); }
.note-warning p { color: var(--text-secondary); }

.note-danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: var(--danger-soft); }
.note-danger > svg { color: var(--danger); }
.note-danger p { color: var(--danger); font-weight: 500; }

.note-inline {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-top: var(--s-4);
    font-size: 12.5px;
    color: var(--warning);
}
.note-inline svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
        border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--ink); color: var(--ink-contrast); box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-md); filter: brightness(1.08); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }

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

.btn-large { width: 100%; padding: 14px 24px; font-size: 15px; margin-top: var(--s-2); }
.btn-large svg { width: 19px; height: 19px; }
.btn-small { padding: 8px 14px; font-size: 13px; }
.btn-small svg { width: 16px; height: 16px; }

/* spinner */
.btn .lucide-loader-circle { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Result boxes ---------- */
.result-box {
    margin-top: var(--s-6);
    padding: var(--s-5);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
}
.result-box.error { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: var(--danger-soft); }
.result-title {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--s-4);
    color: var(--success);
}
.result-title svg { width: 18px; height: 18px; }
.result-box.error .result-title { color: var(--danger); }
.result-title.danger { color: var(--danger); }
.result-box p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.key-info, .signature-info { margin-bottom: var(--s-4); }

.info-row {
    display: flex;
    gap: var(--s-3);
    padding: var(--s-3) 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-secondary); min-width: 110px; flex-shrink: 0; }
.info-value { color: var(--text); word-break: break-all; }
.info-value.mono { font-family: var(--font-mono); font-size: 12px; }
.info-value.small { font-size: 11.5px; color: var(--text-secondary); }

.action-row { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-4); }
.action-row .btn { flex: 1; min-width: 150px; }

/* ---------- Status indicator ---------- */
.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    margin-bottom: var(--s-5);
    font-size: 13.5px;
    color: var(--text-secondary);
}
.status-dot { width: 9px; height: 9px; border-radius: var(--r-full); flex-shrink: 0; }
.status-dot.status-success { background: var(--success); }
.status-dot.status-warning { background: var(--warning); }
.status-dot.status-danger { background: var(--danger); }

/* ---------- Drand / message preview ---------- */
.block-title {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--s-3);
}
.block-title svg { width: 17px; height: 17px; }

.drand-info, .message-preview {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: var(--s-5);
    margin-bottom: var(--s-5);
}

.drand-info select {
    padding: 6px 34px 6px 12px;
    background-color: var(--surface);
    border-radius: var(--r-sm);
    font-size: 13px;
    width: auto;
    min-width: 240px;
}

.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: var(--s-4);
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-height: 220px;
    overflow: auto;
    white-space: pre;
}

.upload-result {
    margin-top: var(--s-4);
    padding: var(--s-3) var(--s-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-muted);
    border-radius: var(--r-sm);
    font-size: 13px;
    color: var(--text-secondary);
}
.upload-result.success { border-left-color: var(--success); }
.upload-result.error { border-left-color: var(--warning); }
.upload-result strong { color: var(--text); }
.upload-result code { font-family: var(--font-mono); font-size: 12px; word-break: break-all; }
.upload-result a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.upload-result details { margin-top: var(--s-2); }
.upload-result summary { cursor: pointer; color: var(--text-secondary); }
.upload-result pre {
    margin-top: var(--s-2);
    max-height: 200px;
    overflow: auto;
    background: var(--bg);
    padding: var(--s-2);
    border-radius: var(--r-sm);
    font-family: var(--font-mono);
    font-size: 11px;
}

/* ---------- Records ---------- */
.records-list { max-height: 440px; overflow-y: auto; margin-bottom: var(--s-5); }
.record-item {
    padding: var(--s-4);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: var(--s-3);
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.record-item:hover { border-color: var(--text); background: var(--surface); transform: translateY(-1px); }
.record-header { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin-bottom: var(--s-2); }
.record-fingerprint { font-family: var(--font-mono); font-size: 12px; color: var(--text); }
.record-time { font-size: 13px; color: var(--text-secondary); }
.record-status { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-full); border: 1px solid var(--border-strong); color: var(--text-secondary); }
.record-status.duress { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); color: var(--danger); }
.record-meta { margin-top: var(--s-1); font-size: 12px; color: var(--text-muted); }

.empty-text { text-align: center; color: var(--text-muted); padding: var(--s-12) 0; font-size: 14px; }

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: var(--s-8) var(--s-10) var(--s-10);
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.footer-note { display: inline-flex; align-items: center; gap: var(--s-2); }
.footer-note svg { width: 14px; height: 14px; }
.footer-tech { margin-top: var(--s-2); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: var(--s-8);
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: var(--ink);
    color: var(--ink-contrast);
    padding: 12px 22px;
    border-radius: var(--r-full);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Utility ---------- */
.hidden { display: none !important; }

/* ---------- Responsive: tablet / mobile ---------- */
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }

    .sidebar {
        position: fixed;
        left: 0; right: 0; bottom: 0; top: auto;
        flex-direction: row;
        align-items: stretch;
        gap: 0;
        height: auto;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border);
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        backdrop-filter: saturate(180%) blur(12px);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        z-index: 50;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .brand, .sidebar-foot { display: none; }

    .nav {
        flex-direction: row;
        flex: 1;
        gap: 0;
        justify-content: space-around;
    }
    .nav-item {
        flex-direction: column;
        gap: 3px;
        flex: 1;
        justify-content: center;
        padding: 10px 4px;
        border-radius: 0;
        font-size: 11px;
        color: var(--text-muted);
    }
    .nav-item svg { width: 21px; height: 21px; }
    .nav-item.active { background: transparent; box-shadow: inset 0 2px 0 var(--text); color: var(--text); }

    .topbar { padding: var(--s-4) var(--s-5); }
    .content { padding: var(--s-6) var(--s-5) 96px; }
    .card { padding: var(--s-6); }
    .footer { padding: var(--s-6) var(--s-5) 96px; }
}

@media (max-width: 560px) {
    .page-title { font-size: 18px; }
    .card { padding: var(--s-5); border-radius: var(--r); }
    .action-row { flex-direction: column; }
    .action-row .btn { width: 100%; }
    .info-row { flex-direction: column; gap: var(--s-1); }
    .info-label { min-width: auto; }
    .drand-info select { width: 100%; min-width: 0; }
    .toast { left: var(--s-4); right: var(--s-4); transform: translateY(12px); text-align: center; }
    .toast.show { transform: translateY(0); }
}

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