/* 管理画面（全体管理・事務所の管理・ログイン）の共通デザイン。
   薄い灰色の台の上に白い面を置き、枠線ではなく薄い影で区切る。色は状態（緑・黄・赤）の文字だけに使い、
   役割や状態を色付きの丸いラベルにしない。数字は等幅でそろえる
   （参考：inspora.design「Deploy Pipeline」@jeetnirnejak の面の作り、「Support analytics」@disarto_max の数字の見せ方） */
:root {
  --ink: #1b1b1a;
  --ink-2: #52524e;
  --muted: #8e8d88;
  --faint: #b9b8b2;
  --line: #e7e6e2;
  --line-2: #efeeea;
  --soft: #f3f3f1;
  --tray: #f6f6f4;
  --side: var(--tray);
  --navy: var(--ink);
  --blue: var(--ink);
  --blue-soft: var(--soft);
  --green: #2f7a4f;
  --green-soft: var(--soft);
  --amber: #9a6010;
  --amber-soft: #f6efe2;
  --red: #b4342a;
  --red-soft: #faeeec;
  --violet: var(--ink);
  --violet-soft: var(--soft);
  --radius: 12px;
  --panel: 0 0 0 1px rgba(27, 27, 26, .06), 0 1px 2px rgba(27, 27, 26, .04);
  --mono: ui-monospace, "SF Mono", "Menlo", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--tray); color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  font-size: 14px; line-height: 1.7; -webkit-font-smoothing: antialiased;
}
svg { width: 1em; height: 1em; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
b, strong { font-weight: 600; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------- 骨組み */
.console { display: flex; min-height: 100%; }
.c-side {
  width: 248px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--side); padding: 14px 12px 12px;
}
.c-brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 14px; font-weight: 700; font-size: 16px; text-decoration: none; }
.c-brand svg { width: 20px; height: 20px; color: var(--ink); }
.c-scope { margin-left: auto; white-space: nowrap; flex: none; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.c-scope.company { color: var(--muted); }
.c-org { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 8px 10px; border-radius: 10px; background: #fff; box-shadow: var(--panel); min-width: 0; }
.c-org-mark { width: 30px; height: 30px; border-radius: 7px; flex: none; display: grid; place-items: center; background: var(--soft); color: var(--ink-2); font-weight: 600; font-size: 13px; }
.c-org-text { min-width: 0; line-height: 1.35; }
.c-org-text b, .c-org-text small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.c-org-text b { font-size: 13.5px; }
.c-org-text small { color: var(--muted); font-size: 11.5px; }
.c-nav { display: flex; flex-direction: column; gap: 1px; }
.c-nav-label { margin: 16px 10px 4px; font-size: 11.5px; font-weight: 500; color: var(--faint); }
.c-nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; text-decoration: none;
  font-weight: 500; color: var(--ink-2); font-size: 13.5px;
}
.c-nav a svg { width: 16px; height: 16px; color: var(--muted); }
.c-nav a:hover { color: var(--ink); }
.c-nav a.active { background: #fff; color: var(--ink); box-shadow: var(--panel); }
.c-nav a.active svg { color: var(--ink); }
.c-nav a .count { margin-left: auto; font: 500 12px var(--mono); color: var(--muted); }
.c-nav a.op { color: var(--amber); }
.c-nav a.op.active { color: var(--amber); }
.c-side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 1px; }
.c-side-foot a, .c-side-foot button {
  display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 9px;
  text-decoration: none; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; text-align: left;
}
.c-side-foot svg { width: 15px; height: 15px; }
.c-side-foot a:hover, .c-side-foot button:hover { color: var(--ink); }
.c-me { padding: 4px 10px 8px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; line-height: 1.5; }

.c-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.c-top { position: sticky; top: 0; z-index: 5; background: rgba(246, 246, 244, .9); backdrop-filter: blur(8px); }
.c-top-inner { max-width: 1160px; margin: 0 auto; padding: 22px 32px 10px; display: flex; align-items: flex-end; gap: 16px; }
.c-crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.c-crumb a { text-decoration: none; color: var(--muted); }
.c-crumb a:hover { color: var(--ink); }
.c-title { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.35; letter-spacing: .01em; }
.c-sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.c-top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.c-content { width: 100%; max-width: 1160px; margin: 0 auto; padding: 14px 32px 64px; display: flex; flex-direction: column; gap: 14px; }

/* ---------------------------------------------------------- 部品 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 8px;
  border: 0; background: #fff; box-shadow: var(--panel); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink);
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { box-shadow: 0 0 0 1px rgba(27, 27, 26, .14), 0 1px 2px rgba(27, 27, 26, .06); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--ink); color: #fff; box-shadow: none; }
.btn.primary:hover { background: #33332f; box-shadow: none; }
.btn.danger { color: var(--red); }
.btn.danger:hover { box-shadow: 0 0 0 1px #ecc5c0; }
.btn.danger-fill { background: var(--red); color: #fff; box-shadow: none; }
.btn.danger-fill:hover { background: #a8261d; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.icon-btn { width: 32px; height: 32px; border: 0; background: none; border-radius: 8px; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12px; }
.input, .select {
  height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; outline: 0; width: 100%;
}
.input:focus, .select:focus { border-color: var(--faint); box-shadow: 0 0 0 3px var(--soft); }
.select { padding-right: 30px; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%238b93a3' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 8px center / 16px; cursor: pointer; }
.select.small { height: 28px; font-size: 13px; border-radius: 7px; padding-left: 8px; min-width: 124px; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search .input { padding-left: 32px; height: 36px; }

.card { border-radius: var(--radius); background: #fff; box-shadow: var(--panel); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; }
.card-head .note { color: var(--muted); font-size: 12.5px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px 18px; }
.card-foot { padding: 10px 18px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }
.grid-2.even { grid-template-columns: 1fr 1fr; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border-radius: var(--radius); box-shadow: var(--panel); }
.tile { padding: 14px 18px 15px; min-width: 0; }
.tile + .tile { box-shadow: inset 1px 0 0 var(--line-2); }
.tile-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.tile-label svg { display: none; }
.tile-value { margin-top: 6px; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile-value small { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.tile-sub { margin-top: 4px; font-size: 11.5px; color: var(--muted); }

.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; color: var(--ink-2); }
.tag svg { width: 12px; height: 12px; }
.tag.ok { color: var(--green); }
.tag.off { color: var(--muted); }
.tag.warn { color: var(--amber); }
.tag.bad { color: var(--red); }
.tag.info { color: var(--muted); }
.tag.role-admin, .tag.role-attorney, .tag.role-member { color: var(--ink-2); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* 表 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 500; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13.5px; }
.table td.num { font: 500 12.5px var(--mono); color: var(--ink-2); }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: #fafaf8; }
.table .name { font-weight: 600; }
.table .name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.table .th-center, .table .center { text-align: center; }
.table .empty { text-align: center; color: var(--muted); padding: 34px 12px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 600; font-size: 12.5px; color: var(--ink-2); background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.avatar.owner { background: var(--ink); color: #fff; box-shadow: none; }
.person-text { min-width: 0; line-height: 1.4; }
.person-text b { display: flex; align-items: center; gap: 6px; }
.person-text small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.you { font-size: 11px; font-weight: 500; color: var(--muted); }
.row-off td { color: var(--muted); }
.row-off .avatar { opacity: .5; }

/* 権限の切り替え（表の中のマス） */
.perm {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center;
  cursor: pointer; color: transparent; transition: background .12s, border-color .12s;
}
.perm svg { width: 14px; height: 14px; }
.perm.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.perm:not(:disabled):hover { border-color: var(--faint); }
.perm:disabled { cursor: not-allowed; }
.perm.locked { background: transparent; color: var(--faint); border-style: dashed; }
.perm.all { background: var(--soft); border-color: var(--line); color: var(--ink-2); }

/* スイッチ */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: #dcdbd6; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(15px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--line); }
.switch input:disabled + .track { opacity: .5; }
.switch .label { font-size: 13px; font-weight: 500; }

/* 期間の切り替え */
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: #ebebe8; }
.seg button { border: 0; background: none; padding: 3px 12px; border-radius: 6px; font: 500 12px var(--mono); color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--panel); }

/* 機能の一覧 */
.features { list-style: none; margin: 0; padding: 0; }
.features li { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); }
.features li:last-child { border-bottom: 0; }
.features .f-icon { width: 16px; display: grid; place-items: center; flex: none; color: var(--green); }
.features li.off .f-icon { color: var(--faint); }
.features li.off .f-text { color: var(--muted); }
.features .f-icon svg { width: 14px; height: 14px; }
.features .f-text { flex: 1; min-width: 0; line-height: 1.45; }
.features .f-text small { display: block; color: var(--muted); font-size: 12px; }

/* グラフ（日ごとの棒） */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 8px 0 0; position: relative; border-bottom: 1px solid var(--line); }
.chart .bar { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; background: #dddcd7; position: relative; min-height: 1px; }
.chart .bar.today { background: var(--ink-2); }
.chart .bar:hover { background: var(--ink); }
.chart .bar:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--ink); color: #fff; font: 500 11px var(--mono); padding: 3px 8px; border-radius: 5px; z-index: 2; pointer-events: none;
}
.chart-axis { display: flex; justify-content: space-between; font: 500 11px var(--mono); color: var(--muted); margin-top: 6px; }
.chart-empty { height: 120px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.meter { height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; min-width: 80px; }
.meter i { display: block; height: 100%; background: var(--ink-2); border-radius: 2px; }
.meter.warn i { background: var(--amber); }
.meter.bad i { background: var(--red); }

/* 構成（いま何を使っているか） */
.stack { list-style: none; margin: 0; padding: 0; }
.stack li { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.stack li:last-child { border-bottom: 0; }
.stack .k { min-width: 64px; color: var(--muted); font-weight: 500; flex: none; white-space: nowrap; }
.stack code { font: 500 12px var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.stack .tag { margin-left: auto; }

/* 操作の記録 */
.log-changes { margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-2); }
.log-changes li::before { content: "・"; color: var(--muted); }

/* リンク（URL）の表示 */
.linkbox { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 8px; padding: 3px 4px 3px 12px; background: var(--tray); min-width: 0; }
.linkbox code { flex: 1; min-width: 0; font: 500 12px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 説明の枠 */
.explain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.explain > div { background: #fff; box-shadow: var(--panel); border-radius: 10px; padding: 12px 14px; }
.explain b { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.explain p { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.6; }
.callout { display: flex; gap: 10px; align-items: flex-start; border-radius: 8px; padding: 10px 14px; font-size: 13px; background: #fff; box-shadow: var(--panel); color: var(--ink-2); }
.callout svg { width: 16px; height: 16px; margin-top: 3px; }
.callout.warn { background: var(--amber-soft); color: var(--amber); box-shadow: none; }
.callout.op { background: var(--amber-soft); color: #7a4800; box-shadow: none; }

.danger-zone { box-shadow: 0 0 0 1px #f0d3cf; }
.danger-zone .card-head h2 { color: var(--red); }
.danger-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.danger-row:last-child { border-bottom: 0; }
.danger-row div { flex: 1; min-width: 0; }
.danger-row small { display: block; color: var(--muted); font-size: 12.5px; }

/* メニュー */
.menu { position: fixed; z-index: 60; min-width: 190px; background: #fff; border-radius: 10px; box-shadow: 0 0 0 1px rgba(27, 27, 26, .06), 0 12px 32px rgba(27, 27, 26, .14); padding: 5px; animation: fade .1s ease-out; }
.menu button, .menu a { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; cursor: pointer; text-align: left; text-decoration: none; color: var(--ink); }
.menu button:hover, .menu a:hover { background: var(--soft); }
.menu svg { width: 16px; height: 16px; color: var(--ink-2); }
.menu .danger, .menu .danger svg { color: var(--red); }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; }

/* ダイアログ */
.modal-veil { position: fixed; inset: 0; z-index: 70; background: rgba(27, 27, 26, .32); display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 14px; box-shadow: 0 24px 70px rgba(27, 27, 26, .22); animation: pop .16s ease-out; }
.modal.small { width: min(420px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 6px; }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 10px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

.role-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.role-card { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; line-height: 1.5; }
.role-card input { position: absolute; opacity: 0; }
.role-card b { display: block; font-size: 14px; font-weight: 600; }
.role-card small { display: block; color: var(--muted); font-size: 11.5px; }
.role-card:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.role-card:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--line); }
.perm-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.perm-list li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); }
.perm-list li:last-child { border-bottom: 0; }
.perm-list .f-text { flex: 1; line-height: 1.4; }
.perm-list small { display: block; color: var(--muted); font-size: 11.5px; }
.perm-list li.locked { color: var(--muted); }
.success { text-align: center; padding: 8px 0 2px; }
.success .ok-mark { width: 44px; height: 44px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; background: var(--soft); color: var(--green); }
.success .ok-mark svg { width: 24px; height: 24px; }
.success h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.success p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }

/* 通知・エラー */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 80; background: var(--ink); color: #fff; border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); display: flex; align-items: center; gap: 8px; animation: pop .15s ease-out; }
.toast svg { width: 16px; height: 16px; color: #7ee2b0; }
.toast.error svg { color: #ffb4ae; }
.alert { border-radius: 8px; padding: 10px 14px; background: var(--red-soft); color: var(--red); font-size: 13.5px; }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, #ecebe8, #f6f6f4, #ecebe8); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.blank { text-align: center; padding: 48px 16px; color: var(--muted); }
.blank svg { width: 28px; height: 28px; margin-bottom: 8px; color: var(--faint); }
.blank h3 { margin: 0 0 4px; color: var(--ink); font-size: 15px; font-weight: 600; }
.blank p { margin: 0 0 14px; font-size: 13px; }

/* ログイン */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--side); }
.login { width: min(380px, 100%); background: #fff; border-radius: 14px; padding: 28px 26px 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--panel), 0 16px 50px rgba(27, 27, 26, .06); }
.login .c-brand { padding: 0; }
.login h1 { margin: 4px 0 0; font-size: 19px; font-weight: 600; }
.login p { margin: 0; color: var(--muted); font-size: 13px; }
.login .btn { height: 42px; font-size: 14.5px; }

/* ---------------------------------------------------------- 狭い画面 */
@media (max-width: 1080px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile:nth-child(3) { box-shadow: inset 0 1px 0 var(--line-2); }
  .tile:nth-child(4) { box-shadow: inset 1px 0 0 var(--line-2), inset 0 1px 0 var(--line-2); }
  .grid-2, .grid-2.even { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .console { flex-direction: column; }
  .c-side { width: 100%; height: auto; position: sticky; top: 0; z-index: 10; flex-direction: row; align-items: center; gap: 4px; padding: 8px 10px; overflow-x: auto; box-shadow: 0 1px 0 var(--line); }
  .c-brand { padding: 4px 6px; }
  .c-brand span:not(.c-scope), .c-org, .c-nav-label { display: none; }
  .c-nav { flex-direction: row; gap: 2px; }
  .c-nav a { padding: 6px 10px; white-space: nowrap; }
  .c-nav a .count { display: none; }
  .c-side-foot { margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; }
  .c-side-foot a span, .c-side-foot button span { display: none; }
  .c-me { display: none; }              /* 狭い画面では横並びになるので、メールアドレスは出さない */
  .c-top { position: static; }
  .c-top-inner { padding: 14px 16px 10px; flex-wrap: wrap; align-items: center; }
  .c-top-actions { margin-left: 0; justify-content: flex-start; }
  .c-content { padding: 16px 16px 48px; }
  .explain, .role-cards { grid-template-columns: 1fr; }
  .tile-value { font-size: 22px; }
}

/* ---------------------------------------------------------------- ログイン画面（/login） */
.signin { width: min(380px, calc(100% - 32px)); margin: 10vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.signin h1 { font-size: 22px; letter-spacing: .04em; margin: 0; }
.signin-sub { color: var(--ink-2); font-size: 14px; margin: -6px 0 4px; }
.signin form { display: flex; flex-direction: column; gap: 12px; }
.signin-note { color: var(--ink-2); font-size: 13px; line-height: 1.6; margin: 0; }
.signin-foot { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.btn.wide { width: 100%; justify-content: center; }
.input.code { letter-spacing: .4em; font-size: 18px; text-align: center; }
.qr { display: flex; justify-content: center; padding: 10px; background: #fff; border-radius: 10px; box-shadow: var(--panel); }
.qr img { width: 180px; height: 180px; }
.secret { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.secret code { font-size: 12.5px; word-break: break-all; color: var(--ink-2); }
