/* SecureShare — visual language shared with remote.adaptis.cz (same tokens, cards,
   gradient primary button and auth background). No inline styles anywhere (CSP). */
:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #2bb7f0;
    /* Text/link colour on white: 5.7:1 (WCAG AA). The lighter brand cyans are for fills only. */
    --primary-deep: #0b6e99;
    --accent: #3be3c6;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --warn-bg: #fff7e6;
    --warn-border: #f5d48a;
    --warn-text: #7a4b00;
    --ok-bg: #e9fbf5;
    --ok-border: #a7ecd6;
    --ok-text: #065f46;
    --info-bg: #eef9fe;
    --info-border: #bfe8fb;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 28px 70px rgba(15, 23, 42, 0.14);
    --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-deep); }
code, .mono { font-family: var(--mono); }
h1, h2 { letter-spacing: -0.01em; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
/* Off-screen textarea used by the execCommand('copy') fallback. */
.sr-copy { position: fixed; top: -1000px; left: -1000px; opacity: 0; }

/* ---------- Auth / anonymous card layout ---------- */
body.auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(1200px 800px at 20% 0%, #d2f7ee 0%, transparent 50%),
                radial-gradient(1000px 700px at 100% 100%, #bde6fb 0%, transparent 55%),
                var(--bg);
}

.card {
    background: var(--surface);
    width: 100%;
    max-width: 440px;
    border-radius: var(--radius-lg);
    padding: 36px 40px 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.card.card-wide { max-width: 680px; }

.card-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    margin-bottom: 18px;
}
.card-brand .logo {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 8px 18px rgba(43, 183, 240, 0.25));
}
.card-brand-name { font-weight: 800; font-size: 15px; letter-spacing: 0.01em; color: var(--muted); }

.card-header {
    text-align: center;
    margin-bottom: 24px;
}
.card h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
}
.subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}
.hero-ico { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.error-code {
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- Forms ---------- */
form label {
    display: block;
    margin: 18px 0 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}
form label.check, form label.check-row, form label.gen-length { margin: 0; }
.optional { font-weight: 500; color: var(--muted); }

form input[type="text"],
form input[type="password"],
form input[type="number"],
form input[type="url"],
form select,
form textarea,
.share-url {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: #fbfbfd;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
form textarea { resize: vertical; min-height: 120px; line-height: 1.45; }
form textarea.mono, form input.mono, .share-url.mono { font-family: var(--mono); font-size: 14px; }
form select { appearance: auto; }

form input:focus,
form select:focus,
form textarea:focus,
.share-url:focus {
    outline: none;
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(43, 183, 240, 0.15);
}

.field-hint {
    display: block;
    margin-top: 7px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.45;
}
.field-hint.center { text-align: center; }
.field-error {
    margin: 8px 0 0;
    color: var(--danger-text);
    background: var(--danger-bg);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
}

.cf-turnstile {
    margin: 22px 0 18px;
    display: flex;
    justify-content: center;
    min-height: 65px;
}

/* ---------- Buttons ---------- */
button.primary,
a.button.primary,
.button.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    /* Dark text: white on these cyans is only 1.6-2.3:1; this is 7.8-11:1. */
    color: var(--text);
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s, filter 0.2s;
    box-shadow: 0 10px 24px rgba(43, 183, 240, 0.25);
}
button.primary:hover, .button.primary:hover { filter: brightness(1.05); box-shadow: 0 14px 30px rgba(43, 183, 240, 0.3); }
button.primary:active, .button.primary:active { transform: translateY(1px); }
button.primary:disabled { cursor: not-allowed; opacity: 0.85; }
button.primary.compact, .button.primary.compact {
    width: auto;
    padding: 10px 18px;
    font-size: 14px;
    box-shadow: 0 8px 18px rgba(43, 183, 240, 0.22);
}

button.primary .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(15, 23, 42, 0.25);
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-left: 4px;
}
button.primary.loading .label { opacity: 0.6; }
button.primary.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn, a.btn, .button.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    border: 1.5px solid transparent;
    background: transparent;
    line-height: 1.2;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn-secondary, .button.btn-secondary {
    background: #fff;
    color: var(--primary-deep);
    border-color: var(--primary);
}
.btn-secondary:hover, .button.btn-secondary:hover { background: #f2fbff; }
.btn-danger {
    background: #fff;
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.45);
}
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-sm, .button.btn-sm { padding: 6px 12px; font-size: 13px; }
.block, .button.block, .btn.block { display: flex; width: 100%; }
.button.is-disabled, .btn.is-disabled { opacity: 0.45; pointer-events: none; }
.btn.is-done, .primary.is-done { filter: saturate(0.6); }

/* ---------- Alerts / callouts / flashes ---------- */
.alert {
    background: var(--danger-bg);
    color: var(--danger-text);
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 14px;
    border: 1px solid rgba(153, 27, 27, 0.15);
}
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert ul:first-child { margin-top: 0; }

.callout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--info-border);
    background: var(--info-bg);
    margin: 0 0 18px;
    font-size: 14px;
}
.callout p { margin: 2px 0 0; color: #475569; }
.callout strong { display: block; }
.callout-ico { font-size: 20px; line-height: 1.2; }
.callout-warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.callout-warn p { color: var(--warn-text); }
.callout-muted { background: var(--surface-2); border-color: var(--border); }
.share-card .callout { margin: 14px 0 0; }

.flash {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--info-border);
    background: var(--info-bg);
}
.flash-success { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok-text); }
.flash-error { background: var(--danger-bg); border-color: rgba(153, 27, 27, 0.15); color: var(--danger-text); }

.muted {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    margin-top: 22px;
}
.muted a { text-decoration: none; }
.muted a:hover { text-decoration: underline; }

/* ---------- Home ---------- */
.feature-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 14px; }
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.feature-list p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.step {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #0f172a;
    font-weight: 800;
    font-size: 13px;
}

/* ---------- Topbar (admin) ---------- */
.topbar { background: #0f172a; color: #fff; }
.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.01em;
}
.logo-sm { width: 30px; height: 30px; }
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.mainnav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.mainnav a[aria-current="page"] { color: #fff; background: rgba(43, 183, 240, 0.22); }
.who { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.who-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.who .name { font-weight: 600; }
.who .upn { color: rgba(255, 255, 255, 0.6); font-size: 12.5px; }
.logout-form { margin: 0; }
.linklike {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: background 0.15s;
}
.linklike:hover { background: rgba(255, 255, 255, 0.08); }

/* ---------- Admin shell ---------- */
.shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 36px 24px 48px;
}
.page-head { margin-bottom: 24px; }
.page-head h1 {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}
.page-head .lead { margin: 0; color: var(--muted); max-width: 680px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lead-sep { color: #cbd5e1; margin: 0 2px; }
.back-link {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.panel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}
.panel-card h2 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.panel-card > h2 + .field-hint { margin-top: 0; margin-bottom: 4px; }

/* ---------- Create form: CSS-only tabs (radio buttons) ---------- */
.kind-card { padding-top: 14px; }
.kind-radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.kind-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 4px;
}
.kind-tab {
    margin: 0 !important;
    padding: 8px 16px !important;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--muted) !important;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    user-select: none;
    white-space: nowrap;
}
.kind-tab:hover { color: var(--text) !important; }
#kind-text:checked ~ .kind-tabs .kind-tab-text,
#kind-file:checked ~ .kind-tabs .kind-tab-file,
#kind-url:checked ~ .kind-tabs .kind-tab-url {
    background: #fff;
    color: var(--primary-deep) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
#kind-text:focus-visible ~ .kind-tabs .kind-tab-text,
#kind-file:focus-visible ~ .kind-tabs .kind-tab-file,
#kind-url:focus-visible ~ .kind-tabs .kind-tab-url {
    outline: 3px solid rgba(43, 183, 240, 0.45);
    outline-offset: 1px;
}
.kind-panel { display: none; }
.kind-panel.is-solo,
#kind-text:checked ~ .kind-panels .kind-panel-text,
#kind-file:checked ~ .kind-panels .kind-panel-file,
#kind-url:checked ~ .kind-panels .kind-panel-url { display: block; }

/* Password generator */
.generator {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 10px;
}
.gen-options > summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    list-style: none;
}
.gen-options > summary::-webkit-details-marker { display: none; }
.gen-options > summary::before { content: '▸ '; }
.gen-options[open] > summary::before { content: '▾ '; }
.gen-options[open] { flex-basis: 100%; }
.gen-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13.5px;
}
.gen-length { display: flex !important; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px !important; }
.gen-length input[type="number"] { width: 78px; padding: 6px 8px; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13.5px; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--primary-deep); width: 16px; height: 16px; }

/* Drag & drop zone: the real file input covers the zone so it works without JS. */
.dropzone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    background: var(--surface-2);
    padding: 28px 18px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--primary); background: #f2fbff; }
.dropzone:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(43, 183, 240, 0.15); }
.dropzone-input {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.dropzone-text { display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.dropzone-text span { color: var(--muted); font-size: 13px; }
.dropzone-ico {
    display: inline-grid !important;
    place-items: center;
    width: 40px; height: 40px;
    margin: 0 auto 4px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: var(--text) !important;
    font-size: 18px !important;
    font-weight: 800;
}
.picked-files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.picked-files li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 13.5px;
    background: #fff;
}
.picked-files .pf-name { overflow-wrap: anywhere; }
.picked-files .pf-size { color: var(--muted); white-space: nowrap; }
.picked-files li.pf-total { background: var(--surface-2); font-weight: 700; }
.picked-files li.is-over { border-color: rgba(220, 38, 38, 0.45); background: var(--danger-bg); }

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 22px;
}
.views-row { display: flex; align-items: center; gap: 12px; }
.views-range { flex: 1; accent-color: var(--primary-deep); min-width: 0; }
form input.views-number { width: 92px; flex: none; text-align: center; }
.checks { display: grid; gap: 10px; margin: 20px 0 4px; }
.check-row {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    cursor: pointer;
    font-weight: 400 !important;
    transition: border-color 0.15s, background 0.15s;
}
.check-row:hover { border-color: var(--primary); background: #fbfeff; }
.check-row input { margin-top: 3px; flex: none; }
.check-row strong { display: block; font-size: 14px; }
.check-row small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.form-actions { display: grid; gap: 4px; max-width: 420px; }

/* ---------- Dashboard ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.toolbar-count { margin-left: auto; color: var(--muted); font-size: 13px; }
.segmented {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 11px;
}
.segmented a {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
}
.segmented a:hover { color: var(--text); }
.segmented a[aria-current="page"] {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: var(--text);
}
.empty {
    text-align: center;
    padding: 48px 24px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted);
}
.empty p { margin: 0 0 14px; }

.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.panel-card .table-wrap { box-shadow: none; margin-top: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: 11px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #fbfdff; }
table.data.compact td { padding: 9px 14px; font-size: 13.5px; }
table.data .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data .sub, .sub { display: block; color: var(--muted); font-size: 12.5px; }
table.data .nowrap, .nowrap { white-space: nowrap; }
table.data .ua { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
table.data .actions { text-align: right; }
table.data .actions form { margin: 0; }
.row-link { font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.row-link:hover { text-decoration: underline; }

.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11.5px;
    font-weight: 700;
    vertical-align: 1px;
}
.badge-muted { background: #f1f5f9; color: #475569; }
.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}
.pill-active { background: var(--ok-bg); color: var(--ok-text); border: 1px solid var(--ok-border); }
.pill-expired { background: #f1f5f9; color: #475569; border: 1px solid var(--border); }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pager-info { color: var(--muted); font-size: 13.5px; }

/* ---------- Detail ---------- */
.share-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}
.share-card.is-new { border: 2px solid var(--primary); }
.share-card h2 { margin: 0 0 4px; font-size: 18px; }
.share-card > p { margin: 0 0 12px; color: var(--muted); }
.share-row { display: flex; gap: 10px; align-items: stretch; }
.share-url { font-size: 16px; padding: 14px 16px; background: #f2fbff; border-color: var(--info-border); }
.share-card.is-new .share-url { font-size: 17px; font-weight: 600; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; }
.detail-grid > .panel-card { margin-bottom: 18px; }
.props { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; margin: 14px 0 0; font-size: 14px; }
.props dt { color: var(--muted); font-weight: 600; }
.props dd { margin: 0; overflow-wrap: anywhere; }
.props .sub { display: inline; }
.actions-card form { margin: 14px 0 0; }
.actions-card .field-hint { margin-bottom: 4px; }
.actions-card > .button { margin-top: 16px; }
.reveal-card { border-color: var(--primary); }

.ev {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    background: #f1f5f9;
    color: #475569;
}
.ev-created { background: var(--info-bg); color: var(--primary-deep); }
.ev-view { background: var(--ok-bg); color: var(--ok-text); }
.ev-owner { background: #ede9fe; color: #5b21b6; }
.ev-bad { background: var(--danger-bg); color: var(--danger-text); }

/* ---------- Tokens ---------- */
.stack-form label:first-of-type { margin-top: 10px; }
.stack-form button.primary { margin-top: 16px; }
pre.code {
    margin: 6px 0 14px;
    padding: 12px 14px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ---------- Revealed content ---------- */
.secret-label { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.secret-wrap { position: relative; }
.secret {
    margin: 0;
    padding: 18px 20px;
    min-height: 64px;
    max-height: 55vh;
    overflow: auto;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: var(--mono);
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--text);
}
.secret:focus { outline: 3px solid rgba(43, 183, 240, 0.35); outline-offset: 1px; }
/* Blur only when app.js runs (it sets html.js); without JS the content is simply shown. */
.js .secret-wrap:not(.is-revealed) .secret { filter: blur(7px); user-select: none; }
.secret-cover {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.35);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
.secret-cover:hover { background: rgba(242, 251, 255, 0.55); }
.secret-cover:focus-visible { outline: 3px solid rgba(43, 183, 240, 0.45); }
.secret-wrap.is-revealed .secret-cover { display: none; }
.secret-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 4px; }
.secret-url-box {
    padding: 16px 18px;
    background: #f2fbff;
    border: 1px solid var(--info-border);
    border-radius: 12px;
}
.secret-url { font-size: 15px; overflow-wrap: anywhere; word-break: break-all; }
.file-dl { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.file-dl li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}
.file-ico { font-size: 22px; }
.file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { font-weight: 700; overflow-wrap: anywhere; }
.file-size { color: var(--muted); font-size: 12.5px; }
.secret-wrap + .secret-actions + .secret-label,
.secret-actions + .secret-label { margin-top: 18px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 6px; }
.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
}
.stat-v { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.stat-l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.card .callout-warn { margin-top: 20px; }

.viewer-delete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding: 14px 16px;
    border: 1px solid rgba(220, 38, 38, 0.2);
    background: #fffafa;
    border-radius: 12px;
}
.viewer-delete p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.viewer-delete .btn { flex: none; }
.gate-form button.primary { margin-top: 20px; }
.reason-list { margin: 0 auto; padding-left: 20px; max-width: 460px; color: #475569; font-size: 14px; }
.reason-list li { margin-bottom: 6px; }

/* ---------- Footer + language switch ---------- */
.pagefoot {
    display: grid;
    gap: 6px;
    max-width: 1080px;
    margin: 0 auto;
    padding: 20px 24px 32px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}
body.auth .pagefoot { padding: 18px 0 0; }
.pagefoot a { color: var(--primary-deep); text-decoration: none; }
.lang-switch { display: inline-flex; justify-content: center; gap: 8px; }
.lang-switch a { font-weight: 600; }
.lang-switch a[aria-current="true"] { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .detail-grid { grid-template-columns: 1fr; }
    .topbar-inner { flex-wrap: wrap; gap: 10px 16px; }
    .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; }
    .who { margin-left: auto; }
}
@media (max-width: 720px) {
    table.data thead { display: none; }
    table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
    table.data tr { padding: 10px 4px; border-bottom: 1px solid var(--border); }
    table.data tbody tr:last-child { border-bottom: 0; }
    table.data td, table.data.compact td {
        border-bottom: 0;
        padding: 5px 14px;
        text-align: right;
        overflow: hidden;
    }
    /* Label floats left, the cell's own inline content flows on the right. */
    table.data td::before {
        content: attr(data-label);
        float: left;
        margin-right: 12px;
        color: var(--muted);
        font-weight: 600;
        font-size: 12.5px;
        text-align: left;
    }
    table.data td.actions::before { content: none; }
    table.data .ua { max-width: none; white-space: normal; overflow-wrap: anywhere; }
    table.data .sub { display: inline; margin-left: 6px; }
}
@media (max-width: 640px) {
    .card { padding: 28px 20px 24px; }
    body.auth { padding: 16px; }
    .shell { padding: 24px 16px 40px; }
    .topbar-inner { padding: 12px 16px; }
    .who-text { display: none; }
    .page-head h1 { font-size: 23px; }
    .settings-grid { grid-template-columns: 1fr; }
    .share-row { flex-direction: column; }
    .share-row .primary.compact { width: 100%; }
    .panel-card, .share-card { padding: 18px 16px; }
    .viewer-delete { flex-direction: column; align-items: stretch; }
    .stats { grid-template-columns: 1fr; }
    .toolbar-count { margin-left: 0; flex-basis: 100%; }
    .kind-tabs { width: 100%; }
    .kind-tab { flex: 1; text-align: center; padding: 8px 4px !important; font-size: 13px !important; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
