/* ==========================================================================
   WannaShare — Astronomical Observatory theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@500;600;700;800&family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Space palette */
    --void:      #05060f;
    --deep:      #0a0b1f;
    --ink:       #10132b;
    --panel:     rgba(18, 22, 52, 0.62);
    --panel-solid: #121634;
    --border:    rgba(180, 200, 255, 0.10);
    --border-strong: rgba(180, 200, 255, 0.22);

    --text:      #ecf0fb;
    --muted:     #9aa3c7;
    --dim:       #6a7395;

    --aurora:    #7ee8fa;   /* primary cyan */
    --aurora-2:  #a5b4fc;   /* cooler periwinkle */
    --nebula:    #c084fc;   /* violet accent */
    --corona:    #ffd86b;   /* warm star */
    --rose:      #ff7eb6;   /* pink accent */

    --ok:        #5eead4;
    --danger:    #ff6e88;
    --warn:      #ffa769;

    --glow-aurora: 0 0 24px rgba(126,232,250,0.35);
    --glow-nebula: 0 0 28px rgba(192,132,252,0.35);

    --radius:    14px;
    --radius-sm: 8px;

    --shadow-lg: 0 24px 60px -15px rgba(0, 0, 0, 0.65),
                 0 0 0 1px rgba(180,200,255,0.05) inset;

    --font-display: "Syne", "Outfit", sans-serif;
    --font-body:    "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- reset ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
::selection { background: rgba(126,232,250,0.28); color: #fff; }

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

html, body {
    min-height: 100%;
    background: var(--void);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* Deep-space gradient + nebula glows as fixed backdrop */
body::before {
    content: "";
    position: fixed; inset: 0;
    z-index: -3;
    background:
        radial-gradient(1200px 900px at 15% 8%,  rgba(126,232,250,0.18), transparent 60%),
        radial-gradient(1100px 800px at 88% 92%, rgba(192,132,252,0.18), transparent 60%),
        radial-gradient(700px  520px at 50% 45%, rgba(255,216,107,0.05), transparent 70%),
        linear-gradient(180deg, #06061a 0%, #020312 100%);
    pointer-events: none;
}

/* Starfield — three parallax layers built from SVG tiles. */
.starfield {
    position: fixed; inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}
.starfield .layer {
    position: absolute; inset: -50%;
    background-repeat: repeat;
    will-change: transform;
}
.starfield .layer.small {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'><g fill='%23ffffff'><circle cx='23'  cy='57'  r='0.5' opacity='0.55'/><circle cx='87'  cy='12'  r='0.4' opacity='0.65'/><circle cx='141' cy='98'  r='0.6' opacity='0.45'/><circle cx='212' cy='33'  r='0.5' opacity='0.75'/><circle cx='277' cy='144' r='0.4' opacity='0.5'/><circle cx='319' cy='42'  r='0.6' opacity='0.65'/><circle cx='374' cy='195' r='0.5' opacity='0.55'/><circle cx='431' cy='72'  r='0.4' opacity='0.85'/><circle cx='498' cy='231' r='0.6' opacity='0.6'/><circle cx='551' cy='103' r='0.5' opacity='0.45'/><circle cx='38'  cy='276' r='0.4' opacity='0.7'/><circle cx='112' cy='349' r='0.6' opacity='0.5'/><circle cx='178' cy='221' r='0.5' opacity='0.75'/><circle cx='243' cy='397' r='0.4' opacity='0.55'/><circle cx='308' cy='462' r='0.6' opacity='0.65'/><circle cx='367' cy='314' r='0.5' opacity='0.5'/><circle cx='422' cy='535' r='0.4' opacity='0.7'/><circle cx='487' cy='411' r='0.6' opacity='0.45'/><circle cx='542' cy='486' r='0.5' opacity='0.55'/><circle cx='71'  cy='502' r='0.4' opacity='0.8'/><circle cx='163' cy='567' r='0.6' opacity='0.5'/><circle cx='256' cy='253' r='0.5' opacity='0.6'/><circle cx='333' cy='48'  r='0.4' opacity='0.9'/><circle cx='395' cy='136' r='0.6' opacity='0.55'/><circle cx='459' cy='328' r='0.5' opacity='0.7'/><circle cx='519' cy='251' r='0.4' opacity='0.45'/><circle cx='583' cy='401' r='0.6' opacity='0.6'/><circle cx='15'  cy='148' r='0.5' opacity='0.5'/><circle cx='95'  cy='225' r='0.4' opacity='0.75'/><circle cx='202' cy='472' r='0.6' opacity='0.55'/><circle cx='285' cy='591' r='0.5' opacity='0.65'/><circle cx='349' cy='232' r='0.4' opacity='0.85'/><circle cx='441' cy='452' r='0.6' opacity='0.5'/><circle cx='501' cy='565' r='0.5' opacity='0.6'/><circle cx='56'  cy='391' r='0.4' opacity='0.8'/><circle cx='131' cy='435' r='0.6' opacity='0.45'/><circle cx='233' cy='95'  r='0.5' opacity='0.55'/><circle cx='295' cy='326' r='0.4' opacity='0.7'/><circle cx='381' cy='259' r='0.6' opacity='0.55'/><circle cx='455' cy='157' r='0.5' opacity='0.75'/><circle cx='571' cy='321' r='0.4' opacity='0.55'/><circle cx='9'   cy='356' r='0.6' opacity='0.7'/><circle cx='116' cy='522' r='0.5' opacity='0.55'/><circle cx='198' cy='291' r='0.4' opacity='0.65'/></g></svg>");
    background-size: 600px 600px;
    animation: drift 240s linear infinite;
    opacity: 0.85;
}
.starfield .layer.mid {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='800' height='800' viewBox='0 0 800 800'><g fill='%23ffffff'><circle cx='73'  cy='122' r='1.0' opacity='0.75'/><circle cx='211' cy='301' r='0.8' opacity='0.6'/><circle cx='355' cy='55'  r='1.2' opacity='0.9'/><circle cx='489' cy='218' r='0.9' opacity='0.7'/><circle cx='613' cy='412' r='1.1' opacity='0.8'/><circle cx='721' cy='89'  r='0.7' opacity='0.55'/><circle cx='145' cy='555' r='1.0' opacity='0.75'/><circle cx='281' cy='671' r='0.8' opacity='0.6'/><circle cx='403' cy='487' r='1.3' opacity='0.9'/><circle cx='529' cy='735' r='0.9' opacity='0.65'/><circle cx='657' cy='599' r='1.0' opacity='0.7'/><circle cx='753' cy='489' r='0.8' opacity='0.55'/><circle cx='29'  cy='401' r='1.1' opacity='0.8'/><circle cx='175' cy='231' r='0.9' opacity='0.65'/><circle cx='319' cy='361' r='0.7' opacity='0.5'/><circle cx='577' cy='133' r='1.0' opacity='0.75'/><circle cx='691' cy='267' r='0.8' opacity='0.6'/><circle cx='247' cy='433' r='1.2' opacity='0.85'/></g></svg>");
    background-size: 800px 800px;
    animation: drift 360s linear infinite reverse;
    opacity: 0.9;
}
.starfield .layer.big {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1000' height='1000' viewBox='0 0 1000 1000'><g><circle cx='132' cy='187' r='1.6' fill='%23ffffff'/><circle cx='132' cy='187' r='3.8' fill='%23ffffff' opacity='0.18'/><circle cx='488' cy='102' r='1.8' fill='%237ee8fa'/><circle cx='488' cy='102' r='4.2' fill='%237ee8fa' opacity='0.22'/><circle cx='794' cy='235' r='1.5' fill='%23ffffff'/><circle cx='794' cy='235' r='3.5' fill='%23ffffff' opacity='0.18'/><circle cx='266' cy='488' r='1.7' fill='%23ffd86b'/><circle cx='266' cy='488' r='4.0' fill='%23ffd86b' opacity='0.2'/><circle cx='602' cy='541' r='2.0' fill='%23ffffff'/><circle cx='602' cy='541' r='4.5' fill='%23ffffff' opacity='0.2'/><circle cx='871' cy='673' r='1.6' fill='%23c084fc'/><circle cx='871' cy='673' r='3.8' fill='%23c084fc' opacity='0.22'/><circle cx='159' cy='812' r='1.8' fill='%23ffffff'/><circle cx='159' cy='812' r='4.2' fill='%23ffffff' opacity='0.18'/><circle cx='443' cy='887' r='1.5' fill='%23ffffff'/><circle cx='443' cy='887' r='3.5' fill='%23ffffff' opacity='0.18'/><circle cx='723' cy='933' r='1.7' fill='%237ee8fa'/><circle cx='723' cy='933' r='4.0' fill='%237ee8fa' opacity='0.2'/></g></svg>");
    background-size: 1000px 1000px;
    animation: drift 600s linear infinite, twinkle 6s ease-in-out infinite;
}

@keyframes drift {
    from { transform: translate(0, 0); }
    to   { transform: translate(-600px, -600px); }
}
@keyframes twinkle {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 6px rgba(255,255,255,0.15)); }
    50%      { filter: brightness(1.3) drop-shadow(0 0 10px rgba(255,255,255,0.3)); }
}

/* Shooting star */
.starfield .comet {
    position: absolute;
    top: 8%; left: -200px;
    width: 240px; height: 1.5px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.9), rgba(126,232,250,0.7));
    border-radius: 999px;
    transform: rotate(18deg);
    animation: comet 14s linear infinite;
    opacity: 0;
}
@keyframes comet {
    0%        { transform: translate(0, 0) rotate(18deg); opacity: 0; }
    4%        { opacity: 1; }
    16%       { opacity: 1; }
    22%       { transform: translate(120vw, 40vh) rotate(18deg); opacity: 0; }
    100%      { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .starfield .layer, .starfield .comet { animation: none !important; }
}

/* ---------- typography ---------- */

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin: 0 0 0.75rem;
}
h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    background: linear-gradient(100deg, #fff 0%, var(--aurora) 45%, var(--nebula) 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1.25rem;
}
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); color: var(--text); }
h3 { font-size: 1.05rem; color: var(--text); }
p  { margin: 0 0 1rem; }

a {
    color: var(--aurora);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 150ms ease, border-color 150ms ease;
}
a:hover { color: #c7f2fb; border-bottom-color: rgba(126,232,250,0.5); }

code, .mono { font-family: var(--font-mono); font-size: 0.9em; }

.muted { color: var(--muted); }
.dim   { color: var(--dim); }
.small { font-size: 0.82rem; }
.centered { text-align: center; }

/* ---------- topbar / nav ---------- */

.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.9rem clamp(1rem, 3vw, 2rem);
    background: linear-gradient(180deg, rgba(7, 8, 26, 0.85) 0%, rgba(7, 8, 26, 0.55) 100%);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.brand a {
    display: inline-flex; align-items: center;
    border-bottom: none;
    color: var(--text);
}
.brand a:hover { border-bottom: none; }
.brand-logo {
    height: 30px; width: auto;
    filter: drop-shadow(0 0 14px rgba(126,232,250,0.35));
    transition: filter 250ms ease;
}
.brand a:hover .brand-logo { filter: drop-shadow(0 0 20px rgba(126,232,250,0.6)); }

.nav {
    display: flex; align-items: center; gap: 1.4rem;
}
.nav a, .nav .linkish {
    position: relative;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.94rem;
    border-bottom: none;
    padding: 0.25rem 0;
    transition: color 150ms ease;
}
.nav a:hover, .nav .linkish:hover { color: var(--text); }
.nav a::after, .nav .linkish::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: -6px;
    height: 1px;
    background: linear-gradient(90deg, var(--aurora), var(--nebula));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 200ms ease;
}
.nav a:hover::after, .nav .linkish:hover::after { transform: scaleX(1); }

.inline { display: inline; }

.linkish {
    background: none; padding: 0;
    color: var(--muted);
    font: inherit;
    box-shadow: none;
    border: none;
    border-radius: 0;
}
.linkish:hover {
    color: var(--text);
    transform: none;
    filter: none;
    box-shadow: none;
}

/* Hamburger (mobile) */
.hamburger {
    display: none;
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 0;
    align-items: center; justify-content: center;
    color: var(--text);
}
.hamburger:hover { border-color: var(--border-strong); }
.hamburger svg { width: 22px; height: 22px; }

@media (max-width: 820px) {
    .hamburger { display: inline-flex; }
    .nav {
        position: fixed;
        top: 64px; right: 0; bottom: 0;
        width: min(320px, 80vw);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1.5rem 1.25rem;
        background: linear-gradient(180deg, #0a0c22 0%, #06081a 100%);
        border-left: 1px solid var(--border);
        box-shadow: -30px 0 80px rgba(0,0,0,0.6);
        transform: translateX(100%);
        transition: transform 260ms cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    .nav.open { transform: translateX(0); }
    .nav a, .nav form, .nav .linkish {
        padding: 0.9rem 0.25rem;
        border-bottom: 1px solid var(--border) !important;
        width: 100%;
        text-align: left;
    }
    .nav a::after, .nav .linkish::after { display: none; }
    .nav form.inline { display: block; }
    .nav form button { width: 100%; text-align: left; padding: 0 !important; }
}

/* ---------- container ---------- */

.container {
    position: relative;
    max-width: 1160px;
    margin: 2rem auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
    animation: pageRise 500ms ease both;
}
@keyframes pageRise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- cards, panels ---------- */

.card, .panel {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 3vw, 2rem);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    box-shadow: var(--shadow-lg);
}
.card::before, .panel::before {
    content: "";
    position: absolute; inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(800px 400px at 0% 0%, rgba(126,232,250,0.08), transparent 50%),
        radial-gradient(800px 400px at 100% 100%, rgba(192,132,252,0.08), transparent 50%);
    opacity: 0.8;
}

.narrow { max-width: 460px; margin: 3rem auto; }

/* ---------- forms ---------- */

.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack label {
    display: flex; flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
    letter-spacing: 0.02em;
}
.stack label > input,
.stack label > select,
.stack label > textarea { color: var(--text); font-size: 1rem; }

input, select, textarea {
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(6, 8, 22, 0.6);
    color: var(--text);
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
    width: 100%;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: rgba(126, 232, 250, 0.55);
    background: rgba(6, 8, 22, 0.85);
    box-shadow: 0 0 0 3px rgba(126, 232, 250, 0.12), var(--glow-aurora);
}
input[type="checkbox"], input[type="radio"] {
    width: auto;
    accent-color: var(--aurora);
}
textarea { resize: vertical; min-height: 84px; }

label.checkbox {
    flex-direction: row; align-items: center;
    gap: 0.5rem; margin-top: 0.5rem;
    color: var(--text);
}

/* ---------- buttons ---------- */

button, .button {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 0.5rem;
    position: relative;
    padding: 0.65rem 1.1rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.93rem;
    letter-spacing: 0.01em;
    border-radius: var(--radius-sm);
    color: #06081a;
    background: linear-gradient(135deg, var(--aurora) 0%, var(--aurora-2) 100%);
    border: 1px solid transparent;
    transition: transform 120ms ease, box-shadow 200ms ease, filter 150ms ease;
    box-shadow: 0 0 0 1px rgba(126,232,250,0.25), 0 10px 25px -10px rgba(126,232,250,0.45);
}
button:hover, .button:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
    box-shadow: 0 0 0 1px rgba(126,232,250,0.4), 0 18px 32px -8px rgba(126,232,250,0.55);
    text-decoration: none;
    color: #06081a;
    border-bottom: none;
}
button:active { transform: translateY(0); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
    box-shadow: none;
}
button.ghost:hover {
    background: rgba(126,232,250,0.08);
    border-color: rgba(126,232,250,0.5);
    filter: none;
}

button.danger {
    background: linear-gradient(135deg, #ff5e7a 0%, #ff8a5b 100%);
    color: #1b0413;
    box-shadow: 0 0 0 1px rgba(255,110,136,0.3), 0 10px 25px -10px rgba(255,110,136,0.5);
}
button.danger:hover {
    color: #1b0413;
    box-shadow: 0 0 0 1px rgba(255,110,136,0.5), 0 18px 32px -8px rgba(255,110,136,0.6);
}

/* ---------- rows / utilities ---------- */

.row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.row-between {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.row-end { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.hidden { display: none !important; }

/* ---------- flash / messages ---------- */

.flash {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
    background: var(--panel);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.94rem;
}
.flash.success { border-color: rgba(94,234,212,0.35); background: rgba(94,234,212,0.08); color: #c8fbed; }
.flash.error   { border-color: rgba(255,110,136,0.35); background: rgba(255,110,136,0.08); color: #ffd0d8; }

.err { color: var(--danger); font-size: 0.88rem; margin-top: 0.15rem; }

/* ---------- breadcrumbs ---------- */

.breadcrumbs {
    font-size: 0.98rem;
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem;
    font-family: var(--font-display);
    font-weight: 500;
}
.breadcrumbs a { color: var(--muted); border-bottom: none; }
.breadcrumbs a:hover { color: var(--aurora); }
.breadcrumbs .sep { color: var(--dim); font-weight: 400; }
.breadcrumbs a[data-drop-folder-id].drop-over {
    color: var(--aurora);
    background: rgba(126,232,250,0.12);
    border-radius: 6px;
    padding: 2px 8px;
    box-shadow: var(--glow-aurora);
}

/* ---------- toolbar / quota ---------- */

.toolbar {
    display: flex; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap;
}

.quota {
    font-size: 0.85rem;
    color: var(--muted);
    text-align: right;
    min-width: 200px;
    font-family: var(--font-mono);
}
.quota .bar {
    height: 6px;
    background: rgba(180,200,255,0.08);
    border-radius: 999px;
    margin-top: 0.35rem;
    overflow: hidden;
}
.quota .bar span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--aurora), var(--nebula));
    box-shadow: 0 0 12px rgba(126,232,250,0.5);
    transition: width 400ms ease;
}

/* ---------- dropzone ---------- */

.dropzone {
    position: relative;
    border: 1.5px dashed rgba(126,232,250,0.25);
    border-radius: var(--radius);
    padding: 1rem;
    min-height: 240px;
    background: var(--panel);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
.dropzone.dragover {
    border-color: var(--aurora);
    background: rgba(126,232,250,0.05);
    box-shadow: 0 0 0 1px rgba(126,232,250,0.35), 0 0 60px rgba(126,232,250,0.15);
}
.dz-label {
    position: absolute; top: 0.6rem; right: 1rem;
    color: var(--dim);
    font-size: 0.82rem;
    font-family: var(--font-mono);
    pointer-events: none;
    letter-spacing: 0.04em;
}

/* ---------- tables ---------- */

table.files {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1.25rem;
}
table.files th, table.files td {
    padding: 0.75rem 0.9rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}
table.files th {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--font-display);
}
table.files tbody tr { transition: background 150ms ease; }
table.files tbody tr:hover { background: rgba(126,232,250,0.04); }

.item { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); border-bottom: none; }
.item.folder { font-weight: 500; }
.item .icon { font-size: 1.1rem; filter: drop-shadow(0 0 6px rgba(126,232,250,0.3)); }

.actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.actions a, .actions button {
    background: rgba(255,255,255,0.03);
    color: var(--aurora);
    border: 1px solid var(--border);
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
    border-radius: 6px;
    box-shadow: none;
    transition: background 150ms, border-color 150ms, color 150ms;
}
.actions a:hover, .actions button:hover {
    background: rgba(126,232,250,0.1);
    border-color: rgba(126,232,250,0.4);
    color: #c7f2fb;
    transform: none;
    box-shadow: none;
}
.actions button.danger {
    background: rgba(255,110,136,0.05);
    color: #ffc0cc;
    border-color: rgba(255,110,136,0.28);
}
.actions button.danger:hover {
    background: rgba(255,110,136,0.15);
    border-color: rgba(255,110,136,0.55);
    color: #fff;
}
.actions a { border-bottom: 1px solid var(--border); }

/* mobile table fallback — horizontal scroll */
.table-wrap { overflow-x: auto; }
@media (max-width: 640px) {
    table.files th, table.files td { padding: 0.55rem 0.6rem; font-size: 0.88rem; }
    .actions { gap: 0.3rem; }
    .actions a, .actions button { padding: 0.3rem 0.5rem; font-size: 0.78rem; }
}

/* ---------- share URL input ---------- */

.share-url-input {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: rgba(0,0,0,0.35);
    color: #d6e8ff;
}

/* ---------- search form ---------- */

.search-form {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin: 1rem 0 1.5rem;
    background: var(--panel);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.search-row {
    display: grid;
    grid-template-columns: 2fr repeat(5, 1fr);
    gap: 0.85rem;
}
.search-row label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.search-row input, .search-row select { padding: 0.55rem 0.7rem; font-size: 0.95rem; }
.search-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
@media (max-width: 900px) { .search-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .search-row { grid-template-columns: 1fr; } }

/* ---------- drag-to-move ---------- */

tr.draggable { cursor: grab; }
tr.draggable.dragging { opacity: 0.35; cursor: grabbing; }
tr.drop-over, tr.drop-over > td {
    background: rgba(126,232,250,0.12) !important;
    box-shadow: inset 0 0 0 1px rgba(126,232,250,0.45);
}
tr.drop-target { transition: background-color 120ms ease, box-shadow 120ms ease; }

/* ---------- upload tray ---------- */

.upload-tray {
    position: fixed;
    bottom: 1.25rem; right: 1.25rem;
    width: min(360px, 92vw);
    max-height: 60vh;
    overflow: auto;
    background: var(--panel-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    box-shadow: 0 30px 60px rgba(0,0,0,0.65), 0 0 0 1px rgba(126,232,250,0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 50;
    animation: trayIn 200ms ease;
}
@keyframes trayIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.upload-tray h3 { margin: 0 0 0.6rem; font-size: 0.95rem; font-family: var(--font-display); letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }
.upload-tray ul { list-style: none; padding: 0; margin: 0; }
.upload-tray li {
    margin-bottom: 0.65rem;
    font-size: 0.86rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border);
}
.upload-tray li:last-child { border-bottom: none; }
.upload-tray .pbar {
    height: 4px;
    background: rgba(180,200,255,0.08);
    border-radius: 999px;
    margin-top: 4px;
    overflow: hidden;
}
.upload-tray .pbar span {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--aurora), var(--nebula));
    box-shadow: 0 0 10px rgba(126,232,250,0.5);
    transition: width .25s;
}
.upload-tray .status.done   { color: var(--ok); }
.upload-tray .status.err    { color: var(--danger); }

/* ---------- native <dialog> styling (share create, share edit) ---------- */

dialog {
    border: 1px solid var(--border-strong);
    background: var(--panel-solid);
    color: var(--text);
    border-radius: var(--radius);
    padding: 1.75rem;
    width: min(520px, 92vw);
    box-shadow: 0 40px 80px rgba(0,0,0,0.75), 0 0 0 1px rgba(126,232,250,0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
dialog::backdrop { background: rgba(4, 5, 18, 0.7); backdrop-filter: blur(4px); }
dialog h2 { font-family: var(--font-display); margin-bottom: 0.25rem; }

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

#toastStack {
    position: fixed; top: 1rem; right: 1rem; z-index: 200;
    display: flex; flex-direction: column; gap: 0.6rem;
    width: min(360px, 92vw);
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--panel-solid);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: toastIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
    font-size: 0.92rem;
}
.toast.leave { animation: toastOut 220ms ease forwards; }
.toast .dot {
    flex: none; width: 10px; height: 10px; border-radius: 999px;
    margin-top: 0.45rem;
    background: var(--aurora);
    box-shadow: 0 0 10px var(--aurora);
}
.toast.ok      .dot { background: var(--ok);     box-shadow: 0 0 12px var(--ok); }
.toast.error   .dot { background: var(--danger); box-shadow: 0 0 12px var(--danger); }
.toast.info    .dot { background: var(--aurora); box-shadow: 0 0 12px var(--aurora); }
.toast .msg { flex: 1 1 auto; }
.toast .close {
    background: transparent; color: var(--dim);
    padding: 0; width: 22px; height: 22px;
    border-radius: 6px; box-shadow: none;
    border: 1px solid transparent;
    font-size: 1rem; line-height: 1;
}
.toast .close:hover { background: rgba(255,255,255,0.08); color: var(--text); transform: none; filter: none; box-shadow: none; }

@keyframes toastIn {
    from { opacity: 0; transform: translate(20px, -4px); }
    to   { opacity: 1; transform: translate(0, 0); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translate(20px, -4px); }
}

/* ---------- UI modal (custom alert / confirm / prompt) ---------- */

#uiModalRoot {
    position: fixed; inset: 0;
    display: none;
    z-index: 150;
    align-items: center; justify-content: center;
    padding: 1rem;
    background: rgba(4, 5, 18, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: uiFadeIn 180ms ease;
}
#uiModalRoot.open { display: flex; }
.ui-modal {
    position: relative;
    width: min(460px, 100%);
    background: linear-gradient(160deg, rgba(20, 24, 58, 0.92) 0%, rgba(10, 12, 34, 0.92) 100%);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 1.6rem 1.75rem 1.4rem;
    box-shadow: 0 40px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(126,232,250,0.18), 0 0 60px rgba(192,132,252,0.12);
    animation: uiRise 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ui-modal::before {
    content: "";
    position: absolute; inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(126,232,250,0.4), transparent 40%, rgba(192,132,252,0.4) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}
.ui-modal h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin: 0 0 0.4rem;
    background: linear-gradient(100deg, #fff 0%, var(--aurora) 60%, var(--nebula) 100%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}
.ui-modal .body { color: var(--muted); margin: 0 0 1.1rem; }
.ui-modal .body strong { color: var(--text); }
.ui-modal input, .ui-modal select, .ui-modal textarea { margin-bottom: 1rem; }
.ui-modal .actions-row {
    display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap;
}
.ui-modal .actions-row button { padding: 0.55rem 1rem; }
.ui-modal .radio-list {
    display: flex; flex-direction: column; gap: 0.4rem;
    margin-bottom: 1rem;
}
.ui-modal .radio-list label {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--text);
    transition: border-color 150ms ease, background 150ms ease;
}
.ui-modal .radio-list label:hover { border-color: rgba(126,232,250,0.45); }
.ui-modal .radio-list label.selected {
    border-color: rgba(126,232,250,0.6);
    background: rgba(126,232,250,0.08);
}

@keyframes uiFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes uiRise {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- footer ---------- */

.footer {
    position: relative;
    margin-top: 4rem;
    padding: 2.5rem clamp(1rem, 3vw, 2rem) 2rem;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, transparent, rgba(5,7,21,0.8));
    text-align: center;
    font-size: 0.86rem;
    color: var(--muted);
}
.footer .footer-inner {
    max-width: 1160px;
    margin: 0 auto;
    display: flex; flex-direction: column; gap: 0.6rem; align-items: center;
}
.footer .foot-nav {
    display: flex; flex-wrap: wrap; gap: 0.15rem 1.5rem; justify-content: center;
}
.footer .foot-nav a {
    color: var(--muted);
    border-bottom: none;
    font-size: 0.88rem;
}
.footer .foot-nav a:hover { color: var(--aurora); }
.footer .foot-mark {
    font-family: var(--font-display);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--dim);
}

/* ---------- auth pages flourish ---------- */

.auth-stage {
    position: relative;
    min-height: calc(100vh - 220px);
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
}
.auth-stage::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(500px 400px at 50% 50%, rgba(126,232,250,0.06), transparent 60%);
    pointer-events: none;
}
.auth-card {
    position: relative;
    max-width: 420px; width: 100%;
    padding: 2rem 2rem 1.75rem;
}
.auth-card .hint { color: var(--muted); font-size: 0.88rem; margin-top: -0.6rem; margin-bottom: 1rem; }
.auth-links {
    display: flex; justify-content: space-between; gap: 1rem;
    margin-top: 1.25rem; font-size: 0.88rem; flex-wrap: wrap;
}

.orbit {
    position: absolute; pointer-events: none;
    width: 320px; height: 320px;
    border: 1px dashed rgba(126,232,250,0.18);
    border-radius: 50%;
    top: -60px; right: -80px;
    animation: orbit 40s linear infinite;
}
.orbit::after {
    content: "";
    position: absolute; top: -5px; left: 50%;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--aurora);
    box-shadow: 0 0 18px var(--aurora);
    transform: translateX(-50%);
}
@keyframes orbit {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@media (max-width: 520px) {
    .orbit { display: none; }
    .auth-card { padding: 1.5rem 1.25rem; }
}

/* ---------- status pills ---------- */

.status-ok, .status-bad {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.status-ok  { color: var(--ok);     background: rgba(94,234,212,0.1);  border: 1px solid rgba(94,234,212,0.35); }
.status-bad { color: var(--danger); background: rgba(255,110,136,0.1); border: 1px solid rgba(255,110,136,0.35); }

/* ---------- stats page ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.stat-card {
    padding: 1.25rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 250ms ease, border-color 250ms ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(126,232,250,0.35);
}
.stat-card .label {
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.3rem;
}
.stat-card .value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    background: linear-gradient(100deg, #fff 0%, var(--aurora) 70%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    word-break: break-word;
}
.stat-card .sub { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }

/* ---------- legal pages ---------- */

.legal {
    max-width: 820px;
    margin: 2rem auto;
    padding: clamp(1.5rem, 4vw, 2.5rem);
}
.legal h2 { font-family: var(--font-display); margin-top: 2rem; }
.legal p, .legal li { line-height: 1.75; color: #cfd6ef; }
.legal ul { padding-left: 1.25rem; }
.legal .updated { font-family: var(--font-mono); font-size: 0.8rem; color: var(--dim); }

/* ---------- misc ---------- */

code {
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border);
    padding: 0.12rem 0.4rem;
    border-radius: 5px;
    font-size: 0.88em;
    color: var(--aurora);
}

.pagination { display: flex; gap: 0.35rem; margin-top: 1rem; flex-wrap: wrap; }
.pagination a {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
}
.pagination a:hover { color: var(--text); border-color: var(--border-strong); }
.pagination a.active {
    background: linear-gradient(135deg, var(--aurora), var(--aurora-2));
    color: #06081a;
    border-color: transparent;
}

/* Share view page tiny niceties */
.share-hero {
    text-align: center;
    padding: 2rem 0 1rem;
}
.share-hero .kind {
    font-family: var(--font-mono);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
}

/* ---------- responsive topbar inner stacking ---------- */

@media (max-width: 820px) {
    .row-between { flex-direction: column; align-items: flex-start; }
    .quota { text-align: left; }
}
