/* 東洋大学写真研究会 幹部議事録
   ポータルと同じ基調: 薄茶/クリーム + 方眼グリッド / 差し色: 紺 #26355e・茶 #a8642f
   フォント: Zen Kaku Gothic New、数字のみ EB Garamond */
:root {
  --bg: #f3ecdd;
  --bg-grid: rgba(38, 53, 94, 0.07);
  --surface: #fffdf8;
  --ink: #2b2620;
  --muted: #8a7d68;
  --navy: #26355e;
  --navy-dark: #1a2543;
  --brown: #a8642f;
  --amber: #b07d2b;
  --sage: #7d8b6a;
  --red: #c0392b;
  --line: rgba(38, 53, 94, 0.16);
  --shadow: 0 12px 32px rgba(101, 80, 46, 0.13), 0 2px 8px rgba(101, 80, 46, 0.07);
  --bar-h: 52px;
  --tab-h: 60px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', sans-serif;
  color: var(--ink);
  background:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px);
  overflow-x: hidden;
}
body.no-tabs { padding-bottom: 24px; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, select, textarea { font: inherit; min-width: 0; max-width: 100%; }
a { color: var(--navy); }
.num { font-family: 'EB Garamond', serif; }

/* ---------- ブランドバー（ポータルと同じ） ---------- */
#brandbar {
  position: sticky; top: 0; z-index: 90; height: var(--bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand-left { display: flex; align-items: center; gap: 9px; min-width: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.brand-left:active { opacity: 0.75; }
.brand-logo { height: 36px; width: auto; }
.brand-name { font-weight: 900; font-size: 0.98rem; letter-spacing: 0.04em; white-space: nowrap; }
.brand-sub {
  flex: none; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.12em;
  color: #fff; background: var(--navy); border-radius: 999px; padding: 4px 10px;
}

/* ---------- 共通 ---------- */
#view { max-width: 680px; margin: 0 auto; }
.section { padding: 26px 18px 6px; }
h2.sec-title {
  font-weight: 900; font-size: 26px; letter-spacing: 0.02em; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
  border-top: 2px solid var(--ink); padding-top: 14px;
}
h2.sec-title::after { content: '.'; color: var(--navy); }
.head-action {
  order: 1; margin-left: auto; border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 6px 14px; font-size: 0.85rem; font-weight: 700; background: var(--surface); color: var(--ink);
  flex: none;
}
.sub-title { font-weight: 900; font-size: 1.125rem; margin-bottom: 12px; }
.card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  border: 1.5px solid var(--navy); color: var(--navy); background: transparent; text-decoration: none;
}
.btn.primary { background: var(--navy); color: #fff; }
.btn.warm { background: var(--brown); border-color: var(--brown); color: #fff; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: 0.85rem; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; }
.text-btn { color: var(--navy); font-weight: 700; font-size: 0.85rem; padding: 6px 8px; }
.muted { color: var(--muted); font-size: 0.85rem; }
.chip {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  background: rgba(38,53,94,0.1); color: var(--navy); white-space: nowrap;
}
.chip.urgent { background: var(--red); color: #fff; }
.chip.soon { background: var(--amber); color: #fff; }
.chip.warm { background: rgba(168,100,47,0.14); color: var(--brown); }
.chip.outline { border: 1.5px solid var(--line); color: var(--muted); background: transparent; }
.chip.prio-high { background: var(--red); color: #fff; }
.chip.prio-normal { background: rgba(38,53,94,0.1); color: var(--navy); }
.chip.prio-low { background: transparent; border: 1.5px solid var(--line); color: var(--muted); }
.chip.status-todo { background: #ddd5c2; color: #6b5f45; }
.chip.status-doing { background: rgba(176,125,43,0.2); color: #7c5a16; }
.chip.status-done { background: rgba(125,139,106,0.28); color: #41512f; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 6px; }
.field input[type="text"], .field input[type="date"], .field input[type="time"], .field input[type="password"],
.field input[type="search"], .field select, .field textarea {
  width: 100%; min-width: 0; max-width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.form-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.form-2col > div { min-width: 0; }
.field textarea { min-height: 84px; resize: vertical; }
.field textarea.tall { min-height: 150px; }
.note { font-size: 0.8rem; color: var(--muted); margin-top: 5px; line-height: 1.6; }
.form-error { color: var(--red); font-size: 0.85rem; font-weight: 600; margin-top: 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 18px); z-index: 180;
  background: var(--navy-dark); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 0.88rem; font-weight: 700; box-shadow: var(--shadow); }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 0.9rem; line-height: 1.8; }
.footer-note { text-align: center; color: var(--muted); font-size: 0.75rem; padding: 30px 18px 8px; line-height: 1.9; }
.back-link { display: inline-block; font-weight: 700; color: var(--navy); font-size: 0.9rem; padding: 4px 0 12px; }
.pre { white-space: pre-wrap; line-height: 1.8; font-size: 0.93rem; }

/* ---------- ログイン ---------- */
.login-wrap { max-width: 420px; margin: 0 auto; padding: 44px 18px 10px; text-align: center; }
.login-logo { width: 92px; margin: 0 auto 14px; }
.login-title { font-weight: 900; font-size: 1.3rem; letter-spacing: 0.06em; color: var(--navy); }
.login-sub { font-size: 0.85rem; color: var(--muted); margin: 8px 0 22px; line-height: 1.8; }
.login-card { text-align: left; }

/* ---------- ダッシュボード ---------- */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.overview-cell { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; text-align: center; }
.overview-cell .num { font-size: 2.6rem; font-weight: 700; color: var(--navy); line-height: 1; }
.overview-cell.alert .num { color: var(--red); }
.overview-cell p { font-size: 0.8rem; font-weight: 700; margin-top: 6px; }
.bar-wrap { height: 10px; background: rgba(38,53,94,0.1); border-radius: 5px; overflow: hidden; margin: 6px 0 4px; }
.bar-fill { height: 100%; background: var(--navy); border-radius: 5px; }

/* ---------- リスト行 ---------- */
.row-item { display: block; width: 100%; text-align: left; padding: 14px 2px; border-bottom: 1px solid var(--line); cursor: pointer; background: none; }
.row-item:last-child { border-bottom: none; }
.row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-title { font-weight: 900; font-size: 1.02rem; line-height: 1.45; }
.row-meta { font-size: 0.8rem; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; }
.row-item.done .row-title { color: var(--muted); text-decoration: line-through; }
.row-item.overdue { border-left: 4px solid var(--red); padding-left: 10px; }

/* ---------- 詳細 ---------- */
.spec-list { margin-top: 6px; display: grid; gap: 12px; }
.spec-list > div { display: flex; gap: 14px; font-size: 0.92rem; }
.spec-list dt { width: 64px; flex: none; font-weight: 700; color: var(--muted); }
.spec-list dd { font-weight: 600; flex: 1; min-width: 0; }
.detail-block { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.detail-block h3 { font-size: 0.85rem; font-weight: 900; letter-spacing: 0.08em; color: var(--navy); margin-bottom: 8px; }

/* ---------- タスクボード ---------- */
.view-toggle { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.view-toggle button { padding: 7px 16px; font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.view-toggle button.active { background: var(--navy); color: #fff; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-row select {
  flex: 1; min-width: 120px; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-weight: 600; font-size: 0.88rem;
}
.board { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; margin: 0 -2px; scrollbar-width: none; }
.board::-webkit-scrollbar { display: none; }
.board-col { flex: 0 0 78vw; max-width: 320px; scroll-snap-align: start; background: rgba(255,253,248,0.6); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; }
.board-col h3 { font-size: 0.88rem; font-weight: 900; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.board-col h3 .cnt { color: var(--muted); font-size: 0.8rem; }
.board-card { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); padding: 12px; margin-bottom: 10px; cursor: pointer; width: 100%; text-align: left; display: block; }
.board-card .bc-title { font-weight: 700; font-size: 0.92rem; line-height: 1.5; }
.board-card.overdue { border-left: 4px solid var(--red); }
.status-btns { display: flex; gap: 6px; margin-top: 10px; }
.status-btns button {
  flex: 1; padding: 7px 2px; font-size: 0.75rem; font-weight: 700; border-radius: 8px;
  border: 1.5px solid var(--line); background: #fff; color: var(--muted);
}
.status-btns button.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- コメント ---------- */
.comment-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment-item:last-child { border-bottom: none; }
.comment-item .c-body { font-size: 0.92rem; line-height: 1.7; white-space: pre-wrap; }
.comment-item .c-meta { font-size: 0.75rem; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; align-items: center; }

/* ---------- メモ ---------- */
.memo-card { position: relative; }
.memo-card.pinned { border: 2px solid var(--brown); }
.memo-card .m-body { font-size: 0.9rem; line-height: 1.75; white-space: pre-wrap; margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.pin-mark { color: var(--brown); font-weight: 900; font-size: 0.75rem; letter-spacing: 0.08em; }

/* ---------- 設定 ---------- */
.menu-card { padding: 6px 18px; }
.menu-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 15px 0; text-align: left; background: none; border: none; cursor: pointer;
}
.menu-row + .menu-row { border-top: 1px solid var(--line); }
.menu-title { display: block; font-weight: 700; font-size: 1rem; }
.menu-desc { display: block; margin-top: 2px; font-size: 0.85rem; color: var(--muted); }
.menu-arrow { color: var(--muted); font-size: 1.1rem; flex: none; }
.file-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--navy); color: #fff; border-radius: 10px; padding: 11px 20px; font-weight: 700; font-size: 0.9rem; cursor: pointer; }
.file-name { margin-top: 8px; font-size: 0.85rem; color: var(--muted); }

/* ---------- 下部ナビ ---------- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
  display: flex; max-width: 680px; margin: 0 auto;
}
#tabbar[hidden] { display: none; }
.tab { flex: 1; position: relative; font-size: 0.78rem; font-weight: 700; color: var(--muted); white-space: nowrap; padding: 0 2px; }
.tab.active { color: var(--navy); }
.tab.active::before { content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 3px; background: var(--navy); border-radius: 0 0 3px 3px; }

/* ---------- PC対応（≥900px） ---------- */
@media (min-width: 900px) {
  #view { max-width: 1080px; }
  #tabbar { max-width: 1080px; }
  .section { padding: 34px 28px 10px; }
  #brandbar { padding: 0 max(14px, calc((100vw - 1024px) / 2)); }
  .overview-grid { grid-template-columns: repeat(4, 1fr); }
  .board { overflow-x: visible; }
  .board-col { flex: 1; max-width: none; }
  .card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .card-grid .card { margin-bottom: 0; }
}
