/* 経験の棚卸し — styles
 * 白生成りの紙面に、藍が骨格。砂色は「現在地」と「決定」だけ。
 * トークンは shared/bridge.css v3.0 から転記(このツールは共通シェルを読まないため)。
 */

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

:root {
  --bg: #FBFAF7;
  --bg-2: #F4EFE6;
  --ink: #1B1B1E;
  --ink-2: #45464C;
  --ink-3: #63646B;
  --ink-4: #B6B3AB;
  --line: rgba(27, 27, 30, 0.10);
  --navy: #16233E;
  --blue: #24365C;
  --blue-soft: #8B9BBC;
  --dawn: #A98F63;         /* 砂色。面と罫に使う温度 */
  --dawn-deep: #7D6845;    /* 文字として使える砂。--dawnは白面3.09:1でAA未達 */
  --dark-sec: #131A2A;     /* 砂の上に置く炭(チェック印・選択範囲) */
  --card: #FFFFFF;
  --shadow: 0 2px 8px rgba(22, 35, 62, 0.04), 0 16px 48px rgba(22, 35, 62, 0.07);
  --mincho: 'Shippori Mincho B1', 'Noto Serif JP', serif;
  --sans: 'Noto Sans JP', sans-serif;
  --en: 'Inter', sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
[data-theme="dark"] {
  --bg: #111521;
  --bg-2: #161B2B;
  --ink: #EDEAE2;
  --ink-2: #C2BFB6;
  --ink-3: #8A8D98;
  --ink-4: #565A68;
  --line: rgba(237, 234, 226, 0.10);
  --navy: #D8DEEB;
  --blue: #9FB1D4;
  --blue-soft: #5A6C92;
  --dawn: #C2A97E;
  --dawn-deep: #C2A97E;    /* ダークは--dawnが暗い面で7.33:1と合格しているため暗くしない */
  --dark-sec: #0B0F1A;
  --card: #181E2E;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 16px 48px rgba(0, 0, 0, 0.35);
}

html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.9;
  min-height: 100dvh;
  font-feature-settings: "palt" 1;
  transition: background .5s, color .5s;
}
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--dawn); color: var(--dark-sec); }

/* スマホでだけ効かせる改行 */
.sp { display: inline; }
@media (min-width: 600px) { .sp { display: none; } }
.nowrap { white-space: nowrap; }

/* ---------- 骨格 ---------- */

.wrap {
  max-width: 660px;
  margin: 0 auto;
  padding: 12px 22px calc(64px + env(safe-area-inset-bottom));
}

/* 上部バー:ツール名とテーマ切替のみ。迫らない */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 10px;
}
.bar .name {
  font-family: var(--mincho);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.bar .name a { display: inline-flex; align-items: baseline; gap: 9px; }
.bar .name .en {
  font: 600 9px/1 var(--en);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.bar-right { display: flex; align-items: center; gap: 10px; }
.theme-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--ink-3);
  transition: color .3s, border-color .3s;
  position: relative;
}
/* 見た目は34pxのまま、タップ領域だけ44pxに広げる */
.theme-btn::before { content: ''; position: absolute; inset: -5px; border-radius: 50%; }
.theme-btn svg { width: 15px; height: 15px; }
.theme-btn:hover { color: var(--ink); border-color: var(--blue-soft); }
.theme-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-btn .icon-sun { display: block; }
[data-theme="dark"] .theme-btn .icon-moon { display: none; }

/* ---------- ビュー切替 ---------- */

.view { display: none; }
.view.on { display: block; animation: rise .45s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .view.on { animation: none; }
}

/* ---------- 共通タイポ ---------- */

.eyebrow {
  font: 700 10px/1 var(--en);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--dawn); }

/* ---------- ① 入口 ---------- */

.intro-hero { padding: 8vh 0 0; }
.intro-hero h1 {
  font-family: var(--mincho);
  font-weight: 600;
  font-size: clamp(25px, 6.6vw, 36px);
  line-height: 1.7;
  letter-spacing: 0.02em;
  margin: 20px 0 22px;
}
.intro-lead {
  font-size: 14.5px;
  line-height: 2.15;
  color: var(--ink-2);
  max-width: 560px;
  margin-bottom: 14px;
}
.intro-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
}
.intro-notes {
  margin: 26px 0 0;
  list-style: none;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 2.1;
}
.intro-notes li { padding-left: 16px; position: relative; }
.intro-notes li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.95em;
  width: 6px; height: 1px;
  background: var(--ink-4);
}

/* ---------- ボタン ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 100px;
  font: 700 14px/1.4 var(--sans);
  letter-spacing: 0.05em;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), opacity .2s, border-color .25s, color .25s;
}
.btn.primary { background: var(--blue); color: #fff; }
[data-theme="dark"] .btn.primary { color: #08131E; }
.btn.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.ghost {
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-weight: 500;
  background: transparent;
}
.btn.ghost:hover { border-color: var(--blue-soft); color: var(--ink); }
.btn.quiet {
  min-height: 44px;
  padding: 8px 6px;
  border-radius: 6px;
  color: var(--ink-3);
  font-weight: 500;
  font-size: 13px;
}
.btn.quiet:hover { color: var(--ink); }
.btn.quiet.marked { color: var(--dawn-deep); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:disabled:hover { transform: none; box-shadow: none; }

/* ---------- ② 職種選択 ---------- */

.view-head { padding: 4vh 0 8px; }
.view-head h2 {
  font-family: var(--mincho);
  font-weight: 600;
  font-size: clamp(21px, 5.4vw, 27px);
  line-height: 1.7;
  margin: 14px 0 10px;
}
.view-head .sub { font-size: 13.5px; color: var(--ink-3); line-height: 2.1; max-width: 540px; }

.role-list { margin-top: 22px; border-top: 1px solid var(--line); }
.role-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}
.role-item .arrow { color: var(--ink-4); font-family: var(--en); transition: color .2s, transform .3s var(--ease); }
.role-item:hover .arrow { color: var(--dawn); transform: translateX(3px); }

/* ---------- ③ 質問(単票) ---------- */

/* 現在地:6カテゴリのドット。残数は数えない、いまどの章かだけ */
.waypoints {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0 0;
}
.waypoints .wp {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--line);
  transition: background .4s;
}
.waypoints .wp.visited { background: var(--ink-4); }
.waypoints .wp.here { background: var(--dawn); }

.quest-cat {
  font: 700 10px/1 var(--en);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 24px;
}
.quest-cat .jp {
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--ink-2);
  margin-left: 10px;
}
.quest-q {
  font-family: var(--mincho);
  font-weight: 600;
  font-size: clamp(19px, 5vw, 23px);
  line-height: 1.8;
  margin: 12px 0 6px;
}
.quest-hint {
  font-size: 12.5px;
  line-height: 2;
  color: var(--ink-3);
  margin-bottom: 20px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field label .opt { font-weight: 400; color: var(--ink-3); font-size: 11.5px; margin-left: 8px; }
.field textarea {
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: 400 16px/1.9 var(--sans);
  resize: vertical;
  transition: border-color .25s;
}
.field textarea::placeholder { color: var(--ink-4); font-size: 13px; }
.field textarea:focus { outline: none; border-color: var(--blue-soft); }

.quest-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}
.quest-nav .grow { flex: 1; }
.reassure {
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 2;
}

/* ---------- ④ 材料一覧 ---------- */

.mat-list { margin-top: 20px; border-top: 1px solid var(--line); }
.mat-row { padding: 16px 4px 14px; border-bottom: 1px solid var(--line); }
.mat-row .cat {
  font: 700 10px/1.6 var(--sans);
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.mat-row .q {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin: 0 0 4px;
  line-height: 1.9;
}
.mat-row .q .draft {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  color: var(--dawn-deep);
  border: 1px solid currentColor;
  border-radius: 100px;
  padding: 0 8px;
  line-height: 1.7;
  margin-left: 8px;
  vertical-align: 1px;
}
.mat-row .a { font-size: 13.5px; color: var(--ink-2); line-height: 2.05; }
.mat-row .a .k { color: var(--ink-3); font-size: 11px; margin-right: 7px; }
.mat-row .ops { display: flex; gap: 16px; }
.mat-row .ops button {
  font-size: 12px;
  color: var(--ink-3);
  padding: 4px 2px;
  min-height: 44px;
}
.mat-row .ops button:hover { color: var(--ink); }

.mat-empty {
  padding: 40px 0;
  color: var(--ink-3);
  font-size: 13.5px;
  line-height: 2.1;
}

.mat-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- ⑤ 出力 ---------- */

.out-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 3px;
  margin: 14px 0 4px;
}
.out-toggle button {
  min-height: 40px;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  transition: background .3s, color .3s;
}
.out-toggle button.on { background: var(--blue); color: #fff; }
[data-theme="dark"] .out-toggle button.on { color: #08131E; }

.out-paper {
  margin-top: 14px;
  padding: 22px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.out-paper pre {
  font: 400 13.5px/2.1 var(--sans);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}
.out-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.out-note {
  margin-top: 26px;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 2.1;
  max-width: 560px;
}

.careerlog {
  margin-top: 30px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  max-width: 560px;
}
.careerlog p { font-size: 13px; color: var(--ink-2); line-height: 2.15; }
.careerlog.second p, .careerlog.second a { font-size: 12.5px; color: var(--ink-3); }
.careerlog a {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  border-bottom: 1px solid var(--dawn);
  padding-bottom: 1px;
  transition: color .2s;
}
.careerlog a:hover { color: var(--ink); }

/* ---------- 戻る導線・フッター ---------- */

.back-line { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 4px 22px; }

.foot {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.foot a:hover { color: var(--ink-2); }

/* ---------- トースト ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  background: var(--navy);
  color: var(--bg);
  font-size: 13px;
  padding: 10px 22px;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease);
  z-index: 50;
  max-width: calc(100vw - 40px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- デスクトップ微調整 ---------- */

@media (min-width: 720px) {
  .wrap { padding-top: 20px; }
  .quest-nav { margin-top: 30px; }
}
