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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f5f5f5;
  padding: 20px;
  line-height: 1.6;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1 {
  margin-bottom: 24px;
  font-size: 24px;
  color: #333;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 2px solid #4a90d9;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #555;
  font-size: 14px;
}

.required {
  color: #e74c3c;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background-color: white;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #4a90d9;
}

textarea {
  resize: vertical;
}

select {
  cursor: pointer;
}

.divider {
  height: 1px;
  background-color: #e0e0e0;
  margin: 24px 0;
}

.info-text {
  font-size: 13px;
  color: #666;
  margin-bottom: 20px;
  padding: 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
}

button[type="submit"] {
  padding: 9px 18px;
  background-color: #4a90d9;
  color: white;
  border: 1px solid #4a90d9;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s;
}

button[type="submit"]:hover {
  background-color: #357abd;
  border-color: #357abd;
}

button[type="submit"]:active {
  background-color: #2a6299;
}

/* ---- 汎用操作ボタン（タブ/カード/バッジ以外） ----
   class を持たない操作ボタン（id/data-* のみ）に統一した二次ボタン外観を与える。
   .nav-btn / .subtab / .task-card / .status-badge は class 付きなので対象外。 */
.portal button:not([class]) {
  padding: 9px 16px;
  border: 1px solid #c7ced8;
  border-radius: 6px;
  background: #fff;
  color: #2d3a4a;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.portal button:not([class]):hover { background: #f3f6fb; border-color: #4a90d9; }
.portal button:not([class]):active { background: #e9eef6; }
.portal button:not([class]):disabled { opacity: .55; cursor: default; }

/* 主操作（保存・作成・提出など 1 画面の代表アクション） */
.portal button.btn-primary {
  padding: 9px 18px;
  border: 1px solid #4a90d9;
  border-radius: 6px;
  background: #4a90d9;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s;
}
.portal button.btn-primary:hover { background: #357abd; }
.portal button.btn-primary:active { background: #2a6299; }
.portal button.btn-primary:disabled { background: #9bbfe3; border-color: #9bbfe3; cursor: default; }

/* 破壊・注意操作（差し戻し・削除確定など） */
.portal button.btn-danger {
  padding: 9px 16px;
  border: 1px solid #e0b4b4;
  border-radius: 6px;
  background: #fff;
  color: #b02a37;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.portal button.btn-danger:hover { background: #fdf2f2; border-color: #c0392b; }

/* ツールバー: 操作ボタンを横並び・等間隔・折返し可で整列する */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.action-bar.tight { margin-top: 10px; }
.action-bar .spacer { flex: 1 1 auto; }
/* ツールバー内のフォーム要素は内容幅（全幅 select/input でボタン列を割らない） */
.action-bar select,
.action-bar input { width: auto; }
.action-bar label { margin-bottom: 0; }

/* 表の中の操作ボタンはコンパクトに保つ（行高を膨らませない） */
.portal .review-table button:not([class]),
.portal .review-table button.btn-primary,
.portal .review-table button.btn-danger { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; text-align: center; }

.state-banner {
  margin-bottom: 20px;
  padding: 12px;
  background-color: #fff3cd;
  border: 1px solid #ffe69c;
  border-radius: 4px;
  color: #664d03;
  font-weight: 600;
}

.portal-load-status {
  margin: 12px 0 20px;
  white-space: pre-wrap;
}
.portal-load-status-loading {
  background-color: #eaf2ff;
  border-color: #b7d3ff;
  color: #174a7c;
}
.portal-load-status-error {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #7f1d1d;
}

/* AI レビュー結果の整形表示（markdown → HTML）。state-banner 内で表・見出しを読みやすくする */
#goalReviewResult, #selfReviewResult { font-weight: normal; line-height: 1.5; }
.rv-head { font-weight: 700; margin-bottom: 8px; }
.rv-h { font-weight: 700; margin: 10px 0 4px; }
.rv-sp { height: 8px; }
.rv-list { margin: 4px 0 0 1.3em; }
.rv-tbl {
  border-collapse: collapse;
  margin: 6px 0;
  width: 100%;
  font-size: 0.92em;
  background-color: #fff;
}
.rv-tbl th, .rv-tbl td {
  border: 1px solid #d9c79a;
  padding: 5px 9px;
  text-align: left;
  vertical-align: top;
}
.rv-tbl th { background-color: #fbeec3; font-weight: 700; }

.goals-view {
  margin-bottom: 24px;
  padding: 14px;
  background-color: #f0f6ff;
  border: 1px solid #cfe2ff;
  border-radius: 6px;
}

.goals-view-item h3 {
  margin: 8px 0 4px;
  font-size: 15px;
}

.goals-view-item p {
  margin: 0 0 8px;
  white-space: pre-wrap;
  color: #333;
}

/* 区切りの無い長文（URL や繰り返し文字列）が画面からはみ出さないよう折り返す（2026-06-23） */
.portal .info-text,
.portal .goals-view-item p,
.portal .result-block,
.portal .review-table td,
.portal .goals-view-item {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.review-table th, .review-table td {
  border: 1px solid #dee2e6;
  padding: 8px 10px;
  text-align: left;
  font-size: 14px;
}

.review-table th {
  background-color: #f0f6ff;
}

.review-table button {
  margin-right: 6px;
  padding: 4px 10px;
}

.low-badge {
  color: #b02a37;
  font-weight: 600;
}

.self-ref {
  color: #555;
  background: #fafafa;
  padding: 6px;
  border-radius: 4px;
}

/* ---- ポータル共通（portal.js / doc/04 §3） ---- */

.portal .container {
  max-width: 100%;   /* ポータルはウィンドウ幅いっぱいに（表が多く横に広いため。2026-06-22） */
  padding: 16px;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid #4a90d9;
}

.portal-header h1 {
  margin: 0;
  padding: 0;
  border: none;
  text-align: left;
  font-size: 20px;
}

.header-meta {
  font-size: 12px;
  color: #666;
}

/* セグメント型タブ: 角丸トラックの中で選択中だけ塗りつぶす（メイン画面切替） */
.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 18px;
  padding: 4px;
  background: #eceff3;
  border: 1px solid #dde1e7;
  border-radius: 10px;
}

.nav-btn {
  flex: 0 0 auto;
  padding: 7px 16px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #5a6573;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s, color .15s, box-shadow .15s;
}

.nav-btn:hover {
  color: #2a6299;
  background: rgba(74, 144, 217, .10);
}

.nav-btn[aria-current="page"] {
  background: #4a90d9;
  color: #fff;
  box-shadow: 0 1px 3px rgba(42, 98, 153, .35);
}

/* セグメント型サブタブ（プロジェクト設定・ユーザー管理など .tabbar 内）。
   選択中は .active（JS が toggle）。aria-selected も将来用に許容 */
.tabbar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 16px;
  padding: 4px;
  background: #eceff3;
  border: 1px solid #dde1e7;
  border-radius: 10px;
}

.subtab {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #5a6573;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s, color .15s, box-shadow .15s;
}

.subtab:hover { color: #2a6299; background: rgba(74, 144, 217, .10); }

.subtab.active,
.subtab[aria-selected="true"] {
  background: #fff;
  color: #1f2d3d;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

/* 評価者一覧の区分見出し（評価記入する対象 / 目標確認する対象を同画面に並べる） */
.list-section-head {
  margin: 18px 0 6px;
  font-size: 1.05em;
  border-left: 4px solid #4a90d9;
  padding-left: 8px;
}

/* 担当外タブ（表示はするが操作不可。発見性のため隠さず無効化する） */
.subtab.disabled,
.subtab:disabled {
  color: #aab2bd;
  background: transparent;
  cursor: not-allowed;
  box-shadow: none;
}
.subtab.disabled:hover,
.subtab:disabled:hover { color: #aab2bd; background: transparent; }

[data-view][hidden] {
  display: none;
}

.task-card {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid #cfe2ff;
  border-radius: 6px;
  background: #f0f6ff;
  font-size: 14px;
  cursor: pointer;
}

.task-card:disabled {
  cursor: default;
  opacity: 0.7;
}

.task-card .status-badge {
  float: right;
}

.status-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  background: #e0e0e0;
  color: #555;
  font-size: 12px;
}

.status-done {
  background: #d1e7dd;
  color: #0f5132;
}

.status-rejected {
  background: #f8d7da;
  color: #842029;
}

.toast {
  margin: 14px 0;
  padding: 12px;
  background: #e8f5e9;
  border: 1px solid #badbcc;
  border-radius: 6px;
  font-weight: 600;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-bar select,
.filter-bar input {
  width: auto;
  padding: 6px 8px;
  font-size: 13px;
}

/* 社員名簿の絞り込み結果は操作後すぐ確認できるよう、人数を強調して表示する。 */
.portal.admin-ui2 .filter-bar > .users-count {
  padding: 4px 10px;
  border-radius: 999px;
  background: #e8f1fb;
  color: #1f3b5b;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.review-table th[data-sort] {
  cursor: pointer;
  text-decoration: underline dotted;
}

/* 社員名簿の各データ列は見出しのボタンで昇順・降順を切り替える。チェック欄は対象外。 */
.review-table th[data-users-sort] {
  padding: 0;
}
.portal .review-table .users-sort-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.portal .review-table .users-sort-button:hover {
  background: #e5effc;
}
.portal .review-table .users-sort-button:focus-visible {
  outline: 2px solid #4a90d9;
  outline-offset: -2px;
}
.users-sort-indicator {
  color: #5b6b7a;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.review-table input[type="number"],
.review-table select {
  width: 64px;
  padding: 4px;
}

.review-table textarea,
.review-table input[type="text"] {
  width: 100%;
  min-width: 120px;
  padding: 4px;
}

/* 横スクロール容器: 列が多い表（ユーザー管理 機密/公開タブ）が container をはみ出さないようにする */
.table-scroll {
  overflow-x: auto;
  width: 100%;
}

/* ユーザー管理のセレクトは選択肢の文字が切れないよう内容幅に広げる（部門・職種・等級・担当・ロール）。
   上限は**実在する最長の名前が入る値**にする（2026-08-27 実測: 組織を 10 部門 13 職種に分けた結果
   「管理本部・経営企画室・営業事務」= 229px / 「総務・経理・人事・経営企画」= 203px になり、
   200px では選んでいる部門名が読めなくなっていた。列自体は 248px あって余っていた）。
   足りなければ .table-scroll が横スクロールを出す＝文字を切るよりそちらに倒す。 */
.review-table select.user-input,
.review-table select.pub-input {
  width: auto;
  min-width: 88px;
  max-width: 260px;
}
/* 見える形のロール select にだけ広さを与える。機密タブのロールはチェックボックスへ移り、
   select は画面外の控えになったので、そこへ min-width を効かせるとチェックボックスの上に
   重なってクリックを奪う（2026-08-20 実機指摘の直因）。 */
.review-table select.user-input[data-field="roles"]:not(.role-select) {
  min-width: 130px;
}

.matrix-cell {
  text-align: center;
}

.matrix-heat-1 { background: #e3f2fd; }
.matrix-heat-2 { background: #90caf9; }
.matrix-heat-3 { background: #42a5f5; color: white; }

.view-note {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
}

/* ---- 入力検証（doc/06 §1 ヒューマンエラー防止: 機械チェックはフロントで完結） ---- */

input.field-error,
textarea.field-error,
select.field-error {
  border-color: #e74c3c;
  background-color: #fff6f6;
}

.error-msg {
  margin: 4px 0 0;
  color: #c0392b;
  font-size: 12px;
  font-weight: 600;
}

.share-hint {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 600;
}

.share-hint.share-ok { color: #0f5132; }
.share-hint.share-bad { color: #c0392b; }

/* ---- 貢献評価: 事業貢献 / 組織貢献 を一目で区別（色帯＋バッジ） ---- */
.contrib-row, .ev-row { padding-left: 12px; border-left: 5px solid #ccc; }
.contrib-row[data-section="business"], .ev-row[data-section="business"] {
  border-left-color: #4a90d9; background: #f3f8ff;
}
.contrib-row[data-section="organization"], .ev-row[data-section="organization"] {
  border-left-color: #2e9e6b; background: #f0faf4;
}
.contrib-badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 2px 10px; border-radius: 10px; margin-bottom: 8px; color: #fff;
}
.contrib-badge-business { background: #4a90d9; }
.contrib-badge-organization { background: #2e9e6b; }

/* ---- 評価結果サマリ（被評価者 result）: 最終評価点・ランクを一目で ---- */
.result-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin: 8px 0 22px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #f0f6ff, #ecf7f0);
  border: 1px solid #cfe2ff;
  border-radius: 10px;
}
.score-callout {
  text-align: center;
  padding-right: 20px;
  border-right: 1px solid #d4dde8;
}
.score-callout .score-num {
  font-size: 34px;
  font-weight: 800;
  color: #2a6299;
  line-height: 1.05;
}
.score-callout .score-label { font-size: 12px; color: #66707d; }
.rank-badge {
  display: inline-block;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  background: #4a90d9;
  padding: 4px 16px;
  border-radius: 8px;
  margin-top: 4px;
}
.score-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 0;
}
.score-breakdown div { min-width: 64px; }
.score-breakdown dt { font-size: 12px; color: #66707d; margin: 0; }
.score-breakdown dd { font-size: 17px; font-weight: 700; color: #2d3a4a; margin: 2px 0 0; }

/* 結果内の自由記述ブロックの可読性（コメント・来期目標） */
.result-block { margin: 0 0 8px; white-space: pre-wrap; }
.result-block .result-block-label {
  display: inline-block; font-weight: 700; color: #2a6299; margin-right: 6px;
}

/* ---- 非管理者ポータル UI2: 上部バー＋左ナビ＋カード型の画面 ---- */
.portal.ui2 {
  min-height: 100vh;
  padding: 0;
  background: #fff;
  color: #1b2530;
  font-size: 14px;
}

.portal.ui2 .container {
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
}

.portal.ui2 .ui2-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  margin: 0;
  padding: 10px 20px;
  border: 0;
  background: #4a86d8;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.portal.ui2 .ui2-topbar h1 {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  text-align: left;
}

.portal.ui2 .ui2-topbar .portal-role {
  color: #d8e6f8;
  font-weight: 500;
}

.portal.ui2 .ui2-topbar .ui2-context {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.portal.ui2 .ui2-period {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.portal.ui2 .ui2-phase-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.portal.ui2 .ui2-phase-pill {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  color: #e8f0fc;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.portal.ui2 .ui2-phase-pill.current {
  background: #fff;
  color: #2f5f9e;
}

.portal.ui2 .ui2-topbar .header-meta {
  flex: 0 0 auto;
  margin: 0;
  color: #e8f0fc;
  font-size: 11.5px;
  white-space: nowrap;
}

.portal.ui2 .ui2-phase-text {
  display: none;
}

.portal.ui2 .ui2-layout {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 58px);
}

.portal.ui2 .ui2-sidebar {
  display: flex;
  flex: 0 0 212px;
  flex-direction: column;
  gap: 8px;
  width: 212px;
  padding: 16px 10px;
  background: #f7f9fb;
  border-right: 1px solid #e7ebf0;
}

.portal.ui2 .ui2-sidebar-label {
  padding: 0 10px 5px;
  color: #8a95a3;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
}

.portal.ui2 .ui2-nav.portal-nav {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.portal.ui2 .ui2-nav .nav-btn {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #41505f;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: normal;
  box-shadow: none;
}

.portal.ui2 .ui2-nav .nav-btn:hover {
  background: #e9f1fa;
  color: #2f5f9e;
}

.portal.ui2 .ui2-nav .nav-btn[aria-current="page"] {
  background: #dcebfa;
  color: #1e5cb8;
  box-shadow: none;
}

.portal.ui2 .ui2-main {
  flex: 1;
  min-width: 0;
  padding: 24px 28px 60px;
  background: #fff;
}

.portal.ui2 .ui2-main > .portal-load-status,
.admin-ui2 .state-banner.portal-load-status {
  margin: 0 0 16px;
}

.portal.ui2 .ui2-main [data-view][hidden] {
  display: none;
}

.portal.ui2 .ui2-main section[data-view]:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.portal.ui2 .ui2-main section[data-view] > h2 {
  margin: 0;
  color: #1b2530;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.portal.ui2 .ui2-main section[data-view] > h3,
.portal.ui2 .ui2-main section[data-view] h3.list-section-head {
  margin: 4px 0 0;
  color: #41505f;
  font-size: 14px;
  font-weight: 800;
}

.portal.ui2 .ui2-main section[data-view] > h4 {
  margin: 10px 0 0;
  color: #5f6b7a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.portal.ui2 .ui2-main .info-text {
  margin: 0;
  padding: 10px 13px;
  border: 1px solid #e2e6ec;
  border-left: 3px solid #2f6fbf;
  border-radius: 7px;
  background: #f7f9fb;
  color: #5f6b7a;
  font-size: 12.5px;
}

.portal.ui2 .ui2-main .state-banner {
  margin: 0;
  border-radius: 8px;
}

/* UI2の状態表示: 進行段階による表示差分とデータ取得中を、本文のカードと同じ密度で見せる。 */
.portal.ui2 .ui2-phase-context {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid #d9e5f5;
  border-left: 3px solid #2f6fbf;
  border-radius: 8px;
  background: #f5f9ff;
  color: #41505f;
  font-size: 12.5px;
  font-weight: 700;
}

.portal.ui2 .ui2-phase-context::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #2f6fbf;
  content: '';
}

/* ---- 読み込み中の帯の正本 ----
   非管理者（`.portal.ui2`）と管理者（`.admin-ui2`）で同じ見た目にする。以前は管理者側にだけ
   別の写しがあり、片方を直しても管理者に届かなかった。**ここ 1 箇所**で両方を決める。
   管理者の帯は `state-banner` も同時に持ち、`.admin-ui2 .state-banner`（admin-ui.css の後方）と
   同じ強さでは負けるので、`.state-banner` と組にして 1 段強くしてある。 */
.portal.ui2 .ui2-main .portal-load-status-loading,
.admin-ui2 .state-banner.portal-load-status-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid #d9e5f5;
  border-left: 3px solid #2f6fbf;
  border-radius: 8px;
  background: #f5f9ff;
  color: #2f5f9e;
  font-weight: 700;
}

.portal.ui2 .ui2-main .portal-load-status-loading::before,
.admin-ui2 .state-banner.portal-load-status-loading::before {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid #c8dcf6;
  border-top-color: #2f6fbf;
  border-radius: 50%;
  animation: ui2-loading-spin .8s linear infinite;
  content: '';
}

/* 失敗の帯は管理者だけここで整える。非管理者は前からの見た目（上の .portal-load-status-error）を
   そのまま使う。今回の依頼は管理者ポータルなので、他のポータルの見た目は動かさない。 */
.admin-ui2 .state-banner.portal-load-status-error {
  padding: 11px 14px;
  border: 1px solid #fecaca;
  border-left: 3px solid #dc2626;
  border-radius: 8px;
  background: #fef2f2;
  color: #7f1d1d;
  font-weight: 700;
}

@keyframes ui2-loading-spin {
  to { transform: rotate(360deg); }
}

.portal.ui2 .ui2-busy-box {
  border: 1px solid #d9e5f5;
  border-top: 4px solid #2f6fbf;
  border-radius: 10px;
  color: #1b2530;
}

.portal.ui2 .ui2-progress-box {
  border-top-color: #4a86d8;
}

.portal.ui2 .ui2-loading-bar {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f6fbf, #9ec5f2, #2f6fbf);
  background-size: 200% 100%;
  animation: ui2-loading-bar 1.2s linear infinite;
}

@keyframes ui2-loading-bar {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.portal.ui2 .ui2-main .task-card {
  display: flex;
  align-items: center;
  min-height: 58px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #e2e6ec;
  border-radius: 8px;
  background: #fff;
  color: #1b2530;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: none;
}

.portal.ui2 .ui2-main .task-card:hover {
  border-color: #2f6fbf;
  background: #f5f9ff;
}

.portal.ui2 .ui2-main .action-bar {
  gap: 8px;
  margin-top: 0;
}

.portal.ui2 .ui2-main button:not([class]),
.portal.ui2 .ui2-main button.btn-primary,
.portal.ui2 .ui2-main button.btn-danger {
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.portal.ui2 .ui2-main button.btn-primary {
  border-color: #2f6fbf;
  background: #2f6fbf;
}

.portal.ui2 .ui2-main button.btn-primary:hover {
  border-color: #255a9c;
  background: #255a9c;
}

.portal.ui2 .ui2-main button.btn-danger {
  border-color: #e0b4b4;
  background: #fff;
  color: #b02a37;
}

.portal.ui2 .ui2-main .review-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 13.5px;
}

.portal.ui2 .ui2-main .review-table th {
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid #dde3ea;
  background: transparent;
  color: #5f6b7a;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
}

.portal.ui2 .ui2-main .review-table td {
  padding: 10px;
  border: 0;
  border-bottom: 1px solid #eef1f5;
  background: #fff;
  color: #1b2530;
  vertical-align: top;
}

.portal.ui2 .ui2-main .review-table tr:hover td {
  background: #f7fafd;
}

.portal.ui2 .ui2-main .goals-view,
.portal.ui2 .ui2-main .goals-view-item {
  border: 1px solid #e2e6ec;
  border-radius: 9px;
  background: #fff;
}

.portal.ui2 .ui2-main .goals-view {
  padding: 14px 16px;
}

.portal.ui2 .ui2-main .goals-view-item {
  margin-bottom: 10px;
  padding: 12px 14px;
}

.portal.ui2 .ui2-main .form-group {
  margin-bottom: 14px;
}

.portal.ui2 .ui2-main input[type="text"],
.portal.ui2 .ui2-main input[type="number"],
.portal.ui2 .ui2-main textarea,
.portal.ui2 .ui2-main select {
  padding: 8px 10px;
  border-color: #d5dbe3;
  border-radius: 7px;
  font-size: 13px;
}

.portal.ui2 .ui2-main input:focus,
.portal.ui2 .ui2-main textarea:focus,
.portal.ui2 .ui2-main select:focus {
  border-color: #2f6fbf;
  box-shadow: 0 0 0 3px rgba(47,111,191,.15);
}

.portal.ui2 .ui2-main .divider {
  height: 1px;
  margin: 2px 0;
  background: #e7ebf0;
}

.portal.ui2 .ui2-main .toast {
  border: 1px solid #b7e6cd;
  border-radius: 8px;
  background: #eafaf2;
  color: #14633c;
}

.portal.ui2 .ui2-main .contrib-row,
.portal.ui2 .ui2-main .ev-row {
  border-radius: 8px;
}

.portal.ui2 .ui2-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e2e6ec;
  border-radius: 10px;
  background: #e2e6ec;
}

.portal.ui2 .ui2-kpi-cell {
  min-height: 88px;
  padding: 14px 16px;
  background: #fff;
}

.portal.ui2 .ui2-kpi-label {
  margin-bottom: 4px;
  color: #5f6b7a;
  font-size: 11.5px;
}

.portal.ui2 .ui2-kpi-value {
  color: #1b2530;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.portal.ui2 .ui2-home-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal.ui2 .ui2-main .result-summary,
.portal.ui2 .ui2-main .committee-card {
  border-radius: 10px;
}

@media (max-width: 900px) {
  .portal.ui2 .ui2-topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .portal.ui2 .ui2-context {
    order: 3;
    flex-basis: 100%;
    flex-wrap: wrap;
  }
  .portal.ui2 .ui2-layout {
    flex-direction: column;
  }
  .portal.ui2 .ui2-sidebar {
    flex: none;
    width: 100%;
    padding: 9px 10px;
    border-right: 0;
    border-bottom: 1px solid #e7ebf0;
  }
  .portal.ui2 .ui2-sidebar-label {
    display: none;
  }
  .portal.ui2 .ui2-nav.portal-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .portal.ui2 .ui2-nav .nav-btn {
    width: auto;
  }
  .portal.ui2 .ui2-main {
    padding: 18px 16px 44px;
  }
}

@media (max-width: 600px) {
  .portal.ui2 .ui2-phase-pills {
    width: 100%;
    overflow-x: auto;
  }
  .portal.ui2 .ui2-kpi-grid {
    grid-template-columns: 1fr;
  }
  .portal.ui2 .ui2-topbar .header-meta {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ---- UI2 参照画面との最終整合（非管理者ポータル専用） ----
   既存の ID・クラス・イベント契約は残したまま、UI改修の配色・余白・部品寸法を
   実ポータルへ適用する。管理者ポータルは body.admin-ui2 のため影響しない。 */
.portal.ui2 {
  min-height: 100vh;
  padding: 0;
  background: #fff;
  color: #1b2530;
  line-height: 1.55;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", Meiryo, sans-serif;
}

.portal.ui2 .container.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
}

.portal.ui2 .ui2-topbar {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 0;
  margin: 0;
  padding: 11px 20px;
  border: 0;
  background: #4a86d8;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.portal.ui2 .ui2-topbar h1,
.portal.ui2 .ui2-topbar h1.brand {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-align: left;
}

.portal.ui2 .ui2-topbar .portal-role,
.portal.ui2 .ui2-topbar .role {
  color: #d8e6f8;
  font-weight: 500;
}

.portal.ui2 .ui2-sep {
  width: 1px;
  height: 16px;
  flex: 0 0 1px;
  background: rgba(255,255,255,.25);
}

.portal.ui2 .ui2-context {
  display: contents;
}

.portal.ui2 .ui2-period {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.portal.ui2 .ui2-phase-pills {
  display: flex;
  align-items: center;
  gap: 5px;
}

.portal.ui2 .ui2-phase-pill,
.portal.ui2 .ui2-phase-pills .phase-pill {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.2);
  color: #e8f0fc;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.portal.ui2 .ui2-phase-pill.current,
.portal.ui2 .ui2-phase-pills .phase-pill.current {
  background: #fff;
  color: #2f5f9e;
}

.portal.ui2 .ui2-topbar .header-meta {
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  color: #e8f0fc;
  font-size: 11.5px;
  white-space: nowrap;
}

.portal.ui2 .ui2-phase-text { display: none; }

.portal.ui2 .ui2-layout {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.portal.ui2 .ui2-sidebar {
  display: flex;
  flex: 0 0 212px;
  flex-direction: column;
  gap: 18px;
  width: 212px;
  min-height: calc(100vh - 45px);
  padding: 16px 10px;
  background: #f7f9fb;
  border-right: 1px solid #e7ebf0;
}

.portal.ui2 .ui2-sidebar-label {
  padding: 0 10px 5px;
  color: #8a95a3;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
}

.portal.ui2 .ui2-nav.portal-nav {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  /* 縦並びにしたら wrap を戻す。基底の `.portal-nav` は横並びタブ用に wrap を持つので、
     残したままだと入り切らない分が横へ折り返して枠外に出る（解決方針 #10）。
     横並びに戻す狭幅時の指定（下の media query）では wrap をあらためて有効にしている。 */
  flex-wrap: nowrap;
}

.portal.ui2 .ui2-nav .nav-btn,
.portal.ui2 .ui2-nav .side-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #41505f;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  box-shadow: none;
}

.portal.ui2 .ui2-nav .nav-btn:hover,
.portal.ui2 .ui2-nav .side-btn:hover {
  background: #e9f1fa;
  color: #2f5f9e;
}

.portal.ui2 .ui2-nav .nav-btn[aria-current="page"],
.portal.ui2 .ui2-nav .side-btn.active {
  background: #dcebfa;
  color: #1e5cb8;
  box-shadow: none;
}

.portal.ui2 .ui2-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 22px 26px 60px;
  background: #fff;
}

.portal.ui2 .ui2-main section[data-view]:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.portal.ui2 .ui2-main section[data-view] > h2 {
  margin: 0;
  color: #1b2530;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.01em;
}

.portal.ui2 .ui2-main section[data-view] > h2 + .ui2-subtitle {
  margin-top: -13px;
}

.portal.ui2 .ui2-subtitle {
  margin: 0;
  color: #5f6b7a;
  font-size: 12.5px;
}

.portal.ui2 .ui2-main .panel,
.portal.ui2 .ui2-main .ui2-panel {
  border: 1px solid #e2e6ec;
  border-radius: 10px;
  padding: 15px 17px;
  background: #fff;
}

/* 2026-08-19 UI フィードバック（Slack）: 項目名が小さくて読みづらいという指摘。
   例に挙がったのは被評価者の「事業貢献の目標」「組織貢献の目標」。管理者側
   （admin-ui.css の .admin-ui2 .panel-title）と同じ値に揃える。 */
.portal.ui2 .ui2-main .panel-title {
  margin-bottom: 12px;
  color: #3d4756;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
}

/* 基本情報（2026-08-19 UI フィードバック: 「項目/値」の 2 列表をやめた）。
   氏名を主役にし、部門・職種は添え字。属性はラベル小・値大のカードで横に並べる。 */
.portal.ui2 .emp-id-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.portal.ui2 .emp-id-name {
  font-size: 20px;
  font-weight: 800;
  color: #26313f;
  letter-spacing: .01em;
}

.portal.ui2 .emp-id-sub {
  font-size: 13px;
  color: #7a8697;
}

.portal.ui2 .emp-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.portal.ui2 .emp-fact {
  padding: 10px 12px;
  border: 1px solid #e6ebf2;
  border-radius: 10px;
  background: #f7f9fc;
}

.portal.ui2 .emp-fact-label {
  display: block;
  margin-bottom: 4px;
  color: #8a95a3;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
}

.portal.ui2 .emp-fact-value {
  display: block;
  color: #26313f;
  font-size: 15px;
  font-weight: 700;
}

.portal.ui2 .ui2-kpi-grid {
  display: grid;
  grid-template-columns: repeat(var(--ui2-kpi-cols, 4), minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #e2e6ec;
  border-radius: 10px;
  background: #e2e6ec;
}

.portal.ui2 .ui2-kpi-cell {
  min-height: 88px;
  padding: 14px 16px;
  background: #fff;
}

.portal.ui2 .ui2-kpi-label {
  margin-bottom: 4px;
  color: #5f6b7a;
  font-size: 11.5px;
}

.portal.ui2 .ui2-kpi-value {
  color: #1b2530;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.portal.ui2 .ui2-kpi-value .unit {
  color: #8a95a3;
  font-size: 13px;
  font-weight: 600;
}

.portal.ui2 .ui2-action-panel {
  padding: 15px 17px;
  border: 1px solid #d9e5f5;
  border-radius: 10px;
  background: #f5f9ff;
}

.portal.ui2 .ui2-action-title {
  margin-bottom: 12px;
  color: #2f5f9e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.portal.ui2 .ui2-home-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal.ui2 .ui2-main .task-card {
  display: flex;
  align-items: center;
  min-height: 64px;
  margin: 0;
  padding: 12px 17px;
  border: 1px solid #e2e6ec;
  border-radius: 8px;
  background: #fff;
  color: #1b2530;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: none;
}

.portal.ui2 .ui2-main .task-card:hover {
  border-color: #2f6fbf;
  background: #f7fafd;
}

.portal.ui2 .ui2-main .task-card .status-badge {
  margin-left: auto;
  float: none;
}

.portal.ui2 .ui2-task-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.portal.ui2 .ui2-task-title { font-size: 13.5px; font-weight: 700; }
.portal.ui2 .ui2-task-sub { color: #5f6b7a; font-size: 11.5px; font-weight: 400; }
.portal.ui2 .ui2-inline-action {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 13px;
  border-radius: 7px;
  background: #2f6fbf;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.portal.ui2 .ui2-save-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 12px;
  border-bottom: 1px solid #e7ebf0;
}

.portal.ui2 .ui2-save-hint {
  padding: 9px 13px;
  border: 1px solid #e2e6ec;
  border-left: 3px solid #2f6fbf;
  border-radius: 7px;
  background: #f7f9fb;
  color: #5f6b7a;
  font-size: 12.5px;
}

.portal.ui2 .ui2-main .ui2-panel > h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
}

/* 基本情報は下の2列表だけを表示し、旧画面の一行サマリは重複させない。値は
   既存の描画処理とテストのため DOM に残す。 */
.portal.ui2 .ui2-main #homeIdentity { display: none; }

.portal.ui2 .ui2-main button:not([class]),
.portal.ui2 .ui2-main button.btn-primary,
.portal.ui2 .ui2-main button.btn-danger {
  min-height: 34px;
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
}

.portal.ui2 .ui2-main button.btn-primary {
  border-color: #2f6fbf;
  background: #2f6fbf;
  color: #fff;
}

.portal.ui2 .ui2-main button.btn-primary:hover {
  border-color: #255a9c;
  background: #255a9c;
}

.portal.ui2 .ui2-main .review-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 13.5px;
}

.portal.ui2 .ui2-main .review-table th {
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid #dde3ea;
  background: transparent;
  color: #5f6b7a;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
}

.portal.ui2 .ui2-main .review-table td {
  padding: 10px;
  border: 0;
  border-bottom: 1px solid #eef1f5;
  background: #fff;
  color: #1b2530;
  vertical-align: top;
}

.portal.ui2 .ui2-main .review-table tr:hover td { background: #f7fafd; }

.portal.ui2 .ui2-main .list-section-head {
  margin: 0;
  padding: 5px 0 5px 12px;
  border-left: 4px solid #4a86d8;
  color: #41505f;
  font-size: 15px;
  font-weight: 800;
}

.portal.ui2 .ui2-main .status-badge {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.portal.ui2 .ui2-main ul[id$="Notifications"],
.portal.ui2 .ui2-main #notificationList {
  max-width: 60em;
  list-style: none;
  border: 1px solid #e2e6ec;
  border-radius: 10px;
  overflow: hidden;
}

.portal.ui2 .ui2-main ul[id$="Notifications"] li,
.portal.ui2 .ui2-main #notificationList li {
  padding: 12px 16px;
  border-bottom: 1px solid #eef1f5;
  color: #41505f;
  font-size: 13.5px;
}

.portal.ui2 .ui2-main ul[id$="Notifications"] li:last-child,
.portal.ui2 .ui2-main #notificationList li:last-child { border-bottom: 0; }

.portal.ui2 .ui2-main .ui2-subtitle + .info-text { margin-top: 0; }

@media (max-width: 900px) {
  .portal.ui2 .ui2-topbar { align-items: flex-start; flex-wrap: wrap; }
  .portal.ui2 .ui2-context { display: flex; order: 3; flex-basis: 100%; flex-wrap: wrap; }
  .portal.ui2 .ui2-topbar .header-meta { margin-left: auto; }
  .portal.ui2 .ui2-layout { flex-direction: column; }
  .portal.ui2 .ui2-sidebar {
    flex: none;
    width: 100%;
    min-height: 0;
    padding: 9px 10px;
    border-right: 0;
    border-bottom: 1px solid #e7ebf0;
  }
  .portal.ui2 .ui2-sidebar-label { display: none; }
  .portal.ui2 .ui2-nav.portal-nav { flex-direction: row; flex-wrap: wrap; }
  .portal.ui2 .ui2-nav .nav-btn,
  .portal.ui2 .ui2-nav .side-btn { width: auto; }
}

@media (max-width: 600px) {
  .portal.ui2 .ui2-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal.ui2 .ui2-phase-pills { width: 100%; overflow-x: auto; }
  .portal.ui2 .ui2-topbar .header-meta { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
