/* =========================================================
   英文解釈ラボ — page styles
   ========================================================= */

.wrap { max-width: 920px; margin: 0 auto; padding: 0 22px 0; }

/* ---- header ---- */
.site-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 2px 18px;
}
.head-cta {
  font-family: var(--jp); font-weight: 700; font-size: 14px;
  color: var(--brown); text-decoration: none;
  border: 1.5px solid var(--camel-soft); border-radius: var(--r-pill);
  padding: .5em 1.2em; background: var(--card);
  transition: background .18s, transform .18s;
}
.head-cta:hover { background: var(--peach-2); transform: translateY(-1px); }

/* ---- hero ---- */
.hero-lab { padding: 30px 2px 18px; }
.kicker {
  font-family: var(--en); font-weight: 700; letter-spacing: .04em;
  color: var(--camel); margin: 0 0 .5em; font-size: 15px;
}
.hero-lab h1 {
  font-family: var(--jp); font-weight: 900; color: var(--ink);
  font-size: clamp(24px, 3.4vw, 40px); line-height: 1.3; margin: 0 0 .55em;
  letter-spacing: .01em;
}
.mark-line {
  white-space: nowrap;
  background: linear-gradient(transparent 62%, var(--peach) 62%, var(--peach) 96%, transparent 96%);
  padding: 0 .08em; border-radius: 4px;
}
.lede { color: var(--body); font-size: clamp(15px, 2vw, 18px); max-width: 40em; margin: .4em 0 0; }

/* ---- mode tabs ---- */
.mode-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--paper-2); padding: 8px; border-radius: var(--r);
  margin: 28px 0 6px; position: sticky; top: 8px; z-index: 20;
  box-shadow: var(--shadow-sm);
}
.mtab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: transparent; cursor: pointer; border-radius: var(--r-sm);
  padding: 12px 6px; font-family: var(--jp); color: var(--ink-2);
  transition: background .18s, color .18s, box-shadow .18s;
}
.mtab-label { font-weight: 700; font-size: clamp(14px, 2vw, 17px); }
.mtab-sub { font-size: 11px; color: var(--muted); }
.mtab:hover { background: #fff8ec; }
.mtab.on { background: var(--card); box-shadow: var(--shadow-sm); color: var(--ink); }
.mtab.on .mtab-label { color: var(--brown); }
.mtab.on .mtab-sub { color: var(--ink-2); }

/* ---- mode shell ---- */
.content { padding: 26px 0 10px; }
.mode-intro { margin: 4px 2px 18px; }
.mode-intro h2 {
  font-family: var(--jp); font-weight: 900; color: var(--ink);
  font-size: clamp(22px, 3.6vw, 30px); line-height: 1.4; margin: 0 0 .35em;
}
.mode-intro p { margin: 0; color: var(--body); font-size: 15.5px; max-width: 44em; }
.mode-intro b { color: var(--ink-2); font-weight: 700; }

/* ---- sentence nav ---- */
.sentence-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.snav {
  font-family: var(--en); font-weight: 700; font-size: 14px; letter-spacing: .03em;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: .5em 1.1em; border-radius: var(--r-pill); cursor: pointer;
  transition: all .16s;
}
.snav:hover { border-color: var(--camel); }
.snav.on { background: var(--brown); color: #fff; border-color: var(--brown); }

/* ---- stage / card ---- */
.stage, .article { padding: clamp(22px, 4vw, 34px); }
.stage-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.type-badge { display: inline-flex; align-items: baseline; gap: .6em; }
.type-badge b { font-family: var(--jp); font-weight: 900; color: var(--ink); font-size: clamp(18px, 2.6vw, 23px); white-space: nowrap; }
.type-formula { font-family: var(--en); font-weight: 800; color: var(--camel); letter-spacing: .14em; font-size: 14px; }
.stage-meta { display: flex; gap: 8px; }
.pill-meta {
  font-family: var(--jp); font-size: 12px; font-weight: 500; color: var(--ink-2);
  background: var(--peach-2); border-radius: var(--r-pill); padding: .3em .9em;
}

/* ---- sentence chunks ---- */
.sentence {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 8px;
  font-family: var(--en); font-size: clamp(22px, 3.6vw, 31px); font-weight: 600;
  color: #43301f; line-height: 1.35; margin: 6px 0 24px; padding: 6px 0;
}
.chunk {
  position: relative; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px;
  border: none; background: transparent; cursor: pointer; font: inherit; color: inherit;
  padding: 3px 6px 5px; border-radius: 9px; transition: background .18s, box-shadow .18s, transform .12s;
}
.chunk.static { cursor: default; }
.chunk:not(.static):hover { background: #f3e9d6; transform: translateY(-1px); }
.chunk.sel { transform: translateY(-1px); }
.chunk-tag { height: 17px; display: flex; align-items: center; transition: opacity .18s; }
.ctag {
  font-family: var(--en); font-weight: 800; font-size: 10px; letter-spacing: .03em;
  color: #fff; border-radius: 5px; padding: 1px 6px; line-height: 1.5;
}
.chunk-text { white-space: nowrap; }

/* ---- tools ---- */
.stage-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.toggle {
  font-family: var(--jp); font-weight: 700; font-size: 13.5px; cursor: pointer;
  border: 1.5px solid var(--camel-soft); background: var(--card); color: var(--ink-2);
  padding: .5em 1.1em; border-radius: var(--r-pill); transition: all .16s;
}
.toggle:hover { background: var(--peach-2); }
.toggle.on { background: var(--brown); color: #fff; border-color: var(--brown); }

.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-left: auto; }
.legend-item { display: inline-flex; align-items: center; gap: .4em; }
.legend-dot {
  width: 20px; height: 20px; border-radius: 6px; color: #fff;
  font-family: var(--en); font-weight: 800; font-size: 11px;
  display: grid; place-items: center;
}
.legend-jp { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }

/* ---- translation ---- */
.full-trans {
  margin-top: 18px; padding: 14px 18px; border-radius: var(--r-sm);
  background: var(--peach-2); color: var(--ink); font-weight: 700; font-size: 16px;
  border-left: 5px solid var(--camel);
}
.full-trans.solid { margin-top: 20px; }

/* ---- detail panel ---- */
.detail {
  margin: 16px 0 0; padding: 20px 22px; border-radius: var(--r);
  background: var(--card); border: 1.5px dashed var(--line);
  min-height: 96px; transition: border .2s;
}
.detail.filled { border-style: solid; box-shadow: var(--shadow-sm); }
.detail-hint { color: var(--muted); font-size: 14.5px; display: flex; align-items: center; height: 56px; }
.detail-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.detail-en { font-family: var(--en); font-weight: 700; font-size: 20px; color: #43301f; }
.detail-jp { font-weight: 700; color: var(--ink); font-size: 16px; margin-bottom: 8px; }
.detail-note { margin: 0; color: var(--body); font-size: 14.5px; line-height: 1.75; }

/* ---- point box ---- */
.point-box {
  margin-top: 18px; padding: 18px 20px; border-radius: var(--r);
  background: #fff8ec; border-left: 5px solid var(--brown);
}
.point-box p { margin: 6px 0 0; color: var(--body); font-size: 15px; line-height: 1.8; }
.point-label {
  font-family: var(--jp); font-weight: 800; font-size: 12px; letter-spacing: .08em;
  color: #fff; background: var(--brown); border-radius: var(--r-pill); padding: .25em .9em;
}

/* ---- article ---- */
.article-sentence { cursor: default; }
.breakdown { margin-top: 26px; }
.breakdown-title { font-family: var(--jp); font-weight: 800; color: var(--ink); font-size: 17px; margin-bottom: 12px; }
.bd-row { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.bd-row:first-of-type { border-top: none; }
.bd-chip { flex: 0 0 auto; padding-top: 2px; }
.bd-en { font-family: var(--en); font-weight: 700; font-size: 17px; color: #43301f; }
.bd-jp { font-family: var(--jp); font-weight: 700; font-size: 14.5px; color: var(--ink-2); }
.bd-note { margin: 5px 0 0; font-size: 14px; color: var(--body); line-height: 1.7; }

/* ---- quiz ---- */
.quiz-progress { display: flex; align-items: center; gap: 7px; margin: 0 2px 14px; }
.qdot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.qdot.on { background: var(--brown); transform: scale(1.25); }
.qcount { margin-left: auto; font-family: var(--en); font-weight: 700; font-size: 13px; color: var(--muted); }

.quiz { padding: clamp(22px, 4vw, 34px); }
.quiz-stem {
  font-family: var(--en); font-weight: 600; font-size: clamp(19px, 3vw, 26px);
  color: #43301f; line-height: 1.5; margin-bottom: 18px;
}
.blank {
  font-weight: 800; color: var(--brown); border-bottom: 3px solid var(--camel);
  padding: 0 .2em;
}
.quiz-prompt {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--jp); font-weight: 800; color: var(--ink); font-size: 18px;
  background: var(--peach-2); border-radius: var(--r-sm); padding: 14px 16px; margin-bottom: 18px;
}
.q-mark { color: var(--camel); margin-right: .4em; font-family: var(--en); }
.q-hint { font-weight: 500; font-size: 13px; color: var(--ink-2); }

.choices { display: flex; flex-direction: column; gap: 11px; }
.choice {
  display: flex; align-items: flex-start; gap: 14px; text-align: left; width: 100%;
  border: 2px solid var(--line); background: var(--card); border-radius: var(--r);
  padding: 16px 18px; cursor: pointer; font-family: var(--jp);
  transition: border-color .16s, background .16s, transform .12s, box-shadow .16s;
}
.choice:not(:disabled):hover { border-color: var(--camel); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.choice:disabled { cursor: default; }
.ch-key {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-family: var(--en); font-weight: 800; font-size: 14px;
  background: var(--peach); color: var(--brown);
}
.ch-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 4px; }
.ch-word { font-family: var(--en); font-weight: 700; font-size: 20px; color: #43301f; }
.ch-check { color: var(--correct); }
.ch-why { font-family: var(--jp); font-size: 13.5px; color: var(--body); line-height: 1.6; }
.ch-pos {
  flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--ink-2);
  background: var(--paper-2); border-radius: var(--r-pill); padding: .35em .9em; white-space: nowrap;
}

.choice.correct { border-color: var(--correct-line); background: var(--correct-bg); }
.choice.correct .ch-key { background: var(--correct); color: #fff; }
.choice.correct .ch-word { color: var(--correct); }
.choice.wrong { border-color: var(--wrong-line); background: var(--wrong-bg); }
.choice.wrong .ch-key { background: var(--wrong); color: #fff; }
.choice.wrong .ch-word { color: var(--wrong); }
.choice.dim { opacity: .55; }

.quiz-explain { margin-top: 20px; padding: 18px 20px; border-radius: var(--r); background: #fff8ec; border-left: 5px solid var(--brown); }
.quiz-explain p { margin: 8px 0 0; color: var(--body); font-size: 15px; line-height: 1.8; }
.quiz-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; flex-wrap: wrap; }
.quiz-actions .btn-ghost, .quiz-actions .btn-primary { padding: .7em 1.5em; font-size: 15px; }

/* ---- cta band ---- */
.cta-band { margin: 46px 0 0; padding: 0 2px; }
.cta-inner {
  background: var(--paper-2); border-radius: var(--r-lg); padding: clamp(34px, 6vw, 56px) 24px;
  text-align: center;
}
.cta-kick { font-family: var(--en); font-weight: 800; letter-spacing: .02em; color: var(--ink-2); margin: 0 0 .4em; font-size: clamp(20px, 3vw, 26px); }
.cta-inner h2 { font-family: var(--jp); font-weight: 900; color: var(--ink); font-size: clamp(20px, 3.2vw, 27px); line-height: 1.5; margin: 0 0 1.3em; }
.btn-cta {
  display: inline-block; background: var(--brown); border-radius: var(--r-lg);
  padding: 16px; text-decoration: none; box-shadow: var(--shadow); transition: transform .18s;
}
.btn-cta:hover { transform: translateY(-2px); }
.cta-pill {
  display: inline-block; background: #fff; color: var(--brown);
  font-family: var(--jp); font-weight: 800; font-size: clamp(16px, 2.4vw, 20px);
  padding: .85em 2.4em; border-radius: var(--r-pill);
}
.cta-url { font-family: var(--en); font-weight: 600; color: var(--camel); margin: 1.2em 0 0; letter-spacing: .04em; }

/* ---- footer ---- */
.site-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 4px 40px; color: var(--muted); font-size: 13px; font-family: var(--en);
}
.site-foot a { color: var(--ink-2); text-decoration: none; font-family: var(--jp); font-weight: 700; }
.site-foot a:hover { color: var(--brown); }

/* ---- responsive ---- */
@media (max-width: 560px) {
  .mtab-sub { display: none; }
  .legend { width: 100%; margin-left: 0; }
  .ch-pos { display: none; }
  .stage-meta { display: none; }
}
