:root {
  color-scheme: light dark;
  --bg: #f5f4f0;
  --ink: #161615;
  --muted: #6a6964;
  --line: #d5d3cc;
  --field: #fff;
  --accent: #161615;
  --accent-ink: #f5f4f0;
  --ghost: #efeee9;
  --danger: #b42318;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --ink: #f3f2ed;
    --muted: #9c9b94;
    --line: #2c2c29;
    --field: #1c1c1a;
    --accent: #f3f2ed;
    --accent-ink: #121211;
    --ghost: #232321;
    --danger: #ff7b72;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
main, footer {
  width: min(28rem, 100%);
  padding: 0 1.25rem;
}
main { flex: 1; padding-top: 18vh; padding-bottom: 3rem; }
h1 {
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.04em;
  margin: 0 0 .35rem;
}
.lead { color: var(--muted); margin: 0 0 1.5rem; }
#form { display: flex; flex-direction: column; gap: .7rem; }
.field {
  display: flex;
  gap: .4rem;
  align-items: stretch;
}
input[type="url"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: .8rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
}
button {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: var(--radius);
  padding: .8rem 1rem;
  cursor: pointer;
}
button.primary {
  background: var(--accent);
  color: var(--accent-ink);
}
button.secondary, button.ghost {
  background: var(--ghost);
  color: var(--ink);
}
button.ghost { flex: 0 0 auto; }
button.secondary { width: 100%; margin-top: .75rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
.note, .status { color: var(--muted); font-size: .82rem; margin: 0; }
.status.error { color: var(--danger); }
.result { display: none; margin-top: 1.75rem; }
.result.on { display: block; }
.preview-wrap {
  background: var(--ghost);
  overflow: hidden;
  border-radius: 16px;
}
.preview-wrap img {
  width: 100%;
  height: auto;
  display: block;
  -webkit-touch-callout: default;
}
.hint {
  font-size: .95rem;
  margin: .85rem 0 0;
  color: var(--ink);
}
footer {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.5rem;
  color: var(--muted);
  font-size: .8rem;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.legal { padding-top: 8vh; max-width: 28rem; }
.legal h1 { margin-bottom: .6rem; }
.legal h2 { font-size: 1rem; margin: 1.4rem 0 .35rem; }
.legal p, .legal li { color: var(--ink); font-size: .95rem; }
.placeholder {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: .75rem .85rem;
  color: var(--muted);
  font-size: .9rem;
  margin: 1rem 0;
}

.legal .quiet { color: var(--muted); font-size: .85rem; }
