:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5f6670;
  --line: #e3e1da;
  --accent: #2f5bd3;
  --accent-ink: #ffffff;
  --accent-soft: #e8eefc;
  --line-green: #06c755;
  --danger: #c43b3b;
  --radius: 12px;
  font-family: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a; --surface: #1e2125; --text: #e8e9eb; --muted: #a2a8b0;
    --line: #33373d; --accent: #7d9cf0; --accent-ink: #10131a; --accent-soft: #232c40;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.7; }
[hidden] { display: none !important; }
main { max-width: 1080px; margin: 0 auto; padding: 0 16px 64px; }
.site-header { max-width: 1080px; margin: 0 auto; padding: 16px; }
.logo { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: .02em; }

.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-size: 15px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-lg { padding: 16px 32px; font-size: 18px; }
.btn-block { width: 100%; }
.btn-line { background: var(--line-green); border-color: var(--line-green); color: #fff; font-weight: 700; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; padding: 8px 0; font-family: inherit; }
.note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.narrow { max-width: 520px; margin: 24px auto; }
.center { text-align: center; }

.hero { text-align: center; padding: 48px 0 32px; }
.eyebrow { color: var(--accent); font-weight: 600; margin: 0 0 8px; }
.hero h1 { font-size: clamp(32px, 7vw, 52px); line-height: 1.25; margin: 0 0 16px; }
.lead { max-width: 560px; margin: 0 auto 28px; color: var(--muted); }
.steps { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps li { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.steps span { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.steps p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; }
input, select, textarea { width: 100%; margin-top: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 16px; font-family: inherit; }
textarea { resize: vertical; }

.chat-wrap { max-width: 680px; margin: 8px auto; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 16px; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 240px; margin-bottom: 16px; }
.msg { max-width: 85%; padding: 12px 14px; border-radius: 14px; white-space: pre-wrap; }
.msg.ai { background: var(--surface); border: 1px solid var(--line); align-self: flex-start; border-top-left-radius: 4px; }
.msg.me { background: var(--accent-soft); align-self: flex-end; border-top-right-radius: 4px; }
.msg.typing { color: var(--muted); }
.composer { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; }
.composer-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 8px; }
.btn-mic .mic-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); opacity: .35; }
.btn-mic.on { border-color: var(--danger); color: var(--danger); }
.btn-mic.on .mic-dot { opacity: 1; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.4); } }

.spinner { width: 40px; height: 40px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; margin: 8px auto 16px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; margin-top: 8px; }
@media (max-width: 860px) { .result-layout { grid-template-columns: 1fr; } }
.line-inline { display: none; margin-bottom: 12px; font-size: 14px; }
@media (max-width: 860px) { .line-inline { display: flex; } }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.confirm-box { background: #fff7e0; color: #6b4e00; border: 1px solid #f0d58a; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }
.confirm-box ul { margin: 4px 0 0; padding-left: 20px; }

.paper { background: #fff; color: #1a1a1a; border: 1px solid var(--line); border-radius: 4px; padding: 40px 44px; margin-bottom: 16px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 14px; line-height: 1.8; }
@media (max-width: 600px) { .paper { padding: 24px 18px; } }
.paper h1 { text-align: center; font-size: 22px; letter-spacing: .3em; margin: 0 0 4px; }
.paper .date { text-align: right; font-size: 13px; margin: 0 0 20px; }
.paper h2 { font-size: 15px; border-bottom: 2px solid #1a1a1a; padding-bottom: 2px; margin: 24px 0 10px; }
.paper h3 { font-size: 14px; margin: 14px 0 4px; }
.paper .meta { color: #555; font-size: 13px; margin: 0 0 6px; }
.paper ul { margin: 4px 0 8px; padding-left: 20px; }
.paper p { margin: 4px 0 8px; }
.paper .todo { background: #fff2b3; }

.revise h3 small { color: var(--muted); font-weight: 400; font-size: 13px; }
.line-card { border-color: var(--line-green); }
.badge { display: inline-block; background: #e6f9ee; color: #0a7a3b; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; margin: 0 0 8px; }
.line-card h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.5; }
.line-card p { font-size: 14px; color: var(--muted); }
.gift { text-align: center; font-size: 13px !important; }
.paid-item { display: block; width: 100%; text-align: left; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 8px; cursor: pointer; color: var(--text); font-family: inherit; }
.paid-item strong { display: block; }
.paid-item span { font-size: 13px; color: var(--muted); }
.paid-item:hover { border-color: var(--accent); }
.survey p { font-size: 14px; margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { font-weight: 400; margin: 0; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.chips input { display: none; }
.chips label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.thanks { color: #0a7a3b; font-size: 14px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal-box { background: var(--surface); border-radius: var(--radius); padding: 24px; max-width: 420px; width: 100%; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f2328; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); }

.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 13px; color: var(--muted); }
.consent input { width: auto; margin-top: 4px; }
.consent a { color: var(--accent); }
.turnstile { display: flex; justify-content: center; margin: 8px auto 0; }
.site-footer { max-width: 1080px; margin: 0 auto; padding: 24px 16px 40px; display: flex; gap: 20px; justify-content: center; font-size: 13px; }
.site-footer a { color: var(--muted); }
.legal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; margin: 8px auto 24px; max-width: 760px; font-size: 15px; }
.legal h1 { font-size: 24px; margin: 0 0 4px; }
.legal h2 { font-size: 17px; margin: 28px 0 8px; }
.legal a { color: var(--accent); }
.legal ul, .legal ol { padding-left: 22px; }
@media (max-width: 600px) { .legal { padding: 20px 16px; } }

@media print {
  body { background: #fff; }
  .site-header, .no-print, #screen-hero, #screen-setup, #screen-interview, #screen-generating, .toast, .modal { display: none !important; }
  main { padding: 0; max-width: none; }
  .result-layout { display: block; }
  .paper { border: 0; padding: 0; margin: 0; }
  .paper .todo { background: none; }
}
