/* ---------- デザイントークン ----------
   色・角丸・影はここの変数で決める。暗い配色（個人のダークテーマ、メディア画面）は、同じ変数を下で上書きする。 */
:root {
  --top-h: 46px;
  --pnav-h: 44px;
  --bg: #f3f4f7;
  --panel: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f4;
  --hover: #f1f3f6;
  --row-hover: #f5f7fb;
  --line: #eceef2;
  --border: #e0e3e9;
  --border-strong: #cdd2da;
  --text: #1a1d23;
  --text-2: #3d4350;
  --muted: #6b7280;
  --faint: #9aa1ad;
  --primary: #2f6bea;
  --primary-dark: #1f55cc;
  --accent-soft: #eef3fe;
  --sel: #dfe9fd;
  --sel-strong: #c3d6fa;
  --accent-border: #a9c2f7;
  --ring: #b6cbfa;
  --danger: #d83a3a;
  --topbar: #15171c;
  --pnav: #2e3137;
  --row-h: 30px;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 22, 34, .06), 0 1px 1px rgba(16, 22, 34, .04);
  --shadow-md: 0 8px 20px -8px rgba(16, 22, 34, .2), 0 2px 4px rgba(16, 22, 34, .06);
  --shadow: 0 16px 40px -12px rgba(16, 22, 34, .28), 0 4px 10px rgba(16, 22, 34, .08);
  --scroll-thumb: rgba(92, 102, 120, .38);
  --scroll-thumb-hover: rgba(92, 102, 120, .62);
  --ease: .14s ease;
  --font: "Segoe UI Variable Text", "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 13px; color: var(--text); background: var(--bg); overflow: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--sel-strong); }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
/* スクロールバー: 幅は変えず、つまみを丸くして地の色になじませる */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); border: 3px solid transparent; background-clip: padding-box; }
#app { display: flex; flex-direction: column; height: 100vh; }
.main { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.scroll { overflow: auto; }

/* ---------- top bar ---------- */
.topbar { height: var(--top-h); background: var(--topbar); color: #e6e8eb; display: flex; align-items: center; padding: 0 14px; gap: 10px; flex-shrink: 0; box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .07); }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 600; font-size: 13.5px; letter-spacing: .01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { background: linear-gradient(135deg, #63a4ff, #3d6df2); color: #fff; border-radius: 6px; padding: 3px 7px; font-weight: 800; font-size: 11px; letter-spacing: .09em; box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 2px 6px rgba(61, 109, 242, .4); }
.brand-text { color: #d5d9e0; font-weight: 500; }
@media (max-width: 1440px) { .brand-text { display: none; } }   /* 正式名は長いので、幅が狭いときは FFBS のマークだけにして、右端のユーザ名を切らさない */
.topnav { display: flex; align-items: center; height: 100%; margin-left: 12px; gap: 2px; }
.topnav a { display: flex; align-items: center; height: 30px; padding: 0 10px; white-space: nowrap; color: #b7bcc6; font-weight: 500; border-radius: 7px; transition: background-color var(--ease), color var(--ease); }
.topnav a:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.08); }
.topnav a.active { color: #fff; background: rgba(255,255,255,.14); font-weight: 600; }
.rn-tools { display: flex; gap: 2px; margin-bottom: 2px; flex-wrap: wrap; }
.rn-tools .tb-btn { padding: 0 6px; min-width: 24px; }
.rn-preview-box { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 4px 8px; margin-top: 4px; background: var(--surface-2); }
.chip .chip-x { border: 0; background: none; cursor: pointer; color: inherit; padding: 0 2px; }
th.col-flash { outline: 2px solid var(--primary); outline-offset: -2px; background: var(--sel) !important; }
.grid-wrap.rows-tall { --row-h: 46px; }
.grid-wrap.rows-compact { --row-h: 20px; }
.grid-wrap.rows-compact .grid td, .grid-wrap.rows-compact .grid th { font-size: 12px; }
tr.group-row .gmenu { border: 0; background: none; cursor: pointer; color: var(--muted); margin-left: 6px; padding: 0 4px; visibility: hidden; }
tr.group-row:hover .gmenu, tr.group-row .gmenu:focus-visible { visibility: visible; }
.note-card.client-note { border: 2px solid var(--primary); }
.note-card .client-chip { background: #e3f0fb; color: #12508f; border-radius: 10px; padding: 0 8px; font-size: 11px; }
.lock-band { margin: 6px 0; padding: 6px 10px; background: #fdefd6; border: 1px solid #f0c36d; border-radius: var(--radius); display: inline-flex; gap: 10px; align-items: center; color: #5c4400; font-size: 13px; }
.lock-band.dark { margin: 0; padding: 1px 8px; background: #5c4400; border-color: #8a6a12; color: #ffe2a8; font-size: 12px; white-space: nowrap; }
.form-grid label.no-label { min-height: 0; }
.topnav .nav-caret { background: none; border: 0; color: #b7bcc6; padding: 0 5px; margin-left: -2px; height: 30px; border-radius: 6px; cursor: pointer; font-size: 11px; }
.topnav .nav-caret:hover, .topnav .nav-caret:focus-visible { color: #fff; background: rgba(255,255,255,.08); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { background: transparent; border: 0; color: #cfd3da; font-size: 16px; width: 32px; height: 32px; border-radius: 8px; position: relative; display: inline-flex; align-items: center; justify-content: center; transition: background-color var(--ease), color var(--ease); }
.icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.badge { position: absolute; top: 1px; right: -1px; background: #f04a50; color: #fff; font-size: 10px; font-weight: 600; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--topbar); }
.global-search { position: relative; }
.global-search input { width: clamp(110px, 14vw, 260px); height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.07); color: #fff; padding: 0 12px 0 30px; outline: none; transition: background-color var(--ease), border-color var(--ease), box-shadow var(--ease); }
.global-search input::placeholder { color: #8d94a0; }
.global-search input:hover { background: rgba(255,255,255,.1); }
.global-search input:focus { background: #fff; color: #1a1d23; border-color: #6ea0ff; box-shadow: 0 0 0 3px rgba(110, 160, 255, .3); }
.global-search::before { content: "⌕"; position: absolute; left: 11px; top: 5px; font-size: 16px; color: #8d94a0; pointer-events: none; }
.search-results { position: absolute; top: 38px; right: 0; left: auto; width: 420px; max-width: calc(100vw - 16px); max-height: 480px; overflow: auto; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); z-index: 60; }
.search-group { padding: 8px 12px 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; border-top: 1px solid var(--line); }
.search-group:first-child { border-top: 0; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 6px 12px; cursor: pointer; }
.search-item:hover, .search-item.active { background: var(--accent-soft); }
.search-item .thumb { width: 44px; height: 28px; background: var(--surface-3); border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.search-item .sub { color: var(--muted); font-size: 11px; }
.search-item .search-follow { flex-shrink: 0; white-space: nowrap; font-size: 11px; padding: 2px 8px; }
.user-menu button { display: flex; align-items: center; gap: 6px; white-space: nowrap; background: transparent; border: 0; color: #e6e8eb; padding: 3px 8px 3px 4px; border-radius: 8px; transition: background-color var(--ease); }
.user-menu button:hover { background: rgba(255,255,255,.1); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #6aa6ff, #4674f0); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; object-fit: cover; flex-shrink: 0; }
.avatar.sm { width: 20px; height: 20px; font-size: 9px; }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }

/* ---------- project nav ---------- */
.projectnav { height: var(--pnav-h); background: var(--panel); color: var(--text); border-bottom: 1px solid var(--border); display: flex; align-items: stretch; padding: 0 14px; flex-shrink: 0; }
.projectnav .pname { align-self: center; font-weight: 700; font-size: 15px; letter-spacing: .01em; color: var(--text); margin-right: 18px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projectnav .pname:hover { text-decoration: none; color: var(--primary-dark); }
.projectnav .ptabs { display: flex; align-items: stretch; overflow: hidden; gap: 2px; flex: 1 1 auto; min-width: 0; }
.projectnav .ptabs a[hidden] { display: none; }
.projectnav .pname, .projectnav .pright, .projectnav .ptabs button { flex: none; }
.projectnav .ptabs a, .projectnav .ptabs button { display: flex; align-items: center; padding: 0 9px; color: var(--text-2); font-size: 12px; border: 0; background: transparent; border-bottom: 2px solid transparent; border-top: 2px solid transparent; white-space: nowrap; cursor: pointer; transition: color var(--ease), border-color var(--ease); }
.projectnav .ptabs a:hover, .projectnav .ptabs button:hover { color: var(--text); text-decoration: none; border-bottom-color: var(--border-strong); }
.projectnav .ptabs a.active { color: var(--primary-dark); font-weight: 600; border-bottom-color: var(--primary); }
.projectnav .pright { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.projectnav .pright button { background: transparent; border: 0; color: var(--text-2); font-size: 12px; padding: 5px 8px; border-radius: var(--radius); cursor: pointer; transition: background-color var(--ease); }
.projectnav .pright button:hover { background: var(--hover); color: var(--text); }
.nav-edit-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; }
.nav-edit-row { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.nav-edit-row .nl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- page toolbar ---------- */
.page { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 7px 14px; background: var(--panel); border-bottom: 1px solid var(--border); flex-wrap: wrap; flex-shrink: 0; }
.toolbar h1 { font-size: 16px; margin: 0 8px 0 0; font-weight: 650; letter-spacing: .01em; display: flex; align-items: center; gap: 6px; }
.toolbar .spacer { flex: 1; }
.toolbar .count { color: var(--muted); white-space: nowrap; }
.tb-btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text); white-space: nowrap; box-shadow: var(--shadow-sm); transition: background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease); }
.tb-btn:hover { background: var(--hover); }
.tb-btn:active:not(:disabled) { box-shadow: none; }
.tb-btn.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--primary-dark); }
.tb-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 1px 2px rgba(31, 85, 204, .35), inset 0 1px 0 rgba(255, 255, 255, .16); }
.tb-btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.tb-btn.danger { color: var(--danger); border-color: #eab0b0; }
.tb-btn.danger:hover { background: #fdf1f0; }
.tb-btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.tb-btn.ghost:hover { background: var(--hover); }
.tb-btn .caret { font-size: 9px; margin-left: 2px; opacity: .7; }
.tb-btn:disabled { opacity: .5; cursor: default; }
.tb-group { display: inline-flex; box-shadow: var(--shadow-sm); border-radius: var(--radius); }
.tb-group .tb-btn { border-radius: 0; margin-left: -1px; box-shadow: none; }
.tb-group .tb-btn.active { position: relative; z-index: 1; }
.tb-group .tb-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.tb-group .tb-btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.tb-input { height: 28px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0 8px; min-width: 180px; background: var(--panel); transition: border-color var(--ease), box-shadow var(--ease); }
.tb-input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.selection-bar { display: flex; align-items: center; gap: 6px; padding: 5px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--accent-border); flex-shrink: 0; }

/* ---------- body layout ---------- */
.page-body { display: flex; flex: 1; min-height: 0; }
.filter-panel { width: 230px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--border); overflow: auto; padding: 8px 0; }
.filter-panel h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; margin: 10px 12px 4px; }
.filter-panel .fp-item { display: flex; align-items: center; gap: 6px; padding: 3px 12px; cursor: pointer; }
.filter-panel .fp-item:hover { background: var(--hover); }
.filter-panel .fp-item .n { margin-left: auto; color: var(--muted); font-size: 11px; }
.filter-panel .fp-section { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.filter-panel .fp-head { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; cursor: pointer; }
.filter-panel .fp-head h3 { margin: 10px 0 4px; }
.filter-panel .fp-head .toggle { color: var(--muted); font-size: 10px; }
.filter-panel input[type=checkbox] { margin: 0; }
.filter-panel .fp-more { color: var(--primary); padding: 2px 12px; cursor: pointer; font-size: 12px; }
.filter-panel .fp-clear { margin: 6px 12px; }
.filter-panel .fp-head .spacer { flex: 1; }
.filter-panel .fp-not { border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 10px; font-size: 10px; padding: 0 6px; margin: 6px 0 0 6px; cursor: pointer; line-height: 16px; }
.filter-panel .fp-not.on { background: #c0392b; border-color: #c0392b; color: #fff; }
.filter-panel .fp-gear { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 4px; margin-top: 6px; opacity: .35; }
.filter-panel .fp-head:hover .fp-gear, .filter-panel .fp-gear:focus { opacity: 1; }
.filter-panel .fp-add { padding: 8px 12px; border-bottom: 0; }
.filter-panel .fp-named-head { cursor: default; }
.filter-panel .fp-mini { border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 4px; font-size: 11px; padding: 0 6px; margin: 6px 0 0 4px; cursor: pointer; line-height: 18px; }
.filter-panel .fp-mini:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.filter-panel .fp-mini:disabled { opacity: .45; cursor: not-allowed; }
.filter-panel .fp-named-item { cursor: default; }
.filter-panel .fp-named-item label { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; cursor: pointer; }
.filter-panel .fp-named-item label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-panel .fp-named-item .fp-gear { margin-top: 0; }
.filter-panel .fp-named-item:hover .fp-gear { opacity: 1; }
.filter-panel .fp-default { font-size: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 0 5px; white-space: nowrap; }
.filter-panel .fp-hold { display: none; margin: 0 12px 4px; color: var(--primary); }
.filter-panel.holding .fp-hold { display: block; }
.tb-btn.filtering { background: var(--primary); border-color: var(--primary); color: #fff; }
.grid-wrap { flex: 1; min-width: 0; overflow: auto; background: var(--panel); position: relative; }

/* ---------- grid ---------- */
.grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 100%; }
.grid th, .grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 6px; height: var(--row-h); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; vertical-align: middle; }
.grid thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-2); font-weight: 600; z-index: 2; user-select: none; font-size: 12px; border-bottom: 1px solid var(--border-strong); }
.grid thead th .th-inner { display: flex; align-items: center; gap: 4px; }
.grid thead th.renamed .th-label { font-style: italic; }
/* 固定した列: 横に動かしても左に残す。チェックボックスの列も一緒に残す */
.grid th.frozen, .grid td.frozen, .grid.has-frozen .sel-col { position: sticky; }
.grid.has-frozen .sel-col { left: 0; }
.grid td.frozen, .grid.has-frozen td.sel-col { z-index: 1; background: var(--panel); }
.grid thead th.frozen, .grid.has-frozen thead th.sel-col { z-index: 4; }
.grid th.frozen-last, .grid td.frozen-last { border-right: 2px solid var(--faint); }
.grid thead th .th-label { overflow: hidden; text-overflow: ellipsis; flex: 1; cursor: pointer; }
.grid thead th .sort-ind { color: var(--primary); font-size: 10px; }
.grid thead th .th-menu { opacity: 0; cursor: pointer; font-size: 10px; padding: 0 2px; border-radius: 3px; color: var(--muted); flex: none; }
.grid thead th:hover .th-menu, .grid thead th .th-menu:focus { opacity: 1; }
.grid thead th .th-menu:hover { background: rgba(0, 0, 0, .08); color: inherit; }
.grid thead th .resizer { position: absolute; right: 0; top: 0; width: 6px; height: 100%; cursor: col-resize; }
.grid thead th .resizer:hover { background: var(--accent-border); }
.grid thead th { position: sticky; }
.grid thead th.dragover { background: var(--sel); }
.grid tbody tr:hover td { background: var(--row-hover); }
.grid tbody tr.selected td { background: var(--sel); }
.grid td.sel-col, .grid th.sel-col { width: 32px; text-align: center; padding: 0; }
.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.editable { cursor: text; }
.query-rows { max-height: 60vh; overflow: auto; min-width: 320px; }
tr.row-over td { box-shadow: inset 0 2px 0 var(--accent, var(--primary)); }
.pl-order-note { padding: 4px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.pl-order-note.warn { background: #fff7e0; color: #7a5b00; }
/* 未読の Note / Ticket / Delivery の行は、名前を太字にする（Flow の Read and Unread） */
tr.unread td { font-weight: 700; }
tr.unread td .ent-link { font-weight: 700; }
.th-rule { font-size: 10px; margin-left: 3px; color: #c0392b; }
.th-rule.relaxed { color: #b7791f; }
td.time-logged .cell-btns { float: right; visibility: hidden; }
td.time-logged:hover .cell-btns, td.time-logged:focus-within .cell-btns { visibility: visible; }
.cell-btn { border: 1px solid var(--border); background: var(--panel, var(--panel)); color: inherit; border-radius: 3px; padding: 0 5px; margin-left: 2px; font-size: 11px; line-height: 16px; cursor: pointer; }
.cell-btn:hover { background: var(--hover, #eef2f7); }
.query-rows .query-row { padding: 4px 0; border-bottom: 1px solid var(--border); }
.grid td.calc-error { background: #fde3e1 !important; color: #b3261e; font-size: 12px; box-shadow: inset 0 0 0 1px #e9a19b; }
.grid td.editing { padding: 0; overflow: visible; }
.grid td.editing input, .grid td.editing select, .grid td.editing textarea { width: 100%; height: 100%; border: 2px solid var(--primary); padding: 0 4px; outline: none; background: var(--panel); }
.grid td.editing textarea { height: 90px; position: relative; z-index: 5; }
.grid td .thumb { width: 60px; height: 24px; object-fit: cover; background-color: var(--surface-3); border-radius: 2px; display: block; }
.grid td .thumb.empty { display: inline-flex; align-items: center; justify-content: center; color: var(--faint); font-size: 10px; }
.grid td.thumb-cell { padding: 2px 6px; }
.grid tr.group-row td { background: var(--surface-3); font-weight: 600; cursor: pointer; border-right: 0; }
.grid tr.group-row td .gsticky { position: sticky; left: 0; display: inline-flex; align-items: center; gap: 0; max-width: 100vw; z-index: 2; background: var(--surface-3); padding-right: 8px; }
.grid tr.group-row td .gcount { color: var(--muted); font-weight: 400; margin-left: 6px; }
.grid tr.group-row td .gtoggle { display: inline-block; width: 14px; }
.grid tr.group-row td .gindent { display: inline-block; }
.grid tr.group-row.glevel-1 td { background: var(--surface-3); }
.grid tr.group-row.glevel-2 td { background: var(--surface-2); font-weight: 500; }
.grid tr.summary-row td { background: var(--surface-2); color: var(--muted); font-size: 11px; }
.grid .empty-state { padding: 40px; color: var(--muted); text-align: center; }
.grid td.step-cell { padding: 0 4px; }
.grid th.step-col { background: var(--surface-3); text-align: center; }
.grid th.step-col .th-inner { justify-content: center; }
.link-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.link-chip + .link-chip::before { content: ","; margin-right: 2px; color: var(--muted); }
.ent-link { color: var(--primary); }
.cell-muted { color: var(--muted); }
.check-ro { font-size: 14px; }
.color-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; border: 1px solid rgba(0,0,0,.15); margin-right: 4px; }
.url-cell a { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- status ---------- */
.status { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.status .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,.12); }
.status .code { font-weight: 600; font-size: 12px; }
.status .nm { color: var(--muted); }
.status.pill { padding: 1px 8px 1px 5px; border-radius: 10px; }
.status-menu .mi { display: flex; align-items: center; gap: 8px; }

/* ---------- menus & popovers ---------- */
.menu { position: fixed; z-index: 300; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 180px; max-height: 70vh; overflow: auto; padding: 5px; animation: fadein-plain .1s ease-out; }
.menu .mi { padding: 6px 10px; border-radius: 5px; cursor: pointer; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.menu .mi:hover, .menu .mi.active { background: var(--accent-soft); }
.menu .mi.disabled { color: var(--faint); cursor: default; background: transparent; }
.menu .mi.danger { color: var(--danger); }
.menu .mi .shortcut { margin-left: auto; color: var(--muted); font-size: 11px; }
.menu .sep { border-top: 1px solid var(--line); margin: 5px 0; }
.menu .mtitle { padding: 6px 10px 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.menu .mi input[type=checkbox] { margin: 0; }
.menu .mi .mic { width: 18px; text-align: center; color: var(--muted); filter: grayscale(1); flex: none; }
.menu.user-menu { max-height: calc(100vh - 80px); }
.menu.user-menu .mi { padding: 4px 10px 4px 22px; }
.menu.user-menu .mi:has(.mic) { padding-left: 10px; }
.popover { position: fixed; z-index: 300; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 12px; min-width: 240px; max-height: 80vh; overflow: auto; animation: fadein-plain .1s ease-out; }
.popover h4 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .4px; color: var(--muted); text-transform: uppercase; }
.popover .row, .fb-box .row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.popover .row select, .popover .row input, .fb-box .row select, .fb-box .row input { height: 28px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0 6px; }
.popover .fb-group.nested, .fb-box .fb-group.nested { border-left: 3px solid var(--accent-border); background: #f6f9fd; padding: 6px 6px 0 8px; margin: 0 0 6px 18px; border-radius: 0 4px 4px 0; }
.popover .fb-group.nested .fb-group.nested, .fb-box .fb-group.nested .fb-group.nested { border-left-color: #f3c29c; background: #fdf9f4; }
.popover .fb-cond.off > *:not(input[type=checkbox]), .popover .fb-group.off > *:not(.fb-ghead), .fb-box .fb-cond.off > *:not(input[type=checkbox]), .fb-box .fb-group.off > *:not(.fb-ghead) { opacity: .45; }
.popover .fb-chain, .fb-box .fb-chain { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.popover .fb-chain select, .fb-box .fb-chain select { max-width: 170px; }
.popover .actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.field-list { max-height: 360px; overflow: auto; }
.field-list label { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 5px; cursor: pointer; }
.field-list label:hover { background: var(--hover); }
.field-list .ftype { margin-left: auto; color: var(--muted); font-size: 11px; }
.popover .search { width: 100%; height: 28px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0 8px; margin-bottom: 6px; }

/* ---------- entity picker ---------- */
.picker { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 30px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 2px 4px; background: var(--panel); cursor: text; }
.picker:focus-within { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.picker input, .form-grid .ctl .picker input[type=text] { flex: 1; min-width: 80px; width: auto; height: 24px; border: 0; outline: 0; padding: 0 4px; background: transparent; }
.form-grid .ctl .picker input:focus { outline: 0; }
.picker .chips { display: contents; }
.picker.single.has-value input { min-width: 30px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-3); border-radius: 999px; padding: 2px 6px 2px 8px; font-size: 12px; }
.chip .x { cursor: pointer; color: var(--muted); font-weight: 700; }
.chip .x:hover { color: var(--danger); }
.picker-list { position: absolute; left: 0; right: 0; top: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 0 0 8px 8px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; z-index: 120; }
.picker-list .pi { padding: 5px 8px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.picker-list .pi:hover, .picker-list .pi.active { background: var(--accent-soft); }
.picker-list .pi .pt { color: var(--muted); font-size: 11px; margin-left: auto; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(15, 18, 26, .5); backdrop-filter: blur(2px); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding-top: 6vh; overflow: auto; animation: fadein-plain .14s ease-out; }
.modal { background: var(--panel); border-radius: 12px; width: 640px; max-width: 95vw; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 28px 70px -16px rgba(8, 12, 20, .5), 0 0 0 1px rgba(16, 22, 34, .06); animation: modal-in .16s ease-out; }
.modal.wide { width: 980px; }
.modal.narrow { width: 440px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 650; letter-spacing: .01em; }
.modal-head .close { margin-left: auto; background: transparent; border: 0; font-size: 18px; line-height: 1; color: var(--muted); width: 28px; height: 28px; border-radius: 6px; transition: background-color var(--ease), color var(--ease); }
.modal-head .close:hover { background: var(--hover); color: var(--text); }
.modal-body { padding: 16px 18px; overflow: auto; flex: 1; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 12px 12px; display: flex; justify-content: flex-end; gap: 8px; }
.modal-foot .foot-left { margin-right: auto; }
.tb-btn.link { border-color: transparent; background: transparent; color: var(--primary); box-shadow: none; }
.tb-btn.link:hover { background: var(--accent-soft); }
.more-pop { width: 260px; }
.more-pop input { width: 100%; height: 28px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0 8px; margin-bottom: 4px; }
.more-pop .mi { padding: 5px 10px; cursor: pointer; border-radius: 5px; }
.more-pop .mi:hover { background: var(--accent-soft); }
.more-list { max-height: 280px; overflow: auto; }
.drop-zone.compact { padding: 8px; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; align-items: start; }
.form-grid label { padding-top: 6px; color: var(--text-2); font-weight: 500; }
.form-grid label .req { color: var(--danger); margin-left: 2px; }
.form-grid .ctl input[type=text], .form-grid .ctl input[type=password], .form-grid .ctl input[type=number], .form-grid .ctl input[type=date], .form-grid .ctl input[type=datetime-local], .form-grid .ctl input[type=url], .form-grid .ctl select, .form-grid .ctl textarea { width: 100%; height: 30px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0 8px; }
.form-grid .ctl textarea { height: 80px; padding: 6px 8px; resize: vertical; }
.form-grid .ctl input:focus, .form-grid .ctl select:focus, .form-grid .ctl textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.form-grid .ctl .hint { color: var(--muted); font-size: 11px; margin-top: 2px; }
.form-grid .ctl input[type=color] { height: 30px; width: 60px; padding: 0; }
.form-grid.compact { grid-template-columns: 120px 1fr; }
.more-fields { color: var(--primary); cursor: pointer; grid-column: 1 / -1; }
.drop-zone { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); transition: border-color var(--ease), background-color var(--ease); padding: 14px; text-align: center; color: var(--muted); cursor: pointer; }
.drop-zone.over { border-color: var(--primary); background: var(--accent-soft); }
.drop-zone .fname { color: var(--text); font-weight: 500; }

/* ---------- toast ---------- */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast { background: #1b1e24; color: #fff; padding: 9px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13px; font-weight: 500; animation: fadein .15s ease-out; }
@keyframes fadein-plain { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.toast.error { background: #b42318; }
.toast.success { background: #1a7f4b; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- projects page ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; padding: 18px; }
.pcard { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: box-shadow var(--ease), transform var(--ease), border-color var(--ease); display: flex; flex-direction: column; }
.pcard:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.pcard .pimg { height: 140px; background: linear-gradient(135deg, #232833, #454d5c); display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 32px; font-weight: 700; letter-spacing: .06em; object-fit: cover; }
.pcard img.pimg { object-fit: cover; width: 100%; }
.pcard .pbody { padding: 12px 14px 13px; }
.pcard .ptitle { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pcard .pstar { border: 0; background: none; padding: 0; font-size: 16px; line-height: 1; cursor: pointer; color: var(--muted, var(--faint)); }
.pcard .pstar.on { color: #f5b301; }
.pcard .pdesc { color: var(--muted); font-size: 12px; margin-top: 4px; max-height: 34px; overflow: hidden; }
.pcard .pmeta { display: flex; gap: 10px; color: var(--muted); font-size: 11px; margin-top: 8px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-weight: 500; font-size: 11px; background: var(--surface-3); color: var(--text-2); }
.pill.Active { background: #d8f3e4; color: #15663b; }
.pill.Bidding { background: #fdefd6; color: #8a5a00; }
.pill.Archived { background: var(--surface-3); color: var(--text-2); }
.pill.Template { background: #ecdff5; color: #5b2a86; }
.pill.Lost { background: #fbe2df; color: #8c2a24; }

/* ---------- overview ---------- */
.overview { padding: 16px; display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.stat { background: var(--row-hover); border-radius: 8px; padding: 12px; transition: background-color var(--ease); cursor: pointer; }
.stat:hover { background: var(--accent-soft); }
.stat .v { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.stat .l { color: var(--muted); font-size: 11px; }
.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-3); }
.bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.feed { display: flex; flex-direction: column; gap: 8px; }
.feed-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.feed-item .ftime { color: var(--muted); font-size: 11px; white-space: nowrap; }
.feed-item .fbody { flex: 1; min-width: 0; }
.task-list .ti { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.task-list .ti .due { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.task-list .ti .due.late { color: var(--danger); font-weight: 600; }
.step-progress { display: flex; flex-direction: column; gap: 6px; }
.step-progress .sp { display: grid; grid-template-columns: 110px 1fr 60px; align-items: center; gap: 8px; font-size: 12px; }

/* ---------- detail page ---------- */
.detail-head { display: flex; gap: 14px; padding: 14px 18px; background: var(--panel); border-bottom: 1px solid var(--border); align-items: center; flex-shrink: 0; }
.detail-head .dthumb { width: 120px; height: 68px; border-radius: 8px; background-color: var(--surface-3); object-fit: cover; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 11px; flex-shrink: 0; }
.detail-head .dtitle { font-size: 18px; font-weight: 650; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-head .dtitle .etype { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.detail-head .dcrumb { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.detail-head .dmeta { display: flex; gap: 14px; color: var(--muted); font-size: 12px; margin-top: 4px; flex-wrap: wrap; }
.detail-head .dactions { margin-left: auto; display: flex; gap: 6px; align-self: flex-start; }
.tabs { display: flex; gap: 2px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--border); flex-shrink: 0; overflow-x: auto; }
.tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; color: var(--text-2); font-weight: 500; white-space: nowrap; transition: color var(--ease), border-color var(--ease); }
.tabs button:hover { color: var(--text); border-bottom-color: var(--border-strong); }
.tabs button.active { color: var(--primary-dark); font-weight: 600; border-bottom-color: var(--primary); }
.tabs button .n { color: var(--muted); margin-left: 4px; font-size: 11px; }
.detail-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 0 32px; padding: 12px 16px; }
.info-row { display: grid; grid-template-columns: 160px 1fr; border-bottom: 1px solid var(--line); min-height: 32px; align-items: center; }
.info-row .k { color: var(--muted); font-size: 12px; padding: 4px 0; }
.info-row .v { padding: 4px 6px; min-height: 26px; display: flex; align-items: center; border-radius: 5px; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.info-row .v.editable:hover { background: var(--accent-soft); cursor: text; }
.info-row .v.editing { padding: 0; }
.info-row .v.editing input, .info-row .v.editing select, .info-row .v.editing textarea { width: 100%; height: 28px; border: 2px solid var(--primary); padding: 0 4px; outline: none; }
.info-row .v.editing textarea { height: 100px; }
.activity { padding: 12px 16px; max-width: 980px; }
.composer { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 10px; margin-bottom: 14px; }
.composer textarea { width: 100%; min-height: 60px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); padding: 6px 8px; resize: vertical; }
.composer .crow { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.composer .crow .lbl { color: var(--muted); font-size: 12px; }
.note-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 10px 12px; margin-bottom: 10px; }
.note-card .nh { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.note-card .nh .who { font-weight: 600; }
.note-card .nh .when { color: var(--muted); font-size: 11px; }
.note-card .nh .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.note-card .nsubj { font-weight: 600; margin-bottom: 4px; }
.note-card .nbody { word-break: break-word; }
.note-card.unread .nsubj, .note-card.unread .nbody, .note-card.unread .nh .who { font-weight: 700; }
.note-card.unread { border-left: 3px solid var(--primary); }
.note-card .read-toggle { font-size: 11px; height: 20px; padding: 0 6px; }
.note-card .reply-order { color: var(--muted); margin-bottom: 4px; }
.md p { margin: 0 0 6px; }
.md p:last-child { margin-bottom: 0; }
.md h3, .md h4, .md h5, .md h6 { margin: 8px 0 4px; font-size: 14px; }
.md ul, .md ol { margin: 0 0 6px; padding-left: 22px; }
.md li.task { list-style: none; margin-left: -18px; }
.md code { background: var(--hover); border-radius: 4px; padding: 0 4px; font-family: Consolas, Menlo, monospace; font-size: 12px; }
.md pre { background: var(--hover); border-radius: 6px; padding: 8px; overflow: auto; margin: 0 0 6px; }
.md pre code { background: none; padding: 0; white-space: pre; }
/* コードブロックの色分け（public/js/highlight.js） */
.md .hl-k { color: #a626a4; font-weight: 600; }
.md .hl-b { color: #4078f2; }
.md .hl-s { color: #50a14f; }
.md .hl-c { color: var(--faint); font-style: italic; }
.md .hl-n { color: #986801; }
.md table { border-collapse: collapse; margin: 0 0 6px; }
.md th, .md td { border: 1px solid var(--border-strong); padding: 2px 8px; }
.md th { background: var(--surface-2); }
.md blockquote { margin: 0 0 6px; padding-left: 10px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.note-card .nlinks { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.note-card .natt { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.note-card .natt img { max-height: 120px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; }
.note-card .replies { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.note-card .reply { display: flex; gap: 8px; padding: 4px 0; }
.note-card .reply .rb { flex: 1; }
.note-card .reply .rb .who { font-weight: 600; font-size: 12px; margin-right: 6px; }
.note-card .reply .rb .when { color: var(--muted); font-size: 11px; }
.note-card .reply-box { display: flex; gap: 6px; margin-top: 6px; }
.note-card .reply-box input { flex: 1; height: 28px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); padding: 0 8px; }
.event-item { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.event-item .when { color: var(--muted); white-space: nowrap; width: 120px; flex-shrink: 0; }
.event-item .who { font-weight: 600; margin-right: 4px; }
.version-card { display: flex; gap: 10px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 8px 10px; margin-bottom: 10px; align-items: center; }
.version-card img { width: 120px; height: 68px; object-fit: cover; background: var(--surface-3); border-radius: 6px; }
.version-card .thumb-wrap.vthumb { width: 120px; height: 68px; border-radius: 4px; flex-shrink: 0; }

/* ---------- thumbnail / card view ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 12px; }
.ecard { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: box-shadow var(--ease), border-color var(--ease); }
.ecard:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
/* 長い名前は 1 行で切らずに折り返して全部読めるようにする（Flow 8.35）。.ecard .cn と .mc-bar .cn の nowrap を上書きする */
.ecard .cn, .mc-bar .cn { white-space: normal !important; overflow-wrap: anywhere; word-break: break-word; text-overflow: clip !important; }
.ecard.selected { outline: 2px solid var(--primary); }
.ecard .ci { width: 100%; height: 124px; object-fit: cover; background: #2e3137; display: flex; align-items: center; justify-content: center; color: var(--faint); }
.ecard .cb { padding: 8px 10px; }
.ecard .cn { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ecard .cf { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; gap: 6px; }
.ecard .cf span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- task board ---------- */
.board { display: flex; gap: 10px; padding: 12px; overflow: auto; flex: 1; align-items: flex-start; }
.board .col { width: 250px; flex-shrink: 0; background: var(--surface-3); border-radius: var(--radius-lg); padding: 8px; min-height: 120px; }
.board .col.over { background: var(--sel); }
.board .col h4 { margin: 0 0 8px; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.board .col h4 .n { color: var(--muted); font-weight: 400; margin-left: auto; }
.board .tcard { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-sm); transition: box-shadow var(--ease); padding: 8px; margin-bottom: 6px; cursor: grab; }
.board .tcard:hover { box-shadow: var(--shadow-md); }
.board .tcard .tn { font-weight: 600; }
.board .tcard .te { color: var(--muted); font-size: 11px; margin-top: 2px; }
.board .tcard .ta { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 11px; }
.board .tcard.dragging { opacity: .4; }

/* ---------- gantt ---------- */
.gantt { display: flex; flex: 1; min-height: 0; overflow: auto; background: var(--panel); }
.gantt .gl { width: 320px; flex-shrink: 0; border-right: 1px solid var(--border); position: sticky; left: 0; background: var(--panel); z-index: 2; }
.gantt .gl .gh, .gantt .gr .gh { height: 44px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-end; font-size: 11px; color: var(--muted); }
.gantt .gl .gh { padding: 0 8px 6px; }
.gantt .gl .grow { height: 28px; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 8px; gap: 6px; white-space: nowrap; overflow: hidden; }
.gantt .gl .grow .sub { color: var(--muted); font-size: 11px; }
/* 左側はページの列（Flow の Task ページの List）。セルは一覧と同じに編集できる */
.gantt .gl.gl-cols { overflow-x: auto; overflow-y: hidden; }
.gantt .gl.gl-cols.full { flex: 1; width: auto; }
.gantt .gl.gl-cols .gh.gcols { padding: 0; box-sizing: border-box; }
.gantt .gl.gl-cols .grow { padding: 0; gap: 0; box-sizing: border-box; }
.gantt .gl.gl-cols .grow.ggroup { padding: 0 8px; gap: 6px; }
.gantt .gl .gcell, .gantt .gl .grow td { display: block; flex: none; height: 28px; line-height: 27px; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid var(--line); box-sizing: border-box; font-size: 12px; }
.gantt .gl .grow td.editing { overflow: visible; background: var(--panel); position: relative; z-index: 5; line-height: normal; padding: 2px; }
.gantt .gl .grow td.editable { cursor: cell; }
.gantt .gl .gpick { width: 28px; padding: 0 6px; }
.gantt .gl .gcol-h { flex: none; padding: 0 6px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-sizing: border-box; border-right: 1px solid var(--line); }
.gantt .gsplit { flex: none; width: 6px; cursor: col-resize; position: sticky; z-index: 3; background: var(--border); align-self: stretch; }
.gantt .gsplit:hover, .gantt .gsplit:focus { background: var(--border-strong); outline: none; }
.gantt .gr { position: relative; flex: 1; }
.gantt .gr .gh { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.gantt .gr .gh .day { position: absolute; bottom: 0; font-size: 10px; border-left: 1px solid var(--line); padding: 0 2px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.gantt .gr .gh .day.month { border-left-color: var(--border-strong); font-weight: 600; }
.gantt .gr .grow { height: 28px; border-bottom: 1px solid var(--line); position: relative; }
.gantt .gr .bar-t { position: absolute; top: 6px; height: 16px; border-radius: 4px; background: #9cc2f3; font-size: 10px; line-height: 16px; padding: 0 4px; white-space: nowrap; overflow: hidden; color: #0b1a2e; cursor: pointer; }
.gantt .gr .bar-t.ms { border-radius: 2px; transform: rotate(45deg); width: 12px !important; height: 12px; background: #e67e22; padding: 0; }
.gantt .today { position: absolute; top: 0; bottom: 0; width: 2px; background: #e5484d; z-index: 1; opacity: .7; }
.gantt .weekend { position: absolute; top: 0; bottom: 0; background: var(--surface-2); }
.gantt .weekend.holiday { background: var(--surface-3); }
/* 作業スケジュール（G45） */
.ws { display: flex; gap: 16px; align-items: flex-start; }
.ws-side { width: 220px; flex-shrink: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 6px 0 10px; }
.ws-side h3 { font-size: 11px; color: var(--muted); margin: 10px 12px 4px; }
.ws-side select { margin: 4px 12px 0; width: calc(100% - 24px); }
.ws-item { padding: 6px 12px; cursor: pointer; }
.ws-item:hover, .ws-item.active { background: var(--accent-soft); color: var(--primary-dark); }
.ws-main { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 16px; }
.ws-main h3 { margin: 0; }
table.ws-week { width: auto; }
table.ws-week th { width: 80px; }
.ws-exc { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ws-cal { display: grid; grid-template-columns: repeat(7, 38px); gap: 3px; margin-top: 8px; }
.ws-dow { text-align: center; font-size: 11px; color: var(--muted); }
.ws-day { height: 32px; border: 1px solid var(--border); background: var(--panel); border-radius: 6px; cursor: pointer; }
.ws-day.off { background: var(--surface-3); color: var(--text-2); }
.ws-day.pending { box-shadow: inset 0 0 0 2px #f0932b; }
.ws-day.picked { outline: 2px solid var(--primary); }
.ws-form { min-width: 320px; }
tr.ws-pending td { background: #fff7ec; }
tr.ws-removed td { text-decoration: line-through; color: var(--muted); }
.ws-opt { display: block; margin: 6px 0; }
.gantt-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; width: 100%; overflow: hidden; }
.gantt-wrap .gantt { min-width: 0; }
.gantt .gl .gh .gantt-month { margin-left: auto; font-weight: 600; color: var(--text, var(--text)); }
.gantt .gl .grow .gantt-pick { margin: 0; flex-shrink: 0; }
.gantt-toolbar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--panel); flex-wrap: wrap; }
.gantt-toolbar .gantt-sel { margin-left: auto; }
.gantt .gr .gh .major { position: absolute; top: 4px; font-size: 11px; font-weight: 600; color: var(--text, var(--text)); padding-left: 3px; border-left: 1px solid var(--border-strong); white-space: nowrap; }
.gantt .gr .gh .day { height: 22px; overflow: hidden; white-space: nowrap; }
.gantt-wrap .gantt .gr .bar-t { cursor: grab; touch-action: none; user-select: none; }
/* 選んだタスク: バーに枠は描かず、Gantt 側の行の背景を変える（Flow と同じ） */
.gantt-wrap .gantt .gr .grow.selected { background: var(--accent-soft); }
.gantt-wrap .gantt .gr.linking, .gantt-wrap .gantt .gr.linking .bar-t { cursor: crosshair; }
.gantt-dragtip { position: absolute; z-index: 20; pointer-events: none; background: #1d1f22; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.gantt-wrap .gantt .gr .bar-t.saving { cursor: progress; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.55) 0 4px, transparent 4px 8px) !important; pointer-events: none; }
.gantt-wrap .gantt .gl .grow.selected { background: var(--accent-soft); }
.gantt .bar-t .gx { position: absolute; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.gantt .bar-t .gx-l { left: 0; }
.gantt .bar-t .gx-r { right: 0; }
.gantt .gr .pin-frame { position: absolute; top: 3px; height: 22px; border: 1.5px dashed #5b6472; border-radius: 4px; pointer-events: none; }
.gantt .gr .gviol { position: absolute; top: 6px; width: 16px; height: 16px; border-radius: 50%; border: 0; background: #e5484d; color: #fff; font-weight: 700; font-size: 11px; line-height: 16px; padding: 0; cursor: pointer; z-index: 2; }
.gviol-cell { display: inline-block; vertical-align: middle; width: 16px; height: 16px; margin-right: 4px; border-radius: 50%; border: 0; background: #e5484d; color: #fff; font-weight: 700; font-size: 11px; line-height: 16px; padding: 0; cursor: pointer; }
.gantt .gr .gdot { position: absolute; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--panel); border: 1.5px solid #5b6472; cursor: crosshair; opacity: 0; z-index: 2; touch-action: none; }
.gantt .gr .grow:hover .gdot { opacity: 1; }
.gantt .gr svg.gdeps { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; overflow: visible; }
.gantt .gdeps .gdep { fill: none; stroke: #8a94a3; stroke-width: 1.2; }
.gantt .gdeps .gdep-head { fill: none; stroke: #8a94a3; stroke-width: 1.2; }
.gantt .gdeps .bad { stroke: #e5484d; }
.gantt .gdeps .glink { fill: none; stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: 4 3; }
.gantt .gdeps .glink.ok { stroke-dasharray: none; }
.toast .toast-action { margin-left: 10px; background: transparent; border: 1px solid rgba(255,255,255,.7); color: #fff; border-radius: 4px; padding: 1px 8px; cursor: pointer; font: inherit; }

/* ---------- inbox / my tasks ---------- */
.split { display: flex; flex: 1; min-height: 0; }
.split .list { width: 380px; flex-shrink: 0; border-right: 1px solid var(--border); overflow: auto; background: var(--panel); }
.split .detail { flex: 1; overflow: auto; background: var(--bg); }
.inbox-item { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.inbox-item:hover { background: var(--row-hover); }
.inbox-item.active { background: var(--sel); }
.inbox-item.unread .ib .t { font-weight: 700; }
.inbox-item .ib { flex: 1; min-width: 0; }
.inbox-item .ib .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item .ib .s { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item .when { color: var(--muted); font-size: 11px; white-space: nowrap; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); align-self: center; flex-shrink: 0; }
.inbox-item:not(.unread) .unread-dot { visibility: hidden; }

.inbox-item.selected { background: #fff4d6; }
.inbox-item.selected.active { background: var(--sel); }
.follow-settings { width: 100%; border-collapse: collapse; }
.follow-settings th, .follow-settings td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.follow-settings thead th { background: var(--surface-2); font-weight: 600; }
.follow-settings tbody th { font-weight: 600; white-space: nowrap; }

/* ---------- media player ---------- */
.player-back { position: fixed; inset: 0; background: #111; z-index: 300; display: flex; flex-direction: column; color: #e6e8eb; }
.player-head { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #1d1f22; border-bottom: 1px solid #2e3137; }
.player-head .vt { font-weight: 600; }
.player-head .close { margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 20px; }
.player-main { flex: 1; display: flex; min-height: 0; }
.player-stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.player-view { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; background: #000; overflow: hidden; }
.player-view video, .player-view img { max-width: 100%; max-height: 100%; }
.player-view canvas.anno { position: absolute; cursor: crosshair; }
.player-view .noimg { color: #9aa0a6; }
.player-ctrl { height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: #1d1f22; }
.player-ctrl button { background: #2e3137; border: 0; color: #fff; border-radius: 4px; height: 30px; padding: 0 10px; }
.player-ctrl button:hover { background: #3c4047; }
.player-ctrl button.on { background: var(--primary); }
.player-ctrl input[type=range] { flex: 1; }
.player-ctrl .fc { font-variant-numeric: tabular-nums; min-width: 110px; text-align: center; }
.player-side { width: 380px; flex-shrink: 0; background: #1d1f22; border-left: 1px solid #2e3137; display: flex; flex-direction: column; min-height: 0; }
.player-side .ps-tabs { display: flex; border-bottom: 1px solid #2e3137; }
.player-side .ps-tabs button { flex: 1; background: transparent; border: 0; color: #c9ccd1; padding: 10px; border-bottom: 2px solid transparent; }
.player-side .ps-tabs button.active { color: #fff; border-bottom-color: #4da3ff; }
.player-side .ps-body { flex: 1; overflow: auto; padding: 10px; }
.player-side .note-card { background: #26292e; border-color: #3c4047; color: #e6e8eb; }
.player-side .note-card .nh .when, .player-side .note-card .nlinks { color: #9aa0a6; }
.player-side .composer { background: #26292e; border-color: #3c4047; }
.player-side .composer textarea, .player-side .note-card .reply-box input { background: #1d1f22; color: #fff; border-color: #3c4047; }
.player-side .info-row { border-bottom-color: #2e3137; }
.player-side .info-row .k { color: #9aa0a6; }
.player-side .info-row .v.editable:hover { background: #2e3137; }
.player-side .info-row .v.editing input, .player-side .info-row .v.editing select, .player-side .info-row .v.editing textarea { background: #1d1f22; color: #fff; }
.player-list { display: flex; gap: 6px; padding: 6px 12px; overflow-x: auto; background: #1d1f22; border-top: 1px solid #2e3137; }
.player-list .pl { width: 96px; flex-shrink: 0; cursor: pointer; opacity: .75; }
.player-list .pl.active { opacity: 1; outline: 2px solid #4da3ff; border-radius: 3px; }
.player-list .pl img, .player-list .pl .ph { width: 96px; height: 54px; object-fit: cover; background: #2e3137; display: block; border-radius: 3px; }
.player-list .pl .pn { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.anno-tools { display: flex; gap: 6px; align-items: center; }
.anno-tools .sw { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.anno-tools .sw.on { border-color: #fff; }

/* ---------- admin ---------- */
.admin { display: flex; flex: 1; min-height: 0; }
.admin .side { width: 220px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--border); padding: 10px 0; overflow: auto; }
.admin .side h3 { font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin: 12px 16px 4px; }
.admin .side a { display: block; padding: 6px 10px; margin: 1px 6px; border-radius: 6px; color: var(--text); transition: background-color var(--ease), color var(--ease); }
.admin .side a.active, .admin .side a:hover { background: var(--accent-soft); text-decoration: none; color: var(--primary-dark); }
.admin .content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-page { padding: 18px 20px; overflow: auto; }
.admin-page h2 { margin: 0 0 12px; font-size: 17px; font-weight: 650; letter-spacing: .01em; }
.admin-page .card { margin-bottom: 14px; }
.schema-list { display: flex; gap: 14px; flex: 1; min-height: 0; }
.schema-list .types { width: 240px; flex-shrink: 0; overflow: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.schema-list .types div { padding: 6px 10px; cursor: pointer; display: flex; justify-content: space-between; }
.schema-list .types div:hover, .schema-list .types div.active { background: var(--accent-soft); }
.schema-list .types div .t { color: var(--muted); font-size: 11px; }
.schema-list .fields { flex: 1; overflow: auto; }
table.simple { border-collapse: collapse; width: 100%; background: var(--panel); }
table.simple th, table.simple td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: middle; }
table.simple th { background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--text-2); }
table.simple tr:hover td { background: var(--row-hover); }
/* 権限の表（G39） */
.perm-tabs { display: flex; gap: 2px; margin: 12px 0 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.perm-tab { border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.perm-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }
table.perm-table td.perm-cell { text-align: center; width: 90px; }
table.perm-table th { text-align: center; }
table.perm-table th:first-child { text-align: left; }
td.perm-cond { background: var(--surface-3); }
td.perm-cond input { opacity: .55; }
td.perm-ro { background: var(--surface-2); }
td.perm-diff { background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.06) 0 4px, transparent 4px 8px); }
td.perm-dirty, table.simple tr:hover td.perm-dirty { background: #ffe3c2; box-shadow: inset 0 0 0 2px #f0932b; }
.perm-star { color: #b26a00; font-weight: 700; margin-left: 3px; }
tr.perm-group td { background: var(--surface-2); cursor: pointer; font-weight: 600; }
tr.perm-sub td:first-child { padding-left: 24px; }
.perm-diff-badge { margin-left: 8px; font-size: 11px; font-weight: 400; color: #8a5a00; background: #fff2d6; border-radius: 8px; padding: 1px 6px; }
.perm-savebar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-top: 10px; background: #fff7ec; border: 1px solid #f0932b; border-radius: var(--radius-lg); }
.perm-savebar[hidden] { display: none; }
.perm-savebar .spacer, .admin-page .flex > .spacer { flex: 1; }
.perm-dirty-msg { color: #b35a00; font-weight: 600; }
.code { font-family: Consolas, "Courier New", monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 12px; }
pre.code { padding: 10px; white-space: pre-wrap; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.flex { display: flex; align-items: center; gap: 8px; }
.mt { margin-top: 10px; }
.mb { margin-bottom: 10px; }
.kbd { font-family: Consolas, monospace; background: var(--surface-3); border-radius: 4px; border: 1px solid var(--border); border-bottom-width: 2px; padding: 0 4px; font-size: 11px; }

/* ---------- misc ---------- */
.loading { padding: 30px; color: var(--muted); text-align: center; }
.error-box { margin: 16px; padding: 12px; background: #fbe2df; color: #8c2a24; border-radius: var(--radius-lg); }
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination button { height: 26px; min-width: 26px; border: 1px solid var(--border-strong); background: var(--panel); border-radius: 5px; transition: background-color var(--ease); }
.pagination button:hover:not(:disabled) { background: var(--hover); }
.pagination button:disabled { opacity: .4; }
.pagination select { height: 26px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--panel); }
.ctx-help { color: var(--muted); font-size: 11px; }
.dropdown-filter-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--sel); color: var(--primary-dark); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.dropdown-filter-chip .x { cursor: pointer; font-weight: 700; }
.img-viewer { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 400; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.img-viewer img { max-width: 95vw; max-height: 95vh; }

@media (max-width: 900px) {
  .filter-panel { display: none; }
  .global-search input { width: 150px; }
  .brand-text { display: none; }
  .overview { grid-template-columns: 1fr; }
  .split .list { width: 100%; }
  .split .detail { display: none; }
  .player-side { display: none; }
}

/* ---------- login ---------- */
.login-screen { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 40px; overflow: auto; background: radial-gradient(900px 480px at 50% -8%, rgba(86, 130, 255, .28), transparent 70%), var(--topbar); }
.login-card { width: 388px; max-width: 100%; background: var(--panel); border-radius: 14px; padding: 28px 30px 30px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06); display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.login-card h1 { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: .01em; }
.login-field { display: flex; flex-direction: column; gap: 4px; font-weight: 500; color: var(--text-2); }
.login-field input { height: 38px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 11px; font-size: 14px; font-weight: 400; background: var(--panel); transition: border-color var(--ease), box-shadow var(--ease); }
.login-field input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.login-field input[readonly] { background: var(--hover); color: var(--muted); }
.login-field .hint, .login-note { color: var(--muted); font-size: 12px; font-weight: 400; margin: 0; line-height: 1.6; }
.login-link { background: none; border: 0; padding: 0; color: var(--accent, #4a90d9); text-decoration: underline; cursor: pointer; font: inherit; }
.login-error { background: #fbe2df; color: #8c2a24; border-radius: 8px; padding: 8px 10px; }
.login-submit { height: 40px; justify-content: center; font-size: 14px; border-radius: 8px; }
a.login-submit { text-decoration: none; display: flex; align-items: center; }
.login-sep { text-align: center; }
.pw-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pw-list .tb-btn { gap: 6px; }

/* ダッシュボード */
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; align-content: start; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } .dash-card { grid-column: auto !important; } }
.dash-card { min-height: 140px; display: flex; flex-direction: column; }
.dash-head { display: flex; align-items: center; gap: 6px; }
.dash-head h3 { flex: 1; margin-bottom: 8px; }
.dash-tools button { border: 1px solid var(--border); background: var(--panel); border-radius: 5px; height: 22px; min-width: 22px; cursor: pointer; font-size: 11px; }
.dash-body { flex: 1; min-height: 0; overflow: auto; }
.dash-number { font-size: 44px; font-weight: 700; letter-spacing: -.02em; text-align: center; padding: 14px 0 4px; color: var(--primary); }
.dash-card.draggable { cursor: grab; }
.dash-card.dragging { opacity: .5; }
.dash-card.drop-target { outline: 2px dashed var(--accent, var(--primary)); outline-offset: 2px; }
.dash-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.dash-thumb, .dash-thumb-one { display: block; color: inherit; text-decoration: none; }
.dash-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: var(--hover); display: block; }
.dash-thumb-one img { max-width: 100%; max-height: 320px; border-radius: 4px; display: block; margin: 0 auto 4px; }
.dash-thumb-one { text-align: center; }
.dash-thumb-none { aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: var(--hover); color: var(--faint); border-radius: 4px; font-size: 11px; }
.dash-thumb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.dash-gantt { display: flex; flex-direction: column; gap: 3px; }
.dash-gantt .dg-head, .dash-gantt .dg-row { display: grid; grid-template-columns: 34% 1fr; gap: 8px; align-items: center; font-size: 12px; }
.dash-gantt .dg-range { text-align: right; }
.dash-gantt .dg-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-gantt .dg-track { position: relative; height: 16px; background: var(--hover); border-radius: 3px; overflow: hidden; }
.dash-gantt .dg-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; }
.dash-gantt .dg-today { position: absolute; top: 0; bottom: 0; width: 1px; background: #ff3b30; }
.dash-bars { display: flex; flex-direction: column; gap: 4px; }
.dash-bar { display: grid; grid-template-columns: 30% 1fr 52px; gap: 8px; align-items: center; font-size: 12px; }
.dash-bar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar .b { background: var(--hover); border-radius: 3px; height: 14px; overflow: hidden; }
.dash-bar .b i { display: block; height: 100%; border-radius: 3px; }
.dash-bar .v { text-align: right; font-variant-numeric: tabular-nums; }
.dash-stack { display: flex; height: 22px; border-radius: 4px; overflow: hidden; background: var(--hover); margin: 6px 0 10px; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.dash-legend.col { flex-direction: column; }
.dash-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dash-table th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); padding: 4px 6px; }
.dash-table td { border-bottom: 1px solid var(--line); padding: 4px 6px; }
.dash-table tr:hover td { background: var(--row-hover); }
.dash-list .dash-li { padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
/* まだ見ていないバージョン（viewed_by_current_user が false） */
tr.unviewed td:nth-child(-n+3) { font-weight: 700; }
.ecard.unviewed .cn::before, .player-list .pl.unviewed .pn::before { content: "●"; color: var(--primary); font-size: 9px; margin-right: 4px; vertical-align: middle; }
/* 分割したタスク（Task.splits）: 期間ごとのバーと、あいだをつなぐ線 */
.split-link { position: absolute; top: 50%; height: 0; border-top: 2px dotted #9aa0a6; }
.bar-t.split { z-index: 1; }
.split-editor .flex { margin-bottom: 4px; gap: 4px; align-items: center; }
table.import-map select { width: 100%; }
.import-summary { margin-top: 12px; }
.import-errors { margin: 6px 0 0; padding-left: 18px; color: #c0392b; font-size: 12px; max-height: 160px; overflow: auto; }
.thumb-wrap { display: block; position: relative; background-size: cover; background-position: center; background-repeat: no-repeat; overflow: hidden; }
.thumb-wrap > img { transition: opacity .15s; }
.thumb-wrap.playable { cursor: pointer; }
.thumb-wrap > .thumb-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; background: transparent; }
.thumb-wrap > .thumb-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; line-height: 30px; text-align: center; padding-left: 2px; box-sizing: border-box; opacity: 0; transition: opacity .12s; pointer-events: none; z-index: 1; }
.thumb-wrap.playable:hover > .thumb-play { opacity: 1; }
.grid td .thumb-wrap > .thumb-play { width: 16px; height: 16px; font-size: 8px; line-height: 16px; padding-left: 1px; }

/* ---------- プロジェクト概要（Flow と同じ並び） ---------- */
.pov { min-height: 100%; background: var(--bg); display: flex; flex-direction: column; }
.pov-bill { position: relative; height: 190px; background: #d3d8e0 center / cover no-repeat; flex: none; }
.pov-bill-ph { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-12deg); font-size: 96px; opacity: .25; filter: grayscale(1); pointer-events: none; }
.pov-bill-up { position: absolute; right: 16px; top: 12px; background: transparent; border: 0; color: var(--text-2); font-size: 12px; cursor: pointer; }
.pov-bill-up:hover { text-decoration: underline; }
.pov-bill-name { position: absolute; left: 12px; bottom: -12px; display: flex; align-items: flex-end; gap: 14px; right: 12px; }
.pov-bill-name::before { content: ""; position: absolute; left: -12px; right: -12px; bottom: 12px; height: 70px; background: linear-gradient(transparent, rgba(0,0,0,.35)); pointer-events: none; }
.pov-thumb { position: relative; width: 92px; height: 92px; object-fit: cover; border: 3px solid #fff; border-radius: 10px; background: var(--panel); box-shadow: 0 1px 4px rgba(0,0,0,.3); cursor: pointer; flex: none; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 11px; }
.pov-bill-name h1 { position: relative; margin: 0 0 22px; color: #fff; font-size: 30px; font-weight: 600; letter-spacing: .01em; text-shadow: 0 1px 3px rgba(0,0,0,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pov-tabs { display: flex; gap: 6px; padding: 14px 16px 0 120px; background: var(--panel); border-bottom: 1px solid var(--border); flex: none; }
.pov-tabs a { padding: 6px 16px 8px; color: var(--text-2); font-size: 12px; border-bottom: 2px solid transparent; }
.pov-tabs a:hover { text-decoration: none; color: var(--text); }
.pov-tabs a.active { color: var(--text); border-bottom-color: var(--primary); }
.pov-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
.pov-stream { padding: 12px; max-width: 640px; }
.pov-item { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.pov-item > .avatar { flex: none; width: 32px; height: 32px; border-radius: 8px; }
.pov-item > .note-card, .pov-item > .pov-card, .pov-item > .composer { flex: 1; min-width: 0; margin: 0; border-radius: 8px; }
.pov-composer textarea { min-height: 30px; height: 30px; border: 0; padding: 4px; resize: none; }
.pov-composer textarea.open { height: 80px; border: 1px solid var(--border-strong); resize: vertical; }
.pov-card { background: var(--panel); border: 1px solid var(--border); padding: 8px 10px; box-shadow: var(--shadow-sm); overflow: hidden; }
.pov-ch { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); font-size: 12px; margin-bottom: 6px; }
.pov-ch > span:first-child { flex: 1; min-width: 0; }
.pov-ch .when { color: var(--muted); font-size: 11px; white-space: nowrap; }
.pov-desc { margin-bottom: 6px; white-space: pre-wrap; word-break: break-all; }
/* Flow と同じく、カードの幅いっぱいに切り抜いて見せ、再生マークを重ねる。background はまとめ書きにしない（ぼかしの下地が繰り返し模様になる） */
.pov-card .thumb-wrap.pov-vthumb { display: block; width: calc(100% + 20px); margin: 0 -10px 8px; background-color: #222; aspect-ratio: 16 / 9; }
.pov-card .thumb-wrap.pov-vthumb:last-child { margin-bottom: -8px; }
.pov-card img.pov-vthumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.pov-card .thumb-wrap.pov-vthumb > .thumb-play { opacity: .85; width: 40px; height: 40px; line-height: 36px; font-size: 16px; border: 2px solid rgba(255,255,255,.85); box-sizing: border-box; }
.pov-card .pov-desc:last-child { margin-bottom: 0; }
.pov-nomedia { padding: 6px 0; }
.pov-more { display: block; margin: 0 auto 16px 40px; }
.pov-empty { padding: 16px 0 16px 40px; }
.pov-side { background: var(--surface-2); border-left: 1px solid var(--border); padding: 12px 14px; }
.pov-side section { margin-bottom: 22px; }
.pov-sh { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.pov-sh button { background: transparent; border: 0; font-size: 15px; cursor: pointer; color: var(--text-2); padding: 0 2px; }
.pov-media { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pov-media .thumb-wrap.pov-mthumb { display: block; aspect-ratio: 4 / 3; background-color: #222; overflow: hidden; border-radius: 4px; }
.pov-media img.pov-mthumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.pov-links { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; }
.pov-links.right { justify-content: flex-end; }
.pov-users { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pov-users .avatar { width: 26px; height: 26px; border-radius: 6px; }
.pov-usermore { font-size: 11px; color: var(--text-2); padding: 0 4px; }
.pov-info { display: grid; grid-template-columns: 90px 1fr; gap: 6px 8px; font-size: 11px; }
.pov-info .k { color: var(--muted); }
.pov-info .v { word-break: break-all; }
@media (max-width: 800px) { .pov-body { grid-template-columns: 1fr; } .pov-side { border-left: 0; border-top: 1px solid var(--border); } .pov-tabs { padding-left: 16px; } }

/* Flow から読み込んだページの、ページ内のレイアウト（タブ） */
.layout-tabs { display: flex; gap: 2px; padding: 6px 12px 0; background: var(--panel); border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; }
.layout-tabs a.lt-tab { text-decoration: none; }
.layout-tabs button, .layout-tabs a.lt-tab { border: 1px solid transparent; border-bottom: 0; background: transparent; padding: 5px 12px; font-size: 12px; color: var(--text-2); border-radius: 4px 4px 0 0; white-space: nowrap; cursor: pointer; }
.layout-tabs button:hover, .layout-tabs a.lt-tab:hover { background: var(--surface-3); color: var(--text); }
.layout-tabs button.active, .layout-tabs a.lt-tab.active { background: var(--accent-soft); border-color: var(--border); color: var(--text); font-weight: 600; }

/* ---------- 一覧を Flow に合わせる: 折り返し・大きめのサムネイル・書式ルールの色・表は列幅の合計・フィルタは右 ---------- */
.grid-wrap:has(> table.grid) { background: var(--bg); }
.grid { min-width: 0; background: var(--panel); }
.grid.wrap tbody td { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; text-overflow: clip; height: auto; vertical-align: top; padding-top: 5px; padding-bottom: 5px; line-height: 1.45; }
.grid.wrap tbody td.thumb-cell, .grid.wrap tbody td.sel-col, .grid.wrap tbody td.step-cell { padding-top: 3px; padding-bottom: 3px; }
.grid.wrap tbody tr.group-row td { white-space: nowrap; vertical-align: middle; }
.grid td .thumb-wrap.thumb, .grid td img.thumb { width: 84px; height: 48px; }
.grid td .thumb-wrap.thumb { display: block; }
.grid td .thumb.empty { width: 84px; height: 48px; }
.grid tbody tr.ruled td, .grid tbody td.ruled { background: var(--rule-bg); }
.grid tbody tr.ruled:hover td, .grid tbody tr:hover td.ruled { background: var(--rule-bg); filter: brightness(.96); }
.grid tbody tr.selected.ruled td { background: var(--sel-strong); }
.filter-panel.right { order: 2; border-right: 0; border-left: 1px solid var(--border); }
.grid .status.icon-only .code, .grid .status.icon-only .nm { display: none; }
.grid .status.icon-only { justify-content: center; width: 100%; }
.grid.wrap tbody td { line-height: 1.35; font-size: 12px; }
.grid tbody tr.status-row td { background: color-mix(in srgb, var(--status-bg) 40%, var(--panel)); }
.grid tbody tr.status-row:hover td { background: color-mix(in srgb, var(--status-bg) 55%, var(--panel)); }
.grid tbody tr.status-row.selected td, .grid tbody tr.selected td { background: var(--sel-strong); }

/* ---------- メディア（Flow のメディア画面に合わせた暗い配色） ---------- */
.media-app { flex: 1; min-height: 0; display: flex; background: #2b2d31; color: #c9ccd1; --border: #3c3f45; --border-strong: #4a4e56; --line: #34373d; --panel: #2b2d31; --surface-2: #26282c; --surface-3: #33363c; --hover: #33363c; --row-hover: #303339; --muted: #8b9099; --faint: #6f747c; --text: #d7dade; --text-2: #c9ccd1; --primary: #4db2ff; --primary-dark: #7cc6ff; --accent-soft: #263645; --sel: #1f3a52; --sel-strong: #285074; --accent-border: #2f5878; --ring: #2f6a99; --bg: #232528; --scroll-thumb: rgba(160, 170, 188, .3); --scroll-thumb-hover: rgba(160, 170, 188, .5); }
.media-side { width: 248px; flex-shrink: 0; background: #232528; border-right: 1px solid #1b1c1f; display: flex; flex-direction: column; min-height: 0; }
.ms-tabs { display: flex; gap: 4px; padding: 10px 12px 0; }
.ms-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: #9aa0a6; font-size: 15px; padding: 4px 8px 6px; }
.ms-tabs button.active { color: #4db2ff; border-bottom-color: #4db2ff; }
.ms-search-wrap { padding: 8px 6px; }
.ms-search { width: 100%; background: #1b1c1f; border: 1px solid #3c3f45; border-radius: 3px; color: #d7dade; padding: 4px 8px; font-size: 12px; }
.ms-body { flex: 1; overflow: auto; padding-bottom: 12px; }
.ms-sec { color: #7d828a; font-size: 11px; padding: 14px 14px 6px; }
.ms-empty { color: #6b7078; font-style: italic; font-size: 11px; padding: 4px 32px 8px; }
.ms-item { display: flex; align-items: center; gap: 4px; height: 24px; padding-right: 6px; cursor: pointer; color: #c9ccd1; font-size: 12px; }
.ms-item:hover { background: #30333a; }
.ms-item.active { background: #1ea7fd; color: #fff; }
.calc-picks { flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.calc-picks select { max-width: 220px; }
.field-warn { color: #b26a00; }
.field-warn:empty { display: none; }
.query-builder .qb-row { gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.query-builder .qb-row select { max-width: 200px; }
.media-meta { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 6px; min-height: 0; }
.media-meta:empty { display: none; }
.media-desc { color: #c9ccd1; font-size: 12px; white-space: pre-wrap; cursor: text; max-width: 720px; border-radius: 3px; padding: 2px 4px; }
.media-desc.empty { color: #7d828a; font-style: italic; }
.media-desc:hover, .media-desc:focus { background: #30333a; outline: none; }
.media-desc-edit { flex: 1; max-width: 720px; background: #1b1d21; color: #e6e8eb; border: 1px solid #1ea7fd; border-radius: 3px; font: inherit; font-size: 12px; padding: 4px 6px; }
.ms-parent-wrap { padding: 4px 10px 6px; }
.ms-parent { width: 100%; background: #1b1d21; color: #c9ccd1; border: 1px solid #3a3e46; border-radius: 3px; font-size: 12px; padding: 3px 4px; }
.ms-item.drop-target { outline: 2px dashed #1ea7fd; outline-offset: -2px; background: #23384a; }
.ms-tw { width: 12px; text-align: center; color: #8b9099; flex-shrink: 0; }
.ms-item.active .ms-tw { color: #fff; }
.ms-ic { width: 14px; text-align: center; opacity: .75; flex-shrink: 0; }
.ms-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-fav { visibility: hidden; color: #8b9099; }
.ms-item:hover .ms-fav, .ms-fav.on { visibility: visible; }
.ms-fav.on { color: #f5c542; }
.media-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.media-head { padding: 8px 12px 0; }
.media-head-row { display: flex; align-items: center; gap: 6px; }
.media-crumb { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-right: 12px; }
.media-crumb a { color: #c9ccd1; }
.media-crumb .sep { color: #6b7078; }
.media-title { font-size: 22px; font-weight: 400; color: #e6e8eb; margin: 4px 0 6px; }
.media-list { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.media-list .page { background: #2b2d31; }
.media-app .toolbar { background: #2b2d31; border-bottom: 1px solid #3c3f45; }
.media-app .tb-btn { background: transparent; border-color: transparent; color: #c9ccd1; }
.media-app .tb-btn:hover { background: #3a3d44; }
.media-app .tb-btn.active { background: transparent; color: #4db2ff; }
.media-app .tb-group .tb-btn.active { color: #4db2ff; }
.media-app .tb-input { background: #1b1c1f; border-color: #3c3f45; color: #d7dade; border-radius: 12px; min-width: 220px; }
.media-app .count, .media-app .pagination { color: #8b9099; }
.media-app .pagination button, .media-app .pagination select { background: #1b1c1f; color: #c9ccd1; border-color: #3c3f45; }
.media-latest { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #c9ccd1; cursor: pointer; margin-right: 4px; }
.media-app .page-body { background: #2b2d31; }
.media-app .cards { grid-template-columns: repeat(auto-fill, 202px); gap: 34px 34px; padding: 20px 24px; }
.mcard { background: transparent; border: 0; border-radius: 0; }
.mcard:hover { box-shadow: none; }
.mcard .ci { height: 114px; background: #1b1c1f; }
.mcard.selected { outline: 2px solid #1ea7fd; outline-offset: 2px; }
.mc-bar { display: flex; align-items: center; gap: 8px; height: 26px; background: #232528; border: 1px solid #3c3f45; border-top: 0; padding: 0 8px; }
.mc-bar .cn { flex: 1; font-weight: 400; font-size: 11px; color: #d7dade; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-play { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #1ea7fd; background: transparent; padding: 0; position: relative; flex-shrink: 0; }
.mc-play::after { content: ""; position: absolute; left: 5px; top: 3px; border-left: 6px solid #1ea7fd; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.mc-play.seen { border-color: #8b9099; }
.mc-play.seen::after { border-left-color: #8b9099; }
.ms-sec { display: flex; align-items: center; gap: 6px; }
.ms-sec .ms-sec-btn { margin-left: auto; background: none; border: 0; color: #8b9099; cursor: pointer; font-size: 11px; padding: 0 2px; }
.ms-sec .ms-sec-btn:hover { color: #fff; }
.ms-x { visibility: hidden; color: #8b9099; padding: 0 2px; }
.ms-item:hover .ms-x { visibility: visible; }
.ms-x:hover { color: #fff; }
.ms-add { display: block; width: calc(100% - 20px); margin: 8px 10px 0; }
.ms-rename { flex: 1; min-width: 0; height: 20px; font-size: 12px; background: #1d1f22; color: #fff; border: 1px solid #1ea7fd; padding: 0 4px; }
.mc-play.off { border-color: #5d6168; }
.mc-play.off::after { border-left-color: #5d6168; }
.mc-extra { background: #232528; border: 1px solid #3c3f45; border-top: 0; padding: 2px 8px 6px; }
.mc-extra .cf { color: #8b9099; }
.media-app .grid-wrap { background: #2b2d31; }
.media-app .filter-panel { background: #232528; color: #c9ccd1; border-color: #3c3f45; }
.media-app .selection-bar { background: #1f3a52; border-bottom-color: #2f5878; color: #e6e8eb; }
.media-app .selection-bar .tb-btn { color: #e6e8eb; }
.media-app .selection-bar .tb-btn.danger { color: #ff8a8a; }

.nav-paste { width: 100%; box-sizing: border-box; font: inherit; font-size: 12px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; resize: vertical; }
.nav-paste-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

/* サイトのお知らせバナー（トップバーの下の帯） */
.site-banners { flex-shrink: 0; }
.site-banner { display: flex; align-items: flex-start; gap: 10px; padding: 7px 14px; font-size: 13px; line-height: 1.5; border-bottom: 1px solid rgba(0, 0, 0, .12); background: #e3f0fb; color: #12395c; }
.site-banner.warning { background: #ffe2bd; color: #6b3d00; }
.site-banner.acting { background: #1f6fbf; color: #fff; align-items: center; }
.site-banner.acting .acting-exit { flex: none; background: #fff; color: #1f6fbf; border-color: #fff; font-weight: 600; }
.site-banner.critical { background: #f8d7da; color: #6b1620; font-weight: 600; }
.site-banner .sb-icon { flex: none; }
.site-banner .sb-text { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.site-banner .sb-link { flex: none; color: inherit; text-decoration: underline; }
.site-banner .sb-close { flex: none; border: 0; background: transparent; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 4px; }
.site-banner .sb-close:hover { background: rgba(0, 0, 0, .1); }
.site-banner-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #e3f0fb; color: #12395c; white-space: nowrap; }
.site-banner-chip.warning { background: #fff3cd; color: #5c4400; }
.site-banner-chip.critical { background: #f8d7da; color: #6b1620; }

/* 設定のチェックの並び（メール通知、取り込みの選択肢） */
.pref-group { border: 1px solid var(--border); border-radius: 6px; margin: 0 0 10px; padding: 6px 12px 10px; }
.pref-group legend { font-weight: 600; font-size: 12px; padding: 0 6px; color: var(--text-2); }
.pref-row { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0 !important; font-weight: 400 !important; cursor: pointer; }
.pref-row input[type=checkbox] { margin-top: 3px; flex: none; }

/* カットの取り込み（EDL / OTIO）の差分 */
.cut-import-result p { margin: 6px 0; }
.ci-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.ci-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.ci-chip.ci-new { background: #d9f2e0; color: #17572a; }
.ci-chip.ci-change { background: #dbe9ff; color: #1c3f7a; }
.ci-chip.ci-move { background: #ece5fb; color: #45307a; }
.ci-chip.ci-warn { background: #fff3cd; color: #5c4400; }
.ci-chip.ci-omit { background: #f8d7da; color: #6b1620; }
.ci-table { max-height: 46vh; overflow: auto; border: 1px solid var(--border); border-radius: 6px; margin-top: 8px; }
.ci-table thead th { position: sticky; top: 0; }
.ci-table tr.ci-omit td { color: #8c2a24; text-decoration: line-through; }
.ci-table tr.ci-omit td:nth-child(2), .ci-table tr.ci-omit td:last-child { text-decoration: none; }
.ci-table tr.ci-same td { color: var(--muted); }
.ci-nochange { padding: 8px 10px; background: #eef6ee; border-radius: 6px; }

/* 行のフォーマット（色分けのルール）: 文字色を付けた行では、リンクも同じ色にする。選んだ行は読める色に戻す */
.grid tbody .ruled-color a, .grid tbody .ruled-color .muted { color: inherit; }
.grid tbody td.invalid-cell { background: #fde3e1 !important; box-shadow: inset 0 0 0 1px #e5484d; color: #a4262c; }
.grid tbody td.invalid-warn { box-shadow: inset 0 -2px 0 #e0a100; }
.grid tbody tr.selected.ruled-color td, .grid tbody tr.selected td.ruled-color { color: var(--text); }
.rr-list { max-height: 56vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.rr-rule { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--panel); }
.rr-head { display: flex; align-items: center; gap: 6px; }
.rr-head input[type=text] { flex: 1; min-width: 120px; height: 28px; }
.rr-head select { height: 28px; max-width: 220px; }
.rr-conds { margin: 6px 0 4px 22px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.rr-cond { display: grid; grid-template-columns: 200px 200px 130px auto; gap: 6px; align-items: center; }
.rr-cond select, .rr-cond input { height: 28px; min-width: 0; width: 100%; }
.rr-style { display: flex; align-items: center; gap: 16px; margin-left: 22px; }
.rr-color { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.rr-color input[type=color] { width: 34px; height: 24px; padding: 0; border: 1px solid var(--border); border-radius: 4px; background: var(--panel); }
.rr-color input[type=color]:disabled { opacity: .35; }

/* ページの ☆ と「変更済み」 */
.page-star { border: 0; background: none; padding: 0 2px; font-size: 16px; line-height: 1; cursor: pointer; color: var(--muted, var(--faint)); }
.page-star.on { color: #f5b301; }
.page-dirty { color: #8a5a00; background: #fdefd6; border-radius: 10px; padding: 1px 8px; height: auto; font-size: 11px; }

/* ブラウザ表示（左に一覧、右に詳細） */
.browser-view { display: flex; flex: 1; min-width: 0; min-height: 0; }
.browser-list { width: 260px; flex: none; overflow-y: auto; border-right: 1px solid var(--border); background: var(--panel); }
.browser-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 12px; }
.browser-item:hover { background: var(--surface-2); }
.browser-item.active { background: var(--sel); }
.browser-item .bthumb { width: 46px; height: 28px; flex: none; object-fit: cover; background: var(--surface-3); border-radius: 4px; }
.browser-item .bname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.browser-detail { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- グラフのタブ（Flow のキャンバスのレイアウト） ---------- */
.canvas-body { overflow: auto; padding: 12px; display: block; }
.canvas-row { display: grid; gap: 12px; align-items: start; margin-bottom: 12px; }
.canvas-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 900px) { .canvas-row { grid-template-columns: minmax(0, 1fr) !important; } }
.canvas-card { min-height: 0; padding: 0; overflow: hidden; }
.canvas-card .dash-body { padding: 10px 12px 12px; }
.canvas-card.collapsed .dash-body { display: none; }
.canvas-head { background: var(--surface-2); padding: 4px 6px; border-bottom: 1px solid var(--border); }
.canvas-card.collapsed .canvas-head { border-bottom: 0; }
.canvas-title { flex: 1; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; padding: 2px 4px; min-width: 0; }
.canvas-title h3 { margin: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas-caret { font-size: 10px; width: 10px; }
.canvas-refresh { border: 0; background: transparent; color: inherit; cursor: pointer; opacity: .6; font-size: 13px; }
.canvas-refresh:hover { opacity: 1; }
.dash-bar .b.none { background: transparent; }
.dash-bar.total { border-top: 1px solid var(--border); padding-top: 4px; font-weight: 600; }
.dash-none { padding: 18px 0; text-align: center; }
.dash-total { font-weight: 600; margin-top: 4px; }
.dash-number.neg { color: #d93025; }
.page-history { min-width: min(820px, 86vw); max-height: 70vh; overflow: auto; }
.ph-month-head { border: 0; background: none; font: inherit; font-weight: 600; padding: 8px 0 4px; cursor: pointer; color: inherit; }
.ph-entry { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.ph-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ph-head .spacer { flex: 1; }
.ph-badge { background: #e8f0fe; color: #174ea6; border-radius: 10px; padding: 1px 8px; font-size: 12px; }
.ph-name { font-weight: 600; margin-top: 6px; }
.ph-desc { white-space: pre-wrap; margin-top: 2px; }
.ph-summary { margin: 6px 0 0 18px; padding: 0; }
.ph-detail { margin-top: 6px; }
.ph-change { margin-top: 6px; }
.ph-ba { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.ph-ba pre { margin: 2px 0 0; padding: 6px; background: var(--surface-2); border-radius: 4px; white-space: pre-wrap; word-break: break-all; font-size: 11px; max-height: 160px; overflow: auto; }
.dash-divider { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.dash-web { width: 100%; border: 1px solid var(--border); border-radius: 4px; background: var(--panel); }
.chart-box { display: flex; flex-direction: column; gap: 8px; }
.chart-svg { width: 100%; height: auto; max-height: 320px; display: block; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { stroke: #b6bcc6; stroke-width: 1; }
.chart-svg .tick { font-size: 10px; fill: #667085; }
.chart-svg .mark:hover { opacity: .8; }
.chart-key { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: inherit; cursor: pointer; }
.chart-key.off { opacity: .35; text-decoration: line-through; }
.chart-h .b.stackrow { display: flex; gap: 2px; background: transparent; }
.chart-h .b.stackrow i { border-radius: 3px; flex: none; }
.chart-h .multi { display: flex; flex-direction: column; gap: 2px; }
.chart-h .multi .b { height: 8px; }
.canvas-card .dash-bar { grid-template-columns: 28% 1fr minmax(52px, auto); }
/* ステップ列: 工程名の見出し、ステータスの背景色、空のセルの ＋ はマウスを乗せたときだけ */
.grid th.step-col .step-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid td.step-cell.step-colored.dark, .grid td.step-cell.step-colored.dark .cell-muted { color: #fff; }
.grid td.step-cell.step-colored .cell-muted { color: inherit; opacity: .85; }
.grid td.step-cell, .grid.wrap tbody td.step-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid td.step-cell .step-add { opacity: 0; }
.grid td.step-cell:hover .step-add { opacity: 1; }
.grid td.step-cell.step-colored.dark .status .code { color: #1f2328; }

/* ステップ列を Flow と同じ 2 段の見出しにする（上: 工程名、下: ステータス・担当者・タスク名など） */
.grid.two-row thead tr:first-child th { height: 34px; }
.grid.two-row thead tr.step-sub th { top: 34px; height: 22px; padding: 0 2px; font-weight: 500; font-size: 10px; letter-spacing: -.06em; color: var(--text-2); background: var(--surface-3); text-overflow: clip; }
.grid.two-row thead tr.step-sub th .th-inner { justify-content: center; }
/* 細いステップ（閉じているステップ）でも工程名が読めるよう、見出しは 2 行まで折り返す */
.grid.two-row thead th.step-col { padding: 0 3px; }
.grid.two-row thead th.step-col .step-name { white-space: normal; line-height: 1.1; font-size: 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.grid.two-row thead th.step-col .color-swatch { flex-shrink: 0; }
.grid td.step-sub a.ent-link { color: inherit; }
.grid thead th.step-col { border-left: 2px solid var(--border-strong); }
.grid thead th.step-sub-col.first, .grid tbody td.step-sub.first { border-left: 2px solid var(--border-strong); }
.grid td.step-sub { padding: 0 4px; }
.grid td.step-status { text-align: center; cursor: pointer; }
.grid td.step-status .step-st { font-size: 11px; font-weight: 600; letter-spacing: .01em; }
.grid td.step-status.dark { color: #fff; }
.grid.wrap tbody td.nowrap, .grid tbody td.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid thead th.step-col.narrow .color-swatch { display: none; }
.grid thead th.step-col.narrow { box-shadow: inset 0 3px 0 var(--step-color); }
.grid thead th.step-col.narrow .th-inner { justify-content: center; text-align: center; }

/* Flow に合わせたステップ列: 見出しは工程の色で塗る、まとまりの両側に工程の色の太い線、中は灰色の地、ステータスは色の箱とアイコン */
.grid.two-row thead th.step-col.filled { background: var(--step-color); color: #1f2328; box-shadow: none; text-align: left; }
.grid.two-row thead th.step-col.filled.dark { color: #fff; }
.grid.two-row thead th.step-col.filled .color-swatch { display: none; }
.grid.two-row thead th.step-col.filled .th-inner { justify-content: flex-start; gap: 3px; }
.grid thead th.step-col .step-toggle { cursor: pointer; font-size: 12px; line-height: 1; padding: 1px 3px; border-radius: 2px; background: rgba(255,255,255,.55); color: #1f2328; flex-shrink: 0; }
.grid thead th.step-col .step-toggle:hover { background: #fff; }
.grid thead th.step-col, .grid thead th.step-sub-col.first, .grid tbody td.step-sub.first { border-left: 3px solid var(--step-color, var(--border-strong)); }
.grid thead th.step-col, .grid thead th.step-sub-col.last, .grid tbody td.step-sub.last { border-right: 3px solid var(--step-color, var(--border-strong)); }
.grid tbody tr td.step-sub, .grid tbody tr.ruled td.step-sub, .grid tbody tr.status-row td.step-sub { background: var(--surface-3); }
.grid tbody tr.selected td.step-sub { background: var(--sel); }
.grid td.step-status { text-align: left; padding: 3px 4px; }
.grid td.step-status .step-box { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 16px; border-radius: 1px; color: #1f2328; }
.grid td.step-status .step-box.dark { color: #fff; }
.grid td.step-sub a.ent-link { color: var(--text); text-decoration: underline; text-decoration-color: rgba(0,0,0,.35); }
.st-ico { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; line-height: 0; }
.status .st-ico svg { width: 13px; height: 13px; }
.grid .status.icon-only .st-ico svg { width: 15px; height: 15px; }
/* Flow と同じく、一覧のサムネイルの左下に再生の印をいつも出す */
.grid td .thumb-wrap.playable > .thumb-play { opacity: .9; left: 3px; top: auto; bottom: 3px; transform: none; }
/* Flow の「見出しを折り返す」: 細い列の見出しも 2 行まで出す */
.grid.wrap-head thead th .th-label { white-space: normal; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }

/* Flow と同じ並び: 1 段目にページ名・☆・タブ（More ▾）、2 段目に操作、右に検索とフィルタ */
.page-head { display: flex; align-items: center; gap: 6px; padding: 6px 12px 0; background: var(--panel); flex-shrink: 0; min-width: 0; }
.page-head h1 { font-size: 16px; margin: 0 10px 0 0; font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.page-head .spacer { flex: 1; }
.layout-tabs.inline { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0; padding: 0; background: transparent; border-bottom: 0; overflow: hidden; }
.layout-tabs.inline button, .layout-tabs.inline a.lt-tab { border: 0; border-radius: 0; background: transparent; padding: 6px 9px; font-size: 12px; color: var(--text-2); white-space: nowrap; flex-shrink: 0; }
.layout-tabs.inline button:hover, .layout-tabs.inline a.lt-tab:hover { color: var(--primary); background: transparent; }
.layout-tabs.inline button.active, .layout-tabs.inline a.lt-tab.active { color: var(--primary); background: transparent; font-weight: 600; box-shadow: inset 0 -2px 0 var(--primary); }
.layout-tabs.inline .lt-more { color: var(--text-2); }
.toolbar.page-tools { padding-top: 6px; }
.toolbar.page-tools { flex-wrap: nowrap; overflow: hidden; }
.toolbar.page-tools > * { flex-shrink: 0; }
.toolbar.page-tools .tb-search { flex: 0 1 240px; width: 240px; min-width: 110px; }
.toolbar.page-tools .spacer { flex: 1 1 0; min-width: 4px; }

/* Flow と同じく、ページのタブは 1 段目の右側に寄せる */
.layout-tabs.inline { justify-content: flex-end; }
/* ステップの中に同じステップのタスクが複数あるときは、1 タスク 1 行で縦に並べる（Flow と同じ） */
.grid td.step-sub.multi { padding: 0; vertical-align: top; }
.grid td.step-sub .step-line { height: 19px; line-height: 19px; padding: 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-bottom: 1px solid var(--line); box-sizing: border-box; }
.grid td.step-sub .step-line:last-child { border-bottom: 0; }
.grid td.step-status.multi .step-line { padding: 1px 2px; cursor: pointer; }
.grid td.step-status .step-line .step-box { min-height: 16px; height: 16px; }
/* 独自アイコン（Flow で作った画像のアイコン） */
.st-ico.st-img { display: inline-flex; align-items: center; }
.st-ico.st-img img { width: 14px; height: 14px; display: block; image-rendering: pixelated; }
/* ステータスの欄をステータスの色で塗る */
.grid td.st-filled.dark, .grid td.st-filled.dark a { color: #fff; }
/* 行の書式ルールで文字を白にした行でも、ステップ列（灰色の背景）の文字は読める色のまま（Flow と同じ） */
.grid tr.ruled td.step-cell { color: var(--text); }
/* ステップ列: タスクフィルタの印、見出しのメニュー、ALL TASKS、集計（G14） */
.grid thead th.step-col .step-menu { cursor: pointer; font-size: 11px; line-height: 1; padding: 1px 3px; border-radius: 2px; opacity: .55; flex-shrink: 0; }
.grid thead th.step-col .step-menu:hover, .grid thead th.step-col .step-menu:focus { opacity: 1; background: rgba(255,255,255,.6); color: #1f2328; }
.grid thead th.step-col .step-filter { font-size: 10px; white-space: nowrap; padding: 0 3px; border-radius: 2px; background: #1f6fd0; color: #fff; flex-shrink: 0; }
.grid thead th.step-col.all-tasks { font-weight: 700; }
.grid td.step-cell.step-multi { white-space: normal; }
.grid td.step-cell .step-mini { cursor: pointer; margin-right: 2px; }
.grid td.step-cell .step-sum { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
.grid td.step-cell .step-sum.after { margin-left: 4px; padding-left: 4px; border-left: 1px solid var(--border-strong); }
.grid td.step-sub .step-sum-line { background: var(--surface-3); font-size: 11px; }
.grid tr.summary-row td.step-total { text-align: center; }
/* 詳細ページのタブの追加と削除（G18） */
.tabs button .tab-menu { margin-left: 4px; font-size: 10px; opacity: .45; padding: 0 2px; border-radius: 2px; }
.tabs button .tab-menu:hover, .tabs button .tab-menu:focus { opacity: 1; background: var(--surface-3); }
.tabs button.tab-add { color: var(--muted); font-weight: 400; margin-left: auto; }
.toast.warn { background: #9a6700; }

/* プロジェクトの表示設定（Tracking Settings） */
.tracking-settings section { margin-bottom: 12px; }
.tracking-settings h4 { margin: 0 0 4px; font-size: 13px; }
.tracking-settings .hint { margin-bottom: 6px; }
.tracking-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 12px; max-height: 240px; overflow: auto; padding: 6px 8px; border: 1px solid var(--border, var(--border)); border-radius: 6px; }
.tracking-item { display: flex; align-items: center; gap: 6px; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* メディア画面: ドロップでのアップロード、カードの状態（アップロード中・変換中） */
.media-main { position: relative; }
.media-drop { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(30, 167, 253, .16); border: 2px dashed #1ea7fd; color: #fff; font-size: 15px; pointer-events: none; }
.media-drop[hidden] { display: none; }
.media-upload { border-top: 1px solid #3c3f45; background: #232528; padding: 8px 12px; font-size: 12px; color: #d7dade; }
.media-upload .mu-head { display: flex; align-items: center; gap: 8px; }
.media-upload .mu-track { height: 6px; background: #3c3f45; border-radius: 3px; margin: 6px 0; overflow: hidden; }
.media-upload .mu-fill { height: 100%; background: #1ea7fd; transition: width .2s; }
.media-upload[data-finished="1"] .mu-fill { background: #3fb950; }
.media-upload .mu-items { display: flex; flex-wrap: wrap; gap: 4px 14px; max-height: 64px; overflow: auto; color: #8b9099; }
.media-upload .mu-item.uploading { color: #d7dade; }
.media-upload .mu-item.done { color: #3fb950; }
.media-upload .mu-item.error { color: #ff7b72; }
.mc-thumb { position: relative; }
.mc-state { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; font-size: 11px; color: #fff; background: rgba(0, 0, 0, .66); text-align: center; }
.mc-state.failed { background: rgba(217, 72, 72, .85); }
.mc-busy { width: 14px; height: 14px; flex-shrink: 0; border-radius: 50%; border: 2px solid #5d6168; border-top-color: #1ea7fd; animation: mc-spin 1s linear infinite; }
@keyframes mc-spin { to { transform: rotate(360deg); } }

/* ---------- メディア情報の項目（管理、プレイヤーのダイアログ） ---------- */
.info-fields-head { display: flex; gap: 10px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.info-fields-list { border: 1px solid var(--border); border-radius: 4px; max-height: 360px; overflow: auto; background: var(--panel); color: var(--text); }
.info-fields-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.info-fields-row .n { width: 26px; color: var(--muted); }
.info-fields-row .l { font-weight: 600; }
.info-fields-row .spacer, .info-fields-foot .spacer { flex: 1; }
.info-fields-list > .muted { padding: 10px; }
.info-fields-foot { display: flex; gap: 8px; align-items: center; margin-top: 10px; }

/* ---------- review notes ---------- */
.review-notes .rn-version { margin: 0 0 10px; padding: 10px 12px; }
.review-notes .rn-head { display: flex; align-items: center; gap: 8px; }
.review-notes .rn-thumb { width: 64px; height: 36px; object-fit: cover; border-radius: 3px; background: var(--surface-3); display: inline-block; flex: none; }
.review-notes .rn-code { font-weight: 600; }
.review-notes .rn-draft { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; }
.review-notes .rn-draft .rn-body { flex: 1; min-width: 0; }
.review-notes .rn-draft textarea { resize: vertical; }
.review-notes .rn-meta { display: flex; gap: 8px; align-items: center; min-height: 18px; }

/* 詳細ページの ← → と、上部の項目（H19） */
.detail-nav { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; }
.dheader-fields { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 12px; }
.dheader-fields .dhf { display: inline-flex; align-items: center; gap: 2px; }

/* Gantt のグループの行とバー、日付の無いタスク（H22） */
.gantt .grow.ggroup { background: var(--surface-2); font-size: 12px; }
.gantt .bar-g { position: absolute; top: 9px; height: 10px; background: #5b6b7f; border-radius: 2px; cursor: grab; opacity: .85; }
.gantt .bar-g::before, .gantt .bar-g::after { content: ""; position: absolute; bottom: -5px; border: 5px solid transparent; border-top-color: #5b6b7f; }
.gantt .bar-g::before { left: -5px; }
.gantt .bar-g::after { right: -5px; }
.gantt .grow.nodate .ent-link { color: var(--muted); }
.gantt .gdep.orphan { stroke-dasharray: 3 2; }
.gantt .gorphan { position: absolute; font-size: 12px; line-height: 16px; color: #5b6b7f; cursor: help; z-index: 3; }
.gantt .gorphan.locked { color: #8a6d00; }
/* Gantt の休暇・日付の点・フェーズの縦線（H24） */
.gantt .gbook { position: absolute; top: 2px; bottom: 2px; background: repeating-linear-gradient(135deg, rgba(120, 120, 120, .28) 0 5px, rgba(120, 120, 120, .12) 5px 10px); border-radius: 2px; pointer-events: none; }
.gantt .gr .glabel { position: absolute; top: 6px; height: 16px; line-height: 16px; font-size: 10px; color: var(--muted, #6b7280); white-space: nowrap; pointer-events: none; }
.gantt .gvac { position: absolute; top: 2px; bottom: 2px; background: rgba(120, 120, 120, .18); border-bottom: 2px solid #d9534f; pointer-events: none; }
.gantt .gpoint { position: absolute; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: #e67e22; border: 1px solid #fff; z-index: 2; }
.gantt .gphase { position: absolute; top: 44px; bottom: 0; border-left: 2px dashed #8e44ad; z-index: 1; pointer-events: auto; }
.gantt .gphase.ms { border-left-style: solid; }
.gantt .gphase-label { position: absolute; top: -16px; left: 2px; font-size: 10px; color: #8e44ad; white-space: nowrap; background: rgba(255, 255, 255, .85); }
/* 詳細ページの ALL TASKS の完了率（H27） */
.dprogress { display: inline-flex; align-items: center; gap: 4px; }
.dprogress-bar { display: inline-block; width: 60px; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.dprogress-bar span { display: block; height: 100%; background: #27ae60; }
/* プレイリストの並び順（H31） */
.reorder-list { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow: auto; }
.reorder-item { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-bottom: 1px solid var(--line); cursor: grab; background: var(--panel); }
.reorder-item.over { background: var(--accent-soft); }
/* 接続エンティティのフィールドの網掛け（H47。セルの色の書式は style で上に塗る） */
.grid td.conn-cell { background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.035) 0 4px, transparent 4px 8px); }
/* 個人のダークテーマ（H52）。主な面と文字の色だけを暗くする */
body.theme-dark { --bg: #14161a; --panel: #1e2127; --surface-2: #23272e; --surface-3: #2a2f37; --hover: #2a2f37; --row-hover: #252a32; --line: #2b3038; --border: #343a44; --border-strong: #454c58; --text: #e4e7ec; --text-2: #c2c8d1; --muted: #949ba7; --faint: #6f7783; --primary: #6c9dfc; --primary-dark: #8db3ff; --accent-soft: #232f47; --sel: #2a3d63; --sel-strong: #34508a; --accent-border: #3f5c94; --ring: #3d5fa8; --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 8px 20px -8px rgba(0, 0, 0, .6); --shadow: 0 16px 40px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .04); --scroll-thumb: rgba(160, 170, 188, .3); --scroll-thumb-hover: rgba(160, 170, 188, .5); color-scheme: dark; }
body.theme-dark input, body.theme-dark select, body.theme-dark textarea { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
body.theme-dark .tb-btn.primary { color: #0e1422; }
/* 色を塗ったセル（書式ルール、ステータス、工程）は明るい地なので、文字は暗い色のままにする */
body.theme-dark .grid tbody tr.ruled:not(.ruled-color) td:not(.step-cell), body.theme-dark .grid tbody td.ruled:not(.ruled-color), body.theme-dark .grid td.step-cell.step-colored:not(.dark), body.theme-dark .grid td.step-status .step-box:not(.dark), body.theme-dark .grid td.st-filled:not(.dark), body.theme-dark .grid td.st-filled:not(.dark) a { color: #1f2328; }
/* ダッシュボード: 押せる棒、Fields ウィジェット（H55） */
.dash-bar.clickable, .dash-legend .clickable { cursor: pointer; }
.dash-bar.clickable:hover { background: var(--accent-soft); }
.dash-fields .df { margin-top: 6px; }
/* Fields ウィジェット: ラベルは値より小さく（大きさの段に合わせて一緒に大きくなる）、値は大きく。アイコン（ステータスなど）も em で大きくなる */
.dash-fields .df-label { font-size: .8em; }
.dash-fields .df-value { font-size: 1.4em; }
.dash-fields .df-value img, .dash-fields .df-value svg { height: 1em; width: auto; }
/* H44: 人のスケジュールのドラッグ、プロジェクトのタイムライン */
.gantt .gr .tl-create { cursor: crosshair; touch-action: none; }
.sched-ghost { position: absolute; top: 3px; bottom: 3px; background: rgba(142, 68, 173, 0.35); border: 1px dashed #8e44ad; pointer-events: none; }
.bar-t .tl-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.tl-milestone { position: absolute; top: 6px; width: 14px; height: 14px; transform: rotate(45deg); background: #c0392b; cursor: grab; }
.gantt .gr .sched-load, .gantt .gr .bar-t, .gantt .gr .tl-milestone { touch-action: none; user-select: none; }
.composer textarea:focus, .note-card .reply-box input:focus, .popover .row select:focus, .popover .row input:focus, .popover .search:focus, .more-pop input:focus, .pagination select:focus, .nav-paste:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
/* Gantt の道具の並びの選択欄も、ほかの入力欄と同じ枠にする */
.gantt-toolbar select { height: 26px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel); padding: 0 4px; }
.gantt-toolbar select:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
