/* グループウェア - 共通スタイル（ビルド不要の素の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;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a; --panel: #1e2125; --text: #e6e8eb; --muted: #9aa3ad; --line: #33383e;
    --primary: #4c95ea; --ok: #5cc27e; --ng: #ff7b72; --warn: #e3a948;
    --ok-bg: #1b3325; --ng-bg: #3a1f1f; --warn-bg: #3a2d14; --info-bg: #1b2a3d; --hover: #262a30;
  }
}
* { 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; }
.mainnav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.mainnav a { padding: 14px 12px; color: var(--muted); white-space: nowrap; border-bottom: 3px solid transparent; }
.mainnav a.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.mainnav a:hover { text-decoration: none; color: var(--text); }
.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); }
.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; }

/* 休日 */
.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; }

/* スマホ */
@media (max-width: 760px) {
  .topbar { padding: 0 12px; gap: 0; }
  .brand { padding: 10px 0; flex: 1; }
  .usermenu { order: 2; }
  .mainnav { order: 3; flex-basis: 100%; }
  .mainnav a { padding: 10px; }
  .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 print {
  .topbar, .filters, .btn, .bulkbar, .dangerzone { display: none !important; }
}
