:root {
  color-scheme: dark;
  font: 100%/1.5 system-ui, sans-serif;
  --bg: #101214;
  --panel: #171a1d;
  --surface: #1d2125;
  --line: #31373d;
  --text: #f0f2f4;
  --muted: #aeb7c0;
  --accent: #c8f481;
  --accent-text: #1d2b10;
  --danger: #ffb4ad;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.055em; line-height: 1.08; }
h2 { font-size: 1.25rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; font-weight: 620; overflow-wrap: anywhere; }
button, input { font: inherit; }
button, .button {
  display: inline-flex; justify-content: center; align-items: center; gap: .4rem;
  border: 1px solid var(--line); border-radius: .55rem; padding: .48rem .85rem;
  background: var(--surface); color: var(--text); text-decoration: none;
  font-size: .875rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
button:hover:not(:disabled), .button:hover { border-color: var(--muted); }
button:disabled { opacity: .48; cursor: default; }
button.primary, a.primary { color: var(--accent-text); border-color: var(--accent); background: var(--accent); padding-inline: 1.1rem; }
button.primary:hover:not(:disabled), a.primary:hover { background: #d9ffa0; border-color: #d9ffa0; }
button.quiet { background: transparent; border-color: transparent; }
.danger, .error { color: var(--danger); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner, .account, .upload-controls, .library-header, .card-actions, .pagination, .dialog-header, .input-row {
  display: flex; align-items: center; gap: .75rem;
}
.topbar-inner, .upload-controls, .library-header, .dialog-header { justify-content: space-between; }
.topbar-inner { min-height: 4rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 680; text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: .5rem;
  background: var(--accent); color: var(--accent-text); font-weight: 850;
}
.email, .count, .hint, small { color: var(--muted); font-size: .875rem; }
.dashboard { padding-block: clamp(2rem, 6vw, 4rem); }
.dashboard > h1 { margin-bottom: 1.6rem; }
.panel { border: 1px solid var(--line); border-radius: .9rem; background: var(--panel); }
.upload-panel { padding: clamp(1rem, 3vw, 1.5rem); }
.dropzone {
  display: flex; align-items: center; gap: 1rem; min-height: 6.5rem; padding: 1rem;
  margin-block: .9rem; border: 1px dashed #465158; border-radius: .65rem; background: #121517; cursor: pointer;
}
.dropzone:hover, .dropzone.active { border-color: var(--accent); background: #1a2117; }
.upload-panel:has(#picker:focus-visible) .dropzone { outline: 2px solid var(--accent); outline-offset: 3px; }
.dropzone strong, .dropzone small { display: block; overflow-wrap: anywhere; }
.drop-mark {
  display: grid; place-items: center; flex: 0 0 2.5rem; height: 2.5rem;
  border-radius: .55rem; background: var(--surface); color: var(--accent); font-size: 1.45rem;
}
.check { display: flex; align-items: center; gap: .5rem; font-size: .9375rem; }
.check input { margin: 0; accent-color: var(--accent); width: 1rem; height: 1rem; }
.upload-controls .hint { margin-top: .25rem; }
progress { display: block; width: 100%; margin-top: 1rem; accent-color: var(--accent); }
.status, .share-result { margin-top: .8rem; overflow-wrap: anywhere; }
.share-result > a { display: inline-block; margin-top: .55rem; font-size: .875rem; }
.input-row { margin-top: .35rem; }
input[type="text"], input[type="password"] {
  width: 100%; min-width: 0; background: #101214; color: var(--text);
  border: 1px solid var(--line); border-radius: .5rem; padding: .5rem .65rem;
}
.library { margin-top: 2.1rem; }
.library-header { margin-bottom: .85rem; }
.empty { padding: 1.25rem; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .85rem; }
.card { overflow: hidden; }
.thumbnail {
  display: grid; place-items: center; width: 100%; height: 8.5rem;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0;
  background: #111416; color: var(--muted); font-size: .875rem;
}
.thumbnail:hover { color: var(--accent); }
.thumbnail:focus-visible { outline-offset: -4px; }
.thumbnail img { display: block; width: 100%; height: 8.5rem; object-fit: contain; }
.placeholder { text-decoration: underline; text-underline-offset: .2em; }
.sealed { color: #d0e5b5; }
.card-info { padding: .8rem; }
.card-actions { margin-top: .75rem; justify-content: space-between; }
.pagination { margin-top: 1rem; color: var(--muted); }
.centered { display: grid; place-items: center; min-height: min(32rem, 75vh); padding-block: 2rem; }
.gate { width: min(100%, 28rem); padding: clamp(1.2rem, 5vw, 2.1rem); }
.gate h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); overflow-wrap: anywhere; }
.gate p { margin-top: .75rem; color: var(--muted); }
.gate p.error { color: var(--danger); }
.gate a.primary, .gate form { margin-top: 1rem; }
.viewer { width: min(100%, 42rem); }
.viewer input { margin-block: .35rem .65rem; }
.viewer .media { margin-top: 1rem; }
dialog {
  width: min(calc(100% - 2rem), 62rem); max-height: 90vh; padding: 1rem;
  border: 1px solid var(--line); border-radius: .9rem; background: var(--panel); color: var(--text);
}
dialog::backdrop { background: #000b; }
.dialog-header { margin-bottom: 1rem; }
.dialog-header h2 { overflow-wrap: anywhere; }
.media { display: grid; place-items: center; background: #101214; border-radius: .5rem; }
.media img, .media video { display: block; max-width: 100%; max-height: 66vh; object-fit: contain; }
.media audio { width: 100%; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
@media (max-width: 31rem) {
  .shell { width: calc(100% - 1.5rem); }
  .email { display: none; }
  .grid { grid-template-columns: 1fr; }
}
