:root {
    --bg:        #ffffff;
    --bg-2:      #f3f5ef;
    --fg:        #14170f;
    --fg-2:      #5c6156;
    --line:      #d4d9cc;
    --accent:    #2e7d32;
    --accent-fg: #ffffff;
    --danger:    #a81f18;

    --r: 10px;
    --gutter: clamp(24px, 4vw, 56px);

    --font: 'PixelMplus12', 'Hiragino Sans', 'Yu Gothic UI', 'Yu Gothic', Meiryo,
            system-ui, sans-serif;
    --mono: 'PixelMplus12', ui-monospace, SFMono-Regular, 'Cascadia Code',
            Consolas, monospace;
}

[data-theme="dark"] {
    --bg:        #101210;
    --bg-2:      #1c1f1b;
    --fg:        #e8eae2;
    --fg-2:      #9ba196;
    --line:      #363b33;
    --accent:    #81c784;
    --accent-fg: #08240f;
    --danger:    #ff9d94;
}

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

[hidden] { display: none !important; }

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

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.7;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    display: flex; flex-direction: column;
    -webkit-font-smoothing: none;
    font-smooth: never;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px var(--gutter);
    border-bottom: 1px solid var(--line);
}
main {
    flex: 1;
    display: flex; align-items: center;
    padding: clamp(40px, 6vh, 72px) var(--gutter);
}
main > * { width: 100%; }
footer {
    padding: 24px var(--gutter) 28px;
    font-size: 13px; color: var(--fg-2);
}

.cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    gap: clamp(40px, 6vw, 96px);
    align-items: start;
}
.cols > :first-child { max-width: 620px; }

.brand {
    font-size: 15px; font-weight: 600; letter-spacing: -.01em;
    text-decoration: none; color: var(--fg);
}
.theme {
    width: 32px; height: 32px; border: none; background: none;
    color: var(--fg-2); cursor: pointer;
    display: grid; place-items: center; border-radius: var(--r);
}
.theme:hover { color: var(--fg); background: var(--bg-2); }

.btn {
    font: inherit; font-size: 14px; font-weight: 600;
    padding: 13px 22px; border-radius: var(--r);
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s, color .15s, filter .15s;
}
.btn-fill  { background: var(--accent); color: var(--accent-fg); }
.btn-fill:hover:not(:disabled) { filter: brightness(1.12); }
.btn-fill:disabled { opacity: .38; cursor: not-allowed; }
.btn-line  { background: none; color: var(--fg); border-color: var(--line); }
.btn-line:hover:not(:disabled) { background: var(--bg-2); }
.btn-quiet { background: none; color: var(--fg-2); padding-inline: 12px; }
.btn-quiet:hover:not(:disabled) { color: var(--fg); background: var(--bg-2); }
.btn-quiet:disabled { opacity: .5; cursor: default; }
.btn-block { display: flex; width: 100%; }

.drop {
    border: 2px dashed var(--line);
    border-radius: var(--r);
    background: var(--bg-2);
    padding: 52px 36px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); }
.drop.off { pointer-events: none; opacity: .45; }
.drop strong { display: block; font-size: 17px; font-weight: 600; }
.drop span   { font-size: 14px; color: var(--fg-2); }
input[type="file"] { display: none; }

.field {
    -webkit-appearance: none; appearance: none;
    width: 100%; font: inherit; font-size: 14px;
    padding: 11px 13px;
    border: 1px solid var(--line); border-radius: var(--r);
    background: var(--bg); color: var(--fg);
    outline: none;
    transition: border-color .15s;
}
.field:focus { border-color: var(--accent); }
.field::placeholder { color: var(--fg-2); opacity: 1; }
.field::-ms-reveal, .field::-webkit-credentials-auto-fill-button { display: none; }
.field::-ms-clear, .field::-webkit-search-cancel-button { display: none; }
.field:-webkit-autofill,
.field:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--fg);
    box-shadow: 0 0 0 1000px var(--bg) inset;
    caret-color: var(--fg);
}

.fileblock { display: none; border-bottom: 1px solid var(--line); }
.fileblock.on { display: block; }
.filerow {
    display: flex; align-items: baseline; gap: 14px;
    padding: 16px 2px 12px;
}
.pwfield { padding: 0 2px 16px; }
.filerow .nm {
    flex: 1; min-width: 0; font-size: 15px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filerow .sz { font-family: var(--mono); font-size: 13px; color: var(--fg-2); }
.filerow button {
    font: inherit; font-size: 13px; border: none; background: none;
    color: var(--fg-2); cursor: pointer; padding: 0 2px;
}
.filerow button:hover { color: var(--fg); text-decoration: underline; }

.prog { display: none; padding: 16px 2px; }
.prog.on { display: block; }
.prog-head {
    display: flex; justify-content: space-between; gap: 12px;
    font-family: var(--mono); font-size: 13px; color: var(--fg-2);
    margin-bottom: 10px;
}
.track { height: 4px; border-radius: 2px; background: var(--line); }
.track > i {
    display: block; height: 100%; width: 0; border-radius: 2px;
    background: var(--accent); transition: width .25s;
}

.note {
    display: none; margin-top: 18px;
    padding: 8px 0 8px 14px; border-left: 3px solid var(--danger);
    color: var(--danger); font-size: 14px;
}
.note.on { display: block; }

.actbar { margin-top: 24px; }

.result { display: none; margin-top: 30px; }
.result.on { display: block; }
.lbl {
    font-size: 12px; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--fg-2); margin-bottom: 9px;
}
.linkrow { display: flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.linkrow input {
    flex: 1; min-width: 0; border: none; background: none; color: var(--fg);
    font: inherit; font-family: var(--mono); font-size: 13px;
    padding: 12px 14px; outline: none;
}
.linkrow button {
    font: inherit; font-size: 13px; font-weight: 600;
    border: none; border-left: 1px solid var(--line); background: var(--bg-2);
    color: var(--accent); padding: 0 18px; min-width: 124px; cursor: pointer;
}
.linkrow button:hover { filter: brightness(.97); }
.result .exp { margin-top: 10px; font-size: 13px; color: var(--fg-2); }

.lock h1 { font-size: 21px; font-weight: 600; margin-bottom: 10px; }
.lock p  { font-size: 15px; color: var(--fg-2); max-width: 40ch; margin-bottom: 24px; }
.lock form { display: flex; flex-direction: column; gap: 12px; max-width: 320px; }
.lock .note { margin-bottom: 18px; }

.facts > div {
    display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
    padding: 13px 0; border-bottom: 1px solid var(--line);
}
.facts > div:first-child { padding-top: 0; }
.facts > div:last-child { border-bottom: none; }
.facts > div > span { color: var(--fg-2); font-size: 14px; line-height: 1.5; }
.facts b {
    font-family: var(--mono); font-weight: 400; font-size: 15px;
    color: var(--fg); text-align: right; overflow-wrap: anywhere;
}

.uploads {
    margin-top: 28px; padding-top: 20px;
    border-top: 1px solid var(--line);
}
.uploads .lbl { margin-bottom: 10px; }
.uploads ul { list-style: none; }
.uploads li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.uploads li:last-child { border-bottom: none; }
.up-name {
    display: block; font-size: 14px; color: var(--fg);
    text-decoration: none; overflow-wrap: anywhere;
}
.up-name:hover { color: var(--accent); text-decoration: underline; }
.up-meta { display: block; font-size: 13px; color: var(--fg-2); margin-top: 2px; }
#btnClearUploads { margin-top: 12px; padding-inline: 0; font-size: 13px; }

.preview {
    border: 1px solid var(--line);
    border-radius: var(--r); overflow: hidden; background: #000;
    display: flex; align-items: center; justify-content: center;
    max-height: 460px; margin-bottom: 32px;
}
.preview img   { max-width: 100%; max-height: 460px; object-fit: contain; display: block; }
.preview video { width: 100%; max-height: 460px; display: block; }
.preview-audio { margin-bottom: 32px; }
.preview-audio audio { width: 100%; max-width: 560px; }

.title h1 { font-size: 21px; font-weight: 600; line-height: 1.45; word-break: break-all; }
.title p  { font-family: var(--mono); font-size: 13px; color: var(--fg-2); margin-top: 4px; }

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
#btnReport { margin-left: auto; }
#btnCopyLink { min-width: 156px; }

dialog {
    margin: auto;
    border: 1px solid var(--line); border-radius: var(--r);
    background: var(--bg); color: var(--fg);
    padding: 24px; width: calc(100% - 32px); max-width: 400px;
}
dialog::backdrop { background: rgba(0,0,0,.5); }
dialog h2 { font-size: 17px; font-weight: 600; }
dialog .sub { font-size: 14px; color: var(--fg-2); margin: 6px 0 16px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 15px; cursor: pointer; }
.opt input { accent-color: var(--accent); width: 16px; height: 16px; }
dialog textarea {
    width: 100%; margin-top: 14px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: var(--r);
    background: var(--bg-2); color: var(--fg);
    font: inherit; font-size: 14px; resize: vertical; min-height: 64px; outline: none;
}
dialog textarea:focus { border-color: var(--accent); }
.dlg-msg { display: none; margin-top: 14px; font-size: 14px; color: var(--danger); }
.dlg-msg.on { display: block; }
.dlg-act { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.empty h1 { font-size: 23px; font-weight: 600; margin-bottom: 10px; }
.empty p  { font-size: 15px; color: var(--fg-2); max-width: 40ch; margin-bottom: 28px; }

@media (max-width: 900px) {
    main { align-items: flex-start; padding-block: 32px 40px; }
    .cols { grid-template-columns: 1fr; gap: 40px; }
    .cols > :first-child { max-width: none; }
    .drop { padding: 46px 22px; }
    .actions { flex-direction: column; align-items: stretch; }
    #btnReport { margin-left: 0; }
    #btnCopyLink { min-width: 0; }
}
