/* スキルシート型の画面（skillsheet.html）。Excel「スキルシート」の罫線・見出しに合わせる */
:root {
  --navy: #1f2a44;
  --head: #dde7f5;
  --line: #9ca3af;
  --text: #1f2937;
  --muted: #6b7280;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 16px;
  background: #f5f6f8;
  color: var(--text);
  font-family: "Inter", "Noto Sans JP", "Meiryo UI", sans-serif;
  font-size: 12px;
}
#lang-buttons {
  max-width: 1400px;
  margin: 0 auto 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
#lang-buttons button {
  border: 1px solid var(--navy);
  background: #fff;
  color: var(--navy);
  border-radius: 6px;
  padding: 5px 16px;
  font-weight: bold;
  cursor: pointer;
}
#lang-buttons button.active {
  background: var(--navy);
  color: #fff;
}
/* JP／EN は 1 つの切り替え（つなげて表示） */
#lang-buttons #btn-ja {
  border-radius: 6px 0 0 6px;
}
#lang-buttons #btn-en {
  border-radius: 0 6px 6px 0;
  border-left: 0;
}
#lang-buttons .lang-switch {
  display: flex;
}
.sheet {
  max-width: 1400px;
  margin: 0 auto;
  background: #fff;
  padding: 20px 24px 28px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
h1 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: 0.2em;
  text-align: center;
}
.source {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  min-height: 14px;
  margin-bottom: 8px;
}
table {
  width: 100%;
  /* 見出しを貼り付けても罫線が消えないよう、線は各セルの右・下に持たせる（collapse にしない） */
  border-collapse: separate;
  border-spacing: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  table-layout: fixed;
}
th,
td {
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 4px 6px;
  vertical-align: top;
  word-break: break-word;
}
th {
  background: var(--head);
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
  white-space: pre-line;
}

/* ヘッダー部 */
.profile {
  margin-bottom: 14px;
}
.profile th {
  width: 110px;
}
.profile td {
  line-height: 1.6;
}

/* 案件一覧（列幅は colgroup。業務内容が残りの幅を使う） */
.c-no {
  width: 34px;
}
.c-period {
  width: 82px;
}
.c-role {
  width: 82px;
}
.c-env {
  width: 112px;
}
.c-phase {
  width: 28px;
}
.projects .no,
.projects .period {
  text-align: center;
}
.projects thead .phase {
  height: 78px;
  padding: 2px;
}
.projects thead .phase span {
  writing-mode: vertical-rl;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.projects tbody .phase {
  text-align: center;
  font-size: 13px;
  padding: 4px 0;
}
.projects tbody td {
  line-height: 1.5;
}
.projects tbody tr {
  break-inside: avoid;
}
.months {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.project-title .industry {
  font-weight: normal;
  color: var(--muted);
  font-size: 0.92em;
  margin-left: 4px;
}
.project-title {
  font-weight: 700;
  margin-bottom: 2px;
}
.section-label {
  color: var(--navy);
  font-weight: 700;
  margin-top: 4px;
}
.work ul {
  margin: 0;
  padding-left: 1.2em;
}
.position {
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}
.scale {
  font-size: 11px;
  color: var(--muted);
}
html[lang="en"] .projects thead .phase span {
  font-size: 10px;
}

@page {
  size: A4 landscape;
  margin: 10mm;
}
@media print {
  body {
    background: #fff;
    padding: 0;
    font-size: 9.5px;
  }
  #lang-buttons,
  .download-menu {
    display: none !important;
  }
  .sheet {
    box-shadow: none;
    padding: 0;
    max-width: none;
  }
  th {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  thead {
    display: table-header-group; /* 改ページ後も見出しを繰り返す */
  }
  /* 印刷では環境の列を細くして業務内容に幅を回す（行が低くなりページ数が減る） */
  .c-no {
    width: 28px;
  }
  .c-period {
    width: 56px;
  }
  .c-role {
    width: 64px;
  }
  .scale {
    white-space: nowrap;
    font-size: 8.5px;
  }
  .c-env {
    width: 78px;
  }
  .c-phase {
    width: 18px;
  }
  .profile th {
    width: 70px;
  }
  .projects thead .phase {
    height: 64px;
  }
  .projects thead .phase span {
    font-size: 8.5px;
  }
  .projects tbody .phase {
    font-size: 10px;
  }
}
/* ===== 案件のカード（スマホ。表の代わり） ===== */
.project-cards {
  display: none;
}
@media screen and (max-width: 768px) {
  .projects {
    display: none;
  }
  .project-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .project-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px 12px 16px;
    background: #fff;
    font-size: 13px;
    line-height: 1.6;
    scroll-margin-top: 12px;
  }
  .project-card.marked {
    background: var(--mark-soft);
  }
  .project-card.target {
    background: #fff8db;
  }
  .project-card .mark-band i {
    border-radius: 0;
  }
  .card-head {
    display: flex;
    gap: 8px;
    align-items: baseline;
  }
  .card-no {
    flex: none;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    background: var(--navy);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    display: inline-grid;
    place-items: center;
  }
  .project-card .project-title {
    font-weight: bold;
    font-size: 14px;
  }
  .card-meta {
    margin-top: 4px;
    color: var(--navy);
  }
  .card-meta .position {
    margin-left: 6px;
    padding: 0 8px;
    border-radius: 10px;
    background: var(--navy);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
  }
  .card-scale {
    color: #6b7280;
    font-size: 12px;
  }
  .card-env {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 4px 8px;
    margin: 10px 0;
    padding: 8px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .card-env dt {
    color: #6b7280;
    font-size: 12px;
  }
  .card-env dd {
    margin: 0;
    overflow-wrap: anywhere;
  }
  .card-phases {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .card-phases span {
    padding: 0 8px;
    border: 1px solid var(--navy);
    border-radius: 10px;
    font-size: 11px;
    color: var(--navy);
  }
  .card-work ul {
    margin: 2px 0 6px;
    padding-left: 1.3em;
  }
}

/* スマホ: 上の表（氏名・学歴・メールなど）は「見出し・中身」の 2 列にして、1 行に 1 項目ずつ並べる
   （パソコンでは「見出し・中身・見出し・中身」の 4 列。中身の列が細くなって 1〜2 字ずつ折り返すのを防ぐ） */
@media screen and (max-width: 768px) {
  .profile,
  .profile tbody {
    display: block;
  }
  .profile tr {
    display: grid;
    grid-template-columns: 84px 1fr;
  }
  .profile th,
  .profile td {
    display: block;
    width: auto;
    min-width: 0;
    overflow-wrap: anywhere; /* メールアドレスなど長い英数字も枠の中で折り返す */
  }
}
@media screen and (max-width: 900px) {
  .sheet {
    overflow-x: auto;
    padding: 12px;
  }
  .projects {
    min-width: 1000px;
  }
}

/* ===== 画面移動ボタン（assets/js/page_nav.js） ===== */
.page-nav {
  display: flex;
  gap: 8px;
  margin-right: auto; /* 左寄せ（言語ボタンは右） */
}
.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: 5px 14px;
  font-weight: bold;
  font-size: 12px;
  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;
}
@media print {
  .page-nav {
    display: none;
  }
}

/* ダッシュボードの案件名から来たときの行（#所属ID-p案件番号） */
.projects tbody tr {
  /* 固定した見出し行の下に隠れないよう、その高さ分あけて止める（--head-h は skillsheet.html が設定） */
  scroll-margin-top: calc(var(--head-h, 110px) + 8px);
}
.projects tbody tr.target td {
  background: #fff8db;
}
@media print {
  .projects tbody tr.target td {
    background: none;
  }
}

/* ===== 見出し行を画面上端に固定（ナビバーのように。スクロールしても列名が見える） ===== */
.projects thead {
  position: sticky;
  top: 0;
  z-index: 5;
}
/* 貼り付いている間は下に影を付けて浮かせる（skillsheet.html が .stuck を付け外し） */
.projects.stuck thead th[rowspan],
.projects.stuck thead tr:last-child th {
  box-shadow: 0 6px 6px -6px rgba(31, 42, 68, 0.35);
}
@media print {
  .projects thead {
    position: static;
  }
  /* 印刷では固定しないので、罫線は元の「隣と共有する」形に戻す（表の外枠がページ下の余白まで伸びないように） */
  table {
    border-collapse: collapse;
    border: 0;
  }
  th,
  td {
    border: 1px solid var(--line);
  }
  .projects.stuck thead th {
    box-shadow: none !important;
  }
}

/* ===== 面談用マーキング（assets/js/marks.js・ISS-01-004） ===== */
.mark-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px 1px 4px;
  border-radius: 999px;
  background: var(--mark-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}
.mark-chip i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mark);
}
/* 行: 左端の色の帯・薄い背景・ラベル */
.projects td.no {
  position: relative;
}
.mark-band {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
}
.mark-band i {
  width: 5px;
}
.projects tbody tr.marked td {
  background: var(--mark-soft);
}
.mark-tags {
  margin: 2px 0 4px;
}
