* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root { font: 16px Poppins, system-ui, sans-serif; color: #112b50; background: #edf5ff; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 18% 5%, #d4ecff, transparent 60%), #edf5ff; }
.top { min-height: 72px; padding: 0 clamp(1rem, 6vw, 5rem); display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid #d7e7fb; }
a { color: #0755c2; font-weight: 600; }
.brand { text-decoration: none; color: #16314f; font-size: 1.45rem; letter-spacing: -.065em; }
.brand span { color: #1263e5; }
main { max-width: 840px; margin: 2rem auto; padding: 0 1rem 3rem; }
.card, dialog { background: #fff; border: 1px solid #d6e6fa; border-radius: 20px; padding: clamp(1rem, 4vw, 1.7rem); box-shadow: 0 12px 36px #20599e12; }
.welcome { max-width: 430px; margin: clamp(2rem, 10vh, 7rem) auto 0; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.5rem, 5vw, 2rem); letter-spacing: -.045em; }
h2 { font-size: 1.22rem; letter-spacing: -.025em; }
.welcome p, dialog p { margin: .65rem 0 1.3rem; color: #415d7c; }
.stack { display: grid; gap: .7rem; min-width: 0; }
.split, .actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.split { justify-content: space-between; }
.end { justify-content: flex-end; margin-top: 1rem; }
label, button, .browse { font-size: .9rem; font-weight: 600; }
input, textarea, button { font: inherit; }
input:not([type=file]), textarea { width: 100%; border: 1px solid #b7cdeb; border-radius: 10px; padding: .65rem .8rem; color: inherit; background: #f8fbff; }
textarea { resize: vertical; }
button, .browse { background: #1263e5; color: #fff; border: 1px solid transparent; border-radius: 10px; padding: .6rem .92rem; font-size: .9rem; font-weight: 600; cursor: pointer; }
button:hover, .browse:hover { filter: brightness(.94); }
button:disabled { opacity: .6; cursor: wait; }
.secondary, .browse { color: #124fa0; background: #e9f3ff; border-color: #c9e0ff; }
.danger { color: #a3253f; background: #fff0f3; border-color: #f7cbd5; }
:focus-visible, .actions:focus-within .browse { outline: 3px solid #2581ff; outline-offset: 2px; }
#files { position: absolute; width: 1px; height: 1px; opacity: 0; }
.help, #selected, .meta { color: #45617f; font-size: .875rem; }
.items-head { margin: 1.7rem 0 .8rem; }
.empty { border-style: dashed; color: #45617f; text-align: center; }
.item { animation: enter .24s ease-out both; overflow-wrap: anywhere; }
.item img, .preview-items img { display: block; max-width: 100%; max-height: 360px; object-fit: contain; border-radius: 10px; }
.item textarea { min-height: 5rem; }
#status { margin-top: .85rem; color: #174c86; }
#status:empty { display: none; }
.upload { position: fixed; bottom: 1rem; right: 1rem; width: min(20rem, calc(100% - 2rem)); z-index: 2; }
progress { display: block; width: 100%; accent-color: #1263e5; margin-top: .4rem; }
dialog { width: min(480px, calc(100% - 2rem)); color: inherit; }
dialog::backdrop { background: #102e55aa; }
.preview-items { margin-top: .8rem; max-height: 50vh; overflow: auto; overflow-wrap: anywhere; }
.preview-items pre { margin: 0; white-space: pre-wrap; font: inherit; }
@keyframes enter { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .item { animation: none; } }
.admin-main { max-width: 1120px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .65rem; margin: 0; }
.admin-stats .card { padding: .85rem 1rem; }
.admin-stats dt { color: #45617f; font-size: .875rem; }
.admin-stats dd { margin: .2rem 0 0; font-weight: 600; overflow-wrap: anywhere; }
.admin-stats .storage-path { grid-column: 1 / -1; }
.admin-menu button[aria-pressed="false"] { color: #124fa0; background: #e9f3ff; border-color: #c9e0ff; }
.admin-main select { font: inherit; font-size: .875rem; color: inherit; background: #f8fbff; border: 1px solid #b7cdeb; border-radius: 10px; padding: .45rem; }
.admin-table { overflow-x: auto; }
.admin-table table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
.admin-table th, .admin-table td { padding: .65rem; border-bottom: 1px solid #d6e6fa; }
.admin-table td:first-child { min-width: 7rem; overflow-wrap: anywhere; }
.admin-table td:nth-child(2), .admin-table td:nth-child(4) { white-space: nowrap; }
.admin-table th { color: #124fa0; background: #edf5ff; }
