:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1d232b;
  --muted: #5d6673;
  --accent: #1f3a5f;
  --accent-ink: #ffffff;
  --line: #d9d5cc;
  --error: #b42318;
  --ok: #1b7f4b;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --card: #1d2229;
    --ink: #eef1f5;
    --muted: #a3acb8;
    --accent: #8db4ea;
    --accent-ink: #0d1520;
    --line: #343b45;
    --error: #ff8a80;
    --ok: #6fd39c;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 19px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
}
.tagline {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  padding: 8px 2px 14px;
}

.screen {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
}
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 12px; }
.instructions { white-space: pre-line; margin: 0 0 20px; }
.muted, .hint, .optional { color: var(--muted); }
.hint { font-size: .9rem; margin: 6px 0 0; }

label { display: block; font-weight: 600; margin: 20px 0 6px; }
input, textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  min-height: 56px;
}
input:focus, textarea:focus, button:focus-visible, .video-button:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.step + .step {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.3rem;
  margin: 0 0 4px;
}
.num {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.1rem;
}
.step label:first-of-type { margin-top: 12px; }

.video-buttons { display: grid; gap: 12px; margin-top: 16px; }
.video-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  margin: 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.15rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.video-button:active { transform: scale(.98); }
.video-button[hidden] { display: none; }
.video-button input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; pointer-events: none; }
.video-button svg {
  flex: none; width: 30px; height: 30px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.video-button small { display: block; font-weight: 400; font-size: .85rem; opacity: .85; }

.file-name { color: var(--muted); margin: 4px 0 0; word-break: break-word; }

button {
  display: block;
  width: 100%;
  min-height: 60px;
  margin-top: 24px;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button:disabled { opacity: .55; cursor: default; }
button.secondary { background: transparent; color: var(--muted); border: 2px solid var(--line); }

.error { color: var(--error); font-weight: 600; margin: 16px 0 0; }

.bar { height: 22px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin: 20px 0 10px; }
.bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.progress-text { font-size: 1.2rem; margin: 0; }
.keep-open { font-weight: 600; margin: 20px 0 0; }
.status { color: var(--muted); min-height: 1.5em; margin: 8px 0 0; }

.check {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ok); color: var(--card);
  font-size: 40px; font-weight: 700; margin-bottom: 12px;
}

/* /u/{id}/browse */
main.wide { max-width: 900px; }
.browse { padding: 20px 16px; }
.browse h1 { font-size: 1.35rem; }
.browse a { color: var(--accent); }
.uploads { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .95rem; }
.uploads th {
  text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; padding: 0 8px 6px;
  border-bottom: 1px solid var(--line);
}
.uploads td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.uploads .when { white-space: nowrap; color: var(--muted); font-size: .85rem; }
.uploads .from { width: 100%; word-break: break-word; }
.uploads .from small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.uploads .from .msg { color: var(--ink); font-style: italic; white-space: pre-line; }
.uploads .size { white-space: nowrap; text-align: right; color: var(--muted); font-size: .85rem; }
.uploads .act { white-space: nowrap; text-align: right; }
.uploads .act form { display: inline; margin: 0; }
.icon {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; min-height: 0; margin: 0 0 0 4px; padding: 0;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--accent); cursor: pointer; vertical-align: middle;
}
.icon:hover, .icon:focus-visible { background: var(--bg); }
.icon.danger { color: var(--muted); }
.icon.danger:hover { color: var(--error); }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 480px) {
  .uploads th.size, .uploads td.size { display: none; }
  .uploads td { padding: 10px 4px; }
}
