/* 管理画面 Atlas の見た目。output/admin-mock.html の <style> の写し（見た目の正はモック）。末尾に、サーバーで描く画面のための足しを置く */
:root {
  color-scheme: light only;
  --accent: #2a55a3;
  --accent-strong: #213f7a;
  --accent-soft: #edf1f9;
  --accent-line: #c2d0ea;
  --text: #1f2328;
  --muted: #59636e;
  --line: #e1e5ea;
  --surface: #f5f6f8;
  --white: #ffffff;
  --line-green: #06c755;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px -4px rgba(42, 85, 163, 0.14);
  --sh-3: 0 24px 64px -24px rgba(42, 85, 163, 0.35), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  /* 状態の色（意味ごとに分ける。注意の黄は文字に使わない） */
  --ok: #0ca30c;
  --caution: #fab219;
  --warn: #ec835a;
  --fail: #d03b3b;
  /* グラフの系列の色（順番で固定。絞り込みで塗り替えない） */
  --s1: #2a6fd6;
  --s2: #a8327e;
  --s3: #00a0a8;
  --s4: #7a45d0;
  --side-w: 232px;
  --top-h: 64px;
  --font: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--white); }
body { margin: 0; min-width: 1280px; background: var(--white); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.65; -webkit-font-smoothing: antialiased; word-break: auto-phrase; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.ic--s { width: 16px; height: 16px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- モックの台紙（実装しない） ---------- */
.board-note { display: flex; align-items: center; gap: 16px; padding: 8px 24px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.board-note strong { color: var(--text); font-weight: 700; }

/* ---------- 上の帯 ---------- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 16px; padding: 0 16px 0 20px; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: calc(var(--side-w) - 20px); margin-right: 16px; flex: none; }
.period { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface); border-radius: var(--r-pill); }
.period button { min-width: 60px; height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.period button[aria-pressed="true"] { background: var(--white); color: var(--accent); box-shadow: var(--sh-1); }
.period-wrap[hidden] { display: none; }
.period-wrap { display: flex; align-items: center; gap: 10px; flex: none; }
.period-wrap > span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.top-right { margin-left: auto; min-width: 0; display: flex; align-items: center; gap: 4px; }
.icon-btn { position: relative; width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface); color: var(--text); }
.icon-btn .dot { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--fail); box-shadow: 0 0 0 2px var(--white); }
.me { display: flex; align-items: center; gap: 10px; height: 44px; min-width: 0; padding: 0 8px 0 12px; margin-left: 8px; }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.me-name { min-width: 0; font-size: 13px; line-height: 1.35; }
.me-name b { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.me-name small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- 左のメニュー ---------- */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.side { position: sticky; top: var(--top-h); align-self: start; height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 12px 12px 32px; border-right: 1px solid var(--line); background: var(--white); }
.nav-group { margin-top: 14px; padding: 0 12px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.nav-group:first-child { margin-top: 0; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-size: 14px; }
.nav a:hover { background: var(--surface); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav a .ic { color: var(--muted); }
.nav a[aria-current="page"] .ic { color: var(--accent); }
.nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: var(--r-pill); background: var(--accent); color: var(--white); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 本文 ---------- */
.main { min-width: 0; padding: 28px 32px 64px; }
.screen { display: none; }
.screen.is-on { display: block; }
.ph { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.ph h1 { font-size: 22px; line-height: 1.4; letter-spacing: -0.01em; }
.ph .lead { margin-top: 4px; color: var(--muted); max-width: 760px; }
.ph-act { display: flex; gap: 8px; flex: none; }
.stack { display: grid; gap: 24px; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.cols-2--wide-left { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); padding: 20px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; min-height: 44px; }
.card-h h2 { font-size: 16px; line-height: 1.4; }
.card-h .sub { color: var(--muted); font-size: 13px; }
.card--flush { padding: 0; }
.card--flush > .card-h { padding: 20px 20px 0; box-sizing: content-box; margin-bottom: 8px; }
h3 { font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 13px; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--white); }
.btn--primary:hover { background: var(--accent-strong); }
.btn--quiet { border-color: transparent; color: var(--accent); padding: 0 12px; }
.btn--quiet:hover { background: var(--accent-soft); }
.btn--sm { min-height: 44px; padding: 0 12px; font-size: 13px; }

/* 札（縁の線の無い小さな札） */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; vertical-align: middle; }
.badge .ic { width: 14px; height: 14px; }
.badge--line { background: #e3f7eb; color: #04703a; }
.badge--mail { background: var(--accent-soft); color: var(--accent-strong); }
.badge--consult { background: #f0ecfb; color: #553599; }
.badge--yt { background: var(--surface); color: var(--text); }
.badge--auto { background: var(--surface); color: var(--muted); }
/* 状態の札（チャネルの札と別の系統。返事待ちは警告の橙） */
.badge--wait { background: var(--white); box-shadow: inset 0 0 0 1px var(--warn); color: #9a3d14; }
.badge--wait .ic { color: var(--warn); }
.badge--sched { background: var(--surface); color: var(--text); }
.badge--tag { background: var(--surface); color: var(--text); font-weight: 500; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
/* 列の先頭に札を置く時は、札の内側の余白ぶんを打ち消して文字の左端をそろえる */
td > .badge:first-child, td > .badges:first-child, td > .st:first-child .badge,
dd > .badge:first-child, dd > .badges:first-child, h3 + .badges, .ib-person-top > .badge:first-child { margin-left: -8px; }

/* 状態（アイコン＋文字。色だけで伝えない） */
.st { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.st--ok .ic { color: var(--ok); }
.st--warn .ic { color: var(--warn); }
.st--fail .ic { color: var(--fail); }
.st--fail { color: var(--fail); font-weight: 600; }
.st--off .ic { color: var(--muted); }
.st--off { color: var(--muted); }

/* 表 */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { height: 44px; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
tr.is-click { cursor: pointer; }
tr.is-click:hover td { background: #fafbfc; }
tr.is-sel td { background: var(--accent-soft); }
.card--flush table th:first-child, .card--flush table td:first-child { padding-left: 20px; }
.card--flush table th:last-child, .card--flush table td:last-child { padding-right: 20px; }
.td-act { width: 1%; white-space: nowrap; text-align: right; }
.td-act .btn { margin: -6px 0; }
.em { font-weight: 600; }
.sum-row td { font-weight: 700; background: #fafbfc; }

/* 数字の札 */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; background: var(--white); }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi-value { margin-top: 6px; display: flex; align-items: baseline; gap: 4px; font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 600; color: var(--muted); }
.kpi-delta { margin-top: 8px; display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kpi-delta .ic { width: 16px; height: 16px; }
.kpi-delta.up .ic { color: var(--ok); }
.kpi-delta.down .ic { color: var(--fail); }
.kpi-delta b { color: var(--text); font-weight: 700; }

/* 今やること */
.todo li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 150px 140px auto; align-items: center; gap: 14px; min-height: 60px; padding: 8px 20px; border-top: 1px solid var(--line); }
.todo li:first-child { border-top: 0; }
.todo .todo-text { font-weight: 500; }
.todo .todo-text small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.todo .todo-due { font-size: 13px; font-variant-numeric: tabular-nums; }
.todo .todo-due small { display: block; color: var(--muted); font-size: 12px; }

/* 切り替え（タブ型） */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-sm); background: var(--surface); flex-wrap: wrap; }
.seg button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--white); color: var(--text); box-shadow: var(--sh-1); }
.seg-wrap { display: flex; align-items: center; gap: 12px; }

/* グラフ */
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.legend { display: flex; gap: 18px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 18px; height: 0; border-top: 2px solid; display: inline-block; }
.chart { position: relative; margin-top: 12px; }
.chart svg { display: block; width: 100%; height: 300px; overflow: visible; }
.chart .grid line { stroke: #eceff3; stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .end-label { fill: var(--text); font-size: 12.5px; font-weight: 600; }
.chart .end-label tspan.v { font-weight: 700; font-variant-numeric: tabular-nums; }
.chart .hover-line { stroke: #9aa3ad; stroke-width: 1; stroke-dasharray: 3 3; }
.tip { position: absolute; pointer-events: none; min-width: 168px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); box-shadow: var(--sh-3); font-size: 13px; display: none; z-index: 5; }
.tip b { display: block; margin-bottom: 4px; }
.tip div { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.tip div span:last-child { margin-left: auto; font-weight: 700; padding-left: 12px; }
.tip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chart-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.chart-table { margin: 12px 0; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.chart-table th { position: sticky; top: 0; }
.chart-table--dense th, .chart-table--dense td { padding: 8px; font-size: 12.5px; }

/* 道筋（横棒） */
.funnel li { display: grid; grid-template-columns: 132px minmax(0, 1fr) 72px 88px; align-items: center; gap: 12px; min-height: 48px; }
.funnel-name { font-size: 13.5px; font-weight: 600; }
.funnel-bar { height: 22px; background: #dbe6f6; border-radius: 4px; overflow: hidden; }
.funnel-bar i { display: block; height: 100%; min-width: 3px; background: var(--s1); border-radius: 4px; }
.funnel-num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-rate { text-align: right; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.funnel--big li { grid-template-columns: 180px minmax(0, 1fr) 96px 120px; min-height: 60px; }
.funnel--big .funnel-bar { height: 30px; }
.funnel--big .funnel-name { font-size: 14px; }
.funnel--big .funnel-num { font-size: 18px; }
.funnel-head { display: grid; grid-template-columns: 132px minmax(0, 1fr) 72px 88px; gap: 12px; font-size: 12px; color: var(--muted); padding-bottom: 4px; }
.funnel--big + .funnel-head, .funnel-head--big { grid-template-columns: 180px minmax(0, 1fr) 96px 120px; }
.funnel-head span:nth-child(3), .funnel-head span:nth-child(4) { text-align: right; }

/* 一覧（受信箱の新着・稼働状況） */
.rows li { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 20px; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows a { color: inherit; text-decoration: none; }
.msg-row { display: grid !important; grid-template-columns: 96px minmax(0, 1fr) 56px; cursor: pointer; }
.msg-row:hover { background: #fafbfc; }
.msg-row .who { font-weight: 600; }
.msg-row .sum { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-row .time { color: var(--muted); font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.health-row { display: grid !important; grid-template-columns: minmax(0, 1fr) 110px 120px; }
.health-row .time { color: var(--muted); font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }

/* 受信箱 */
.inbox { display: grid; grid-template-columns: 208px 352px minmax(0, 1fr); min-height: 680px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.inbox > * { min-width: 0; }
.ib-filter { padding: 16px 12px; border-right: 1px solid var(--line); background: var(--white); }
.ib-filter h2 { padding: 0 12px; margin: 4px 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ib-filter h2 + ul { margin-bottom: 16px; }
.ib-filter button { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: transparent; text-align: left; cursor: pointer; font-size: 14px; }
.ib-filter button:hover { background: var(--surface); }
.ib-filter button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.ib-filter button .n { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; font-weight: 500; }
.ib-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 760px; }
.ib-list-h { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ib-item { display: block; width: 100%; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--line); background: var(--white); text-align: left; cursor: pointer; }
.ib-item:hover { background: #fafbfc; }
.ib-item[aria-selected="true"] { background: var(--accent-soft); }
.ib-item-top { display: flex; align-items: center; gap: 8px; }
.ib-item-top .who { font-weight: 700; }
.ib-item-top .time { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ib-item p { margin-top: 4px; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ib-item .badges { margin-top: 8px; }
.ib-detail { display: flex; flex-direction: column; background: var(--white); }
.ib-person { padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ib-person-top { display: flex; align-items: center; gap: 12px; }
.ib-person-top .who { font-size: 16px; font-weight: 700; }
.ib-person-top .btn { margin-left: auto; }
.ib-facts { margin-top: 10px; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 6px 12px; font-size: 13px; }
.ib-facts dt { color: var(--muted); }
.ib-thread { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; background: var(--surface); }
.bubble small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.bubble--me { align-self: flex-end; background: var(--accent-soft); }
.bubble-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); align-self: flex-end; }
.ib-reply { padding: 16px 20px; border-top: 1px solid var(--line); }
.ib-reply label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
textarea, input[type="text"], input[type="number"], input[type="search"], select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); font-size: 14px; }
textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent-line); outline-offset: 0; border-color: var(--accent); }
.ib-reply-foot { margin-top: 10px; display: flex; align-items: center; gap: 12px; }
.ib-reply-foot .note { margin-right: auto; }

/* 絞り込みの帯 */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.search { position: relative; width: 300px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input { padding-left: 38px; }
.toolbar select { width: auto; min-width: 150px; }
.toolbar .spacer { margin-left: auto; }
.toolbar .count-text { color: var(--muted); font-size: 13px; }

/* 右から出る板 */
.drawer-back { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.18); z-index: 40; display: none; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; z-index: 41; background: var(--white); box-shadow: var(--sh-3); transform: translateX(100%); visibility: hidden; transition: transform 0.22s ease, visibility 0s linear 0.22s; display: flex; flex-direction: column; }
.drawer.is-open { transform: none; visibility: visible; transition: transform 0.22s ease; }
.drawer-back.is-open { display: block; }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 24px; border-bottom: 1px solid var(--line); }
.drawer-h h2 { font-size: 18px; }
.drawer-h .icon-btn { margin-left: auto; }
.drawer-b { flex: 1; overflow-y: auto; padding: 20px 24px 32px; display: grid; gap: 22px; align-content: start; }
.dl { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px 12px; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.timeline li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.timeline li:first-child { border-top: 0; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }

/* タグと区分 */
.tag-list li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 20px; border-top: 1px solid var(--line); }
.tag-list li:first-child { border-top: 0; }
.tag-list .n { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.tag-sec { padding: 10px 20px 6px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.builder { display: grid; gap: 10px; }
.cond { display: grid; grid-template-columns: 56px minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.cond .join { font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; }
.builder-foot { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.builder-foot .hit { margin-right: auto; font-size: 14px; }
.builder-foot .hit b { font-size: 20px; font-variant-numeric: tabular-nums; }

/* QR の板 */
.qr-panel { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 20px; align-items: start; }
.qr-panel svg { width: 168px; height: 168px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; background: var(--white); }
.url-box { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 13px; word-break: break-all; }
.url-box span { flex: 1; }

/* LINE の通数の帯 */
.quota-bar { position: relative; display: flex; height: 28px; margin-top: 14px; border-radius: 6px; overflow: hidden; background: var(--surface); }
.quota-bar .used { background: var(--s1); }
.quota-bar .free { background: #b9d3f2; }
.quota-bar .reserve { background: repeating-linear-gradient(135deg, #d9dee5 0 6px, #eef1f4 6px 12px); }
.quota-legend { display: flex; gap: 28px; margin-top: 12px; font-size: 13px; flex-wrap: wrap; }
.quota-legend span { display: inline-flex; align-items: center; gap: 8px; }
.quota-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.quota-legend b { font-variant-numeric: tabular-nums; }
.quota-top { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.quota-top .big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.quota-top .quota-sub { margin-left: -12px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.quota-cap { margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.quota-bar--thin { height: 8px; margin-top: 6px; border-radius: 4px; }
.quota-zoom { position: relative; display: flex; height: 36px; margin-top: 6px; margin-bottom: 36px; }
.quota-zoom > span:not(.edge) { display: flex; align-items: center; padding: 0 12px; font-size: 12.5px; }
.quota-zoom .free { background: #b9d3f2; border-radius: 6px 0 0 6px; }
.quota-zoom .reserve { background: repeating-linear-gradient(135deg, #d9dee5 0 6px, #eef1f4 6px 12px); border-radius: 0 6px 6px 0; justify-content: flex-end; }
.quota-zoom b { font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, 0.85); padding: 1px 6px; border-radius: 4px; }
.quota-zoom .edge { position: absolute; top: -6px; bottom: -6px; width: 0; border-right: 2px solid var(--text); }
.quota-zoom .edge em { position: absolute; top: 100%; left: 0; transform: translateX(-50%); margin-top: 4px; font-style: normal; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* リッチメニュー */
.rm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.rm-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.rm-card h2 { font-size: 15px; }
.rm-card .people { margin-top: 2px; color: var(--muted); font-size: 13px; }
.rm-card .people b { color: var(--text); font-variant-numeric: tabular-nums; font-size: 15px; }
.rm-phone { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--white); }
.rm-chat { height: 56px; background: var(--surface); display: flex; align-items: center; padding: 0 12px; }
.rm-chat i { display: block; width: 60%; height: 14px; border-radius: 7px; background: #e3e7ec; }
.rm-areas { display: grid; gap: 2px; background: var(--line); }
.rm-areas div { background: #fbfcfd; min-height: 64px; padding: 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.rm-areas div small { margin-top: 2px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.rm-areas--6 { grid-template-columns: repeat(3, 1fr); }
.rm-areas--3 { grid-template-columns: repeat(3, 1fr); }
.rm-areas--wide { grid-template-columns: 2fr 1fr; }
.rm-bar { height: 22px; border-top: 1px solid var(--line); background: var(--white); display: grid; place-items: center; font-size: 11px; color: var(--muted); }

/* SNS の札 */
.acct { border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; }
.acct-h { display: flex; align-items: center; gap: 10px; }
.acct-h b { font-size: 15px; }
.acct-h span { color: var(--muted); font-size: 13px; }
.acct-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.acct-stats dt { font-size: 12.5px; color: var(--muted); }
.acct-stats dd { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mono-mark { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); font-size: 13px; font-weight: 700; color: var(--text); }

/* 権限の表 */
.perm td:not(:first-child), .perm th:not(:first-child) { text-align: center; width: 140px; }
.perm .yes { color: var(--ok); }
.perm .no { color: var(--muted); }

/* 設定 */
.set-row { display: grid; grid-template-columns: 240px minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row .label b { display: block; }
.set-row .label small { display: block; color: var(--muted); font-size: 12.5px; }
.inline-input { display: flex; align-items: center; gap: 8px; }
.inline-input .btn { white-space: nowrap; }
.inline-input input[type="number"] { width: 120px; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.split .card { position: sticky; top: calc(var(--top-h) + 16px); }
.bars-mini li { display: grid; grid-template-columns: 24px minmax(0, 1fr) 64px; align-items: center; gap: 10px; min-height: 40px; padding: 0 20px; border-top: 1px solid var(--line); font-size: 13.5px; }
.bars-mini li:first-child { border-top: 0; }
.bars-mini .rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.bars-mini .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bars-mini .kw { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bars-mini .kw span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars-mini .kw i { flex: none; height: 6px; border-radius: 3px; background: var(--s1); opacity: 0.55; }
.info { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface); font-size: 13.5px; }
.info .ic { color: var(--muted); margin-top: 1px; }

/* ---------- Atlas で足したもの ---------- */
.brand { gap: 10px; }
.brand-logo { width: 34px; height: 34px; display: block; flex: none; }
.brand b { font-size: 18px; font-weight: 700; letter-spacing: 0.01em; }
.top-sw { display: flex; align-items: center; gap: 10px; flex: none; }
.top-sw > span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.period-wrap.is-off .period button { color: #a3abb4; cursor: not-allowed; }
.period-wrap.is-off .period button[aria-pressed="true"] { background: transparent; box-shadow: none; color: #a3abb4; }
.vsep { width: 1px; height: 32px; background: var(--line); margin: 0 4px 0 8px; }
.me-btn { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; cursor: pointer; text-align: left; }
.me-btn:hover { background: var(--surface); }
.pop { position: absolute; top: calc(100% + 6px); right: 0; min-width: 260px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); box-shadow: var(--sh-3); z-index: 50; }
.pop[hidden] { display: none; }
.pop h2 { padding: 8px 12px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pop button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: transparent; cursor: pointer; text-align: left; font-size: 14px; }
.pop button:hover { background: var(--surface); }
.pop button[aria-checked="true"] { color: var(--accent); font-weight: 700; }
.pop button .ic { visibility: hidden; color: var(--accent); }
.pop button[aria-checked="true"] .ic { visibility: visible; }
.pop p { padding: 4px 12px 8px; font-size: 12.5px; color: var(--muted); }
.rel { position: relative; }

/* チャネルの札（文字＋アイコン＋チャネルの色の点。後半の4つは輪の点で、グラフの点線と対になる） */
.badge--ch { background: var(--surface); color: var(--text); gap: 5px; }
.chdot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }
.chdot--ring { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.badge--kind { background: var(--white); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-weight: 500; }

/* 絞り込みのチップ（チャネルの共通部品もこれ） */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--white); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip:hover { background: var(--surface); }
.chip .ic { width: 16px; height: 16px; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-strong); }
.chip[aria-pressed="true"] .ic { color: var(--accent); }
.chip.is-off { color: var(--muted); border-style: dashed; font-weight: 500; }
.chip .n { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.filters { display: grid; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.filters-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filters-row > .lbl { width: 64px; flex: none; font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* タブ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button { min-height: 44px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* 見本の状態（モックだけの切り替え） */
.mock-st { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.mock-st select { width: auto; min-width: 190px; font-size: 13px; }
.st-panel { display: grid; justify-items: center; gap: 10px; padding: 72px 24px; border: 1px solid var(--line); border-radius: var(--r-md); text-align: center; }
.st-panel > .ic { width: 36px; height: 36px; color: var(--muted); stroke-width: 1.5; }
.st-panel h2 { font-size: 17px; }
.st-panel p { max-width: 520px; color: var(--muted); text-wrap: balance; }
.st-panel .btn { margin-top: 6px; }
.st-inline { padding: 40px 24px; border: 0; }
.skel { border-radius: var(--r-sm); background: linear-gradient(90deg, #eef1f4 0%, #f7f8fa 40%, #eef1f4 80%); background-size: 200% 100%; animation: skel 1.4s linear infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skel-grid { display: grid; gap: 16px; }
.skel-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 通数 */
.quota-rows { display: grid; gap: 18px; }
.quota-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; align-items: start; }
.quota-row + .quota-row { padding-top: 18px; border-top: 1px solid var(--line); }
.quota-name b { display: block; font-size: 14px; }
.quota-name small { display: block; color: var(--muted); font-size: 12.5px; }
.quota-nums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.quota-nums dt { font-size: 12.5px; color: var(--muted); }
.quota-nums dd { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.quota-nums dd small { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.quota-bar .resv { background: repeating-linear-gradient(135deg, #8fb6e8 0 5px, #b9d3f2 5px 10px); }
.quota-bar { height: 12px; margin-top: 12px; border-radius: 4px; }
.quota-legend { margin-top: 10px; gap: 20px; font-size: 12.5px; }
.quota-mini { display: grid; gap: 12px; padding: 4px 20px 18px; }
.quota-mini .q-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.quota-mini .q-line b { font-size: 18px; font-variant-numeric: tabular-nums; }

/* 受信箱（一覧・会話・その人の情報） */
.ib3 { display: grid; grid-template-columns: 316px minmax(0, 1fr) 292px; min-height: 700px; }
.ib3 > * { min-width: 0; }
.ib3 .ib-list { max-height: 820px; }
.ib-conv { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.ib-conv-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.ib-conv-h .who { font-size: 16px; font-weight: 700; margin-right: auto; }
.ib-conv-h select { width: auto; min-width: 140px; }
.ib-conv-h label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ib-window { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ib-window.is-over { color: var(--fail); font-weight: 600; }
.ib-side { padding: 16px 20px; display: grid; gap: 18px; align-content: start; background: var(--white); }
.ib-side .dl { grid-template-columns: 96px minmax(0, 1fr); font-size: 13px; }
.ib-reply textarea[disabled], .btn[aria-disabled="true"] { background: var(--surface); color: var(--muted); cursor: not-allowed; }
.btn--primary[aria-disabled="true"] { background: #9fb1d3; border-color: #9fb1d3; color: var(--white); }
.cost-note { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.cost-note .ic { width: 14px; height: 14px; }

/* 発信の予定表 */
.cal-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.cal-h h2 { font-size: 16px; min-width: 190px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 196px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal--month .cal-day { min-height: 112px; }
.cal-day.is-out { background: #fafbfc; }
.cal-day.is-out .cal-date { color: #a3abb4; }
.cal-date { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 0 2px; }
.cal-day.is-today .cal-date span { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent); color: var(--white); }
.cal-item { display: grid; gap: 2px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); text-align: left; cursor: pointer; font-size: 12.5px; line-height: 1.45; min-height: 44px; }
.cal-item:hover { background: var(--surface); }
.cal-item .t { font-variant-numeric: tabular-nums; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.cal-item .t .ic { width: 14px; height: 14px; }
.cal-item .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-item.is-draft { border-style: dashed; }
.cal-more { font-size: 12px; color: var(--muted); padding: 0 2px; }
.ch-icons { display: inline-flex; gap: 3px; align-items: center; }

/* 作成の板 */
.drawer--wide { width: 680px; }
.field { display: grid; gap: 6px; }
.field > label, .field > .flabel { font-size: 13px; font-weight: 600; }
.field .help { font-size: 12.5px; color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; font-weight: 600; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.check.is-off { color: var(--muted); border-style: dashed; cursor: not-allowed; font-weight: 500; }
.radios { display: flex; gap: 6px; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.drawer-f { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); }
.drawer-f .note { margin-right: auto; }

/* 自動の決まり */
.flow { display: grid; gap: 12px; }
.flow-step { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; display: grid; gap: 10px; }
.flow-step h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.flow-step h3 .num-c { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 700; }
.flow-arrow { justify-self: center; color: var(--muted); }
.flow-arrow .ic { transform: rotate(45deg); }
.act-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.act-row .btn { white-space: nowrap; }
.form-narrow { max-width: 640px; }
.rm-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 分析 */
.heat { display: grid; grid-template-columns: 40px repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; position: relative; }
.heat .hl { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.heat .hc { height: 28px; border-radius: 4px; }
.heat .hx { font-size: 11px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.heat-scale { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.heat-scale i { width: 160px; height: 10px; border-radius: 3px; background: linear-gradient(90deg, #f5f6f8, #2a55a3); display: inline-block; }
.chart .bar-label { fill: var(--text); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart .bar-sub { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .bar-name { fill: var(--text); font-size: 13px; font-weight: 600; }
.legend i.dash { border-top-style: dashed; }
.ch-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-value .na { font-size: 20px; color: var(--muted); font-weight: 600; }
.cmp-up { color: #08770b; font-weight: 600; }
.cmp-down { color: var(--fail); font-weight: 600; }
.hidden-amt { color: var(--muted); font-weight: 500; }
.kpi .hidden-amt { font-size: 16px; }
.exp-near { color: #9a3d14; font-weight: 600; }
/* 足りなかった部品 */
.ph-btns { display: inline-flex; gap: 8px; }
.ph-btns:empty { display: none; }
.chartbox { position: relative; }
.conn-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.conn-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.xcell { display: block; margin: -8px -10px; padding: 8px 10px; border-radius: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.msg-row--ch { grid-template-columns: 120px minmax(0, 1fr) auto; }
.msg-row--ch > .badge { justify-self: start; }
.msg-row--ch .sum { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart .bar { transition: opacity .15s; }
.nav .count[hidden] { display: none; }
.quota-nums dd { white-space: nowrap; }
[hidden] { display: none !important; }
/* 今やること: 列を全行でそろえる */
.todo { display: grid; grid-template-columns: 44px minmax(0, 1fr) 150px 140px 156px; column-gap: 14px; }
.todo li { grid-column: 1 / -1; grid-template-columns: subgrid; gap: 0; column-gap: 14px; }
.todo .todo-btn { justify-self: end; min-width: 136px; justify-content: center; }
/* 設定のつながりの表: 事業ごとの表で列の幅をそろえる */
table.tbl-conn, table.tbl-conn2 { table-layout: fixed; width: 100%; }
.tbl-conn th:nth-child(1) { width: 190px; }
.tbl-conn th:nth-child(2) { width: 22%; }
.tbl-conn th:nth-child(3) { width: 180px; }
.tbl-conn th:nth-child(5), .tbl-conn2 th:nth-child(4) { width: 184px; }
.tbl-conn2 th:nth-child(1) { width: 190px; }
.tbl-conn2 th:nth-child(3) { width: 180px; }
.tbl-conn .td-act .btn, .tbl-conn2 .td-act .btn { min-width: 144px; justify-content: center; }
/* LINE の通数: 見出しは折り返さず、帯と同じ並び */
.quota-nums { grid-template-columns: minmax(max-content, 1fr) minmax(max-content, 1fr) minmax(max-content, 1.5fr) minmax(max-content, 0.8fr) minmax(max-content, 0.9fr); }
.quota-nums > div:last-child { text-align: right; }
.quota-nums dt { white-space: nowrap; }
.quota-rows--stack .quota-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.quota-rows--stack .quota-name { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.quota-rows--stack .quota-name small { display: inline; }
/* 受信箱: 担当と状態は1つの組で折り返す。DM の残り時間は時刻の横 */
.ib-conv-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.ib-conv-ctl select { min-width: 120px; }
.ib-item-top .ib-win { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.ib-item-top .ib-win .ic, .ib-item-top .ib-win svg { width: 14px; height: 14px; }
.ib-item-top .ib-win + .time { margin-left: 0; }

/* ---------------------------------------------------------------- サーバーで描く画面のための足し */
/* インラインの style を CSP で止めているので、モックで style 属性にしていたものを型にする */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.chdot--line { --c: #2a6fd6; }
/* 事業の切り替えはリンクで行う（押した時に画面を読み直す） */
.period a { min-width: 60px; height: 44px; padding: 0 14px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-pill); color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.period a:hover { color: var(--text); }
.period a[aria-current="true"] { background: var(--white); color: var(--accent); box-shadow: var(--sh-1); }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 6px; }
.inline-form { display: inline-flex; margin: 0; }
.main a { color: var(--accent); }
.main a.chip:not([aria-current="true"]) { color: var(--text); }
.main a.btn { color: var(--text); text-decoration: none; }
.main a.btn--primary { color: var(--white); }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-bottom: 4px; font-size: 13.5px; text-decoration: none; }
.pager { border-top: 1px solid var(--line); border-bottom: 0; }
.btn[aria-disabled="true"] { color: #a3abb4; cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { background: var(--white); }
.note--pad { padding: 12px 20px; }
.info--pad { margin: 0 20px 14px; }
.flash { margin-bottom: 16px; }
.tag-edit { display: grid; gap: 14px; }
.tag-edit .badges { align-items: center; }
.tag-chip { display: inline-flex; align-items: center; gap: 2px; padding: 0 0 0 10px; border-radius: var(--r-pill); background: var(--surface); font-size: 12.5px; }
.tag-chip .icon-btn { width: 36px; height: 36px; }
.tag-add { display: flex; align-items: center; gap: 8px; }
.tag-add input { width: 260px; }
.tag-sec-sub { font-weight: 500; }
.tag-list a { text-decoration: none; }
/* ログインの画面 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: var(--surface); }
.login-card { width: 420px; display: grid; gap: 16px; padding: 32px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); }
.login-card .brand { margin: 0; }
.login-card h1 { font-size: 20px; }
.login-card p { color: var(--muted); }
.login-card .info { color: var(--text); }

/* 設定のつながりの表（4列。モックの5列用の幅は使わない） */
table.tbl-conn3 { table-layout: fixed; width: 100%; }
.tbl-conn3 th:nth-child(1) { width: 190px; }
.tbl-conn3 th:nth-child(2) { width: 251px; }
.tbl-conn3 th:nth-child(3) { width: 220px; }
/* ログインの画面の、断られた・失敗した知らせ */
.info--warn .ic { color: var(--warn); }
.info--bad .ic { color: var(--fail); }
.info--bad { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fail) 35%, transparent); }

/* 切り替えをリンクで作る部分（スクリプトを使わないので button の代わりに a を使う） */
.seg a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 6px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.seg a[aria-current="true"] { background: var(--white); color: var(--text); box-shadow: var(--sh-1); }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.chip { text-decoration: none; }
.chip[aria-current="true"], .chip.is-on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-strong); cursor: default; }
span.chip { cursor: default; }
a.cal-item { color: inherit; text-decoration: none; }
.cal-h h2 { font-size: 16px; }

/* チャネルの点の色（モックと同じ） */
.chdot--mail { --c: #a8327e; }
.chdot--ig { --c: #00a0a8; }
.chdot--x { --c: #7a45d0; }
.chdot--tiktok { --c: #2a6fd6; }
.chdot--threads { --c: #a8327e; }
.chdot--yt { --c: #00a0a8; }
.chdot--article { --c: #7a45d0; }
.chdot--other { --c: #8b949e; }

/* グラフの線と凡例 */
.chart .ln { stroke-width: 2; }
.chart .ln.s1, .chart .pt.s1 { stroke: var(--s1); }
.chart .ln.s2, .chart .pt.s2 { stroke: var(--s2); }
.chart .ln.s3, .chart .pt.s3 { stroke: var(--s3); }
.chart .ln.s4, .chart .pt.s4 { stroke: var(--s4); }
.chart .ln.s-gray, .chart .pt.s-gray { stroke: #8b949e; }
.chart .ln.dash { stroke-dasharray: 5 4; }
.chart .pt.s1 { fill: var(--s1); }
.chart .pt.s2 { fill: var(--s2); }
.chart .pt.s3 { fill: var(--s3); }
.chart .pt.s4 { fill: var(--s4); }
.chart .pt.s-gray { fill: #8b949e; }
.chart .bar.s1 { fill: var(--s1); }
.legend i.s1 { border-color: var(--s1); }
.legend i.s2 { border-color: var(--s2); }
.legend i.s3 { border-color: var(--s3); }
.legend i.s4 { border-color: var(--s4); }
.legend i.s-gray { border-color: #8b949e; }
.legend i.dash { border-top-style: dashed; }
.chart--heat svg { height: auto; }
.chart-more { margin-top: 8px; }
.chart-more > summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; }
.chart-more > summary::-webkit-details-marker { display: none; }

/* 通数の帯（幅を style で渡せないので SVG で描く） */
.quota-svg { display: block; width: 100%; height: 12px; margin-top: 12px; border-radius: 4px; overflow: hidden; }
.quota-svg .q-used { fill: var(--s1); }
.quota-svg .q-free { fill: #b9d3f2; }
.quota-legend i.q-used { background: var(--s1); }
.quota-legend i.q-resv { background: repeating-linear-gradient(135deg, #8fb6e8 0 5px, #b9d3f2 5px 10px); }
.quota-legend i.q-free { background: #b9d3f2; }
.quota-legend i.q-res { background: repeating-linear-gradient(135deg, #d9dee5 0 6px, #eef1f4 6px 12px); }

/* 入力の部品（date と time。ほかの入力と同じ形にする） */
input[type="date"], input[type="time"] { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); font-size: 14px; }
.builder .cond { grid-template-columns: 56px minmax(0, 1.2fr) minmax(0, 1fr); }
.toolbar input[type="text"] { flex: 1; min-width: 240px; }
.act-row form { display: inline-flex; gap: 8px; align-items: center; }
.inline-input select { width: auto; min-width: 110px; }

/* 選択欄は Chrome が内側に約4px足すので、入力欄と文字の左端をそろえる */
select { padding-left: 8px; }
/* 表で見るのボタンは図の右上。開いた表は図の下に出る */
.chartbox { padding-top: 52px; }
.chartbox > .chart-head { position: absolute; top: 0; left: 0; right: 170px; min-height: 44px; }
.chart-more { margin-top: 0; }
.chart-more > summary { position: absolute; top: 0; right: 0; }
/* クロス分析 */
.xcell { display: inline-block; min-width: 56px; padding: 4px 8px; border-radius: 6px; text-align: right; }
.xcell--0 { color: var(--muted); }
.xcell--1 { background: rgba(42, 85, 163, 0.11); }
.xcell--2 { background: rgba(42, 85, 163, 0.22); }
.xcell--3 { background: rgba(42, 85, 163, 0.33); }
.xcell--4 { background: rgba(42, 85, 163, 0.60); color: #fff; }
.xcell--5 { background: rgba(42, 85, 163, 0.80); color: #fff; }
/* チャネルのラベルは左に固定し、チップはその右の列の中で折り返す */
.filters-row { flex-wrap: nowrap; }
.filters-row > .chips { flex: 1; min-width: 0; }
/* チップが2段になっても、ラベルは1段目にそろえる */
.filters-row:has(> .chips) { align-items: flex-start; }
.filters-row:has(> .chips) > .lbl { line-height: 44px; }
