/* リガレッセ 日次報告・評価入力アプリ
   配色は #127C6F（ティールグリーン）と白の2色基調のみ。
   それ以外の色は、状態を伝えるための無彩色の濃淡に限る。 */

:root {
  --teal: #127c6f;
  --teal-dark: #0d5d53;
  --teal-tint: #e7f2f0;
  --teal-tint-2: #f4f9f8;
  --ink: #1b2321;
  --ink-soft: #5a6663;
  --line: #d8e3e0;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(18, 124, 111, 0.12);
}

* { box-sizing: border-box; }

/* 端末がダークモードでも、フォーム部品を黒く塗らせない */
:root { color-scheme: light; }

/* チェックボックスは自前で描く。外したときも白地に緑の枠（黒くならない） */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  border: 2px solid var(--teal);
  border-radius: 4px;
  background: var(--white);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  vertical-align: middle;
}
input[type="checkbox"]::before {
  content: "";
  width: 0.62em;
  height: 0.34em;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: translateY(-0.08em) rotate(-45deg);
  opacity: 0;
}
input[type="checkbox"]:checked { background: var(--teal); }
input[type="checkbox"]:checked::before { opacity: 1; }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--teal-dark); outline-offset: 2px; }
input[type="checkbox"]:disabled { border-color: var(--line); background: var(--teal-tint-2); cursor: not-allowed; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--teal-tint-2);
}

/* ── ヘッダ（携帯優先） ── */
.site-header {
  background: var(--teal);
  color: var(--white);
  padding: 0.55rem 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
}
.site-header h1 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.site-header .brand {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  opacity: 0.85;
  display: block;
  font-weight: 400;
}
.site-header .spacer { flex: 1; }
.site-header .who { font-size: 0.85rem; }
.site-header .who strong { font-weight: 700; }

.nav-tabs {
  display: flex;
  gap: 0.2rem;
  background: var(--teal);
  padding: 0 0.55rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  white-space: nowrap;
}
.nav-tabs button[aria-selected="true"] {
  background: var(--teal-tint-2);
  color: var(--teal);
  font-weight: 700;
}

main { max-width: 1080px; margin: 0 auto; padding: 0.9rem; }

@media (min-width: 720px) {
  .site-header { padding: 0.75rem 1.25rem; gap: 0.75rem 1.25rem; }
  .site-header h1 { font-size: 1.05rem; }
  .site-header .brand { font-size: 0.7rem; }
  .nav-tabs { padding: 0 1.25rem; gap: 0.25rem; }
  .nav-tabs button { font-size: 0.9rem; padding: 0.55rem 0.95rem; }
  main { padding: 1.25rem; }
}

/* ── カード ── */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.85rem;
}
@media (min-width: 720px) {
  .card { padding: 1.1rem 1.25rem; margin-bottom: 1.1rem; }
}
.card > h2 {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  color: var(--teal);
  border-bottom: 2px solid var(--teal-tint);
  padding-bottom: 0.45rem;
}
.card > h2 .sub {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 400;
  margin-left: 0.5rem;
}

/* ── フォーム ── */
.grid { display: grid; gap: 0.9rem; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.3rem; }
label .req { color: var(--teal); margin-left: 0.2rem; }
.hint { font-size: 0.78rem; color: var(--ink-soft); font-weight: 400; margin-top: 0.25rem; }

input[type="text"], input[type="password"], input[type="date"],
input[type="week"], input[type="month"], input[type="number"], select, textarea {
  width: 100%;
  font: inherit;
  /* 16px 未満だと iOS がフォーカス時に勝手に拡大するため下限を16pxにする */
  font-size: max(16px, 1rem);
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}
textarea { min-height: 6.5rem; resize: vertical; }

/* ── ボタン ── */
button.btn {
  font: inherit;
  font-weight: 700;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: var(--white);
  cursor: pointer;
}
button.btn:hover:not(:disabled) { background: var(--teal-dark); border-color: var(--teal-dark); }
button.btn.ghost { background: var(--white); color: var(--teal); }
button.btn.ghost:hover:not(:disabled) { background: var(--teal-tint); }
button.btn.small { padding: 0.28rem 0.7rem; font-size: 0.82rem; }
button.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1rem; }

/* ── テーブル ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--teal-tint); color: var(--teal); font-weight: 700; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--teal-tint-2); }
.empty { color: var(--ink-soft); font-size: 0.88rem; padding: 0.9rem 0; }

/* ── バッジ ── */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--teal);
  color: var(--teal);
  background: var(--white);
  white-space: nowrap;
}
.badge.filled { background: var(--teal); color: var(--white); }
.badge.muted { border-color: var(--line); color: var(--ink-soft); }
.badge.strike { border-style: dashed; }

.points { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── 評価項目リスト ── */
.item-list { display: grid; gap: 0.7rem; }
.item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  background: var(--white);
}
.item.selected { border-color: var(--teal); background: var(--teal-tint-2); }
.item-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.item-head .name { font-weight: 700; flex: 1; min-width: 12rem; }
.item .note { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.35rem; }
.item .controls { margin-top: 0.6rem; display: grid; gap: 0.6rem; }
.item .controls[hidden] { display: none; }
.check-row { display: flex; gap: 0.5rem; align-items: flex-start; }
.check-row input[type="checkbox"] { margin-top: 0.4rem; width: 1.05rem; height: 1.05rem; accent-color: var(--teal); }

/* ── 通知 ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--teal);
  color: var(--white);
  padding: 0.65rem 1.3rem;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(18, 124, 111, 0.3);
  font-size: 0.9rem;
  font-weight: 700;
  max-width: min(90vw, 40rem);
  text-align: center;
  z-index: 50;
}
.toast.error { background: var(--white); color: var(--teal-dark); border: 2px solid var(--teal-dark); }
.toast[hidden] { display: none; }

.notice {
  border-left: 4px solid var(--teal);
  background: var(--teal-tint);
  padding: 0.6rem 0.9rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ── ログイン ── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: var(--teal);
}
.login-card {
  background: var(--white);
  border-radius: 14px;
  padding: 2rem 1.9rem;
  width: min(24rem, 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.login-card .logo { text-align: center; margin-bottom: 1.5rem; }
.login-card .logo .mark {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--teal);
}
.login-card .logo .app { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.35rem; }
.login-card .field { margin-bottom: 0.95rem; }
.login-card button.btn { width: 100%; padding: 0.65rem; margin-top: 0.5rem; }
.login-error {
  color: var(--teal-dark);
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--teal-tint);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.9rem;
}
.login-error[hidden] { display: none; }

.panel[hidden] { display: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── 氏名・所属・職種・役職 ── */
.identity { font-size: 0.85rem; line-height: 1.45; text-align: right; }
.identity .name { font-weight: 700; font-size: 0.98rem; }
.identity .meta { opacity: 0.9; }
.identity .meta span + span::before { content: "／"; opacity: 0.6; margin: 0 0.15rem; }

/* ── 全タブ共通の目標バー（携帯優先） ──
   ぱっと見は「60点＝達成ライン」の値だけ。全段階は開いたときだけ出す。 */
.goalbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0.9rem 0.75rem;
}

/* 画面が広いときだけ上に貼り付ける。携帯・タブレットでは入力の邪魔になるので一緒にスクロールする */
@media (min-width: 1200px) {
  .goalbar {
    position: sticky;
    top: 0;
    z-index: 20;
  }
}
.goalbar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-bottom: 0.55rem;
}
.goalbar-head h2 {
  margin: 0;
  font-size: 0.8rem;
  color: var(--teal);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.goalbar-head .src {
  font-size: 0.72rem;
  color: var(--ink-soft);
  flex: 1 1 100%;
  order: 3;
}
.goalbar-head .toggles { display: flex; gap: 0.3rem; margin-left: auto; }
.goalbar-head .toggles button {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.goalbar-head .toggles button[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
  font-weight: 700;
}

.goals { display: grid; gap: 0.45rem; }

.goal {
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  background: var(--white);
}
.goal .g-top {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.goal .g-name {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}
.goal .g-weight {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.goal .g-weight small { font-size: 0.7rem; font-weight: 400; }
.goal .g-bar {
  height: 3px;
  background: var(--teal-tint);
  border-radius: 999px;
  margin: 0.3rem 0;
}
.goal .g-bar i { display: block; height: 100%; background: var(--teal); border-radius: 999px; }

/* 60点＝達成ラインの値。ここが一番目立つ */
.goal .g-base {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.goal .g-base .tag {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--white);
  background: var(--teal);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  white-space: nowrap;
}
.goal .g-cycle { font-size: 0.7rem; color: var(--ink-soft); margin-left: auto; white-space: nowrap; }

/* 実績と、それを換算表に当てはめた点数 */
.goal .g-actual {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-top: 0.2rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--line);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.goal .g-actual .lbl { font-size: 0.68rem; color: var(--ink-soft); font-weight: 700; }
.goal .g-actual .val { font-weight: 700; }
.goal .g-actual .sc {
  margin-left: auto;
  font-weight: 700;
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 4px;
  padding: 0 0.35rem;
  white-space: nowrap;
}

/* 全段階（0〜100点）。横スクロールで携帯でも崩れない */
.scale { margin-top: 0.45rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scale[hidden] { display: none; }
.scale-row { display: flex; gap: 0.25rem; min-width: min-content; padding-bottom: 0.15rem; }
.scale-step {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  min-width: 4.6rem;
  text-align: center;
  background: var(--white);
}
.scale-step .s { font-size: 0.65rem; color: var(--ink-soft); font-weight: 700; }
.scale-step .v { font-size: 0.72rem; font-variant-numeric: tabular-nums; line-height: 1.3; }
.scale-step.is-base {
  border-color: var(--teal);
  background: var(--teal-tint);
}
.scale-step.is-base .s { color: var(--teal); }
.scale-step.is-base .v { font-weight: 700; color: var(--teal-dark); }
/* いま実績が当たっている段 */
.scale-step.is-now {
  border-color: var(--teal);
  border-width: 2px;
  background: var(--teal);
}
.scale-step.is-now .s,
.scale-step.is-now .v { color: var(--white); font-weight: 700; }

.goalbar .warn { font-size: 0.74rem; color: var(--teal-dark); margin-top: 0.45rem; font-weight: 700; }
.goalbar .empty { padding: 0; }
.goalbar.is-collapsed .goals,
.goalbar.is-collapsed .warn { display: none; }

@media (min-width: 720px) {
  .goalbar { padding: 0.7rem 1.25rem 0.8rem; }
  .goalbar-head .src { flex: 0 1 auto; order: 0; }
  .goals { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
}

/* ── サブタブ ── */
.subtabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.subtabs button {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
}
.subtabs button[aria-selected="true"] {
  border-color: var(--teal);
  background: var(--teal);
  color: var(--white);
  font-weight: 700;
}

/* ── 貢献ポイントタブの2段（入力する／見るだけ） ──
   点数が動く画面と、読むだけの画面を見た目で分ける。
   入力する段は濃いまま、見るだけの段は枠線だけの淡い見た目にする。 */
.subtabs.entry,
.subtabs.read {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.subtabs.entry { margin-bottom: 0.45rem; }
.subtabs.read { margin-bottom: 1rem; }
.subtabs.entry .sub-label,
.subtabs.read .sub-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}
.subtabs.entry .sub-label { color: var(--white); background: var(--teal); }
.subtabs.read .sub-label { color: var(--ink-soft); background: var(--teal-tint-2); border: 1px solid var(--line); }
.subtabs.read button {
  background: var(--teal-tint-2);
  border-style: dashed;
}
.subtabs.read button[aria-selected="true"] {
  background: var(--white);
  color: var(--teal);
  border-style: solid;
  border-color: var(--teal);
}

/* ── 評価点の一覧 ──
   横にスクロールさせない。列は5つまでに固定し、見出しは折り返す。
   幅が720px未満のときは、1人ぶんを縦に積んで（見出しは各行の左に出す）横幅に収める。 */
.score-table { overflow-x: visible; }
.score-table table { width: 100%; table-layout: fixed; font-size: 0.82rem; }
.score-table th { white-space: normal; }
.score-table th, .score-table td { padding: 0.45rem 0.4rem; overflow-wrap: anywhere; }
.score-table th:not(:first-child) { width: 5.5rem; }
.score-table th:last-child { width: 6rem; }
.score-table .btn.small { margin: 0; }
.goal-chips { display: flex; flex-wrap: wrap; gap: 0.2rem; justify-content: flex-end; margin-top: 0.3rem; }
.goal-chips .badge { font-size: 0.68rem; }
@media (max-width: 720px) {
  .score-table table, .score-table tbody, .score-table tr, .score-table td { display: block; width: auto; }
  .score-table thead { display: none; }
  .score-table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.4rem 0.55rem;
    margin-bottom: 0.5rem;
  }
  .score-table td { border: 0; padding: 0.2rem 0; display: flex; gap: 0.6rem; align-items: baseline; }
  .score-table td.num { text-align: left; }
  .score-table td::before {
    content: attr(data-label);
    flex: none;
    width: 6rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--teal);
  }
  /* 氏名は折り返さず、説明・バー・項目の点数は次の行いっぱいに出す */
  .score-table td { flex-wrap: wrap; }
  .score-table td .btn { white-space: nowrap; }
  .score-table td > p.hint { flex: 1 1 100%; margin: 0.15rem 0 0; }
  .score-table td .meter,
  .score-table td .goal-chips { flex: 1 1 100%; }
  .score-table .goal-chips { justify-content: flex-start; }
  .score-table td .score-cell-main { justify-content: flex-start; }
}
tr.below-line td { background: var(--teal-tint-2); }
.score-cell-main { display: flex; align-items: baseline; gap: 0.15rem; justify-content: flex-end; }
.score-cell-main strong { font-size: 1.15rem; color: var(--teal); }
.score-cell-main small { font-size: 0.7rem; color: var(--muted); }
td .meter { margin-top: 0.25rem; }

/* ── 前回立てた目標（週次・月次の先頭） ── */


.card.prev-goal {
  border-left: 4px solid var(--teal);
  background: var(--teal-tint-2);
}
.prev-list { display: grid; gap: 0.7rem; }
.prev-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}
.prev-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

/* ── 報告フォーム：見出しごとのまとまり ── */
.field-group + .field-group { margin-top: 1.2rem; }
.field-group-title {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: var(--teal);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.field-group-title::after { content: ""; flex: 1; height: 1px; background: var(--teal-tint); }

/* 数字報告は詰めて並べる（携帯2列・広い画面3列） */
.num-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 0.75rem; }
@media (min-width: 720px) { .num-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* 見出し（と説明）を上、入力欄を下端に揃える。見出しが2行になる項目があっても横の欄と段がずれない */
.num-grid .field-row { margin: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 0.3rem; }
.num-grid .field-row label { font-size: 0.8rem; line-height: 1.35; margin: 0; }
.num-grid .field-row .hint { font-size: 0.72rem; margin-top: 0.1rem; line-height: 1.35; }
.num-grid .field-row input, .num-grid .field-row select { margin-top: auto; }
.field-label { min-width: 0; }
.field-stack .field-row + .field-row { margin-top: 0.9rem; }
select.num-select { text-align: center; font-variant-numeric: tabular-nums; }

/* チェック項目は行ごと押せる大きさにする */
.field-stack .check-field + .check-field { margin-top: 0.45rem; }
.check-field {
  background: var(--teal-tint-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}
.check-field .check-row { align-items: flex-start; }
.check-field .check-row label { margin: 0; font-size: 0.9rem; line-height: 1.5; flex: 1; cursor: pointer; }
.check-field .check-row input[type="checkbox"] { margin-top: 0.2rem; width: 1.25rem; height: 1.25rem; flex: none; }
.check-field .hint { margin: 0.15rem 0 0 1.75rem; }
.check-field .check-row .rule-open { margin-left: auto; flex: none; align-self: flex-start; }

/* チェック項目から開く基準（基本姿勢のルール・身だしなみ） */
.rule-panel {
  margin: 0.5rem 0 0.2rem 1.75rem;
  padding: 0.6rem 0 0.2rem 0.75rem;
  border-left: 3px solid var(--teal);
  max-height: 22rem;
  overflow-y: auto;
}
.rule-panel[hidden] { display: none; }
.rule-panel-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  padding-bottom: 0.35rem;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
  color: var(--teal-dark);
}
.rule-close {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--teal-dark);
  border-radius: 6px;
  width: 1.8rem;
  height: 1.8rem;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.rule-close:hover { background: var(--teal-tint); }
.rule-panel .point-group + .point-group { margin-top: 0.8rem; }
.rule-panel .hint { margin: 0 0 0.4rem; }

/* 写真 */
.photo-input { display: none; }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.photo-thumbs:empty { display: none; }
.photo-thumb {
  position: relative;
  width: 6rem;
  height: 6rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--teal-tint-2);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-remove {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  border: 0;
  background: var(--teal-dark);
  color: var(--white);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.photo-remove:focus-visible { outline: 2px solid var(--white); outline-offset: -4px; }

/* ── ルール・基準 ── */
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.rule-item {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.15rem 0.65rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}
.rule-no {
  grid-row: span 2;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--teal);
  color: var(--white);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.rule-title { font-weight: 700; line-height: 1.45; align-self: center; }
.rule-detail { font-size: 0.85rem; color: var(--ink-soft); white-space: pre-wrap; line-height: 1.65; }

.point-group + .point-group { margin-top: 1.1rem; }
.point-group h3 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  color: var(--teal);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  border-bottom: 1px solid var(--teal-tint);
  padding-bottom: 0.2rem;
}
.point-group h3 .count { font-size: 0.72rem; color: var(--ink-soft); font-weight: 400; }
.point-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.point-list li { white-space: pre-wrap; font-size: 0.88rem; line-height: 1.65; }

.eval-card { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.75rem; background: var(--white); }
.eval-card + .eval-card { margin-top: 0.5rem; }
.eval-card.not-mine { background: var(--teal-tint-2); }
.eval-card.not-mine .eval-name { color: var(--ink-soft); }
.eval-card .eval-name { font-weight: 700; line-height: 1.45; }
.eval-card .pill-row { margin-top: 0.35rem; }
.eval-card .note { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.35rem; white-space: pre-wrap; }

/* ── 動的フォーム ── */
.field-row { margin-bottom: 0.9rem; }
.field-row:last-child { margin-bottom: 0; }
.field-row .unit { font-size: 0.8rem; color: var(--ink-soft); margin-left: 0.35rem; }
.inline-num { display: flex; align-items: center; }
.inline-num input { max-width: 10rem; }

.editor { border: 1px solid var(--teal); border-radius: var(--radius); padding: 1rem; background: var(--teal-tint-2); }
/* 一覧と同じカードに置くので、表との間を空ける */
.editor + .table-wrap, .editor + div { margin-top: 1rem; }
.editor h3 { margin: 0 0 0.8rem; font-size: 0.92rem; color: var(--teal); }
.editor[hidden] { display: none; }

.rowlink { color: var(--teal); text-decoration: underline; cursor: pointer; background: none; border: 0; font: inherit; padding: 0; }

.pill-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.disabled-row td { opacity: 0.5; }
/* 一括入力で、その項目が適用されない職員の行 */
.item.disabled-row { opacity: 0.6; background: var(--teal-tint-2); }
.item.disabled-row .name { font-weight: 400; }

/* ── 採点表：行＝評価項目／列＝その日の対象者 ──
   紙の採点表と同じ形。項目の列と見出しの行は貼り付けたまま、横にスクロールする。 */
.score-grid-scroll {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.score-grid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.score-grid th,
.score-grid td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0.35rem 0.45rem;
  background: #fff;
  vertical-align: middle;
}
.score-grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--teal-tint);
  font-size: 0.78rem;
  text-align: center;
  white-space: nowrap;
}
.score-grid .item-col {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 15rem;
  min-width: 15rem;
  /* 項目名が長くても列を広げない。広がると人の列が画面から押し出される */
  max-width: 15rem;
  text-align: left;
  background: var(--teal-tint-2);
}
.score-grid .item-name { overflow-wrap: anywhere; }
.score-grid thead .item-col { z-index: 4; }
.score-grid .item-line { display: flex; align-items: baseline; gap: 0.35rem; }
.score-grid .item-id {
  font-weight: 700;
  color: var(--teal);
  font-size: 0.75rem;
  flex: none;
}
.score-grid .item-name { font-size: 0.84rem; font-weight: 700; }
.score-grid .item-sub {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}
.score-grid .item-sub .hint { margin: 0; font-size: 0.72rem; }
.score-grid .item-actions { display: flex; gap: 0.3rem; margin-top: 0.25rem; flex-wrap: wrap; }
.score-grid .item-actions .btn { margin: 0; padding: 0.15rem 0.45rem; font-size: 0.72rem; }
.score-grid .staff-col { min-width: 5.2rem; max-width: 9rem; }
.score-grid .staff-name { display: block; font-weight: 700; font-size: 0.8rem; }
.score-grid .staff-state { display: block; font-size: 0.68rem; color: var(--muted); }
.score-grid .staff-state.done { color: var(--teal); }
.score-grid .staff-state.off { color: var(--muted); font-weight: 700; }
.score-grid .kind-row th {
  position: sticky;
  left: 0;
  text-align: left;
  background: var(--teal);
  color: #fff;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}
.score-grid .team-row .item-col { background: var(--teal-tint); }
.score-grid .score-cell { text-align: center; }
.score-grid .score-cell.off { background: var(--teal-tint-2); }
.score-grid .score-cell .dash { color: var(--muted); }
.score-grid .score-cell input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--teal);
}
.score-grid .score-cell input[type="number"] { width: 4.2rem; padding: 0.2rem 0.3rem; text-align: right; }
.score-grid .score-cell select {
  /* 選択肢の文字が長いので、列が広がらないよう幅を決め打ちする（中身は開けば全部読める） */
  width: 8.5rem;
  max-width: 8.5rem;
  padding: 0.2rem 0.3rem;
  font-size: 0.72rem;
}
/* 1件ごとの証跡・理由を開くボタン。入れた欄にだけ出て、入っていれば濃くなる */
.score-grid .cell-note {
  display: inline-block;
  margin-left: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.15rem 0.25rem;
  cursor: pointer;
}
.score-grid .cell-note.has { border-color: var(--teal); background: var(--teal-tint); color: var(--teal); font-weight: 700; }
.score-grid .cell-note[hidden] { display: none; }

/* ── タブレットで採点するとき ──
   項目の列を詰めて人の列を多く見せ、指で押せる大きさにする。
   iPad の縦（768）と横（1024）の両方がここに入る。 */
@media (max-width: 1024px) {
  .score-grid-scroll { max-height: 78vh; }
  /* 列の幅を指定どおりに使う。既定の width:max-content のままだと、
     氏名や選択肢の長さで列が広がり、1画面に少人数しか入らない */
  .score-grid { table-layout: fixed; width: min-content; min-width: 100%; }
  .score-grid .item-col { width: 10.5rem; min-width: 10.5rem; max-width: 10.5rem; }
  .score-grid .item-name { font-size: 0.8rem; }
  /* 「チーム」「都度」などの注記は項目一覧で読めるので、ここでは出さない（点数の印は残す） */
  .score-grid .item-sub .hint { display: none; }
  .score-grid th,
  .score-grid td { padding: 0.5rem 0.4rem; }
  /* 人の列は幅を決め打ちし、入力欄は列いっぱいに広げる。
     証跡の「✎」は右に置かず下に回して、1人分の幅を抑える */
  .score-grid .staff-col { width: 5.8rem; min-width: 5.8rem; max-width: 5.8rem; }
  /* 氏名は折り返してよい。1行のままだと名前の長さで列が広がってしまう */
  .score-grid thead th.staff-col { white-space: normal; }
  .score-grid .score-cell { white-space: normal; }
  .score-grid .score-cell input[type="checkbox"] { width: 1.6rem; height: 1.6rem; }
  .score-grid .score-cell input[type="number"] { width: 100%; font-size: 0.95rem; padding: 0.35rem 0.3rem; }
  .score-grid .score-cell select { width: 100%; max-width: none; font-size: 0.72rem; padding: 0.35rem 0.2rem; }
  .score-grid .cell-note { display: block; margin: 0.25rem auto 0; padding: 0.3rem 0.4rem; font-size: 0.8rem; }
  .score-grid .item-actions .btn { padding: 0.3rem 0.5rem; font-size: 0.75rem; }
  /* 行ごとの備考は右端にあるので、タブレットでは幅を詰める */
  .score-grid-scroll .score-grid .memo-col { min-width: 8rem; }
}

.score-grid .score-cell .already {

  display: block;
  font-size: 0.66rem;
  color: var(--muted);
}
.score-grid .memo-col { min-width: 12rem; }
.score-grid .memo-col input { width: 100%; padding: 0.25rem 0.4rem; font-size: 0.78rem; }
.score-grid-wrap { margin-top: 0.2rem; }

/* ── 対象の絞り込みをチェックで選ぶ ── */
.pick-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pick {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.6rem 0.15rem 0.4rem;
  background: var(--white);
}
.pick.on { border-color: var(--teal); background: var(--teal-tint); }
.pick input[type="checkbox"] { width: 0.95rem; height: 0.95rem; accent-color: var(--teal); flex: none; }
.pick label { margin: 0; font-size: 0.78rem; font-weight: 400; white-space: nowrap; }
.pick.on label { font-weight: 700; color: var(--teal-dark); }
.pick-list + .hint, .pick-list .hint { flex-basis: 100%; margin-top: 0.15rem; }
.stat { display: grid; gap: 0.15rem; }
.stat .v { font-size: 1.3rem; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.stat .k { font-size: 0.78rem; color: var(--ink-soft); }
.pre { white-space: pre-wrap; font-size: 0.85rem; }

/* ── 評価点（個人集計・チームの貢献ポイント） ── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.6rem 0.9rem; align-items: flex-end; }
.filter-bar > div { flex: 1 1 11rem; min-width: 0; }
.filter-bar > .filter-actions { flex: 0 0 auto; }
.period-picker select { margin-bottom: 0.4rem; }
.period-picker select[hidden] { display: none; }
.month-range { display: flex; gap: 0.4rem; align-items: center; }
.month-range input { min-width: 0; flex: 1; }
.month-range[hidden] { display: none; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.6rem; }
.stat-row .stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  background: var(--teal-tint-2);
}

.score-hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.6rem; margin: 0.35rem 0 0.4rem; }
.score-hero .big { font-size: 2.6rem; line-height: 1; font-weight: 700; color: var(--teal); font-variant-numeric: tabular-nums; }
.score-hero .of { color: var(--ink-soft); font-size: 0.9rem; }

/* 0〜100点のバー。縦線が60点（達成ライン） */
.meter { position: relative; height: 0.5rem; background: var(--teal-tint); border-radius: 999px; margin: 0.35rem 0; }
.meter i { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.meter .line { position: absolute; top: -0.2rem; bottom: -0.2rem; width: 2px; background: var(--teal-dark); }

.result-list { display: grid; gap: 0.6rem; margin-top: 0.8rem; }
.result { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.75rem; background: var(--white); }
.result.is-nodata { background: var(--teal-tint-2); border-style: dashed; }
.result .r-top { display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; align-items: baseline; }
.result .r-name { font-weight: 700; flex: 1 1 10rem; min-width: 0; }
.result .r-score { font-weight: 700; font-size: 1.15rem; color: var(--teal); font-variant-numeric: tabular-nums; margin-left: auto; }
.result .r-detail { font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.2rem; line-height: 1.5; }
.result .r-detail strong { color: var(--ink); }

td.score-cell { min-width: 8rem; }
.score-line { display: flex; gap: 0.35rem; align-items: baseline; white-space: nowrap; }
tr.is-alert td:first-child { box-shadow: inset 3px 0 0 var(--teal-dark); }
td.cell-zero { color: var(--line); }

/* 週次・月次の「日次の合計」（自動・入力不可） */
input.auto-value {
  background: var(--teal-tint-2);
  border-style: dashed;
  color: var(--teal-dark);
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  cursor: default;
}
input.auto-value:focus { box-shadow: none; border-color: var(--line); }
.auto-tag {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--teal);
  color: var(--white);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.5;
  vertical-align: 0.1em;
}
.auto-note { margin-top: 0.6rem; }

/* 報告先（報告ボタンのすぐ上に置く） */
.report-to-box {
  margin-top: 1.1rem;
  border: 2px solid var(--teal);
  border-radius: var(--radius);
  background: var(--teal-tint-2);
  padding: 0.7rem 0.8rem;
}
.report-to-box label { color: var(--teal-dark); }
.report-to-box .hint { margin-top: 0.35rem; }

/* 対象期間の前後送り */
.period-nav { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
/* display を持つ要素でも hidden を効かせる（採点表の「その日／月まとめ」の切り替えで使う） */
.period-nav[hidden] { display: none; }
.period-nav input { flex: 1 1 8.5rem; min-width: 0; }
.period-nav button { white-space: nowrap; }

/* 組織図（上長のつながり）。行ごとにぶら下げて、絞り込みに当てはまらない人は薄く出す */
.org-tree { border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem; overflow-x: auto; }
.org-node { border-left: 2px solid var(--teal-tint); padding-left: 0.5rem; margin-top: 0.25rem; }
.org-node.dim { opacity: 0.35; }
.org-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; padding: 0.15rem 0; }
.org-row .org-name { font-weight: 700; }
.org-row .hint { margin: 0; }

/* 設定タブ（ホームのカード・検索・パンくず） */
.settings-head { padding: 0.9rem 1.25rem 0; }
.settings-head select { max-width: 22rem; }
.settings-head .hint { margin: 0.35rem 0 0; }
.settings-search {
  width: 100%;
  max-width: 34rem;
  font-size: 0.95rem;
  padding: 0.55rem 0.8rem;
}

.settings-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.9rem 1.25rem 0.2rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.settings-crumb .sep { color: var(--line); }
.settings-crumb .crumb-link {
  font: inherit;
  color: var(--teal);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.settings-group {
  margin: 1.2rem 1.25rem 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.settings-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.7rem;
  padding: 0 1.25rem;
}
.settings-card {
  display: block;
  text-align: left;
  font: inherit;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
}
.settings-card:hover { background: var(--teal-tint-2); }
.settings-card .sc-head { display: flex; align-items: center; gap: 0.35rem; }
.settings-card .sc-name { font-weight: 700; }
.settings-card .sc-lock { font-size: 0.8rem; }
.settings-card .sc-desc {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.settings-card .sc-count {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal);
  min-height: 1rem;
}

/* ── 報告タブの1段目（日次・週次・月次） ──
   2段目と同じ丸いボタンだと上下の関係が分からないので、
   1段目は下線のタブ（大きめ・下に線）にして「どの報告を見ているか」を見出しのように出す。 */
.subtabs.kinds {
  gap: 0.2rem;
  border-bottom: 2px solid var(--teal-tint);
  margin-bottom: 0.75rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.subtabs.kinds::-webkit-scrollbar { display: none; }
.subtabs.kinds button {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem 0.45rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
}
.subtabs.kinds button[aria-selected="true"] {
  background: transparent;
  color: var(--teal);
  border-bottom-color: var(--teal);
}

/* ── 報告タブの2段目（自分の報告／部下の確認） ──
   1段目が下線のタブなので、2段目はひと続きの「切り替えスイッチ」にする。
   左に「表示」と出して、何を切り替えているのかを分かるようにする。 */
.subtabs.sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.subtabs.sub .sub-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
.subtabs.sub .switch {
  display: inline-flex;
  gap: 0.15rem;
  padding: 0.15rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--teal-tint-2);
}
.subtabs.sub .switch button {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.25rem 0.85rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
}
.subtabs.sub .switch button[aria-selected="true"] {
  background: var(--white);
  color: var(--teal);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(18, 124, 111, 0.25);
}

/* 出し分けの表を、見出し（チェック項目・業務・数字報告…）で区切る */
tr.matrix-group td {
  background: var(--teal-tint-2);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--teal);
}

/* 設定の「この画面で決まること」（①〜⑤の手順） */
.howto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.6rem;
}
.howto-step {
  display: flex;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: var(--teal-tint-2);
}
.howto-step .n {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--teal);
  color: var(--white);
  font-weight: 700;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
}
.howto-step .t { font-weight: 700; font-size: 0.85rem; line-height: 1.4; }
.howto-step .hint { margin-top: 0.15rem; }

/* ── 報告画面（スタッフが毎日使うところ） ── */

/* 「今日の日次：未提出」の1行。入力より先に状態が分かるように */
.state-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 0 0.9rem;
  font-size: 0.85rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: var(--teal-tint-2);
  border-left: 4px solid var(--line);
}
.state-line.todo { border-left-color: var(--teal-dark); }
.state-line.done { border-left-color: var(--teal); }

/* 下に貼り付く「報告する」。最後までスクロールしなくても押せる */
.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem -0.9rem -0.85rem;
  padding: 0.7rem 0.9rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  background: var(--white);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 8px rgba(18, 124, 111, 0.08);
}
.save-bar .warn { font-size: 0.78rem; font-weight: 700; color: var(--teal-dark); }
@media (min-width: 720px) {
  .save-bar { margin: 1rem -1.25rem -1.1rem; padding: 0.7rem 1.25rem; }
}

/* タブの未提出マーク */
.nav-tabs button .tab-dot { font-size: 0.6rem; margin-left: 0.2rem; vertical-align: 0.25em; }

/* 評価項目バーを畳んでいるときだけ出す件数 */
.goalbar-head .src.folded { display: none; }
.goalbar.is-collapsed .goalbar-head .src.folded { display: inline; }
.goalbar.is-collapsed .goalbar-head .src:not(.folded) { display: none; }
