:root {
  --bg: #eef1ec; --ink: #14232b; --muted: #57676e; --line: #cdd5cf;
  --card: #ffffff; --accent: #0f4c5c; --accent-ink: #ffffff; --err: #a3261f;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11181b; --ink: #e8efe9; --muted: #98a8ad; --line: #2b383d; --card: #182125; --accent: #7cc4d4; --accent-ink: #0b1a1f; --err: #ff8a80; }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font: 16px/1.5 ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
main { max-width: 30rem; margin: 0 auto; padding: 1.5rem 1.1rem 3rem; }
h1 { font-size: 1.9rem; line-height: 1.1; margin: 1rem 0 .4rem; letter-spacing: -.02em; }
.lead { margin: 0 0 1.4rem; color: var(--muted); }
label { display: block; font-weight: 600; margin: 0 0 .35rem; }
input {
  width: 100%; min-height: 3rem; padding: .6rem .8rem; font: inherit; color: inherit;
  background: var(--card); border: 1.5px solid var(--line); border-radius: .6rem;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: .5rem; margin-bottom: 1rem; }
#keyWrap { margin-bottom: 1rem; }
button, .big {
  font: inherit; font-weight: 700; min-height: 3rem; padding: .6rem 1rem; border-radius: .6rem;
  border: 1.5px solid var(--accent); cursor: pointer; text-align: center; text-decoration: none; display: block;
}
.ghost { background: transparent; color: var(--accent); width: auto; }
.primary { background: var(--accent); color: var(--accent-ink); width: 100%; }
.primary:disabled { opacity: .6; cursor: progress; }
.big { min-height: 3.6rem; font-size: 1.15rem; line-height: 2.2rem; margin-top: 1rem; }
#status { margin: 1rem 0 0; font-weight: 600; }
#status.error { color: var(--err); }
#result { margin-top: 1.4rem; }
video { width: 100%; max-height: 70vh; background: #000; border-radius: .6rem; display: block; }
dl { margin: 1rem 0 0; border-top: 1px solid var(--line); }
dl div { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); } dd { margin: 0; font-weight: 600; }
#previewNote { color: var(--muted); font-size: .9rem; }
.foot { margin-top: 2.2rem; color: var(--muted); font-size: .85rem; }
@media (prefers-reduced-motion: no-preference) { button, .big { transition: transform .08s; } button:active, .big:active { transform: scale(.98); } }
