/* グループウェア - 共通スタイル（ビルド不要の素のCSS） */
:root {
  --bg: #f5f6f8; --panel: #fff; --text: #1f2328; --muted: #6a737d; --line: #dfe2e6;
  --primary: #1a6fd1; --primary-ink: #fff; --ok: #1d7a3e; --ng: #c62828; --warn: #a15c00;
  --ok-bg: #e6f4ea; --ng-bg: #fdecea; --warn-bg: #fff4e0; --info-bg: #e8f1fc; --hover: #f0f4fa;
  --note-yellow: #fff6bf; --note-green: #dcf5e1; --note-blue: #dceafd; --note-pink: #fde1ea; --note-purple: #ece2fb;
  --radius: 8px;
  color-scheme: light;
}
/* ダークモード：「自動」はパソコン・スマホの設定に合わせる。個人設定で「ダーク」「ライト」に固定もできる */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a; --panel: #1e2125; --text: #e6e8eb; --muted: #9aa3ad; --line: #33383e;
    --primary: #4c95ea; --primary-ink: #fff; --ok: #5cc27e; --ng: #ff7b72; --warn: #e3a948;
    --ok-bg: #1b3325; --ng-bg: #3a1f1f; --warn-bg: #3a2d14; --info-bg: #1b2a3d; --hover: #262a30;
    --note-yellow: #3d3818; --note-green: #1c3524; --note-blue: #1b2b42; --note-pink: #3f2029; --note-purple: #2f2442;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15171a; --panel: #1e2125; --text: #e6e8eb; --muted: #9aa3ad; --line: #33383e;
  --primary: #4c95ea; --primary-ink: #fff; --ok: #5cc27e; --ng: #ff7b72; --warn: #e3a948;
  --ok-bg: #1b3325; --ng-bg: #3a1f1f; --warn-bg: #3a2d14; --info-bg: #1b2a3d; --hover: #262a30;
  --note-yellow: #3d3818; --note-green: #1c3524; --note-blue: #1b2b42; --note-pink: #3f2029; --note-purple: #2f2442;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.4rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.8rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; word-break: break-all; }
.req { font-size: .7rem; color: var(--ng); border: 1px solid var(--ng); border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.warn-text { color: var(--warn); }

/* ヘッダー */
.topbar { display: flex; align-items: center; gap: 1rem; background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 0 16px; position: sticky; top: 0; z-index: 10; min-height: 52px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); white-space: nowrap; display: flex; flex-direction: column; line-height: 1.25; }
.brand:hover { text-decoration: none; }
.brand-ver { font-size: .72rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.theme-btn { background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: .8rem; cursor: pointer; }
.theme-btn:hover { color: var(--text); background: var(--hover); }
.login-ver { text-align: center; margin: -.6rem 0 1rem; color: var(--muted); font-size: .85rem; }
/* メニューは2段のボタン（横に伸びすぎないように） */
.mainnav { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; padding: 6px 0; }
.navrow { display: flex; flex-wrap: wrap; gap: 4px; }
.mainnav a { padding: 4px 11px; color: var(--muted); white-space: nowrap; border: 1px solid var(--line); border-radius: 6px; font-size: .9rem; line-height: 1.5; background: var(--panel); }
.mainnav a.active { color: var(--primary-ink); background: var(--primary); border-color: var(--primary); font-weight: 600; }
.mainnav a.active .badge { background: var(--primary-ink); color: var(--primary); }
.mainnav a:hover { text-decoration: none; color: var(--text); background: var(--hover); }
.mainnav a.active:hover { color: var(--primary-ink); background: var(--primary); }
.menu-toggle { display: none; }
.usermenu { display: flex; gap: .8rem; align-items: center; font-size: .9rem; white-space: nowrap; }
.usermenu form { margin: 0; }
.linklike { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; }
.linklike.danger { color: var(--ng); }

.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.pagehead h1 { margin: 0; }
.btns { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ボタン */
.btn { display: inline-block; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 8px 14px; border-radius: var(--radius); cursor: pointer; font: inherit; line-height: 1.3; text-align: center; }
.btn:hover { text-decoration: none; background: var(--hover); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--ng); border-color: var(--ng); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.btn.wide { width: 100%; padding: 12px; }
.btn:disabled { opacity: .6; cursor: wait; }

/* メッセージ */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 1rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.ng { background: var(--ng-bg); color: var(--ng); }
.flash.info { background: var(--info-bg); }
.tag { display: inline-block; font-size: .72rem; padding: 1px 6px; border-radius: 4px; margin-left: 4px; vertical-align: middle; white-space: nowrap; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.ng { background: var(--ng-bg); color: var(--ng); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.gray { background: var(--hover); color: var(--muted); }
.status { font-size: .85rem; padding: 2px 10px; border-radius: 999px; background: var(--hover); }
.status.s-completed { background: var(--ok-bg); color: var(--ok); }
.status.s-failed { background: var(--ng-bg); color: var(--ng); }
.status.s-running, .status.s-queued { background: var(--info-bg); }

/* フォーム */
.form { display: grid; gap: 14px; }
.form.narrow { max-width: 560px; }
.form.grid2, .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span2 { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); }
input[type=text], input[type=search], input[type=password], input[type=email], input[type=number], input[type=date],
input[type=datetime-local], input[type=time], input[type=tel], input[type=url], input:not([type]), select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 14px; margin: 0; }
legend { padding: 0 6px; color: var(--muted); font-size: .9rem; }
.kv { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-bottom: 8px; }
.actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.actions.sticky { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.bigqty { font-size: 1.5rem !important; padding: 10px !important; }

/* 検索条件 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 240px; width: auto; }
.filters select { width: auto; max-width: 260px; }
.filters input[type=date] { width: auto; }

/* 一覧 */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { font-size: .82rem; color: var(--muted); font-weight: 600; background: var(--panel); white-space: nowrap; }
table.list tbody tr:hover { background: var(--hover); }
table.list tr:last-child td { border-bottom: 0; }
table.list.compact { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table.list.compact th { width: 140px; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.cb, th.cb { width: 32px; }
td.thumb, th.thumb { width: 64px; }
td.thumb img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; display: block; }
.nophoto { display: block; width: 52px; height: 52px; border-radius: 6px; background: var(--hover); }
.nophoto.big { width: 100%; height: 200px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
td.name a { font-weight: 600; }
td.empty, .empty { text-align: center; color: var(--muted); padding: 30px; }
td.memo { max-width: 260px; }
.actions-cell { white-space: nowrap; }
.actions-cell a { margin-left: .6rem; }
tr.dim td { opacity: .55; }
.minus { color: var(--ng); }
.plus { color: var(--ok); }
.type { font-size: .8rem; padding: 1px 8px; border-radius: 4px; background: var(--hover); white-space: nowrap; }
.type.t-in, .type.t-transfer_in { background: var(--ok-bg); color: var(--ok); }
.type.t-out, .type.t-transfer_out { background: var(--ng-bg); color: var(--ng); }
.type.t-adjust { background: var(--warn-bg); color: var(--warn); }
.type.t-import { background: var(--info-bg); }
.bulkbar { display: flex; align-items: center; gap: 6px; padding: 10px 0; flex-wrap: wrap; font-size: .9rem; }
.bulkbar input { width: 7em; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.pager a, .pager span { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); font-size: .9rem; }
.pager .current { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.pager .disabled, .pager .dots { color: var(--muted); }
.pager .total { border: 0; background: none; color: var(--muted); }

/* 詳細表示・危険な操作・切り替えボタン */
dl.props { display: grid; grid-template-columns: 110px 1fr; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
dl.props dt, dl.props dd { margin: 0; padding: 7px 12px; border-bottom: 1px solid var(--line); }
dl.props dt { color: var(--muted); font-size: .85rem; }
dl.props dt:last-of-type, dl.props dd:last-of-type { border-bottom: 0; }
.dangerzone { display: flex; gap: .6rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.dangerzone form { margin: 0; }
.segmented { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); margin-bottom: 14px; max-width: 560px; }
.segmented label, .segmented a { flex: 1; text-align: center; margin: 0; }
.segmented input { display: none; }
.segmented span, .segmented a { display: block; padding: 10px 6px; cursor: pointer; color: var(--text); border-right: 1px solid var(--line); }
.segmented label:last-child span, .segmented a:last-child { border-right: 0; }
.segmented input:checked + span, .segmented a.on { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.form .segmented label { display: block; color: var(--text); font-size: 1rem; }

/* 取り込み */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.stats span { display: block; color: var(--muted); font-size: .8rem; }
.stats strong { font-size: 1.4rem; }
label.radio { display: block; padding: 2px 0; cursor: pointer; }
table.conflicts td { font-size: .9rem; }

/* ログイン */
.login-box { max-width: 380px; margin: 8vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.login-box h1 { text-align: center; }

/* 共通部品（グループウェア） */
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--ng); color: #fff;
  font-size: .72rem; line-height: 18px; text-align: center; font-weight: 600; vertical-align: 1px; }
.subnav { display: flex; gap: 4px; padding: 6px 16px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.subnav a { padding: 4px 10px; border-radius: 6px; color: var(--muted); white-space: nowrap; font-size: .9rem; }
.subnav a.active { background: var(--info-bg); color: var(--text); font-weight: 600; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.inline { display: inline; margin: 0; }
.datenav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.datenav-label { margin-left: 8px; font-size: 1.05rem; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar form { margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.toolbar select { width: auto; }
.prio-1 { color: var(--ng); font-weight: 600; }
.prio-3 { color: var(--muted); }
.overdue { color: var(--ng); font-weight: 600; }
.progress { display: inline-block; width: 70px; height: 8px; background: var(--hover); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.progress > span { display: block; height: 100%; background: var(--primary); }
tr.done td { color: var(--muted); }
tr.done td.title a { text-decoration: line-through; color: var(--muted); }
tr.unread td.title a { font-weight: 700; }
.dot-unread { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 6px; vertical-align: 1px; }
.body-text { white-space: pre-wrap; word-break: break-word; line-height: 1.75; }
.meta { color: var(--muted); font-size: .85rem; }

/* 利用者の選択 */
.picker { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.picker-tools { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.picker-tools select, .picker-tools input[type=search] { width: auto; flex: 1 1 140px; padding: 6px 8px; }
.picker-list { max-height: 220px; overflow-y: auto; padding: 6px 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 2px 10px; }
.picker-list label { color: var(--text); font-size: .92rem; padding: 3px 0; }
.picker-count { padding: 4px 10px; border-top: 1px solid var(--line); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* 添付ファイル */
ul.files { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
ul.files li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
ul.files img { max-width: 160px; max-height: 120px; border-radius: 6px; display: block; border: 1px solid var(--line); }

/* スケジュール：月表示 */
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--panel); }
.cal th { font-size: .8rem; color: var(--muted); padding: 6px; border: 1px solid var(--line); font-weight: 600; }
.cal td { border: 1px solid var(--line); vertical-align: top; height: 104px; padding: 4px; }
.cal td.other { background: var(--bg); }
.cal td.today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal .daynum { display: flex; justify-content: space-between; font-size: .82rem; }
.cal .daynum a.add { visibility: hidden; }
.cal td:hover .daynum a.add { visibility: visible; }
.sun, .cal th.sun { color: var(--ng); }
.sat, .cal th.sat { color: var(--primary); }
.ev { display: block; font-size: .8rem; line-height: 1.35; padding: 2px 4px; margin-top: 2px; border-radius: 4px; background: var(--info-bg); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev:hover { text-decoration: none; filter: brightness(.96); }
.ev.allday { background: var(--ok-bg); }
.ev.private { background: var(--hover); color: var(--muted); }
.ev .t { color: var(--muted); margin-right: 4px; }
/* 週・日表示（予定の一覧） */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week .day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-height: 140px; padding: 6px; }
.week .day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.week .day h3 { font-size: .9rem; margin: 0 0 4px; display: flex; justify-content: space-between; }
.week .ev { white-space: normal; }
.dayview { display: grid; gap: 8px; max-width: 760px; }
.dayview .ev { font-size: .95rem; padding: 8px 10px; white-space: normal; }
/* グループ・施設の週表示 */
table.grid { border-collapse: collapse; width: 100%; min-width: 860px; table-layout: fixed; background: var(--panel); }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 4px; vertical-align: top; }
table.grid th { font-size: .8rem; color: var(--muted); font-weight: 600; }
table.grid th.rowhead, table.grid td.rowhead { width: 130px; text-align: left; font-size: .88rem; color: var(--text); background: var(--panel); }
table.grid td { height: 64px; }
table.grid td.today, table.grid th.today { background: var(--info-bg); }
table.grid td .add { display: block; text-align: center; color: var(--muted); font-size: .8rem; opacity: 0; }
table.grid td:hover .add { opacity: 1; }
.legend { font-size: .82rem; color: var(--muted); }

/* メッセージ */
.chat-layout { display: grid; grid-template-columns: 280px 1fr; gap: 14px; }
ul.rooms { list-style: none; padding: 0; margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
ul.rooms li { border-bottom: 1px solid var(--line); }
ul.rooms li:last-child { border-bottom: 0; }
ul.rooms a { display: block; padding: 10px 12px; color: var(--text); }
ul.rooms a:hover { background: var(--hover); text-decoration: none; }
ul.rooms .last { display: block; color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); height: calc(100vh - 190px); min-height: 420px; }
.chat-head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; align-self: flex-start; }
.msg.mine { align-self: flex-end; text-align: right; }
.msg .who { font-size: .78rem; color: var(--muted); }
.msg .bubble { display: inline-block; text-align: left; padding: 8px 12px; border-radius: 12px; background: var(--hover); white-space: pre-wrap; word-break: break-word; }
.msg.mine .bubble { background: var(--info-bg); }
.msg.system { align-self: center; max-width: 92%; text-align: center; }
.msg.system .bubble { background: transparent; color: var(--muted); font-size: .85rem; border: 1px dashed var(--line); }
.msg .read { font-size: .72rem; color: var(--muted); margin-right: 6px; }
.chat-form { border-top: 1px solid var(--line); padding: 10px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.chat-form textarea { resize: vertical; min-height: 44px; max-height: 200px; }
.chat-form .file { grid-column: 1 / -1; font-size: .85rem; }
details.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }
details.panel summary { cursor: pointer; color: var(--primary); }

/* トップ画面 */
.dash { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.dash .card h2 { margin: 0 0 8px; font-size: 1rem; display: flex; gap: 6px; align-items: baseline; }
.dash .card h2 a { margin-left: auto; }
.dash .card h2 a { font-size: .82rem; font-weight: normal; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; }
ul.plain li:last-child { border-bottom: 0; }
ul.plain .when { color: var(--muted); font-size: .85rem; min-width: 76px; white-space: nowrap; }
ul.plain .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* 共有フォルダー・メモ帳・簡易データベース */
.crumbs { margin-bottom: 4px; color: var(--muted); }
.ficon { margin-right: 6px; }
.folder-actions { display: grid; gap: 8px; margin: 8px 0; }
.colorpick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.colorpick a:not(.sw) { font-size: .85rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.colorpick a.on:not(.sw) { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.sw { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; position: relative; }
.sw.on, .sw:has(input:checked) { box-shadow: 0 0 0 2px var(--primary); }
.sw input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.c-none { --note: var(--panel); }
.c-yellow { --note: var(--note-yellow); } .c-green { --note: var(--note-green); } .c-blue { --note: var(--note-blue); } .c-pink { --note: var(--note-pink); } .c-purple { --note: var(--note-purple); }
.sw { background: var(--note, var(--panel)); }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.note { background: var(--note, var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; min-height: 140px; }
.note-head { display: flex; justify-content: space-between; gap: 6px; align-items: start; }
.note-title { font-weight: 700; color: var(--text); }
.note-body { color: var(--text); white-space: pre-wrap; word-break: break-word; font-size: .9rem; flex: 1; margin-top: 4px; }
.note-body:hover, .note-title:hover { text-decoration: none; }
.note-foot { font-size: .75rem; color: var(--muted); margin-top: 6px; }
.pin { background: none; border: 0; cursor: pointer; opacity: .25; font-size: 1rem; padding: 0; }
.pin.on { opacity: 1; }
.note-editor { background: var(--note, var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.note-editor textarea, .note-editor .note-title-input { background: transparent; }
.note-title-input { font-size: 1.15rem; font-weight: 700; }
.dbcard { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.dbcard:hover { text-decoration: none; background: var(--hover); }
.fields-table td { vertical-align: middle; }
.fields-table textarea { min-height: 38px; }
table.dbtable th a { color: var(--muted); }

/* 休日 */
.hname { color: var(--ng); font-size: .72rem; font-weight: 400; margin-left: 4px; }
th .hname { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .daynum .hname { display: inline-block; max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.cal td.hday, .week .day.hday { background: var(--ng-bg); }
.cal td.hday.other { background: var(--bg); }
table.grid td.hday { background: color-mix(in srgb, var(--ng-bg) 60%, var(--panel)); }
.holiday-banner { color: var(--ng); background: var(--ng-bg); border-radius: var(--radius); padding: 6px 12px; font-weight: 600; }
.hname-big { color: var(--ng); font-size: .95rem; font-weight: 600; }

/* ツリー掲示板・スレッド掲示板 */
.catbar { display: flex; gap: 16px; flex-wrap: wrap; margin: -6px 0 12px; font-size: .9rem; }
.inline-details summary { cursor: pointer; color: var(--primary); }
.tree-card { margin-bottom: 10px; padding: 10px 14px; }
.tree-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
ul.tree { list-style: none; margin: 0; padding: 0; }
ul.tree ul { list-style: none; margin: 0; padding-left: 1.3rem; border-left: 1px dotted var(--line); margin-left: .45rem; }
ul.tree li { padding: 2px 0; }
ul.tree li::before { content: "└"; color: var(--muted); margin-right: 4px; }
ul.tree > li::before { content: "■"; font-size: .7rem; vertical-align: 1px; }
.tnode.current strong { background: var(--info-bg); padding: 0 4px; border-radius: 4px; }
.tnode.deleted a { color: var(--muted); }
.tmeta { color: var(--muted); font-size: .82rem; margin-left: 4px; }
.unread-count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-size: .78rem; font-weight: 600; text-align: center; }
.new { color: var(--ng); font-size: .72rem; font-weight: 700; margin-left: 6px; }
.tree-full { margin-bottom: 8px; padding: 10px 14px; }
.forum-body .quote, .res-body .quote { color: var(--ok); }
.thread-title { color: var(--ng); }
.threadnav { display: flex; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.threadnav a.on { font-weight: 700; color: var(--text); }
.thread { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; margin-bottom: 16px; }
.res { padding: 10px 0; border-bottom: 1px solid var(--line); }
.res:last-child { border-bottom: 0; }
.res:target { background: var(--warn-bg); }
.res-head { font-size: .88rem; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.res-num { font-weight: 700; }
.res-name { color: var(--ok); font-weight: 600; }
.res-date { color: var(--muted); }
.res-body { margin: 6px 0 0 1.5rem; line-height: 1.75; word-break: break-word; }
a.anchor { font-size: .95em; }
.anchor-pop { position: absolute; z-index: 50; max-width: min(560px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 8px 12px; font-size: .9rem; }

/* スマホ */
/* Webデータベース（Aipo 型） */
.wdb-title { margin-bottom: .6rem; }
.wdb { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.wdb-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 130px; }
.wdb-side .btn.wdb-add { background: #f28c1a; border-color: #f28c1a; color: #fff; text-align: center; font-size: 1rem; padding: 10px 14px; }
.wdb-side .btn.wdb-add:hover { background: #e07c0c; border-color: #e07c0c; }
.wdb-dbs { display: flex; flex-direction: column; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 0; max-height: 60vh; overflow-y: auto; }
.wdb-dbs a { display: block; padding: 8px 12px; color: var(--text); border-radius: 4px; line-height: 1.45; }
.wdb-dbs a:hover { background: var(--hover); text-decoration: none; }
.wdb-dbs a.active { background: var(--hover); font-weight: 700; box-shadow: inset 3px 0 0 #f28c1a; }
.wdb-vis { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 9px; font-size: .7rem; font-weight: 500; vertical-align: 1px; background: var(--info-bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.wdb-vis.private { background: var(--warn-bg); }
.wdb-visopts { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.wdb-visbox[hidden] { display: none; }
.wdb-links { display: flex; flex-direction: column; gap: 8px; padding: 0 2px 10px; border-bottom: 1px solid var(--line); }
.wdb-links a { text-decoration: underline; color: var(--text); }
.wdb-links a.active { font-weight: 700; }
.wdb-dbname { font-size: 1.15rem; margin: 0 0 .6rem; }
.wdb-search { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.wdb-search input[type=search] { flex: 0 1 420px; min-width: 0; }
.wdb-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.wdb-tools .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.wdb-pager { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.wdb-pager > span:first-child { margin-right: 6px; }
.wdb-pager.bottom { justify-content: flex-end; margin-top: 10px; }
.btn.disabled { opacity: .45; pointer-events: none; }
table.wdb-table { background: var(--panel); }
table.wdb-table th { background: var(--hover); color: var(--text); font-size: .9rem; }
table.wdb-table th a { color: var(--text); text-decoration: underline; }
table.wdb-table th.cb, table.wdb-table td.cb { width: 34px; text-align: center; }
table.wdb-table td { padding: 10px; }
table.wdb-table td a.wdb-open { text-decoration: underline; }
.wdb-sortmark { font-size: .7rem; margin-left: 4px; color: var(--muted); }
dialog.wdb-dialog { border: 1px solid var(--line); border-radius: 8px; padding: 0; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  background: var(--panel); color: var(--text); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog.wdb-dialog::backdrop { background: rgba(0,0,0,.35); }
.wdb-dialog-body { padding: 14px 18px; }
.wdb-detail-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.wdb-detail-head strong { font-size: 1.05rem; }
table.wdb-props { width: 100%; border-collapse: collapse; }
table.wdb-props th, table.wdb-props td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.wdb-props th { width: 34%; max-width: 220px; font-weight: 700; }
.wdb-meta { margin: 8px 0 0; }
.wdb-detail-btns { display: flex; justify-content: center; gap: 8px; margin-top: 4px; padding: 10px 0 2px; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--panel); }
.wdb-detail-head { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.wdb-detail-btns form { margin: 0; }
.wdb-form { max-width: 760px; }
table.wdb-fields td { vertical-align: middle; }
table.wdb-fields td input[type=text], table.wdb-fields td select { min-width: 9em; }
table.wdb-fields .cb, table.wdb-manage .cb { text-align: center; }
table.wdb-preview td, table.wdb-preview th { font-size: .82rem; white-space: nowrap; }
/* 共有フォルダー：左のツリーと移動 */
.fm { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.fm-side { position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow-y: auto; }
.fm-treebox { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 4px 8px; }
.fm-treehead { font-weight: 700; padding: 4px 8px; cursor: pointer; list-style: none; }
.fm-treehead::-webkit-details-marker { display: none; }
.fm-tree, .fm-tree ul { list-style: none; margin: 0; padding: 0; }
.fm-tree ul { padding-left: 14px; display: none; }
.fm-tree li.open > ul { display: block; }
.fm-tree li { display: block; }
.fm-tree li > a { display: inline-flex; align-items: center; max-width: calc(100% - 20px); padding: 4px 6px; border-radius: 5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.fm-tree li > a:hover { background: var(--hover); text-decoration: none; }
.fm-tree li > a.active { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.fm-tree .fm-root > a { font-weight: 600; }
.fm-ico { margin-right: 5px; flex: none; }
.fm-tw, .fm-tw-sp { display: inline-block; width: 18px; height: 22px; vertical-align: middle; }
.fm-tw { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); }
.fm-tw::before { content: "▸"; font-size: .8rem; }
li.open > .fm-tw::before { content: "▾"; }
.fm-hint { margin: 6px 4px 0; }
.fm-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; background: var(--info-bg); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 8px; }
.fm-bar select { width: auto; flex: 0 1 320px; min-width: 0; }
.fm-bar:not(.has-sel) { opacity: .65; }
table.fm-list th.cb, table.fm-list td.cb { width: 34px; text-align: center; }
table.fm-list tr[draggable="true"] { cursor: grab; }
table.fm-list tr.dragging { opacity: .45; }
[data-drop-to].drop-over { outline: 2px dashed var(--primary); outline-offset: 1px; background: var(--info-bg) !important; color: var(--text) !important; }
@media (max-width: 760px) {
  .fm { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .fm-side { position: static; max-height: none; }
  .fm-treebox:not([open]) { padding-bottom: 6px; }
  .fm-hint { display: none; }
  table.fm-list .hide-sm { display: none; }
}

@media (max-width: 760px) {
  .wdb { grid-template-columns: 1fr; gap: 12px; }
  .wdb-side { position: static; }
  .wdb-dbs { flex-direction: row; overflow-x: auto; max-height: none; gap: 4px; }
  .wdb-dbs a { white-space: nowrap; border: 1px solid var(--line); }
  .wdb-links { flex-direction: row; gap: 14px; padding-bottom: 6px; }
  .wdb-search input[type=search] { flex: 1 1 100%; }
  table.wdb-props th { width: 40%; }
}
@media print { .wdb { display: block; } .wdb-side, .wdb-search, .wdb-tools, .wdb-pager { display: none !important; } }

@media (max-width: 760px) {
  .topbar { padding: 0 12px; gap: 0; }
  .brand { padding: 10px 0; flex: 1; }
  .usermenu { order: 2; }
  /* スマホ：メニューはバーで開閉 */
  .menu-toggle { order: 3; flex-basis: 100%; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px 12px;
    background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .95rem; cursor: pointer; text-align: left; }
  .menu-toggle:active { background: var(--hover); }
  .menu-icon { display: inline-flex; flex-direction: column; gap: 3px; width: 18px; }
  .menu-icon i { display: block; height: 2px; background: currentColor; border-radius: 1px; transition: transform .2s, opacity .2s; }
  .menu-label { font-weight: 600; }
  .menu-current { color: var(--muted); font-size: .88rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-current:not(:empty)::before { content: "｜ "; }
  .menu-caret { font-size: .7rem; color: var(--muted); transition: transform .2s; margin-left: auto; }
  .topbar.nav-open .menu-caret { transform: rotate(180deg); }
  .topbar.nav-open .menu-icon i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .topbar.nav-open .menu-icon i:nth-child(2) { opacity: 0; }
  .topbar.nav-open .menu-icon i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
  .mainnav { order: 4; flex-basis: 100%; padding: 0 0 10px; display: none; gap: 0; max-height: calc(100vh - 120px); overflow-y: auto; }
  .topbar.nav-open .mainnav { display: flex; }
  .navrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 6px 0; }
  .navrow + .navrow { border-top: 1px dashed var(--line); }
  .navrow:empty { display: none; }
  .mainnav a { padding: 9px 4px; font-size: .88rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .container { padding: 14px 12px 60px; }
  .form.grid2, .grid2, .detail { grid-template-columns: 1fr; }
  .filters select, .filters input[type=search] { flex: 1 1 100%; max-width: none; min-width: 0; width: 100%; }
  table.list.compact th { width: 100px; }
  .kv { grid-template-columns: 1fr; }
  dl.props { grid-template-columns: 90px 1fr; }
  .week { grid-template-columns: 1fr; }
  .week .day { min-height: 0; }
  .cal td { height: 64px; padding: 2px; }
  .cal .ev .t { display: none; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout.in-room .rooms-col { display: none; }
  .chat { height: calc(100vh - 150px); }
  .msg { max-width: 92%; }
  .dash { grid-template-columns: 1fr; }
  .res-body { margin-left: .4rem; }
  ul.tree ul { padding-left: .8rem; }
  .usermenu { gap: .6rem; }
}
@media (max-width: 400px) {
  .mainnav a { font-size: .8rem; padding: 9px 1px; letter-spacing: -.03em; }
  .usermenu { gap: .55rem; font-size: .84rem; }
  .theme-btn { padding-left: 7px; padding-right: 7px; }
}
@media print {
  .topbar, .filters, .btn, .bulkbar, .dangerzone, .noprint, .subnav, .flash { display: none !important; }
  body { background: #fff; color: #000; }
  .container { max-width: none; padding: 0; }
  .tt-day { break-inside: avoid; }
}

/* 社内メール・日報 */
dl.props.mail-head { max-width: 900px; margin-bottom: 12px; }
.mail-body { max-width: 900px; margin-bottom: 18px; }
.report { display: grid; gap: 10px; max-width: 900px; margin-bottom: 14px; }
.report .card h2 { margin: 0 0 6px; font-size: .95rem; color: var(--muted); }
.comment { border-left: 3px solid var(--line); padding: 4px 12px; margin: 8px 0; max-width: 760px; }
.comment-head { font-size: .9rem; display: flex; gap: 8px; align-items: baseline; }
.report-status th, .report-status td.st { text-align: center; white-space: nowrap; }
.report-status th.today { background: var(--info-bg); }
.report-status td.off { background: var(--hover); }
.st-ok { color: var(--ok); font-weight: 600; }
.st-conf { color: var(--ok); margin-left: 2px; }
.st-draft { color: var(--warn); }
.st-none { color: var(--ng); }
.plain a.strong { font-weight: 700; }

/* Wiki */
.wiki-home { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.wiki-cat { margin-bottom: 12px; }
.wiki-cat h2 { margin: 0 0 6px; font-size: 1.05rem; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.wiki-cat h2 a { margin-left: auto; font-weight: normal; }
.wiki-tree { margin: 4px 0; padding-left: 1.2em; }
.wiki-tree li { margin: 2px 0; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 8px 4px 0; }
.wiki-layout { display: block; }
.wiki-layout.has-toc { display: grid; grid-template-columns: 1fr 240px; gap: 16px; align-items: start; }
.wiki-toc { position: sticky; top: 100px; font-size: .88rem; max-height: 70vh; overflow: auto; }
.wiki-toc ul { list-style: none; padding: 0; margin: 6px 0 0; }
.wiki-toc li { margin: 3px 0; }
.wiki-toc .lv3 { padding-left: 1em; } .wiki-toc .lv4 { padding-left: 2em; }
.wiki-body { line-height: 1.8; overflow-wrap: anywhere; }
.wiki-body > :first-child { margin-top: 0; }
.wiki-body h1, .wiki-body h2 { border-bottom: 1px solid var(--line); padding-bottom: 4px; scroll-margin-top: 100px; }
.wiki-body h1 { font-size: 1.4rem; } .wiki-body h2 { font-size: 1.2rem; margin-top: 1.6rem; }
.wiki-body h3, .wiki-body h4 { scroll-margin-top: 100px; }
.wiki-body table { border-collapse: collapse; margin: 10px 0; display: block; overflow-x: auto; }
.wiki-body th, .wiki-body td { border: 1px solid var(--line); padding: 5px 10px; }
.wiki-body th { background: var(--hover); }
.wiki-body pre { background: var(--hover); padding: 10px 12px; border-radius: 6px; overflow-x: auto; font-size: .88rem; }
.wiki-body code { background: var(--hover); padding: 1px 4px; border-radius: 4px; font-size: .9em; }
.wiki-body pre code { background: none; padding: 0; }
.wiki-body blockquote { margin: 8px 0; padding: 4px 14px; border-left: 4px solid var(--line); color: var(--muted); }
.wiki-body img { max-width: 100%; height: auto; }
.wiki-body ul.contains-task-list, .wiki-body .task-list-item { list-style: none; }
.wiki-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.4rem 0; }
.wiki-body a.missing { color: var(--ng); border-bottom: 1px dashed var(--ng); }
.wiki-body a.missing:hover { text-decoration: none; }
.wiki-form { max-width: 1000px; }
.wiki-editor { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.wiki-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 6px 8px 0; }
.wiki-tabs button { border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font: inherit; }
.wiki-tabs button.on { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.wiki-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.wiki-toolbar button { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 5px; padding: 2px 8px; font: inherit; font-size: .82rem; cursor: pointer; }
.wiki-toolbar button:hover { background: var(--hover); }
.wiki-editor textarea { border: 0; border-radius: 0 0 var(--radius) var(--radius); font-family: ui-monospace, SFMono-Regular, Consolas, "Noto Sans Mono CJK JP", monospace; font-size: .92rem; line-height: 1.6; min-height: 420px; }
.wiki-preview { border: 0; min-height: 420px; }
.t-help td { padding: 3px 10px 3px 0; vertical-align: top; }
.wiki-files { margin-top: 1.6rem; font-size: 1rem; }
.diff { font-family: ui-monospace, SFMono-Regular, Consolas, "Noto Sans Mono CJK JP", monospace; font-size: .86rem; padding: 6px 0; overflow-x: auto; }
.diff .dl { white-space: pre-wrap; padding: 0 10px; overflow-wrap: anywhere; }
.diff .mk { display: inline-block; width: 1.4em; color: var(--muted); user-select: none; }
.diff .add { background: var(--ok-bg); } .diff .del { background: var(--ng-bg); text-decoration: line-through; text-decoration-color: rgba(198,40,40,.4); }
.diff .skip { color: var(--muted); font-style: italic; background: var(--hover); }
.diff-legend { display: inline-block; padding: 1px 8px; border-radius: 4px; margin-right: 8px; }
.diff-legend.add { background: var(--ok-bg); } .diff-legend.del { background: var(--ng-bg); }
@media (max-width: 900px) {
  .wiki-home, .wiki-layout.has-toc { grid-template-columns: 1fr; }
  .wiki-toc { position: static; order: -1; }
}

/* タイムテーブル */
dl.props.tt-head { max-width: 900px; margin-bottom: 8px; }
.tt-day { max-width: 1000px; }
.tt-day h2 { margin: 1.4rem 0 .5rem; padding-bottom: 4px; border-bottom: 2px solid var(--primary); display: flex; gap: 8px; align-items: baseline; }
.tt-table td { vertical-align: top; }
.tt-table .tt-time { width: 9.5em; }
.tt-title { font-weight: 600; }
.tt-add-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 760px) { .tt-add-row { grid-template-columns: 1fr 1fr; } }
.tt-table { table-layout: fixed; width: 100%; }
.tt-table th:nth-child(3) { width: 22%; } .tt-table th:nth-child(4) { width: 16%; } .tt-table th:nth-child(5) { width: 7.5em; }
@media (max-width: 760px) { .tt-table { table-layout: auto; } }

/* GL予定管理 */
.gl-title { margin-bottom: .6rem; }
.gl { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }
.gl-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 130px; }
.gl-side .btn.gl-add { background: #f28c1a; border-color: #f28c1a; color: #fff; text-align: center; }
.gl-side .btn.gl-add:hover { background: #e07c0c; border-color: #e07c0c; }
.gl-mini { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; }
.gl-mini-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.gl-mini-nav .btn { padding: 2px 8px; }
.gl-mini table { width: 100%; border-collapse: collapse; text-align: center; font-size: .9rem; }
.gl-mini th { font-weight: normal; color: var(--muted); padding: 2px 0; }
.gl-mini td a { display: block; padding: 4px 0; border-radius: 4px; color: var(--text); }
.gl-mini td a:hover { background: var(--hover); text-decoration: none; }
.gl-mini td a.out { color: var(--muted); opacity: .6; }
.gl-mini td a.sun, .gl-mini th.sun { color: var(--ng); } .gl-mini td a.sat, .gl-mini th.sat { color: var(--primary); }
.gl-mini td a.today { font-weight: 700; text-decoration: underline; }
.gl-mini td a.sel { background: var(--hover); outline: 1px solid var(--line); }
.gl-cals { display: flex; flex-direction: column; gap: 2px; }
.gl-cals a { padding: 4px 6px; border-radius: 6px; color: var(--text); }
.gl-cals a.on { background: var(--info-bg); font-weight: 600; }
.gl-cals a:hover { text-decoration: none; background: var(--hover); }
.gl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); margin-right: 6px; vertical-align: middle; }
.gl-dot.all { background: conic-gradient(#1a6fd1 0 25%, #1d7a3e 0 50%, #e07c0c 0 75%, #8a3fd1 0); }
.gl-search { display: flex; gap: 8px; margin-bottom: 10px; max-width: 560px; }
.gl-search input { flex: 1; min-width: 0; } .gl-search .btn { flex: none; white-space: nowrap; }
.gl-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.gl-btns { display: inline-flex; } .gl-btns .btn { border-radius: 0; margin-left: -1px; padding: 6px 12px; } .gl-btns .btn:first-child { border-radius: 6px 0 0 6px; } .gl-btns .btn:last-child { border-radius: 0 6px 6px 0; }
.gl-label { font-size: 1.05rem; }
.gl-views { margin-left: auto; display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.gl-views a { padding: 6px 14px; color: var(--text); border-left: 1px solid var(--line); background: var(--panel); }
.gl-views a:first-child { border-left: 0; } .gl-views a.on { background: var(--hover); font-weight: 700; } .gl-views a:hover { text-decoration: none; background: var(--hover); }
.gl-calsel { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.gl-calsel select { width: auto; min-width: 260px; }
.gl-chip { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--c); color: #fff; font-size: .85rem; font-weight: 600; }
.gl-c-blue { --c: #1a5fbf; } .gl-c-green { --c: #1d7a3e; } .gl-c-orange { --c: #d06a00; } .gl-c-red { --c: #c62828; }
.gl-c-purple { --c: #7b3fc4; } .gl-c-teal { --c: #0f7a7a; } .gl-c-pink { --c: #c2185b; } .gl-c-gray { --c: #5f6b78; }
.gl-grid { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.gl-head, .gl-body { display: grid; grid-template-columns: 64px repeat(var(--days), minmax(90px, 1fr)); }
.gl-head { border-bottom: 1px solid var(--line); overflow-y: hidden; scrollbar-gutter: stable; }
.gl-dayhead { text-align: center; padding: 6px 2px; border-left: 1px solid var(--line); font-size: .95rem; }
.gl-dayhead a { color: var(--text); text-decoration: underline; }
.gl-dayhead.sat a { color: var(--primary); } .gl-dayhead.sun a { color: var(--ng); }
.gl-hname { font-size: .72rem; color: var(--ng); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-allday { border-left: 1px solid var(--line); border-top: 1px solid var(--line); min-height: 30px; padding: 2px; display: flex; flex-direction: column; gap: 2px; position: relative; }
.gl-alllabel { border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.gl-body { height: 640px; overflow-y: auto; scrollbar-gutter: stable; position: relative; }
.gl-times { position: relative; }
.gl-hour { height: var(--hour); border-top: 1px solid var(--line); position: relative; }
.gl-hour span { position: absolute; top: -.6em; right: 6px; font-size: .85rem; color: var(--muted); background: var(--panel); padding: 0 2px; }
.gl-hour:first-child span { top: 2px; }
.gl-col { position: relative; height: calc(var(--hour) * 24); border-left: 1px solid var(--line); }
.gl-col { background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px), linear-gradient(to bottom, transparent calc(var(--hour) / 2), color-mix(in srgb, var(--line) 55%, transparent) calc(var(--hour) / 2), color-mix(in srgb, var(--line) 55%, transparent) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px)); background-size: 100% var(--hour); }
.gl-col.today, .gl-dayhead.today, .gl-allday.today { background-color: color-mix(in srgb, #2fb34a 9%, transparent); }
.gl-col.sat, .gl-allday.sat, .gl-dayhead.sat { background-color: color-mix(in srgb, #5b8bd0 9%, transparent); }
.gl-col.sun, .gl-allday.sun, .gl-dayhead.sun { background-color: color-mix(in srgb, #e8742f 9%, transparent); }
.gl-slot { position: absolute; left: 0; right: 0; height: calc(var(--hour) / 2); }
.gl-slot:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.gl-ev { display: block; font-size: .8rem; line-height: 1.35; padding: 2px 5px; border-radius: 4px; color: var(--text); overflow: hidden;
  background: color-mix(in srgb, var(--c, #1a5fbf) 16%, var(--panel)); border-left: 3px solid var(--c, #1a5fbf); white-space: nowrap; text-overflow: ellipsis; }
.gl-ev:hover { text-decoration: none; filter: brightness(.96); }
.gl-timed { position: absolute; white-space: normal; z-index: 1; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.gl-time { font-weight: 600; color: var(--c); }
.gl-timed .gl-time { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-name { font-weight: 600; }
.gl-sub { display: block; color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--ng); z-index: 2; pointer-events: none; }
.gl-addday { position: absolute; right: 3px; top: 1px; font-size: .8rem; color: var(--muted); opacity: 0; }
.gl-allday:hover .gl-addday, .gl-month td:hover .gl-addday { opacity: 1; }
.gl-month { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--panel); }
.gl-month th { padding: 6px; border: 1px solid var(--line); font-weight: 600; font-size: .9rem; }
.gl-month th.sun { color: var(--ng); } .gl-month th.sat { color: var(--primary); }
.gl-month td { border: 1px solid var(--line); vertical-align: top; height: 110px; padding: 2px 3px; position: relative; }
.gl-month td .gl-ev { margin-bottom: 2px; }
.gl-month td.out { opacity: .55; } .gl-month td.today { background: color-mix(in srgb, #2fb34a 9%, transparent); }
.gl-month td.sun .gl-mday > a:first-child { color: var(--ng); } .gl-month td.sat .gl-mday > a:first-child { color: var(--primary); }
.gl-mday { font-size: .85rem; display: flex; gap: 4px; align-items: baseline; }
.gl-mday > a:first-child { color: var(--text); font-weight: 600; }
.gl-mday .gl-addday { top: 2px; }
@media (max-width: 900px) {
  .gl { grid-template-columns: 1fr; }
  .gl-side { position: static; }
  .gl-mini { display: none; }
  .gl-views { margin-left: 0; }
  .gl-head, .gl-body { grid-template-columns: 48px repeat(var(--days), minmax(110px, 1fr)); }
  .gl-grid { overflow-x: auto; }
}

/* 報告書 */
.rd-groups { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 4px 0; }
.rd-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.rd-thumb { display: flex; flex-direction: column; align-items: center; width: 130px; gap: 4px; }
.rd-thumb { position: relative; }
.rd-thumb .rd-name { max-width: 126px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-x { position: absolute; top: -6px; right: -2px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel);
  color: var(--ng); font-size: .85rem; line-height: 1; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); padding: 0; }
.rd-x:hover { background: var(--ng-bg); }
.rd-thumb.removing { opacity: .4; pointer-events: none; }
.rd-up { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 12px; }
.rd-up-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.rd-up-bar .btn { position: relative; overflow: hidden; }
.rd-up-input.js-hidden { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rd-thumb .rd-file { display: flex; align-items: center; justify-content: center; width: 120px; height: 90px; border: 1px solid var(--line); border-radius: 6px; font-size: 2rem; background: var(--bg); }
.rd-thumb.rd-new img, .rd-thumb.rd-new .rd-file { outline: 2px solid var(--primary); outline-offset: -2px; }
.rd-thumb img, .rd-thumbs > img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.rd-file { font-size: 2.4rem; }
.rd-body { max-width: 900px; margin: 10px 0; line-height: 1.8; }
.rd-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; max-width: 1000px; }
.rd-gallery a { display: flex; flex-direction: column; gap: 4px; }
.rd-gallery img { width: 100%; height: 180px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
tr.sel td { background: var(--info-bg); }
@media print { .rd-gallery img { height: auto; max-height: 360px; object-fit: contain; } }
