/* ================================================================
   AMOワークスペース 新しい骨組み（app.html / app.js と対）
   左メニュー + 事業切替（全社 / 旗二ふどうさん / 旗二でじたる）+ ダッシュボード。
   事業ごとの色は body[data-biz] のトークンで切り替える（画面側の色指定はすべて var() 経由）。
   UI設計ルール: 文字は rem、高さは min-height、折り返し前提、タップ領域 44px。
   制作・運営: 旗二でじたる
   ================================================================ */
:root {
  --bg: #f3f5f8; --panel: #ffffff; --line: #dde2ea; --line-weak: #eef1f5;
  --text: #1a2233; --muted: #5d6b7e; --faint: #8a96a8;
  --danger: #b42318; --danger-weak: #fdecea;
  --warn: #7a4f00; --warn-weak: #fff3d1;
  --ok: #1c7037; --ok-weak: #e5f3e9;
  --info: #1d4ed8; --info-weak: #e6edfb;
  /* 事業の色（図の色。文字には使わない） */
  --fudosan: #15803d; --fudosan-weak: #e6f5ea;   /* 旗二ふどうさん＝濃い緑（2026-10-21 ユーザー指示） */
  --digital: #3b4f8c; --digital-weak: #e6e9f2;   /* 旗二でじたる＝黒に近い紺（2026-10-21 ユーザー指示）。図の棒は少し明るい紺 #3b4f8c（dataviz 検証済み） */
  --service3: #d97706;
  --profit: #eb6834;   /* 営業利益の線。緑の棒（ふどうさん）のときは色覚で区別がつくよう紫に（下で上書き） */
  /* 事業で切り替わるトークン（既定 = 全社） */
  --side: #050a1c; --side-text: #c9d3e6; --side-active: #1e2a5a;   /* 全社＝とても濃い紺 */
  --accent: #1e2a5a; --accent-weak: #e6e9f2; --accent-text: #1e2a5a;
  --chart: #3b4f8c;   /* 図の棒の色（主色が暗すぎて図の基準を外れるので、事業ごとに読める濃さの色を持つ） */
  --side-w: 14rem;
}
body[data-biz="fudosan"] { --profit: #6250d6; --side: #0f3b2e; --side-text: #cfe3d8; --side-active: #15803d; --accent: #166534; --accent-weak: #e6f5ea; --accent-text: #166534; --chart: #15803d; }
body[data-biz="digital"] { --side: #0f1736; --side-text: #c9d0e3; --side-active: #2a3a66; --accent: #1b2440; --accent-weak: #e6e9f2; --accent-text: #1b2440; --chart: #3b4f8c; }

* { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-size: 1rem; line-height: 1.6;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  overflow-wrap: break-word;
}
button, input, select, textarea { font: inherit; color: inherit; }
button {
  min-height: 2.75rem; padding: 0.35em 0.9em; border: 1px solid var(--line); background: var(--panel);
  border-radius: 0.5rem; cursor: pointer; text-align: center;
}
button:hover { border-color: #9aa1aa; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 0.15rem solid var(--accent); outline-offset: 0.1rem; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button > svg { width: 1.1rem; height: 1.1rem; vertical-align: -0.2em; }
button.primary { display: inline-flex; align-items: center; gap: 0.3em; justify-content: center; }
button.plain { border-color: transparent; background: transparent; }
button.small { font-size: 0.9rem; padding: 0.2em 0.7em; }
button.link { border: none; background: none; color: var(--accent-text); padding: 0.35em 0.3em; text-decoration: underline; text-align: left; }
input[type=search], input[type=text], select { min-height: 2.75rem; padding: 0.35em 0.6em; border: 1px solid var(--line); border-radius: 0.5rem; background: #fff; max-width: 100%; }
a { color: var(--accent-text); }
h1, h2, h3 { line-height: 1.35; margin: 0; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 全体の配置 ---------- */
.shell { display: flex; min-height: 100vh; } /* 左メニュー+本文の2枠。折り返さない（スマホは左メニューを消す） */
.side {
  width: var(--side-w); flex: 0 0 var(--side-w); background: var(--side); color: var(--side-text);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  transition: background 0.2s;
}
.side .brand { display: flex; align-items: center; justify-content: center; min-height: 4.5rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.side .brand img { display: block; width: 100%; max-width: 7.5rem; height: auto; margin: 0.4rem 0; }
.side nav { padding: 0.6rem 0.5rem; display: flex; flex-direction: column; gap: 0.15rem; }
.side nav button {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 2.75rem; padding: 0.45em 0.8em;
  background: transparent; border: none; color: inherit; border-radius: 0.5rem; text-align: left; font-size: 0.95rem;
}
.side nav button:hover { background: rgba(255,255,255,0.08); }
.side nav button.active { background: var(--side-active); color: #fff; }
.side nav button svg { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.side .side-foot { margin-top: auto; padding: 0.8rem; font-size: 0.75rem; color: rgba(255,255,255,0.55); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; padding: 0.7rem 1.2rem; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; min-height: 4.5rem;
}
.top .title { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.top .title .logo-h { display: none; height: 2.8rem; width: auto; flex: 0 0 auto; }
.top .title .name { font-weight: 700; font-size: 1.1rem; }
.top .title .sub { font-size: 0.8rem; color: var(--muted); display: none; }
@media (min-width: 75rem) { .top .title .sub { display: block; } }
.top .back { display: inline-flex; align-items: center; gap: 0.2em; min-height: 2.75rem; padding: 0.35em 0.8em 0.35em 0.5em; flex: 0 0 auto; }
.top .back svg { width: 1.1rem; height: 1.1rem; }
.top .spacer { flex: 1 1 auto; }
.top .top-extra { display: flex; align-items: center; gap: 0.5rem; }
.top .top-extra input[type=search] { width: 14rem; max-width: 40vw; }
.side .brand a { display: block; width: 100%; max-width: 7.5rem; }
.top .iconbtn { width: 2.75rem; min-height: 2.75rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; position: relative; }
.top .iconbtn svg { width: 1.3rem; height: 1.3rem; }
.top .iconbtn .dot { position: absolute; top: 0.5rem; right: 0.55rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--danger); }
.bell-wrap { position: relative; }
.bell-menu { position: absolute; right: 0; top: calc(100% + 0.4rem); width: 20rem; max-width: calc(100vw - 2rem); background: var(--panel); border: 1px solid var(--line); border-radius: 0.9rem; box-shadow: 0 8px 24px rgba(15,28,58,0.12); padding: 0.8rem; z-index: 30; }
.bell-menu h3 { font-size: 0.95rem; margin: 0 0 0.4rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.bell-menu .row.read { opacity: 0.6; }
.bell-menu .foot { width: 100%; margin-top: 0.3rem; }
.top .avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--accent-weak); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.biz-badge { font-size: 0.8rem; padding: 0.15em 0.6em; border-radius: 999px; background: var(--accent-weak); color: var(--accent-text); }

.content { padding: 1rem 1.2rem 2rem; max-width: 90rem; width: 100%; }
.page-head { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.page-head h1 { font-size: 1.3rem; display: flex; align-items: center; gap: 0.5rem; }
.page-head h1 svg { width: 1.5rem; height: 1.5rem; }
.page-head .spacer { flex: 1 1 auto; }
.period { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); }
.page-head .period { flex-basis: 100%; }   /* 見出し行の下の段に置く（デザイン: セレクト → 期間） */

/* 事業の切替 */
.biz-tabs { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; background: var(--line-weak); padding: 0.25rem; border-radius: 0.7rem; }
.biz-tabs button { min-height: 2.5rem; border: none; background: transparent; border-radius: 0.5rem; padding: 0.3em 1em; color: var(--muted); }
.biz-tabs button.active { background: var(--accent); color: #fff; }

/* タブ（画面内） */
.tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.8rem; }
.tabs button { min-height: 2.5rem; padding: 0.25em 0.9em; border-radius: 999px; font-size: 0.9rem; }
.tabs button.active { background: var(--accent-weak); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.tabs .n { font-size: 0.8rem; margin-left: 0.3em; background: #fff; border-radius: 999px; padding: 0 0.5em; }

/* ---------- カード ---------- */
.grid { display: grid; gap: 0.9rem; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.grid.counts { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.grid.tiles { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.grid.quick { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 0.9rem; padding: 1rem 1.1rem; min-width: 0; }
.card h2 { font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.card h2 .spacer { flex: 1 1 auto; }
.card h2 .more { font-size: 0.85rem; font-weight: 400; }
.stack { display: flex; flex-direction: column; gap: 0.9rem; }

/* ホーム: 人ごとの列 */
.grid.people { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.person.me { border-color: var(--accent); }
.p-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-bottom: 0.4rem; }
.p-name { font-weight: 700; font-size: 1.05rem; }
.p-counts { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.row.task { width: 100%; border-left: none; border-right: none; border-bottom: none; border-radius: 0; background: transparent; text-align: left; justify-content: flex-start; }
.row.task:hover { background: var(--line-weak); }
.row.task .date { flex: 0 0 3.2rem; }
.row.task .body { flex: 1 1 8rem; min-width: 0; }
.row.task .pill { flex: 0 0 auto; }
.row.task.overdue .date { color: var(--danger); font-weight: 700; }
.row.task .body .t { font-weight: 600; }
.row.task .body .s { font-size: 0.8rem; color: var(--muted); }
.row .sub { font-size: 0.8rem; color: var(--muted); display: block; }
.row .body .t { font-weight: 600; }
.row .meta { font-size: 0.85rem; color: var(--muted); text-align: right; flex: 0 0 auto; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; margin-bottom: 0.3rem; }
.chip-row .lbl { color: var(--muted); font-size: 0.9rem; flex: 0 0 2.5rem; }
details.fold > summary { cursor: pointer; min-height: 2.75rem; display: flex; align-items: center; font-weight: 600; list-style: none; }
details.fold > summary::before { content: '▸'; margin-right: 0.4em; color: var(--muted); }
details.fold[open] > summary::before { content: '▾'; }
.doc-ic { width: 2.4rem; height: 2.4rem; border-radius: 0.5rem; background: var(--danger-weak); color: var(--danger); display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; flex: 0 0 auto; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0.6rem; }
.thumbs a { display: block; aspect-ratio: 3 / 4; border: 1px solid var(--line); border-radius: 0.6rem; overflow: hidden; background: var(--line-weak); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .cap { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.grid.two-one { grid-template-columns: 2fr 1fr; }
@media (max-width: 68.75rem) { .grid.two-one { grid-template-columns: 1fr; } }
.pl { max-width: 40rem; }
.pl tr.bold td { font-weight: 700; border-top: 1px solid var(--line); }
.sp-only { display: none !important; }

.kpi .label { font-size: 0.85rem; color: var(--muted); }
.kpi .value { font-size: 1.6rem; font-weight: 700; line-height: 1.25; margin: 0.15em 0; }
.kpi .value .unit { font-size: 0.9rem; font-weight: 500; margin-left: 0.15em; }
.kpi .value, .count .value { font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 0.85rem; color: var(--muted); }
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--danger); }
.kpi.accent { border-left: 0.3rem solid var(--accent); }

.count { text-align: left; }
.count .label { font-size: 0.85rem; color: var(--muted); }
.count .value { font-size: 1.5rem; font-weight: 700; }
.count .value .unit { font-size: 0.9rem; font-weight: 500; margin-left: 0.15em; }
.count .note { font-size: 0.8rem; color: var(--danger); }

/* 進捗（工程ごとの件数） */
.stages { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stage { flex: 1 1 6rem; min-width: 6rem; text-align: center; border-radius: 0.7rem; padding: 0.6rem 0.4rem; background: var(--accent-weak); border: 1px solid transparent; }
.stage .label { font-size: 0.8rem; color: var(--muted); }
.stage .value { font-size: 1.4rem; font-weight: 700; }
.stage.s1 { background: #eef2f7; } .stage.s2 { background: var(--info-weak); } .stage.s3 { background: #e6f5ea; } .stage.s4 { background: var(--warn-weak); } .stage.s5 { background: var(--danger-weak); }
.stage button { width: 100%; min-height: 2.75rem; border: none; background: transparent; padding: 0; }

/* よく使う操作・会計のタイル */
.quick a, .quick button { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; min-height: 5.5rem; padding: 0.7rem 0.3rem; border: 1px solid var(--line); border-radius: 0.8rem; background: var(--panel); text-decoration: none; color: var(--text); font-size: 0.85rem; text-align: center; }
.quick .ic { width: 2.6rem; height: 2.6rem; border-radius: 0.7rem; background: var(--accent-weak); display: inline-flex; align-items: center; justify-content: center; }
.quick .ic svg { width: 1.4rem; height: 1.4rem; color: var(--accent-text); }
.tile { display: flex; flex-direction: column; gap: 0.4rem; min-height: 7.5rem; padding: 1rem; border: 1px solid var(--line); border-radius: 0.9rem; background: var(--panel); text-align: left; text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--accent); }
.tile .ic { width: 2.6rem; height: 2.6rem; border-radius: 0.7rem; background: var(--accent-weak); display: inline-flex; align-items: center; justify-content: center; }
.tile .ic svg { width: 1.4rem; height: 1.4rem; color: var(--accent-text); }
.tile .t { font-weight: 700; }
.tile .d { font-size: 0.85rem; color: var(--muted); }

/* 一覧 */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; padding: 0.55rem 0; border-top: 1px solid var(--line-weak); min-height: 2.75rem; }
.row:first-child { border-top: none; }
.row .date { flex: 0 0 5.5rem; color: var(--muted); font-size: 0.9rem; }
.row .body { flex: 1 1 10rem; min-width: 0; }
.row .amount { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.pill { display: inline-block; font-size: 0.8rem; padding: 0.1em 0.6em; border-radius: 999px; background: #eef2f7; color: var(--text); white-space: normal; }
.pill.p-info { background: var(--info-weak); color: var(--info); }
.pill.p-ok { background: var(--ok-weak); color: var(--ok); }
.pill.p-warn { background: var(--warn-weak); color: var(--warn); }
.pill.p-danger { background: var(--danger-weak); color: var(--danger); }
.pill.p-fudosan { background: var(--fudosan-weak); color: #166534; }
.pill.p-digital { background: var(--digital-weak); color: #1b2440; }
.pill.p-service3 { background: #fdf1e1; color: #92400e; }
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.chips button { min-height: 2.5rem; padding: 0.2em 0.8em; border-radius: 999px; font-size: 0.85rem; }
.chips button.active { background: var(--accent-weak); border-color: var(--accent); color: var(--accent-text); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.tbl th, table.tbl td { text-align: left; padding: 0.55rem 0.5rem; border-top: 1px solid var(--line-weak); vertical-align: top; }
table.tbl th { color: var(--muted); font-weight: 600; font-size: 0.85rem; border-top: none; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tr.clickable { cursor: pointer; }
table.tbl tr.clickable:hover td { background: var(--line-weak); }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.8rem; }
.toolbar input[type=search] { flex: 1 1 14rem; }
.empty { color: var(--muted); padding: 1rem 0; text-align: center; }

/* ---------- 図（インラインSVG） ---------- */
.viz { position: relative; }
.viz svg { width: 100%; height: auto; display: block; }
.viz .viz-svg { min-height: 12rem; }
.viz .axis text { fill: var(--muted); }
.viz .grid line { stroke: var(--line-weak); stroke-width: 1; }
.viz .lbl { fill: var(--text); font-weight: 600; }
.viz .hit { fill: transparent; }
.viz .col { fill: transparent; }
.viz .col.on { fill: var(--line-weak); }
.viz .hit:hover + .bar, .viz .bar.on { opacity: 0.8; }
.legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.85rem; color: var(--muted); margin: 0.3rem 0; }
.legend .k { display: inline-flex; align-items: center; gap: 0.35rem; }
.legend .sw { width: 0.8rem; height: 0.8rem; border-radius: 0.2rem; display: inline-block; }
.legend .ln { width: 1rem; height: 0; border-top: 2px solid; display: inline-block; }
.legend .v { color: var(--text); font-weight: 600; margin-left: 0.2em; }
.tip { position: absolute; pointer-events: none; background: #1a2233; color: #fff; font-size: 0.8rem; padding: 0.4rem 0.6rem; border-radius: 0.4rem; white-space: normal; max-width: 14rem; z-index: 3; }
.tip .v { font-weight: 700; font-size: 0.9rem; }
.tip .k { display: inline-block; width: 0.8rem; border-top: 2px solid; margin-right: 0.3em; vertical-align: middle; }
.share { display: flex; flex-direction: column; gap: 0.6rem; }
.share .bar { display: flex; /* 構成比の帯。折り返さない */ height: 1.6rem; border-radius: 0.4rem; overflow: hidden; gap: 2px; background: var(--line-weak); }
.share .seg { min-width: 0.25rem; }
.share .items { display: flex; flex-direction: column; gap: 0.3rem; }
.share .item { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.9rem; }
.share .item .sw { width: 0.8rem; height: 0.8rem; border-radius: 0.2rem; }
.share .item .pct { font-weight: 700; margin-left: auto; font-variant-numeric: tabular-nums; }
.share .item .amt { color: var(--muted); font-variant-numeric: tabular-nums; }
.share .total { font-size: 0.85rem; color: var(--muted); }
.viz-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.3rem; }
.viz-foot button { min-height: 2.5rem; }
.viz-table { margin-top: 0.5rem; overflow-x: auto; }

/* ---------- スマホ ---------- */
.bottom { display: none; }
@media (max-width: 56rem) {
  .side { display: none; }
  .top { padding: 0.6rem 0.9rem; }
  body[data-view="home"] .top .title .logo-h { display: block; }
  body[data-view="home"] .top .title .names { display: none; }
  .top .name { font-size: 1rem; }
  .top .sub { display: none !important; }
  .top .top-extra { flex-basis: 100%; order: 9; }
  .top .top-extra input[type=search] { width: 100%; max-width: none; }
  .pc-only { display: none !important; }
  .sp-only { display: flex !important; }
  .content { padding: 0.8rem 0.9rem 5.5rem; }
  .grid.kpi { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .grid.kpi .card { padding: 0.8rem 0.8rem; }
  .kpi .value { font-size: 1.2rem; }
  .biz-badge { display: none; }
  .bottom {
    display: flex; /* 下メニュー4つ。折り返さない */ position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--panel); border-top: 1px solid var(--line);
    padding: 0.25rem 0.3rem calc(0.25rem + env(safe-area-inset-bottom));
  }
  .bottom button { flex: 1 1 0; min-height: 3.25rem; border: none; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; font-size: 0.75rem; color: var(--muted); border-radius: 0.5rem; }
  .bottom button.active { color: var(--accent-text); font-weight: 700; }
  .bottom button svg { width: 1.3rem; height: 1.3rem; }
  .footer-credit { margin-bottom: 0.5rem; }
}
.devbar { background: #fff3d1; color: #7a4f00; padding: 0.4rem 0.9rem; font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.devbar select { min-height: 2.5rem; }
/* デモサイトの帯（shell.js の demoBar）。44px 以上のタップ領域 */
.devbar.demobar { background: #1e2a5a; color: #fff; padding: 0.5rem 0.9rem; gap: 0.5rem 0.9rem; line-height: 1.4; }
.devbar.demobar strong { background: #ffd166; color: #3b2a00; border-radius: 0.4rem; padding: 0.15em 0.6em; font-size: 0.85rem; }
.devbar.demobar .demo-who { display: inline-flex; align-items: center; gap: 0.4em; }
.devbar.demobar select { min-height: 2.75rem; border-radius: 0.5rem; border: 1px solid #c9d3e6; background: #fff; color: #1a2233; padding: 0.3em 0.6em; font-size: 0.95rem; }
.devbar.demobar button { min-height: 2.75rem; padding: 0.3em 0.9em; border-radius: 0.5rem; border: 1px solid #c9d3e6; background: transparent; color: #fff; font-size: 0.9rem; }
.loading { color: var(--muted); padding: 1.5rem 0; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 5rem; transform: translateX(-50%); background: #1a2233; color: #fff; padding: 0.6rem 1rem; border-radius: 0.6rem; z-index: 20; max-width: 90vw; }
.toast.err { background: var(--danger); }
.side nav a.ext { display: flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; padding: 0.45em 0.8em; color: inherit; text-decoration: none; border-radius: 0.5rem; font-size: 0.9rem; opacity: 0.85; margin-top: 0.5rem; border-top: 1px solid rgba(255,255,255,0.1); }
.side nav a.ext svg { width: 1.15rem; height: 1.15rem; }
.btn-link { display: inline-flex; align-items: center; gap: 0.3em; min-height: 2.75rem; padding: 0.35em 0.9em; border: 1px solid var(--line); border-radius: 0.5rem; text-decoration: none; color: inherit; background: var(--panel); }
.btn-link.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-link svg { width: 1.1rem; height: 1.1rem; }
.footer-credit { text-align: center; font-size: 0.8rem; color: var(--faint); padding: 1.5rem 0 0.5rem; }

/* ---------- アプリ管理（受信箱・顧客台帳・アプリ一覧。2026-10-21） ---------- */
.row.notice { align-items: flex-start; }
.row.notice .body .t { display: block; margin: 0.15rem 0; }
.row.read .body, .row.dim .body, .card.dim { opacity: 0.6; }
.sub.pre { white-space: pre-wrap; }   /* 通知の本文は改行を保つ（折り返しはする） */
.actions { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.btn-link.small { font-size: 0.85rem; padding: 0.25em 0.7em; min-height: 2.5rem; }
.btn-link svg { flex: 0 0 auto; }
dl.info { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.8rem; margin: 0.4rem 0 0; font-size: 0.95rem; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; min-width: 0; }
@media (max-width: 30rem) { dl.info { grid-template-columns: 1fr; } dl.info dt { margin-top: 0.3rem; } }
details.fold.group { border-top: 1px solid var(--line-weak); padding-top: 0.3rem; }
details.fold.group > summary { gap: 0.4rem; flex-wrap: wrap; }
details.fold.group > .list { padding-left: 1.2rem; }
.count .value.alert { color: var(--danger); }
.tabs button svg { width: 1rem; height: 1rem; vertical-align: -0.15em; }
