:root {
  --bg: #ffffff; --fg: #111111; --muted: #444444; --line: #bbbbbb;
  --accent: #0b57d0; --accent-fg: #ffffff;
  --contains: #b3261e; --possible: #9a5b00; --shared: #6b4fa0; --unknown: #444444; --notfound: #1e6b3a;
  --card: #f4f6f8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418; --fg: #f2f2f2; --muted: #c8c8c8; --line: #555b63;
    --accent: #8ab4f8; --accent-fg: #0b1a33;
    --contains: #ff8a80; --possible: #ffcc66; --shared: #c9b3ff; --unknown: #d0d0d0; --notfound: #7ee2a0;
    --card: #1d2228;
  }
}
* { box-sizing: border-box; }
html { font-size: 112.5%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif; line-height: 1.7; }
header, main { max-width: 640px; margin: 0 auto; padding: 0 16px; }
header { padding-top: 16px; }
h1 { font-size: 1.5rem; margin: 0.2em 0; }
h2 { font-size: 1.25rem; margin: 1.4em 0 0.4em; border-bottom: 2px solid var(--line); }
.badge { font-size: 0.8rem; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; vertical-align: middle; }
.lead, .hint { color: var(--muted); }
button, .big-button, input[type=text], input[type=password] { font-size: 1.1rem; min-height: 48px; border-radius: 8px; }
button { padding: 0 18px; border: 2px solid var(--accent); background: var(--bg); color: var(--accent); font-weight: 700; }
.big-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 72px; font-size: 1.3rem; font-weight: 700; background: var(--accent); color: var(--accent-fg); cursor: pointer; }
.big-button:focus-within, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
input[type=text], input[type=password] { flex: 1; min-width: 0; padding: 0 12px; border: 2px solid var(--line); background: var(--bg); color: var(--fg); }
.row { display: flex; gap: 8px; margin: 8px 0; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li button { border-color: var(--line); color: var(--fg); font-weight: 400; }
h3 { font-size: 1rem; margin: 16px 0 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(9em, 1fr)); gap: 4px 12px; padding: 8px 0; }
.checks label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.checks input { width: 24px; height: 24px; }
summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
#result ul { list-style: none; padding: 0; margin: 0; }
#result li { padding: 10px 12px; margin: 8px 0; border-radius: 8px; background: var(--card); border-left: 8px solid var(--unknown); font-size: 1.1rem; }
#result li.contains { border-color: var(--contains); }
#result li.possible { border-color: var(--possible); }
#result li.shared { border-color: var(--shared); }
#result li.not_found { border-color: var(--notfound); }
#result .label { font-weight: 700; }
#result .contains .label { color: var(--contains); }
#result .possible .label { color: var(--possible); }
#result .shared .label { color: var(--shared); }
#result .not_found .label { color: var(--notfound); }
.product { font-size: 1.2rem; font-weight: 700; margin: 0.3em 0; }
.expiry { font-size: 1.2rem; margin: 0.3em 0; }
dl dt { font-weight: 700; margin-top: 8px; }
dl dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.note { color: var(--muted); }
#status { min-height: 1.7em; font-weight: 700; }
.error { color: var(--contains); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.check-row { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 1.1rem; }
.check-row input { width: 28px; height: 28px; }
select { font-size: 1.1rem; min-height: 48px; border-radius: 8px; border: 2px solid var(--line); background: var(--bg); color: var(--fg); padding: 0 8px; }
.row label[for=speech-rate] { display: flex; align-items: center; }
#speech-controls button { flex: 1; }
.big-button.secondary { background: var(--bg); color: var(--accent); border: 2px solid var(--accent); min-height: 56px; font-size: 1.1rem; margin-top: 10px; }
#photo-figure { margin: 12px 0; }
#photo-figure img { display: block; max-width: 100%; max-height: 70vh; border-radius: 8px; border: 1px solid #ccc; }
#photo-figure figcaption { font-size: 0.85rem; color: #555; margin-top: 4px; }
