:root { --bg:#f8fafc; --fg:#1e293b; --muted:#64748b; --card:#ffffff; --line:#e2e8f0; --accent:#2563eb; --accent-fg:#ffffff; --ok:#059669; --err:#b91c1c; --overlay:rgba(15,23,42,.55); }
@media (prefers-color-scheme: dark) {
  :root { --bg:#0f172a; --fg:#e2e8f0; --muted:#94a3b8; --card:#1e293b; --line:#334155; --accent:#60a5fa; --accent-fg:#0f172a; --ok:#34d399; --err:#f87171; --overlay:rgba(2,6,23,.75); }
}
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Hiragino Kaku Gothic ProN","Meiryo",sans-serif; line-height:1.7; }
main, footer { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
main { padding-bottom: 8px; }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.25rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 20px 0 6px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:16px; margin-bottom:16px; }
.privacy { border-left: 4px solid var(--ok); }
label.field { display:block; font-weight:600; margin: 12px 0 4px; }
input[type=text], textarea { width:100%; padding:8px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--fg); font: inherit; }
textarea { min-height: 220px; resize: vertical; }
.row { display:flex; gap:8px; flex-wrap:wrap; margin-top: 12px; }
button { padding: 10px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--fg); font: inherit; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#status { color: var(--muted); font-size: .9rem; min-height: 1.4em; }
#status.error, #message { color: var(--err); }
#message { white-space: pre-wrap; }
iframe#frame { width: 100%; height: 900px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
footer { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
footer p { margin: 4px 0; }
a { color: var(--accent); }
#perf { font-size: .75rem; color: var(--muted); }

/* consent gate */
#consent { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 16px; z-index: 10; }
#consent[hidden] { display: none; }
#consent .panel { background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; max-width: 720px; width: 100%; padding: 24px; margin: 16px 0; }
#consent ul { margin: 4px 0; padding-left: 1.2em; }
#consent li { margin: 4px 0; }
#consent .agree { display: flex; gap: 10px; align-items: flex-start; margin: 20px 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; cursor: pointer; }
#consent .agree input { width: 20px; height: 20px; margin-top: 3px; flex: none; }
#consent .actions { display: flex; gap: 8px; }
#consent .actions button { flex: 1; }
@media (max-width: 480px) { #consent .panel { padding: 16px; } .row button { flex: 1; } }
