:root {
    color-scheme: light dark;
    --bg: #fbfbfa;
    --fg: #16150f;
    --muted: #6b6a60;
    --rule: #dedcd3;
    --accent: #b4531f;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12110e;
        --fg: #f2f0e8;
        --muted: #918d80;
        --rule: #2b2924;
        --accent: #e2854a;
    }
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
}

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

.page {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 2rem 1.5rem;
}

.site-footer {
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted);
    border-top: 1px solid var(--rule);
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.site-footer .sep {
    margin: 0 0.5rem;
}

/* ---------- hero ---------- */

.hero {
    width: 100%;
    max-width: 34rem;
    text-align: center;
}

.mark {
    font-size: clamp(2.75rem, 12vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1;
    margin: 0;
}

.mark span {
    color: var(--accent);
}

.tagline {
    margin: 1.25rem 0 0;
    font-size: clamp(1.05rem, 3.2vw, 1.3rem);
    line-height: 1.5;
    font-weight: 400;
}

.hero hr {
    border: 0;
    border-top: 1px solid var(--rule);
    margin: 2.25rem auto;
    width: 4rem;
}

.note {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--muted);
}

.badge {
    display: inline-block;
    margin-top: 1.75rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- blazor error ui ---------- */

#blazor-error-ui {
    color-scheme: light only;
    background: #ffe9c9;
    color: #16150f;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ---------- private area (/me) ---------- */

.private {
    width: 100%;
    max-width: 52rem;
    padding: 1rem 0 2rem;
}

.private-head {
    text-align: left;
    margin-bottom: 2.5rem;
}

.private-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.private-head h1 {
    margin: 1rem 0 0.5rem;
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.private-sub {
    margin: 0;
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
}

.card {
    border: 1px solid var(--rule);
    border-radius: 0.6rem;
    padding: 1.25rem;
    background: color-mix(in srgb, var(--fg) 3%, transparent);
}

.card h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.card p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--muted);
}

.card code {
    font-size: 0.8125em;
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
    background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.private-foot {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
    font-size: 0.875rem;
}

.private-foot a {
    color: var(--muted);
    text-decoration: none;
}

.private-foot a:hover {
    color: var(--accent);
}

/* ---------- admin + recipient UI ---------- */

.you {
    width: 100%;
    max-width: 46rem;
    padding: 1rem 0 2rem;
}

.crumb {
    font-size: 0.8125rem;
    color: var(--muted);
    text-decoration: none;
}

.crumb:hover { color: var(--accent); }

.panel {
    border: 1px solid var(--rule);
    border-radius: 0.6rem;
    padding: 1.25rem 1.35rem 1.4rem;
    margin-bottom: 1.25rem;
    background: color-mix(in srgb, var(--fg) 3%, transparent);
}

.panel h2 {
    margin: 0 0 0.85rem;
    font-size: 1rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
}

.hint {
    margin: 0 0 0.85rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--muted);
}

.empty {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
    font-style: italic;
}

.opt {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--muted);
}

/* forms */

.stack { display: flex; flex-direction: column; gap: 0.75rem; align-items: flex-start; }
.stack .row { display: flex; flex-wrap: wrap; gap: 0.75rem; width: 100%; }
.stack .row label { flex: 1 1 12rem; }

label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.8125rem;
    font-weight: 500;
    width: 100%;
}

input[type="text"], input[type="password"], input:not([type]), textarea {
    font: inherit;
    font-size: 0.9375rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--rule);
    border-radius: 0.4rem;
    background: var(--bg);
    color: var(--fg);
    width: 100%;
}

input[type="file"] { font-size: 0.875rem; color: var(--muted); }

textarea { resize: vertical; line-height: 1.6; font-family: inherit; }

input:focus-visible, textarea:focus-visible, .btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.upload { flex-direction: row; align-items: center; flex-wrap: wrap; }

.btn {
    display: inline-block;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--rule);
    border-radius: 0.4rem;
    background: transparent;
    color: var(--fg);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn.primary:hover { filter: brightness(1.08); color: #fff; }

.btn.danger { color: #c0392b; border-color: color-mix(in srgb, #c0392b 35%, var(--rule)); }
.btn.danger:hover { background: #c0392b; border-color: #c0392b; color: #fff; }

@media (prefers-color-scheme: dark) {
    .btn.danger { color: #ff8a75; }
    .btn.danger:hover { background: #c0392b; color: #fff; }
}

/* lists */

.user-list, .file-list { list-style: none; margin: 0; padding: 0; }

.user-list li, .file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.7rem 0;
    border-top: 1px solid var(--rule);
}

.user-list li:first-child, .file-list li:first-child { border-top: 0; }

.user-main, .file-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }

.user-name, .file-main a {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--fg);
    text-decoration: none;
    word-break: break-word;
}

.user-name:hover, .file-main a:hover { color: var(--accent); }

.user-display { font-size: 0.8125rem; color: var(--fg); }
.user-meta, .file-meta { font-size: 0.75rem; color: var(--muted); }

.user-actions { display: flex; gap: 0.5rem; align-items: center; }

.danger-zone { border-color: color-mix(in srgb, #c0392b 25%, var(--rule)); }

/* flash messages */

.flash {
    margin: 0 0 1.25rem;
    padding: 0.6rem 0.85rem;
    border-radius: 0.4rem;
    font-size: 0.875rem;
    border: 1px solid var(--rule);
}

.flash.ok  { border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); }
.flash.err { border-color: color-mix(in srgb, #c0392b 45%, var(--rule)); color: #c0392b; }

@media (prefers-color-scheme: dark) { .flash.err { color: #ff8a75; } }

/* sign-in */

.signin { max-width: 21rem; margin: 0 auto; text-align: center; }
.signin .mark { font-size: clamp(2.25rem, 9vw, 3rem); }
.signin-sub { margin: 0.75rem 0 1.5rem; color: var(--muted); font-size: 0.9375rem; }
.signin .stack { text-align: left; }
.signin .btn { width: 100%; text-align: center; margin-top: 0.25rem; }
.signin-note { margin: 1.5rem 0 0; font-size: 0.75rem; color: var(--muted); line-height: 1.5; }

.you-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.you-head h1 {
    margin: 0.75rem 0 0;
    font-size: clamp(1.5rem, 5vw, 2rem);
    letter-spacing: -0.03em;
}

/* preserve the owner's line breaks without allowing markup */
.message {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.7;
    font-size: 0.9375rem;
}
