:root { --ink: #1c2b33; --mute: #5d6e77; --line: #d9e1e5; --bg: #f5f8f9; --main: #1F4E5F; --warn: #a33a2a; --all: #2d7a4f; --internal: #8a5a00; --private: #6a3d8f; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.6 -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; color: var(--ink); background: var(--bg); }
.top { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--main); color: #fff; }
.top h1 { margin: 0; font-size: 18px; flex: 1; }
.who { font-size: 13px; opacity: .85; }
main { max-width: 1100px; margin: 0 auto; padding: 16px 16px 88px; }
h2 { font-size: 16px; margin: 20px 0 8px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0 0 10px; }
.card b { display: block; }
.meta { color: var(--mute); font-size: 13px; }
.chip { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; color: #fff; margin-right: 6px; }
.chip.all { background: var(--all); }
.chip.internal { background: var(--internal); }
.chip.private { background: var(--private); }
form.new { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
label { display: block; font-size: 13px; color: var(--mute); margin-top: 8px; }
input, select, textarea, button { font: inherit; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
button { background: var(--main); color: #fff; border: 0; margin-top: 12px; min-height: 44px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; background: var(--ink); color: #fff; padding: 12px; border-radius: 8px; }
.empty { color: var(--mute); padding: 16px 0; }
a { color: inherit; }
.card.link { display: block; text-decoration: none; }
.card h2 { margin: 0 0 6px; font-size: 18px; }
.card .note { white-space: pre-wrap; margin: 8px 0; }
.chip.st-todo { background: #6b7a83; } .chip.st-doing { background: #2a6ea8; } .chip.st-review { background: #b07a00; } .chip.st-done { background: #2d7a4f; }
.overdue { color: var(--warn); font-weight: 600; margin-right: 4px; }
.alert { background: #fff4d6; border: 1px solid #e6c970; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.pills { display: flex; gap: 8px; margin-bottom: 12px; }
.pill { flex: 1; text-align: center; padding: 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; text-decoration: none; }
.pill.on { background: var(--main); color: #fff; border-color: var(--main); }
.back { display: inline-block; margin-bottom: 8px; color: var(--main); }
dl { display: grid; grid-template-columns: 8em 1fr; gap: 4px 8px; margin: 8px 0 0; }
dt { color: var(--mute); font-size: 14px; } dd { margin: 0; }
.actions button.sub, button.sub { background: #fff; color: var(--main); border: 1px solid var(--main); }
.ev { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; margin: 6px 0; }
details > summary { cursor: pointer; font-weight: 600; min-height: 32px; }
button:disabled { opacity: .5; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom a { flex: 1; text-align: center; padding: 14px 4px; text-decoration: none; color: var(--mute); }
.bottom a.on { color: var(--main); font-weight: 700; }
.toast { bottom: 76px; }

/* ---- 一覧の行・カード ---- */
.list { display: grid; gap: 10px; }
.list-head { display: none; }
.row { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 6px 12px; grid-template-columns: 1fr 1fr; grid-template-areas: "main main" "who rev" "due vis" "meta meta"; }
.r-main { grid-area: main; display: grid; gap: 6px; min-width: 0; }
.row .r-title { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; }
.row .r-title a { text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.row .r-title a:hover { text-decoration: underline; }
.r-notebox { min-width: 0; }
.r-note { color: #33444d; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.r-note.clamp { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.r-note.c2 { -webkit-line-clamp: 2; } .r-note.c3 { -webkit-line-clamp: 3; }
.r-note.open { display: block; overflow: visible; }
.r-note.empty-note { color: #98a6ad; font-size: 13px; }
button.more { all: unset; color: var(--main); font-size: 13px; cursor: pointer; text-decoration: underline; padding: 2px 0; }
button.more[hidden] { display: none; }
.r-who { grid-area: who; } .r-rev { grid-area: rev; } .r-due { grid-area: due; } .r-vis { grid-area: vis; } .r-meta { grid-area: meta; }
.r-who, .r-rev { display: flex; align-items: center; gap: 6px; font-size: 14px; min-width: 0; }
.r-who .nm, .r-rev .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab { color: var(--mute); font-size: 12px; min-width: 2.2em; }
.av { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 700; color: #fff; flex: none; background: #6b7a83; }
.av { background: #5b6b74; } .av.none { background: none; border: 1.5px dashed #98a6ad; }
.due { font-size: 13px; padding: 1px 8px; border-radius: 6px; background: #eef2f4; }
.due.none { color: #98a6ad; background: none; padding-left: 0; }
.due.over { background: #fde4e0; color: #b3261e; font-weight: 700; }
.due.week { background: #ffedd5; color: #b45309; font-weight: 600; }
.r-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--mute); font-size: 13px; }
.r-act:empty { display: none; }
.r-act { display: flex; gap: 8px; }
button.q { width: auto; margin: 0; min-height: 36px; padding: 6px 14px; font-size: 14px; }
.sico { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; font-weight: 700; color: #fff; flex: none; margin-right: 6px; }
.sico.st-todo { background: #6b7a83; } .sico.st-doing { background: #2a6ea8; } .sico.st-review { background: #b07a00; } .sico.st-done { background: #2d7a4f; }
.row.st-done { opacity: .75; }
/* グループ */
details.group { margin: 0 0 12px; }
details.group > summary { list-style: none; cursor: pointer; font-weight: 700; padding: 8px 2px; display: flex; align-items: center; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::before { content: "▸"; margin-right: 6px; color: var(--mute); transition: transform .15s; }
details.group[open] > summary::before { transform: rotate(90deg); }
.count { margin-left: 6px; background: #e3eaee; color: var(--mute); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 600; }
/* ツールバー */
.toolbar { display: grid; gap: 8px; margin-bottom: 8px; }
.seg { display: flex; gap: 0; max-width: 260px; } .seg .pill { border-radius: 0; margin: 0; } .seg .pill:first-child { border-radius: 999px 0 0 999px; } .seg .pill:last-child { border-radius: 0 999px 999px 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips .pill { padding: 6px 12px; }
.selects { display: flex; gap: 8px; flex-wrap: wrap; }
.fsel { width: auto; min-width: 9em; padding: 6px 8px; }
button.pill { width: auto; margin: 0; background: #fff; color: var(--ink); min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
button.pill.on { background: var(--main); color: #fff; border-color: var(--main); }
.summary { color: var(--mute); font-size: 13px; margin: 4px 2px 8px; }
/* ボード */
.board { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.col { flex: 0 0 84%; scroll-snap-align: start; background: #e9eff2; border-radius: 12px; padding: 10px; align-self: flex-start; min-width: 0; }
.col h3 { margin: 0 0 8px; font-size: 14px; display: flex; align-items: center; }
.bcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; display: grid; gap: 6px; }
.bcard .bt { font-weight: 700; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.b-line { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; }
/* デスクトップ幅：行は列つきの表、ボードは4列 */
@media (min-width: 900px) {
  .list { gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
  .list-head { display: grid; grid-template-columns: minmax(0, 3.2fr) 1.2fr 1.2fr 1fr .9fr minmax(0, 2fr); gap: 12px; padding: 8px 14px; font-size: 12px; color: var(--mute); background: #f0f4f6; border-bottom: 1px solid var(--line); }
  .row { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; grid-template-columns: minmax(0, 3.2fr) 1.2fr 1.2fr 1fr .9fr minmax(0, 2fr); grid-template-areas: "main who rev due vis meta"; align-items: start; }
  .row:last-child { border-bottom: 0; }
  .row .r-note { max-width: 60ch; }
  .lab { display: none; }
  .r-who, .r-rev, .r-due, .r-vis { min-height: 28px; align-items: center; }
  .r-due, .r-vis { display: flex; }
  .r-meta { flex-direction: column; gap: 2px; }
  .board { margin: 0; padding: 0; overflow: visible; }
  .col { flex: 1 1 0; }
}

/* 追加：誰の番か・まとめ・凡例・新着・ボードの1列カード・スマホのボードの列タブ */
.turn { font-size: 13px; color: #8a5a00; background: #fff4d6; border-radius: 6px; padding: 2px 8px; justify-self: start; }
.summary { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--ink); }
.sp { border-radius: 999px; padding: 1px 10px; font-size: 13px; font-weight: 600; background: #eef2f4; }
.sp.over { background: #fde4e0; color: #b3261e; } .sp.week { background: #ffedd5; color: #b45309; } .sp.mine { background: #fff4d6; color: #8a5a00; }
.legend { font-size: 13px; color: var(--mute); margin: 2px 2px 8px; } .legend summary { cursor: pointer; } .legend ul { margin: 4px 0 0; padding-left: 1.2em; }
.new { background: #d8f0e0; color: #1d6a3f; border-radius: 6px; padding: 0 6px; font-size: 12px; font-weight: 700; }
.last.none { color: #98a6ad; }
.bcard { display: flex; flex-direction: column; gap: 6px; }
.b-who { display: grid; gap: 4px; font-size: 14px; } .who1 { display: flex; align-items: center; gap: 6px; }
.ctabs { display: flex; gap: 6px; margin-bottom: 8px; }
.ctab { flex: 1; width: auto; margin: 0; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 6px 4px; min-height: 40px; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 2px; flex-wrap: wrap; }
.ctab.on { background: var(--main); color: #fff; border-color: var(--main); } .ctab.on .count { background: rgba(255,255,255,.25); color: #fff; }
@media (max-width: 899px) {
  .board { display: block; margin: 0; padding: 0; overflow: visible; }
  .col { display: none; } .col.on { display: block; }
  .col > h3 { display: none; }
}
@media (min-width: 900px) { .ctabs { display: none; } .col { display: block !important; } .col > h3 { display: flex !important; } .lab { display: none; } .b-who .lab { display: inline; } }
.list-head { font-size: 12px; color: #4a5a63; }
.chips .pill { flex: 0 0 auto; }
.list-head { border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; margin-bottom: -1px; }
.due { white-space: nowrap; }

/* 議事録 */
.row.min { grid-template-columns: 1fr auto; grid-template-areas: "main vis" "meta meta"; }
.mdate { color: var(--mute); font-weight: 600; font-size: 13px; white-space: nowrap; margin-right: 8px; }
.md { line-height: 1.8; overflow-wrap: anywhere; }
.md h3 { font-size: 18px; margin: 16px 0 6px; } .md h4 { font-size: 16px; margin: 14px 0 4px; } .md h5 { font-size: 15px; margin: 12px 0 4px; }
.md p { margin: 6px 0; white-space: pre-wrap; } .md ul, .md ol { margin: 4px 0; padding-left: 1.4em; } .md li { margin: 2px 0; }
.md blockquote { margin: 8px 0; padding: 2px 12px; border-left: 3px solid var(--line); color: var(--mute); }
.md code { background: #eef2f4; padding: 0 4px; border-radius: 4px; font-size: .92em; }
.md .tbl { overflow-x: auto; margin: 8px 0; } .md table { border-collapse: collapse; min-width: 100%; } .md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; } .md th { background: #f0f4f6; }
.md-full { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }
.addbtn { display: inline-block; text-decoration: none; text-align: center; }
@media (min-width: 900px) { .row.min { grid-template-columns: minmax(0, 1fr) 9em 14em; grid-template-areas: "main vis meta"; } }
.bottom a { padding: 14px 2px; font-size: 14px; }
.row.min .r-title { flex-wrap: wrap; } .row.min .mdate { flex-basis: 100%; margin: 0; }
.row.min .r-note.c2 { -webkit-line-clamp: 3; }
@media (min-width: 900px) { .row.min .mdate { flex-basis: auto; margin-right: 8px; } .row.min .r-note.c2 { -webkit-line-clamp: 2; } }
