/* 学びのコンシェルジュ
 * 明るい・やさしい・静か・信頼感・少し知的。外部フォントは使わず OS 標準の日本語フォント。 */

:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-soft: #eef4f2;
  --ink: #26313b;
  --ink-soft: #5b6670;
  --line: #dcd8cf;
  --accent: #2f6f6a;
  --accent-ink: #ffffff;
  --accent-soft: #d9ebe7;
  --gold: #a57a34;
  --gold-soft: #f4ead7;
  --danger: #a3453a;
  --ok: #2f7a4f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(38, 49, 59, .06), 0 4px 14px rgba(38, 49, 59, .05);
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b2126;
    --surface: #232b31;
    --surface-soft: #22302f;
    --ink: #e8ebed;
    --ink-soft: #a9b3ba;
    --line: #3a454d;
    --accent: #6fb3aa;
    --accent-ink: #10201e;
    --accent-soft: #2a3f3c;
    --gold: #d6b06a;
    --gold-soft: #3a3326;
    --danger: #e08a80;
    --ok: #7cc79b;
    --shadow: none;
    color-scheme: dark;
  }
}

html { font-size: 17px; -webkit-text-size-adjust: 100%; }
html[data-font="large"] { font-size: 20px; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.8;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

h1 { font-size: 1.5rem; line-height: 1.5; margin: 1.2em 0 .5em; font-weight: 700; }
h2 { font-size: 1.15rem; margin: 1.6em 0 .5em; }
h3 { font-size: 1.05rem; margin: .3em 0 .3em; }
h1:focus, h2:focus { outline: none; }
p { margin: .5em 0; }
a { color: var(--accent); }
code { font-size: .85em; }

.small { font-size: .88rem; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }

/* ---------- header / footer ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; line-height: 1.3; }
.brand-ja { font-weight: 700; font-size: 1.02rem; }
.brand-en { font-size: .72rem; color: var(--ink-soft); letter-spacing: .12em; }
.home-link { text-decoration: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-size: .9rem; }

main { min-height: 60vh; padding-bottom: 48px; }

.site-footer { border-top: 1px solid var(--line); padding: 20px 0 32px; color: var(--ink-soft); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 6px; }
.footer-nav a { color: var(--ink-soft); }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 40px 0 16px; }
.hero h1 { font-size: 1.9rem; margin: .1em 0; letter-spacing: .08em; }
.hero.small { padding: 24px 0 4px; }
.hero.small h1 { font-size: 1.5rem; }
.eyebrow { font-size: .8rem; letter-spacing: .14em; color: var(--gold); margin: 1.4em 0 0; }
.hero .eyebrow { margin: 0; }
.lead { font-size: 1.1rem; margin: .2em 0; }
.copy { color: var(--ink-soft); margin: 0; }

/* ---------- concierge voice ---------- */
.concierge { font-size: 1.05rem; }
.concierge.big { font-size: 1.2rem; font-weight: 600; }
.concierge-box { background: var(--surface); border-left: 4px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 18px; margin: 12px 0 18px; box-shadow: var(--shadow); }
.concierge-box p { margin: .25em 0; }
.ctx { display: inline-block; font-size: .85rem; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 12px; margin: .2em 0 .6em; }
.notice { background: var(--gold-soft); border-radius: 10px; padding: 8px 12px; font-size: .92rem; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; box-shadow: var(--shadow); }
.card.soft { background: var(--surface-soft); border-color: transparent; box-shadow: none; }
.card h2 { margin-top: .2em; }
.notice-card { border-color: var(--gold); }

/* ---------- home ---------- */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.entry { display: flex; flex-direction: column; justify-content: flex-end; min-height: 150px; padding: 18px; border-radius: 18px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s; position: relative; overflow: hidden; }
.entry::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; }
.e1::before { background: var(--accent); }
.e2::before { background: #6f8fb5; }
.e3::before { background: var(--gold); }
.e4::before { background: #8f7bb0; }
.entry:hover { transform: translateY(-2px); border-color: var(--accent); }
.entry-title { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.entry-sub { font-size: .85rem; color: var(--ink-soft); line-height: 1.6; margin-top: 4px; }
.badge { background: var(--danger); color: #fff; font-size: .78rem; border-radius: 999px; min-width: 1.6em; padding: 0 .5em; text-align: center; line-height: 1.6; }
.banner { display: block; width: 100%; text-align: left; font: inherit; color: var(--ink); background: var(--gold-soft); border: 1px solid var(--gold); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; cursor: pointer; }
.banner strong { display: block; }

/* ---------- buttons ---------- */
.btn { font: inherit; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.big { min-height: 56px; font-size: 1.05rem; padding: 12px 28px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.link { font: inherit; background: none; border: 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; padding: 8px; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; align-items: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- option list / tiles ---------- */
.option-list { display: grid; gap: 12px; margin: 16px 0; }
.option { font: inherit; text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.option:hover { border-color: var(--accent); }
.option strong { font-size: 1.05rem; }
.option span { color: var(--ink-soft); font-size: .9rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.tile { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-height: 110px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); }

.tag { display: inline-block; font-size: .75rem; padding: 1px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-weight: 600; }
.tag.new { background: var(--accent-soft); color: var(--accent); }
.pill { display: inline-block; white-space: nowrap; font-size: .75rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); }
.pill.tried { border-color: var(--accent); color: var(--accent); }
.pill.some { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.often { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pill-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pill-list li { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 14px; }

/* ---------- form ---------- */
.field { display: block; margin: 18px 0; }
.field > span { display: block; margin-bottom: 6px; font-size: .92rem; }
.q { font-weight: 600; display: block; margin: 0 0 8px; }
.q.small { font-size: .82rem; margin-bottom: 4px; }
.opt { font-weight: 400; font-size: .75rem; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-left: 8px; }
.input { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 46px; }
textarea.input { resize: vertical; line-height: 1.7; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input.num { width: 5.5em; display: inline-block; margin-left: 4px; }
.count-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span, .chip-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .95rem; line-height: 1.4; }
.chip-btn { font: inherit; color: var(--ink); cursor: pointer; }
.chip.on span, .chip-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.chips-sm .chip span { min-height: 36px; padding: 4px 12px; font-size: .85rem; }
.chips-scale { justify-content: space-between; flex-wrap: nowrap; }
.chips-scale .chip { flex: 1; }
.chips-scale .chip span { justify-content: center; width: 100%; padding: 8px 0; }
.scale-labels { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-soft); margin-top: 4px; }

/* ---------- recommend ---------- */
.cands { display: grid; gap: 14px; }
.cand { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.cand h3 { margin-top: 6px; font-size: 1.15rem; }
.cand p { margin: .3em 0; }
.cand .reason { font-size: .88rem; color: var(--ink-soft); }
.cand .btn { margin-top: 8px; }
.academic { font-size: .8em; color: var(--ink-soft); font-weight: 400; margin-left: 4px; }
.others { margin-top: 12px; }

.plain-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.row-btn { font: inherit; color: var(--ink); width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; min-height: 52px; }
.row-btn:hover { border-color: var(--accent); }
.row-btn > span:first-child { display: flex; flex-direction: column; }
.row-btn small { font-size: .75rem; }

/* ---------- run ---------- */
.run-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 20px; font-weight: 600; }
.run-prog { color: var(--ink-soft); font-size: .9rem; white-space: nowrap; }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0 10px; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .25s ease; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-top: 10px; }
.step-text { font-size: 1.1rem; font-weight: 600; line-height: 1.7; }
.step-info { background: var(--surface-soft); border-color: transparent; box-shadow: none; }
.step-do { position: relative; padding-left: 52px; }
.do-mark { position: absolute; left: 18px; top: 22px; color: var(--accent); font-size: .9rem; }
.list-row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.list-no { width: 1.8em; flex: none; text-align: center; color: var(--ink-soft); font-size: .9rem; }
.check-item { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.check-item:first-of-type { border-top: 0; }
.check-q { font-weight: 600; margin: 0; }
.check-item .chips { margin: 8px 0; }
.timer { text-align: center; margin: 16px 0; }
.timer-num { font-size: 2.6rem; font-variant-numeric: tabular-nums; font-weight: 300; letter-spacing: .05em; }

.reveal { padding: 28px 20px; }
.reveal-name { font-size: 1.5rem; font-weight: 700; margin: .2em 0 .6em; }
.reveal-academic { font-size: 1.3rem; font-weight: 700; color: var(--accent); margin: .2em 0; }

/* ---------- exploration ---------- */
.words { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
.word { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; font-size: 1.3rem; }
.word .w { font-weight: 700; }
.word .eq { color: var(--ink-soft); margin: 0 .4em; }
.words.visual .word { color: #fff; border: 0; font-size: 1.5rem; }
.words.visual .word .eq { color: rgba(255, 255, 255, .8); }
.word.c1 { background: #3f7f6e; }
.word.c2 { background: #b0703a; transform: rotate(-1.5deg); }
.word.c3 { background: #4f6fa0; transform: rotate(1deg); }
.word.c4 { background: #8a5a8e; }
.beat { display: flex; justify-content: center; gap: 14px; margin: 14px 0; }
.beat span { width: 18px; height: 18px; border-radius: 50%; background: var(--line); }
.beat.on span { animation: beat 2.4s infinite; }
.beat.on span:nth-child(2) { animation-delay: .6s; }
.beat.on span:nth-child(3) { animation-delay: 1.2s; }
.beat.on span:nth-child(4) { animation-delay: 1.8s; }
@keyframes beat { 0%, 20% { background: var(--accent); transform: scale(1.35); } 30%, 100% { background: var(--line); transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .beat.on span { animation-duration: 4.8s; } .entry { transition: none; } }
.note-inputs .field { margin: 10px 0; }
.quiz .step-text { margin-top: 0; }
.answer-list { list-style: none; padding: 0; }
.answer-list li { padding: 4px 0; }
.answer-list .ok::before { content: "○ "; color: var(--ok); font-weight: 700; }
.answer-list .ng::before { content: "・ "; color: var(--ink-soft); }
.record-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.record-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; }

/* ---------- drawer ---------- */
.filters { display: grid; gap: 10px; margin: 12px 0 4px; }
.drawer-group h2 { margin-bottom: 0; }
.hist { list-style: none; padding: 0; display: grid; gap: 10px; }
.hist li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.hist p { margin: .2em 0; }
details { margin: 14px 0; }
summary { cursor: pointer; color: var(--accent); }
.src p { margin-top: 6px; }

/* ---------- review ---------- */
.review-item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.review-item p { margin: .1em 0; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-actions .btn { min-height: 42px; padding: 6px 14px; }

/* ---------- about ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .82rem; min-width: 560px; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
th { color: var(--ink-soft); font-weight: 600; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-size: .92rem; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  html { font-size: 16px; }
  html[data-font="large"] { font-size: 19px; }
  .home-grid { grid-template-columns: 1fr; }
  .entry { min-height: 110px; }
  .hero h1 { font-size: 1.6rem; }
  .actions .btn.big { width: 100%; }
  .step { padding: 16px; }
  .step-do { padding-left: 40px; }
  .do-mark { left: 14px; top: 18px; }
  .words.visual .word, .word { font-size: 1.1rem; padding: 12px 6px; }
  .chip span { padding: 8px 12px; }
}

/* ---------- 学年別の表示 ---------- */
.grade-list .option { align-items: center; text-align: center; min-height: 64px; justify-content: center; }
.grade-list .option.current { border-color: var(--accent); background: var(--accent-soft); }
.grade-link { color: var(--ink-soft); }
.home-grid.simple .entry { min-height: 110px; justify-content: center; }
.home-grid.simple .entry-title { font-size: 1.3rem; }
.more-goals { margin-top: 8px; }
.why { font-size: .9rem; margin: .4em 0; }
.why span { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--gold); border: 1px solid var(--gold); border-radius: 6px; padding: 0 6px; margin-right: 8px; }
.combo { font-size: .85rem; color: var(--accent); }
.face-q { font-size: 1.6rem; margin: 1em 0 .8em; }
.faces { display: grid; gap: 12px; max-width: 420px; margin: 0 auto; }
.face { font: inherit; font-size: 1.2rem; color: var(--ink); display: flex; align-items: center; gap: 16px; min-height: 72px; padding: 12px 20px; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; cursor: pointer; box-shadow: var(--shadow); text-align: left; }
.face:hover, .face:focus-visible { border-color: var(--accent); }
.face-icon { font-size: 2.2rem; line-height: 1; }

.src-list { padding-left: 1.4em; display: grid; gap: 12px; }
.src-list a { word-break: break-all; }

.cloud-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.3rem; letter-spacing: .08em; margin: .2em 0; }
