:root {
  color-scheme: light dark;
  --bg: #f6f5f1; --card: #ffffff; --text: #1d1f23; --muted: #62666e; --line: #d9d8d2;
  --accent: #1f4d8f; --accent-text: #ffffff; --tint: #eef3fa; --danger: #a4262c; --danger-tint: #fdf1f1; --warn: #7a5200; --warn-tint: #fdf6e3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a; --card: #1e2125; --text: #eceef0; --muted: #a2a7ae; --line: #363a40;
    --accent: #7fb0f0; --accent-text: #10223a; --tint: #1f2a38; --danger: #f2a6a9; --danger-tint: #33201f; --warn: #e8c477; --warn-tint: #2f2818;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 720px; margin: 0 auto; padding: 48px 16px; }
.home-link { display: inline-block; margin-bottom: 20px; padding: 4px 0; color: var(--accent); font-size: .9rem; font-weight: 600; text-decoration: none; }
.home-link:hover { text-decoration: underline; }
header h1 { margin: 0 0 8px; font-size: 2rem; line-height: 1.2; }
header p { margin: 0 0 28px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-bottom: 16px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 32px 16px; border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; text-align: center; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); background: var(--tint); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop strong { overflow-wrap: anywhere; }
.drop span { color: var(--muted); font-size: .9rem; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0; }
.field label { display: block; margin-bottom: 4px; font-size: .9rem; font-weight: 600; }
.optional { color: var(--muted); font-weight: 400; }
.field input, .field select { width: 100%; padding: 9px 10px; font: inherit; color: inherit; background: transparent; border: 1px solid var(--line); border-radius: 8px; }
.field select option { background: var(--card); }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .button { display: inline-block; padding: 11px 18px; font: inherit; font-weight: 600; color: var(--accent-text); background: var(--accent); border: 0; border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
button { width: 100%; }
button:disabled { opacity: .55; cursor: default; }
.note { margin: 12px 0 0; color: var(--muted); font-size: .875rem; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.row .note { margin-top: 2px; }
.bar { height: 8px; margin-top: 12px; background: var(--line); border-radius: 4px; overflow: hidden; }
#fill { height: 100%; width: 0; background: var(--accent); transition: width .25s; }
.error { background: var(--danger-tint); border-color: var(--danger); }
.error strong { color: var(--danger); }
.error p { margin: 4px 0 0; }
.warning { margin: 16px 0 0; padding: 10px 12px; color: var(--warn); background: var(--warn-tint); border-radius: 8px; font-size: .9rem; }
.preview { display: block; width: 100%; height: 70vh; margin-top: 20px; border: 1px solid var(--line); background: #fff; }
footer { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .8rem; }
footer a { color: inherit; }
[hidden] { display: none !important; }
@media (max-width: 520px) {
  main { padding-top: 28px; }
  .card { padding: 18px; }
  .grid { grid-template-columns: 1fr; }
  .row { flex-direction: column; align-items: stretch; }
  .button { text-align: center; }
}
