:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --fg: #222;
  --muted: #6b6b6b;
  --line: #ddd6cc;
  --accent: #5b3f8c;
  --accent-soft: #efe9f7;
  --on-accent: #fff;
  --star: #b8841f;
  --error: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a1f;
    --surface: #24222a;
    --fg: #e8e6e3;
    --muted: #a09c96;
    --line: #3a3740;
    --accent: #b49be0;
    --accent-soft: #2e2839;
    --on-accent: #1b1a1f;
    --star: #e0b458;
    --error: #f2b8b5;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: system-ui, "Hiragino Sans", "Yu Gothic UI", sans-serif; line-height: 1.7; }
main { max-width: 720px; margin: 0 auto; padding: 16px 16px 64px; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; line-height: 1.4; margin: 0 0 8px; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
section { margin-bottom: 20px; }
.note { color: var(--muted); font-size: .9em; }

/* ヘッダー・パンくず */
.site-header { padding: 4px 0 8px; }
.home { font-size: 1.25rem; font-weight: bold; color: var(--accent); text-decoration: none; }
.crumbs { font-size: .85em; color: var(--muted); margin-bottom: 16px; min-height: 1.4em; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.crumbs .sep { color: var(--line); }

/* トップ */
.hero p { color: var(--muted); margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.card:hover, .card:focus-visible { border-color: var(--accent); }
.card strong { color: var(--accent); font-size: 1.1rem; }
.card span { font-size: .85em; color: var(--muted); line-height: 1.5; }
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card { padding: 12px; }
  .card strong { font-size: 1rem; }
}

/* 占術ページ */
.method-head .catch { font-weight: bold; margin: 0 0 8px; }
.method-head .intro { color: var(--muted); margin: 0; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: inherit; text-decoration: none; background: var(--bg); }
.chip:hover, .chip:focus-visible { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: bold; }
details.more { margin-top: 4px; }
details.more summary { cursor: pointer; color: var(--muted); font-size: .9em; padding: 4px 0; }
.modes { display: flex; gap: 8px; margin-bottom: 8px; }
.mode { flex: 1; min-height: 44px; font: inherit; font-size: .9em; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: inherit; }
.mode.active { border-color: var(--accent); color: var(--accent); font-weight: bold; }
.mode:disabled { opacity: .55; }

/* 入力 */
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.choices:empty { display: none; }
.choice { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
#needs span { display: block; }
#needs .need-main { color: var(--fg); font-weight: bold; }
.field { margin-bottom: 16px; }
.field-label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; font-weight: bold; }
.field-label em { color: var(--error); font-style: normal; font-size: .75em; font-weight: normal; white-space: nowrap; flex-shrink: 0; }
.field-label small { color: var(--muted); font-size: .75em; font-weight: normal; white-space: nowrap; flex-shrink: 0; }
.field .note { display: block; margin-top: 4px; font-size: .8em; }
select, input[type=text], input[type=date], input[type=time], textarea {
  width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; font-size: 16px; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
select option { color: var(--fg); background: var(--surface); }
.submit, .button-link { display: block; width: 100%; min-height: 52px; font: inherit; font-size: 1.05rem; font-weight: bold; padding: 12px 24px; border: 0; border-radius: 10px; background: var(--accent); color: var(--on-accent); cursor: pointer; text-align: center; text-decoration: none; }
.submit:disabled { opacity: .5; }
.errors { color: var(--error); padding: 12px 12px 12px 32px; border: 1px solid var(--error); border-radius: 8px; }

/* 結果 */
#result { margin-top: 32px; padding-top: 24px; border-top: 2px solid var(--line); }
#result h2 { font-size: 1.4rem; margin-bottom: 0; }
#result h3 { font-size: 1.05rem; border-bottom: 1px solid var(--line); padding-bottom: 4px; margin-top: 28px; }
#result h4 { font-size: 1rem; margin: 16px 0 0; }
#result .item p { margin-top: 4px; }
.method { color: var(--muted); margin: 0; font-size: .9em; }
.stars { color: var(--star); font-weight: normal; }
.stars.big { font-size: 1.2rem; }
.summary { white-space: pre-wrap; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
dt { font-weight: bold; }
dd { margin: 0; }
@media (max-width: 480px) {
  dl { grid-template-columns: 1fr; gap: 0; }
  dd { margin-bottom: 8px; }
}
#after { margin-top: 32px; }
#after h2 { font-size: 1rem; margin-top: 16px; }
