/* ============================================================
   タスク管理ボード — UI stylesheet
   ============================================================ */
:root {
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-2: #f5f8fa;
  --border: #e2e8ee;
  --border-strong: #cfd8e1;
  --text: #2b3440;
  --muted: #6e7b89;
  --primary: #1e9be6;
  --primary-soft: rgba(30, 155, 230, .1);
  --grad: linear-gradient(135deg, #1e9be6 0%, #17b1cf 100%);
  --danger: #f0475b;
  --warn: #f0920e;
  --ok: #27b06a;
  --sidebar-bg: #ffffff;
  --sidebar-text: #55606c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(30, 45, 60, .06), 0 1px 5px rgba(30, 45, 60, .05);
  --shadow-md: 0 2px 8px rgba(30, 45, 60, .08), 0 10px 28px rgba(30, 45, 60, .1);
  --shadow-lg: 0 24px 64px rgba(20, 35, 55, .26);
  --ring: 0 0 0 3px rgba(30, 155, 230, .18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: var(--text); }
input, textarea, select {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--ring);
}
::placeholder { color: #aab3bd; }
#app { height: 100%; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c6cdd6; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #aab3bf; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== 認証画面 ===== */
.auth-wrap {
  min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 20px;
  background: linear-gradient(150deg, #1e9be6 0%, #1db4d4 60%, #24c3a8 100%);
  position: relative; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.auth-wrap::before {
  content: ''; position: absolute; width: 720px; height: 720px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .22), transparent);
  top: -260px; right: -180px; pointer-events: none;
}
.auth-wrap::after {
  content: ''; position: absolute; width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 102, .25), transparent);
  bottom: -220px; left: -140px; pointer-events: none;
}
.auth-card {
  position: relative; z-index: 1; background: var(--panel); border-radius: 18px; padding: 40px 42px; width: 400px; max-width: 100%;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 21px; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; letter-spacing: .01em; }
.auth-card .logo-mark { width: 30px; height: 30px; }
.auth-card p.sub { color: var(--muted); font-size: 12.5px; margin-bottom: 24px; }
.auth-card label { display: block; font-size: 12px; font-weight: 700; color: #5a6572; margin: 14px 0 6px; }
.auth-card input { width: 100%; padding: 11px 13px; font-size: 16px; }
.auth-card .btn-primary { width: 100%; margin-top: 24px; padding: 12px; font-size: 14.5px; }
.auth-toggle { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.auth-toggle a { color: var(--primary); cursor: pointer; text-decoration: none; font-weight: 700; }
.auth-toggle a:hover { text-decoration: underline; }
.auth-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ===== ボタン ===== */
.btn-primary {
  background: var(--grad); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 9px 18px; font-weight: 700; letter-spacing: .01em;
  box-shadow: 0 2px 8px rgba(30, 155, 230, .3), inset 0 1px 0 rgba(255,255,255,.18);
  transition: filter .15s, transform .05s, box-shadow .15s;
}
.btn-primary:hover { filter: brightness(1.06) saturate(1.05); box-shadow: 0 4px 14px rgba(30, 155, 230, .38); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 13px; color: #3c4552; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-ghost:hover { background: var(--panel-2); border-color: var(--border-strong); color: var(--text); }
.btn-danger-ghost {
  background: transparent; border: none; color: var(--danger); padding: 7px 10px;
  border-radius: var(--radius-sm); font-weight: 600; transition: background .15s;
}
.btn-danger-ghost:hover { background: rgba(229, 72, 77, .09); }

/* ===== レイアウト ===== */
.layout { display: flex; height: 100%; }
.sidebar {
  width: 230px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid var(--border);
}
.sidebar::-webkit-scrollbar-thumb { background: #c6cdd6; border: 2px solid transparent; background-clip: content-box; }
.sidebar .brand {
  padding: 20px 20px 16px; font-size: 16.5px; font-weight: 800; color: var(--text); letter-spacing: .02em;
  display: flex; align-items: center; gap: 10px;
}
.sidebar nav { padding: 4px 10px 10px; flex: 1; }
.side-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; cursor: pointer;
  border-radius: 9px; user-select: none; margin-bottom: 1px; font-weight: 600; font-size: 13px;
  transition: background .13s, color .13s;
}
.side-item:hover { background: var(--panel-2); color: var(--text); }
.side-item.active { background: var(--primary-soft); color: var(--primary); }
.side-item .dot { width: 10px; height: 10px; border-radius: 3.5px; flex-shrink: 0; }
.side-item .nm { overflow: hidden; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all; }
.side-item .cnt {
  margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--muted);
  background: #edf1f5; border-radius: 20px; padding: 1.5px 7px; flex-shrink: 0;
}
.side-item.active .cnt { background: rgba(30, 155, 230, .16); color: var(--primary); }
.side-item .cnt.unread { background: var(--danger); color: #fff; }
.side-item .newdot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex-shrink: 0; box-shadow: 0 0 0 2.5px rgba(224, 83, 61, .18); }
.card .newdot.card-nd { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin: 0 6px 1px 0; vertical-align: middle; box-shadow: 0 0 0 2.5px rgba(224, 83, 61, .16); }
.side-item .bell { font-size: 13px; }
.side-section {
  padding: 18px 12px 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .14em;
  color: #a3aeb9; text-transform: uppercase;
}
.side-add {
  margin: 8px 2px; padding: 9px; text-align: center; border: 1.5px dashed var(--border-strong);
  border-radius: 9px; color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 600;
  transition: color .15s, border-color .15s, background .15s;
}
.side-add:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.side-user {
  padding: 14px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.side-user .info { font-weight: 700; color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .logout {
  margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  background: none; border: none;
}
.side-user .logout:hover { color: var(--primary); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; color: #fff; font-size: 11.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  letter-spacing: -.02em; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.25);
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

/* ===== トップバー ===== */
.topbar {
  background: var(--panel); border-bottom: 1px solid var(--border); padding: 13px 24px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.topbar h2 { font-size: 16.5px; font-weight: 800; display: flex; align-items: center; gap: 10px; margin-right: 8px; letter-spacing: .01em; }
.topbar h2 .dot { width: 13px; height: 13px; border-radius: 4.5px; }
.topbar .spacer { flex: 1; }
.topbar .btn-ghost { font-size: 12.5px; padding: 6.5px 12px; }
.view-tabs { display: flex; background: #e7edf2; border-radius: 10px; padding: 3px; gap: 2px; }
.view-tabs button {
  border: none; background: transparent; padding: 6.5px 16px; border-radius: 8px;
  color: var(--muted); font-weight: 700; font-size: 13px; transition: color .15s, background .15s;
}
.view-tabs button:hover { color: var(--text); }
.view-tabs button.active { background: var(--panel); color: var(--primary); box-shadow: var(--shadow-sm); }
.member-avatars { display: flex; margin-right: 2px; }
.member-avatars .avatar { margin-left: -7px; border: 2px solid var(--panel); box-shadow: none; }
.member-avatars .avatar:first-child { margin-left: 0; }

/* ===== フィルターバー ===== */
.filterbar {
  background: var(--panel); border-bottom: 1px solid var(--border); padding: 9px 24px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.filterbar input, .filterbar select { padding: 7px 11px; font-size: 13px; }
.filterbar #f-q { width: 230px; }
.filterbar .f-labels { display: flex; gap: 5px; align-items: center; }
.label-swatch.mini { width: 20px; height: 15px; border-radius: 5px; }

/* ===== カンバン ===== */
.board-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; padding: 20px 24px; }
.board { display: flex; gap: 16px; height: 100%; align-items: flex-start; }
.list-col {
  width: 296px; flex-shrink: 0; background: #e6ebf0; border-radius: var(--radius);
  display: flex; flex-direction: column; max-height: 100%;
}
.list-head { padding: 13px 15px 7px; display: flex; align-items: center; gap: 8px; }
.list-head .list-name { font-weight: 800; font-size: 13.5px; flex: 1; cursor: pointer; letter-spacing: .01em; }
.list-head .list-name:hover { color: var(--primary); }
.list-head .done-mark { color: var(--ok); font-weight: 800; }
.list-head input { font-weight: 800; width: 100%; padding: 4px 8px; }
.list-head .task-count {
  color: var(--muted); font-size: 11.5px; font-weight: 700;
  background: rgba(35, 39, 47, .06); padding: 1.5px 8px; border-radius: 20px;
}
.list-menu-btn {
  border: none; background: none; color: #97a1ad; font-size: 14px; padding: 3px 7px;
  border-radius: 6px; transition: background .13s, color .13s;
}
.list-menu-btn:hover { background: rgba(35, 39, 47, .08); color: var(--text); }
.list-opts { padding: 10px 15px; background: rgba(35, 39, 47, .045); border-bottom: 1px solid rgba(35, 39, 47, .05); }
.list-opts .lo-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.list-opts .color-dot { width: 20px; height: 20px; border-radius: 7px; }
.list-opts .lo-check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; cursor: pointer; }
.list-opts .lo-check input { accent-color: var(--primary); }
.list-body { padding: 5px 11px 4px; overflow-y: auto; flex: 1; min-height: 30px; }
.card {
  background: var(--panel); border-radius: 10px; box-shadow: var(--shadow-sm); padding: 9px 11px;
  margin-bottom: 9px; cursor: pointer; border: 1px solid rgba(35, 39, 47, .04);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: rgba(61, 111, 242, .35); }
.card.dragging { opacity: .35; transform: rotate(2deg); }
.card .labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.card .label-chip { height: 7px; width: 34px; border-radius: 4px; }
.card .title { font-size: 14px; font-weight: 700; line-height: 1.5; word-break: break-word; color: var(--text); }
.card .title.done { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.card .meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.card .due { padding: 2.5px 8px; border-radius: 6px; background: rgba(35, 39, 47, .055); font-weight: 600; }
.card .due.overdue { background: rgba(229, 72, 77, .1); color: var(--danger); font-weight: 800; }
.card .due.soon { background: rgba(217, 130, 43, .12); color: var(--warn); font-weight: 800; }
.card .meta .avatar { margin-left: auto; }
.st-badge { font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 6px; letter-spacing: .02em; }
.st-badge.hold { background: rgba(217, 130, 43, .13); color: var(--warn); }
.st-badge.cancel { background: rgba(35, 39, 47, .07); color: var(--muted); }
.drop-indicator { height: 3px; background: var(--primary); border-radius: 2px; margin: 2px 2px 9px; box-shadow: 0 0 6px rgba(61, 111, 242, .5); }
.add-card-btn {
  margin: 0 11px 12px; padding: 8px 10px; border: none; background: none; color: #8b95a1;
  text-align: left; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  transition: background .13s, color .13s;
}
.add-card-btn:hover { background: rgba(35, 39, 47, .06); color: var(--text); }
.add-card-form textarea { width: 100%; padding: 10px; resize: none; font-size: 13px; box-shadow: var(--shadow-md); }
.add-list-col {
  width: 296px; flex-shrink: 0; padding: 14px; border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius); color: var(--muted); text-align: center; cursor: pointer;
  background: rgba(255, 255, 255, .5); font-weight: 600; font-size: 13px;
  transition: color .15s, border-color .15s, background .15s;
}
.add-list-col:hover { color: var(--text); border-color: #b3bcc8; background: rgba(255, 255, 255, .8); }
.add-list-col input { width: 100%; padding: 9px; }

/* ===== ガントチャート ===== */
.gantt-wrap { flex: 1; overflow: auto; padding: 20px 24px; }
.gantt { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: fit-content; overflow: hidden; }
.gantt-row { display: flex; border-bottom: 1px solid #f0f2f5; }
.gantt-row:last-child { border-bottom: none; }
.gantt-row:not(.head):hover { background: #fafbfc; }
.gantt-row.head { position: sticky; top: 0; background: var(--panel); z-index: 2; border-bottom: 1px solid var(--border); }
.gantt-label {
  width: 250px; flex-shrink: 0; padding: 9px 14px; font-size: 12.5px; font-weight: 600;
  border-right: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 0;
  background: inherit; background: var(--panel); cursor: pointer;
}
.gantt-label:hover { color: var(--primary); }
.gantt-row.head .gantt-label { font-weight: 800; }
.gantt-days { display: flex; }
.gantt-day { width: 34px; flex-shrink: 0; border-right: 1px solid #f2f4f6; font-size: 9.5px; font-weight: 600; color: #9aa4af; text-align: center; padding: 5px 0; }
.gantt-day.weekend { background: #f4f7fa; }
.gantt-day.today { background: var(--primary-soft); }
.gantt-cells { display: flex; position: relative; height: 36px; }
.gantt-bar {
  position: absolute; top: 7px; height: 22px; border-radius: 6px; min-width: 10px;
  color: #fff; font-size: 10px; font-weight: 700; line-height: 22px; padding: 0 7px; overflow: hidden;
  white-space: nowrap; cursor: grab; display: flex; align-items: center; user-select: none;
  box-shadow: 0 1px 3px rgba(23, 30, 40, .22);
}
.gantt-bar:active { cursor: grabbing; }
.gantt-bar-txt { flex: 1; overflow: hidden; pointer-events: none; }
.gantt-resize { width: 8px; height: 100%; cursor: ew-resize; flex-shrink: 0; border-radius: 0 6px 6px 0; }
.gantt-resize:hover { background: rgba(255, 255, 255, .4); }
.gantt-empty { padding: 56px 40px; text-align: center; color: var(--muted); line-height: 1.9; }

/* ===== マイタスク・締切一覧 ===== */
.mytasks-wrap { flex: 1; overflow-y: auto; padding: 24px; }
.mytask-group { margin-bottom: 26px; }
.mytask-group h3 { font-size: 13.5px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; letter-spacing: .01em; }
.mytask-group h3 .dot { width: 11px; height: 11px; border-radius: 4px; }
.mytask-group h3.dl-overdue { color: var(--danger); }
.mytask-row {
  background: var(--panel); border-radius: 10px; box-shadow: var(--shadow-sm); padding: 12px 16px;
  margin-bottom: 8px; display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1px solid rgba(35, 39, 47, .04); transition: box-shadow .15s, border-color .15s, transform .15s;
}
.mytask-row:hover { box-shadow: var(--shadow-md); border-color: rgba(61, 111, 242, .35); transform: translateY(-1px); }
.mytask-row .list-tag {
  font-size: 11px; font-weight: 700; color: #57677a; background: #e7edf2;
  padding: 2.5px 10px; border-radius: 20px; flex-shrink: 0;
}
.mytask-row .t { flex: 1; font-weight: 600; }
.mytask-row .due { font-weight: 700; }
.empty-hint { color: var(--muted); text-align: center; padding: 64px 20px; line-height: 2; }

/* ===== KPI ===== */
.kpi-wrap { flex: 1; overflow-y: auto; padding: 24px; }
.kpi-tiles { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.kpi-tile {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 18px 22px; min-width: 140px; flex: 1; max-width: 230px;
  border: 1px solid rgba(35, 39, 47, .04);
}
.kpi-tile .v { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.kpi-tile .v .u { font-size: 14px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.kpi-tile .l { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.kpi-tile.alert .v { color: var(--danger); }
.kpi-grid { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.kpi-card {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 18px 20px; width: 308px; border: 1px solid rgba(35, 39, 47, .04);
  transition: box-shadow .15s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); }
.kpi-card.add {
  border: 1.5px dashed var(--border-strong); background: transparent; box-shadow: none; cursor: pointer;
  color: var(--muted); text-align: center; padding: 34px 18px; font-weight: 700; line-height: 1.9;
  transition: color .15s, border-color .15s;
}
.kpi-card.add:hover { color: var(--text); border-color: #b3bcc8; }
.kpi-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kpi-name { font-weight: 800; flex: 1; font-size: 14px; }
.kpi-badge.ok { font-size: 11px; font-weight: 800; color: var(--ok); background: rgba(48, 164, 108, .12); padding: 2.5px 9px; border-radius: 20px; }
.kpi-nums { display: flex; align-items: baseline; gap: 8px; }
.kpi-cur { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.kpi-cur .u { font-size: 14px; color: var(--muted); font-weight: 700; margin-left: 1px; }
.kpi-target { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi-pct { font-size: 12px; font-weight: 700; color: var(--muted); margin: -2px 0 6px; }
.kpi-record-add { display: flex; gap: 6px; margin-top: 10px; }
.kpi-record-add input { padding: 7px 9px; font-size: 12.5px; min-width: 0; }
.kpi-record-add input[type=number] { flex: 1; width: 70px; }
.kpi-last { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 8px; }
/* 添付ファイルリスト(本家Jooto風: 種類バッジ + ファイル名 + サイズ + 日時 + ×) */
.attach-list { display: flex; flex-direction: column; gap: 4px; }
.attach-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.attach-row:hover { background: var(--panel-2); }
.attach-row.hidden { display: none; }
.attach-ico { width: 30px; height: 34px; flex-shrink: 0; border: 1.5px solid #c7ced6; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 800; color: #6b7784; background: #fff; letter-spacing: .02em; }
.attach-ico.pdf { border-color: #e5484d; color: #e5484d; }
.attach-ico.image { border-color: #2e9e5b; color: #2e9e5b; }
.attach-ico.word { border-color: #2b5fd9; color: #2b5fd9; }
.attach-ico.excel { border-color: #1f8a4c; color: #1f8a4c; }
.attach-ico.ppt { border-color: #d9542b; color: #d9542b; }
.attach-name { color: var(--primary); text-decoration: none; word-break: break-all; cursor: pointer; }
.attach-name:hover { text-decoration: underline; }
.attach-size, .attach-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.attach-row .del { margin-left: auto; }
.attach-more { align-self: center; font-size: 13px; margin-top: 4px; }
@media (max-width: 640px) { .attach-date { display: none; } }
/* タスク複製ダイアログのキープ項目 */
.cp-keep { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.field .cp-keep label { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 500; color: inherit; margin: 0; letter-spacing: 0; cursor: pointer; }
.field .cp-keep input[type=checkbox] { width: 17px; height: 17px; padding: 0; margin: 0; accent-color: var(--primary); }
/* KPI内タスク(source=tasks) */
.kpi-tasks { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; max-height: 168px; overflow-y: auto; }
.kpi-task { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 8px; border-radius: 7px; cursor: pointer; background: var(--hover, rgba(120, 140, 160, .1)); }
.kpi-task:hover { background: rgba(120, 140, 160, .22); }
.kpi-task .tk-done { opacity: .55; text-decoration: line-through; }
.kpi-task-grip { flex-shrink: 0; cursor: grab; touch-action: none; color: var(--muted); font-size: 15px; padding: 6px 8px 6px 2px; margin: -4px 0; user-select: none; -webkit-user-select: none; }
.kpi-task-grip:active { cursor: grabbing; }
.kpi-task.dragging { opacity: .65; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.kpi-task-chk { flex-shrink: 0; cursor: pointer; padding: 6px 6px; margin: -4px 0; user-select: none; -webkit-user-select: none; }
.kpi-task .kt-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 日次入力KPI(コマ数など) */
.kpi-days { max-height: 240px; }
.kpi-day { cursor: default; padding: 2px 4px 2px 8px; }
.kpi-day .kt-title { cursor: pointer; }
.kpi-day.today { outline: 2px solid var(--primary); outline-offset: -2px; }
.kpi-day-in { width: 72px; flex-shrink: 0; text-align: right; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--card, #fff); color: inherit; }
.kpi-day-u { width: 2.4em; flex-shrink: 0; font-size: 11.5px; color: var(--muted); }
.kpi-month { font-size: 11.5px; color: var(--muted); margin: -2px 0 2px; }
.kpi-needtarget { font-size: 12px; background: #fff4d6; color: #7a5600; border-radius: 7px; padding: 6px 8px; margin: 4px 0 6px; cursor: pointer; }
.kpi-avg { font-size: 12.5px; margin: 2px 0 4px; }
.kpi-avg b { font-size: 15px; }
.kpi-avg span { color: var(--muted); font-size: 11.5px; }
.kpi-months { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* ===== モーダル ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(18, 24, 32, .52); display: flex;
  align-items: flex-start; justify-content: center; padding: 44px 16px; z-index: 100; overflow-y: auto;
  backdrop-filter: blur(3px); animation: fadeIn .14s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--panel); border-radius: 16px; width: 780px; max-width: 100%;
  padding: 26px 30px; box-shadow: var(--shadow-lg); animation: popIn .16s ease;
}
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal.sm { width: 460px; }
.modal-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.modal-head .title-input {
  flex: 1; font-size: 17px; font-weight: 800; border: 1px solid transparent; border-radius: 8px; padding: 7px 9px;
  background: transparent;
}
.modal-head .title-input:hover { border-color: var(--border); background: #fff; }
.modal-head .title-input:focus { background: #fff; }
.modal-close {
  border: none; background: none; font-size: 17px; color: var(--muted); padding: 6px 10px;
  border-radius: 8px; transition: background .13s, color .13s;
}
.modal-close:hover { background: var(--panel-2); color: var(--text); }
.field-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.field { flex: 1; min-width: 140px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 800; color: #43506b; margin-bottom: 7px;
  letter-spacing: .02em;
}
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; font-size: 14px; }
.field textarea { resize: vertical; min-height: 92px; line-height: 1.7; }
.label-picker { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 5px; }
.label-swatch {
  width: 34px; height: 22px; border-radius: 7px; cursor: pointer; border: 2px solid transparent;
  opacity: .45; transition: opacity .12s, transform .12s, border-color .12s;
}
.label-swatch:hover { opacity: .8; transform: scale(1.06); }
.label-swatch.on { opacity: 1; border-color: var(--text); }
.check-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; }
.check-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }
.check-row .txt { flex: 1; font-weight: 500; font-size: 14px; }
.check-row .txt.done { text-decoration: line-through; color: var(--muted); }
.check-row .del { border: none; background: none; color: var(--muted); cursor: pointer; visibility: hidden; border-radius: 6px; padding: 2px 6px; }
.check-row .del:hover { background: var(--panel-2); color: var(--danger); }
.check-row:hover .del { visibility: visible; }
.check-add { display: flex; gap: 8px; margin-top: 8px; }
.check-add input { flex: 1; padding: 8px 11px; }
.progress-track { height: 6px; background: #edeff2; border-radius: 4px; margin: 8px 0 12px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--grad); border-radius: 4px; transition: width .3s ease; }
.comment-item { display: flex; gap: 11px; margin-bottom: 16px; }
.tasklink { color: var(--primary); font-weight: 700; text-decoration: none; }
.tasklink:hover { text-decoration: underline; }
.comment-item.cmt-highlight .body { animation: cmtflash 2.4s ease; }
@keyframes cmtflash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 12% { box-shadow: 0 0 0 3px var(--primary); } }
.comment-item .body { flex: 1; background: var(--panel-2); border-radius: 12px; padding: 11px 15px; line-height: 1.7; font-size: 14px; }
.comment-item .who { font-size: 13.5px; font-weight: 800; margin-bottom: 5px; display: flex; gap: 8px; align-items: baseline; }
.comment-item .when { font-weight: 500; color: var(--muted); font-size: 12px; }
.comment-item .del { border: none; background: none; color: var(--muted); font-size: 11px; cursor: pointer; }
.comment-item .del:hover { color: var(--danger); }
.comment-add { display: flex; gap: 8px; margin-top: 10px; }
.comment-add input { flex: 1; padding: 12px 14px; font-size: 14px; }
.modal-section { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.modal-section > h4 { font-size: 13px; font-weight: 800; margin-bottom: 10px; letter-spacing: .01em; }
.modal-foot { display: flex; margin-top: 22px; gap: 10px; align-items: center; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f4f5f7; }
.member-row:last-of-type { border-bottom: none; }
.member-row .nm { flex: 1; font-weight: 600; }
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 5px; }
.color-dot {
  width: 26px; height: 26px; border-radius: 9px; cursor: pointer; border: 2.5px solid transparent;
  transition: transform .12s, border-color .12s;
}
.color-dot:hover { transform: scale(1.1); }
.color-dot.on { border-color: var(--text); }
#tm-follow.following { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ===== お知らせ ===== */
.notif-panel {
  position: fixed; left: 258px; top: 14px; width: 390px; max-height: 82vh; z-index: 90;
  background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; animation: popIn .16s ease;
}
.notif-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.notif-head b { flex: 1; font-size: 14px; }
.notif-list { overflow-y: auto; }
.notif-item { padding: 12px 18px; border-bottom: 1px solid #f4f5f7; cursor: pointer; transition: background .12s; }
.notif-item:hover { background: var(--panel-2); }
.notif-item.unread { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.notif-item .msg { font-size: 13px; font-weight: 500; line-height: 1.55; }
.notif-item .sub { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 4px; }

/* ===== 添付・共有ファイル ===== */
.attach-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.attach-item { width: 124px; }
.attach-item img {
  width: 124px; height: 82px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border);
  transition: transform .13s, box-shadow .13s; display: block;
}
.attach-item img:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }
.attach-item .attach-file {
  display: flex; align-items: center; justify-content: center; width: 124px; height: 82px;
  background: var(--panel-2); border-radius: 10px; font-size: 28px; text-decoration: none;
  border: 1px solid var(--border); transition: background .13s, box-shadow .13s;
}
.attach-item .attach-file:hover { background: #eef0f3; box-shadow: var(--shadow-sm); }
.attach-meta { display: flex; align-items: center; gap: 4px; font-size: 11px; margin-top: 5px; }
.attach-meta a { color: var(--text); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.attach-meta a:hover { color: var(--primary); }
.attach-meta span { color: var(--muted); flex-shrink: 0; }
.attach-meta .del { border: none; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; }
.attach-meta .del:hover { color: var(--danger); }
.attach-add {
  display: inline-block; padding: 9px 16px; border: 1.5px dashed var(--border-strong); border-radius: 9px;
  color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600;
  transition: color .15s, border-color .15s;
}
.attach-add:hover { color: var(--text); border-color: #b3bcc8; }
/* クリップ(添付)アイコン: 絵文字の代わりのSVG。テキストと綺麗に揃える */
.ico-clip { vertical-align: -3px; }
.clip-badge { display: inline-flex; align-items: center; gap: 3px; }
.clip-badge .ico-clip { width: 12px; height: 12px; vertical-align: 0; }
.cmt-file .ico-clip { width: 13px; height: 13px; vertical-align: -2px; }

/* ===== その他 ===== */
.mention { color: var(--primary); font-weight: 800; background: var(--primary-soft); border-radius: 4px; padding: 0 4px; }
.act-list { max-height: 60vh; overflow-y: auto; }
.act-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f4f5f7; font-size: 13px; align-items: flex-start; }
.act-row .when { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 3px; }

/* ===== ファイルプレビュー ===== */
.preview-overlay {
  position: fixed; inset: 0; background: rgba(12, 17, 24, .88); z-index: 150;
  display: flex; flex-direction: column; animation: fadeIn .14s ease; backdrop-filter: blur(4px);
}
.pv-head { display: flex; align-items: center; gap: 14px; padding: 13px 22px; }
.pv-name { color: #fff; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-dl { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255, 255, 255, .25); text-decoration: none; font-size: 13px; }
.pv-dl:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.pv-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.pv-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 24px 24px; min-height: 0; }
.pv-body img { max-width: 94%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 16px 56px rgba(0, 0, 0, .55); }
.pv-body video { max-width: 94%; max-height: 100%; border-radius: 10px; }
.pv-body iframe { width: 94%; height: 100%; border: none; border-radius: 10px; background: #fff; }

/* ===== トースト ===== */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: #24384c; color: #fff; padding: 11px 24px; border-radius: 12px; z-index: 200;
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600;
  animation: toastIn .18s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== モバイル対応 ===== */
.menu-toggle {
  display: none; position: fixed; top: 10px; left: 10px; z-index: 60;
  background: var(--primary); color: #fff; border: none; border-radius: 10px;
  width: 40px; height: 40px; font-size: 17px; box-shadow: var(--shadow-md);
}
@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 55; width: 254px;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 8px 0 32px rgba(0, 0, 0, .35);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .42); z-index: 50; }
  .main { width: 100%; }
  .topbar { padding: 10px 12px 10px 58px; gap: 7px; }
  .topbar h2 { font-size: 15px; width: 100%; }
  .topbar .btn-ghost { padding: 5px 9px; font-size: 12px; }
  .member-avatars { display: none; }
  .view-tabs button { padding: 5px 11px; font-size: 12.5px; }
  .filterbar { padding: 8px 12px; gap: 6px; overflow-x: auto; flex-wrap: nowrap; }
  .filterbar #f-q { width: 140px; flex-shrink: 0; }
  .filterbar select { flex-shrink: 0; }
  .board-scroll { padding: 12px; -webkit-overflow-scrolling: touch; }
  .list-col { width: 82vw; max-width: 320px; }
  .add-list-col { width: 60vw; }
  .modal-overlay { padding: 12px 8px; }
  .modal { padding: 18px 16px; width: 100%; border-radius: 14px; }
  .field-row { gap: 8px; }
  .gantt-wrap { padding: 12px; }
  .gantt-label { width: 124px; font-size: 11px; }
  .mytasks-wrap, .kpi-wrap { padding: 14px; }
  .mytask-row { flex-wrap: wrap; gap: 8px; padding: 11px 13px; }
  .kpi-card { width: 100%; }
  .kpi-tile { min-width: 40%; padding: 13px 16px; }
  .kpi-tile .v { font-size: 23px; }
  .notif-panel { left: 8px; right: 8px; width: auto; top: 58px; }
  .attach-grid { gap: 8px; }
  .attach-item, .attach-item img, .attach-item .attach-file { width: 104px; }
  .pv-body { padding: 0 10px 12px; }
  .pv-body img, .pv-body video, .pv-body iframe { max-width: 100%; width: 100%; }
}

/* ==================== v2: Jooto同等機能のスタイル ==================== */
/* 名前付きラベルチップ */
.label-chip.named { height: auto; width: auto; color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 10px; line-height: 1.5; white-space: nowrap; }
.label-chip.named.pick { cursor: pointer; opacity: .38; user-select: none; }
.label-chip.named.pick.on { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px currentColor; }
.label-picker.named { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 5px; }

/* カードのサムネイル */
.card-thumb { margin: -4px -4px 8px; border-radius: 8px 8px 4px 4px; overflow: hidden; height: 84px; background: var(--panel-2); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* タスク番号・状態アイコン・工数 */
.task-num { color: var(--muted); font-size: 11px; font-weight: 600; }
.task-num.lg { font-size: 15px; align-self: center; margin-right: 2px; }
.st-icon { margin-right: 4px; font-size: 12px; }
.st-icon.st-done { color: #2da44e; }
.st-icon.st-hold { color: #b98a00; }
.st-icon.st-cancel { color: var(--danger); }
.effort-badge { font-variant-numeric: tabular-nums; }
.list-effort { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.spacer-mini { flex: 1; }

/* 複数担当者アバター(重ね表示) */
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar { margin-left: -7px; box-shadow: 0 0 0 2px #fff; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar.sm.more { background: #8595a5; font-size: 9.5px; }

/* 担当者ピッカー(モーダル内) */
.member-picker { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 5px; }
.member-chip { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--border); border-radius: 16px; padding: 3px 11px 3px 4px; font-size: 12.5px; font-weight: 600; cursor: pointer; user-select: none; color: var(--muted); }
.member-chip.on { border-color: var(--primary); background: rgba(30, 155, 230, .09); color: var(--text); }

/* チェックリスト(複数・タイトル付き) */
.checklist-block { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.cl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cl-title { flex: 1; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; font-weight: 700; font-size: 13.5px; background: transparent; min-width: 60px; }
.cl-title:hover, .cl-title:focus { border-color: var(--border); background: #fff; }
.cl-count { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.cl-mini { font-size: 11px; padding: 3px 8px; }
.cl-head .del { border: none; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; padding: 2px 6px; }
.cl-head .del:hover { background: var(--panel-2); color: var(--danger); }
.chk-date { border: 1px solid transparent; border-radius: 6px; font-size: 11px; color: var(--muted); width: 108px; padding: 2px 4px; background: transparent; }
.chk-date:hover, .chk-date:focus { border-color: var(--border); background: #fff; }
.chk-asg { border: 1px solid transparent; border-radius: 6px; font-size: 11px; color: var(--muted); max-width: 82px; padding: 2px 2px; background: transparent; }
.chk-asg:hover, .chk-asg:focus { border-color: var(--border); background: #fff; }
/* 項目ごとの期日・担当は普段は隠す。設定済み(.set)・行にホバー・フォーカス中のときだけ表示してスッキリさせる */
.chk-date, .chk-asg { display: none; }
.chk-date.set, .chk-asg.set,
.check-row:hover .chk-date, .check-row:hover .chk-asg,
.check-row:focus-within .chk-date, .check-row:focus-within .chk-asg { display: inline-block; }
.cl-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.cl-actions select { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; }

/* ラベル管理モーダル */
.modal-overlay.keep { z-index: 130; }
.lm-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--panel-2); }
.lm-row.add { border-bottom: none; margin-top: 6px; }
.lm-name { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; min-width: 90px; }
.lm-colors { display: flex; gap: 5px; flex-wrap: wrap; }
.lm-row .del { border: none; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; padding: 2px 7px; }
.lm-row .del:hover { background: var(--panel-2); color: var(--danger); }

@media (max-width: 760px) {
  .chk-date { width: 96px; }
  .member-chip { padding: 3px 9px 3px 3px; font-size: 12px; }
}

/* コメントの改行を保持して表示 */
.comment-item .body .cmt-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.78; }

/* コメント内リンク */
.cmt-text a { color: var(--primary); word-break: break-all; }
.cmt-text a.jlink { display: inline-block; background: rgba(30,155,230,.1); border: 1px solid rgba(30,155,230,.35); border-radius: 7px; padding: 2px 9px; font-size: 12px; font-weight: 600; text-decoration: none; margin: 2px 0; }
.cmt-text a.jlink:hover { background: rgba(30,155,230,.18); }

/* ワンクリック完了ボタン */
.qdone { width: 19px; height: 19px; border-radius: 50%; border: 1.6px solid #c3ccd4; background: #fff; color: transparent; font-size: 11px; line-height: 1; cursor: pointer; margin-right: 7px; flex-shrink: 0; vertical-align: -3px; padding: 0; transition: all .12s; }
.qdone:hover { border-color: #2da44e; color: #2da44e; }
.qdone.on { background: #2da44e; border-color: #2da44e; color: #fff; }
.qdone.on:hover { background: #d1372f; border-color: #d1372f; }

/* プロジェクト並び替え */
#side-projects .side-item { cursor: grab; }
#side-projects .side-item.dragging-proj { opacity: .45; cursor: grabbing; }

/* ==================== ダッシュボード ==================== */
.dash-wrap { padding: 18px 22px; overflow-y: auto; height: 100%; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1240px; }
.dash-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; min-height: 120px; box-shadow: 0 1px 3px rgba(16,42,67,.05); }
.dash-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dash-head h3 { font-size: 14.5px; font-weight: 800; flex: 1; }
.dash-add { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-size: 16px; cursor: pointer; color: var(--muted); line-height: 1; }
.dash-add:hover { color: var(--primary); border-color: var(--primary); }
.dash-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.dash-tab { font-size: 12px; font-weight: 600; color: var(--muted); padding: 3px 10px; border-radius: 14px; cursor: pointer; }
.dash-tab:hover { background: var(--panel-2); }
.dash-tab.on { background: var(--primary); color: #fff; }
/* ブックマーク */
.bm-row { display: flex; gap: 10px; flex-wrap: wrap; }
.bm-tile { position: relative; width: 92px; }
.bm-tile a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 9px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); }
.bm-tile a:hover { border-color: var(--primary); background: rgba(30,155,230,.05); }
.bm-icon { font-size: 22px; }
.bm-name { font-size: 11px; font-weight: 600; text-align: center; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bm-tile .del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 10px; cursor: pointer; visibility: hidden; padding: 0; }
.bm-tile:hover .del { visibility: visible; }
.bm-tile .del:hover { color: var(--danger); border-color: var(--danger); }
/* 掲示板 */
.post-list { max-height: 260px; overflow-y: auto; }
.post-item { border-bottom: 1px solid var(--panel-2); padding: 8px 2px; }
.post-item:last-child { border-bottom: none; }
.post-title { font-weight: 700; font-size: 13px; display: flex; align-items: center; }
.post-title .del { margin-left: auto; border: none; background: none; color: var(--muted); cursor: pointer; visibility: hidden; border-radius: 6px; padding: 2px 6px; }
.post-item:hover .del { visibility: visible; }
.post-title .del:hover { color: var(--danger); background: var(--panel-2); }
.post-body { font-size: 12.5px; color: var(--text); white-space: pre-wrap; word-break: break-word; margin-top: 3px; }
/* 未完了タスクテーブル */
.dash-tasks { max-height: 340px; overflow-y: auto; }
.dash-task-head { display: none; }
.dash-task-row { display: grid !important; grid-template-columns: 84px 1fr; gap: 10px; align-items: flex-start; margin: 0 !important; border-radius: 0 !important; border-bottom: 1px solid var(--panel-2); padding: 8px 10px !important; }
.dash-task-row .due { font-size: 11.5px; }
.dash-task-row .t { font-weight: 600; font-size: 12.5px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.dash-task-row .dt-main { min-width: 0; }
.dash-task-row .dt-sub { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 10.5px; color: var(--muted); overflow: hidden; white-space: nowrap; }
.dash-task-row .dt-sub .dt-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.dash-task-row .dt-sub .dt-sep { color: #c2c9d2; }
.dash-task-row .list-tag { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.proj-tag { color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* お知らせフィード */
.feed-list { max-height: 340px; overflow-y: auto; }
.feed-item { border-bottom: 1px solid var(--panel-2); padding: 9px 10px !important; margin: 0 !important; border-radius: 0 !important; cursor: pointer; }
.feed-crumb { font-size: 11px; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.feed-body-row { display: flex; gap: 8px; align-items: flex-start; }
.feed-main { flex: 1; min-width: 0; }
.feed-who { font-size: 12px; font-weight: 700; }
.feed-who .when { color: var(--muted); font-weight: 400; font-size: 11px; }
.feed-body { font-size: 12.5px; white-space: pre-wrap; word-break: break-word; color: var(--text); }
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-task-row { grid-template-columns: 74px 1fr; }
}

/* 未読の赤丸 */
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e0533d; margin-right: 6px; vertical-align: 1px; }
.feed-item.unread { background: rgba(224, 83, 61, .045); }
.tab-badge { display: inline-block; background: #e0533d; color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 5px; margin-left: 4px; line-height: 15px; vertical-align: 1px; }
.dash-tab.on .tab-badge { background: #fff; color: var(--primary); }

/* ファイル一覧のタスクリンク */
.file-task-link { display: block; font-size: 10.5px; color: var(--primary); font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-task-link:hover { text-decoration: underline; }

/* ==================== v3: 全体検索・横断ビュー・リアクション等 ==================== */
.side-search { padding: 4px 12px 8px; }
.side-search input { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; background: var(--panel-2); }
.side-search input:focus { background: #fff; }
.fav-star { color: #d8b60a; font-size: 13px; visibility: hidden; cursor: pointer; padding: 0 2px; }
.side-item:hover .fav-star { visibility: visible; }
.fav-star.on { visibility: visible; }
.gantt-group { font-weight: 800; font-size: 12px; }

/* リアクション */
/* リアクションボタンは常時表示(スマホはホバーが無いため。Jooto同様いつでも押せる) */
.react-btn { visibility: visible; opacity: .55; }
.comment-item:hover .react-btn, .react-btn:hover { opacity: 1; }
.react-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
.react-chip { font-size: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 1px 8px; cursor: pointer; background: #fff; user-select: none; }
.react-chip.mine { border-color: var(--primary); background: rgba(30,155,230,.08); }
.react-chip:hover { border-color: var(--primary); }
.react-palette { position: absolute; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 6px 8px; display: flex; gap: 6px; box-shadow: 0 6px 18px rgba(16,42,67,.14); z-index: 20; }
.comment-item .body { position: relative; }
.react-pick { cursor: pointer; font-size: 17px; }
.react-pick:hover { transform: scale(1.25); }

/* コメント添付 */
.comment-add { display: flex; flex-direction: column; gap: 8px; align-items: stretch; margin-top: 10px; }
.comment-add textarea#tm-newcomment { width: 100%; min-height: 130px; max-height: 400px; padding: 12px 14px; font-size: 14px; line-height: 1.7; resize: vertical; font-family: inherit; border-radius: 10px; }
.comment-add-actions { display: flex; gap: 8px; align-items: center; }
.comment-add-actions .cmt-hint { font-size: 11.5px; color: var(--muted); }
.cmt-attach-btn { padding: 7px 12px; font-size: 12.5px; }
#tm-postcomment { padding: 8px 20px; font-size: 13.5px; }
.cmt-files { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.cmt-file { font-size: 12px; color: var(--primary); text-decoration: none; }
.cmt-file:hover { text-decoration: underline; }
.cmt-file span { color: var(--muted); }
.cmt-edit-area { width: 100%; min-height: 70px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; font-size: 13px; font-family: inherit; }

/* ===== AIチャットウィジェット ===== */
#aichat-fab {
  position: fixed; right: 18px; bottom: 18px; width: 50px; height: 50px; border-radius: 50%;
  border: none; background: var(--grad); color: #fff; font-size: 23px; cursor: pointer;
  box-shadow: var(--shadow-md); z-index: 900; transition: transform .15s, box-shadow .15s;
}
#aichat-fab:hover { transform: scale(1.07); box-shadow: var(--shadow-lg); }
#aichat-panel {
  position: fixed; right: 18px; bottom: 78px; width: 370px; max-width: calc(100vw - 24px);
  height: 500px; max-height: 72vh; background: var(--panel); border-radius: 14px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; z-index: 901;
  border: 1px solid var(--border);
}
.ac-head { padding: 11px 14px; font-weight: 800; font-size: 13.5px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.ac-head .ac-hint { font-weight: 400; font-size: 10.5px; color: var(--muted); flex: 1; }
.ac-head button { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 14px; }
.ac-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.ac-msg { max-width: 88%; padding: 8px 11px; border-radius: 12px; font-size: 13px; line-height: 1.55; word-break: break-word; }
.ac-msg.user { align-self: flex-end; background: var(--primary-soft); border-bottom-right-radius: 4px; }
.ac-msg.ai { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ac-msg.ai.pending { color: var(--muted); font-size: 12px; border-style: dashed; }
.ac-inputrow { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.ac-inputrow textarea { flex: 1; resize: none; padding: 8px 10px; font-size: 13px; }
.ac-inputrow .btn-primary { padding: 6px 14px; align-self: flex-end; }

/* ===== サイドバー折りたたみ & プロジェクトアイコン ===== */
.side-item .picon { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.brand #side-fold {
  margin-left: auto; border: none; background: none; color: var(--muted); cursor: pointer;
  font-size: 15px; font-weight: 800; padding: 2px 8px; border-radius: 6px;
}
.brand #side-fold:hover { background: var(--panel-2); color: var(--text); }
#side-unfold {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 80;
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font-size: 17px; box-shadow: var(--shadow-sm);
}
body.side-fold .sidebar { display: none; }
body.side-fold #side-unfold { display: block; }
body.side-fold .content, body.side-fold .main { padding-left: 0; }
@media (max-width: 900px) { #side-unfold { display: none !important; } body.side-fold .sidebar { display: flex; } }

/* ===== リスト2段表示 ===== */
.board.two-rows {
  display: grid;
  grid-auto-flow: column dense; /* 折り畳み棒(縦フル)の手前で通常リストが単独になった場合、後続の通常リストがその下を埋める */
  grid-template-rows: repeat(2, minmax(0, 1fr));
  grid-auto-columns: max-content; /* 折り畳んだリスト(40px)は40px分だけ場所を取る */
  gap: 14px 16px;
  height: 100%;
  align-items: stretch;
}
.board.two-rows .list-col { width: 296px; height: 100%; max-height: none; min-height: 0; }
.board.two-rows .add-list-col { grid-row: span 2; align-self: flex-start; }

/* ===== リスト並び切替(共通/マイ) ===== */
.scroll-jump { display: flex; gap: 4px; flex-shrink: 0; }
.flt-toggle { border: 1px solid var(--border); }
.flt-toggle.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); font-weight: 700; }
.order-seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.order-seg button { border: none; background: var(--panel); color: var(--muted); font-size: 12px; font-weight: 700; padding: 5px 11px; }
.order-seg button.on { background: var(--primary-soft); color: var(--primary); }
.list-col.list-dragging { opacity: .45; }
.list-col.list-drop-left { box-shadow: -3px 0 0 0 var(--primary); }
.list-col.list-drop-right { box-shadow: 3px 0 0 0 var(--primary); }
.list-head[draggable="true"] { cursor: grab; }

/* ===== ダークモード ===== */
body.dark {
  --bg: #14181e;
  --panel: #1d232b;
  --panel-2: #262d36;
  --border: #323a45;
  --border-strong: #434e5b;
  --text: #e8edf3;
  --muted: #96a2b0;
  --primary: #4db2f0;
  --primary-soft: rgba(77, 178, 240, .16);
  --sidebar-bg: #181d24;
  --sidebar-text: #aeb8c3;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 5px rgba(0, 0, 0, .25);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);
}
body.dark input, body.dark textarea, body.dark select { background: #262d36; color: var(--text); }
body.dark ::placeholder { color: #6b7784; }
body.dark ::-webkit-scrollbar-thumb { background: #49525e; }
body.dark .sidebar::-webkit-scrollbar-thumb { background: #49525e; }
body.dark .side-item .cnt { background: #2b333e; }
body.dark .view-tabs { background: #232a33; }
body.dark .list-col { background: #20262e; }
body.dark .add-list-col { background: rgba(255, 255, 255, .04); border-color: #3a434e; color: #aeb6c0; }
body.dark .add-list-col:hover { background: rgba(255, 255, 255, .09); border-color: #59636f; color: #fff; }
body.dark .list-head .task-count { background: rgba(255, 255, 255, .08); color: var(--muted); }
body.dark .list-menu-btn:hover { background: rgba(255, 255, 255, .08); }
body.dark .list-opts { background: rgba(255, 255, 255, .04); border-bottom-color: rgba(255, 255, 255, .06); }
body.dark .card { border-color: rgba(255, 255, 255, .06); }
body.dark .card .due { background: rgba(255, 255, 255, .09); color: #c9d3dd; }
body.dark .st-badge.cancel { background: rgba(255, 255, 255, .09); }
body.dark .add-card-btn:hover { background: rgba(255, 255, 255, .06); }
body.dark .gantt-row:not(.head):hover { background: #20262e; }
body.dark .gantt-day.weekend { background: #1a2027; }
body.dark .mytask-row .list-tag, body.dark .list-tag { background: #2b333e; color: #aab6c2; }
body.dark .btn-ghost { background: var(--panel); color: #c6d0da; border-color: var(--border); }
body.dark .btn-ghost:hover { background: var(--panel-2); }
body.dark .modal-head .title-input:hover { background: var(--panel-2); }
body.dark .brand { color: var(--text); }
body.dark .side-user .info { color: var(--text); }
body.dark .order-seg button { background: var(--panel); }
body.dark .order-seg button.on { background: var(--primary-soft); color: var(--primary); }
body.dark #side-unfold { background: var(--panel); color: var(--text); }
body.dark .ac-msg.ai { background: var(--panel-2); border-color: var(--border); }
body.dark .dash-task-row .dt-sub .dt-sep { color: #55606c; }

/* ---------- Jooto風コンパクトなタスク画面 ---------- */
/* ヘッダーの状態ピル(Jootoの「● 進行中 ▼」相当) */
.status-pill {
  appearance: none; -webkit-appearance: none;
  border: none; border-radius: 16px; cursor: pointer;
  padding: 6px 26px 6px 14px; font-size: 12.5px; font-weight: 700; color: #fff;
  background: #1e9be6 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6"><path d="M0 0l5 6 5-6z" fill="white"/></svg>') no-repeat right 10px center;
  flex: 0 0 auto;
}
.status-pill.st-open { background-color: #1e9be6; }
.status-pill.st-done { background-color: #2e9e5b; }
.status-pill.st-hold { background-color: #e8a13c; }
.status-pill.st-cancel { background-color: #9aa4ae; }
.status-pill option { color: #333; background: #fff; font-weight: 400; }

/* 5項目を1行に収める(入り切らなければ折り返す) */
.field-row.compact .field { min-width: 112px; }

/* 色・ラベルは選択中のものだけ表示。「変更」「＋追加/変更」で全候補を開閉 */
#tm-colors.collapsed .color-dot:not(.on) { display: none; }
#tm-labels.collapsed .label-chip:not(.on) { display: none; }

/* チェックリストの折り畳み */
.checklist-block.folded > *:not(.cl-head) { display: none !important; }
.cl-fold { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 12px; padding: 2px 4px; border-radius: 6px; }
.cl-fold:hover { background: var(--panel-2); }

/* 絵文字パレットをコメント操作列の近くに出す */
.comment-add-actions { position: relative; }

/* ---------- リストの折り畳み(Jooto風) ---------- */
.list-fold-btn { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 2px 5px; border-radius: 6px; flex-shrink: 0; }
.list-fold-btn:hover { background: var(--panel-2); color: var(--ink); }
.list-col.folded {
  width: 40px; min-width: 40px; max-width: 40px; cursor: pointer;
  padding: 8px 0; align-self: flex-start; min-height: 220px;
}
.list-col.folded:hover { background: var(--panel-2); }
.folded-body { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 4px; flex: 1; min-height: 0; }
.folded-body .fold-name {
  writing-mode: vertical-rl; font-weight: 700; font-size: 12.5px; color: var(--ink);
  flex: 1; min-height: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.board.two-rows .list-col.folded { width: 40px; min-width: 40px; max-width: 40px; min-height: 0; height: 100%; grid-row: span 2; /* 1段表示と同じ順序で横並びの縦棒。通常リストだけが2段にペアされる */ }
.react-row { align-items: center; }

/* ---------- ユーザーのアイコン画像 ---------- */
.avatar.pic { background: #dfe3e8; overflow: hidden; padding: 0; }
.avatar.pic img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }

/* ---------- Jooto風メニュー(リスト⋯/カード⋯) ---------- */
.jmenu { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 6px 0; box-shadow: 0 8px 24px rgba(16,42,67,.16); }
.jmenu .jmenu-title { font-size: 12px; font-weight: 800; color: var(--muted); padding: 6px 14px 4px; }
.jmenu .jmenu-item { display: block; width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 8px 14px; font-size: 13px; color: var(--ink); }
.jmenu .jmenu-item:hover { background: var(--panel-2); }
.jmenu .jmenu-item.danger { color: var(--danger); }
.jmenu .jmenu-sep { border-top: 1px solid var(--border); margin: 4px 0; }
.jmenu .lo-edit { padding: 8px 14px 4px; border-top: 1px solid var(--border); margin-top: 4px; }
.list-opts.jmenu { position: absolute; right: 6px; top: 40px; z-index: 30; width: 210px; }
.list-col { position: relative; }
.jmenu.floating { z-index: 200; width: 190px; }
body.dark .jmenu { background: #262c34; }
body.dark .jmenu .jmenu-item:hover { background: #2f3640; }

/* カードの⋯ボタン */
.card { position: relative; }
.card-menu-btn { position: absolute; top: 4px; right: 6px; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 4px; border-radius: 6px; visibility: hidden; z-index: 5; }
.card:hover .card-menu-btn { visibility: visible; }
.card-menu-btn:hover { background: var(--panel-2); color: var(--ink); }

/* カードの折り畳み(タイトル行だけ表示) */
.card.cfolded { padding: 6px 11px; }
.card.cfolded .meta, .card.cfolded .labels, .card.cfolded .card-thumb { display: none; }
.card.cfolded .title { margin-bottom: 0; font-size: 12.5px; }

/* ---------- ファイルの一覧表示(アイコン無し・名前と種類が全部見える) ---------- */
.file-rows { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.file-row { display: flex; gap: 10px; align-items: center; padding: 7px 12px; border-top: 1px solid var(--border); font-size: 13px; }
.file-row:first-child { border-top: none; }
.file-row.head { background: var(--panel-2); font-weight: 700; font-size: 11.5px; color: var(--muted); }
.file-row:not(.head):hover { background: var(--panel-2); }
.fr-name { flex: 1; min-width: 0; word-break: break-all; color: var(--primary); text-decoration: none; cursor: pointer; }
.fr-name:hover { text-decoration: underline; }
.fr-type { width: 84px; flex-shrink: 0; }
.fr-size { width: 68px; flex-shrink: 0; text-align: right; color: var(--muted); font-size: 12px; }
.fr-date { width: 72px; flex-shrink: 0; color: var(--muted); font-size: 12px; }
.fr-src { width: 168px; flex-shrink: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-src a { cursor: pointer; color: var(--primary); }
@media (max-width: 640px) { .fr-date, .fr-src { display: none; } }

/* コメント内の画像プレビュー(添付写真をコメントの中にそのまま表示) */
.cmt-img { max-width: 270px; max-height: 200px; border-radius: 6px; display: block; border: 1px solid var(--border); }
/* コメント内の添付(本家Jooto風): 画像はサムネの右にファイル名(サイズ)・プレビュー・×、ファイルは種類バッジ+名前+ダウンロード */
.cmt-att { display: flex; align-items: flex-end; gap: 10px; margin-top: 8px; }
.cmt-att.file { align-items: center; }
.cmt-att-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.cmt-att-meta.col { flex-direction: column; align-items: flex-start; gap: 2px; }
.cmt-att-meta .row { display: flex; align-items: center; gap: 8px; }
.cmt-att-name { color: var(--text, inherit); word-break: break-all; }
.cmt-att-pv { cursor: pointer; font-size: 14px; color: var(--muted); }
.cmt-att-pv:hover { color: var(--primary); }
.cmt-att-dl { color: var(--primary); text-decoration: underline; font-size: 12px; }
.cmt-att .del { font-size: 14px; }
.cmt-imglink { display: inline-block; }

/* 添付予定プレビュー(コメント投稿前) */
.pend-note { font-size: 12.5px; color: var(--ink); background: rgba(30,155,230,.08); border: 1px solid rgba(30,155,230,.3); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.pend-files { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pend-chip { position: relative; display: inline-flex; align-items: center; }
.pend-chip img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.pend-chip.file { font-size: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 24px 6px 10px; background: var(--panel-2); }
.pend-chip .del { position: absolute; top: -6px; right: -6px; background: #fff; border: 1px solid var(--border); border-radius: 50%; width: 20px; height: 20px; line-height: 1; cursor: pointer; font-size: 11px; }
/* 担当者ピッカーの「👥 全員」ボタン */
.member-chip.all { border-style: dashed; font-weight: 700; cursor: pointer; }

/* ファイルのドラッグ&ドロップ添付: モーダル全体→タスクに添付、コメント欄→コメントの添付予定 */
.modal.dropping { outline: 3px dashed #1e9be6; outline-offset: -6px; position: relative; }
.modal.dropping::after {
  content: 'ここにドロップでタスクに添付'; position: sticky; bottom: 12px; left: 0; right: 0; display: block; margin: 8px auto 0; width: max-content;
  background: #1e9be6; color: #fff; font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 999px; box-shadow: var(--shadow-lg); pointer-events: none; z-index: 5;
}
.modal.dropping .comment-add.dropping { outline: 3px dashed #3cb371; outline-offset: 4px; border-radius: 10px; background: rgba(60,179,113,.08); }
.modal.dropping .comment-add.dropping::after { content: 'ここにドロップでコメントに添付(投稿で送信)'; font-size: 12.5px; color: #2e8b57; font-weight: 600; }
.modal.dropping * { pointer-events: none; } /* 子要素の上で dragleave が連発しないようにする */
.pv-rot { color: #fff; border-color: rgba(255,255,255,.35); padding: 4px 10px; font-size: 12.5px; }
.pv-rot:hover { background: rgba(255,255,255,.12); color: #fff; }
@media (max-width: 640px) { .pv-head { flex-wrap: wrap; gap: 8px; padding: 10px 12px; } .pv-name { flex-basis: 100%; } }
.add-card-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.add-card-actions .add-card-submit { padding: 8px 16px; font-size: 13.5px; }
.add-card-actions .add-card-cancel { padding: 8px 10px; }
.add-card-hint { font-size: 11px; color: var(--muted); margin-left: auto; }
@media (pointer: coarse) { .add-card-hint { display: none; } .add-card-actions .add-card-submit { padding: 10px 20px; font-size: 14.5px; } }
/* スマホでリスト見出し/カードを長押ししても「コピー」の吹き出しや文字選択が出ないようにする */
.list-head, .list-head .list-name, .card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
body.list-touch-dragging { overscroll-behavior: none; }
body.list-touch-dragging .board-scroll { touch-action: none; }

/* スマホ: タスク詳細の見出し行を2段に(1段目: 番号+タイトル+✕、2段目: 状態・リンク・フォロー)。以前は横に並べきれず状態/リンク/フォロー/✕が画面外にはみ出していた */
@media (max-width: 760px) {
  .modal-head { flex-wrap: wrap; gap: 8px; }
  .modal-head .title-input { flex: 1 1 60%; min-width: 0; font-size: 16px; }
  .modal-head .task-num.lg { order: 0; }
  .modal-head .modal-close { order: 1; }
  .modal-head #tm-status, .modal-head #tm-copylink, .modal-head #tm-follow { order: 2; }
  .modal-head #tm-status { margin-left: 0; }
  .modal-head #tm-copylink, .modal-head #tm-follow { padding: 6px 10px; font-size: 12.5px; }
  .modal .modal-head + .field-row { margin-top: 4px; }
}
/* タスク名は複数行(高さ自動)。長い名前が途中で切れない */
.modal-head textarea.title-input { resize: none; overflow: hidden; line-height: 1.35; min-height: 0; font-family: inherit; white-space: pre-wrap; word-break: break-word; }

/* 添付一覧: コメント由来の印 */
.attach-from { cursor: pointer; text-decoration: none; font-size: 13px; flex-shrink: 0; }
.comment-item.hl { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 10px; transition: outline-color .6s; }

/* スマホ: タスク詳細の固定✕(スクロールして上部の✕が隠れたら出る) */
.modal-float-close { display: none; }
@media (max-width: 760px) {
  .modal-float-close { position: fixed; top: 10px; right: 10px; z-index: 120; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(27,36,48,.82); color: #fff; font-size: 18px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .15s; display: block; }
  .modal-float-close.show { opacity: 1; pointer-events: auto; }
}

/* 開始日・締切日の欄が枠からはみ出さないように(日付入力は最小幅が大きいため列を広めに確保し、入力自体は枠内に収める) */
.field input[type="date"] { min-width: 0; max-width: 100%; }
.field-row.compact .field { min-width: 150px; }
.field-row.compact .field input, .field-row.compact .field select { width: 100%; min-width: 0; }
.kpi-grip { cursor: grab; touch-action: none; color: var(--muted); font-size: 15px; padding: 2px 6px 2px 0; user-select: none; -webkit-user-select: none; }
.kpi-card.dragging { opacity: .6; outline: 2px dashed var(--primary); }
body.card-touch-dragging { overscroll-behavior: none; }
body.card-touch-dragging .board-scroll, body.card-touch-dragging [data-listbody] { touch-action: none; }
.check-add-btn { flex-shrink: 0; padding: 7px 12px; font-size: 12.5px; white-space: nowrap; }

/* カードの担当者表示(アイコン+名前。4人以上は +N) */
.card-asg { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; align-items: center; }
.asg-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; max-width: 100%; }
.asg-chip .avatar.sm { width: 18px; height: 18px; font-size: 8px; }
.asg-chip .asg-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 7em; }
.asg-chip.more { color: var(--muted); font-size: 11px; }
.card.is-done .asg-chip { opacity: .6; }

/* ==================== 回覧 ==================== */
.circ-badge { color: #b3261e; font-weight: 700; }
.circ-badge.me { color: #2da44e; }
.st-badge.circ { background: #fdecea; color: #b3261e; }
.circ-panel { border: 1px solid #f3c3bf; background: #fff6f5; border-radius: 12px; padding: 12px 14px; margin: 4px 0 12px; }
.circ-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.circ-title { font-weight: 700; font-size: 15px; flex: 1; min-width: 160px; }
.circ-ack { font-size: 15px; padding: 10px 18px; }
.circ-people { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 13px; }
.circ-person { color: var(--muted); }
.circ-person.ok { color: #2da44e; }
.circ-person .when { color: var(--muted); font-size: 11px; margin-left: 4px; }
.circ-hint { color: var(--muted); font-size: 11.5px; margin-top: 8px; }
.circ-shoot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.circ-shoot label { cursor: pointer; }
.circ-cam { font-size: 15px; padding: 10px 18px; }
.circ-shoot-hint { color: var(--muted); font-size: 11.5px; flex-basis: 100%; }
.circ-files { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.circ-file { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.circ-file img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: #eee; }
.circ-file .circ-pdf { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; font-size: 26px; background: #f2f4f7; border-radius: 6px; }
.circ-file .nm { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.circ-file .del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
@media (max-width: 760px) {
  .circ-cam, .circ-ack { width: 100%; text-align: center; }
  .circ-shoot > label.btn-ghost { flex: 1; text-align: center; }
}

/* ==================== 組織(2026-10-01) ==================== */
.org-bar { display: flex; align-items: center; gap: 6px; padding: 0 12px 8px; }
.org-bar select { flex: 1; min-width: 0; font-size: 12.5px; padding: 4px 6px; border: 1px solid var(--border, #dde3ea); border-radius: 6px; background: var(--card, #fff); color: inherit; }
.org-bar .org-name { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted, #6b7785); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-bar #org-members { border: 1px solid var(--border, #dde3ea); background: var(--card, #fff); border-radius: 6px; padding: 3px 7px; cursor: pointer; font-size: 13px; }
.demo-banner { margin: 0 10px 8px; padding: 6px 8px; border-radius: 6px; background: #fff4d6; color: #7a5a00; font-size: 11.5px; line-height: 1.4; }
body.dark .demo-banner { background: #3a3220; color: #f0d58a; }
.om-list { max-height: 300px; overflow: auto; }
.om-list select { font-size: 12.5px; padding: 3px 4px; }
.om-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.om-add input[type=text], .om-add input:not([type]) { flex: 1 1 160px; min-width: 0; }
body.side-fold .org-bar, body.side-fold .demo-banner { display: none; }

/* リスト名の横の未読の赤丸(2026-10-01 要望) */
.list-head .newdot.list-nd { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin-right: 6px; flex-shrink: 0; box-shadow: 0 0 0 2.5px rgba(224, 83, 61, .18); }
.list-col.folded .newdot.list-nd { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); margin: 2px auto 4px; box-shadow: 0 0 0 2.5px rgba(224, 83, 61, .18); }
body.dark .kpi-needtarget { background: #4a3b12; color: #ffd98a; }
