/* ===== Action Board - カスタムスタイル ===== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Noto Sans JP', sans-serif;
  color: #2b2724;
  background: #ece7dd;
}
[x-cloak] { display: none !important; }

/* x-show は非表示→表示の復元時にインライン display を削除するだけで元の値(flex/grid)には
   戻さないため、表示値はクラスで持たせて CSS カスケードで復元されるようにする */
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-inline-flex { display: inline-flex; }

/* ---- アニメーション ---- */
@keyframes hf-pop {
  0%   { transform: scale(.88); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- スクロールバー ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d6cfc1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #c4bba8; }

/* ---- フォント ---- */
.zk { font-family: 'Zen Kaku Gothic New', sans-serif; }

/* ---- Icon Rail ---- */
.rail-btn {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  border: none; cursor: pointer;
  background: transparent;
  transition: background .15s;
}
.rail-btn:hover             { background: rgba(255,255,255,0.08); }
.rail-btn-active            { background: #3f5a66 !important; }
.rail-btn-active-green      { background: #5c8270 !important; }
.rail-btn-admin-active      { background: #4a6a54 !important; }

/* ---- Context Panel ---- */
.ctx-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 9px;
  text-decoration: none; color: #2b2724; font-size: 13.5px;
  cursor: pointer; border: none; background: transparent;
  width: 100%; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .1s;
}
.ctx-item:hover    { background: rgba(0,0,0,.04); }
.ctx-item-active   { background: #e2dccf !important; }
.proj-drag-handle:hover { opacity: 1 !important; color: #7a9baa !important; }
.tl-story-drag-handle:hover { opacity: 1 !important; color: #7a9baa !important; }
.sortable-ghost    { opacity: .4; }
.sortable-chosen    { background: rgba(92,124,138,.08) !important; }
.ctx-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  color: #a59c8b; padding: 2px 8px 6px 8px; display: block;
}

/* ---- 通知バッジ ---- */
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: #e05c3a; color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* チャット未読バッジ（通知バッジと同形・別色。ダッシュボードアイコンの左下に出す） */
.chat-badge {
  position: absolute; bottom: -4px; right: -4px;
  background: #5c8270; color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* チャット新着トースト（画面右下・クリックでチャットタブへ） */
.chat-toast {
  width: 280px; max-width: 82vw;
  background: #fff; border: 1px solid #e2dccf; border-left: 3px solid #5c8270;
  border-radius: 12px; padding: 10px 13px;
  box-shadow: 0 10px 28px rgba(43,39,36,.22);
  cursor: pointer;
  animation: hf-pop .18s ease-out;
}
.chat-toast:hover { background: #faf8f4; }

/* ---- タスクカード ---- */
.task-card {
  background: #fff; border: 1px solid #e5e0d8; border-radius: 8px;
  padding: 10px 12px; cursor: pointer;
  transition: box-shadow .1s, border-color .1s;
}
.task-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); border-color: #ccc5b8; }

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; border: none; transition: opacity .15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary          { background: #5c7c8a; color: #fff; }
.btn-primary:hover    { background: #4a6a78; }
.btn-secondary        { background: #f0ede6; color: #4a443b; border: 1px solid #e2dccf; }
.btn-secondary:hover  { background: #e5e0d8; }
.btn-danger           { background: #e05c3a; color: #fff; }
.btn-danger:hover     { background: #cc4f30; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---- フォーム ---- */
.form-input {
  width: 100%; border: 1px solid #e2dccf; border-radius: 6px;
  padding: 8px 10px; font-size: 14px; font-family: inherit;
  background: #faf8f4; transition: border-color .15s; outline: none;
}
.form-input:focus { border-color: #b0a791; background: #fff; }
textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input { cursor: pointer; }

/* ---- モーダル ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(43,39,36,.35); backdrop-filter: blur(2px);
  z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 28px;
}
.modal {
  position: relative; background: #fbf9f5;
  border: 1px solid #e2dccf; border-radius: 18px;
  box-shadow: 0 24px 60px rgba(43,39,36,.28);
  max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: hf-pop .16s ease;
}

/* ---- カンバンカラム ---- */
.kanban-col {
  background: #f0ede6; border-radius: 12px;
  min-width: 240px; flex: 0 0 240px;
  display: flex; flex-direction: column;
  max-height: 100%; overflow: hidden;
}
.kanban-col-header {
  padding: 12px 14px; font-size: 12px; font-weight: 700;
  color: #6b6356; letter-spacing: .04em;
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.kanban-col-body {
  flex: 1; overflow-y: auto;
  padding: 0 8px 8px 8px;
  display: flex; flex-direction: column; gap: 6px;
}

/* ---- ローディングスピナー ---- */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid #e2dccf; border-top-color: #5c7c8a;
  border-radius: 50%; animation: spin .8s linear infinite;
}

/* ---- ステータスバッジ ---- */
.status-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 100px;
  font-size: 11px; font-weight: 600; border: 1px solid;
}

/* ---- アバター ---- */
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}

/* ---- アイコンレール（Prod/Stgで背景色が異なる） ----
   Alpine の :style は文字列を渡すと style 属性全体を上書きし、
   同居する静的 style の内容(width/padding等)を消してしまうため、
   レイアウトを担う静的プロパティは必ずクラスへ分離し、:style は
   純粋に1〜2個の動的プロパティ(background等)専用にする。 */
.icon-rail {
  width: 66px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0; gap: 6px;
}
.icon-rail-prod { background: #36464d; }
.icon-rail-stg  { background: #5a3620; }

/* ---- 動的背景色ドット（:style上書きバグ対策で形状をクラス側に分離） ---- */
.dot-7          { width: 7px;  height: 7px;  border-radius: 50%; flex-shrink: 0; }
.dot-8          { width: 8px;  height: 8px;  border-radius: 50%; flex-shrink: 0; }
.dot-8-mt5      { width: 8px;  height: 8px;  border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.dot-9          { width: 9px;  height: 9px;  border-radius: 50%; flex-shrink: 0; }
.dot-10         { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-12-square  { width: 12px; height: 12px; border-radius: 3px;  flex-shrink: 0; }
.dot-12         { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.dot-14         { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.dot-36-bordered{ width: 36px; height: 36px; border-radius: 50%; border: 2px solid #e2dccf; flex-shrink: 0; }

.avatar-circle-38 {
  width: 38px; height: 38px; border-radius: 50%; color: #fff;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar-rail-btn {
  width: 36px; height: 36px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  border: 2.5px solid rgba(255,255,255,0.2); cursor: pointer;
}

.progress-fill      { height: 100%; background: #5b9272; border-radius: 99px; }
.progress-fill-anim { height: 100%; background: #5b9272; border-radius: 99px; transition: width .3s; }

.notif-type-icon {
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  align-self: center;
}

.badge-priority      { font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.badge-priority-card { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px; border: 1px solid; white-space: nowrap; flex-shrink: 0; }
.task-card-row-topline { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #f1ede4; }

.kanban-task-card {
  background: #fff; border: 1px solid #e8e3da; border-radius: 13px;
  padding: 13px 14px; box-shadow: 0 1px 3px rgba(43,39,36,.04); cursor: pointer;
}

/* ---- 絞り込みボタン・パネル ---- */
.filter-btn {
  display: flex; align-items: center; gap: 5px; background: #f1ede4; color: #6b6356;
  border: 1px solid #e2dccf; border-radius: 10px; padding: 6px 13px; cursor: pointer;
  font-size: 12.5px; flex-shrink: 0; position: relative; transition: all .15s;
}
.filter-btn-active { background: #e9eff1 !important; color: #3f5a66 !important; border-color: #cddbe0 !important; }
.filter-count-badge {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  background: #cf7d5c; color: #fff; border-radius: 50%; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.filter-panel {
  position: fixed; right: 0; top: 60px; bottom: 0; width: 360px;
  background: #fbf9f5; border-left: 1px solid #ece6da;
  box-shadow: -8px 0 24px rgba(43,39,36,.12); z-index: 45;
  display: flex; flex-direction: column; overflow: hidden;
}
.filter-section-label { font-size: 11px; font-weight: 700; color: #a59c8b; letter-spacing: .05em; margin-bottom: 8px; display: block; }
.filter-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px;
  cursor: pointer; transition: background .1s;
}
.filter-item:hover { background: rgba(0,0,0,.03); }
.filter-item-selected { background: #eef3f4; }
.filter-checkbox {
  width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #d8d0c2;
  background: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.filter-checkbox-checked { border-color: #3f5a66 !important; background: #3f5a66 !important; }
.prio-filter-btn {
  flex: 1; border: 1.5px solid #e2dccf; background: #fff; color: #6b6356; font-weight: 400;
  border-radius: 8px; padding: 7px 4px; font-size: 12px; cursor: pointer; text-align: center;
  transition: all .1s;
}
.prio-filter-high.prio-filter-active   { border-color: #e0b9a5 !important; background: #faf0ea !important; color: #a85a37 !important; font-weight: 500; }
.prio-filter-medium.prio-filter-active { border-color: #cddbe0 !important; background: #e9eff1 !important; color: #3f5a66 !important; font-weight: 500; }
.prio-filter-low.prio-filter-active    { border-color: #e2dccf !important; background: #f1ede4 !important; color: #7a7268 !important; font-weight: 500; }
.due-filter-btn {
  flex: 1; border: 1.5px solid #e2dccf; background: #fff; color: #6b6356;
  border-radius: 8px; padding: 7px 4px; font-size: 12px; cursor: pointer; text-align: center;
}
.due-filter-active { border-color: #cddbe0 !important; background: #e9eff1 !important; color: #3f5a66 !important; }

.kanban-card-title { flex: 1; min-width: 0; overflow-wrap: break-word; word-break: break-word; font-size: 13.5px; font-weight: 500; line-height: 1.45; }
.due-badge-card { font-size: 11px; border-radius: 6px; padding: 1px 7px; border: 1px solid; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }

/* ---- ビュー切替(カンバン/タイムライン) ---- */
.view-tab-btn {
  display: flex; align-items: center; gap: 6px; font-size: 13px; border: none;
  border-radius: 8px; padding: 5px 13px; cursor: pointer; white-space: nowrap;
  transition: background .12s, color .12s, box-shadow .12s;
}
.view-tab-btn-active { background: #fff; box-shadow: 0 1px 2px rgba(43,39,36,.08); color: #2b2724; font-weight: 500; }
.view-tab-btn-inactive { background: transparent; color: #9a9080; font-weight: 400; }
.gantt-nav-btn {
  width: 28px; height: 28px; border: 1px solid #e2dccf; background: #fff; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; color: #6b6356;
}

/* ---- タイムライン(ガント) ---- */
.tl-day-header-cell { flex: 1; text-align: center; font-size: 11px; }
.tl-story-row-left {
  flex: 0 0 680px; min-width: 0; padding: 5px 20px; border-right: 1px solid #f4f1ea;
  display: flex; align-items: center; gap: 12px; background: #fff; cursor: pointer;
  min-height: 56px; transition: background .1s;
}
.tl-story-row-left:hover { background: #faf8f4; }
.tl-task-row-left {
  flex: 0 0 680px; min-width: 0; padding: 0 20px; border-right: 1px solid #f1ede4;
  display: flex; align-items: center; gap: 12px; min-height: 36px;
}
.tl-gantt-area { flex: 1; position: relative; min-height: 100%; }
.tl-bar {
  position: absolute; top: 11px; height: 24px; border-radius: 8px;
  display: flex; align-items: center; overflow: hidden; padding: 0 6px;
}
.tl-bar-fill { position: absolute; top: 0; left: 0; bottom: 0; border-radius: 7px 0 0 7px; opacity: .85; }
.tl-task-bar { position: absolute; top: 9px; height: 16px; border-radius: 5px; overflow: hidden; }
.tl-task-bar-fill { position: absolute; top: 0; left: 0; bottom: 0; border-radius: 4px 0 0 4px; opacity: .8; }
.tl-rh-l, .tl-rh-r { position: absolute; top: 0; bottom: 0; width: 6px; cursor: ew-resize; z-index: 3; }
.tl-rh-l { left: 0; border-radius: 4px 0 0 4px; }
.tl-rh-r { right: 0; border-radius: 0 4px 4px 0; }
.tl-rh-l:hover, .tl-rh-r:hover { background: rgba(0,0,0,.13); }
.tl-dragging, .tl-dragging * { cursor: ew-resize !important; user-select: none !important; }
.tl-day-num { width: 20px; height: 20px; line-height: 20px; border-radius: 50%; margin: 0 auto; }
.tl-task-prio-bar { width: 3px; height: 16px; border-radius: 2px; flex-shrink: 0; }
.tl-task-due-label { font-size: 10.5px; flex-shrink: 0; }
.tl-col-iter    { width: 90px;  flex-shrink: 0; text-align: center; }
.tl-col-progress{ width: 170px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.tl-col-avatars { width: 76px;  flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.tl-col-due     { width: 70px;  flex-shrink: 0; display: flex; justify-content: flex-end; }
.tl-col-edit    { width: 32px;  flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.tl-col-prio    { width: 90px;  flex-shrink: 0; display: flex; justify-content: center; }
.tl-col-status  { width: 170px; flex-shrink: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.tl-progress-track { flex: 1; height: 7px; background: #eceadf; border-radius: 99px; overflow: hidden; }
.tl-progress-fill  { height: 100%; border-radius: 99px; }
.tl-avatar {
  width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff; flex-shrink: 0;
}
.tl-avatar + .tl-avatar { margin-left: -6px; }
.tl-story-edit-btn {
  width: 28px; height: 28px; border: none; background: transparent; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #9a9080; opacity: 0; transition: opacity .15s;
}
.tl-story-group:hover .tl-story-edit-btn { opacity: 1; }
.tl-chevron { transition: transform .15s; display: flex; align-items: center; flex-shrink: 0; }
.tl-chevron-open { transform: rotate(90deg); }
.tl-checklist-toggle {
  width: 20px; height: 20px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .12s; border: 1px solid transparent; color: #b0a791; cursor: pointer;
}
.tl-checklist-toggle-open { background: #e9f0ea; border-color: #c8ddce; color: #41705a; }
.tl-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: #6b6356; }
.tl-legend-bar { width: 18px; height: 6px; border-radius: 99px; }
.tl-legend-box { width: 14px; height: 10px; border-radius: 2px; }
.badge-status-sm     { font-size: 11.5px; font-weight: 700; border-radius: 7px;  padding: 3px 10px; }
.badge-sprint-status { font-size: 11px;   font-weight: 700; border-radius: 99px; padding: 2px 10px; flex-shrink: 0; margin-left: 8px; }

.row-grid-status { display: grid; grid-template-columns: 16px 140px 1fr; align-items: center; padding: 14px 18px; gap: 12px; }
.row-grid-member-3col { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; align-items: center; padding: 13px 18px; }
.row-grid-category  { display: grid; grid-template-columns: 16px 130px 1fr 56px 72px; align-items: center; padding: 13px 18px; gap: 12px; }
.row-grid-iteration  { display: grid; grid-template-columns: 16px 1fr 200px 90px 72px; align-items: center; padding: 13px 18px; gap: 12px; }
.table-header-row {
  display: grid; align-items: center; padding: 10px 18px;
  background: #faf7f1; border-bottom: 1px solid #ece6da; gap: 12px;
}
.table-header-label { font-size: 11.5px; font-weight: 700; color: #a59c8b; letter-spacing: .04em; }
.table-card { background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid #ece6da; }

.icon-action-btn {
  width: 30px; height: 30px; border: none; background: #f9f6f1; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.icon-action-edit   { color: #5c7c8a; }
.icon-action-delete { color: #c08a6e; }

.sprint-card { border: 2px solid; border-radius: 14px; padding: 16px; cursor: pointer; transition: box-shadow .15s; }

.watch-toggle-btn {
  display: flex; align-items: center; gap: 5px; font-size: 11.5px;
  border: 1px solid #e2dccf; border-radius: 7px; padding: 3px 9px;
  background: #fff; cursor: pointer;
}
.like-toggle-btn {
  display: flex; align-items: center; gap: 4px; background: none; border: none;
  cursor: pointer; font-size: 11.5px;
}
.comment-submit-btn {
  margin-left: auto; background: #5c8270; color: #fff; border: none;
  border-radius: 8px; padding: 7px 16px; font-size: 13px; cursor: pointer;
}
.color-preset-swatch {
  width: 26px; height: 26px; border-radius: 50%; border: none;
  cursor: pointer; transition: box-shadow .15s;
}

.is-disabled { opacity: .6 !important; cursor: not-allowed !important; }

.text-sm-bold   { font-size: 12px; font-weight: 600; }
.count-badge-sm { margin-left: auto; font-size: 11px; font-weight: 600; }
.text-11half    { font-size: 11.5px; }

.group-header-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 6px 4px; background: transparent; border: none; cursor: pointer;
  border-radius: 6px;
}
.chevron-icon { transition: transform .15s; flex-shrink: 0; }
.notif-row { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 6px; }

.group-toggle-btn {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #6b6356;
  background: #fff; border: 1px solid #e2dccf; border-radius: 8px; padding: 5px 12px; cursor: pointer;
}
.col-header-label { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; }
.kanban-drop-zone {
  flex: 1; display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px;
}
/* スイムレーン(ストーリー別)ではCSS Gridの子要素になり flex:1 が効かないため、
   空セルの高さがほぼ0になりドロップしづらくなる。最小高さで確保する */
.kanban-drop-zone-swimlane { min-height: 56px; }

/* AIサマリー(dashboard.htmlのx-htmlで挿入されるMarkdown由来HTML)のスタイル。
   Tailwind CDNのPreflightがh1〜h3・ul/li・aの既定スタイルをリセットしてしまうため、
   見出し・箇条書き・リンクが判別できなくなる問題への対応(Prodのdash-ai-body/
   ai-summary-bodyと同等のスタイルを移植) */
.dash-ai-body h1, .dash-ai-body h2 { font-size: 12.5px; font-weight: 700; color: #2b2724; margin: 12px 0 5px; padding-bottom: 4px; border-bottom: 1px solid #f0ede6; }
.dash-ai-body h3 { font-size: 12px; font-weight: 700; color: #3f3b35; margin: 10px 0 4px; }
.dash-ai-body p { font-size: 13px; line-height: 1.75; color: #3f3b35; margin: 0 0 8px; }
.dash-ai-body ul, .dash-ai-body ol { padding-left: 18px; margin: 0 0 8px; }
.dash-ai-body li { font-size: 13px; line-height: 1.7; color: #3f3b35; margin-bottom: 3px; }
.dash-ai-body a { color: #5c7c8a; text-decoration: underline; text-underline-offset: 2px; }
.dash-ai-body a:hover { color: #3f5a66; }
.dash-ai-body strong { font-weight: 700; color: #2b2724; }
.dash-ai-body hr { border: none; border-top: 1px solid #f0ede6; margin: 12px 0; }

.ai-summary-body h1, .ai-summary-body h2 { font-size: 14px; font-weight: 700; color: #2b2724; margin: 18px 0 8px; padding-bottom: 5px; border-bottom: 1px solid #f0ede6; }
.ai-summary-body h3 { font-size: 13.5px; font-weight: 700; color: #3f3b35; margin: 14px 0 6px; }
.ai-summary-body p { font-size: 14px; line-height: 1.8; color: #3f3b35; margin: 0 0 10px; }
.ai-summary-body ul, .ai-summary-body ol { padding-left: 20px; margin: 0 0 10px; }
.ai-summary-body li { font-size: 14px; line-height: 1.75; color: #3f3b35; margin-bottom: 4px; }
.ai-summary-body a { color: #5c7c8a; text-decoration: underline; text-underline-offset: 2px; }
.ai-summary-body a:hover { color: #3f5a66; }
.ai-summary-body strong { font-weight: 700; color: #2b2724; }
.ai-summary-body hr { border: none; border-top: 1px solid #f0ede6; margin: 16px 0; }

/* ============================================================
   モバイル対応: タスク詳細画面（チケット#584・幅768px未満のみ）

   **PC 向けの記述は一切変えない。** 既存のインラインスタイルはそのまま残し、
   ここで携帯幅のときだけ打ち消す。インラインスタイルは詳細度が最強なので
   打ち消しには !important が要る（この構造を選んだ理由は下記）。

   なぜインラインを消してクラス化しなかったか:
     - task-detail.js はカンバン・ダッシュボードから**モーダルとしても使われる共有部品**で、
       PC 側の見た目を変えるリスクがある（L7 の43件が依存している）
     - L7 が `div[style*="max-height: 180px"]` のように**インラインスタイルの値そのものを
       セレクタにしている箇所がある**。インラインを消すとテストが壊れる

   対象は「タスク詳細」のみ。カンバン・ダッシュボード等は今回スコープ外
   （携帯では使わせない方針。specs/sessions/20260814-001/feature.md 参照）。
   ============================================================ */
@media (max-width: 767px) {

  /* --- ページの外枠: 画面全体をスクロールできるようにする ---
     元は height:100vh + overflow:hidden で固定枠にしていた。
     携帯ではアドレスバーの出入りで 100vh が変動し、下端が隠れることがある */
  .td-page-body,
  .td-page-shell {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
    display: block !important;
  }
  .td-page-main {
    min-width: 0 !important;
  }

  /* --- 高さ固定の連鎖を解除する ---
     外枠だけ height:auto にしても、その内側に
       .td-page-content(flex:1;overflow:hidden) -> .td-mount(height:100%)
       -> .td-root(height:100%) -> .td-root-inner(height:100%)
     の4層が残っており、**中身は viewport 高で切られたまま**になる。
     ページはスクロールできるのに下が空白、という見え方になるので気づきにくい */
  .td-page-content,
  .td-mount,
  .td-root,
  .td-root-inner {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  /* --- 他画面への導線を出さない ---
     行き先（カンバン・スプリント・ラベル管理等）が携帯未対応のため。
     押させると崩れた画面に着地する（feature.md 決定6）。

     **`.icon-rail` は layout.js が全画面に出す共通クラス。**
     裸で書くとダッシュボード・カンバン等の携帯表示からもナビが消える
     （今回のスコープはタスク詳細だけ）。`.td-page-body`（この画面の body）
     配下に限定する */
  .td-page-body .icon-rail,
  .td-page-header {
    display: none !important;
  }

  /* --- 本文と右パネルを縦に積む ---
     横に並べる幅がない。読む順は「本文 -> 属性」で成立する */
  .td-body {
    display: block !important;
    overflow: visible !important;
  }
  .td-body > div {
    border-right: none !important;
    overflow: visible !important;
  }
  .td-side {
    width: 100% !important;
    flex-shrink: 1 !important;
    overflow: visible !important;
    border-top: 1px solid #ece6da;
  }

  /* --- ポップアップ（メンション候補・書式ヘルプ）を画面内に収める ---
     240/260px 固定のため、右端近くで開くと画面外へはみ出す */
  .td-pop {
    width: auto !important;
    max-width: calc(100vw - 32px) !important;
    /* いいねした人の一覧は white-space:nowrap を持つ。max-width だけでは
       はみ出したままなので折り返しを許す（他の td-pop は既定が normal で無影響） */
    white-space: normal !important;
  }

  /* --- 変更履歴: 日時列の固定幅をやめて折り返す --- */
  .td-activity-time {
    width: auto !important;
    flex-shrink: 1 !important;
  }

  /* --- タップ対象を44px以上にする ---
     Apple/Google のガイドラインが共通して示す下限。
     指で押せない要素は「表示されているのに使えない」状態になる。

     **セレクタは対象を名指しする。** `.td-body label` のような広い書き方をすると
     右パネルの項目名（ストーリー・優先度・担当者…の7個）まで 44px になり、
     携帯で縦に間延びする（最初にそう書いていた）。 */
  .td-body input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
  }
  /* チェックリストは**行そのものが切替**（label にも同じ toggle が付いている）。
     チェックボックスを 44px 四方にすると異様に大きいので、
     行の高さで 44px を satisfy し、ラベルが横幅いっぱいを占める形にする */
  .td-check-row {
    min-height: 44px;
  }
  .td-check-label {
    display: flex !important;
    align-items: center;
    min-height: 44px;
  }
  /* 添付（写真・ファイル）は 15〜17px の SVG だけを持つ label。そのままでは押せない */
  .td-attach-label {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
  .watch-toggle-btn,
  .like-toggle-btn,
  .comment-submit-btn {
    min-width: 44px;
    min-height: 44px;
  }

  /* --- 長い文字列で横スクロールさせない ---
     URL・英数字の連続は既定では折り返されない */
  .td-body,
  .td-side {
    overflow-wrap: anywhere;
  }
}
