:root {
  --bg: #f3f0e8;
  --card: #fffdf8;
  --ink: #1c1b18;
  --muted: #6f6a62;
  --line: #e3dcd0;
  --btn: #1c1b18;
  --btn-ink: #f7f4ee;
  --ghost: #fffdf8;
  --copy: #234237;
  --copy-ink: #f4faf6;
  --banner: #efe4c6;
  --banner-ink: #3d3420;
  --danger: #8a3d32;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --card: #211f1c;
    --ink: #f3f0ea;
    --muted: #b7b1a6;
    --line: #3a3833;
    --btn: #f3f0ea;
    --btn-ink: #161614;
    --ghost: #2a2825;
    --copy: #d5e6db;
    --copy-ink: #13241c;
    --banner: #3a3424;
    --banner-ink: #f3ead4;
    --danger: #f0b2a8;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: 720px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.45;
  padding:
    calc(18px + env(safe-area-inset-top))
    calc(16px + env(safe-area-inset-right))
    calc(32px + env(safe-area-inset-bottom))
    calc(16px + env(safe-area-inset-left));
}

h1, h2, p { margin: 0; }

h1 {
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 18px;
  font-weight: 650;
}

.lede {
  margin-top: 8px;
  color: var(--muted);
}

.banner {
  margin-top: 16px;
  background: var(--banner);
  color: var(--banner-ink);
  border-radius: 14px;
  padding: 12px 14px;
}

.banner a { color: inherit; }

.card {
  margin-top: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

label, .check {
  display: block;
  margin-top: 12px;
  font-size: 15px;
  color: var(--muted);
}

.modes label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-top: 4px;
  color: var(--ink);
  font-size: 17px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--ink);
  font-size: 16px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  flex: 0 0 auto;
  accent-color: var(--copy);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.spread { justify-content: space-between; }

.grow { flex: 1; }

input[type="password"],
input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 17px;
  line-height: 1.4;
}

textarea { resize: vertical; }

#note { margin-top: 6px; min-height: 84px; }

#strict {
  margin-top: 12px;
  min-height: 180px;
  white-space: pre-wrap;
  resize: none;
  overflow: hidden;
}

.hint, .status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.status:empty { display: none; }

.status.bad { color: var(--danger); }

button {
  font: inherit;
  font-size: 17px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--ghost);
  color: var(--ink);
  min-height: 48px;
  padding: 10px 14px;
  touch-action: manipulation;
}

button:active { transform: translateY(1px); }

button:disabled { opacity: 0.55; }

.ghost { background: var(--ghost); }

.textbtn {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 40px;
  padding: 6px 2px;
}

.go, .copy {
  width: 100%;
  border: 0;
}

.go {
  margin-top: 16px;
  min-height: 56px;
  background: var(--btn);
  color: var(--btn-ink);
  font-size: 18px;
  font-weight: 650;
}

.copy {
  margin-top: 12px;
  min-height: 64px;
  background: var(--copy);
  color: var(--copy-ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tune {
  width: 100%;
  margin-top: 8px;
}

.tune-row {
  margin-top: 8px;
}

.tune-row .tune {
  margin-top: 0;
}

.strip {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.shot {
  flex: 0 0 auto;
  width: 132px;
  scroll-snap-align: start;
}

.shot img {
  width: 132px;
  height: 168px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.shot-tools {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.shot-tools button {
  flex: 1;
  min-height: 40px;
  padding: 4px;
  font-size: 15px;
}

.explain {
  margin-top: 8px;
  min-height: 140px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  white-space: normal;
}

.explain.empty { color: var(--muted); }

.explain p { margin: 0 0 12px; }
.explain p:last-child { margin-bottom: 0; }
.explain ul { margin: 0 0 12px; padding-left: 1.2em; }
.explain li { margin: 4px 0; }
.explain strong { font-weight: 700; }

#usage:empty { display: none; }
