/* 経歴エディタ（editor.html）。配色はダッシュボードと共通 */
:root {
  --navy: #1f2a44;
  --navy-soft: #9aa3b5;
  --teal: #0d9488;
  --blue: #2563eb;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --page: #f5f6f8;
  --ok: #047857;
  --ng: #b91c1c;
  --warn: #b45309;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 24px 16px;
  background: var(--page);
  color: var(--text);
  font-family: "Inter", "Noto Sans JP", "Meiryo UI", sans-serif;
  font-size: 14px;
}
/* ===== 画面移動（ダッシュボード・スキルシートの #lang-buttons と同じ位置・見た目） ===== */
.top-bar {
  max-width: 1400px;
  margin: 0 auto 12px;
  display: flex;
  gap: 8px;
}
.page-nav {
  display: flex;
  gap: 8px;
}
/* 言語の切り替え（ダッシュボードなどの #lang-buttons button と同じ見た目） */
.lang-switch {
  display: flex;
  margin-left: auto;
}
.lang-switch button {
  border: 1px solid var(--navy);
  background: #fff;
  color: var(--navy);
  border-radius: 6px;
  padding: 6px 18px;
  font-weight: bold;
  cursor: pointer;
}
.lang-switch button.active {
  background: var(--navy);
  color: #fff;
}
/* JP／EN は 1 つの切り替え（つなげて表示） */
.lang-switch button:first-child {
  border-radius: 6px 0 0 6px;
}
.lang-switch button:last-child {
  border-radius: 0 6px 6px 0;
  border-left: 0;
}
.page-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--navy);
  background: #fff;
  color: var(--navy);
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: bold;
  font-size: 13px;
  text-decoration: none;
}
.page-nav-icon {
  flex: none;
}

/* ロゴ（トップページへのリンク。assets/js/page_nav.js・トップページのロゴと同じ見た目） */
.page-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 24px; /* 画面移動のボタンと間をあける */
  color: var(--navy);
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
}
.page-nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #0d9488;
  display: grid;
  place-items: center;
}
.page-nav-brand:hover .page-nav-brand-name {
  text-decoration: underline;
}
/* スマホの画面上部（☰ メニュー）は assets/css/nav_mobile.css */
.page-nav-btn:hover {
  background: #eef2f7;
}

/* 今いる画面のボタン（タブの選択中）: 塗りつぶし・押せない */
.page-nav-btn.current {
  background: var(--navy);
  color: #fff;
  cursor: default;
  pointer-events: none;
}

/* ===== カード・見出し（ダッシュボードの .dashboard / .dash-header と同じ） ===== */
.ed-card {
  max-width: 1400px;
  margin: 0 auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(31, 42, 68, 0.08);
  overflow: hidden;
}
.ed-header {
  background: var(--navy);
  color: #fff;
  padding: 18px 24px 14px;
  border-bottom: 4px solid var(--teal);
}
.ed-header h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.04em;
}
.ed-header .subtitle {
  color: var(--navy-soft);
  font-size: 11px;
  margin-top: 2px;
}
.ed-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.ed-tools .group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ed-tools button,
.ed-tools .btn {
  border: 1px solid var(--navy);
  background: #fff;
  color: var(--navy);
  border-radius: 6px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ed-tools button.primary {
  background: var(--navy);
  color: #fff;
}
.ed-tools button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ed-tools select {
  font: inherit;
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
/* 会社名の出し方（マスク名｜実名）: ダッシュボードの TOP10／すべて と同じ形の切り替え */
.mask-switch {
  display: inline-flex;
  align-items: center;
}
.mask-switch-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-right: 8px;
}
.ed-tools .mask-switch button {
  border-radius: 0;
  font-weight: 600;
}
.ed-tools .mask-switch button:first-of-type {
  border-radius: 6px 0 0 6px;
}
.ed-tools .mask-switch button:last-of-type {
  border-radius: 0 6px 6px 0;
  border-left: 0;
}
.ed-tools .mask-switch button.active {
  background: var(--navy);
  color: #fff;
}
.status {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}
.status.ok {
  color: var(--ok);
}
.status.error {
  color: var(--ng);
}
.ed-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  padding: 16px 24px;
  height: calc(100vh - 250px);
  min-height: 480px;
}
.editor-pane {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-height: 0;
  display: flex; /* 上に今いる場所、下に編集欄 */
  flex-direction: column;
}
/* 今いる場所（職歴・所属・案件の番号） */
.ed-path {
  flex: none;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--page);
  font-size: 12px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 目次 */
.outline { margin: 10px 0; font-size: 13px; }
.outline summary { cursor: pointer; font-weight: 600; }
.outline-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow: auto; }
.outline-list li { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.outline-list li.lv1 { padding-left: 14px; }
.outline-list li.lv2 { padding-left: 28px; }
.outline-list li.empty { color: #6b7280; }
.outline-list a { color: #1f2937; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outline-list a:hover { text-decoration: underline; }
.outline-list a b { color: #1f6f43; font-weight: 600; }
.outline-list .ol-fold { flex: none; width: 18px; height: 18px; padding: 0; border: 0; background: none; color: #6b7280; cursor: pointer; font-size: 11px; }
.editor-pane textarea,
.editor-pane .CodeMirror {
  width: 100%;
  flex: 1 1 0; /* 今いる場所の残り */
  min-height: 0;
  height: auto;
  border: 0;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 13px;
}
.editor-pane textarea {
  padding: 12px;
  resize: none;
}
.check-pane {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  overflow: auto;
}
.check-pane h2 {
  margin: 0 0 8px;
  font-size: 15px;
}
.summary {
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--page);
  font-size: 13px;
}
.summary.ok {
  color: var(--ok);
  background: #ecfdf5;
}
.summary.ng {
  color: var(--ng);
  background: #fef2f2;
}
.problems {
  list-style: none;
  margin: 10px 0;
  padding: 0;
}
.problems li {
  border-left: 3px solid var(--line);
  padding: 6px 8px;
  margin-bottom: 6px;
  font-size: 12.5px;
  background: #fafafa;
}
.problems li.error {
  border-color: var(--ng);
}
.problems li.warn {
  border-color: var(--warn);
}
.problems li[data-line] {
  cursor: pointer;
}
.problems code {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
  word-break: break-all;
}
.help {
  font-size: 12.5px;
  margin-top: 8px;
}
.help summary {
  cursor: pointer;
  font-weight: 600;
}
.help code {
  background: var(--page);
  padding: 0 3px;
  border-radius: 3px;
}
.note {
  font-size: 11.5px;
  color: var(--muted);
}
@media screen and (max-width: 900px) {
  .ed-main {
    grid-template-columns: 1fr;
    height: auto;
  }
  .editor-pane {
    height: 60vh;
  }
}

/* ===== 集計結果（「集計を実行」・assets/js/career_metrics.js） ===== */
.metrics-box {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--page);
  font-size: 12.5px;
  color: var(--muted);
}
.metrics-box.fresh {
  background: #f0f7ff;
  color: var(--text);
}
.metrics-box.stale {
  background: #fffbeb;
  color: var(--text);
}
.metrics-box .stale-note {
  margin-left: 8px;
  color: var(--warn);
  font-size: 11.5px;
}
.metrics-box dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 6px 0 0;
}
.metrics-box dt {
  color: var(--muted);
}
.metrics-box dd {
  margin: 0;
}

/* カーソルのある行（CodeMirror の active-line）。行番号の欄も同じ色にして、どの行か分かりやすくする */
.editor-pane .CodeMirror-activeline-background { background: #fff7cc; }
.editor-pane .CodeMirror-activeline-gutter { background: #fde68a; }
.editor-pane .CodeMirror-activeline .CodeMirror-linenumber { color: #92400e; font-weight: 700; }

/* 入力補完のプルダウン（CodeMirror の show-hint） */
.CodeMirror-hints { font-family: "Noto Sans JP", system-ui, sans-serif; font-size: 13px; z-index: 50; }
.CodeMirror-hint { padding: 3px 10px; }
li.CodeMirror-hint-active { background: #1f2a44; color: #fff; }
