/* The page is hidden only until i18n.js has put the text in; it reveals the page even when a language fails to load. */
html:not([data-i18n-ready]) body { visibility: hidden; }

:root {
  --ground: #edf1ef;
  --surface: #ffffff;
  --sunken: #e2e9e6;
  --ink: #14211f;
  --muted: #576964;
  --line: #d0dad6;
  --accent: #0f6b66;
  --accent-ink: #ffffff;
  --danger: #b2382b;
  --danger-soft: #f7e5e2;
  --ok: #26734d;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0e1614; --surface: #15201d; --sunken: #1c2a27; --ink: #e4eeeb; --muted: #8da19b; --line: #263632;
    --accent: #45b8ae; --accent-ink: #06201d; --danger: #ee7767; --danger-soft: #3a1f1b; --ok: #5cc48d;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.5 var(--sans); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-inner { max-width: 880px; margin: 0 auto; padding: 0.75rem 1rem; display: flex; align-items: center; justify-content: space-between; }
main { max-width: 880px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; text-align: center;
  min-height: 11rem; padding: 1.5rem; cursor: pointer;
  background: var(--surface); border: 2px dashed var(--line); border-radius: 12px;
}
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); outline: none; }
.drop.over { background: var(--sunken); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-main { font-size: 1.1rem; font-weight: 600; }

.notice { margin: 1rem 0 0; padding: 0.6rem 0.8rem; background: var(--danger-soft); border-radius: 8px; }
details { margin: 1rem 0; }
summary { cursor: pointer; color: var(--muted); }
.field { display: block; margin: 0.5rem 0; }
.field > span:first-child { display: block; font-size: 0.8rem; color: var(--muted); }
input[type="password"], .copyrow input {
  width: 100%; padding: 0.4rem 0.55rem; font: 0.85rem var(--mono); color: var(--ink);
  background: var(--sunken); border: 1px solid var(--line); border-radius: 6px;
}
.copyrow { display: flex; gap: 0.4rem; }

.btn {
  display: inline-block; padding: 0.35rem 0.8rem; font: inherit; font-size: 0.85rem; color: var(--ink); text-decoration: none; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
}
.btn:hover { border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn[hidden] { display: none; }

.row-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.row-head p { margin: 0; }
.rows { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.item { display: flex; gap: 0.9rem; padding: 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.thumb { flex: none; width: 96px; height: 96px; overflow: hidden; background: var(--sunken); border-radius: 8px; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.body { flex: 1; min-width: 0; }
.name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
progress { width: 100%; height: 0.6rem; margin: 0.4rem 0; accent-color: var(--accent); }
.error { margin: 0.35rem 0 0; color: var(--danger); }
.links { margin-top: 0.4rem; }
.actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.item.gone { opacity: 0.55; }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); padding: 0.5rem 1rem;
  background: var(--ink); color: var(--ground); border-radius: 8px;
}
.toast[hidden] { display: none; }

@media (max-width: 520px) {
  .item { flex-direction: column; }
  .thumb { width: 100%; height: 160px; }
}
