:root {
    color-scheme: light;
    --canvas: #edf1f7;
    --paper: #fdfdff;
    --ink: #111d36;
    --muted: #455570;
    --line: #ccd6e7;
    --blue: #174cf2;
    --blue-hover: #103bd0;
    --soft: #e9f0ff;
    --danger: #a42638;
    --radius: 11px;
    font-family: "Segoe UI", "Tahoma", sans-serif;
    background: var(--canvas);
    color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding: clamp(12px, 4vw, 48px); }
button, input, select { font: inherit; }
button, a, label, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #405fb5; outline-offset: 4px; }
p { margin: 0; }

.shell {
    width: min(100%, 890px);
    min-height: 70vh;
    margin-inline: auto;
    border: 1px solid #bccbe2;
    border-radius: 16px;
    background: var(--paper);
    box-shadow: 0 18px 55px #142b5710;
}
.topbar {
    min-height: 72px;
    padding: 12px clamp(18px, 4vw, 34px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 25px; font-weight: 750; letter-spacing: -.035em; }
.brand-mark { color: var(--blue); font-size: 30px; font-weight: 400; line-height: 1; letter-spacing: -.24em; padding-right: .19em; }
main { padding: clamp(20px, 4vw, 34px); }
h1, h2 { margin: 0; letter-spacing: -.038em; line-height: 1.16; }
h1 { font-size: clamp(32px, 5.5vw, 51px); }
.section-title { font-size: 27px; }
.section-title.small { font-size: 20px; margin-bottom: 12px; }
.subtle { color: var(--muted); font-size: .91rem; }
.status { color: var(--muted); font-size: .94rem; line-height: 1.45; }
.status:not(:empty) { margin-block: 12px; }
.status.error { color: var(--danger); }
.status.success { color: #176343; }

.quota { display: flex; align-items: center; gap: 17px; margin-top: 24px; font-weight: 650; }
.quota span { flex-shrink: 0; }
.quota-detail { margin-top: 7px; }
progress { border: 0; border-radius: 99px; background-color: #dce5f5; height: 10px; min-width: 0; flex: 1; accent-color: var(--blue); }
progress::-webkit-progress-bar { background-color: #dce5f5; border-radius: 99px; }
progress::-webkit-progress-value { background-color: var(--blue); border-radius: 99px; }
progress::-moz-progress-bar { background-color: var(--blue); border-radius: 99px; }

.dropzone {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 10px;
    min-height: 170px;
    margin-top: 24px;
    border: 1px dashed #92a8d1;
    border-radius: var(--radius);
    background: #f7faff;
    cursor: pointer;
    transition: background .16s, border-color .16s;
}
.dropzone:hover, .dropzone.drag { background: #edf3ff; border-color: var(--blue); }
.dropzone:has(+ input:focus-visible) { outline: 3px solid #405fb5; outline-offset: 4px; }
.dropzone:has(+ input:disabled) { opacity: .58; cursor: default; }
.upload-mark { font-size: 36px; line-height: .9; color: var(--blue); border-bottom: 2px solid currentColor; padding: 0 8px 4px; }
.selected-file { overflow-wrap: anywhere; margin-top: 10px; color: var(--muted); }
.retention { padding: 0; margin: 20px 0 0; border: 0; min-width: 0; }
.retention legend { margin-bottom: 10px; font-weight: 650; }
.segments {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid #aebddd;
    border-radius: 9px;
    overflow: hidden;
}
.segments label { position: relative; }
.segments label + label { border-inline-start: 1px solid #aebddd; }
.segments span { display: grid; min-height: 42px; place-items: center; cursor: pointer; }
.segments input, .visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.segments input:checked + span { background: var(--blue); color: white; font-weight: 650; }
.segments input:focus-visible + span { outline: 2px solid #405fb5; outline-offset: -4px; }
.segments input:checked:focus-visible + span { outline-color: white; }
.segments input:disabled + span { cursor: default; opacity: .6; }
#start-upload { margin-top: 17px; }

.button, button {
    min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
    padding: 7px 13px; border: 1px solid transparent; border-radius: 8px;
    cursor: pointer; line-height: 1.2; text-decoration: none; font-weight: 600;
}
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: var(--blue-hover); }
.soft { background: #dce8ff; color: #172e68; }
.outline { background: var(--soft); color: #163b9d; border-color: #b2c4e7; }
.outline:hover, .quiet:hover { background: #dce7ff; }
.quiet { background: transparent; color: var(--ink); }
.danger { background: var(--danger); color: white; }
button:disabled { opacity: .55; cursor: default; }

.active, #pending-section { margin-top: 22px; }
.inventory { border-top: 1px solid var(--line); margin-top: 27px; padding-top: 23px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.file-list { list-style: none; padding: 0; margin: 13px 0 0; display: grid; gap: 9px; }
.file-row {
    min-height: 73px; display: flex; align-items: center; gap: 12px;
    padding: 11px; border: 1px solid var(--line); border-radius: var(--radius);
    background: #fbfcff;
}
.file-icon {
    display: grid; place-items: center;
    width: 43px; height: 43px; flex: 0 0 auto; border-radius: 10px;
    background: #e2edff; color: #204cb1;
}
.file-icon::before {
    content: ""; box-sizing: border-box; width: 43%; height: 57%;
    border: 2px solid currentColor; border-radius: 3px;
    background: linear-gradient(135deg, transparent 52%, #a9c4ff 53%) right top / 42% 32% no-repeat;
}
.file-label { flex: 2; min-width: 0; display: grid; gap: 4px; overflow-wrap: anywhere; }
.file-actions { display: flex; align-items: center; gap: 8px; }
.file-actions button { min-height: 36px; }
details { position: relative; }
summary {
    display: grid; place-items: center; width: 37px; height: 36px;
    border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
    list-style: none; font-size: 19px; line-height: 1;
}
summary::-webkit-details-marker { display: none; }
details[open] { z-index: 1; }
.menu {
    display: grid; position: absolute; z-index: 1; top: calc(100% + 5px); right: 0;
    min-width: max-content; padding: 4px; border: 1px solid var(--line); border-radius: 9px;
    background: var(--paper); box-shadow: 0 8px 24px #15275323;
}
.menu button { justify-content: flex-start; }
.menu .remove { color: var(--danger); }
.empty { margin-top: 15px; padding: 17px; border: 1px dashed var(--line); border-radius: var(--radius); }

.login { max-width: 385px; margin: 18px auto 50px; }
.login h1 { font-size: 33px; }
.login form { margin-top: 23px; display: grid; gap: 11px; }
input[type=password], select {
    width: 100%; min-height: 42px; padding: 8px 11px; border-radius: 8px;
    border: 1px solid #adbfdd; color: var(--ink); background: #fff;
}
.login label, dialog label { font-weight: 650; }
.share-shell { max-width: 610px; min-height: min(700px, calc(100dvh - 60px)); }
.share-main { padding-top: clamp(27px, 8vw, 81px); }
.share-card {
    text-align: center; display: grid; justify-items: center;
    border: 1px solid var(--line); border-radius: 13px;
    background: #fbfcff; padding: clamp(19px, 5vw, 32px);
}
.hero-icon { width: 87px; height: 87px; border-radius: 17px; margin-bottom: 16px; }
.hero-icon::before { border-width: 3px; border-radius: 5px; }
.share-card h1 { font-size: clamp(25px, 5.4vw, 36px); overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.share-card .size { margin-top: 9px; }
.share-card .primary { width: 100%; margin: 24px 0 12px; min-height: 48px; }
.share-main > .status { text-align: center; }

dialog { width: min(420px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 14px; padding: 23px; color: var(--ink); }
dialog::backdrop { background: #10213b66; }
dialog h2 { font-size: 23px; }
.dialog-copy { margin: 12px 0 17px; overflow-wrap: anywhere; }
dialog select { margin-top: 7px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 19px; }

@media (max-width: 560px) {
    .topbar { min-height: 59px; }
    .brand { font-size: 22px; }
    .segments span { font-size: .84rem; }
    .file-row { flex-wrap: wrap; }
    .file-actions { margin-inline-start: auto; }
    .active progress { flex-basis: 100%; }
}
