/* 麻の輪 — 森の深緑を地に、麻の生成り色と若葉色を差し色にした配色 */
:root {
  --bg: #F3F4EF; --panel: #FFFFFF; --side: #24382A; --side-ink: #E3EADF; --side-muted: #9FB29C; --side-hover: #2F4734; --side-active: #3B5640;
  --ink: #1E2A22; --muted: #5E6B62; --line: #DDE2D8; --hover: #EEF1EA;
  --accent: #A9572F; --leaf: #5F7F33; --straw: #C9A95A; --danger: #B3261E; --ok: #3E7A3A;
  --bubble-mine: #EEF3E6;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Noto Sans JP", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141A16; --panel: #1B231D; --side: #10170F; --side-ink: #DCE5D8; --side-muted: #8EA08B; --side-hover: #1C281D; --side-active: #263627;
    --ink: #E4EAE1; --muted: #9DA99F; --line: #2C362E; --hover: #222C24;
    --accent: #E08E66; --leaf: #A6C27A; --straw: #D9BE7A; --danger: #F2928A; --ok: #8CC487;
    --bubble-mine: #212B20;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.7 var(--font); -webkit-text-size-adjust: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- ボタン ---------- */
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 16px; font-weight: 600; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--side); color: #fff; border-color: var(--side); }
.btn.primary:hover { background: var(--side-active); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: transparent; width: 38px; height: 38px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.link-btn { border: 0; background: none; color: var(--side-muted); font-size: 13px; padding: 2px 4px; }
.link-btn:hover { color: var(--side-ink); text-decoration: underline; }

/* ---------- ログイン ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left)); background: var(--side); }
.auth-card { width: min(420px, 100%); background: var(--panel); border-radius: 16px; padding: 28px; display: grid; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; letter-spacing: .04em; }
.auth-lead { margin: 0; color: var(--muted); font-size: 14px; }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--hover); border-radius: 10px; padding: 4px; }
.tabs button { border: 0; background: transparent; border-radius: 8px; padding: 8px; font-weight: 600; color: var(--muted); font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--ink); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
.form .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.form input, .form select, .form textarea { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg); font-weight: 400; width: 100%; }
.form-error { margin: 0; color: var(--danger); font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }

/* ---------- 全体の枠 ---------- */
.app { display: grid; grid-template-columns: 264px 1fr; height: 100%; height: 100dvh; }
.sidebar { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; min-height: 0; padding-top: env(safe-area-inset-top); }
.side-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 700; font-size: 17px; letter-spacing: .04em; }
.side-title { flex: 1; }
.side-head .icon-btn { color: var(--side-muted); }
.channels { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.group-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--side-muted); margin: 14px 8px 4px; }
.channels ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ch { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--side-muted); padding: 7px 10px; border-radius: 6px; text-align: left; font-size: 15px; }
.ch:hover { background: var(--side-hover); color: var(--side-ink); }
.ch[aria-current="true"] { background: var(--side-active); color: #fff; font-weight: 600; }
.ch svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.ch .ch-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch.unread { color: #fff; font-weight: 700; }
.ch .badge { background: var(--straw); color: #2A220E; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.side-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me-name { display: grid; line-height: 1.3; min-width: 0; }
.me-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-name small { color: var(--side-muted); }
.foot-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 15px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: var(--panel); }
.chan-head { display: flex; align-items: center; gap: 10px; padding: 10px max(16px, env(safe-area-inset-right)) 10px 16px; border-bottom: 1px solid var(--line); padding-top: calc(10px + env(safe-area-inset-top)); }
.chan-icon svg { width: 20px; height: 20px; color: var(--muted); display: block; }
.chan-titles { flex: 1; min-width: 0; }
.chan-titles h1 { font-size: 17px; margin: 0; line-height: 1.4; }
.chan-titles p { margin: 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.conn.off { background: var(--danger); }

/* ---------- 会話 ---------- */
.messages { flex: 1; overflow-y: auto; padding: 12px 0 8px; overscroll-behavior: contain; }
.older { text-align: center; padding: 8px; }
.message-list { list-style: none; margin: 0; padding: 0; }
.day { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 600; margin: 18px 16px 6px; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; padding: 3px max(16px, env(safe-area-inset-right)) 3px 16px; position: relative; }
.msg:hover { background: var(--hover); }
.msg.first { margin-top: 10px; }
.msg .avatar { grid-row: span 2; margin-top: 2px; }
.msg .gutter { font-size: 11px; color: transparent; text-align: right; padding-top: 3px; font-variant-numeric: tabular-nums; }
.msg:hover .gutter { color: var(--muted); }
.msg-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.msg-head b { font-size: 15px; }
.msg-head time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.msg-body a { color: var(--accent); }
.edited { font-size: 11px; color: var(--muted); margin-left: 4px; }
.msg.pending-send { opacity: .55; }
.actions { position: absolute; right: 16px; top: -12px; display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; }
.msg:hover .actions, .msg:focus-within .actions { display: flex; }
.actions button { border: 0; background: transparent; font-size: 12px; padding: 3px 8px; border-radius: 6px; color: var(--muted); }
.actions button:hover { background: var(--hover); color: var(--ink); }
.actions .del:hover { color: var(--danger); }
.edit-box { display: grid; gap: 6px; }
.edit-box textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--bg); resize: vertical; min-height: 60px; }
.edit-box div { display: flex; gap: 6px; }

.media { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.media img, .media video { display: block; border-radius: 10px; background: var(--hover); max-width: 100%; height: auto; }
.media video { background: #000; }
.media button.thumb { border: 0; padding: 0; background: none; border-radius: 10px; max-width: 100%; }
.media.many img { width: 180px; height: 180px; object-fit: cover; }


.empty { text-align: center; color: var(--muted); padding: 48px 24px; }
.empty-title { font-weight: 700; color: var(--ink); font-size: 16px; margin: 0 0 4px; }
.empty p { margin: 0; }

/* ---------- 入力欄 ---------- */
.composer { padding: 8px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.compose-row { display: flex; align-items: flex-end; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.compose-row:focus-within { border-color: var(--leaf); }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; padding: 8px 4px; max-height: 40vh; min-width: 0; outline: none; line-height: 1.6; }
.send { color: var(--leaf); }
.send:disabled { opacity: .4; }
.compose-hint { margin: 0; font-size: 12px; color: var(--muted); }
.pending { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--hover); border: 1px solid var(--line); }
.chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chip .kind { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; padding: 0 5px; border-radius: 4px; }
.chip .bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--leaf); width: 0; }
.chip .state { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; color: var(--muted); text-align: center; padding: 4px; }
.chip.error { border-color: var(--danger); }
.chip.error .state { color: var(--danger); background: var(--panel); }
.chip .rm { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; line-height: 22px; padding: 0; }
.drop { position: absolute; inset: 8px; border: 2px dashed var(--leaf); border-radius: 16px; background: color-mix(in srgb, var(--panel) 88%, transparent); display: grid; place-items: center; font-weight: 700; color: var(--leaf); pointer-events: none; }

/* ---------- 拡大表示・小窓 ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--panel); }
dialog::backdrop { background: rgba(10, 16, 12, .72); }
.lightbox { background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; }
.lightbox img { max-width: 96vw; max-height: 92vh; display: block; border-radius: 8px; }
.lb-close { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right)); background: rgba(0,0,0,.55); color: #fff; }
.modal { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); border-radius: 14px; display: none; flex-direction: column; }
.modal[open] { display: flex; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px; overflow-y: auto; display: grid; gap: 18px; }
.modal-body h3 { margin: 0 0 6px; font-size: 15px; }
.modal-body section { display: grid; gap: 10px; }
.modal-body .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.modal-body .row > label { flex: 1 1 160px; }
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; min-width: 0; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list small { color: var(--muted); }
.code-box { font: 600 20px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .08em; background: var(--hover); border-radius: 10px; padding: 12px; text-align: center; user-select: all; }
.pill { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); white-space: nowrap; }
.pill.admin { background: #F6E8CB; color: #6B4307; }
.pill.off { background: #F8E1D6; color: #7A2F14; }
.note { font-size: 13px; color: var(--muted); margin: 0; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100vw - 32px); z-index: 50; }

/* ---------- スマホ ---------- */
.only-mobile { display: none; }
.scrim { display: none; }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .only-mobile { display: inline-grid; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 30; transform: translateX(-100%); transition: transform .2s ease; }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; }
  .compose-hint { display: none; }
  .actions { display: flex; position: static; grid-column: 2; justify-self: start; border: 0; padding: 0; background: none; margin-top: 2px; }
  .msg .gutter { display: none; }
  .media.many img { width: 132px; height: 132px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ===================== 第2版：メニュー・プロジェクト・予定・募集・通話 ===================== */
a.ch { text-decoration: none; }
.side-search { padding: 0 12px 6px; }
.side-search input { width: 100%; border: 0; border-radius: 8px; padding: 8px 12px; background: rgba(255,255,255,.1); color: var(--side-ink); font-size: 14px; }
.side-search input::placeholder { color: var(--side-muted); }
.side-search input:focus { background: rgba(255,255,255,.16); outline: 2px solid var(--straw); outline-offset: 0; }
.nav { margin-bottom: 6px !important; }
.navlink .ico svg { width: 18px; height: 18px; }
.navlink .ico { display: inline-grid; }
.ch .badge { margin-left: auto; }
.ch.mentioned .badge { background: #E08E66; color: #2A1307; }
.in-voice { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--straw); }
.in-voice svg { width: 13px !important; height: 13px !important; }

/* 会話：呼びかけとリアクション */
.mention { color: var(--accent); font-weight: 600; }
.mention.self { background: color-mix(in srgb, var(--straw) 35%, transparent); color: inherit; border-radius: 4px; padding: 0 3px; }
.msg.to-me { background: color-mix(in srgb, var(--straw) 12%, transparent); }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 0 9px; font-size: 13px; line-height: 24px; }
.react.mine { border-color: var(--leaf); background: color-mix(in srgb, var(--leaf) 14%, var(--panel)); }
.actions button svg { width: 16px; height: 16px; display: block; }
.react-pop { position: absolute; right: 16px; top: 18px; z-index: 5; display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.react-pop button { border: 0; background: none; font-size: 20px; width: 36px; height: 36px; border-radius: 8px; }
.react-pop button:hover { background: var(--hover); }

/* 通話 */
.voice-btn { display: inline-flex; align-items: center; gap: 6px; }
.voice-btn svg { width: 16px; height: 16px; }
.voice-btn.active { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.voice-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 16px; background: color-mix(in srgb, var(--leaf) 14%, var(--panel)); border-bottom: 1px solid var(--line); }
.voice-live { width: 10px; height: 10px; border-radius: 50%; background: var(--leaf); }
@media (prefers-reduced-motion: no-preference) { .voice-live { animation: live 1.4s ease-in-out infinite; } }
@keyframes live { 50% { opacity: .35; } }
.voice-title { font-weight: 700; font-size: 14px; }
.voice-people { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
.vp { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.vp .avatar { width: 26px; height: 26px; font-size: 12px; box-shadow: 0 0 0 2px var(--leaf); }
.vp.muted .avatar { box-shadow: 0 0 0 2px var(--danger); opacity: .7; }
.vp.connecting { opacity: .55; }

/* 画面（プロジェクトなど） */
.view-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.view-actions .btn, .row-between .btn, .iconbtn { display: inline-flex; align-items: center; gap: 6px; }
.btn svg { width: 16px; height: 16px; }
a.btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
a.btn.primary { color: #fff; }
.view-body { flex: 1; overflow-y: auto; padding: 16px max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) 16px; display: grid; gap: 16px; align-content: start; }
.stack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-between .note { flex: 1; min-width: 200px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-link { text-decoration: none; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; font-size: 14px; font-weight: 600; background: var(--panel); }
.chip-link[aria-selected="true"] { background: var(--side); color: #fff; border-color: var(--side); }
.tabs-line { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.card { display: grid; gap: 8px; align-content: start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: inherit; text-decoration: none; text-align: left; min-width: 0; }
a.card:hover, button.card:hover { border-color: var(--leaf); }
.card.wide { max-width: 640px; }
.card h3 { margin: 0; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.card h3 a { color: inherit; }
.card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.card-top .grow { flex: 1; min-width: 0; }
.card-sum { margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.need-count { color: var(--accent); font-weight: 600; }
.pill.st-planning { background: #E6EBF2; color: #2E4766; }
.pill.st-active { background: #DCEFD9; color: #24521F; }
.pill.st-paused { background: #EFE7D6; color: #6B4F12; }
.pill.st-done { background: #E5E5E2; color: #4A4A45; }
.pill.lock { background: #F1E1E8; color: #6E2846; }
.pill.recruit { background: #FBE3D6; color: #7A2F14; }
.pill.role { background: #DDEBE8; color: #1E4C45; }
.pill.skill { background: var(--hover); color: var(--ink); font-weight: 600; }
.pill.warn { background: #FBE0DD; color: #8A1F17; margin-left: 4px; }
.pill.today { background: var(--straw); color: #2A220E; margin-left: 8px; }
.pill.k-event { background: #E6EBF2; color: #2E4766; }
.pill.k-task { background: #DCEFD9; color: #24521F; }
.pill.k-deadline { background: #FBE3D6; color: #7A2F14; }
.lead { font-size: 16px; margin: 0; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.prose a, .notes-doc a { color: var(--accent); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts a { color: var(--accent); }
.callout { background: color-mix(in srgb, var(--straw) 18%, var(--panel)); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; }
.callout.small { padding: 8px 12px; font-size: 14px; }
.quote { color: var(--muted); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.ok-note { color: var(--ok); font-weight: 600; margin: 0; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 600; grid-template-columns: none !important; }
.check input { width: auto !important; }
.check.small { font-size: 12px; font-weight: 400; color: var(--muted); gap: 4px; white-space: nowrap; }
.filter { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel); width: 100%; max-width: 420px; }
.empty { padding: 32px 16px; }

/* 予定 */
.sched-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.sched-row { display: grid; grid-template-columns: 128px 1fr auto; gap: 12px; align-items: start; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sched-row:last-child { border-bottom: 0; }
.sched-row.past { opacity: .55; }
.sched-row.overdue { background: color-mix(in srgb, var(--danger) 6%, transparent); }
.sched-when { display: grid; font-size: 13px; font-variant-numeric: tabular-nums; line-height: 1.5; }
.sched-main { min-width: 0; overflow-wrap: anywhere; }
.sched-main small { color: var(--muted); display: block; }
.sched-main small a { color: var(--accent); }
.sched-side { display: flex; gap: 6px; align-items: center; }
.sched-side select { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; background: var(--bg); font-size: 13px; }
.day-block { display: grid; gap: 8px; }
.day-block h3 { margin: 0; font-size: 15px; display: flex; align-items: center; }
.day-block.warn h3 { color: var(--danger); }

/* 必要な人・物・お金 */
.cat { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.cat svg { width: 14px; height: 14px; }
.cat-person { background: #E6EBF2; color: #2E4766; }
.cat-thing { background: #E9F0DC; color: #36561A; }
.cat-money { background: #F6E8CB; color: #6B4307; }
.need-card .card-top { justify-content: space-between; }
.need-card .card-top select { border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; background: var(--bg); font-size: 12px; }
.amount { margin: 0; font-weight: 700; font-size: 15px; }
.offers { list-style: none; margin: 0; padding: 8px 10px; background: var(--hover); border-radius: 8px; font-size: 13px; display: grid; gap: 4px; }
.pill.ns-open { background: #FBE3D6; color: #7A2F14; }
.pill.ns-partial { background: #F6E8CB; color: #6B4307; }
.pill.ns-filled { background: #DCEFD9; color: #24521F; }

/* メンバー */
.member-card { cursor: pointer; font: inherit; }
.skill-list { display: flex; flex-wrap: wrap; gap: 4px; }

/* ノート */
.notes-doc { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; line-height: 1.9; max-width: 72ch; }
.notes-edit { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--panel); line-height: 1.8; resize: vertical; font: inherit; }

.search-sec h3 { margin: 0 0 6px; font-size: 15px; }
.list a { color: inherit; text-decoration: none; }
.list a.grow:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .sched-row { grid-template-columns: 1fr; gap: 4px; }
  .sched-when { display: flex; gap: 8px; }
  .chan-head { flex-wrap: wrap; }
  .voice-btn .lbl { display: none; }
  .view-actions { width: 100%; justify-content: flex-start; }
  .card-grid { grid-template-columns: 1fr; }
}
@media (prefers-color-scheme: dark) {
  .pill.st-planning, .pill.k-event, .cat-person { background: #22324A; color: #BFD3EE; }
  .pill.st-active, .pill.k-task, .cat-thing, .pill.ns-filled { background: #23381F; color: #C2E2B4; }
  .pill.st-paused, .cat-money, .pill.ns-partial { background: #3A2F17; color: #EBD39A; }
  .pill.st-done { background: #2E2E2B; color: #CFCFC8; }
  .pill.lock { background: #3D2230; color: #F0C2D5; }
  .pill.recruit, .pill.k-deadline, .pill.ns-open { background: #43261A; color: #F4C3AA; }
  .pill.role { background: #1E3532; color: #B4DCD4; }
  .pill.warn { background: #4A1E1A; color: #F5B7AF; }
}
.card .note a { color: var(--accent); }
@media (min-width: 761px) { .sched-row { grid-template-columns: 110px 1fr auto; } }

/* 第3版：日時の表示と「加工中のもの」 */
.stamp { margin: 0; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.due { margin: 0; font-size: 13px; font-weight: 600; }
.due.late { color: var(--danger); }
.item-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: -4px -6px 2px; }
.item-photos .thumb { border: 0; padding: 0; background: var(--hover); border-radius: 8px; overflow: hidden; aspect-ratio: 1; }
.item-photos .thumb.main { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.item-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-kind { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.item-card.st-done, .item-card.st-closed { opacity: .65; }
.item-card .card-top select { border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; background: var(--bg); font-size: 12px; }
.my-req { margin: 0; font-size: 13px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pill.mode-sale { background: #FBE3D6; color: #7A2F14; }
.pill.mode-transfer { background: #DCEFD9; color: #24521F; }
.pill.mode-consign { background: #E6EBF2; color: #2E4766; }
.pill.mode-provide { background: #F6E8CB; color: #6B4307; }
.pill.stage { background: var(--hover); color: var(--ink); }
.pill.ls-open { background: #DCEFD9; color: #24521F; }
.pill.ls-talking { background: #F6E8CB; color: #6B4307; }
.pill.rq-pending { background: #F6E8CB; color: #6B4307; }
.pill.rq-agreed { background: #DCEFD9; color: #24521F; }
.pill.rq-declined, .pill.rq-withdrawn { background: #E5E5E2; color: #4A4A45; }
fieldset.modes { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0; display: grid; gap: 6px; }
fieldset.modes legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
.mode-check small { color: var(--muted); font-weight: 400; }
.check.legal { background: var(--warn-bg, #F6EBDD); border-radius: 8px; padding: 10px; font-size: 13px; color: var(--ink); }
.req-row { align-items: flex-start !important; }
.req-row .row { flex-wrap: nowrap; }
@media (prefers-color-scheme: dark) {
  .pill.mode-sale { background: #43261A; color: #F4C3AA; }
  .pill.mode-transfer, .pill.ls-open, .pill.rq-agreed { background: #23381F; color: #C2E2B4; }
  .pill.mode-consign { background: #22324A; color: #BFD3EE; }
  .pill.mode-provide, .pill.ls-talking, .pill.rq-pending { background: #3A2F17; color: #EBD39A; }
  .pill.rq-declined, .pill.rq-withdrawn { background: #2E2E2B; color: #CFCFC8; }
  .check.legal { background: #2E2720; }
}

/* ---------- 第4版：プロフィール・困りごと・麻ニュース・言語 ---------- */
.avatar.photo { background: var(--hover); overflow: hidden; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.big { width: 56px; height: 56px; font-size: 22px; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .avatar.big, .profile-photo .avatar.big { width: 72px; height: 72px; font-size: 28px; }
.photo-row { align-items: center; }
.member-no { font-variant-numeric: tabular-nums; color: var(--muted); }
.pill.rank-admin { background: #F6E8CB; color: #6B4307; }
.pill.rank-leader { background: #DDEBE8; color: #1E4C45; }
.pill.rank-general { background: var(--hover); color: var(--muted); }
.trouble-list, .reply-list, .news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.trouble-card { display: flex; gap: 14px; align-items: flex-start; }
.trouble-card h3 { margin: 0; font-size: 16px; }
.trouble-card.ts-solved { opacity: .78; }
.trouble-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; flex: none; }
.reply-count { color: var(--accent); }
.pill.ts-open { background: #FBE3D6; color: #7A2F14; }
.pill.ts-solved { background: #DCEFD9; color: #24521F; }
.pill.tc-cultivation { background: #DCEFD9; color: #24521F; }
.pill.tc-processing { background: #F6E8CB; color: #6B4307; }
.pill.tc-tools { background: #E6EBF2; color: #2E4766; }
.pill.tc-sales { background: #F1E1E8; color: #6E2846; }
.pill.tc-legal { background: #EDE3F5; color: #4A2A6B; }
.reply-list li { display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.reply-form textarea { width: 100%; }
.news-list { gap: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.news-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; }
.news-title { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
a.news-title:hover { color: var(--accent); }
.pill.news-post { background: #FBE3D6; color: #7A2F14; }
.pill.news-feed { background: var(--hover); color: var(--muted); }
.url { color: var(--muted); overflow-wrap: anywhere; }
.auth-lang { text-align: right; margin: -6px 0 8px; }
.auth-lang .link-btn { color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .pill.rank-admin, .pill.tc-processing { background: #3D3214; color: #EED9A2; }
  .pill.rank-leader { background: #1C3632; color: #A8D5CD; }
  .pill.ts-open { background: #46261A; color: #F2C1A7; }
  .pill.ts-solved, .pill.tc-cultivation { background: #1F3A1D; color: #B5DBAE; }
  .pill.tc-tools { background: #22324A; color: #BFD3EE; }
  .pill.tc-sales { background: #3D2130; color: #E8B9CE; }
  .pill.tc-legal { background: #31233F; color: #D3BDEB; }
  .pill.news-post { background: #46261A; color: #F2C1A7; }
}
@media (max-width: 600px) {
  .trouble-thumb { width: 64px; height: 64px; }
  .news-item { flex-direction: column; }
}
.clamp { margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-item > .grow, .reply-list li > .grow, .trouble-card > .grow { flex: 1; min-width: 0; }
.facts dd .pill { margin-left: 6px; }
.trouble-detail .item-photos .thumb img { max-height: 380px; }
.trouble-detail .item-photos { max-width: 560px; }

/* パスワードの表示切り替えと確認 */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: 8px; }
.pw-eye:hover { background: var(--hover); color: var(--ink); }
.pw-eye svg { width: 20px; height: 20px; }
.pw-match { margin: -6px 0 0; font-size: 13px; min-height: 1em; }
.pw-match.ok { color: var(--ok); }
.pw-match.ng { color: var(--danger); font-weight: 600; }
.reg-note { margin: -6px 0 0; font-size: 12px; color: var(--muted); }
