:root {
  --bg: #f4f5f7; --card: #ffffff; --ink: #14171c; --muted: #616a78; --line: #e2e5ea;
  --yes: #1f8a4c; --yes-soft: #e3f4ea; --no: #c23b3b; --no-soft: #f9e4e4; --accent: #2d5bd7;
  --shadow: 0 10px 30px rgba(20, 23, 28, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --card: #181b21; --ink: #e8eaee; --muted: #9aa3b2; --line: #2a2f38;
    --yes: #3fbf77; --yes-soft: #16301f; --no: #e06363; --no-soft: #331a1a; --accent: #7c9cff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; min-height: 100dvh; overscroll-behavior: none;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
header { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.brand { font-weight: 700; font-size: 18px; }
#counts { flex: 1; font-size: 14px; }
.muted { color: var(--muted); }
button { font: inherit; border: 0; border-radius: 12px; cursor: pointer; color: var(--ink); background: var(--card); }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ghost { background: transparent; color: var(--muted); padding: 10px 12px; }
details { font-size: 14px; margin-bottom: 8px; }
summary { color: var(--muted); cursor: pointer; padding: 4px 0; }
.src { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
main { flex: 1; display: flex; align-items: stretch; min-height: 0; }
.card {
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 18px; width: 100%;
  position: relative; display: flex; flex-direction: column; min-height: 0; touch-action: pan-y; user-select: none;
  transition: transform 0.2s ease, background 0.15s ease;
}
.card.dragging { transition: none; }
.chip { align-self: flex-start; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
h1 { font-size: 20px; line-height: 1.3; margin: 12px 0; }
.state { overflow: auto; flex: 1; min-height: 0; font-size: 15px; border-top: 1px solid var(--line); padding-top: 10px; -webkit-user-select: text; user-select: text; }
.state .k { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-top: 10px; }
.state .v { white-space: pre-wrap; word-break: break-word; }
.stamp { position: absolute; top: 18px; font-weight: 800; font-size: 28px; padding: 2px 12px; border: 3px solid; border-radius: 10px; opacity: 0; pointer-events: none; }
.stamp.yes { left: 18px; color: var(--yes); transform: rotate(-12deg); }
.stamp.no { right: 18px; color: var(--no); transform: rotate(12deg); }
footer { padding: 14px 0 18px; }
.row { display: flex; gap: 12px; align-items: center; }
.big { flex: 1; padding: 16px; font-size: 18px; font-weight: 700; }
.big.yes { background: var(--yes); color: #fff; }
.big.no { background: var(--no); color: #fff; }
.options { display: flex; flex-direction: column; gap: 8px; max-height: 45vh; overflow: auto; }
.options button { text-align: left; padding: 12px 14px; border: 1px solid var(--line); }
.options b { display: block; }
.options span { color: var(--muted); font-size: 14px; }
.empty { margin: auto; text-align: center; }
.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; max-width: calc(100% - 32px); }
body.login { justify-content: center; }
.loginbox { max-width: 360px; margin: 0 auto; gap: 14px; }
.loginbox input { font: inherit; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
