/* NECCO — Backlog風の業務UI。緑ヘッダー＋左ナビ＋白パネル */
:root {
  --brand: #3d9b83;
  --brand-dark: #2f7d69;
  --brand-soft: #e3f3ee;
  --bg: #eef1f0;
  --panel: #ffffff;
  --line: #dde3e1;
  --line-strong: #c5cfcc;
  --fg: #2b3533;
  --muted: #6b7875;
  --danger: #c8442f;
  --warn: #c98a12;
  --sat: #2f6fc4;
  --sun: #c8442f;
  --row-hover: #f5faf8;
  --tree-line: #9fb3ae;
  --base: #b3bdbb;
  --act: #33393d;
  --plan: #6f9fd8;
  --plan-parent: #4a78b5;
  --title: #1d8466;   /* 課題名（Backlog風の緑。白背景で読める濃さ） */
  --font: "Meiryo UI", "Meiryo", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  --mono: "Consolas", "BIZ UDGothic", "Menlo", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* body の高さを画面に固定すると上のバー（sticky）がスクロールで流れてしまうので、最小高さにする */
html { height: 100%; }
body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 13px/1.6 var(--font); }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---- header */
.top { height: 46px; background: var(--brand); color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 16px; position: sticky; top: 0; z-index: 20; }
.brand { color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .04em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
/* ロゴ: 芽の出た根っこのキャラクター＋丸い文字。マウスを乗せると芽がゆれる */
.brand { display: inline-flex; align-items: center; gap: 6px; }
.brand-logo { width: 32px; height: 32px; margin: -2px 0; transform-origin: 50% 80%; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
.brand:hover .brand-logo { animation: necco-wiggle .6s ease-in-out; }
@keyframes necco-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(8deg); } }
.brand-name { font-family: "Arial Rounded MT Bold", "Hiragino Maru Gothic ProN", "Varela Round", system-ui, sans-serif; font-size: 19px; font-weight: 800; letter-spacing: .1em; }
.top-search { flex: 1; max-width: 320px; }
.top-search input { width: 100%; border: 0; border-radius: 3px; padding: 5px 10px; background: rgba(255,255,255,.9); color: var(--fg); }
.top-user { margin-left: auto; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.top-user a { color: #fff; opacity: .9; }
/* 上のバーの ☰ で左メニューを隠す／出す（上のバーは固定なので、スクロールしても押せる） */
.menu-btn { display: block; background: none; border: 0; color: #fff; font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 6px; margin-left: -6px; border-radius: 4px; }
.menu-btn:hover { background: rgba(255,255,255,.15); }
body.side-off .side { display: none; }

/* ---- layout */
.shell { display: flex; min-height: calc(100vh - 46px); }
.side { width: 220px; flex: none; background: #2d3836; color: #cfd8d6; padding-block: 12px; overflow-y: auto; }
.side h4 { margin: 14px 16px 4px; font-size: 11px; color: #8fa09c; letter-spacing: .08em; font-weight: 600; }
.side a { display: flex; align-items: center; gap: 8px; color: #dfe7e5; padding: 6px 16px; }
.side a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.side a.on { background: rgba(61,155,131,.35); color: #fff; }
.side .sub a { padding-left: 34px; font-size: 12px; }
.pdot { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.main { flex: 1; min-width: 0; padding: 18px 24px 40px; }
.loading { color: var(--muted); }

/* ---- page parts */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 18px; margin: 0; font-weight: 700; }
.page-head .spacer { flex: 1; }
.crumb { color: var(--muted); font-size: 12px; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.crumb span.sep { opacity: .6; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.panel + .panel { margin-top: 16px; }
.panel-h { padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-b { padding: 14px; }
.empty { padding: 28px 14px; color: var(--muted); text-align: center; }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--panel); border-radius: 3px; padding: 5px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--row-hover); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn.danger.armed { background: var(--danger); color: #fff; }
.btn.sm { padding: 2px 8px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 3px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 4px 12px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }

/* ---- chips */
.type { display: inline-block; color: #fff; border-radius: 3px; padding: 0 7px; font-size: 11px; line-height: 19px; white-space: nowrap; }
.status { display: inline-block; color: #fff; border-radius: 10px; padding: 0 9px; font-size: 11px; line-height: 19px; white-space: nowrap; }
.wtype { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.wtype::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.av { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; flex: none; border: 2px solid var(--panel); }
.avs { display: inline-flex; align-items: center; }
/* アイコン画像（プロフィールで設定） */
.av.av-img { overflow: hidden; }
.av > img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.me-link { display: inline-flex; align-items: center; gap: 8px; color: #fff; }
.me-link:hover { text-decoration: none; opacity: .9; }
/* プロフィール画面 */
.prof-av { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.prof-pic .av { width: 96px; height: 96px; font-size: 40px; border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--line-strong); }
.prof-btns { display: grid; gap: 8px; justify-items: start; max-width: 460px; }
.prof-btns p { margin: 0; font-size: 12px; }
/* 担当者別ガント: チームのメンバーを並べて選ぶ */
.people-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.people-pick button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 16px; padding: 3px 12px 3px 3px; background: var(--panel); cursor: pointer; }
.people-pick button:hover { background: var(--row-hover); }
.people-pick button.on { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; box-shadow: inset 0 0 0 1px var(--brand); }
.people-pick .av { width: 24px; height: 24px; border: 0; }
.people-pick small { font-size: 10px; color: var(--muted); margin-left: 2px; }
.av.av-link { cursor: pointer; }
.av.av-link:hover { transform: scale(1.18); position: relative; z-index: 2; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--brand); }
/* 担当者の選択欄（メイン1名＋サブ複数） */
.assign { display: grid; gap: 6px; }
.assign-row { display: flex; align-items: flex-start; gap: 10px; }
.assign-l { flex: none; width: 52px; padding-top: 3px; font-size: 12px; font-weight: 700; color: var(--fg); }
.assign-l small { display: block; font-weight: 400; color: var(--muted); font-size: 10px; line-height: 1.2; }
.pick.pick-main button.on { border-color: var(--fg); background: var(--fg); color: var(--panel); }
.pick button:disabled { opacity: .35; cursor: default; }
.avs .av + .av { margin-left: -6px; }
.who { display: inline-flex; align-items: center; gap: 6px; }
.prio { font-family: var(--mono); letter-spacing: -1px; }
.prio.p4 { color: var(--danger); font-weight: 700; }
.prio.p3 { color: var(--danger); }
.prio.p2 { color: var(--muted); }
.prio.p1 { color: #8aa; }
.key { font-family: var(--mono); color: var(--brand-dark); white-space: nowrap; }
.over { color: var(--danger); font-weight: 700; }
.soon { color: var(--warn); font-weight: 700; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; white-space: nowrap; }

/* ---- filter bar */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.filters label.fl { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.filters select, .filters input[type=search] { border: 1px solid var(--line-strong); border-radius: 3px; padding: 3px 6px; background: var(--panel); }
.filters input[type=search] { width: 180px; }
.st-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.st-chip { border: 1px solid var(--line-strong); background: var(--panel); border-radius: 12px; padding: 1px 10px; font-size: 12px; cursor: pointer; opacity: .55; }
.st-chip.on { opacity: 1; border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.count { color: var(--muted); font-size: 12px; margin-left: auto; }

/* ---- issue table */
.tbl-wrap { overflow-x: auto; }
table.issues { width: 100%; border-collapse: collapse; min-width: 980px; }
table.issues th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); background: #f7f9f8; border-bottom: 1px solid var(--line); padding: 6px 8px; white-space: nowrap; user-select: none; }
table.issues th.sortable { cursor: pointer; }
table.issues th.sortable:hover { color: var(--fg); }
table.issues th .arrow { font-size: 10px; margin-left: 2px; }
table.issues td { border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: middle; }
table.issues tr.row { cursor: pointer; }
table.issues tr.row:hover td { background: var(--row-hover); }
table.issues tr.ctx td { opacity: .5; }
/* 担当外（階層が分かるよう薄く出している上位の課題）: 課題名を緑ではなくグレーにして、ぱっと見で区別する */
.g-row.ctx { opacity: .5; }
table.issues tr.ctx .title-text, .g-row.ctx .title-text { color: #8a9490; font-weight: 400; }
table.issues tr.done .title-text { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.tcell { display: flex; align-items: center; gap: 4px; min-width: 260px; }
.tog { width: 18px; height: 18px; flex: none; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; font-size: 10px; border-radius: 2px; }
.tog:hover { background: var(--line); color: var(--fg); }
.tog.leaf { cursor: default; position: relative; }
.tog.leaf:hover { background: none; }
.tog.leaf::before { content: ""; position: absolute; left: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
/* 罫線: .v=上の階層の縦線が続く / .br=自分への分岐（├）/ .br.last=最後の子（└） */
.guide { width: 20px; flex: none; align-self: stretch; position: relative; --ext: -7px; }
.guide.v::before, .guide.br::before { content: ""; position: absolute; left: 9px; top: var(--ext); bottom: var(--ext); border-left: 1px solid var(--tree-line); }
.guide.br.last::before { bottom: 50%; }
.guide.br::after { content: ""; position: absolute; left: 9px; right: -3px; top: 50%; border-top: 1px solid var(--tree-line); }
.title-text { overflow-wrap: anywhere; color: var(--title); }
/* 課題一覧: 件名の列が他の列に押されて折り返さないよう幅を確保 */
table.issues td.ttl .tcell { min-width: 330px; }
table.issues td { white-space: nowrap; }
table.issues td.ttl { white-space: normal; }
tr.d0 .title-text, .g-left.d0 .title-text { font-weight: 700; }
/* 階層ラベル（親/子/孫/ひ孫） */
.lv { flex: none; font-size: 10px; line-height: 16px; padding: 0 5px; border-radius: 3px; border: 1px solid; margin-right: 2px; white-space: nowrap; }
.lv0 { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.lv1 { color: var(--brand-dark); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.lv2 { color: #8a5a00; background: #fdf3df; border-color: #ecd3a0; }
.lv3 { color: #6a4a9a; background: #f1ecfa; border-color: #d6c8ee; }
/* その場でコメント（💬）: 件数ありは常に表示、なしはマウスを乗せた行だけ */
.qcom { flex: none; font: inherit; font-size: 11px; line-height: 16px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; margin-left: 6px; cursor: pointer; white-space: nowrap; }
.qcom:not(.has) { display: none; }
tr.row:hover .qcom, .g-row:hover .qcom { display: inline-block; }
.qcom:hover { color: var(--brand-dark); border-color: var(--brand); }
.qc-pop { position: fixed; z-index: 1000; width: 380px; max-width: calc(100vw - 16px); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); padding: 10px 12px; }
.qc-h { font-size: 13px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qc-list { max-height: 220px; overflow: auto; margin-bottom: 8px; border-top: 1px solid var(--line); }
.qc-more { font-size: 11px; padding: 4px 0; }
.qc-item { padding: 6px 0; border-bottom: 1px solid var(--line); }
.qc-meta { font-size: 11px; color: var(--muted); }
.qc-body { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.qc-pop textarea.in { width: 100%; box-sizing: border-box; resize: vertical; height: 76px; min-height: 56px; }
.qc-f { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.kids { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; white-space: nowrap; margin-left: 4px; }
.addchild { visibility: hidden; margin-left: auto; }
tr.row:hover .addchild { visibility: visible; }
/* ガント: 💬は課題名の列の右端に固定（マウスを乗せても位置が動かない）。
   ＋子課題はマウスを乗せた行だけ、💬の左に課題名へ重ねて出す（💬の位置をずらさないため） */
.g-acts { margin-left: auto; flex: none; position: relative; display: flex; align-items: center; }
.g-left .addchild { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); margin: 0 4px 0 0; background: var(--panel); box-shadow: 0 0 0 4px var(--panel); }
.g-row:hover .g-left .addchild { visibility: visible; }

/* ---- detail */
.detail-title { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.detail-title h1 { font-size: 20px; margin: 0; flex: 1; min-width: 240px; overflow-wrap: anywhere; }
.props { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin-top: 14px; }
.prop { display: grid; grid-template-columns: 90px 1fr; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.prop > dt { background: #f7f9f8; color: var(--muted); font-size: 12px; padding: 7px 10px; margin: 0; }
/* 見出しが長い項目（スケジュール反映など）は見出し列を広げて1行で表示する */
.prop.wl { grid-template-columns: max-content 1fr; }
.prop.wl > dt, .frow.wl > label { white-space: nowrap; }
.fgrid .frow.wl { grid-template-columns: max-content minmax(0, 1fr); }
.prop > dd { margin: 0; padding: 6px 10px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* その場編集: ふだんは枠なしで表示、マウスを乗せると枠、クリックで編集 */
.ed { border: 1px solid transparent; border-radius: 3px; background: transparent; padding: 3px 6px; min-width: 0; }
.ed:hover { border-color: var(--line-strong); background: var(--panel); }
.ed:focus { border-color: var(--brand); background: var(--panel); outline: none; box-shadow: 0 0 0 2px var(--brand-soft); }
select.ed { cursor: pointer; }
.ed-title { flex: 1; min-width: 240px; font-size: 20px; font-weight: 700; padding: 2px 8px; }
.ed-title.behind { color: var(--danger); }
.ed-desc { display: block; width: 100%; margin-top: 14px; min-height: 90px; resize: vertical; line-height: 1.75; border-color: var(--line); }
.num-in { width: 72px; text-align: right; font-variant-numeric: tabular-nums; }
/* 詳細画面の日程・時間: 予定と実施を2行で揃える（日付・時間の位置が上下でずれない） */
.sched { display: grid; grid-template-columns: auto auto auto 1fr; align-items: center; gap: 6px 14px; width: 100%; }
.sched .sl { font-weight: 700; font-size: 12px; }
.sched .sr { display: inline-flex; align-items: center; white-space: nowrap; }
.sched .sep { margin: 0 4px; color: var(--muted); }
.sched .st { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 12px; color: var(--muted); }
.sched input[type=date].ed { width: 150px; }
.sched .ed { border-color: var(--line); }
@media (max-width: 700px) { .sched { grid-template-columns: auto minmax(0, 1fr); } .sched .st { grid-column: 2; } .sched > span:empty { display: none; } }
/* 担当者欄のメイン・サブの行間を詰める */
.prop > dd > .assign { width: 100%; }
.prop.wide { grid-column: 1 / -1; }
.ed-hint { font-size: 12px; margin: 6px 0 0; }
.save-state { font-size: 12px; color: var(--muted); min-width: 90px; }
.save-state.ok { color: var(--brand-dark); font-weight: 700; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; }
.comments { list-style: none; margin: 0; padding: 0; }
.comments li { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.comments li:last-child { border-bottom: 0; }
.comments .av { width: 28px; height: 28px; font-size: 12px; }
.cmeta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.cmeta b { color: var(--fg); }
.changes { margin: 6px 0 0; padding: 6px 10px; background: #f7f9f8; border-radius: 3px; font-size: 12px; list-style: none; }
.changes li { display: block; padding: 1px 0; border: 0; }
.changes .f { color: var(--muted); display: inline-block; min-width: 70px; }
.cbody { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }

/* ---- form */
.form { display: grid; gap: 14px; }
.frow { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 12px; align-items: start; }
.frow > label { padding-top: 5px; font-weight: 600; font-size: 12px; color: var(--muted); }
.frow .req::after { content: " *"; color: var(--danger); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; }
.fgrid .frow { grid-template-columns: 80px minmax(0,1fr); }
/* 項目の並びを固定: 1行目=種別など / 2行目=予定 / 3行目=実施。幅が狭いと2列→1列に（開始・終了は横並びを保つ） */
.fgrid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .fgrid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .fgrid.g4 { grid-template-columns: minmax(0, 1fr); } }
.in { width: 100%; border: 1px solid var(--line-strong); border-radius: 3px; padding: 5px 8px; background: var(--panel); }
textarea.in { min-height: 160px; resize: vertical; line-height: 1.7; }
.in.title { font-size: 15px; font-weight: 700; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 14px; padding: 2px 10px 2px 3px; background: var(--panel); cursor: pointer; }
.pick button.on { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.pick .av { width: 20px; height: 20px; font-size: 10px; border: 0; }
table.issues.sib tr.behind .title-text { color: var(--danger); font-weight: 700; }
table.issues.sib tr:hover td { background: var(--row-hover); }
.form-foot { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }

/* ---- board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: #e3e8e6; border-radius: 4px; display: flex; flex-direction: column; min-height: 200px; }
.col-h { padding: 8px 10px; font-weight: 700; display: flex; align-items: center; gap: 8px; border-top: 3px solid var(--c); border-radius: 4px 4px 0 0; }
.col-h .n { color: var(--muted); font-weight: 400; margin-left: auto; }
.col-b { padding: 0 8px 8px; display: grid; gap: 8px; flex: 1; align-content: start; }
.col.drop { outline: 2px dashed var(--brand); outline-offset: -2px; }
.card { background: var(--panel); border-radius: 3px; padding: 8px 10px; box-shadow: 0 1px 2px rgba(0,0,0,.08); cursor: grab; display: grid; gap: 4px; }
.card:hover { box-shadow: 0 2px 6px rgba(0,0,0,.14); }
.card .path { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .ft { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.card .ft .avs { margin-left: auto; }

/* ---- gantt */
.gantt-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.gantt { overflow: auto; max-height: calc(100vh - 230px); position: relative; }   /* 実際の高さは fitGantt() が画面に合わせて決める */
/* ガント画面はページ下の余白を詰めて、表示枠を画面いっぱいに使う */
.main:has(#gantt) { padding-bottom: 12px; }
.g-inner { position: relative; }
.g-row { display: flex; border-bottom: 1px solid var(--line); height: 30px; }
.g-row.head { height: 44px; position: sticky; top: 0; z-index: 3; background: #f7f9f8; }
.g-left { width: 320px; flex: none; position: sticky; left: 0; z-index: 2; background: var(--panel); border-right: 1px solid var(--line-strong); display: flex; align-items: center; gap: 4px; padding: 0 8px; overflow: hidden; white-space: nowrap; cursor: pointer; }
.g-row.head .g-left { background: #f7f9f8; cursor: default; font-weight: 600; color: var(--muted); font-size: 12px; }
.g-left .title-text { overflow: hidden; text-overflow: ellipsis; }
/* 担当者別・チーム別ガント: 隠している担当外の課題の件数（クリックで出す／隠す） */
.fold-chip { flex: none; margin-left: 6px; border: 1px dashed var(--line-strong); background: var(--panel); color: var(--muted); border-radius: 10px; font-size: 11px; padding: 0 8px; line-height: 18px; cursor: pointer; }
.fold-chip:hover { color: var(--brand-dark); border-color: var(--brand); }
/* 設定: 作成したばかりの行を一瞬強調 */
.mrow.flash-row { animation: row-flash 2.5s ease-out; }
@keyframes row-flash { 0%, 50% { background: #fff4c7; } 100% { } }
/* 親（最上位）の課題ごとに太い区切り線（ツリー表示のとき）。ガントと課題一覧で同じ */
.g-row.g-root { border-top: 2px solid var(--tree-line); }
.g-row.head + .g-row.g-root, .g-row.g-proj + .g-row.g-root { border-top: 0; }
table.issues tr.d0 td { border-top: 2px solid var(--tree-line); }
table.issues tbody tr.d0:first-child td { border-top: 0; }
/* 課題列の幅変更つまみ（見出しの右端） */
.g-resize { position: absolute; top: 0; right: -1px; width: 8px; height: 100%; cursor: col-resize; z-index: 4; }
.g-resize::after { content: ''; position: absolute; top: 10px; bottom: 10px; left: 3px; width: 2px; border-radius: 1px; background: var(--line-strong); }
.g-resize:hover::after, body.g-resizing .g-resize::after { background: var(--accent, #3d9b83); }
body.g-resizing, body.g-resizing * { cursor: col-resize !important; user-select: none; }
/* 担当者別ガントのプロジェクト見出し行 */
.g-row.g-proj { height: 30px; background: #eef3f1; }
.g-row.g-proj .g-left { background: #eef3f1; font-weight: 700; gap: 8px; cursor: default; }
/* 課題名の右の固定列（担当者・作業種別） */
.g-col { position: sticky; flex: none; z-index: 2; background: var(--panel); border-right: 1px solid var(--line); display: flex; align-items: center; padding: 0 8px; overflow: hidden; white-space: nowrap; font-size: 12px; }
.g-row.head .g-col { background: #f7f9f8; font-weight: 600; color: var(--muted); }
.g-who { display: inline-flex; align-items: center; min-width: 0; }
.g-who .av { width: 20px; height: 20px; font-size: 10px; }
.g-who .av + .av { margin-left: -6px; }
.av-more { margin-left: 3px; font-size: 11px; color: var(--muted); font-weight: 700; cursor: default; }
.g-names { margin-left: 5px; overflow: hidden; text-overflow: ellipsis; }
.g-col .wtype { overflow: hidden; text-overflow: ellipsis; }
/* ガントの状態プルダウン: 状態の色のピル。クリックで変更 */
.g-status { -webkit-appearance: none; appearance: none; width: 100%; max-width: 100%; border: 0; border-radius: 10px; background: var(--c);
  color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; padding: 0 16px 0 9px; cursor: pointer; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 9px) 8px, calc(100% - 5px) 8px; background-size: 4px 4px; background-repeat: no-repeat; }
.g-status:hover { filter: brightness(1.08); }
/* 選んだ項目の色で塗ったプルダウン（作業種別など。paintSel() が --c と .painted を付ける） */
select.ed.painted, select.in.painted, select.ed.painted:hover, select.ed.painted:focus { background-color: var(--c); color: #fff; border-color: var(--c); font-weight: 600; border-radius: 12px; }
select.painted option:not([style]) { background: var(--panel); color: var(--fg); }
/* 状態のプルダウン（.st-sel）: 開いた一覧を状態の色のピルで並べる。
   カーソルを当てても色を変えない（ブラウザ標準の灰色ハイライトは分かりにくいため）。
   appearance: base-select に対応したブラウザ（Edge/Chrome 135以降）だけで効き、未対応なら標準の一覧のまま */
@supports (appearance: base-select) {
  select.st-sel, select.st-sel::picker(select) { appearance: base-select; }
  select.st-sel::picker-icon { display: none; }
  /* base-select は閉じた状態にも最小高さ24pxが付き、文字が上に寄るので、ガントのピルは高さを固定して上下中央にそろえる */
  select.g-status.st-sel { min-height: 0; height: 20px; align-items: center; line-height: 1; }
  select.ed.st-sel, select.in.st-sel { align-items: center; }
  select.ed.st-sel, select.in.st-sel { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%; background-size: 4px 4px; background-repeat: no-repeat; padding-right: 22px; }
  select.st-sel::picker(select) { border: 1px solid var(--line-strong); border-radius: 6px; padding: 4px; background: var(--panel); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
  select.st-sel option { padding: 3px 12px; margin: 2px 0; border-radius: 10px; font-size: 12px; font-weight: 600; min-height: 0; }
  select.st-sel option::checkmark { display: none; }
  select.st-sel option { cursor: pointer; }
  select.st-sel optgroup { font-size: 11px; color: var(--muted); font-weight: 600; }
  select.st-sel option:not([style]) { color: var(--fg); font-weight: 400; }   /* 「（未設定）」など色のない項目 */
  select.st-sel.painted { background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%); }
  select.st-sel option:hover, select.st-sel option:focus-visible { outline: none; }
}
.g-left .guide { --ext: 0px; }
.g-time { position: relative; flex: none; }
.g-days { display: flex; height: 100%; }
.g-day { flex: none; text-align: center; font-size: 11px; line-height: 1.25; border-left: 1px solid var(--line); padding-top: 4px; color: var(--muted); }
.g-day.sat { color: var(--sat); background: rgba(0, 0, 0, .06); }
.g-day.sun, .g-day.hol { color: var(--sun); background: rgba(0, 0, 0, .06); }
.g-day.today { background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--fg); font-weight: 700; }
/* 実施日の列: クリックでその日へ移動 */
.g-jump { cursor: pointer; }
.g-jump:hover { color: var(--brand); text-decoration: underline; }
.g-day.flash { animation: g-flash 1.5s ease-out; }
@keyframes g-flash { 0%, 40% { background: #f5c242; color: var(--fg); } 100% { } }
/* 月の表示は日付セル（26px）に収まらないので、折り返さずに右隣のセルへはみ出させる */
.g-day .m { display: block; font-weight: 700; color: var(--fg); height: 14px; white-space: nowrap; text-align: left; padding-left: 3px; position: relative; z-index: 1; }
/* 実施が予定より遅れ: 課題名を赤字＋！マーク */
.behind-mark { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; margin-right: 4px; vertical-align: 2px; }
h1 .behind-mark { width: 20px; height: 20px; font-size: 13px; margin-right: 6px; }
.behind-mark.nodate { background: var(--warn); }   /* 実施日が未入力（オレンジ） */
/* 優先度「重」の課題は赤い「！」を点滅させる（遅れと共通の印） */
.behind-mark.blink { animation: mark-blink 1s ease-in-out infinite; }
@keyframes mark-blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
tr.behind .title-text, .g-left.behind .title-text, h1.behind { color: var(--danger); font-weight: 700; }
tr.done.behind .title-text { color: var(--muted); }
.delay { color: #fff; background: var(--danger); border-radius: 3px; padding: 0 6px; font-size: 11px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* ガント: 当初予定・予定・実施の凡例 */
.g-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.g-legend label, .g-legend span { display: inline-flex; align-items: center; gap: 4px; }
.lg { display: inline-block; width: 18px; border-radius: 2px; }
.lg.plan { height: 10px; background: var(--plan); }
.g-legend .opt { margin-left: 6px; padding-left: 12px; border-left: 1px solid var(--line); }
/* 予定バーは状態に関係なく同じ色（赤は遅れだけに使う） */
.g-bar.k-plan, .g-ms.k-plan { background: var(--plan); }
.g-bar.k-plan.parent { background: var(--plan-parent); }
/* 予定は状態の色（--c）で塗る */
.g-bar.k-plan.sc, .g-ms.k-plan.sc { background: var(--c); }
/* 一般ユーザーの予定バー: ドラッグ不可（クリックで詳細へ） */
.g-bar.locked, .g-ms.locked { cursor: pointer; }
.lg.base { height: 4px; background: var(--base); }
.lg.act { height: 7px; background: var(--act); }
.lg.late { height: 7px; background: var(--danger); }
.g-help { font-size: 12px; padding: 6px 14px; border-bottom: 1px solid var(--line); }
.g-bar.k-base { background: var(--base); cursor: default; border-radius: 2px; }
.g-ms.k-base { background: var(--base); cursor: default; }
.g-bar.k-act { background: var(--act); border-radius: 2px; }
.g-bar.k-act.late, .g-ms.k-act.late { background: var(--danger); }
.g-bar.k-act.open { background-image: repeating-linear-gradient(45deg, transparent 0 4px, rgba(255,255,255,.35) 4px 8px); }
.g-ms.k-act { background: var(--act); }
.g-delay { position: absolute; font-size: 11px; font-weight: 700; color: var(--danger); white-space: nowrap; pointer-events: none; line-height: 16px; }
.g-bar { position: absolute; top: 7px; height: 16px; border-radius: 3px; background: var(--c); color: #fff; font-size: 11px; line-height: 16px; white-space: nowrap; overflow: hidden; cursor: grab; touch-action: none; user-select: none; }
.g-bar.parent { top: 10px; height: 10px; border-radius: 1px; opacity: .8; }
.g-lbl { display: block; padding: 0 7px; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.g-h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 1; }
.g-h.l { left: 0; }
.g-h.r { right: 0; }
.g-bar:hover .g-h { background: rgba(255,255,255,.35); }
.g-bar.dragging { cursor: grabbing; box-shadow: 0 2px 8px rgba(0,0,0,.3); opacity: .9; z-index: 2; }
.g-bar.ghost { opacity: .6; }
.g-time.nodate { cursor: crosshair; }
.g-ms { position: absolute; top: 8px; width: 13px; height: 13px; background: var(--c); transform: rotate(45deg); cursor: grab; touch-action: none; }
.g-ms.dragging { cursor: grabbing; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.g-tip { position: fixed; z-index: 60; background: #2d3836; color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 3px; pointer-events: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brand); opacity: .7; pointer-events: none; z-index: 1; }
/* 担当者別: 空き日（予定・実施が入っていない平日）の縦帯 */
/* 土日祝は薄いグレーの縦帯（Backlog と同じ） */
.g-off { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, .06); pointer-events: none; z-index: 1; }
.g-free { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, #f2a93b 16%, transparent); pointer-events: none; z-index: 1; }
.g-day.free { color: #9a5b00; font-weight: 700; }
.lg.free { height: 12px; width: 12px; background: color-mix(in srgb, #f2a93b 35%, transparent); }

/* ---- settings */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 8px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 700; }
.tabs a:hover { text-decoration: none; color: var(--fg); }
.mlist { display: grid; }
.mrow { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mrow input[type=color] { width: 32px; height: 26px; padding: 0; border: 1px solid var(--line-strong); border-radius: 3px; background: none; }
.mrow .in { width: auto; flex: 1; min-width: 140px; max-width: 280px; }
.mrow .preview { min-width: 90px; }
.mrow label.ck { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.mrow .sp { flex: 1; }

.copy-box { margin-top: 12px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent); background: var(--brand-soft); border-radius: 4px; display: grid; gap: 10px; }
.copy-grid { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.copy-opts { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 12px; }
.copy-opts label { display: inline-flex; align-items: center; gap: 5px; }
@media (max-width: 560px) { .copy-grid { grid-template-columns: minmax(0, 1fr); } }
.danger-box { margin: 0 14px 10px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 6%, var(--panel)); border-radius: 4px; display: grid; gap: 6px; }

/* ---- チーム */
.tdot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex: none; }
.tchip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; margin-right: 4px; white-space: nowrap; }
.user-teams { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.team-row { border-bottom: 1px solid var(--line); }
.team-row .mrow { border-bottom: 0; }
.team-body { display: grid; gap: 6px; padding: 0 14px 12px 56px; font-size: 12px; }
.proj-teams { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding-left: 40px; font-size: 12px; }
.proj-teams .pick button { padding: 1px 10px 1px 8px; gap: 5px; font-size: 12px; }
.pick button:disabled.on { opacity: 1; }

/* ---- 取り込み */
.im-target { display: grid; gap: 8px; }
.im-target label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.im-body h4 { margin: 18px 0 4px; font-size: 13px; }
.im-body p { margin: 6px 0; }
.im-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.im-stat { border: 1px solid var(--line); border-radius: 4px; padding: 8px 14px; display: grid; min-width: 120px; }
.im-stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.im-stat span { font-size: 12px; color: var(--muted); }
.im-warn { background: color-mix(in srgb, var(--warn) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: 4px; padding: 8px 12px; }
.im-warn-s { color: var(--warn); font-size: 12px; font-weight: 700; }
tr.im-nomatch td { background: color-mix(in srgb, var(--warn) 8%, var(--panel)); }

/* ---- login */
.login { max-width: 360px; margin: 12px auto 60px; }
/* マスコット（全身版 necco.svg）: ログイン画面とホームに出す。ヘッダー・ファビコンは顔だけの favicon.svg */
.login-mascot { text-align: center; margin-top: 36px; }
.login-mascot img { height: 150px; transform-origin: 50% 90%; animation: necco-bob 2.4s ease-in-out infinite; }
.login-name { font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", sans-serif; font-size: 26px; font-weight: 800; letter-spacing: .12em; color: var(--brand-dark); margin-top: 4px; }
.home-mascot { display: flex; align-items: flex-end; gap: 6px; margin: -10px 0 -14px; }
.home-mascot img { height: 84px; transform-origin: 50% 90%; cursor: pointer; }
.home-mascot:hover img { animation: necco-wiggle .6s ease-in-out; }
.home-mascot .bubble { position: relative; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; padding: 5px 10px; font-size: 12px; color: var(--fg); margin-bottom: 40px; white-space: nowrap; }
.home-mascot .bubble::after { content: ""; position: absolute; right: -6px; bottom: 8px; width: 10px; height: 10px; background: var(--panel); border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); transform: rotate(-45deg); }
/* 右下のNECCO（全ページ。ホーム以外） */
/* 右端から --br だけ離して置く（ガントなどの縦スクロールバーに重ならないように） */
#buddy { --br: 72px; position: fixed; right: var(--br); bottom: 28px; z-index: 900; display: flex; align-items: flex-end; gap: 6px; pointer-events: none; transition: transform .2s cubic-bezier(.3, 1.3, .5, 1); }
/* マウスが近づいたら右へよけて、端からキャラの左側を 44px だけ出す（右の余白 14px ぶんも足す）。
   よけている間は吹き出しを隠す（隠さないと端に出るのが吹き出しになる） */
#buddy.away { transform: translateX(calc(100% + var(--br) - 24px)); }   /* ボタンに重なるときは右端までさっとよけ、スクロールバーより右に 24px だけ出す */
#buddy.away .b-bubble, #buddy.away .b-x { display: none; }
#buddy.away img { animation: none; }
#buddy > * { pointer-events: auto; }
#buddy img { height: var(--bs, 140px); cursor: pointer; transform-origin: 50% 90%; opacity: .9; filter: drop-shadow(0 2px 3px rgba(0,0,0,.18)); }
#buddy:not(.has) img { opacity: .55; cursor: default; }
#buddy.has img { animation: necco-bob 2.4s ease-in-out infinite; }
#buddy img:hover { opacity: 1; }
#buddy .b-bubble { position: relative; font: inherit; font-size: 13px; font-weight: 700; color: var(--danger); background: var(--panel); border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); border-radius: 12px; padding: 6px 12px; margin-bottom: calc(var(--bs, 140px) * .55); cursor: pointer; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
#buddy .b-bubble::after { content: ""; position: absolute; right: -6px; bottom: 8px; width: 10px; height: 10px; background: var(--panel); border-right: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); border-bottom: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); transform: rotate(-45deg); }
#buddy .b-x { position: absolute; right: -4px; top: -6px; width: 18px; height: 18px; line-height: 16px; padding: 0; font-size: 12px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted); cursor: pointer; display: none; }
#buddy:hover .b-x { display: block; }
#buddy .b-list { position: absolute; right: 0; bottom: calc(var(--bs, 140px) + 8px); width: 380px; max-width: calc(100vw - 28px); max-height: 50vh; overflow: auto; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); }
#buddy .b-h { font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); }
#buddy .b-row { display: flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
#buddy .b-row:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
#buddy .b-row .title-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#buddy .b-why { flex: none; font-size: 11px; color: var(--danger); font-weight: 700; }
/* パスワード変更のお願い（短いパスワードの人だけ） */
#pwWarn { background: #fff4d6; border-bottom: 1px solid #f0d58a; color: #6b4e00; padding: 7px 16px; font-size: 13px; }
#pwWarn a { margin-left: 8px; font-weight: 700; }
/* ドラッグ＆ドロップで課題を移動: 真ん中＝その下へ（枠）、上端・下端＝前・後ろへ（線）、移動できない所は赤 */
.dnd-src { opacity: .4; }
tr.dnd-into td, .g-row.dnd-into .g-left { background: color-mix(in srgb, var(--brand) 16%, var(--panel)) !important; }
tr.dnd-into td:first-child, .g-row.dnd-into .g-left { box-shadow: inset 3px 0 0 var(--brand); }
tr.dnd-before td, .g-row.dnd-before, .g-row.dnd-before .g-left { box-shadow: inset 0 3px 0 var(--brand); }
tr.dnd-after td, .g-row.dnd-after, .g-row.dnd-after .g-left { box-shadow: inset 0 -3px 0 var(--brand); }
tr.dnd-no td, .g-row.dnd-no .g-left { background: color-mix(in srgb, var(--danger) 10%, var(--panel)) !important; }
/* 設定 › ユーザー: Teams 通知 URL の行（各メンバーの下に1行） */
.mrow .nt-line { flex-basis: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 0 0 34px; font-size: 12px; }
.nt-line [data-wh] { flex: 1; min-width: 260px; max-width: 560px; font-size: 12px; }
.nt-ok { color: #2e7d32; }
.nt-ng { color: var(--danger); }
/* プロフィール: Teams 通知 */
.p-wh { display: grid; gap: 4px; max-width: 760px; }
.p-wh-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.p-wh-row .in { flex: 1; min-width: 260px; }
/* ヘルプページ（Teams通知の設定方法など） */
.help .panel-b { max-width: 920px; line-height: 1.8; }
.help h2 { font-size: 16px; margin: 22px 0 6px; padding-left: 8px; border-left: 4px solid var(--brand); }
.help h3 { font-size: 14px; margin: 14px 0 4px; }
.help ol, .help ul { padding-left: 22px; margin: 4px 0; }
.help li { margin: 3px 0; }
.help code { background: #f1f4f3; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 12px; }
.cp-box { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.cp-box code { font-size: 13px !important; padding: 3px 8px !important; user-select: all; }
.nt-ho h3 { margin: 0 0 6px; font-size: 14px; }
.nt-ho textarea.in { resize: vertical; }
/* おまけ: 左メニューの下からのぞく仲間キャラ（頭だけ出す） */
#peek { position: fixed; bottom: 0; height: 96px; z-index: 30; cursor: pointer; transform: translateY(100%); transition: transform .6s cubic-bezier(.3, 1.3, .5, 1); filter: drop-shadow(0 -1px 2px rgba(0,0,0,.25)); }
#peek.on { transform: translateY(38%); }   /* 目のあたりまで見せる */
#peek.found { transform: translateY(8%) rotate(-8deg); transition-duration: .25s; }
/* プロフィール: キャラクター選択 */
.chara-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.chara-pick .muted { flex-basis: 100%; }
.chara-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 12px; background: var(--panel); }
.chara-opt img { height: 72px; }
.chara-opt:hover { border-color: var(--brand); }
.chara-opt.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--panel)); font-weight: 700; }
@keyframes necco-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-2deg); } }
.login .panel-b { display: grid; gap: 12px; }
.err { color: var(--danger); font-size: 12px; min-height: 1em; }
.in.bad { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

/* ---- home */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 9px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.feed li:last-child { border-bottom: 0; }

/* ---- 課題の重ね表示（右からのパネル。× / Esc / 背景クリックで閉じる） */
.modal { position: fixed; inset: 0; z-index: 40; }
.modal-bg { position: absolute; inset: 0; background: rgba(20, 30, 28, .45); }
.modal-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(1180px, 94vw); background: var(--bg); box-shadow: -8px 0 24px rgba(0,0,0,.25); display: flex; flex-direction: column; }
.modal-bar { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.modal-x { width: 34px; height: 34px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--panel); font-size: 20px; line-height: 1; cursor: pointer; color: var(--fg); }
.modal-x:hover { background: var(--row-hover); }
.modal-body { flex: 1; overflow-y: auto; padding: 16px 20px 40px; }
body.modal-open { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) { .modal:not([hidden]) .modal-panel { animation: slidein .16s ease-out; } }
@keyframes slidein { from { transform: translateX(40px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---- toast */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; }
.toast { background: #2d3836; color: #fff; padding: 8px 14px; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.2); max-width: 360px; }
.toast.err { background: var(--danger); }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .top-search { display: none; }
  .side, body.side-off .side { display: block; position: fixed; top: 46px; bottom: 0; left: 0; z-index: 30; transform: translateX(-100%); transition: transform .15s; }
  .side.open { transform: none; }
  .main { padding: 14px 16px 40px; }
  .grid2 { grid-template-columns: minmax(0,1fr); }
  .frow { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .g-left { width: 180px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
