﻿/* =========================================================================
   Project Studio — PS 固有の追加スタイル
   ★ps.css（P001 の写し）に手を入れずに、ここへ足す・上書きする。
   ★:root の配色トークンは増やさない。色は ps.css のトークンだけを使う。
   ========================================================================= */

/* ---- ヘッダーのメニュー項目を <a> で描く ---------------------------------
   モックアップは <button> だが、実装では画面遷移なので <a>。見た目は button と同じにそろえる。 */
.ps-header__menu a {
  display: inline-block;
  background: transparent;
  border: 1px solid transparent;
  color: var(--c-header-fg);
  font-size: var(--fs-small);
  font-family: inherit;
  padding: 3px 9px;
  border-radius: var(--r-btn);
  text-decoration: none;
  cursor: pointer;
  line-height: normal;
}
.ps-header__menu a:hover { border-color: var(--c-accent); color: var(--c-accent); }
.ps-header__menu a[aria-current="page"] {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent);
}
/* ログアウトはフォームの POST なので button のまま。form を flex の子として溶かす */
.ps-header__menu form { display: contents; }

/* ---- LT-3 単一ペイン型の器 -------------------------------------------------
   固定ヘッダー ／ 画面見出し ／ 中央1枚（本文が縦にスクロール）／ 下端の操作行 ／ 固定フッター */
.ps-single {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--c-pane-bg);   /* ★パネル構成（ps.css）: LT-3 の1枚もパネル */
}
.ps-single .ps-pane__body { padding: 10px 16px; }

/* ---- LT-4 ①認証の姿: KSP-001 ログイン画面のサイズ感に寄せる ------------------
   参考: input/reference/screens/Login-KSP.png（カード幅 480px・上下余白 50px・ロゴ ／ 題 ／ 欄 ／ 右寄せボタン ／ 右下に version） */
.ps-card--auth {
  max-width: 480px;
  padding: 44px 52px 12px 52px;
  color: var(--c-text);
}
.ps-card--auth.ps-card--wide { max-width: 560px; }
.ps-auth__brand {
  display: flex; align-items: center; gap: 8px;
  height: 36px;
  margin-bottom: 14px;
}
.ps-auth__brand img { display: block; }
.ps-auth__brand .ps-auth__mark { height: 28px; width: auto; }
.ps-auth__brand .ps-auth__wordmark { height: 15px; width: auto; }
.ps-auth__title {
  margin: 0 0 30px 0;
  font-size: 20px; font-weight: normal; color: var(--c-text);
  letter-spacing: .04em;
}
.ps-auth__lead { margin: -20px 0 22px 0; font-size: var(--fs-small); color: var(--c-text-weak); line-height: 1.6; }
.ps-card--auth .ps-field { margin-bottom: 14px; }
.ps-card--auth .ps-field__label { flex: 0 0 120px; font-size: 11px; }
.ps-card--auth .ps-input { background: transparent; }
.ps-card--auth .ps-input:focus { background: var(--c-input-focus-bg); }
.ps-auth__actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 12px;
  margin-top: 26px;
}
.ps-auth__actions .ps-action { min-width: 96px; padding: 6px 14px; font-size: var(--fs-base); }
.ps-auth__links { display: flex; gap: 14px; margin-right: auto; }
.ps-auth__links a { font-size: var(--fs-small); color: var(--c-link); text-decoration: none; }
.ps-auth__links a:hover { text-decoration: underline; }
.ps-auth__links button {
  background: none; border: none; padding: 0; font: inherit; font-size: var(--fs-small);
  color: var(--c-link); cursor: pointer;
}
.ps-auth__links button:hover { text-decoration: underline; }
.ps-auth__version {
  margin-top: 26px;
  text-align: right;
  font-size: 11px; color: var(--c-text-weak);
}
/* カードの上端に置く1行の案内（common.md §4.5 sc-aut-01-lbl-notice）と、利用者エラー */
.ps-auth__notice { margin: 0 0 16px 0; font-size: var(--fs-small); color: var(--c-text-weak); }
.ps-auth__error  {
  margin: 0 0 16px 0; padding: 6px 10px;
  font-size: var(--fs-small); color: var(--c-error); background: var(--c-error-bg);
  border-left: 2px solid var(--c-error);
}
.ps-otp-input { font-size: 20px; letter-spacing: .5em; text-align: center; }
.ps-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); cursor: pointer; }
.ps-check input { margin: 0; accent-color: var(--c-accent); }

/* ---- 開発用 /StyleGuide ---------------------------------------------------- */
.ps-styleguide { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 16px; }
.ps-styleguide h2 {
  font-size: var(--fs-base); margin: 18px 0 8px 0; padding: 4px 10px;
  background: var(--c-section-bg); color: var(--c-section-fg); font-weight: normal;
}
.ps-styleguide h2:first-child { margin-top: 0; }
.ps-styleguide__note { font-size: var(--fs-small); color: var(--c-text-weak); margin: 0 0 8px 0; }
.ps-styleguide__box { border: 1px solid var(--c-border); padding: 10px 12px; margin-bottom: 6px; }
.ps-styleguide__two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ps-styleguide__cap { font-size: 11px; color: var(--c-text-weak); margin: 0 0 6px 0; }
.ps-styleguide code { font-size: 11px; background: var(--c-label-bg); padding: 0 3px; }
.ps-styleguide__frame {
  display: flex; height: 260px; border: 1px solid var(--c-border-strong);
}
.ps-styleguide__frame .ps-main { min-height: 0; }

/* ---- ボタンの見た目のリンク（画面遷移する「新規作成」「キャンセル」） ------------------ */
a.ps-excel, a.ps-action { display: inline-block; text-decoration: none; text-align: center; box-sizing: border-box; }
a.ps-excel:hover, a.ps-action:hover { text-decoration: none; }
/* 下端の操作行の左に出す利用者エラー */
.ps-actionbar .ps-field__error { margin: 0; }

/* ---- 欄の並びの手直し ------------------------------------------------------------
   複数行（textarea）はラベルを上端にそろえる（baseline だと最終行にぶら下がる） */
.ps-field:has(> .ps-field__body > textarea) { align-items: flex-start; }
.ps-field:has(> .ps-field__body > textarea) > .ps-field__label { padding-top: 4px; }
/* 右ペインのラベル列: 「顧客（相手先組織）*」「プロジェクトの状態」が折り返さない幅 */
.ps-right .ps-field__label { flex: 0 0 124px; }

/* ---- 表の列幅（ps.css の mk/xs/sm/md/lg/num/act に足す） -------------------------
   氏名のように「全角 10 文字前後を切らずに見せたい」列。社員管理の氏名列（ユーザー指摘: md の倍） */
.ps-c--xl { width: 264px; }

/* ---- LT-1 課題一覧（SC-ISU-01。6-1） -------------------------------------------
   _Search 部分ビューは「列見出しの帯 ＋ 一覧のスクロール領域」の 2 要素を返す。
   差し込み先の器を display: contents にして、ps-center の flex の子として並べる */
.ps-listarea { display: contents; }
/* ★右ペインの差し込み先も同じ理由で display: contents。
   _Detail が返す 操作ボタン／属性表／時系列／記録欄 は、どれも .ps-right（flex 列）の
   直接の子である前提で書かれている（.ps-timeline の flex:1 1 auto + min-height:0 + overflow-y:auto）。
   器が普通の block のままだと flex の連鎖が切れ、時系列がスクロールせずに伸び続けて、
   コメントの多い課題では下端の記録欄（登録者・処理者・確認者）が画面の外へ出てしまう（決定68-c 違反）。 */
#sc-isu-01-pnl-detailbody { display: contents; }
/* モーダル・フォームの中で欄を親いっぱいに広げる */
.ps-input--block { width: 100%; box-sizing: border-box; }
textarea.ps-input--block { resize: vertical; }
/* 登録モーダルの利用者エラー */
.ps-modal__body .ps-field__error { display: block; margin-top: 6px; }

/* ---- 右ペインの時系列（7-1。決定46: コメントの編集・削除は各投稿から） --------------
   meta は 日時・投稿者 を左に寄せ、操作（編集・削除）を右端に置く（ps.css の space-between を上書き） */
.ps-post__meta { justify-content: flex-start; gap: 10px; }
.ps-post__actions { margin-left: auto; display: flex; gap: 10px; }
.ps-post__actions button {
  border: none; background: none; padding: 0; cursor: pointer;
  font-size: 11px; color: var(--c-link);
}
.ps-post__actions button:hover { text-decoration: underline; }
.ps-post__edited { font-size: 11px; color: var(--c-text-weak); }

/* MD-ISU-03 の状態変更モード（決定47）: 編集不可の優先度トグル */
.ps-toggle:disabled { opacity: .55; cursor: default; }

/* ---- メンションの @補完（7-2。FN-ISU-12・決定41。部品は ps.js の PS.mention） --------
   候補はコメント欄の真上に全幅で出す（欄はモーダル最下部にあるため上向き。キャレット追従はしない） */
.ps-mention__wrap { position: relative; display: block; }
.ps-mention__pop {
  position: absolute; left: 0; right: 0; bottom: 100%; z-index: 30;
  max-height: 168px; overflow-y: auto;
  background: var(--c-pane-bg);
  border: 1px solid var(--c-border-strong);
  box-shadow: 0 -4px 10px rgba(0, 0, 0, .18);
}
.ps-mention__pop[hidden] { display: none; }
.ps-mention__item {
  display: flex; align-items: baseline; gap: 8px; width: 100%;
  padding: 5px 10px; border: none; background: none; cursor: pointer;
  font-size: var(--fs-base); font-family: inherit; text-align: left;
}
.ps-mention__item.is-active, .ps-mention__item:hover { background: var(--c-row-selected); }
.ps-mention__name { font-weight: bold; white-space: nowrap; }
.ps-mention__sub {
  font-size: 11px; color: var(--c-text-weak);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 確定したメンションの表示（欄の下。×で外せる） */
.ps-mention__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.ps-mention__chips[hidden] { display: none; }
.ps-mention__cap { font-size: 11px; color: var(--c-text-weak); }
.ps-mention__chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px;
  border: 1px solid var(--c-accent); color: var(--c-accent);
  background: var(--c-input-focus-bg); font-size: 11px;
}
.ps-mention__chip button {
  border: none; background: none; padding: 0; cursor: pointer;
  color: inherit; font-size: 11px; line-height: 1;
}
/* 時系列（右ペイン）の本文中のメンションの色付け */
.ps-mention { color: var(--c-accent); font-weight: bold; }

/* ---- 添付ファイル（FN-ISU-13/15。7-3。手本: docs/mockups/issue-attachment.html） ----------------- */
/* 本体が数行ぶん高くなる項目は、ラベルを上端にそろえる（ps-field の既定は baseline なので下がってしまう） */
.ps-field--top { align-items: flex-start; }
/* 書く面の添付の欄: 「ファイルを選ぶ」＋ ここへドロップ。選んだものは下にチップで並ぶ（保存で確定＝決定22） */
.ps-files { display: block; }
.ps-files__drop {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  border: 1px dashed var(--c-border-strong); background: var(--c-input-focus-bg);
}
.ps-files__drop.is-over { border-color: var(--c-accent); background: var(--c-row-selected); }
.ps-files__hint { font-size: 11px; color: var(--c-text-weak); }
.ps-files__list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ps-files__list:empty { display: none; }
/* 添付 1 件（書く面でも時系列でも同じ見た目。時系列では名前がダウンロードのリンク） */
.ps-file {
  display: inline-flex; align-items: baseline; gap: 4px; max-width: 320px;
  padding: 1px 6px; border: 1px solid var(--c-border-strong);
  background: var(--c-pane-head-bg); font-size: 11px;
}
.ps-file--new { border-color: var(--c-accent); background: var(--c-input-focus-bg); }
.ps-file__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-file__name a { color: var(--c-accent); }
.ps-file__size { color: var(--c-text-weak); white-space: nowrap; }
.ps-file__del {
  border: none; background: none; padding: 0; cursor: pointer;
  color: inherit; font-size: 11px; line-height: 1;
}
/* 読む面（時系列）の添付の並び */
.ps-post__files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* ---- 「詳細な条件」の枠（軸7〜11。7-4b。issue-list.md §5.1 規則2: ②と③のあいだ） -------------
   トグルの意味は左3軸と同じ「押されている＝一覧に出る」（決定58）。開閉しても一覧の列構成は変わらない */
.ps-adv {
  flex: 0 0 auto;
  border-top: 1px solid var(--c-border-strong);
  border-bottom: 1px solid var(--c-border-strong);
  background: var(--c-input-focus-bg);
  padding: 6px 10px;
  display: grid; grid-template-columns: 76px 1fr; gap: 4px 8px; align-items: center;
}
.ps-adv[hidden] { display: none; }
.ps-adv__label { font-size: var(--fs-small); color: var(--c-text); text-align: right; white-space: nowrap; }
.ps-adv__body { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.ps-adv__body .ps-toggle { flex: 0 0 auto; }
.ps-adv input[type="date"] {
  font: inherit; font-size: var(--fs-small); line-height: 18px; padding: 1px 4px;
  border: none; border-bottom: 1px solid var(--c-accent); background: transparent; outline: none;
}
.ps-adv input[type="date"]:focus { border-bottom-width: 2px; padding-bottom: 2px; }
.ps-adv__sep { font-size: var(--fs-small); color: var(--c-text-weak); }
.ps-adv__spacer { flex: 1 1 auto; }

/* ---- 並び替え（FN-REF-11。7-4c。一覧のバーのドロップダウン 1 つ） ------------------------ */
.ps-sort { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.ps-sort__label { font-size: var(--fs-small); color: var(--c-text-weak); white-space: nowrap; }
.ps-sort select {
  font: inherit; font-size: var(--fs-small); line-height: 18px; padding: 1px 4px;
  min-width: 90px; border: none; border-bottom: 1px solid var(--c-accent);
  background: transparent; outline: none;
}
/* 「自分の順序」のときだけ行をドラッグできる（FN-REF-22） */
.ps-list.is-sortable .ps-row { cursor: grab; }
.ps-list.is-sortable .ps-row.is-dragging { opacity: .5; cursor: grabbing; }
.ps-list.is-sortable .ps-row.is-dropbefore { box-shadow: inset 0 2px 0 0 var(--c-accent); }
.ps-list.is-sortable .ps-row.is-dropafter { box-shadow: inset 0 -2px 0 0 var(--c-accent); }

/* ---- 保存した検索条件（FN-REF-14。7-4d） -------------------------------------------- */
.ps-savedcond {
  flex: 0 0 auto; min-width: 90px; max-width: 180px;
  font: inherit; font-size: var(--fs-small); line-height: 18px; padding: 1px 4px;
  border: none; border-bottom: 1px solid var(--c-accent); background: transparent; outline: none;
}
/* MD-REF-01 の中の保存済み一覧（名前と × だけ。独立した管理画面を持たないため） */
.ps-condlist { display: flex; flex-direction: column; gap: 2px; }
.ps-condlist__item {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-small); padding: 2px 0;
  border-bottom: 1px solid var(--c-border);
}
.ps-condlist__name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-condlist__del {
  flex: 0 0 auto; border: none; background: none; padding: 0; cursor: pointer;
  color: var(--c-text-weak); font-size: 11px; line-height: 1;
}
.ps-condlist__empty { font-size: 11px; color: var(--c-text-weak); }

/* 課題の削除（FN-ISU-18。誤登録の訂正手段なので、ほかの操作ボタンと見分けが付くようにする） */
.ps-action--danger { margin-left: auto; color: #c0392b; border-color: #c0392b; }
.ps-action--danger:hover:not(:disabled) { background: #fdeeec; }

/* ---- 通知先欄（FN-NTF-01。9-1。手本: docs/mockups/issue-notify.html） ------------------
   ★各チップに「なぜ入っているか」を添える（決定76）— 送ったら取り消せないので、外していいか判断できるように。
   契機7（完了からの復帰）で入った人は灰色・× を持たない（D-47） */
.ps-notify { display: block; }
.ps-notify__list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.ps-notify__list:empty { display: none; }
.ps-notify__chip {
  display: inline-flex; align-items: baseline; gap: 4px; padding: 1px 6px;
  border: 1px solid var(--c-accent); color: var(--c-accent);
  background: var(--c-input-focus-bg); font-size: 11px;
}
.ps-notify__chip.is-locked {
  border-color: var(--c-border-strong); color: var(--c-text-weak); background: var(--c-pane-head-bg);
}
.ps-notify__why { font-size: 10px; color: var(--c-text-weak); }
.ps-notify__chip button {
  border: none; background: none; padding: 0; cursor: pointer; color: inherit; font-size: 11px; line-height: 1;
}
.ps-notify__add {
  font: inherit; font-size: var(--fs-small); line-height: 18px; padding: 1px 4px; min-width: 180px;
  border: none; border-bottom: 1px solid var(--c-accent); background: transparent; outline: none;
}
.ps-notify__empty { font-size: 11px; color: var(--c-text-weak); }

/* ---- 詳細の変更を開くリンクと、変更前・変更後の並べ（決定86。MD-ISU-05） ---------
   ★詳細は 1 行に収まらない。20 文字で切った from→to は、冒頭が同じだと左右が
   同じ文字列に見えて何も伝えないので、時系列は「詳細を変更した」だけを出し、
   全文はこのモーダルで並べて見せる（_ChangeDetail が当時の全文を返す）。 */
.ps-changelink {
  border: none; background: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--c-link); text-decoration: underline;
}
.ps-changelink:hover { color: var(--c-accent); }

.ps-diff { display: flex; gap: 10px; align-items: stretch; }
.ps-diff__col { flex: 1 1 50%; min-width: 0; display: flex; flex-direction: column; }
.ps-diff__label {
  font-size: var(--fs-small); color: var(--c-section-fg);
  background: var(--c-section-bg); padding: 3px 8px;
}
.ps-diff__body {
  flex: 1 1 auto; min-height: 180px; max-height: 46vh; overflow-y: auto;
  border: 1px solid var(--c-border-strong); background: var(--c-pane-bg);
  padding: 8px; white-space: pre-wrap; word-break: break-word;
}
.ps-diff__body:empty::before { content: "（なし）"; color: var(--c-text-weak); }

/* ---- MD-ISU-03 課題の作業場（決定90） ------------------------------------
   左＝課題情報（既定は読み取り専用）／右＝これまでのコメント（読むだけ）＋新しいコメント。
   ★幅は割合（決定89 と同じ考え方。px の固定値だと画面が大きいほど相対的に狭くなる）。
     ただし単に引き伸ばすと詳細欄の 1 行が全角 90 文字近くになって読めないので、
     広げた分は「横に並べる」ことに使う。上限 1700px は 1 列あたりが読める幅に収まる線。 */
.ps-modal--xl .ps-modal__box {
  width: 80vw;
  max-width: 1700px;
  height: 80vh;
}
/* ★本文はスクロールしない。中の「これまでのコメント」だけが伸び縮みしてスクロールし、
   「新しいコメント」は常に見えている（書きながら流れを追えるように） */
.ps-editgrid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 0 24px;
  min-height: 0;
  overflow: hidden;
}
.ps-editgrid__col { display: flex; flex-direction: column; min-height: 0; }
.ps-editgrid__col--info { overflow-y: auto; padding-right: 6px; }
.ps-editgrid__new { flex: 0 0 auto; }
.ps-editgrid .ps-timeline {
  flex: 1 1 auto; min-height: 120px;
  margin-top: 0; padding: 0 8px;
  border: 1px solid var(--c-border);
}
.ps-editgrid .ps-timeline .ps-post:first-child { border-top: none; }
.ps-editgrid .ps-timeline:empty::before {
  content: "まだコメントはありません。";
  display: block; padding: 10px 2px; color: var(--c-text-weak); font-size: var(--fs-small);
}
/* 区画が見分けられるように、項目の間隔をモーダルの中だけ広げる */
.ps-editgrid .ps-field { margin-bottom: 12px; }
.ps-editgrid .ps-section { margin-top: 4px; }
/* 区画見出しの右端に置く操作（.ps-section::after の横罫線より後ろへ回す） */
.ps-section__action { order: 1; }
/* ★読み取り専用の欄（決定90）。「直せない」は点線の下辺と薄い地で示すが、
   ★文字は薄くしない — ここは読むための面であり、詳細を読み通せることが要る。
   （ps.css の .ps-input:disabled は文字も薄くするので、そちらを上書きする） */
.ps-input.is-locked,
.ps-input.is-locked:disabled {
  background: var(--c-label-bg);
  border-bottom: 1px dotted var(--c-border-strong);
  color: var(--c-text);
  cursor: default;
}
