/* ゼミログ — 白基調のデザイン。Instagram や X のように、背景は真っ白＋細い線で区切り、差し色は青だけに絞る。
   ダークモードは端末の設定に合わせて自動で切り替わり、こちらは真っ黒が背景になる。
   画面の構成は Discord と同じ「左の列（DM・コミュニティ）｜プロジェクト一覧｜中身」の 3 列。スマホでは列ごとに切り替える */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --rail-bg: #ffffff;
  --panel-bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f8f8;
  --surface-3: #eef1f2;
  --text: #0f1419;
  --muted: #536471;
  --faint: #66727e;
  --border: #eff3f4;
  --border-strong: #cfd9de;
  --accent: #0077c2;
  --accent-hover: #005c94;
  --accent-ink: #ffffff;
  --accent-soft: #e3f1ff;
  --accent-softer: #f3f9ff;
  --accent-on-soft: #0b6bb5; /* 文字に使うアクセント色。--accent はボタンの地の色なので、文字にはこちらを使う */
  --done: #00a97a;
  --done-soft: #e2f6ef;
  --done-on-soft: #0b7a5b;
  --danger: #e0245e;
  --danger-soft: #fdeaf1;
  --alert: #f4212e;
  --shadow: 0 1px 2px rgb(15 20 25 / .05);
  --shadow-lg: 0 8px 32px rgb(15 20 25 / .14);
  --radius: 16px;
  --radius-md: 12px;
  --header-h: 56px;
  --rail-w: 72px;
  --panel-w: 280px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --rail-bg: #000000;
    --panel-bg: #000000;
    --surface: #16181c;
    --surface-2: #1d2024;
    --surface-3: #272b30;
    --text: #e7e9ea;
    --muted: #8b98a5;
    --faint: #858c92;
    --border: #23272b;
    --border-strong: #3d4247;
    --accent: #0f7ac6;
    --accent-hover: #0b6bb5; /* ボタンにカーソルを乗せたときの色。白い文字が読めるよう、ダークモードでも明るくせず暗くする */
    --accent-ink: #ffffff;
    --accent-soft: #12354f;
    --accent-softer: #0c2233;
    --accent-on-soft: #4db4f5;
    --done: #00ba7c;
    --done-soft: #0a2c22;
    --done-on-soft: #00ba7c;
    --danger: #ff6b8e;
    --danger-soft: #33141f;
    --alert: #f4212e;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / .6);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* どこかの要素が幅からはみ出しても、ページ全体が横スクロールしてレイアウトごとずれるのを防ぐ（scroll挙動を変えないoverflow: hiddenではなくclipを使用） */
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
img { display: block; }
/* 入力された文章に URL など区切りのない長い文字列があっても、その語の途中で折り返して
   スマホでページごと横に広がらないようにする（収まる文章の見た目は変わらない）。全体に継承される */
#main, #dialog { overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--muted); }

/* ═════════════ 縦のレイアウト：上のタブ（PC）／下のタブ（スマホ） ═════════════ */
#app { display: flex; flex-direction: column; min-height: 100dvh; }
body.signed-out #header, body.signed-out #tabsTop, body.signed-out #tabsBottom { display: none; }
.booting #header, .booting #tabsTop { visibility: hidden; }

/* ── 上のバー：ロゴ・コミュニティ切り替え・DM・通知・自分 ── */
#header {
  position: sticky; top: 0; z-index: 30;
  padding-top: var(--safe-t);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
body.signed-out #header { border-bottom: 0; }
.bar { max-width: 900px; margin: 0 auto; height: var(--header-h); display: flex; align-items: center; gap: 6px; padding: 0 14px; }
.bar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; line-height: 1.3; }
.bar-title .t { display: block; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title .s { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-title .hash { font-size: 20px; color: var(--faint); font-weight: 400; }
.bar-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: .04em; flex-shrink: 0; }
.brand svg { color: var(--accent); }
.back.desktop-hide { display: inline-grid; }
@media (min-width: 900px) { .back.desktop-hide { display: none; } }

.topbar-switch {
  display: flex; align-items: center; gap: 4px; background: none; border: 0; cursor: pointer;
  padding: 6px 8px; margin-left: 2px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--text);
  min-width: 0; overflow: hidden;
}
.topbar-switch:hover { background: var(--surface-2); }
.topbar-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-switch svg { color: var(--faint); flex-shrink: 0; }
@media (max-width: 640px) { .topbar-switch span { display: none; } }

.topbar-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; flex-shrink: 0; }
.topbar-actions .icon-btn { position: relative; }
.count-badge {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--alert); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.topbar-me { display: flex; align-items: center; margin-left: 4px; }
.topbar-me .avatar { box-shadow: 0 0 0 2px var(--bg); }

/* ── メインの4タブ：PC は上、スマホは下固定 ── */
#tabsTop {
  position: sticky; top: var(--header-h); z-index: 25;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.tabs-top-row { max-width: 900px; margin: 0 auto; display: flex; gap: 4px; padding: 0 10px; }
.tab-pill {
  display: flex; align-items: center; gap: 7px; padding: 12px 14px 10px; font-size: 14px; font-weight: 700;
  color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-pill svg { flex-shrink: 0; }
.tab-pill:hover { color: var(--text); }
.tab-pill.active { color: var(--text); border-bottom-color: var(--accent); }
@media (max-width: 899px) { #tabsTop { display: none; } }

#tabsBottom {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-b);
}
@media (max-width: 899px) {
  #tabsBottom { display: flex; }
}
#app.no-tabs #tabsTop, #app.no-tabs #tabsBottom { display: none; }
.tabs-bottom-row { flex: 1; display: flex; }
.tab-bottom {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 8px; text-decoration: none; color: var(--faint);
}
.tab-bottom svg { flex-shrink: 0; }
.tab-bottom span { font-size: 10.5px; font-weight: 700; }
.tab-bottom.active { color: var(--accent-on-soft); }

main { width: 100%; max-width: 900px; margin: 0 auto; padding: 16px 20px calc(48px + var(--safe-b)); }
/* カード一覧のようにグリッドで並ぶ画面は、広い画面で余白ばかりにならないよう横幅を広げる（ヘッダー・タブの並びもそろえる） */
@media (min-width: 900px) {
  #app.wide main, #app.wide .bar, #app.wide .tabs-top-row { max-width: 1320px; }
}
@media (max-width: 899px) { main { max-width: 760px; padding: 12px 16px calc(84px + var(--safe-b)); } }

.dm-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 1px 0; border-radius: 12px; }
.dm-item:hover { background: var(--surface-2); }
.dm-item.active { background: var(--surface-3); }
.dm-text { flex: 1; min-width: 0; line-height: 1.45; }
.dm-text b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-text span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-item.unread .dm-text b { font-weight: 700; }
.dm-item.unread .dm-text span { color: var(--text); }
.dm-time { font-size: 11px; color: var(--faint); align-self: flex-start; margin-top: 2px; white-space: nowrap; }
.working { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--accent-on-soft); flex-shrink: 0; }

.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 14px; }
.view-head h1, .view-head h2 { font-size: 22px; font-weight: 700; min-width: 0; }
/* 見出しが2行になっても、右側のリンクは幅を譲らず1行のまま（最後の1文字だけ折り返すのを防ぐ） */
.view-head .link { flex-shrink: 0; white-space: nowrap; }
.section-title {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; margin: 28px 4px 10px;
}
.section-title .count { font-weight: 500; }
.section-title a, .section-title .link { font-weight: 500; }
.day-heading { font-size: 13px; font-weight: 700; color: var(--muted); margin: 22px 4px 8px; }
.day-heading:first-of-type { margin-top: 6px; }

/* ═════════════ 部品 ═════════════ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
/* カード内のセクション見出し（余計な説明文をなくして、見出しだけで分かるようにする） */
.card-h { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.card.tappable { cursor: pointer; transition: background .15s, transform .1s; }
@media (hover: hover) { .card.tappable:hover { background: color-mix(in srgb, var(--surface) 70%, var(--surface-2)); } }
.card.tappable:active { transform: scale(.992); }
.card.enter { animation: enter .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@keyframes flash { 0%, 35% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }

.card-top { display: flex; align-items: center; gap: 10px; }
.card-top .badge { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.who b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .time { font-size: 12px; color: var(--faint); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 1px 8px; margin-bottom: 10px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal { font-size: 17px; font-weight: 700; line-height: 1.55; margin: 12px 0 4px; word-break: break-word; }
.detail .goal { font-size: 19px; }
.actions { color: var(--muted); font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; }
.reflect { display: grid; gap: 8px; margin-top: 12px; }
.reflect > div { background: var(--surface-2); border-radius: var(--radius-md); padding: 10px 12px; }
.reflect .label, .field-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.reflect p { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.card-foot { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--faint); font-size: 13px; }
.spacer { flex: 1; }
.field-block { margin-top: 22px; }
.field-block p { white-space: pre-wrap; word-break: break-word; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.badge.active { background: var(--accent-soft); color: var(--accent-on-soft); }
.badge.done { background: var(--done-soft); color: var(--done-on-soft); }
.badge.role { background: var(--surface-2); color: var(--muted); font-weight: 500; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; flex-shrink: 0; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }

/* 今日の活動カード */
.focus-card { padding: 22px; }
.focus-card h2 { font-size: 18px; font-weight: 700; line-height: 1.5; margin: 4px 0 2px; word-break: break-word; }
.focus-card.active { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: linear-gradient(var(--accent-softer), var(--surface) 140px); }
.focus-card .lead { color: var(--muted); font-size: 14px; margin-top: 4px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.eyebrow .muted { font-weight: 400; }
.step { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.step.done { background: var(--done); color: #fff; }
.checkout { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.checkout .row { margin-top: 18px; }
.subtle-actions { display: flex; justify-content: center; gap: 4px; margin-top: 10px; }
.suggestion {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; cursor: pointer;
  margin: 12px 0 2px; padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--accent-softer); border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
}
.suggestion-label { font-size: 12px; font-weight: 700; color: var(--accent-on-soft); }
.suggestion-text { font-size: 14px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

.avatar-stack { display: flex; align-items: center; background: none; border: 0; padding: 4px 6px; border-radius: 99px; cursor: pointer; gap: 6px; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.avatar-stack:hover { background: var(--surface-2); }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--bg); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* フォーム */
label { display: block; font-size: 14px; font-weight: 700; margin: 16px 0 6px; }
label .hint { font-weight: 400; color: var(--faint); font-size: 12px; margin-left: 6px; }
input[type="text"], input[type="url"], input[type="search"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); line-height: 1.65;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 11px 13px; transition: border-color .15s, background .15s;
}
textarea { resize: none; min-height: 52px; overflow: hidden; display: block; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.field-note { font-size: 12px; color: var(--muted); margin-top: 6px; }
.field-note:empty { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .08s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
@media (hover: hover) { .btn.primary:hover:not(:disabled) { background: var(--accent-hover); } }
.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text); font-weight: 500; }
@media (hover: hover) { .btn.ghost:hover:not(:disabled) { background: var(--surface-2); } }
.btn.soft { background: var(--surface-2); color: var(--text); font-weight: 500; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; border-color: var(--border-strong); color: var(--danger); font-weight: 500; }
.btn.google { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
@media (hover: hover) { .btn.google:hover:not(:disabled) { background: var(--surface-2); } }
.btn.block { width: 100%; margin-top: 20px; min-height: 50px; font-size: 16px; }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 13px; border-radius: 999px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.row .btn.block { margin-top: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: transparent; border: 0; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.small { width: 30px; height: 30px; }
.link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 8px; margin: -4px 0; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--muted); }
.link:hover { background: var(--surface-2); color: var(--text); }
.link.accent { color: var(--accent-on-soft); font-weight: 700; }
.link.danger { color: var(--danger); }

.chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 6px; padding: 2px 16px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); border-radius: 99px; padding: 5px 14px; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip.accent[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.avatar { position: relative; flex-shrink: 0; display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%; font-weight: 700; line-height: 1; user-select: none; }
.avatar img, .cicon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.status-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--panel-bg); }
.cicon { position: relative; flex-shrink: 0; display: inline-grid; place-items: center; overflow: hidden; font-weight: 700; line-height: 1; letter-spacing: -.02em; user-select: none; }

/* プロジェクト内のタブ（活動ログ／ゴールと学び） */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 16px; }
.tabs .tab { padding: 10px 14px; font-size: 14px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .tab:hover { color: var(--text); }
.tabs .tab.active { color: var(--accent-on-soft); border-bottom-color: var(--accent); }

/* ゴールと学び */
.goal-text { font-size: 16px; line-height: 1.8; margin-top: 10px; word-break: break-word; }
.field-block .count { font-weight: 500; color: var(--faint); }
.criteria { display: grid; gap: 2px; margin-top: 6px; }
.criterion { display: flex; align-items: center; gap: 10px; padding: 7px 2px; }
.criterion.done .ctext { color: var(--muted); }
.tick {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--border-strong);
  background: var(--surface); display: grid; place-items: center; color: #fff; cursor: pointer; padding: 0;
}
.tick:disabled { cursor: default; opacity: .6; }
.criterion.done .tick { background: var(--done); border-color: var(--done); }
.ctext { flex: 1; min-width: 0; font-size: 14px; line-height: 1.5; word-break: break-word; }
.cby { font-size: 11px; color: var(--faint); white-space: nowrap; flex-shrink: 0; }

/* My room の Todo */
.todo { padding: 18px 18px 10px; }
.todo-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.todo-top h2 { font-size: 17px; font-weight: 800; margin: 0; }
.todo-count { font-size: 13px; font-weight: 700; color: var(--done-on-soft); white-space: nowrap; }
.todo-count .faint { color: var(--faint); font-weight: 500; }
.todo-progress { height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.todo-progress span { display: block; height: 100%; background: var(--done); border-radius: inherit; transition: width .3s ease; }
.todo-add {
  display: flex; align-items: center; gap: 6px; margin: 14px 0 6px; padding: 4px 4px 4px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; transition: border-color .15s, background .15s;
}
.todo-add:focus-within { border-color: var(--accent); background: var(--surface); }
.todo-add-icon { display: grid; place-items: center; color: var(--faint); flex-shrink: 0; }
.todo-add input[type="text"] { flex: 1; min-width: 0; background: transparent; border: 0; padding: 7px 4px; }
.todo-add input[type="text"]:focus { background: transparent; }
.todo-hint { font-size: 13px; color: var(--muted); margin: 10px 4px 8px; line-height: 1.7; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-item { display: flex; align-items: center; gap: 4px; min-height: 48px; border-bottom: 1px solid var(--border); }
.todo-item:last-child { border-bottom: 0; }
.todo-tick { display: grid; place-items: center; width: 40px; height: 44px; margin-left: -8px; background: none; border: 0; padding: 0; cursor: pointer; flex-shrink: 0; }
.todo-tick .box {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); color: transparent; transition: background .15s, border-color .15s, color .15s;
}
@media (hover: hover) { .todo-tick:hover .box { border-color: var(--done); color: var(--done); } }
.todo-item.done .todo-tick .box { background: var(--done); border-color: var(--done); color: #fff; }
.todo-text { flex: 1; min-width: 0; font-size: 15px; line-height: 1.55; padding: 10px 0; white-space: pre-wrap; word-break: break-word; }
.todo-item.done .todo-text { color: var(--faint); text-decoration: line-through; }
.todo-actions { display: flex; gap: 2px; flex-shrink: 0; }
/* マウスのある画面では、行に乗せたときだけ編集・削除を出す（スマホでは常に出す） */
@media (hover: hover) {
  .todo-actions { opacity: 0; transition: opacity .15s; }
  .todo-item:hover .todo-actions, .todo-item:focus-within .todo-actions { opacity: 1; }
}
.todo-done { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 4px; }
.todo-fold {
  display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); padding: 10px 8px 10px 2px; border-radius: 8px;
}
.todo-fold:hover { color: var(--text); }
.todo-fold svg { transition: transform .15s; }
.todo-fold.open svg { transform: rotate(90deg); }
.todo-item.editing { padding: 6px 0; }
.todo-edit { display: flex; gap: 6px; align-items: center; width: 100%; }
.todo-edit input[type="text"] { flex: 1; min-width: 0; padding: 7px 12px; }
.due-left { font-size: 12px; color: var(--muted); margin-left: 6px; }
.due-left.over { color: var(--danger); font-weight: 700; }

/* ミーティング記録 */
.meetings { display: grid; gap: 4px; margin-top: 10px; }
.meeting { display: flex; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--border); }
.meeting:first-child { border-top: 0; padding-top: 4px; }
.meeting-date { flex-shrink: 0; width: 44px; padding-top: 1px; font-size: 13px; font-weight: 700; color: var(--muted); }
.meeting-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.meeting-body p { font-size: 14px; line-height: 1.6; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.field-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500;
  padding: 4px 12px; border-radius: 99px; background: var(--surface-2); color: var(--text); border: 1px solid transparent;
}
.field-chip.pick { cursor: pointer; }
.field-chip.pick:hover { border-color: var(--border-strong); }
.field-chip.pick.on { background: var(--accent-soft); color: var(--accent-on-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); font-weight: 700; }
.field-chip.add { cursor: pointer; background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); }
.field-chip.add:hover { border-color: var(--accent); color: var(--accent-on-soft); }
.field-chip.removable { cursor: pointer; }
.field-chip .x { color: var(--faint); font-weight: 700; }
.field-chip.removable:hover { background: var(--danger-soft); color: var(--danger); }
.field-chip.empty { background: none; border: 0; padding: 4px 0; color: var(--faint); font-size: 13px; }
.suggest-label { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.field-note.warn { color: var(--danger); }

.levels { display: grid; gap: 6px; margin-top: 4px; }
.level {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); font-size: 14px;
}
.level b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); font-size: 12px; flex-shrink: 0; }
.level:hover { border-color: var(--border-strong); }
.level.on { border-color: var(--accent); background: var(--accent-softer); font-weight: 700; }
.level.on b { background: var(--accent); color: var(--accent-ink); }

.badge.motivation { background: var(--surface-2); color: var(--muted); }
.badge.motivation.m5 { background: #f1e9fd; color: #7743cf; }
.badge.motivation.m4 { background: var(--accent-soft); color: var(--accent-on-soft); }
.badge.motivation.m3 { background: var(--done-soft); color: var(--done-on-soft); }
@media (prefers-color-scheme: dark) { .badge.motivation.m5 { background: #2c2340; color: #c3aaf0; } }

/* 立ち位置の内訳：5段階をタイルで並べ、誰がどこにいるかを一目で見せる */
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.overview-tile { display: grid; gap: 6px; align-content: start; min-height: 72px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-2); font-size: 13px; }
.overview-tile.m5 { background: #f1e9fd; }
.overview-tile.m4 { background: var(--accent-soft); }
.overview-tile.m3 { background: var(--done-soft); }
@media (prefers-color-scheme: dark) { .overview-tile.m5 { background: #2c2340; } }
.overview-label { font-weight: 700; }
.overview-people { color: var(--text); word-break: break-word; }
.overview-tile.none .overview-people { color: var(--faint); }

/* メンバーのカード：名前を削らずに折り返し、「あなた」バッジと更新時刻を見えるようにする */
.learner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.learner-grid > .card { margin: 0; display: grid; gap: 12px; }
.learner .who b { white-space: normal; }
.learner .who .time { white-space: nowrap; }
.learner-goal { font-size: 15px; font-weight: 700; line-height: 1.7; word-break: break-word; }
.learner-actions { font-size: 14px; color: var(--muted); line-height: 1.7; word-break: break-word; }
.learner-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.learner .comments { margin-top: 0; }
.pd-toggle svg { transform: rotate(90deg); transition: transform .15s; }
.pd-toggle[aria-expanded="true"] svg { transform: rotate(-90deg); }
.advice-list { display: grid; gap: 10px; margin-bottom: 10px; }
.composer.flat { position: static; box-shadow: none; border-color: var(--border); margin-top: 0; }

/* コメント */
.comments { margin-top: 8px; }
.thread { margin-bottom: 14px; }
.comment { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-md); }
.comment.flash .comment-bubble { animation: flash 2.2s ease; }
.comment-main { flex: 1; min-width: 0; }
.comment-bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; padding: 9px 13px; }
.comment-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.comment-head b { font-weight: 700; }
.comment-head .time { color: var(--faint); font-size: 12px; }
.comment-body { font-size: 15px; white-space: pre-wrap; word-break: break-word; margin-top: 1px; }
.comment-actions { display: flex; gap: 2px; margin: 4px 0 0 4px; }
.comment.deleted .comment-bubble { background: transparent; border-style: dashed; color: var(--faint); font-size: 13px; }
.replies { margin: 8px 0 0 40px; display: grid; gap: 10px; }

.composer {
  position: sticky; bottom: calc(10px + var(--safe-b)); z-index: 10;
  margin-top: 16px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 22px; padding: 6px 6px 6px 14px; box-shadow: var(--shadow-lg);
}
/* スマホでは下タブバー（#tabsBottom, z-index:30）が乗ってしまうため、その高さぶん浮かせる */
@media (max-width: 899px) {
  .composer { bottom: calc(70px + var(--safe-b)); }
}
/* DMの入力欄は、やりとりの長さに関わらず常に画面下端に固定する（Slack/Discordと同じ）。
   sticky はページの高さがビューポートより低いと画面下端まで届かないため fixed にし、
   main の横幅・中央寄せに合わせて位置を合わせる */
.composer.dm { position: fixed; left: 50%; transform: translateX(-50%); width: calc(100% - 40px); max-width: 860px; }
/* PC は左に紺のサイドバー（236px）があるので、その右側の真ん中に合わせる（本文と同じ位置になる） */
@media (min-width: 900px) {
  .composer.dm { left: calc(50% + 118px); width: calc(100% - 236px - 40px); }
}
@media (max-width: 899px) {
  /* DM画面は下タブバーを表示しないので、そのぶんの余白（70px）は不要。画面下端ぎりぎりに */
  .composer.dm { width: calc(100% - 32px); max-width: 728px; bottom: calc(10px + var(--safe-b)); }
}
.composer-row { display: flex; align-items: flex-end; gap: 6px; }
.composer textarea { background: transparent; border: 0; padding: 8px 0; min-height: 40px; max-height: 180px; overflow-y: auto; }
.composer textarea:focus { background: transparent; }
.send-btn { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); }
.send-btn:disabled { opacity: .5; }
.replying { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; color: var(--accent-on-soft); }
.composer-note { font-size: 12px; color: var(--muted); padding: 6px 4px; text-align: center; }
.composer-preview:empty { display: none; }
.composer-preview { position: relative; display: inline-block; margin: 6px 0 2px 8px; }
.composer-preview img { display: block; max-width: 110px; max-height: 110px; border-radius: 10px; object-fit: cover; }
.composer-preview .icon-btn.small { position: absolute; top: -8px; right: -8px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }

/* DM */
/* 最後のメッセージが固定表示の .composer の裏に隠れないよう、その高さぶん余白を確保する */
.chat { display: flex; flex-direction: column; gap: 3px; min-height: 40vh; padding-bottom: 80px; }
@media (max-width: 899px) {
  .chat { padding-bottom: 140px; }
}
.chat .load-older { align-self: center; margin-bottom: 8px; }
.day-sep { align-self: center; font-size: 12px; color: var(--faint); background: var(--surface-2); border-radius: 99px; padding: 1px 12px; margin: 14px 0 8px; }
/* Slack/Discordのような、吹き出しを使わない一列のメッセージ表示。
   自分/相手を色や左右で区別せず、アイコン＋名前の有無だけで連続発言をまとめる */
.msg { display: flex; gap: 12px; align-items: flex-start; padding: 2px 6px; border-radius: 8px; }
.msg-avatar { width: 36px; flex-shrink: 0; }
.msg-body { flex: 1; min-width: 0; }
.msg-header { display: flex; align-items: baseline; gap: 8px; }
.msg-header b { font-size: 14.5px; font-weight: 700; }
.msg-time { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.msg-text { margin-top: 2px; padding: 1px 6px; margin-inline: -6px; border-radius: 6px; white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.6; }
.msg.mine .msg-text { cursor: pointer; }
@media (hover: hover) { .msg.mine .msg-text:hover { background: var(--surface-2); } }
.msg.mine .msg-text:active { background: var(--surface-2); }
.msg-image-wrap { position: relative; display: inline-block; margin-top: 4px; max-width: 100%; }
.msg-image { display: block; max-width: min(320px, 100%); max-height: 320px; border-radius: 12px; cursor: zoom-in; }
.msg-image-delete {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.chat-empty { max-width: 560px; margin: 0 auto; padding: 24px 0 12px; }
.dm-hello { margin-bottom: 14px; }
.dm-hello .mp-name { font-size: 20px; }
.dm-hello-hint { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }

/* 通知 */
.inbox-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.inbox-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.inbox-item:last-child { border-bottom: 0; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.unread { background: var(--accent-softer); }
.inbox-item .text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.6; }
.inbox-item .excerpt { margin-top: 2px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.inbox-item .meta { color: var(--faint); font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 6px; }

.tip { display: flex; gap: 12px; align-items: flex-start; }
.tip > svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.tip > div { flex: 1; min-width: 0; }
.tip b { display: block; font-size: 15px; }
.tip p { color: var(--muted); font-size: 13px; margin: 2px 0 10px; }
.tip .close { margin: -8px -8px 0 auto; }

/* コミュニティの情報 */
.hero { display: flex; align-items: center; gap: 16px; margin: 8px 2px 18px; }
.hero .cicon { border-radius: 22px; }
.hero h2 { font-size: 24px; font-weight: 700; line-height: 1.35; word-break: break-word; }
.hero p { color: var(--muted); font-size: 14px; }
.invite-box { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: var(--radius-md); padding: 6px 6px 6px 12px; margin-top: 10px; }
.invite-box code { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover, button.list-row:hover { background: var(--surface-2); }
.list-row .text { flex: 1; min-width: 0; line-height: 1.45; }
.list-row .text b { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.list-row .text span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .hash { font-size: 20px; color: var(--faint); width: 22px; text-align: center; }
.person-list { max-height: 52vh; overflow-y: auto; margin: 12px -8px 0; }
.person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border: 0; background: none; border-radius: 12px; text-align: left; cursor: pointer; }
.person:hover { background: var(--surface-2); }
.person .text { flex: 1; min-width: 0; line-height: 1.4; }
.person .text b { display: block; font-size: 15px; }
.person .text span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.danger-zone { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; }

/* 呼びかけバナー（例：まだ「引っ張る」を選んでいない） */
.callout {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-softer); border: 1px solid var(--accent-soft); border-radius: var(--radius-md);
  padding: 12px 14px; margin: 4px 2px 16px; font-size: 14px;
}
.callout-icon { font-size: 18px; flex-shrink: 0; }
.callout p { flex: 1; min-width: 160px; }
.btn.dark { background: var(--text); color: var(--bg); }
@media (hover: hover) { .btn.dark:hover:not(:disabled) { opacity: .85; } }

/* プロジェクト一覧のカード */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pcard {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .1s, background .15s;
}
@media (hover: hover) { .pcard:hover { background: color-mix(in srgb, var(--surface) 70%, var(--surface-2)); } }
.pcard:active { transform: scale(.99); }
/* カード全体を覆う透明なリンク。参加ボタンの下に敷き、カードの他の場所のクリックを受け止める */
.pcard-link { position: absolute; inset: 0; }
.pcard-head { position: relative; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
/* 色は colorFor() が発色のよいライトモード向けの色をインラインで付けるため、
   ダークモードでは背景の上に黒い膜を重ねて黒背景になじませる。
   （filter で全体を暗くすると、プロジェクト名や「参加する」ボタンまで暗くなって読みにくい） */
@media (prefers-color-scheme: dark) {
  .pcard-head::before { content: ''; position: absolute; inset: 0; background: rgb(0 0 0 / .62); }
  .pcard-head > b, .pcard-head > .chip-row { position: relative; } /* 膜より手前に出す */
  .pcard-head > b { color: var(--text) !important; }
}
.pcard-head b { font-size: 17px; font-weight: 700; line-height: 1.4; word-break: break-word; padding-right: 52px; }
.pcard-joined {
  position: absolute; top: 12px; right: 14px; font-size: 10.5px; font-weight: 700;
  background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 3px 9px; white-space: nowrap;
}
.pcard-join-btn {
  position: absolute; top: 10px; right: 12px; font-size: 12px; font-weight: 700;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 99px;
  padding: 6px 14px; white-space: nowrap; cursor: pointer;
  pointer-events: auto; /* 親 .pcard-head は pointer-events:none なので、ボタン自身では再度有効にする */
}
.pcard-join-btn:disabled { opacity: .6; cursor: default; }
.pcard-body { padding: 12px 16px; flex: 1; }
.pcard-goal { font-size: 14px; line-height: 1.6; margin-top: 4px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.pcard-goal.empty { color: var(--faint); }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.pcard-people { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pcard-people .avatar { box-shadow: 0 0 0 2px var(--surface-2); margin-left: -8px; }
.pcard-people .avatar:first-child { margin-left: 0; }
.lead-pill { font-size: 11px; font-weight: 700; color: var(--accent-on-soft); background: var(--accent-soft); border-radius: 99px; padding: 3px 10px; white-space: nowrap; }
.lead-pill.none { color: var(--muted); background: var(--surface-3); }


/* プロジェクト詳細のタブ（ゴール／メンバー／記録） */
.dtabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin: 2px 0 20px; }
.dtabs a, .dtabs button { padding: 11px 0; font-size: 15px; font-weight: 700; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; text-decoration: none; }
.dtabs a.active, .dtabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.dtabs a:hover, .dtabs button:hover { color: var(--text); }

/* プロジェクト詳細の上部：参加者・分野と「参加する」を1行に */
.pd-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 2px 6px; }
.pd-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.pd-head .avatar-stack { margin-left: -6px; }
.pd-sep { width: 1px; height: 16px; background: var(--border-strong); margin: 0 4px; }
.field-chip.add.round { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; }

/* 概要タブ：広い画面ではゴール・目標・過去のミーティングを左、最新のミーティングを右に置く */
.pd-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.pd-grid > .card { margin: 0; }
@media (min-width: 900px) {
  .pd-grid { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "goal latest" "crit latest" "past latest"; }
  .pd-goal { grid-area: goal; }
  .pd-latest { grid-area: latest; }
  .pd-crit { grid-area: crit; }
  .pd-past { grid-area: past; }
}
.pd-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pd-card-head h2, .pd-card-title { font-size: 16px; font-weight: 700; }
.pd-card-title { margin-bottom: 12px; }
.pd-eyebrow.pd-eyebrow { font-size: 13px; color: var(--accent-on-soft); }
.pd-goal .goal-text { font-size: 19px; font-weight: 700; line-height: 1.7; margin: 0; }
@media (max-width: 599px) { .pd-goal .goal-text { font-size: 17px; } }
.pd-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 16px; font-size: 14px; }
.pd-meta > div { display: flex; gap: 10px; min-width: 0; }
.pd-meta dt { color: var(--muted); flex-shrink: 0; }
.pd-meta dd { margin: 0; font-weight: 700; word-break: break-word; }
.pd-meta .due-left { font-size: 13px; color: var(--accent-on-soft); margin-left: 8px; }
.pd-meta .due-left.over { color: var(--danger); }
.pd-empty { font-size: 14px; }
.pd-note { font-size: 13px; color: var(--muted); white-space: nowrap; }
.pd-count { font-size: 14px; color: var(--muted); }
.pd-count b { font-size: 18px; color: var(--text); }
.pd-progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 2px 0 8px; }
.pd-progress span { display: block; height: 100%; border-radius: 99px; background: var(--done); transition: width .2s; }
.pd-add { margin-top: 6px; }
.pd-latest { display: grid; gap: 14px; }
.pd-latest .pd-card-head { margin: 0; }
.pd-latest-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pd-past .meetings { margin-top: 0; }
.meeting-next { color: var(--muted); }

/* 「やったこと／変わったこと」と、目立たせる「ネクスト」 */
.mini-label { display: block; font-size: 12px; font-weight: 700; color: var(--accent-on-soft); margin-bottom: 4px; }
.mini-label.done { color: var(--done-on-soft); }
.pd-did p { font-size: 15px; line-height: 1.7; word-break: break-word; }
.next-box { background: var(--accent-soft); border-radius: var(--radius-md); padding: 12px 14px; }
.next-box p { font-size: 15px; line-height: 1.6; word-break: break-word; }
.pd-latest .next-box p { font-size: 16px; font-weight: 700; }

/* 記録タブ：読みやすい幅の1列。他の人の作業中は1行ずつ */
.pd-log { max-width: 760px; margin: 0 auto; }
.working-list { display: grid; gap: 8px; }
.working-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text); text-decoration: none; }
.working-row:hover { border-color: var(--border-strong); }
.working-row .who b { font-size: 15px; }
.log-card .pd-did { margin-top: 10px; }
.log-card .next-box { margin-top: 12px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; margin-bottom: 6px; }
.back-link:hover { color: var(--text); }
/* PCでは上のタブから一覧に戻れるので、スマホ用の「一覧」リンクは出さない（.back は上の専用ルール） */
@media (min-width: 900px) { .back-link.desktop-hide { display: none; } }

/* みんな（人物の一覧）。auto-fit にすることで、人数が少ないときにカードが
   間延びした空欄を残さずに、あるだけの人数分に広がって並ぶ（例：PCの広い
   画面で2人しかいなくても、4列ぶんの空白ができたりしない） */
.people-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
@media (max-width: 599px) {
  .people-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
.people-card {
  display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; text-align: left; padding: 16px; box-shadow: var(--shadow); transition: transform .12s;
  min-width: 0; /* グリッドの列幅まで縮められるようにする（これがないと中の折り返さない要素が幅を押し広げ、ページ全体が横にはみ出る） */
}
@media (hover: hover) { .people-card:hover { background: color-mix(in srgb, var(--surface) 70%, var(--surface-2)); } }
.people-card:active { transform: scale(.99); }
.people-card b { font-size: 17px; font-weight: 700; line-height: 1.4; word-break: break-word; }
/* スマホの2列だと1行では「yamad…」まで削られるので、2行まで折り返す */
.people-card .who b { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.pc-cohort { font-size: 13px; color: var(--muted); }
.people-tag { display: inline-block; font-size: 12.5px; font-weight: 700; border-radius: 8px; padding: 5px 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; background: var(--surface-2); color: var(--text); }
/* プロフィールに自分で付ける自由なタグ（14期、ゼミ長 など）の読み取り専用の表示 */
.tag-pills { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; }
.tag-pill { font-size: 11px; font-weight: 700; color: var(--accent-on-soft); background: var(--accent-softer); border-radius: 7px; padding: 2.5px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-pills.lg .tag-pill { font-size: 12.5px; padding: 4px 10px; border-radius: 8px; }
/* カードの目標文は縦に伸びやすいので、余白のあるPC画面でだけ見せる（スマホはタップして詳細へ） */
.pc-goal { font-size: 13px; line-height: 1.6; color: var(--muted); margin: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
@media (max-width: 899px) { .pc-goal { display: none; } }
.people-mot { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.mot-circle {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700;
  background: var(--muted); color: var(--bg);
}
.mot-circle.m3 { background: #3277b8; color: #fff; }
.mot-circle.m4 { background: var(--accent); color: var(--accent-ink); }
.mot-circle.m5 { background: #0a3d73; color: #fff; }
@media (prefers-color-scheme: dark) {
  .mot-circle.m3 { background: #4477ac; }
  .mot-circle.m5 { background: #4db4f5; color: #0a2540; }
}
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 18px; }
.filter-select {
  appearance: none; -webkit-appearance: none; width: auto; flex: 0 1 auto; min-width: 0; max-width: 100%; height: 36px; margin: 0; padding: 0 32px 0 14px;
  border: 1px solid var(--border-strong); border-radius: 99px; background-color: var(--surface); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23536471' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.filter-select:hover { background-color: var(--surface-2); }
.filter-select.on { border-color: var(--navy-tick); background-color: var(--navy-soft); color: var(--navy-text); }
.filter-clear { font-size: 13px; }
/* 詳細ダイアログ：プロジェクトごとの学び */
.person-detail .pd-projects { display: grid; gap: 0; margin-top: 16px; }
.pd-project { padding: 16px 0; border-top: 1px solid var(--border); }
.pd-project:first-child { border-top: 0; padding-top: 8px; }
.pd-mot-label { font-size: 13.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent-on-soft); border-radius: 99px; padding: 4px 12px; }
.pd-goal { font-size: 14px; line-height: 1.7; margin-top: 12px; color: var(--text); }
.person-detail-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.person-detail-row .pname { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* マイプロジェクト（プロジェクトに属さない個人の目標） */
.eyebrow-mini { font-size: 11px; font-weight: 800; color: var(--accent-on-soft); letter-spacing: .04em; }
.hero-dark {
  position: relative; border-radius: 20px; padding: 20px 20px 18px; margin-top: 8px;
  background: linear-gradient(160deg, #17181a, #262729); color: #ffffff;
}
@media (prefers-color-scheme: dark) { .hero-dark { background: linear-gradient(160deg, #000000, #1c1d1f); box-shadow: inset 0 0 0 1px #2f3336; } }
.hero-dark .edit-btn { position: absolute; top: 14px; right: 14px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.14); color: #ffffff; border: 0; border-radius: 99px; padding: 5px 12px; cursor: pointer; }
.hero-dark h2 { font-size: 19px; font-weight: 800; line-height: 1.5; padding-right: 60px; }
.hero-dark .note { font-size: 11.5px; color: rgba(255,255,255,.5); margin-top: 10px; }
.hero-dark .visible-to { display: flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 11.5px; color: rgba(255,255,255,.55); }
.hero-dark .visible-to .avatar { margin-left: -8px; box-shadow: 0 0 0 2px #17181a; }
.hero-dark .visible-to .avatar:first-child { margin-left: 6px; }
.hero-dark .add-visible { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.7); background: none; border: 1px dashed rgba(255,255,255,.3); border-radius: 99px; padding: 3px 10px; margin-left: 4px; cursor: pointer; }
.hero-dark textarea, .hero-dark input {
  width: 100%; box-sizing: border-box; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px; padding: 9px 11px; color: #ffffff; font-size: 13.5px; line-height: 1.6; resize: none;
}
.hero-dark .field-label-dark { font-size: 11.5px; font-weight: 700; color: rgba(255,255,255,.55); margin-top: 12px; display: block; }
.effort-row { display: flex; gap: 8px; margin-top: 7px; }
.effort-row button { width: 36px; height: 36px; border-radius: 50%; border: 0; font-size: 13px; font-weight: 700; cursor: pointer; background: var(--surface-2); color: var(--muted); }
.effort-row button.on { background: var(--text); color: var(--bg); }
.hero-dark .effort-row button { background: rgba(255,255,255,.1); color: rgba(255,255,255,.6); }
.hero-dark .effort-row button.on { background: var(--accent); color: #ffffff; }
.record-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.record-row { display: flex; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; align-items: flex-start; }
.record-num { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.record-row .title { font-size: 13px; font-weight: 700; color: var(--accent-on-soft); line-height: 1.5; }
.record-row .desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.record-row .record-effort { font-size: 11px; color: var(--faint); margin-top: 3px; }
.record-row time { font-size: 11px; color: var(--faint); flex-shrink: 0; white-space: nowrap; }
/* みんなのマイゴール */
.card.locked { text-align: center; padding: 28px 20px; }
.card.locked .emoji { font-size: 30px; }
.card.locked b { display: block; font-size: 15px; margin-top: 8px; }
.goal-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.goal-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.goal-card-head { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.goal-card-head b { font-size: 14.5px; font-weight: 700; }
.goal-card-goal { font-size: 15px; font-weight: 700; line-height: 1.6; margin-top: 12px; word-break: break-word; }
.goal-card-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.goal-card-latest { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.6; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.goal-card-latest .badge { margin-right: 6px; }
.goal-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.cheer-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); border-radius: 99px; padding: 6px 12px; cursor: pointer; }
.cheer-btn.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent-on-soft); }
.goal-card-foot .btn { margin-left: auto; }

/* カレンダー */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.cal-head .month { flex: 1; text-align: center; font-size: 16px; font-weight: 800; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 2px 14px; }
.cal-legend span { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.cal-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.cal-legend .cal-share { margin: -4px 0 -4px auto; font-weight: 700; color: var(--accent-on-soft); } /* 凡例の行の右端 */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-dow { text-align: center; font-size: 11px; color: var(--faint); padding: 6px 0; border-right: 1px solid var(--border); }
.cal-dow.sat { color: var(--accent-on-soft); }
.cal-dow.sun { color: var(--danger); }
.cal-cell {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px;
  min-height: 96px; padding: 4px; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: none; cursor: pointer; text-align: left; overflow: hidden;
}
.cal-cell .n { font-size: 12.5px; padding: 2px 4px; color: var(--text); }
.cal-cell.sat .n { color: var(--accent-on-soft); }
.cal-cell.sun .n { color: var(--danger); }
.cal-cell.dim { cursor: default; background: var(--surface-2); }
.cal-cell.dim .n { color: var(--faint); }
.cal-cell.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell.selected .n { font-weight: 800; color: var(--accent-on-soft); }
.cal-pill {
  font-size: 11px; font-weight: 600; line-height: 1.4; border-radius: 5px; padding: 2px 6px; margin: 0 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-pill.more { color: var(--muted); font-weight: 500; padding: 0 6px; }
@media (max-width: 899px) { .cal-cell { min-height: 68px; padding: 4px 2px; } .cal-pill { font-size: 10px; padding: 2px 3px; margin: 0; } }
/* コピーした予定を、選んだ日に貼り付けるバー */
.cal-paste { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 8px 8px 12px; border-radius: var(--radius-md); background: var(--accent-softer); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.cal-paste > svg { color: var(--accent-on-soft); flex-shrink: 0; }
.cal-paste .text { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-paste .text b { color: var(--text); font-weight: 700; }
.cal-paste .btn { flex-shrink: 0; }
.cal-event { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.cal-event.tappable { cursor: pointer; transition: background .15s; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } /* 長押しで、文字の選択やメニューが出ないように */
@media (hover: hover) { .cal-event.tappable:hover { background: var(--surface-2); } }
.cal-event .row1 { display: flex; align-items: center; gap: 8px; }
.cal-event time { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-event .cat { font-size: 10.5px; font-weight: 700; background: var(--surface-2); border-radius: 99px; padding: 2px 9px; }
.cal-event .etitle { font-size: 14px; font-weight: 700; margin-top: 4px; word-break: break-word; }
.cal-event .edetail { font-size: 12.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; white-space: pre-line; }
.cal-event .enote { font-size: 11.5px; color: var(--accent-on-soft); font-style: italic; margin-top: 8px; line-height: 1.6; background: var(--accent-softer); border-radius: 8px; padding: 8px 10px; }
/* 予定を長押しで持ち上げて、別の日のマスへ運ぶ */
.cal-event.dragging { background: var(--surface-2); border-style: dashed; }
.cal-event.dragging > * { visibility: hidden; } /* 持ち上げたあとは、枠だけ残す */
.cal-ghost { position: fixed; left: 0; top: 0; z-index: 45; display: flex; align-items: baseline; gap: 8px; max-width: min(260px, calc(100vw - 16px)); padding: 9px 14px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 700; line-height: 1.4; pointer-events: none; will-change: transform; }
.cal-ghost time { flex-shrink: 0; font-size: 12px; color: var(--muted); }
.cal-ghost span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-cell.drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-drop-backdrop { position: fixed; inset: 0; z-index: 44; }
.cal-drop-menu { position: fixed; z-index: 45; display: flex; overflow: hidden; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); }
.cal-drop-menu button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 12px 22px; font-size: 15px; font-weight: 700; cursor: pointer; }
.cal-drop-menu button + button { border-left: 1px solid var(--border); }
.cal-drop-menu button:disabled { opacity: .55; cursor: default; }
.cal-drop-menu[inert] { pointer-events: none; }
@media (hover: hover) { .cal-drop-menu button:hover:not(:disabled) { background: var(--surface-2); } }
body.dragging-event, body.dragging-event * { cursor: grabbing !important; user-select: none; }
.cal-teacher { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-top: 16px; }
.cal-teacher .trow { display: flex; font-size: 12.5px; padding: 3px 0; }
.cal-teacher .trow .d { width: 74px; color: var(--muted); flex-shrink: 0; }

/* プロフィール */
.profile-head { display: flex; align-items: center; gap: 16px; margin: 12px 2px 18px; }
.profile-head h2 { font-size: 22px; font-weight: 700; line-height: 1.35; word-break: break-word; }
.profile-head .row { margin-top: 6px; flex-wrap: wrap; }
.settings .setting { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.settings .setting:first-of-type { border-top: 0; padding-top: 4px; }
.setting > svg { color: var(--muted); flex-shrink: 0; }
.setting .text { flex: 1; min-width: 0; }
.setting .text b { display: block; font-size: 15px; font-weight: 500; }
.setting .text span { display: block; font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 48px; height: 28px; border-radius: 99px; background: var(--surface-3); border: 0; cursor: pointer; flex-shrink: 0; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; }

/* ログイン・ようこそ */
.login { min-height: calc(100dvh - var(--header-h) - 80px); display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; padding: 12px 4px; }
.logo-mark { display: inline-grid; place-items: center; flex-shrink: 0; background: #141414; overflow: hidden; }
.login .logo-mark { margin-bottom: 20px; box-shadow: 0 6px 20px rgb(15 20 25 / .14); }
.dialog-body .logo-mark { margin-bottom: 14px; }
/* 背景が真っ黒になるダークモードでは、影の代わりに細い線で角丸の輪郭を見せる */
@media (prefers-color-scheme: dark) {
  .logo-mark { box-shadow: inset 0 0 0 1px #2f3336; }
  .login .logo-mark { box-shadow: inset 0 0 0 1px #2f3336; }
}
.login h1 { font-size: 30px; font-weight: 700; letter-spacing: .04em; }
.login-actions { display: grid; gap: 10px; margin-top: 36px; }
.login-actions .btn.block { margin-top: 0; }
.login .lead { color: var(--muted); margin-top: 4px; }
.fine { font-size: 12px; color: var(--faint); text-align: center; margin-top: 12px; }
.notice { background: var(--accent-softer); border: 1px solid var(--accent-soft); border-radius: var(--radius-md); padding: 10px 14px; font-size: 14px; margin-top: 20px; }

/* 空・読み込み中 */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .emoji { font-size: 36px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-top: 6px; }
.empty p { font-size: 14px; margin-top: 4px; }
.empty .row { justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.load-more { display: flex; justify-content: center; padding: 12px 0; }
.sk { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.sk-title { height: 64px; width: 60%; margin: 16px 2px 20px; border-radius: 12px; }
.sk-card { height: 150px; margin-bottom: 12px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.boot { padding-top: 8px; }

/* ダイアログ（スマホでは下から出るシート） */
dialog {
  border: 0; padding: 0; border-radius: 18px; width: min(460px, calc(100% - 32px));
  max-height: min(calc(100dvh - 32px), calc(var(--vvh, 100dvh) - 32px)); overflow-y: auto;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgb(15 20 25 / .4); }
dialog[open] { animation: sheet .25s cubic-bezier(.2, .8, .2, 1); }
.dialog-body { padding: 22px 20px 18px; }
.dialog-body[inert] { pointer-events: none; } /* inert に未対応の古いブラウザでも、押せないようにする */
.dialog-body h2 { font-size: 18px; font-weight: 700; line-height: 1.5; }
.dialog-body > p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.dialog-body .row { margin-top: 20px; }
.dialog-body ol { padding-left: 1.3em; margin: 12px 0 0; font-size: 14px; display: grid; gap: 8px; }
.dialog-body ol svg { vertical-align: -5px; color: var(--done); }
.choice { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px; margin-top: 10px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
.choice:hover { background: var(--surface-2); }
.choice > svg { color: var(--accent); flex-shrink: 0; }
.choice b { display: block; font-size: 15px; }
.icon-picker { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.icon-picker .cicon { border-radius: 18px; }
.crop-frame {
  position: relative; width: 260px; max-width: 100%; height: 260px; margin: 14px auto 4px;
  overflow: hidden; background: var(--surface-2); touch-action: none; cursor: grab;
}
.crop-frame:active { cursor: grabbing; }
.crop-frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crop-frame.round { border-radius: 50%; }
.crop-frame:not(.round) { border-radius: 18px; }
.crop-frame img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; -webkit-user-drag: none; }
.crop-zoom {
  -webkit-appearance: none; appearance: none; width: 260px; max-width: 100%; height: 4px;
  border-radius: 99px; background: var(--border); display: block; margin: 4px auto 0;
}
.crop-zoom::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 0; }
.crop-zoom::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 0; }
.crop-zoom::-moz-range-track { height: 4px; border-radius: 99px; background: var(--border); }
@keyframes sheet { from { opacity: 0; transform: translateY(24px); } }
@media (max-width: 560px) {
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; transform: translateY(calc(-1 * var(--kb-inset, 0px))); }
  .dialog-body { padding-bottom: calc(20px + var(--safe-b)); }
  .dialog-body .row .btn { flex: 1; }
}

/* ダイアログ：X＋保存の見出し行と、枠のないタイトル欄（予定の追加など） */
.sheet-grip { display: none; }
@media (max-width: 560px) {
  .sheet-grip { display: block; width: 36px; height: 4px; border-radius: 99px; background: var(--border-strong); margin: 0 auto 12px; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-body .settings { margin-top: 6px; }
.setting-label { margin: 0; flex-shrink: 0; font-size: 15px; font-weight: 500; }
.setting-value { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.setting-value .sep { color: var(--faint); font-size: 13px; }
.setting-value input[type="text"] {
  flex: 1; min-width: 0; width: auto; background: transparent; border: 0; padding: 4px 0;
  text-align: right; font-size: 15px; color: var(--text);
}
.setting-value input[type="text"]:focus { background: transparent; }
.setting-value input[type="text"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.setting-value input[type="time"] {
  width: auto; flex: none; background: var(--surface-2); border: 0; border-radius: 10px;
  padding: 7px 12px; font-size: 14px; text-align: center; color: var(--text);
}
/* 参考にした画像のように、ピルの中は文字だけにする（アイコン分の余白・非対称さをなくす） */
.setting-value input[type="time"]::-webkit-calendar-picker-indicator {
  display: none;
}
.cat-dot { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }

/* 日付ピル：端末のロケールで年/月/日の順が変わってしまう表示のかわりに、
   常に「年」から始まる決まった表記を重ねて出す（タップして開くピッカー自体は変えない） */
.pill-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.pill-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; cursor: pointer; }
.pill-text {
  display: inline-block; white-space: nowrap; pointer-events: none;
  background: var(--surface-2); border-radius: 10px; padding: 7px 12px;
  font-size: 14px; color: var(--text);
}
.pill-native:focus-visible ~ .pill-text { outline: 2px solid var(--accent); outline-offset: 2px; }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); z-index: 50;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 14px;
  font-size: 14px; font-weight: 500; width: max-content; max-width: calc(100% - 32px); text-align: center;
  transition: opacity .2s, transform .2s; box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
/* スマホでは下タブバーの上に出す（.composer と同じ理由） */
@media (max-width: 899px) {
  #toast { bottom: calc(70px + var(--safe-b)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ───────── 紺色（アドネス寄り）：サイドバー・目標ツリーで使う ───────── */
:root { --navy: #14213d; --navy-soft: #e8ecf6; --navy-text: #14213d; --navy-tick: #14213d; }
@media (prefers-color-scheme: dark) {
  :root { --navy: #0e1830; --navy-soft: #18233d; --navy-text: #a9bce6; --navy-tick: #3c5591; }
}
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── PC：左の紺色サイドバー（スマホは今までどおり下のタブ） ── */
@media (min-width: 900px) {
  #app { padding-left: 236px; }
  #app.top #header { display: none; }
  #tabsTop {
    position: fixed; top: 0; left: 0; bottom: 0; width: 236px; z-index: 35;
    background: var(--navy); border: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
    color: #c9d3ea; overflow-y: auto;
  }
  #app.no-tabs #tabsTop { display: block; }
  #app.wide main, #app.wide .bar { max-width: 1240px; }
}
.side { display: flex; flex-direction: column; gap: 6px; min-height: 100%; padding: 18px 14px 16px; }
.side-brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .04em; text-decoration: none; padding: 4px 8px 10px; }
.side-brand svg { color: #fff; }
.side-switch {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px; margin-bottom: 10px;
  background: rgb(255 255 255 / .07); border: 0; border-radius: 12px; color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; text-align: left;
}
.side-switch span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-switch:hover { background: rgb(255 255 255 / .12); }
.side-group { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid rgb(255 255 255 / .08); }
.side-switch + .side-group { border-top: 0; }
.side-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #c9d3ea; text-decoration: none; font-size: 14.5px; font-weight: 600;
}
.side-item span:first-of-type { flex: 1; }
.side-item:hover { background: rgb(255 255 255 / .07); color: #fff; }
.side-item.active { background: rgb(255 255 255 / .13); color: #fff; }
.side-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--alert); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.side-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; }
.side-me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-me:hover, .side-me.active { background: rgb(255 255 255 / .1); }

/* ── パンくず ── */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 2px 2px 14px; min-width: 0; }
.crumbs a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs svg { transform: rotate(-90deg); color: var(--faint); flex-shrink: 0; }
.crumbs [aria-current] { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dtabs a svg { transform: rotate(-90deg); vertical-align: -1px; margin-left: 2px; }

/* ── プロジェクトのアイコン ── */
.project-icon { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; overflow: hidden; font-weight: 700; line-height: 1; }
.project-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pcard-title { display: flex; align-items: center; gap: 10px; }
.pcard-title b { padding-right: 52px; }
@media (prefers-color-scheme: dark) { .pcard-head > .pcard-title { position: relative; } .pcard-head > .pcard-title b { color: var(--text) !important; } }

/* ── 目標タブ：ゴール → 目標 → やること の木 ── */
.pn { display: grid; gap: 28px; align-items: start; }
@media (min-width: 1100px) { .pn { grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; } }
.pn-main { min-width: 0; }
.pn-side { display: flex; flex-direction: column; gap: 16px; }
.pn-goal { display: flex; align-items: flex-start; gap: 16px; }
.pn-goal-text, .pn-goal-input { flex: 1; min-width: 0; font-size: 22px; font-weight: 700; line-height: 1.5; color: var(--text); word-break: break-word; padding: 8px 10px; margin: 0; }
.pn-goal-text.empty { color: var(--faint); font-weight: 500; }
.pn-goal-input { font-family: inherit; border: 1px solid transparent; border-radius: 12px; background: transparent; resize: none; overflow: hidden; min-height: 52px; }
.pn-goal-input:hover { background: var(--surface-2); }
.pn-goal-input:focus { outline: none; background: var(--surface); border-color: var(--navy-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy-text) 15%, transparent); }
.pn-goal-input::placeholder { color: var(--faint); font-weight: 500; }
.pn-count { flex-shrink: 0; margin-top: 16px; font-size: 13px; font-weight: 700; color: var(--navy-text); background: var(--navy-soft); border-radius: 99px; padding: 4px 12px; white-space: nowrap; }
.pn-progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 18px 0 8px 64px; }
.pn-progress span { display: block; height: 100%; background: var(--navy-tick); border-radius: inherit; transition: width .3s; }
.pn-join { margin: 16px 0 0 64px; }
.pn-empty { margin: 18px 0 0 64px; }
.pn-tree, .pn-kids { list-style: none; margin: 0; padding: 0; }
.pn-tree { margin: 22px 0 0 40px; border-left: 2px solid var(--border); padding-left: 22px; }
.pn-item + .pn-item { margin-top: 18px; }
.pn-kids { margin: 6px 0 0 13px; border-left: 2px solid var(--border); padding-left: 20px; }
.pn-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 6px; border-radius: 10px; }
.pn-row:hover { background: var(--surface-2); }
.pn-row .icon-btn { opacity: .55; }
.pn-row:hover .icon-btn, .pn-row .icon-btn:focus-visible { opacity: 1; }
.pn-crit .pn-text { font-size: 16px; font-weight: 700; }
.pn-text { flex: 1; min-width: 0; line-height: 1.55; word-break: break-word; }
.pn-meta { font-size: 12px; font-weight: 700; color: var(--muted); }
.pn-dot {
  width: 26px; height: 26px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--border-strong); background: var(--surface); color: #fff; cursor: pointer; padding: 0;
}
.pn-dot.done { background: var(--navy-tick); border-color: var(--navy-tick); }
.pn-dot:disabled { cursor: default; }
.pn-tick { width: 26px; height: 26px; flex-shrink: 0; display: grid; place-items: center; background: none; border: 0; padding: 0; cursor: pointer; }
.pn-tick .box { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; border: 2px solid var(--border-strong); background: var(--surface); color: #fff; transition: background .15s, border-color .15s; }
.pn-tick.done .box { background: var(--navy-tick); border-color: var(--navy-tick); }
.pn-tick:disabled { cursor: default; }
.pn-task.done .pn-text { color: var(--faint); text-decoration: line-through; }
.pn-who { font-size: 12px; font-weight: 600; color: var(--navy-text); background: var(--navy-soft); border-radius: 99px; padding: 3px 10px; white-space: nowrap; max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.pn-who.none { color: var(--faint); background: var(--surface-2); }
.pn-add { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 10px; background: none; border: 0; border-radius: 10px; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.pn-add:hover { background: var(--surface-2); color: var(--text); }
.pn-add-crit { margin: 18px 0 0 62px; }
.pn-add-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 6px 6px 6px 10px; border: 1px solid var(--navy-text); border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--navy-text) 12%, transparent); }
.pn-add-row.pn-add-crit { margin-left: 62px; }
.pn-add-mark { color: var(--faint); display: grid; }
.pn-add-input { flex: 1; min-width: 0; border: 0 !important; background: none !important; padding: 6px 0 !important; font-size: 15px; box-shadow: none !important; outline: none; }
@media (max-width: 899px) {
  .pn-goal { gap: 12px; }
  .pn-goal-text, .pn-goal-input { font-size: 19px; }
  .pn-tree { margin-left: 22px; padding-left: 14px; }
  .pn-kids { margin-left: 12px; padding-left: 12px; }
  .pn-progress, .pn-join, .pn-empty { margin-left: 0; }
  .pn-add-crit, .pn-add-row.pn-add-crit { margin-left: 36px; }
  .pn-count { margin-top: 12px; }
  .pn-row .icon-btn { opacity: 1; }
}

/* ── アイコンを変えるパネル（アイコンのすぐ下に出る） ── */
.pn-icon-wrap { position: relative; flex-shrink: 0; }
.pn-icon-btn { position: relative; display: block; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 16px; }
.pn-icon-btn:focus-visible, .pn-icon-btn.open { outline: 3px solid color-mix(in srgb, var(--navy-text) 35%, transparent); outline-offset: 2px; }
.pn-icon-badge { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgb(0 0 0 / .25); }
/* プロジェクトのアイコンを変える吹き出し（プロフィール編集の .icon-picker とは別物なので名前を分ける） */
.icon-popover {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 40; width: 288px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 12px;
  animation: pop-in .14s ease-out;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.icon-picker-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.icon-picker-tabs button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.icon-picker-tabs button[aria-pressed="true"] { background: var(--navy-soft); color: var(--navy-text); }
.icon-picker-tabs .spacer { flex: 1; }
.icon-picker-body { display: flex; flex-direction: column; gap: 12px; }
.icon-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 8px; }
.icon-popover .swatch { width: 36px; height: 36px; border-radius: 10px; border: 0; cursor: pointer; }
.icon-popover .swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.icon-popover .glyph { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.icon-popover .glyph[aria-pressed="true"] { background: var(--navy-tick); border-color: var(--navy-tick); color: #fff; }
.icon-picker-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px; border: 1.5px dashed var(--border-strong); border-radius: 12px; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; margin: 0; }
.icon-picker-drop:hover { background: var(--surface-2); color: var(--text); }

/* ── 操作メニュー：スマホは下から出るシート ── */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; }
.sheet-scrim { position: absolute; inset: 0; background: rgb(0 0 0 / .4); opacity: 0; transition: opacity .22s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 8px 12px calc(14px + var(--safe-b)); transform: translateY(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  max-height: 80dvh; overflow-y: auto;
}
.sheet-wrap.open .sheet-scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: var(--border-strong); margin: 4px auto 10px; }
.sheet-title { font-size: 13px; color: var(--muted); padding: 2px 10px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-list { display: flex; flex-direction: column; }
.sheet-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 0 12px; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.sheet-item:hover { background: var(--surface-2); }
.sheet-item.danger { color: var(--danger); }
.sheet-item svg { color: var(--navy-text); }
.menu-dialog .menu-title { font-size: 15px; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-dialog .sheet-item { min-height: 44px; font-size: 15px; }

/* ── トースト：「元に戻す」付き（紺色） ── */
#toast.has-action { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--navy); color: #fff; padding: 10px 10px 10px 18px; }
#toast.has-action.show { pointer-events: auto; }
.toast-action { border: 0; background: rgb(255 255 255 / .14); color: #fff; font: inherit; font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.toast-action:hover { background: rgb(255 255 255 / .24); }

/* ── 記録タブ：プロジェクトを選ぶ ── */
.log-page { max-width: 720px; margin: 0 auto; }
.log-select { position: relative; width: max-content; max-width: 100%; margin-bottom: 18px; }
.log-select > summary { list-style: none; display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 6px 14px 6px 8px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 15px; font-weight: 700; cursor: pointer; user-select: none; }
.log-select > summary::-webkit-details-marker { display: none; }
.log-select > summary:hover { background: var(--surface-2); }
.log-select .project-icon { border-radius: 50% !important; flex: none; }
.log-select-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-select-caret { width: 8px; height: 8px; margin: -4px 2px 0 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; flex: none; }
.log-select[open] .log-select-caret { transform: rotate(-135deg); margin-top: 4px; }
.log-select-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 100%; max-width: min(360px, calc(100vw - 32px)); max-height: 60vh; overflow-y: auto; padding: 6px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, .14); }
.log-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; white-space: nowrap; }
.log-option:hover { background: var(--surface-2); }
.log-option.active { background: var(--navy-soft); color: var(--navy-text); }
.log-option-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.log-option-check { font-weight: 800; }
.log-option-label { padding: 8px 10px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.log-pick { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border: 1px solid var(--border-strong); border-radius: 99px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.log-pick .project-icon { border-radius: 50% !important; }
.log-pick:hover { background: var(--surface-2); }
.log-pick.active { background: var(--navy-tick); border-color: var(--navy-tick); color: #fff; }
.log-more { width: 100%; }
.log-more summary { font-size: 13px; color: var(--muted); cursor: pointer; padding: 4px 2px; width: max-content; }
.log-more-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.log-join { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; background: var(--navy-soft); color: var(--navy-text); font-size: 14px; font-weight: 600; margin-bottom: 16px; }

/* ── 記録に付けた写真・ファイル ── */
.session-files { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.attach-wrap { display: block; }
.attach-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.attach-btn:hover:not(:disabled) { border-color: var(--navy-text); color: var(--navy-text); background: var(--navy-soft); }
.attach-btn:disabled { cursor: default; opacity: .8; }
.attach-btn .spinner { width: 16px; height: 16px; }
.files { display: flex; flex-direction: column; gap: 8px; }
.log-card .files { margin-top: 12px; }
.file-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.files.compact .file-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 420px; }
.file-thumb { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .45); color: #fff; font-weight: 700; font-size: 16px; }
.file-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.file-doc { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 36px 10px 10px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; }
.file-doc:hover { background: var(--surface-2); }
.file-kind { flex-shrink: 0; min-width: 44px; height: 40px; padding: 0 6px; display: grid; place-items: center; border-radius: 9px; background: var(--navy-soft); color: var(--navy-text); font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.file-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.file-name b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name span { font-size: 12px; color: var(--muted); }
.file-x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgb(0 0 0 / .55); color: #fff; cursor: pointer; padding: 0; }
.file-doc .file-x { top: 50%; transform: translateY(-50%); background: var(--surface-3); color: var(--text); }
.file-count { font-size: 12px; }

/* ── マイページ ── */
.mp { max-width: 640px; margin: 0 auto; }
.mp-profile { position: relative; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; overflow: hidden; padding: 0 22px 22px; margin-bottom: 16px; }
.mp-cover { position: relative; height: 104px; margin: 0 -22px; background: var(--navy); overflow: hidden; }
.mp-cover span { position: absolute; border-radius: 50%; }
.mp-cover span:nth-child(1) { width: 180px; height: 180px; right: -40px; top: -60px; background: #1d9e75; opacity: .55; }
.mp-cover span:nth-child(2) { width: 110px; height: 110px; right: 90px; top: 40px; background: #378add; opacity: .45; }
.mp-cover span:nth-child(3) { width: 70px; height: 70px; left: 42%; top: -34px; background: #ef9f27; opacity: .5; }
.mp-actions { position: absolute; top: 116px; right: 18px; display: flex; gap: 6px; }
.mp-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: 99px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.mp-btn.icon-only { padding: 6px 8px; }
.mp-btn:hover { background: var(--surface-2); }
.mp-avatar { width: max-content; margin-top: -44px; border-radius: 50%; box-shadow: 0 0 0 5px var(--surface); position: relative; }
.mp-name { font-size: 22px; font-weight: 800; margin: 12px 0 6px; overflow-wrap: anywhere; }
.mp-bio { font-size: 14px; line-height: 1.8; color: var(--muted); margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mp-bio.empty { display: inline-block; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; color: var(--muted); text-decoration: underline dashed; text-underline-offset: 4px; cursor: pointer; }
.mp-goal { position: relative; overflow: hidden; background: var(--navy); color: #fff; border-radius: 20px; padding: 18px 22px 22px; margin-bottom: 28px; }
.mp-goal::after { content: ''; position: absolute; right: -36px; bottom: -36px; width: 130px; height: 130px; border-radius: 50%; border: 18px solid rgba(255,255,255,.06); }
.mp-goal-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.6); margin-bottom: 8px; }
.mp-goal-edit { position: relative; z-index: 1; padding: 4px 12px; border: 0; border-radius: 99px; background: rgba(255,255,255,.14); color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.mp-goal p { position: relative; margin: 0; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: 20px; font-weight: 700; line-height: 1.6; overflow-wrap: anywhere; }
.mp-goal p.empty { font-family: inherit; font-size: 15px; color: rgba(255,255,255,.6); font-weight: 600; }
.mp-section { font-size: 14px; font-weight: 800; color: var(--muted); margin: 0 0 14px 2px; }
.mp-logs { padding-left: 2px; }
.mp-log { position: relative; display: block; padding: 0 0 22px 26px; color: var(--text); text-decoration: none; }
.mp-log::before { content: ''; position: absolute; left: 5px; top: 16px; bottom: 0; width: 2px; background: var(--border-strong); }
.mp-log:last-child::before { display: none; }
.mp-log-dot { position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--navy-tick); background: var(--surface); box-sizing: border-box; }
.mp-log-meta { display: block; font-size: 12px; color: var(--muted); }
.mp-log-body { display: block; margin-top: 2px; font-size: 15px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.mp-log:hover .mp-log-body { text-decoration: underline; }
.mp-intro-link { display: inline-flex; align-items: center; gap: 2px; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--navy-text); text-decoration: none; }
.mp-intro-link:hover { text-decoration: underline; }

/* ── 自己紹介ページ ── */
.intro-sec { position: relative; padding: 0 0 26px 22px; margin-left: 4px; border-left: 2px solid var(--border-strong); }
.intro-sec:last-child { border-left-color: transparent; }
.intro-sec h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px -38px; font-size: 16px; font-weight: 800; }
.intro-ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; flex: none; box-shadow: 0 0 0 4px var(--bg, var(--surface)); }
.intro-sec p { margin: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; font-size: 15px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.intro-empty { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 22px; border: 1.5px dashed var(--border-strong); border-radius: 16px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.intro-empty span { font-size: 13px; color: var(--muted); line-height: 1.7; }
.intro-empty:hover { background: var(--surface-2); }
.intro-form { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; padding: 20px 22px; }
.intro-form label { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-size: 14px; font-weight: 800; }
.intro-form label:first-child { margin-top: 0; }
.intro-form .intro-ico { width: 26px; height: 26px; box-shadow: none; }
.intro-form textarea { min-height: 140px; line-height: 1.8; resize: vertical; }
/* 長文を書いていても保存ボタンが常に見えるよう、画面下に貼り付ける（スマホは下タブバーの上） */
.intro-form .row.end { position: sticky; bottom: calc(10px + var(--safe-b)); z-index: 10; margin: 20px -8px 0; padding: 8px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-lg); }
@media (max-width: 899px) { .intro-form .row.end { bottom: calc(70px + var(--safe-b)); } }
/* みんなのカード・自己紹介のボタンはリンクにしたので、下線と文字色を元に戻す */
a.people-card, a.mp-btn { color: var(--text); text-decoration: none; }

/* ── プロジェクトの資料（概要タブ） ── */
.res-card { margin-top: 28px; padding: 16px 18px 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; }
.res-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.res-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 800; }
.res-add { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border: 1px solid var(--border-strong); border-radius: 99px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.res-add:hover { background: var(--surface-2); }
.res-chips { display: flex; gap: 6px; margin-bottom: 6px; }
.res-chip { padding: 3px 11px; border: 0; border-radius: 99px; background: var(--surface-2); color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.res-chip[aria-pressed="true"] { background: var(--navy); color: #fff; }
.res-list { display: flex; flex-direction: column; }
.res-row { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); }
.res-row:first-child { border-top: 0; }
.res-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--text); text-decoration: none; }
.res-link:hover .res-title { text-decoration: underline; }
.res-ic { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.res-ic.link { background: #e6f1fb; color: #0c447c; }
.res-ic.pdf { background: #fcebeb; color: #791f1f; }
.res-ic.sheet { background: #eaf3de; color: #27500a; }
.res-ic.image { background: #eeedfe; color: #3c3489; }
.res-ic.file { background: var(--surface-3); color: var(--muted); }
.res-ic.pin { background: #faeeda; color: #633806; }
.res-text { min-width: 0; display: flex; flex-direction: column; }
.res-title { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.res-pinned { font-size: 11px; font-weight: 700; color: #854f0b; flex: none; }
.res-more { flex: none; }
.res-empty { margin: 4px 0 12px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.res-segs { display: flex; gap: 6px; margin-bottom: 4px; }
.res-seg { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.res-seg[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.res-field[hidden] { display: none; }
.res-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.res-drop { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: 12px; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.res-drop:hover { background: var(--surface-2); }
.res-drop.picked { border-style: solid; color: var(--text); }
.res-drop span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-color-scheme: dark) {
  .res-ic.link { background: #0c447c; color: #b5d4f4; }
  .res-ic.pdf { background: #791f1f; color: #f7c1c1; }
  .res-ic.sheet { background: #27500a; color: #c0dd97; }
  .res-ic.image { background: #3c3489; color: #cecbf6; }
  .res-ic.pin { background: #633806; color: #fac775; }
  .res-pinned { color: #fac775; }
}
/* 自己紹介ページ：参加しているプロジェクト */
.mp-projects { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mp-project { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 4px 12px 4px 4px; border: 1px solid var(--border-strong); border-radius: 99px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; text-decoration: none; }
.mp-project:hover { background: var(--surface-2); }
.mp-project .project-icon { border-radius: 50% !important; flex: none; }
.mp-project span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
