:root {
  --bg: #f6f7f9; --card: #fff; --line: #e2e5ea; --text: #1f2328; --muted: #6b7280;
  --accent: #2563eb; --accent-soft: #eaf1ff; --warn: #b45309; --warn-soft: #fff6e5;
  --ok: #15803d; --ok-soft: #e9f7ee; --danger: #b91c1c; --unread: #2563eb;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: "Yu Gothic UI", "Meiryo", "Hiragino Sans", sans-serif; font-size: 15px; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 12px; color: var(--text); }
button:hover { background: #f1f3f6; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:hover { filter: brightness(1.08); }
button.small { padding: 2px 8px; font-size: 13px; }
button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
button.danger { color: var(--danger); }
input[type=text], input[type=password], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: #fff; width: 100%; }
textarea { min-height: 120px; resize: vertical; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ヘッダー */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px; }
.brand { font-weight: 700; font-size: 17px; color: var(--text); white-space: nowrap; }
.search { flex: 1; max-width: 420px; margin-left: auto; }
.me { white-space: nowrap; font-size: 14px; }
.me button { margin-left: 6px; }
.menu-btn { display: none; border: none; font-size: 20px; padding: 2px 8px; }

/* 全体の配置 */
.layout { display: flex; max-width: 1200px; margin: 0 auto; }
.side { width: 240px; flex-shrink: 0; padding: 16px 8px 40px 16px; position: sticky; top: 53px;
  height: calc(100vh - 53px); overflow-y: auto; }
main { flex: 1; min-width: 0; padding: 16px 16px 60px; }
.side h4 { margin: 14px 8px 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.side a { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; border-radius: 6px; color: var(--text); }
.side a:hover { background: #eceff3; text-decoration: none; }
.side a.cur { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge { background: var(--unread); color: #fff; border-radius: 10px; font-size: 12px; padding: 0 7px; min-width: 20px; text-align: center; }

/* カード */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.card h2, .card h3 { margin: 0 0 10px; font-size: 16px; }
h1 { font-size: 20px; margin: 4px 0 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* 挨拶 */
.greet { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.greet-btn { padding: 16px; font-size: 18px; font-weight: 700; border-radius: 10px; border: 2px solid var(--line); background: #fff; }
.greet-btn .sub { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.greet-btn.done { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.greet-comment { margin-top: 10px; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; margin-top: 8px; }
.member { display: flex; justify-content: space-between; font-size: 14px; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.member .t { color: var(--muted); font-size: 13px; white-space: nowrap; }
.member .t b { color: var(--ok); font-weight: 600; }
.feed { list-style: none; padding: 0; margin: 8px 0 0; max-height: 260px; overflow-y: auto; }
.feed li { padding: 4px 0; border-bottom: 1px solid #f0f1f3; font-size: 14px; }
.tag { display: inline-block; font-size: 12px; border-radius: 4px; padding: 0 6px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.imp { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.tag.open { border-color: var(--warn); color: var(--warn); }
.tag.done { border-color: var(--ok); color: var(--ok); }

/* 投稿一覧 */
.plist { list-style: none; padding: 0; margin: 0; }
.plist li { border-bottom: 1px solid var(--line); }
.plist li:last-child { border-bottom: none; }
.plist a.item { display: block; padding: 10px 4px 10px 18px; color: var(--text); position: relative; }
.plist a.item:hover { background: #f8f9fb; text-decoration: none; }
.plist a.item.unread::before { content: ""; position: absolute; left: 4px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--unread); }
.plist a.item.unread .ttl { font-weight: 700; }
.plist .ttl { font-size: 15px; }
.plist .meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.plist .ex { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--muted); padding: 8px 4px; }

/* 投稿詳細 */
.post-head .crumb { font-size: 13px; color: var(--muted); }
.post-head h1 { margin: 2px 0 6px; }
.body { white-space: pre-wrap; word-break: break-word; margin: 12px 0; }
.files { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.files a.file { border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: 14px; }
.files img { max-width: 280px; max-height: 220px; border-radius: 6px; border: 1px solid var(--line); display: block; }
.reacts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.names { font-size: 13px; color: var(--muted); }
.reply { border-top: 1px solid var(--line); padding: 12px 0 4px; }
.reply .who { font-size: 14px; }
.reply .who b { margin-right: 8px; }
.reply .body { margin: 4px 0; }

/* フォーム */
.form label { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 14px; }
.form .check { font-weight: 400; display: flex; gap: 6px; align-items: center; }
.form .check input { width: auto; }
.picked { font-size: 13px; color: var(--muted); }

/* 表 */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr.off td { color: var(--muted); text-decoration: line-through; }
.table-wrap { overflow-x: auto; }

.login { max-width: 360px; margin: 60px auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1f2328; color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; }
.notice { background: var(--warn-soft); border: 1px solid #f3d19c; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }

@media (max-width: 800px) {
  .menu-btn { display: block; }
  .side { position: fixed; left: 0; top: 53px; z-index: 20; background: #fff; border-right: 1px solid var(--line);
    transform: translateX(-100%); transition: transform .2s; height: calc(100vh - 53px); }
  .side.open { transform: none; }
  .search { max-width: none; }
  .me .name, .me .pw-btn { display: none; }
  .top { gap: 8px; padding: 8px 10px; }
  .search { min-width: 0; }
  .greet { grid-template-columns: 1fr; }
  .brand { font-size: 15px; }
}
@media print { .top, .side { display: none; } }
