:root {
    --brand: #e7286b;
    --brand-dark: #bd174f;
    --action: #bd4d70;
    --action-hover: #a53f60;
    --action-shadow: rgb(165 63 96 / 18%);
    --slate: #a1b4be;
    --ink: #14252d;
    --muted: #61727a;
    --eyebrow: #9aa4a8;
    --line: #d9e1e5;
    --surface: #ffffff;
    --surface-soft: #f4f7f8;
    --page-glow: rgb(161 180 190 / 24%);
    --page-start: #f8fafb;
    --page-end: #eef3f5;
    --header-background: rgb(248 250 251 / 88%);
    --glass-surface: rgb(255 255 255 / 88%);
    --card-surface: rgb(255 255 255 / 94%);
    --success: #18794e;
    --success-soft: #e8f5ee;
    --warning: #8a5511;
    --warning-soft: #fff3d8;
    --error: #a32035;
    --error-soft: #fdecef;
    --shadow: 0 18px 50px rgb(20 37 45 / 10%);
    --radius-large: 24px;
    --radius-medium: 16px;
    --content-width: 1200px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --brand-dark: #dc88a5;
    --action: #8f5669;
    --action-hover: #a86379;
    --action-shadow: rgb(0 0 0 / 18%);
    --slate: #777777;
    --ink: #f0f0f0;
    --muted: #b5b5b5;
    --eyebrow: #b3b3b3;
    --line: #454545;
    --surface: #2b2b2b;
    --surface-soft: #353535;
    --page-glow: rgb(120 120 120 / 14%);
    --page-start: #252525;
    --page-end: #1b1b1b;
    --header-background: rgb(36 36 36 / 92%);
    --glass-surface: rgb(43 43 43 / 92%);
    --card-surface: rgb(43 43 43 / 96%);
    --success: #64c994;
    --success-soft: #1d3c2d;
    --warning: #f0be6a;
    --warning-soft: #42351e;
    --error: #ff8799;
    --error-soft: #472630;
    --shadow: 0 18px 50px rgb(0 0 0 / 28%);
    color-scheme: dark;
}

:root[data-theme="light"] {
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --brand-dark: #dc88a5;
        --action: #8f5669;
        --action-hover: #a86379;
        --action-shadow: rgb(0 0 0 / 18%);
        --slate: #777777;
        --ink: #f0f0f0;
        --muted: #b5b5b5;
        --eyebrow: #b3b3b3;
        --line: #454545;
        --surface: #2b2b2b;
        --surface-soft: #353535;
        --page-glow: rgb(120 120 120 / 14%);
        --page-start: #252525;
        --page-end: #1b1b1b;
        --header-background: rgb(36 36 36 / 92%);
        --glass-surface: rgb(43 43 43 / 92%);
        --card-surface: rgb(43 43 43 / 96%);
        --success: #64c994;
        --success-soft: #1d3c2d;
        --warning: #f0be6a;
        --warning-soft: #42351e;
        --error: #ff8799;
        --error-soft: #472630;
        --shadow: 0 18px 50px rgb(0 0 0 / 28%);
        color-scheme: dark;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 90% 8%, var(--page-glow), transparent 30rem),
        linear-gradient(180deg, var(--page-start) 0%, var(--page-end) 100%);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

button,
input,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

.page-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: 0.6rem;
    color: #fff;
    background: var(--ink);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid var(--line);
    background: var(--header-background);
}

.header-inner,
.nav-inner,
.footer-inner,
.content {
    width: min(calc(100% - 2rem), var(--content-width));
    margin-inline: auto;
}

.header-inner {
    display: flex;
    min-height: 5.25rem;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-nav {
    border-top: 1px solid var(--line);
}

.nav-inner {
    display: flex;
    min-height: 3rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-link {
    position: relative;
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-link::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    border-radius: 999px;
    background: transparent;
    content: "";
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--ink);
}

.nav-link.is-active::after {
    background: var(--brand);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
}

.brand-mark {
    width: 3.15rem;
    height: auto;
}

.brand-copy {
    display: grid;
    line-height: 1.15;
}

.brand-copy strong {
    font-size: 1.08rem;
    letter-spacing: -0.02em;
}

.brand-copy span {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-copy {
    max-width: 18rem;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.85rem;
    text-overflow: ellipsis;
}

.theme-toggle {
    display: inline-flex;
    width: 2.5rem;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--line);
    background: var(--surface-soft);
}

.site-main {
    flex: 1;
}

.content {
    padding-block: clamp(2rem, 5vw, 4.5rem);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    line-height: 1.12;
    letter-spacing: -0.035em;
}

h1 {
    margin-bottom: 1rem;
    font-size: clamp(2.25rem, 6vw, 4.8rem);
}

h2 {
    margin-bottom: 0.75rem;
    font-size: 1.45rem;
}

.eyebrow {
    margin-bottom: 0.75rem;
    color: var(--eyebrow);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.lead,
.login-note,
.empty-copy {
    color: var(--muted);
}

.lead {
    max-width: 42rem;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.button {
    display: inline-flex;
    min-height: 2.85rem;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: auto;
    padding: 0.72rem 1.05rem;
    border: 1px solid transparent;
    border-radius: 0.8rem;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    transition: transform 160ms ease, background 160ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgb(231 40 107 / 35%);
    outline-offset: 3px;
}

.button-primary {
    color: #fff;
    background: var(--action);
    box-shadow: 0 8px 22px var(--action-shadow);
}

.button-primary:hover:not(:disabled) {
    background: var(--action-hover);
}

.button-secondary,
.button-quiet {
    border-color: var(--line);
    color: var(--ink);
    background: var(--surface);
}

.button-quiet {
    background: transparent;
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
    border-color: var(--slate);
    background: var(--surface-soft);
}

.button-small {
    min-height: 2.5rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
}

.text-link {
    color: var(--brand-dark);
    font-weight: 700;
}

.login-layout {
    display: grid;
    min-height: min(42rem, calc(100dvh - 14rem));
    align-items: center;
    grid-template-columns: minmax(0, 1.1fr) minmax(20rem, 0.9fr);
    gap: clamp(2rem, 7vw, 7rem);
}

.login-copy {
    max-width: 46rem;
}

.login-blocks {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
    max-width: 34rem;
}

.login-block,
.panel,
.transfer-card,
.status-panel {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-medium);
    background: var(--card-surface);
    box-shadow: var(--shadow);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.login-block:hover,
.transfer-card:hover {
    border-color: var(--slate);
    box-shadow: 0 22px 54px rgb(20 37 45 / 14%);
    transform: translateY(-2px);
}

.login-block h2 {
    font-size: 1.25rem;
}

.login-visual {
    position: relative;
    display: grid;
    aspect-ratio: 1;
    width: min(100%, 30rem);
    place-items: center;
    justify-self: end;
    border: 1px solid rgb(161 180 190 / 30%);
    border-radius: 50%;
    background: linear-gradient(145deg, var(--glass-surface), var(--page-glow));
    box-shadow: var(--shadow);
}

.login-visual img {
    position: relative;
    z-index: 2;
    width: 38%;
}

.visual-orbit {
    position: absolute;
    border: 1px solid rgb(231 40 107 / 25%);
    border-radius: 50%;
}

.orbit-one {
    width: 76%;
    height: 76%;
}

.orbit-two {
    width: 52%;
    height: 52%;
    border-color: rgb(161 180 190 / 75%);
}

.stack {
    display: grid;
    gap: 0.85rem;
}

.stack label,
.login-block label {
    display: grid;
    gap: 0.35rem;
    font-weight: 700;
}

input[type="text"],
input[type="email"],
input:not([type]),
textarea,
#transfer-code,
#otp-code,
#dev-email,
#guest-email,
#new-title,
#edit-title-field {
    width: 100%;
    min-height: 2.85rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    color: var(--ink);
    background: var(--surface);
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--brand);
}

.file-picker {
    position: relative;
}

.file-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.panel,
.transfer-list {
    margin-top: 1.5rem;
}

.transfer-list {
    display: grid;
    gap: 1rem;
}

.guest-list {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
}

.link-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.link-row code {
    overflow-wrap: anywhere;
}

.file-size,
.file-kind,
.pending-note {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.file-kind {
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table th,
.file-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.check-cell {
    width: 3.4rem;
}

.drop-zone {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    margin: 0.2rem 0 0.4rem;
    padding: 1.5rem 1.25rem 1.25rem;
    border: 1.5px dashed var(--slate);
    border-radius: 1.2rem;
    background: var(--surface-soft);
    text-align: center;
}

.drop-zone.is-hot {
    border-color: var(--brand);
}

.drop-zone strong {
    font-size: 1.25rem;
    letter-spacing: -0.03em;
}

.drop-zone p {
    margin: 0 0 0.45rem;
    color: var(--muted);
}

.icon-button {
    width: 2.7rem;
    min-height: 2.7rem;
    padding: 0;
}

.icon-glyph {
    width: 1.15rem;
    height: 1.15rem;
    background: currentColor;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.icon-download {
    -webkit-mask-image: url("download-arrow.png");
    mask-image: url("download-arrow.png");
}

.icon-delete {
    -webkit-mask-image: url("delete.png");
    mask-image: url("delete.png");
}

.settings-foot {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

.file-name {
    font-weight: 700;
}

.self-badge {
    display: inline-block;
    margin-left: 0.45rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    color: #fff;
    background: var(--brand);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    vertical-align: 0.15em;
}

.is-pending {
    color: var(--muted);
}

.is-pending .file-name,
.file-name.is-deleted {
    text-decoration: line-through;
}

.summary,
.card-facts {
    color: var(--muted);
}

.sort-row {
    display: flex;
    gap: 1.25rem;
}

.sort-link {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.sort-link.is-active {
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--brand);
}

.is-stale {
    color: var(--error);
    font-weight: 700;
}

.flash {
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 0.8rem;
}

.flash-error {
    color: var(--error);
    background: var(--error-soft);
}

.status-panel {
    width: min(100%, 44rem);
    margin: clamp(2rem, 8vh, 7rem) auto;
}

.legal {
    width: min(100%, 42rem);
}

.legal h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.legal h2 {
    margin-top: 1.8rem;
}

.legal address {
    margin-bottom: 0.75rem;
    font-style: normal;
}

.legal address + address {
    margin-top: 0.8rem;
}

.site-footer {
    color: var(--muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1rem;
}

.footer-links a {
    font-weight: 700;
    text-decoration: none;
}

.footer-inner {
    display: flex;
    min-height: 4rem;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--line);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

@media (max-width: 760px) {
    .login-layout {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .login-visual {
        grid-row: 1;
        width: min(68vw, 18rem);
        margin-inline: auto;
        justify-self: center;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 0.25rem;
    }
}
