@import "../shared/tokens.css";

/* =========================================================
   SPI対策ドリル / styles.css
   画像・canvas・SVG・外部ライブラリを使わず、CSSだけで図表を組む。
   ========================================================= */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-main);
  background: var(--bg-light);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { line-height: var(--lh-ui); margin: 0 0 var(--gap-sm); }
p { margin: 0 0 var(--gap-sm); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { margin: 0 0 var(--gap-sm); padding-left: 1.4em; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }

.num { font-family: var(--font-num); font-feature-settings: "tnum" 1; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
}
.header-inner {
  max-width: var(--container); margin: 0 auto;
  min-height: var(--header-height);
  display: flex; align-items: center; gap: var(--gap);
  padding: 0 var(--gap);
}
.logo {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-weight: 700; font-size: 1.15rem; color: var(--primary);
  white-space: nowrap;
}
.logo small { font-size: .7rem; color: var(--text-muted); font-weight: 500; }
.site-nav { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; flex-wrap: wrap; }
.site-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--radius-pill);
  color: var(--text-body); font-size: .92rem; font-weight: 600;
}
.site-nav a:hover { background: var(--bg-soft); text-decoration: none; }
.site-nav a[aria-current="page"] { background: var(--heading-bg); color: var(--primary-dark); }
.nav-count {
  min-width: 22px; padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--ng); color: var(--text-invert);
  font-size: .72rem; font-weight: 700; text-align: center;
  font-family: var(--font-num);
}
.nav-count[data-zero="1"] { background: var(--border-strong); color: var(--text-body); }
.header-tools { display: flex; align-items: center; gap: var(--gap-sm); margin-left: auto; }
.streak {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--warn-bg); color: var(--warn);
  font-size: .85rem; font-weight: 700; white-space: nowrap;
}
.ghost, .secondary, .primary, .link-btn {
  border-radius: var(--radius-pill); border: 1px solid transparent;
  padding: 9px 18px; font-weight: 700; line-height: 1.4;
  transition: background .15s, color .15s, border-color .15s;
}
.primary { background: var(--primary); color: var(--text-invert); border-color: var(--primary); }
.primary:hover:enabled { background: var(--primary-dark); border-color: var(--primary-dark); }
.secondary { background: var(--bg-white); color: var(--primary); border-color: var(--border-strong); }
.secondary:hover:enabled { background: var(--bg-soft); }
.ghost { background: transparent; color: var(--text-body); border-color: var(--border-color); }
.ghost:hover:enabled { background: var(--bg-soft); color: var(--text-main); }
.primary:disabled, .secondary:disabled, .ghost:disabled { opacity: .45; cursor: not-allowed; }
.link-btn {
  background: none; border: none; padding: 0; color: var(--primary);
  font-weight: 600; text-decoration: underline;
}
.accent { background: var(--accent); border-color: var(--accent); color: var(--text-invert); }
.accent:hover:enabled { background: var(--accent-dark); border-color: var(--accent-dark); }

/* ---------------------------------------------- layout */
main { max-width: var(--container); margin: 0 auto; padding: var(--gap-lg) var(--gap) var(--gap-xl); }
.view { display: none; }
.view.is-active { display: block; }
.page-head { margin-bottom: var(--gap-lg); }
.page-head h1 { font-size: 1.7rem; }
.page-head p { color: var(--text-body); max-width: var(--article-width); }
.eyebrow {
  display: inline-block; margin-bottom: 6px;
  font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  color: var(--primary-light);
}
.card {
  background: var(--bg-white); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: var(--gap-md);
  box-shadow: var(--shadow-card);
}
.section { margin-bottom: var(--gap-xl); }
.section > h2 {
  font-size: 1.25rem; padding-bottom: 8px; margin-bottom: var(--gap);
  border-bottom: 2px solid var(--heading-bg);
}
.section-note { color: var(--text-body); font-size: .92rem; margin-bottom: var(--gap); }

/* ---------------------------------------------- home: modes */
.mode-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.mode-card {
  display: flex; flex-direction: column; gap: 6px;
  text-align: left; align-items: flex-start;
  background: var(--bg-white); border: 1px solid var(--border-color);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius); padding: var(--gap);
  box-shadow: var(--shadow-card); color: var(--text-main);
}
.mode-card:hover { box-shadow: var(--shadow-float); text-decoration: none; transform: translateY(-1px); }
.mode-card .mode-name { font-size: 1.08rem; font-weight: 700; }
.mode-card .mode-size { font-family: var(--font-num); color: var(--accent-dark); font-weight: 700; font-size: .9rem; }
.mode-card .mode-desc { font-size: .87rem; color: var(--text-body); line-height: 1.7; }
.mode-card.is-mock { border-left-color: var(--ng); }
.mode-card.is-personality { border-left-color: var(--accent); }

/* ---------------------------------------------- stats */
.stat-grid {
  display: grid; gap: var(--gap-sm);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat {
  background: var(--bg-white); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: var(--gap-sm) var(--gap);
}
.stat dt { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.stat dd {
  margin: 2px 0 0; font-family: var(--font-num);
  font-size: 1.5rem; font-weight: 700; color: var(--primary-dark);
}
.stat dd small { font-size: .8rem; color: var(--text-muted); font-weight: 600; }

/* ---------------------------------------------- difficulty filter */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-sm);
  margin-bottom: var(--gap);
}
.filter-bar .filter-label { font-size: .85rem; font-weight: 700; color: var(--text-body); }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); overflow: hidden; background: var(--bg-white); }
.segmented button {
  border: none; background: transparent; color: var(--text-body);
  padding: 7px 14px; font-size: .85rem; font-weight: 700;
}
.segmented button + button { border-left: 1px solid var(--border-color); }
.segmented button[aria-pressed="true"] { background: var(--primary); color: var(--text-invert); }

/* ---------------------------------------------- field cards */
.cat-block { margin-bottom: var(--gap-lg); }
.cat-block-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--gap-sm); margin-bottom: 6px; }
.cat-block-head h3 { font-size: 1.1rem; margin: 0; }
.cat-block-head .cat-meta { font-size: .82rem; color: var(--text-muted); font-family: var(--font-num); }
.field-grid {
  display: grid; gap: var(--gap-sm);
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.field-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-white); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: var(--gap-sm) var(--gap);
}
.field-card .field-top { display: flex; align-items: baseline; gap: 8px; }
.field-card .field-code {
  font-family: var(--font-num); font-size: .74rem; font-weight: 700;
  color: var(--primary-light); letter-spacing: .04em;
}
.field-card .field-name { font-size: 1rem; font-weight: 700; }
.field-card .field-def { font-size: .84rem; color: var(--text-body); line-height: 1.7; flex: 1 1 auto; }
.field-card .field-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-sm); }
.field-card .field-count { font-size: .8rem; color: var(--text-muted); font-family: var(--font-num); }
.field-card .field-count b { color: var(--accent-dark); font-size: .95rem; }
.field-link { font-size: .88rem; font-weight: 700; white-space: nowrap; }
.chip {
  display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill);
  background: var(--bg-soft); color: var(--text-body);
  font-size: .74rem; font-weight: 700;
}
.chip-d1, .chip-d2 { background: var(--ok-bg); color: var(--ok); }
.chip-d3 { background: var(--heading-bg); color: var(--primary-dark); }
.chip-d4, .chip-d5 { background: var(--ng-bg); color: var(--ng-dark); }

/* ---------------------------------------------- quiz */
.quiz-top {
  display: flex; align-items: center; gap: var(--gap-sm);
  margin-bottom: var(--gap);
}
.quiz-top .progress {
  flex: 1 1 auto; height: 8px; border-radius: var(--radius-pill);
  background: var(--bg-soft); overflow: hidden;
}
.quiz-top .progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }
#counter, #timer {
  font-family: var(--font-num); font-weight: 700; font-size: .92rem;
  color: var(--text-body); white-space: nowrap;
}
#timer { min-width: 56px; text-align: right; }
#timer.is-urgent { color: var(--ng); }
.mode-note {
  border-left: 4px solid var(--primary-light);
  background: var(--bg-soft); border-radius: var(--radius-sm);
  padding: 10px var(--gap); margin-bottom: var(--gap);
  font-size: .88rem; color: var(--text-body);
}
.mode-note strong { color: var(--primary-dark); margin-right: 6px; }

.question {
  background: var(--bg-white); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: var(--gap-md);
  box-shadow: var(--shadow-card);
}
.question .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--gap-sm); }
.question .meta span {
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--bg-soft); color: var(--text-body);
  font-size: .76rem; font-weight: 700;
}
.question .meta #qid { font-family: var(--font-num); color: var(--text-muted); }
.question .meta #qcat { background: var(--heading-bg); color: var(--primary-dark); }
#prompt { font-size: 1.12rem; font-weight: 700; margin-bottom: var(--gap); }
.prompt-paragraph { display: block; }
.prompt-paragraph + .prompt-paragraph { margin-top: 4px; }

.passage {
  background: var(--cream-bg); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: var(--gap) var(--gap-md);
  margin-bottom: var(--gap);
}
.passage h3 { font-size: .98rem; color: var(--primary-dark); }
.passage .passage-body p { font-size: .96rem; line-height: 1.95; margin-bottom: .8em; }
.passage .passage-body p:last-child { margin-bottom: 0; }
.passage .passage-meta { margin-top: 8px; font-size: .76rem; color: var(--text-muted); }

/* choices */
#choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  text-align: left; background: var(--bg-white);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 12px var(--gap); color: var(--text-main);
  transition: border-color .15s, background .15s;
}
.choice:hover:enabled { border-color: var(--primary-light); background: var(--bg-soft); }
.choice b {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-soft); color: var(--primary-dark);
  font-family: var(--font-num); font-size: .82rem;
}
.choice > span { flex: 1 1 auto; line-height: 1.75; }
.choice.is-selected { border-color: var(--primary); background: var(--heading-bg); }
.choice.is-selected b { background: var(--primary); color: var(--text-invert); }
.choice.is-correct { border-color: var(--ok); background: var(--ok-bg); }
.choice.is-correct b { background: var(--ok); color: var(--text-invert); }
.choice.is-wrong { border-color: var(--ng); background: var(--ng-bg); }
.choice.is-wrong b { background: var(--ng); color: var(--text-invert); }
.choice:disabled { cursor: default; opacity: 1; }
.choice.is-dim { opacity: .62; }

.answer-input { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; }
.answer-input input {
  font-family: var(--font-num); font-size: 1.2rem; font-weight: 700;
  width: 160px; padding: 10px var(--gap-sm);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--bg-white); color: var(--text-main);
}
.answer-input input:focus { outline: 2px solid var(--primary-light); outline-offset: 1px; }
.answer-input .unit { color: var(--text-body); font-size: .9rem; }

/* ordering */
.order-slots {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: var(--gap-sm); margin-bottom: 10px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--bg-soft); min-height: 56px; align-items: center;
}
.order-slots .placeholder { color: var(--text-muted); font-size: .85rem; }
.order-slots .slot {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-white); border: 1px solid var(--primary-light);
  border-radius: var(--radius-pill); padding: 6px 12px; font-size: .9rem;
}
.order-slots .slot i {
  font-family: var(--font-num); font-style: normal; font-weight: 700;
  color: var(--primary); font-size: .78rem;
}
.order-actions { display: flex; flex-wrap: wrap; gap: var(--gap-sm); margin-top: var(--gap-sm); }
.choice.is-used { opacity: .4; }

.submit-answer { margin-top: var(--gap); }

/* feedback */
#feedback { display: none; margin-top: var(--gap-md); border-radius: var(--radius); padding: var(--gap); }
#feedback.is-shown { display: block; }
#feedback.ok { background: var(--ok-bg); border: 1px solid var(--ok); }
#feedback.ng { background: var(--ng-bg); border: 1px solid var(--ng); }
.feedback-title { display: flex; align-items: center; gap: 8px; margin-bottom: var(--gap-sm); }
#resultIcon { font-size: 1.3rem; font-weight: 700; font-family: var(--font-num); }
#feedback.ok #resultIcon, #feedback.ok #result { color: var(--ok); }
#feedback.ng #resultIcon, #feedback.ng #result { color: var(--ng-dark); }
#result { font-size: 1.05rem; margin: 0; }
.correct-answer-display {
  background: var(--bg-white); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 8px var(--gap);
  margin-bottom: var(--gap-sm); font-size: .95rem;
}
.correct-answer-display b { font-family: var(--font-num); color: var(--primary-dark); }
.explain { background: var(--bg-white); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: var(--gap-sm) var(--gap); }
.explain > strong { display: block; font-size: .82rem; color: var(--text-muted); margin-bottom: 4px; }
.explain-heading {
  margin: var(--gap-sm) 0 2px; font-size: .88rem; color: var(--primary-dark);
  border-left: 3px solid var(--primary-light); padding-left: 8px;
}
.explain-heading:first-child { margin-top: 0; }
.explain-line { margin: 0 0 2px; font-size: .95rem; line-height: 1.85; }
p.trap {
  margin: var(--gap-sm) 0 0; padding: 8px var(--gap);
  background: var(--warn-bg); border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm); font-size: .9rem; color: var(--text-main);
}
p.trap::before { content: "ひっかかりやすい点："; font-weight: 700; color: var(--warn); }

.quiz-actions { display: flex; justify-content: space-between; gap: var(--gap-sm); margin-top: var(--gap); }

/* ---------------------------------------------- figures (CSSのみ) */
figure.data-figure {
  margin: 0 0 var(--gap); padding: var(--gap-sm) var(--gap);
  background: var(--bg-soft); border: 1px solid var(--border-color);
  border-radius: var(--radius);
}
figure.data-figure figcaption {
  font-size: .85rem; font-weight: 700; color: var(--primary-dark);
  margin-bottom: 8px;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table {
  border-collapse: collapse; width: 100%; min-width: 320px;
  background: var(--bg-white); font-size: .92rem;
}
.table-scroll th, .table-scroll td {
  border: 1px solid var(--border-strong); padding: 7px 10px; text-align: right;
  font-family: var(--font-num);
}
.table-scroll th { background: var(--heading-bg); color: var(--primary-dark); font-weight: 700; }
.table-scroll th:first-child, .table-scroll td:first-child { text-align: left; font-family: var(--font-base); }
.table-scroll tbody tr:nth-child(even) td { background: var(--bg-light); }

.bar-chart { display: flex; flex-direction: column; gap: 7px; }
.bar-chart > div { display: flex; align-items: center; gap: 8px; }
.bar-chart > div > span {
  flex: 0 0 auto; width: 92px; font-size: .82rem; color: var(--text-body);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bar-chart > div > i {
  display: block; height: 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--primary-light); min-width: 2px;
}
.bar-chart > div > b {
  flex: 0 0 auto; font-family: var(--font-num); font-size: .82rem;
  color: var(--text-main); min-width: 52px;
}
.bar-chart > div[data-series="1"] > i { background: var(--accent); }
.bar-legend { display: flex; flex-wrap: wrap; gap: var(--gap); margin-top: 8px; font-size: .78rem; color: var(--text-body); }
.bar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.bar-legend i { width: 14px; height: 10px; border-radius: 2px; background: var(--primary-light); }
.bar-legend span[data-series="1"] i { background: var(--accent); }

.network { display: flex; flex-direction: column; gap: 6px; }
.network .net-nodes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.network .net-nodes span {
  padding: 4px 11px; border-radius: var(--radius-pill);
  background: var(--bg-white); border: 1px solid var(--primary-light);
  font-size: .82rem; font-weight: 700; color: var(--primary-dark);
}
.network .net-edge {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--bg-white); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 5px 10px; font-size: .88rem;
}
.network .net-edge em { font-style: normal; font-weight: 700; color: var(--primary-dark); }
.network .net-edge .arrow { color: var(--text-muted); font-family: var(--font-num); }
.network .net-edge .net-val { margin-left: auto; font-size: .82rem; color: var(--text-body); }

/* fractions */
.math-frac {
  display: inline-flex; flex-direction: column; vertical-align: -0.5em;
  text-align: center; margin: 0 2px; font-family: var(--font-num);
  line-height: 1.15;
}
.math-frac-num { display: block; padding: 0 3px; border-bottom: 1.4px solid currentColor; }
.math-frac-den { display: block; padding: 0 3px; }

/* ---------------------------------------------- finish */
.score-hero { text-align: center; padding: var(--gap-lg) var(--gap); }
.score-hero .score-main {
  font-family: var(--font-num); font-size: 2.8rem; font-weight: 700;
  color: var(--primary-dark); line-height: 1.2;
}
.score-hero .score-main small { font-size: 1.1rem; color: var(--text-muted); }
.score-hero .score-rate { font-family: var(--font-num); font-size: 1.1rem; color: var(--accent-dark); font-weight: 700; }
.score-hero .score-comment { max-width: 620px; margin: var(--gap-sm) auto 0; color: var(--text-body); }
.mock-sections { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-bottom: var(--gap-lg); }
.mock-section { background: var(--bg-white); border: 1px solid var(--border-color); border-radius: var(--radius); padding: var(--gap); }
.mock-section h3 { font-size: 1rem; color: var(--primary-dark); }
.mock-section .mock-score { font-family: var(--font-num); font-size: 1.8rem; font-weight: 700; }
.mock-section dl { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--gap-sm); margin: var(--gap-sm) 0 0; font-size: .86rem; }
.mock-section dt { color: var(--text-muted); }
.mock-section dd { margin: 0; font-family: var(--font-num); }

.review-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--gap-sm); }
.review-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--bg-white); border: 1px solid var(--border-color);
  border-left: 4px solid var(--ng); border-radius: var(--radius);
  padding: 10px var(--gap); font-size: .92rem;
}
.review-list li .rl-id { font-family: var(--font-num); font-size: .78rem; color: var(--text-muted); }
.review-list li .rl-cat { font-weight: 700; }
.review-list li .rl-prompt { flex: 1 1 260px; color: var(--text-body); font-size: .86rem; }
.review-list li a { margin-left: auto; font-weight: 700; white-space: nowrap; }
.actions-row { display: flex; flex-wrap: wrap; gap: var(--gap-sm); margin-top: var(--gap-lg); }

/* ---------------------------------------------- history */
.history-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--bg-white); }
.history-table th, .history-table td { border-bottom: 1px solid var(--border-color); padding: 9px 10px; text-align: right; }
.history-table th { background: var(--heading-bg); color: var(--primary-dark); font-weight: 700; white-space: nowrap; }
.history-table th:first-child, .history-table td:first-child { text-align: left; }
.history-table td.num, .history-table td .num { font-family: var(--font-num); }
.history-table tr[data-empty="1"] td { color: var(--text-muted); }
.log-list { list-style: none; padding: 0; margin: 0; }
.log-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 9px 4px; border-bottom: 1px solid var(--border-color); font-size: .9rem;
}
.log-list .log-mark { font-family: var(--font-num); font-weight: 700; width: 1.2em; }
.log-list li.is-ok .log-mark { color: var(--ok); }
.log-list li.is-ng .log-mark { color: var(--ng); }
.log-list .log-id { font-family: var(--font-num); font-size: .78rem; color: var(--text-muted); }
.log-list .log-cat { font-weight: 700; }
.log-list .log-when, .log-list .log-sec { font-family: var(--font-num); font-size: .82rem; color: var(--text-muted); }
.log-list li a { margin-left: auto; font-weight: 700; white-space: nowrap; }
.data-tools { display: flex; flex-wrap: wrap; gap: var(--gap-sm); align-items: center; }
.data-tools .tool-note { font-size: .82rem; color: var(--text-muted); flex: 1 1 260px; }

/* ---------------------------------------------- wrong */
.wrong-summary {
  background: var(--ng-bg); border: 1px solid var(--ng);
  border-radius: var(--radius); padding: var(--gap) var(--gap-md); margin-bottom: var(--gap-lg);
}
.wrong-summary p { margin: 0; font-weight: 700; color: var(--ng-dark); }
.wrong-card {
  background: var(--bg-white); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: var(--gap); margin-bottom: var(--gap-sm);
}
.wrong-card .wc-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.wrong-card .wc-prompt { font-weight: 700; font-size: .98rem; margin-bottom: 6px; }
.wrong-card .wc-answer { font-size: .9rem; color: var(--text-body); }
.wrong-card .wc-answer b { color: var(--ok); }
.wrong-card .wc-foot { display: flex; justify-content: flex-end; margin-top: 6px; }

/* ---------------------------------------------- mock intro / transition */
.mock-hero { text-align: center; padding: var(--gap-xl) var(--gap); }
.mock-hero h1 { font-size: 1.6rem; }
.mock-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); margin: var(--gap-lg) 0; }
.mock-step {
  background: var(--bg-white); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: var(--gap); min-width: 200px;
}
.mock-step .step-no { font-family: var(--font-num); font-size: .8rem; color: var(--primary-light); font-weight: 700; }
.mock-step .step-name { font-weight: 700; font-size: 1.05rem; }
.mock-step .step-detail { font-family: var(--font-num); color: var(--accent-dark); font-weight: 700; }
.notice {
  text-align: left; max-width: 620px; margin: 0 auto var(--gap-lg);
  background: var(--warn-bg); border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm); padding: var(--gap); font-size: .9rem;
}
.notice ul { margin: 0; padding-left: 1.3em; }

/* ---------------------------------------------- personality */
.likert-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--gap-sm); }
.likert-item {
  background: var(--bg-white); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: var(--gap-sm) var(--gap);
}
.likert-item.is-unanswered { border-left: 4px solid var(--warn); }
.likert-item.is-answered { border-left: 4px solid var(--ok); }
.likert-item .li-no { font-family: var(--font-num); font-size: .76rem; color: var(--text-muted); }
.likert-item .li-text { font-weight: 700; font-size: .98rem; margin: 2px 0 8px; }
.likert-options { display: grid; gap: 6px; grid-template-columns: repeat(4, 1fr); }
.likert-options button {
  border: 1px solid var(--border-strong); background: var(--bg-white);
  border-radius: var(--radius-sm); padding: 8px 6px;
  font-size: .8rem; font-weight: 700; color: var(--text-body); line-height: 1.4;
}
.likert-options button[aria-pressed="true"] { background: var(--primary); color: var(--text-invert); border-color: var(--primary); }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--gap-sm); margin: var(--gap) 0; }
.pager .pager-state { font-family: var(--font-num); font-weight: 700; color: var(--text-body); }

.scale-chart { display: flex; flex-direction: column; gap: var(--gap); }
.scale-row { background: var(--bg-white); border: 1px solid var(--border-color); border-radius: var(--radius); padding: var(--gap-sm) var(--gap); }
.scale-row .sr-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.scale-row .sr-name { font-weight: 700; }
.scale-row .sr-band { font-size: .76rem; }
.scale-row .sr-value { margin-left: auto; font-family: var(--font-num); font-weight: 700; color: var(--primary-dark); }
.scale-row .sr-track {
  position: relative; height: 14px; border-radius: var(--radius-pill);
  background: var(--bg-soft); margin: 8px 0 4px; overflow: hidden;
}
.scale-row .sr-fill { display: block; height: 100%; background: var(--primary-light); border-radius: var(--radius-pill); }
.scale-row .sr-fill[data-band="high"] { background: var(--accent); }
.scale-row .sr-fill[data-band="low"] { background: var(--warn); }
.scale-row .sr-axis { display: flex; justify-content: space-between; font-size: .74rem; color: var(--text-muted); }
.result-block { margin-top: var(--gap-lg); }
.result-block h3 { font-size: 1.05rem; color: var(--primary-dark); }
.tag-list { list-style: none; padding: 0; margin: 0 0 var(--gap-sm); display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list li { background: var(--bg-soft); border-radius: var(--radius-pill); padding: 4px 11px; font-size: .82rem; }
.tag-list.is-watch li { background: var(--warn-bg); color: var(--text-main); }
.qa-list { margin: 0; padding-left: 1.2em; }
.qa-list li { margin-bottom: 4px; font-size: .94rem; }
.disclaimer {
  margin-top: var(--gap-xl); background: var(--bg-soft);
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  padding: var(--gap); font-size: .84rem; color: var(--text-body);
}
.disclaimer strong { color: var(--text-main); }

/* ---------------------------------------------- misc */
.empty-state { text-align: center; padding: var(--gap-xl) var(--gap); color: var(--text-body); }
.empty-state .empty-icon { font-size: 2rem; font-family: var(--font-num); color: var(--border-strong); }
.loading { padding: var(--gap-xl); text-align: center; color: var(--text-muted); }
.site-footer {
  border-top: 1px solid var(--border-color); background: var(--bg-white);
  padding: var(--gap-lg) var(--gap); margin-top: var(--gap-xl);
}
.footer-inner { max-width: var(--container); margin: 0 auto; font-size: .84rem; color: var(--text-muted); }
.footer-inner p { margin-bottom: 4px; }

/* ---------------------------------------------- responsive */
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; gap: var(--gap-sm); padding: 10px var(--gap); }
  .site-nav { order: 3; width: 100%; }
  .header-tools { order: 2; }
  .field-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 820px) {
  main { padding: var(--gap) var(--gap-sm) var(--gap-xl); }
  .question { padding: var(--gap); }
  .page-head h1 { font-size: 1.45rem; }
  .mock-steps { flex-direction: column; align-items: stretch; }
  .score-hero .score-main { font-size: 2.3rem; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  .logo small { display: none; }
  .site-nav a { padding: 7px 9px; font-size: .86rem; }
  .field-grid, .mode-grid, .stat-grid { grid-template-columns: 1fr; }
  .likert-options { grid-template-columns: repeat(2, 1fr); }
  .quiz-actions { flex-direction: column-reverse; }
  .quiz-actions button { width: 100%; }
  .bar-chart > div > span { width: 68px; font-size: .76rem; }
  #prompt { font-size: 1.04rem; }
  .review-list li a, .log-list li a { margin-left: 0; }
}

/* ---------------------------------------------- dark theme tweaks */
[data-theme="dark"] .choice { background: var(--bg-soft); }
[data-theme="dark"] .table-scroll table { background: var(--bg-soft); }
[data-theme="dark"] .table-scroll tbody tr:nth-child(even) td { background: var(--bg-white); }
[data-theme="dark"] .correct-answer-display,
[data-theme="dark"] .explain { background: var(--bg-soft); }
[data-theme="dark"] .nav-count[data-zero="1"] { color: var(--bg-light); }
