/* YGR Hub（hub.web.ytgc.jp）
 * 見た目はテスト版（モック v0.6.1）に合わせる。画面の共通ルールは Notion「よつぐち UI 共通ルール」。 */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #e3e6ea;
  --primary: #2f6fdb;
  --primary-weak: #e8f0fd;
  --danger: #c53030;
  --danger-weak: #fdecec;
  --amber: #a15c00;
  --amber-weak: #fff3dc;
  --green: #1e7a46;
  --green-weak: #e4f5ea;
  --gray-weak: #eef0f3;
  --radius: 8px;
  --sidebar: 264px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
[hidden] { display: none !important; }

/* ── アイコン（SVG ピクトグラム。24 グリッド・線 1.75・丸め・塗りなし・文字色） ── */
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon-sm { width: 14px; height: 14px; vertical-align: -2px; }
.icon-lg { width: 32px; height: 32px; color: var(--muted); }
.icon-xl { width: 44px; height: 44px; color: var(--muted); }
.with-icon { display: inline-flex; align-items: center; gap: 8px; }
.icon-btn { background: none; border: 0; padding: 4px; border-radius: 6px; color: var(--muted); cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--gray-weak); color: var(--text); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── 上部バー（ロゴとソフト名だけ。URL は出さない） ── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 16px;
  background: #1f2a3c; color: #fff;
}
.brand-icon { width: 22px; height: 22px; stroke-width: 1.6; }
.brand { color: #fff; font-weight: 700; font-size: 17px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 4px; }
.nav-toggle .icon { width: 22px; height: 22px; }
.user-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: 999px; padding: 3px 10px 3px 8px; font: inherit; font-size: 12.5px; cursor: pointer; }
.user-btn:hover { background: rgba(255,255,255,.16); }
.user-btn .user-chev { transform: rotate(90deg); opacity: .7; }
.user-btn[aria-expanded=true] .user-chev { transform: rotate(-90deg); }

/* ── レイアウト（横幅いっぱいに使う） ── */
.layout { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: calc(100vh - 56px); min-height: calc(100dvh - 56px); }
.sidenav { background: var(--surface); border-right: 1px solid var(--border); padding: 8px; position: sticky; top: 56px; height: calc(100vh - 56px); height: calc(100dvh - 56px); overflow-y: auto; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px; color: var(--text); position: relative;
}
.sidenav a:hover { background: var(--gray-weak); text-decoration: none; }
.sidenav a.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.sidenav .nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidenav a .nav-label + .nav-label { flex: none; }
.sidenav .lvl-2 a { padding-left: 22px; font-size: 13px; }
.sidenav .lvl-3 a { padding-left: 40px; font-size: 12.5px; color: var(--muted); }
.sidenav .lvl-3 a.active { color: var(--primary); }
.nav-ic { position: relative; display: inline-flex; }
.nav-dot { display: none; position: absolute; top: -2px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 1.5px solid var(--surface); }
.nav-count { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; min-width: 18px; padding: 0 5px; text-align: center; line-height: 18px; }
.nav-collapse { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; margin-bottom: 6px; background: none; border: 0; border-radius: 6px; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; text-align: left; }
.nav-collapse:hover { background: var(--gray-weak); color: var(--text); }
.nav-divider { height: 1px; background: var(--border); margin: 10px 10px; }
.nav-row { display: flex; align-items: center; }
.nav-row .nav-link { flex: 1; min-width: 0; }
.nav-toggle-btn { flex: none; background: none; border: 0; border-radius: 6px; padding: 6px; margin-left: 2px; color: var(--muted); cursor: pointer; display: inline-flex; }
.nav-toggle-btn:hover { background: var(--gray-weak); color: var(--text); }
.nav-toggle-btn .icon { transition: transform .2s ease; }
.nav-toggle-btn.open .icon { transform: rotate(90deg); }
.nav-group { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s ease, opacity .22s ease; opacity: 1; }
.nav-group.closed { grid-template-rows: 0fr; opacity: 0; }
.nav-group > ul { overflow: hidden; min-height: 0; }
.sidenav .lvl-2 .nav-row .nav-link { padding-left: 22px; }
.nav-mobile-head { display: none; }
/* 管理者ダッシュボードの区切り（行全体を押して開閉する。初めは閉じている） */
.nav-cat-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px 7px 22px; background: none; border: 0; border-radius: 6px; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.nav-cat-btn:hover { background: var(--gray-weak); }
.nav-cat-btn .nav-chev { flex: none; color: var(--muted); transition: transform .2s ease; }
.nav-cat-btn.open .nav-chev { transform: rotate(90deg); }
.nav-cat.here > .nav-cat-btn { color: var(--primary); font-weight: 600; }
.nav-here { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.nav-cat .lvl-3 a { color: var(--text); }
.nav-cat .lvl-3 a.active { color: var(--primary); }
@media (min-width: 761px) {
  /* たたんだとき：アイコンだけ。通知は右上の点 */
  .layout.nav-collapsed { grid-template-columns: 60px 1fr; }
  .nav-collapsed .sidenav { padding: 8px 6px; }
  .nav-collapsed .sidenav .nav-label, .nav-collapsed .sidenav .nav-count { display: none; }
  .nav-collapsed .sidenav a, .nav-collapsed .nav-collapse { justify-content: center; padding: 9px 0; }
  .nav-collapsed .sidenav .lvl-2 a, .nav-collapsed .sidenav .lvl-3 a, .nav-collapsed .sidenav .lvl-2 .nav-row .nav-link { padding-left: 0; }
  .nav-collapsed .sidenav .lvl-3 a .icon { width: 12px; height: 12px; }
  .nav-collapsed .nav-dot { display: block; }
  .nav-collapsed .nav-divider { margin: 8px 6px; }
  .nav-collapsed .nav-toggle-btn { display: none; }
  .nav-collapsed .nav-cat-btn { justify-content: center; padding: 9px 0; }
  .nav-collapsed .nav-cat-btn .nav-chev, .nav-collapsed .nav-here { display: none; }
}
.main { padding: 16px 28px 48px; min-width: 0; }

/* ── パンくず ── */
.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 12px; font-size: 12px; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; }
/* 詳細・編集の画面の「一覧に戻る」（2026-11-13） */
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: -4px 0 12px; }
.back-link .back-chev { transform: rotate(180deg); }
.breadcrumb li:last-child { color: var(--text); }

/* ── 共通部品 ── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-head-tight { margin-bottom: 12px; }
.page-head .seg + .muted { align-self: center; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.card-alert { border-color: #f1b5b5; box-shadow: inset 4px 0 0 var(--danger); }
.card-alert h2 { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2 > .span-2 { grid-column: 1 / -1; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .form-row { margin-bottom: 0; }
.grid + .form-row, .grid + .small, .grid + .form-actions { margin-top: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
/* メールアドレスはほかの文字と同じフォント（等幅にしない。長いときは折り返す。2026-11-13） */
.addr { overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; }
.text-danger { color: var(--danger); font-weight: 600; }
.fw-normal { font-weight: 400; }
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-6 { margin-top: 6px; }
.mt-16 { margin-top: 16px; }
.mt-8 { margin-top: 8px; }
.mb-0 { margin-bottom: 0; }
.mb-6 { margin-bottom: 6px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.w-auto { width: auto !important; }
.justify-end { justify-content: flex-end; }
.group-title { margin-top: 8px; }
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.body-text p { margin: 0 0 10px; }
.body-text p:last-child { margin-bottom: 0; }
.body-text { overflow-wrap: anywhere; }

.btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 14px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--gray-weak); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: #2559b4; }
.btn-danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-weak); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #a42626; }
.btn-small { padding: 3px 10px; font-size: 12px; }
.btn-lg { padding: 10px 18px; font-size: 15px; font-weight: 600; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--gray-weak); color: var(--muted); }
.badge-blue { background: var(--primary-weak); color: var(--primary); }
.badge-red { background: var(--danger-weak); color: var(--danger); }
.badge-amber { background: var(--amber-weak); color: var(--amber); }
.badge-green { background: var(--green-weak); color: var(--green); }
.badge-dot { background: var(--danger); color: #fff; }
.dot-count { display: inline-block; margin-left: 6px; background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 17px; }

.notice-bar { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.notice-info { background: var(--primary-weak); color: #1d4f9e; }
.notice-warn { background: var(--amber-weak); color: var(--amber); }
.notice-danger { background: var(--danger-weak); color: var(--danger); }

/* 止まっていることのお知らせ（パンくずの下の帯） */
.issues { background: var(--amber-weak); border: 1px solid #f3d19e; color: #6b3d00; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.issues-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.issue { display: flex; gap: 8px; align-items: baseline; padding: 3px 0 3px 26px; }
.issue .icon { flex: none; position: relative; top: 2px; }

/* ── テーブル ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sortable::after { content: ''; display: inline-block; width: 0; height: 0; margin-left: 6px; vertical-align: 2px; border: 4px solid transparent; opacity: .35; border-top-color: currentColor; border-bottom-width: 0; }
th.sortable[aria-sort="ascending"]::after { opacity: 1; border-top-width: 0; border-bottom: 4px solid currentColor; }
th.sortable[aria-sort="descending"]::after { opacity: 1; }
th.sortable:hover::after { opacity: .7; }
@media (min-width: 761px) { .filters .sort-select { display: none; } }
.table-card { padding: 0; overflow: hidden; }

/* ── 定義リスト ── */
dl.kv { display: grid; grid-template-columns: 180px 1fr; margin: 0; }
dl.kv dt, dl.kv dd { padding: 8px 0; border-bottom: 1px solid var(--border); margin: 0; overflow-wrap: anywhere; }
dl.kv dt { color: var(--muted); font-size: 13px; }
dl.kv dt:last-of-type, dl.kv dd:last-of-type { border-bottom: 0; }

/* ── タブ ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ── フォーム ── */
.form-row { margin-bottom: 14px; }
.form-row > label, .form-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.req { color: var(--danger); font-size: 11px; margin-left: 4px; }
.opt { color: var(--muted); font-size: 11px; margin-left: 4px; font-weight: 400; }
input[type=text], input[type=date], input[type=datetime-local], input[type=url], input[type=search], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; max-width: 520px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: #fff; color: var(--text);
}
input[type=file] { font: inherit; font-size: 13px; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-weak); border-color: var(--primary); }
textarea { max-width: 100%; min-height: 100px; }
textarea.ta-short { min-height: 64px; }
.inline-opts { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.inline-opts label { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; }
.form-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input, .filters select { width: auto; min-width: 140px; }
.filters input[type=search] { min-width: 280px; flex: 1 1 280px; max-width: 420px; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.inline-form { display: inline-flex; margin: 0; }
.maint-msg { margin-top: 6px; max-width: 420px; font-size: 12px; }
.save-bar { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; margin-top: 12px; }

.q-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: #fff; }
.q-card .q-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; }
.q-card .form-row:last-of-type { margin-bottom: 0; }
.q-error { border-color: #f1b5b5; box-shadow: inset 4px 0 0 var(--danger); }
.sched th, .sched td { text-align: center; }
.sched td:first-child, .sched th:first-child { text-align: left; }
.bars-label { width: 40%; }
.bars-num { width: 70px; white-space: nowrap; }

/* ── 一覧 ── */
.list-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .meta { font-size: 12px; color: var(--muted); }
.list-item > .icon { color: var(--muted); }
.li-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; }
.read-dot { width: 8px; height: 8px; flex: none; }

/* お知らせ一覧：1 件ずつ枠で区切り、行全体を押せる */
.notice-list { display: flex; flex-direction: column; gap: 8px; }
.notice-list > [data-row][hidden] { display: none; }
.notice-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.notice-row:hover { text-decoration: none; border-color: #b9c6dc; box-shadow: 0 2px 6px rgba(15,23,42,.06); }
.notice-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notice-row .nr-title { font-weight: 600; color: var(--primary); }
.notice-row .meta { font-size: 12px; color: var(--muted); }
.notice-row .nr-chev { color: #b0b7c3; flex: none; }
.notice-row.needs { border-color: #f1b5b5; box-shadow: inset 4px 0 0 var(--danger); }
.notice-meta { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* 要確認 */
.confirm-box { display: flex; align-items: center; gap: 12px; background: var(--danger-weak); border: 1px solid #f1b5b5; color: #7a1f1f; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.confirm-box .grow { flex: 1; min-width: 200px; }
.confirm-box.done { background: var(--green-weak); border-color: #b5dfc4; color: var(--green); }

/* リンク集のカード：高さは JS で同じ画面の中で一番高いものにそろえる */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.link-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.link-card .title { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.link-card .title a { display: inline-flex; align-items: center; gap: 4px; overflow-wrap: anywhere; }
.link-card .title .icon { color: var(--muted); }
.link-card .lc-foot { margin-top: auto; }
.lc-stopped { background: #fafafa; }
.lc-stopped .title a { color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.status-up { background: #2fa36b; } .status-down { background: var(--danger); } .status-unknown { background: #b8bec7; }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: block; color: inherit; }
.stat:hover { text-decoration: none; border-color: var(--primary); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.stat .num { font-size: 26px; font-weight: 700; color: var(--text); }
.stat .label { color: var(--muted); font-size: 12px; }
.kind-card { display: block; color: inherit; }
.kind-card:hover { text-decoration: none; border-color: var(--primary); }
.kind-card .num { font-size: 28px; font-weight: 700; margin-top: 8px; }

.bar { height: 8px; background: var(--gray-weak); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; width: 0; background: var(--primary); }

/* ── 危険な操作（詳細の一番下だけ） ── */
.danger-zone { border: 1px solid #f1b5b5; border-radius: var(--radius); background: var(--surface); margin-top: 32px; }
.danger-zone h2 { color: var(--danger); padding: 12px 16px; margin: 0; border-bottom: 1px solid #f1b5b5; background: var(--danger-weak); border-radius: var(--radius) var(--radius) 0 0; }
.danger-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.danger-item:last-child { border-bottom: 0; }
.danger-item .desc { font-size: 12px; color: var(--muted); }

/* ── メンテ・エラー・空表示 ── */
.state-box { text-align: center; padding: 48px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.state-box h1 { margin: 8px 0; font-size: 18px; }
.empty { color: var(--muted); padding: 16px 0; text-align: center; font-size: 13px; }
.empty .icon { vertical-align: -4px; }

/* ── 権限管理 ── */
details.perm { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
details.perm > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
details.perm > summary::-webkit-details-marker { display: none; }
details.perm > summary:hover { background: #fafbfc; }
details.perm .chev { color: var(--muted); transition: transform .15s; }
details.perm[open] .chev { transform: rotate(90deg); }
details.perm .perm-title { font-weight: 700; }
details.perm .perm-sum { margin-left: auto; font-size: 12px; color: var(--muted); }
details.perm .perm-body { padding: 12px 16px 16px; border-top: 1px solid var(--border); }
details.perm .perm-body .card { margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--gray-weak); border-radius: 999px; padding: 2px 4px 2px 10px; margin: 0 6px 6px 0; font-size: 12px; }
.chip-ex { background: var(--danger-weak); color: var(--danger); }
.reason { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; margin: 1px 4px 1px 0; }
.reason:hover { text-decoration: none; filter: brightness(.95); }
.reason-op { background: var(--amber-weak); color: var(--amber); }
.reason-orgadmin { background: var(--primary-weak); color: var(--primary); }
.reason-grant { background: var(--green-weak); color: var(--green); }
.reason-everyone { background: var(--gray-weak); color: var(--muted); }

/* ── リンク集のボード ── */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; margin-bottom: 8px; }
.board-col { flex: 0 0 260px; background: #eef1f5; border-radius: var(--radius); padding: 8px; }
.board-col.dragging { opacity: .5; }
.board-col-head { display: flex; align-items: center; gap: 6px; padding: 4px 4px 8px; cursor: grab; }
.board-col-head h3 { margin: 0; flex: 1; font-size: 13px; }
.board-col-aud { display: flex; align-items: center; gap: 4px; padding: 0 4px 8px; color: var(--muted, #667); flex-wrap: wrap; }
.board-list { min-height: 48px; display: flex; flex-direction: column; gap: 6px; border-radius: 6px; padding: 2px; transition: background .15s; }
.board-list.drop-over { background: var(--primary-weak); }
.board-card { display: flex; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; cursor: grab; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.board-card:hover { border-color: #b9c6dc; }
.board-card.dragging { opacity: .4; }
.board-card.locked { cursor: default; background: #f7f8fa; color: var(--muted); }
.board-card.editing { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-weak); }
.board-card[data-editable]:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.board-card .grow { min-width: 0; flex: 1; }
.board-title { font-weight: 600; font-size: 13px; }
.board-url { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-meta { display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.grip { color: #9aa3af; display: inline-flex; padding-top: 2px; }
.board-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 12px 0; border: 1px dashed #c8ced8; border-radius: 6px; }
.drop-marker { height: 3px; background: var(--primary); border-radius: 2px; }
.drop-marker-col { width: 3px; height: auto; align-self: stretch; flex: none; }
.board-add-form { flex: 0 0 160px; margin: 0; display: flex; }
.board-add-col { flex: 1; background: none; border: 1px dashed #c8ced8; border-radius: var(--radius); color: var(--muted); padding: 14px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; font: inherit; }
.board-add-col:hover { color: var(--primary); border-color: var(--primary); }
body.board-saving .board { opacity: .6; pointer-events: none; }

/* 重ねて開く編集ウィンドウ */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(15,23,42,.35); display: flex; justify-content: center; align-items: flex-start; padding: 64px 16px 16px; overflow-y: auto; }
.sheet-box { background: var(--surface); border-radius: 12px; width: 100%; max-width: 640px; padding: 18px 20px; box-shadow: 0 16px 48px rgba(0,0,0,.22); }
.sheet-box .danger-zone { margin-top: 20px; }
body.sheet-open { overflow: hidden; }

/* ── アンケートの回答者ごと ── */
.resp { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.resp > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.resp > summary::-webkit-details-marker { display: none; }
.resp[open] .chev { transform: rotate(90deg); }
.resp .chev { color: var(--muted); transition: transform .15s; }
.resp .resp-at { margin-left: auto; }
.resp-body { border-top: 1px solid var(--border); padding: 4px 14px 10px; }
.resp-q { padding: 8px 0; border-bottom: 1px solid var(--border); }
.resp-q:last-child { border-bottom: 0; }
.resp-q .q { font-size: 12px; color: var(--muted); }
.mark { display: inline-block; min-width: 22px; text-align: center; font-weight: 700; }
.mark-o { color: var(--green); } .mark-t { color: var(--amber); } .mark-x { color: var(--danger); }
.seg { display: inline-flex; background: var(--gray-weak); border-radius: 8px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 14px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ── ヘッダーの自分の情報 ── */
.user-pop { position: fixed; top: 52px; right: 12px; z-index: 45; width: 320px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.18); padding: 14px 16px; }
.up-head { display: flex; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.up-name { font-weight: 700; }
.up-sec { padding: 8px 0; border-bottom: 1px solid var(--border); }
.up-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.up-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 0; font-size: 13px; }
.up-row .up-badges { display: inline-flex; gap: 4px; flex: none; }
.up-foot { padding-top: 10px; margin: 0; display: flex; justify-content: space-between; gap: 8px; }

/* ── モーダル・トースト ── */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; z-index: 55; padding: 16px; }
.modal-box { background: var(--surface); border-radius: 10px; width: 100%; max-width: 460px; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.2); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-box h2 { color: var(--danger); }
.modal-box h2.plain { color: var(--text); display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.modal-plain h2 { margin-top: 0; }
.modal-wide { max-width: 640px; }
.modal-box input, .modal-box textarea { max-width: 100%; margin-top: 6px; }
.modal-box .form-actions { justify-content: flex-end; }
.req-modal { max-width: 680px; }
.req-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.req-head .icon-lg { color: var(--danger); flex: none; }
.req-head h2.plain { color: var(--danger); }
.req-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
.req-item { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; flex-wrap: wrap; }
.req-item .grow { flex: 1; min-width: 220px; }
.req-title { font-weight: 700; margin-bottom: 2px; }
.req-item .meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.req-body { font-size: 13px; margin-top: 4px; }
.req-actions { display: flex; gap: 6px; }
.modal-box .req-foot { justify-content: space-between; align-items: center; }
.change-list { border: 1px solid var(--border); border-radius: var(--radius); margin: 10px 0; }
.change-row { padding: 10px 12px; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.change-row:last-child { border-bottom: 0; }
.change-row > strong { min-width: 7em; }
.change-row > .small { flex-basis: 100%; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1f2a3c; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 60; font-size: 13px; max-width: calc(100% - 32px); }
/* ウィンドウ（確認・要確認）を開いている間は後ろをスクロールさせない */
body:has(.modal:not([hidden])) { overflow: hidden; }

/* ── ログイン・初期設定 ── */
.auth-body { min-height: 100vh; min-height: 100dvh; display: flex; }
.auth { margin: auto; width: 100%; max-width: 440px; padding: 24px 16px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: 0 6px 24px rgba(15,23,42,.06); }
.auth:has(.auth-card-wide) { max-width: 680px; }
.auth-card h1 { margin: 12px 0 6px; }
.auth-brand { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.auth-brand .brand-icon { color: #1f2a3c; }
.auth-foot { margin: 16px 0 0; text-align: center; }

/* ── 幅の狭い画面 ── */
@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand { font-size: 15px; }
  .nav-toggle { display: block; }
  .nav-toggle .icon { width: 24px; height: 24px; }
  .user-btn .user-name, .user-btn .user-chev { display: none; }
  .user-btn { padding: 4px 6px; }
  .layout { grid-template-columns: 1fr; }
  /* 狭い画面のメニュー：画面全体を覆う専用表示。開いている間は後ろをスクロールさせない */
  .sidenav { display: block; position: fixed; top: 56px; left: 0; right: 0; bottom: 0; height: auto; z-index: 30; overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px 24px; border: 0; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .sidenav.open { transform: none; visibility: visible; }
  body.nav-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
  .nav-mobile-head { display: block; font-size: 12px; color: var(--muted); padding: 4px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
  .nav-collapse { display: none; }
  .sidenav a { padding: 11px 10px; font-size: 15px; }
  .sidenav .lvl-2 a { font-size: 14px; }
  .main { padding: 12px 16px 40px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dt { border-bottom: 0; padding-bottom: 0; }
  .page-head h1 { font-size: 19px; }
  .page-actions .btn { padding: 6px 10px; }
  /* 表は 1 行ずつのカードにする */
  .table-card { background: transparent; border: 0; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable thead { display: none; }
  .rtable tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 8px; }
  .rtable td { border: 0; padding: 4px 0; display: flex; gap: 10px; align-items: flex-start; }
  .rtable td::before { content: attr(data-label); flex: 0 0 6.5em; font-size: 11px; color: var(--muted); padding-top: 2px; }
  .rtable td[data-label=""]::before { display: none; }
  .rtable td:first-child { font-weight: 600; font-size: 14px; }
  .rtable td > * { min-width: 0; }
  .rtable [data-live-empty] td::before { display: none; }
  /* 一覧の行：バッジや日付は下に折り返す */
  .list-item { flex-wrap: wrap; align-items: flex-start; }
  .list-item .grow { flex: 1 1 calc(100% - 40px); }
  .list-item .li-badges { flex-basis: 100%; justify-content: flex-start; padding-left: 20px; }
  .list-item > .btn { margin-left: auto; }
  .notice-row { flex-wrap: wrap; align-items: flex-start; padding: 12px; }
  .notice-row .grow { flex: 1 1 calc(100% - 44px); }
  .notice-row .li-badges { flex-basis: 100%; justify-content: flex-start; padding-left: 20px; order: 3; }
  .notice-row .nr-chev { display: none; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters input, .filters select, .filters input[type=search] { width: 100%; max-width: none; min-width: 0; flex: none; }
  /* タブは折り返して全部見えるようにする（横スクロールで隠さない） */
  .tabs { flex-wrap: wrap; overflow: visible; gap: 4px; border-bottom: 0; }
  .tabs a { border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; background: var(--surface); }
  .tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
  .danger-item .btn { width: 100%; justify-content: center; }
  .board-col { flex-basis: 78vw; }
  .sheet { padding: 12px 8px; }
  .issue { padding-left: 0; }
  .resp > summary { flex-wrap: wrap; }
  .resp .resp-at { margin-left: 0; flex-basis: 100%; padding-left: 26px; }
  details.perm > summary { flex-wrap: wrap; }
  details.perm .perm-sum { margin-left: 26px; flex-basis: 100%; }
  .kind-card .num { font-size: 22px; }
  .seg { width: 100%; }
  .seg a { flex: 1; text-align: center; }
  .page-head .seg + .muted { width: 100%; }
  .req-actions { width: 100%; }
  .req-actions .btn { flex: 1; justify-content: center; }
  .confirm-box .btn { width: 100%; justify-content: center; }
  .bars-label { width: auto; }
}

/* ── 2026-11-10 追加 ── */
.q-order { display: inline-flex; align-items: center; gap: 4px; }
.q-grip { cursor: grab; }
.q-card.dragging { opacity: .45; border-style: dashed; }
.audience-users { margin-top: 8px; }
.user-pick { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; margin-top: 6px; max-width: 520px; background: #fff; }
.user-pick label { display: flex; gap: 6px; align-items: center; padding: 3px 0; font-weight: 400; }
.user-pick label.is-off { opacity: .5; }
/* 宛先を選んだときの「出す人」（2026-11-13） */
.audience-preview { margin-top: 6px; max-width: 640px; }
.audience-preview:empty { display: none; }
.audience-preview .audience-names { margin-top: 2px; color: var(--text-sub, #555); line-height: 1.6; }
/* リンク集のカードは全体を押せる */
a.link-card { color: var(--text); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
a.link-card:hover { text-decoration: none; border-color: #b9c6dc; box-shadow: 0 2px 6px rgba(15,23,42,.06); }
a.link-card .lc-name { color: var(--primary); overflow-wrap: anywhere; }
a.link-card:hover .lc-name { text-decoration: underline; }
a.link-card.lc-stopped .lc-name { color: var(--muted); }
a.link-card > span { display: block; }
a.link-card > .title { display: flex; }
.help-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; margin: 8px 0 16px; font-size: 13px; }
.help-box > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.help-box > summary::-webkit-details-marker { display: none; }
.help-box[open] .chev { transform: rotate(90deg); }
.help-box .chev { transition: transform .15s; }
.help-box ul { margin: 8px 0 4px; padding-left: 20px; }

/* メール管理・申請 */
.input-suffix { display: flex; align-items: center; gap: 6px; }
.input-suffix input { flex: 1; min-width: 0; }
.input-suffix > span { color: var(--muted); white-space: nowrap; }
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s; }
.card-link:hover { text-decoration: none; border-color: var(--primary); }
.card-link h2 { margin: 0 0 4px; }
.secret { font-size: 15px; letter-spacing: .04em; background: var(--gray-weak); padding: 2px 8px; border-radius: 6px; user-select: all; }

/* Web メール */
.wm-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.wm-side { position: sticky; top: 12px; z-index: 30; /* アドレスのドロップダウンを一覧（日付の見出しなど）より上に出す */  display: flex; flex-direction: column; gap: 10px; }
.wm-new { justify-content: center; }
.wm-switch { width: 100%; font-size: 12px; }
.wm-folders { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; }
.wm-folders a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 6px; color: var(--text); font-size: 13px; }
.wm-folders a:hover { background: var(--gray-weak); text-decoration: none; }
.wm-folders a.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.wm-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.wm-tools .inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wm-table td { vertical-align: top; }
.wm-check { width: 28px; }
.wm-date { width: 90px; white-space: nowrap; color: var(--muted); font-size: 12px; }
.wm-row-link { color: var(--text); display: block; }
.wm-row-link:hover { text-decoration: none; color: var(--primary); }
.wm-unseen td { font-weight: 700; }
.wm-pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 12px; }
.wm-subject { font-size: 18px; margin: 0 0 10px; word-break: break-word; }
.wm-atts { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.wm-atts .chip { padding: 4px 10px; color: var(--text); }
.wm-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); word-break: break-word; overflow-wrap: anywhere; }
.wm-body p { margin: 0 0 1em; }
.wm-compose-body { min-height: 320px; font-family: inherit; }
@media (max-width: 760px) {
  .wm-layout { grid-template-columns: 1fr; }
  .wm-side { position: static; }
  .wm-folders { flex-direction: row; flex-wrap: wrap; }
}

/* メールアドレスのまとまり（メイン＞組織＞プロジェクト＞サブ）。開閉できる */
.mail-groups { display: flex; flex-direction: column; gap: 10px; }
.mail-group > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; padding: 6px 2px; font-size: 14px; }
.mail-group > summary::-webkit-details-marker { display: none; }
.mail-group > summary .chev { transition: transform .15s; }
.mail-group[open] > summary .chev { transform: rotate(90deg); }
.mail-group > .card { margin-top: 4px; }
.wm-view { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.wm-html { display: block; width: 100%; height: 70vh; min-height: 360px; margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.wm-usage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.wm-usage-warn { border-color: var(--amber); }
.wm-bar { width: 100%; height: 8px; }
.wm-note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.text-warn { color: var(--amber); }
.card-new { border-color: var(--primary); box-shadow: inset 4px 0 0 var(--primary); }

/* 読み込み中（画面を移るとき上に出す帯。少し待ってから出し、すぐ開ける画面ではちらつかせない） */
#page-loading { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .15s ease; }
body.is-loading #page-loading { opacity: 1; visibility: visible; transition-delay: .25s; }
body.is-loading { cursor: progress; }
.page-loading-bar { height: 3px; background: linear-gradient(90deg, transparent 0, var(--primary, #2563eb) 40%, var(--primary, #2563eb) 60%, transparent 100%); background-size: 40% 100%; background-repeat: no-repeat; animation: page-loading 1.1s ease-in-out infinite; }
.page-loading-text { position: absolute; top: 8px; right: 12px; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--surface, #fff); color: var(--muted, #555); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
@keyframes page-loading { 0% { background-position: -40% 0; } 100% { background-position: 140% 0; } }
.loading-dots::after { content: '…'; display: inline-block; animation: loading-dots 1.2s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; width: 0; }
@keyframes loading-dots { to { width: 1.2em; } }
@media (prefers-reduced-motion: reduce) { .page-loading-bar { animation: none; background: var(--primary, #2563eb); } .loading-dots::after { animation: none; width: auto; } }

/* 組織のアイコン（2026-11-11） */
.org-icon { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; vertical-align: -4px; margin-right: 6px; }
.org-icon-edit { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.org-icon-preview { width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--border, #d8dde6); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.org-icon-preview img { width: 64px; height: 64px; object-fit: cover; }

/* ホーム：数のタイル・今やること・よく使うリンク（2026-11-11。掲示板のように全部並べず、すっきりまとめる） */
.home-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.home-tile .num { font-size: 24px; }
.home-tile.tile-has { border-color: #b9cdf3; }
.home-tile.tile-has .num { color: var(--primary); }
.home-tile.tile-alert { border-color: #f1b5b5; background: var(--danger-weak); }
.home-tile.tile-alert .num, .home-tile.tile-alert .stat-top { color: var(--danger); }
.home-tile .tile-state { font-size: 13px; font-weight: 600; color: var(--amber); }
.home-tile .num.loading-dots { font-size: 16px; color: var(--muted); }
.home-sec { margin-bottom: 20px; }
.home-h { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.home-h-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.home-list { padding: 4px 0; }
.home-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; color: var(--text); border-top: 1px solid var(--border); }
.home-row:first-child { border-top: 0; }
.home-row:hover { background: var(--gray-weak); text-decoration: none; }
.home-row > .icon { color: var(--muted); flex: none; }
.home-row .hr-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.home-row .hr-meta { flex: none; }
.home-row .hr-chev { color: var(--muted); flex: none; }
.home-more { padding: 6px 14px 8px; }
/* ホームのよく使うリンク：押しやすい大きさのカード。名前・説明・URL を出す（2026-11-13。Pocket・リンク集にそろえる） */
.link-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.link-chip { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 14px; min-width: 0; }
.link-chip:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.link-chip .lc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ホームのよく使うリンクに説明も出す（2026-11-13） */
.link-chip .lc-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.link-chip .lc-name { font-weight: 600; color: var(--primary); }
.link-chip .lc-desc { font-size: 12px; color: var(--muted, #667); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-chip .lc-url { font-size: 11px; color: var(--muted, #889); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .home-row { flex-wrap: wrap; row-gap: 2px; }
  .home-row .hr-title { flex-basis: calc(100% - 60px); white-space: normal; }
  .home-row .hr-meta { margin-left: 26px; }
}

/* 管理者ダッシュボードの概要：設定する場所（サイドバーと同じ区切り） */
.admin-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.admin-menu .card { margin: 0; }
.am-cat h3 { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 0 0 6px; }
.am-cat ul { list-style: none; margin: 0; padding: 0; }
.am-cat li a { display: flex; flex-direction: column; padding: 6px 8px; margin: 0 -8px; border-radius: 6px; color: var(--text); }
.am-cat li a:hover { background: var(--gray-weak); text-decoration: none; }
.am-cat .am-name { font-weight: 600; color: var(--primary); font-size: 13.5px; }

/* ═════════ ここから YGR Pocket（テスト版 v0.4 の pocket.css から。Web メールは YGR Hub と同じ wm-* を使う） ═════════ */
/* YGR Pocket だけの見た目。共通の部品は style.css（YGR Hub のモックのコピー）を使う */
:root { --sidebar: 232px; --tabbar: 60px; }
.nav-toggle { display: none !important; }

/* ── 下のタブ（狭い画面だけ） ── */
.tabbar { display: none; }
@media (max-width: 760px) {
  .sidenav { display: none !important; }
  .main { padding: 12px 16px calc(var(--tabbar) + 28px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 0 4px env(safe-area-inset-bottom); height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; min-width: 0; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.active { color: var(--primary); font-weight: 700; }
  .tabbar .icon { width: 24px; height: 24px; }
  .tabbar .tb-ic { position: relative; display: inline-flex; }
  .tabbar .tb-count { position: absolute; top: -4px; left: 15px; background: var(--danger); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700; min-width: 17px; line-height: 17px; padding: 0 4px; text-align: center; border: 1.5px solid var(--surface); }
  .toast { bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); }
  .btn { min-height: 40px; }
  .btn-small { min-height: 32px; }
  input[type=text], input[type=email], input[type=search], select, textarea { font-size: 16px; } /* iOS で拡大しないように */
  .testbar select { font-size: 12px; }
}

/* ── 戻る ── */
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.back .icon { transform: rotate(180deg); }
.back:hover { color: var(--text); text-decoration: none; }

/* ── ホーム ── */
.hello { margin-bottom: 14px; }
.hello h1 { font-size: 20px; }
.home-sec { margin-bottom: 18px; }
.home-sec > .sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 8px; }
.home-sec > .sec-head h2 { margin: 0; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.home-sec > .sec-head a { font-size: 13px; }
.mail-tile { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text); }
.mail-tile:hover { text-decoration: none; border-color: #b9c6dc; }
.mail-tile .num { font-size: 26px; font-weight: 700; line-height: 1; }
.mail-tile .grow { flex: 1; min-width: 0; }

/* ── カード型の一覧（通知・アンケート・申請） ── */
.clist { display: flex; flex-direction: column; gap: 8px; }
.crow { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; color: var(--text); min-height: 56px; }
.crow:hover { text-decoration: none; border-color: #b9c6dc; box-shadow: 0 2px 6px rgba(15,23,42,.06); }
.crow .cr-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--gray-weak); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.crow .cr-ic .icon { width: 20px; height: 20px; }
.crow .cr-ic.sys-hub { background: var(--primary-weak); color: var(--primary); }
.crow .cr-ic.sys-inventory { background: var(--green-weak); color: var(--green); }
.crow .cr-ic.sys-mail { background: var(--amber-weak); color: var(--amber); }
.crow .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.crow .cr-title { font-weight: 600; overflow-wrap: anywhere; }
.crow.unread .cr-title { color: var(--primary); }
.crow .meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crow .cr-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.crow .nr-chev { color: #b0b7c3; align-self: center; }
.crow.needs { border-color: #f1b5b5; box-shadow: inset 4px 0 0 var(--danger); }
.crow-wrap { position: relative; }
.crow-wrap .crow { padding-right: 132px; }
.crow-wrap .crow-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 760px) {
  .crow-wrap .crow { padding-right: 14px; padding-bottom: 56px; }
  .crow-wrap .crow-btn { top: auto; bottom: 10px; transform: none; left: 62px; right: 12px; justify-content: center; }
}

/* ── その他 ── */
.menu-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.menu-list a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); border-bottom: 1px solid var(--border); font-size: 15px; }
.menu-list a:last-child { border-bottom: 0; }
.menu-list a:hover { background: #fafbfc; text-decoration: none; }
.menu-list a .grow { flex: 1; }
.menu-list a .nr-chev { color: #b0b7c3; }

/* ── 詳細 ── */
.detail-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.detail-head h1 { font-size: 19px; line-height: 1.4; overflow-wrap: anywhere; }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.vpn-note { display: flex; gap: 10px; align-items: flex-start; }
.vpn-note .icon { flex: none; margin-top: 2px; }

/* ── 申請の経過 ── */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { position: relative; padding: 0 0 16px 28px; }
.steps li::before { content: ''; position: absolute; left: 8px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.steps li:last-child::before { display: none; }
.steps .st-dot { position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--gray-weak); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.steps .st-dot .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.steps .st-ok .st-dot { background: var(--green-weak); color: var(--green); }
.steps .st-ng .st-dot { background: var(--danger-weak); color: var(--danger); }
.steps .st-wait .st-dot { background: var(--amber-weak); color: var(--amber); }
.steps .st-who { font-weight: 600; }
.steps .st-note { background: var(--gray-weak); border-radius: 6px; padding: 6px 10px; margin-top: 4px; font-size: 13px; }

/* ── アンケートの回答 ── */
.q-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.q-block.err { border-color: var(--danger); }
.q-block .q-label { font-weight: 600; margin-bottom: 8px; }
.q-block .q-err { color: var(--danger); font-size: 12px; margin-top: 6px; display: none; }
.q-block.err .q-err { display: block; }
.opt-list { display: flex; flex-direction: column; gap: 6px; }
.opt-list label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; min-height: 44px; }
.opt-list label:has(input:checked) { border-color: var(--primary); background: var(--primary-weak); }
.opt-list input { width: 18px; height: 18px; margin: 0; flex: none; }
.sched-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sched-row:last-child { border-bottom: 0; }
.sched-row .grow { flex: 1; }
.ox { display: inline-flex; gap: 4px; }
.ox button { width: 44px; height: 40px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font: inherit; font-size: 16px; font-weight: 700; color: var(--muted); cursor: pointer; }
.ox button.on-o { background: var(--green-weak); border-color: var(--green); color: var(--green); }
.ox button.on-t { background: var(--amber-weak); border-color: var(--amber); color: var(--amber); }
.ox button.on-x { background: var(--danger-weak); border-color: var(--danger); color: var(--danger); }
.q-block textarea, .q-block input[type=text] { width: 100%; max-width: none; }
.submit-bar { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; }
@media (max-width: 760px) {
  .submit-bar { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .submit-bar .btn { width: 100%; justify-content: center; }
}
.answer-list dt { color: var(--muted); font-size: 12px; margin-top: 10px; }
.answer-list dd { margin: 2px 0 0; white-space: pre-wrap; }

/* ── マイページ ── */
.addr-group { margin-bottom: 14px; }
.addr-group h3 { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0 0 6px; }
.addr-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.addr-row:last-child { border-bottom: 0; }
.addr-row .grow { flex: 1 1 200px; min-width: 0; }
.addr-row .mono { overflow-wrap: anywhere; }
.usage { flex: 0 0 180px; font-size: 12px; color: var(--muted); }
.usage .bar { margin-top: 3px; }
.usage.warn .bar > span { background: var(--amber); }
@media (max-width: 760px) { .usage { flex-basis: 100%; } }

.folder-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.folder-chips a { flex: none; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; background: var(--surface); color: var(--text); }
.folder-chips a:hover { text-decoration: none; }
.folder-chips a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.fab { position: fixed; right: 16px; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); z-index: 24; border-radius: 999px; box-shadow: 0 6px 16px rgba(47,111,219,.35); padding: 12px 18px; min-height: 48px; }
/* ── ポップアップの所属組織 ── */
.up-row .mono { font-size: 12px; }

/* ── 種別の切り替えの説明（テスト用） ── */
.kind-note { font-size: 12px; }

/* ── 問い合わせのやり取り ── */
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; max-width: 88%; background: var(--surface); }
.msg-mine { align-self: flex-end; background: var(--primary-weak); border-color: #c9dbf7; }
.msg-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.reply-box textarea { width: 100%; max-width: none; }
@media (max-width: 760px) {
  .msg { max-width: 100%; }
  .reply-box .btn-primary { width: 100%; justify-content: center; }
}
.thread-head { flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 12px; }

/* ── 申請の判断 ── */
.decision-box textarea { width: 100%; max-width: none; }
.decision-box .q-err { display: none; color: var(--danger); font-size: 12px; margin-top: 4px; }
.decision-box .q-block-err textarea { border-color: var(--danger); }
.decision-box .q-block-err .q-err { display: block; }
.decision-actions { display: flex; gap: 8px; }
@media (max-width: 760px) { .decision-actions .btn { flex: 1; justify-content: center; } }

/* ── YGR Pocket の追加（本実装） ── */
.pocket-filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.crow .cr-snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .unread-dot { margin-top: 8px; }
.crow-btn { margin: 0; }
.cr-ic-lg { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--gray-weak); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.cr-ic-lg.sys-hub { background: var(--primary-weak); color: var(--primary); }
.cr-ic-lg.sys-inventory { background: var(--green-weak); color: var(--green); }
.cr-ic-lg.sys-mail { background: var(--amber-weak); color: var(--amber); }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-18 { margin-bottom: 18px; } .mt-8 { margin-top: 8px; }
.link-card .link-name { color: var(--primary); }
.back-narrow { display: none; }
@media (max-width: 760px) {
  .back-narrow { display: block; }
  .topbar .user-name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .crow-wrap .crow-btn .btn { width: 100%; justify-content: center; }
}
/* 自分のアイコン（YGR Hub と同じ） */
.avatar { border-radius: 50%; object-fit: cover; vertical-align: -4px; margin-right: 6px; flex: none; background: var(--gray-weak); }
.user-btn .avatar { margin-right: 0; vertical-align: middle; border: 1px solid rgba(255,255,255,.35); }
.up-head .avatar { margin-right: 0; }
.up-row .org-icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
/* アイコンの大きさ（画像あり・なしで同じ）と、画像がないときのピクトグラム */
.avatar, .org-icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; overflow: hidden; }
.av-16 { width: 16px; height: 16px; } .av-18 { width: 18px; height: 18px; } .av-20 { width: 20px; height: 20px; }
.av-22 { width: 22px; height: 22px; } .av-40 { width: 40px; height: 40px; } .av-64 { width: 64px; height: 64px; }
.org-icon.av-16 { border-radius: 4px; } .org-icon.av-64 { border-radius: 12px; margin-right: 0; }
.avatar-none, .org-icon-none { background: var(--gray-weak); color: var(--muted); }
.avatar-none .icon, .org-icon-none .icon { width: 62%; height: 62%; }
.user-btn .avatar-none { background: rgba(255,255,255,.15); color: #fff; }
.org-icon-preview .avatar, .org-icon-preview .org-icon { margin: 0; }

/* ── プッシュ通知・自動更新・版（v1.1.0） ── */
.push-card { margin-bottom: 12px; }
.push-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.push-row .grow { flex: 1 1 220px; min-width: 0; }
.push-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--primary-weak); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.push-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.update-bar { position: fixed; left: 50%; transform: translateX(-50%); top: 64px; z-index: 60; display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 8px 6px 16px; box-shadow: 0 6px 18px rgba(15,23,42,.15); font-size: 13px; }
.nav-version { padding: 12px 14px 4px; font-size: 11px; }
.nav-collapsed .nav-version { display: none; }
.app-version { text-align: center; margin-top: 16px; }
tr.wm-click { cursor: pointer; }
tr.wm-click:hover td { background: #fafbfc; }
/* ── スマートフォンで拡大・縮小しない（v1.1.1）。ダブルタップでの拡大も止める ── */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body { touch-action: pan-x pan-y; }
/* ── 使い方（紙芝居。v1.2.0） ── */
.howto { position: fixed; inset: 0; z-index: 70; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.howto[hidden] { display: none; }
.howto-box { position: relative; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 16px; padding: 18px 18px 12px; box-shadow: 0 20px 50px rgba(15,23,42,.3); }
.howto-close { position: absolute; top: 10px; right: 10px; background: none; border: 0; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; }
.howto-close:hover { background: var(--gray-weak); }
.howto-tabs { display: inline-flex; background: var(--gray-weak); border-radius: 999px; padding: 3px; margin-bottom: 10px; }
.howto-tabs[hidden] { display: none; }
.howto-tabs button { border: 0; background: none; font: inherit; font-size: 13px; padding: 5px 14px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.howto-tabs button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.howto-slide { text-align: center; animation: howto-in .25s ease; }
.howto-slide h2 { font-size: 17px; margin: 10px 0 6px; }
.howto-slide p { margin: 0 0 10px; font-size: 14px; line-height: 1.7; color: var(--text); text-align: left; }
.howto-slide p.howto-install, .howto-slide p:has(> .btn) { text-align: center; }
@keyframes howto-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.howto-art { display: flex; justify-content: center; background: linear-gradient(180deg, #eef3fb, #f7f9fc); border-radius: 12px; padding: 12px 0 6px; }
.hw-art { width: 132px; height: 226px; }
.hw-frame { fill: #1f2a3c; } .hw-screen { fill: #fff; }
.hw-head { fill: #1f2a3c; } .hw-line { fill: #e3e8f0; } .hw-short { width: 52px; }
.hw-bar { fill: #f1f3f6; } .hw-ic { fill: none; stroke: #2f6fdb; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hw-ic-dot { fill: #1f2a3c; } .hw-url { fill: #e3e8f0; }
.hw-sheet { fill: #fff; stroke: #d8dee8; } .hw-row { fill: #f4f6f9; } .hw-row-on { fill: #e3edfc; stroke: #2f6fdb; stroke-width: 1; }
.hw-t { font-size: 7.5px; fill: #3b4557; font-family: system-ui, sans-serif; } .hw-t-on { fill: #2f6fdb; font-weight: 700; } .hw-t-c { text-anchor: middle; }
.hw-t-m { fill: #8a94a6; } .hw-t-w { fill: #fff; font-size: 6px; font-weight: 700; }
.hw-app { fill: #dfe4ec; } .hw-app-pocket { fill: #1f2a3c; } .hw-pocket { fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.hw-tab { fill: #b9c2d0; } .hw-tab-on { fill: #2f6fdb; }
.hw-card { fill: #fff; stroke: #d8dee8; } .hw-btn { fill: #2f6fdb; }
.hw-dim { fill: rgba(15,23,42,.35); } .hw-dialog { fill: #fff; } .hw-sep { stroke: #e3e8f0; }
.hw-banner { fill: #fff; stroke: #d8dee8; filter: drop-shadow(0 2px 3px rgba(15,23,42,.18)); }
.hw-spot { fill: none; stroke: #e5484d; stroke-width: 2.2; }
.hw-spot-pulse { fill: none; stroke: #e5484d; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: hw-pulse 1.6s ease-out infinite; }
@keyframes hw-pulse { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.8); } }
.howto-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.howto-nav .btn { min-width: 84px; justify-content: center; }
.howto-dots { display: flex; gap: 6px; }
.howto-dots span { width: 7px; height: 7px; border-radius: 50%; background: #d3d9e3; }
.howto-dots span.on { background: var(--primary); width: 18px; border-radius: 4px; }
.howto-later { display: block; margin: 8px auto 0; background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; }
.mt-12 { margin-top: 12px; }

/* ── Web メール：スマートフォンは Gmail のような形（v1.3.0）。PC は今までどおり ── */
.gm-top, .gm-label, .gm-fab, .gm-scrim, .gm-replybar, .gm-selcount { display: none; }
.wm-table .gm-av { display: none; }
.gm-avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 16px; flex: none; position: relative; cursor: pointer; user-select: none; }
.gm-avatar .gm-ok { display: none; }
.gm-avatar .gm-ok .icon { width: 20px; height: 20px; stroke-width: 2.4; }
.gm-c0 { background: #5b7fd8; } .gm-c1 { background: #d8665b; } .gm-c2 { background: #3e9e6e; } .gm-c3 { background: #c48a1f; }
.gm-c4 { background: #8b63c9; } .gm-c5 { background: #2f9ab3; } .gm-c6 { background: #c25b94; } .gm-c7 { background: #6d7a8c; }
.gm-from summary { list-style: none; }
.gm-from summary::-webkit-details-marker { display: none; }
@media (min-width: 761px) {
  .gm-from > summary { display: none; }
  .gm-from > .kv { display: grid; }
  .gm-from:not([open]) > .kv { display: grid; }
}
@media (max-width: 760px) {
  body.pocket .main:has(.wm-layout) { padding-left: 0; padding-right: 0; padding-top: 6px; }
  .wm-layout { display: block; }
  .wm-pager { padding: 8px 16px; }
  /* 1 通を読む */
  .wm-main .wm-msg { border: 0; border-radius: 0; box-shadow: none; padding: 8px 16px 16px; }
  .wm-main > .wm-tools { padding: 0 12px; margin-bottom: 4px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .wm-main > .wm-tools .btn, .wm-main > .wm-tools select { flex: none; }
  .wm-main > .wm-tools .btn-primary[href*="mode=reply"], .wm-main > .wm-tools a[href*="mode=replyall"], .wm-main > .wm-tools a[href*="mode=forward"] { display: none; }
  .wm-subject { font-size: 20px; font-weight: 600; margin: 4px 0 12px; }
  .gm-from > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 4px 0 10px; }
  .gm-from-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .gm-from-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gm-from-date { align-self: flex-start; }
  .gm-from > .kv { display: none; }
  .gm-from[open] > .kv { display: grid; background: var(--gray-weak); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }
  .gm-replybar { display: flex; gap: 8px; position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding: 10px 16px; background: var(--bg); }
  .gm-replybar .btn { flex: 1; justify-content: center; border-radius: 999px; gap: 6px; }
  .wm-html { height: auto; min-height: 60vh; border: 0; border-radius: 0; }
}
/* ── PC のヘッダー（v1.3.0）：細いバー 1 本に、ロゴ・真ん中の検索・自分のアイコン（Chrome の上のバーのような形）。左のメニューはそのまま ── */
.top-search { display: none; }
@media (min-width: 761px) {
  .topbar { height: 48px; padding: 0 12px; gap: 12px; }
  .layout { min-height: calc(100vh - 48px); }
  .sidenav { top: 48px; height: calc(100vh - 48px); }
  .brand { gap: 6px; }
  .brand .brand-name { display: none; }
  .brand .brand-icon { width: 26px; height: 26px; }
  .top-search { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 720px; height: 34px; margin: 0 auto 0 8px; padding: 0 6px 0 12px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; }
  .top-search:focus-within { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.3); }
  .top-search-ic { color: rgba(255,255,255,.8); flex: none; }
  .top-search input[type=search] { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; font-size: 14px; padding: 0; height: 100%; box-shadow: none; outline: none; }
  .top-search input::placeholder { color: rgba(255,255,255,.65); }
  .top-search-go { background: none; border: 0; color: rgba(255,255,255,.7); padding: 4px; border-radius: 50%; cursor: pointer; display: inline-flex; }
  .top-search-go:hover { color: #fff; background: rgba(255,255,255,.12); }
  .topbar-right { margin-left: 0; }
  .user-btn { padding: 2px; border-radius: 50%; background: transparent; border-color: transparent; }
  .user-btn .user-name, .user-btn .user-chev { display: none; }
  .user-btn .avatar { width: 30px; height: 30px; }
  .user-pop { top: 50px; }
}
/* ── PC にインストールした窓：^ でタイトルバーにヘッダーをまとめる（Window Controls Overlay。v1.3.1） ── */
.top-search-key { display: none; }
@media (min-width: 761px) {
  .top-search-key { display: inline; font: inherit; font-size: 11px; color: rgba(255,255,255,.6); border: 0; background: none; padding: 0 4px; white-space: nowrap; }
  .top-search:focus-within .top-search-key { display: none; }
}
@media (display-mode: window-controls-overlay) {
  /* タイトルバーの場所（窓のボタンを除いたところ）にヘッダーを置く。何もないところをつかむと窓を動かせる */
  .topbar { position: fixed; left: env(titlebar-area-x, 0); top: env(titlebar-area-y, 0); width: env(titlebar-area-width, 100%); height: env(titlebar-area-height, 40px); padding: 0 8px; -webkit-app-region: drag; app-region: drag; z-index: 40; }
  .topbar a, .topbar button, .topbar input, .topbar form { -webkit-app-region: no-drag; app-region: no-drag; }
  .top-search { height: calc(env(titlebar-area-height, 40px) - 8px); max-width: 560px; }
  .brand .brand-icon { width: 22px; height: 22px; }
  .user-btn .avatar { width: 26px; height: 26px; }
  .layout { padding-top: env(titlebar-area-height, 40px); min-height: 100vh; }
  .sidenav { top: env(titlebar-area-height, 40px); height: calc(100vh - env(titlebar-area-height, 40px)); }
  .user-pop { top: calc(env(titlebar-area-height, 40px) + 4px); }
}
/* ── 1 通を読む画面（スマートフォン。v1.3.2）：Gmail のような上のバー・本文は中身の高さ ── */
.gm-msgbar, .gm-view { display: none; }
@media (max-width: 760px) {
  .wm-main > .wm-tools { display: none !important; }
  .gm-msgbar { display: flex; align-items: center; gap: 2px; position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 4px 8px; }
  .gm-grow { flex: 1; }
  .gm-iform { display: inline-flex; gap: 2px; margin: 0; }
  .gm-ibtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: none; border: 0; color: var(--text); cursor: pointer; list-style: none; }
  .gm-ibtn::-webkit-details-marker { display: none; }
  .gm-ibtn:active { background: #e3e8f0; }
  .gm-ibtn .icon { width: 22px; height: 22px; }
  .gm-ibtn.gm-on { color: var(--amber); }
  .gm-more { position: relative; }
  .gm-menu-pop { position: absolute; right: 0; top: 46px; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.18); padding: 6px 0; z-index: 30; }
  .gm-menu-head { padding: 6px 14px; }
  .gm-menu-pop form { margin: 0; }
  .gm-menu-pop button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 12px 14px; font: inherit; font-size: 15px; color: var(--text); cursor: pointer; }
  .gm-menu-pop button:active { background: var(--gray-weak); }
  .wm-main .wm-msg { padding: 0 16px 8px; }
  .wm-main .wm-msg .wm-view { display: none; }
  .gm-view { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 8px; }
  .gm-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--text); background: var(--surface); }
  .gm-chip:hover { text-decoration: none; }
  .wm-main .wm-html { height: 60vh; min-height: 0; margin: 0 -16px; width: calc(100% + 32px); border: 0; border-radius: 0; }
  .wm-main .wm-body { font-size: 15px; line-height: 1.75; }
  .wm-atts { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
  .gm-replybar { margin-top: 8px; }
}
.notif-hide { margin-top: 18px; text-align: right; }

@media (max-width: 760px) { .wm-main .wm-html { height: 240px; } }

/* ── PC のヘッダー（v1.4.0）：検索はやめた。幅に余裕があればロゴの横に名前、自分の丸の横に名前 ── */
@media (min-width: 761px) {
  .topbar-right { margin-left: auto; }
  .user-btn { padding: 2px 10px 2px 2px; border-radius: 999px; }
  .user-btn:hover { background: rgba(255,255,255,.12); }
}
@media (min-width: 900px) {
  .brand .brand-name { display: inline; font-size: 15px; }
  .user-btn .user-name { display: inline; max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (min-width: 761px) and (max-width: 899px) { .user-btn { padding: 2px; } }
/* ── 「読み込んでいます…」はヘッダーの下に出す（v1.5.0。^ でタイトルバーにまとめたときも窓のボタンにかぶらないように） ── */
#page-loading { top: 56px; }
@media (min-width: 761px) { #page-loading { top: 48px; } }
@media (display-mode: window-controls-overlay) { #page-loading { top: env(titlebar-area-height, 40px); } }

/* ── 設定（v1.5.0） ── */
.set-sec { margin-bottom: 18px; }
.set-sec > h2 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 4px 6px; display: flex; align-items: center; gap: 6px; }
.set-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 15px; background: none; width: 100%; text-align: left; font-family: inherit; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; }
.set-row:last-child { border-bottom: 0; }
a.set-row:hover, button.set-row:hover { background: #fafbfc; text-decoration: none; }
.set-row .grow { flex: 1; min-width: 0; }
.set-row .set-val { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.set-row .nr-chev { color: #b0b7c3; }
.set-card .push-card { border: 0; border-radius: 0; margin: 0; box-shadow: none; }
.set-danger { color: var(--danger); }
/* ── メールの通知（v1.5.1）：差出人の頭文字の丸、件名は濃く ── */
.gm-avatar-sm { width: 36px; height: 36px; font-size: 15px; cursor: default; }
.crow-mail .cr-snip { color: var(--text); }
.crow-mail .meta .mono, .crow-mail .meta .addr { font-size: 11px; }
/* マウスを重ねたときだけ出す詳しい情報（UI 共通ルール「情報の出し方」。2026-11-12）。スマートフォンなどマウスのない画面では出さない */
.hov { position: relative; display: inline; }
.hov:focus { outline: none; }
.hov:focus-visible { outline: 2px solid var(--primary-weak); border-radius: 3px; }
.hov-card { display: none; position: fixed; left: 0; top: 0; z-index: 60; min-width: 180px; max-width: 320px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(15,23,42,.12); font-size: 12px; font-weight: 400; color: var(--text); white-space: normal; text-align: left; line-height: 1.5; }
.hov-row { display: flex; gap: 8px; }
.hov-row + .hov-row { margin-top: 2px; }
.hov-k { flex: none; color: var(--muted); min-width: 5.5em; }
.hov-v { min-width: 0; overflow-wrap: anywhere; }
/* マウスを重ねると詳しく出るものは青い文字にする（2026-11-13。マウスのある画面だけ） */
@media (hover: hover) { .hov { color: var(--primary); cursor: help; } .hov > a { cursor: pointer; } }
/* 一覧の中の管理者・リーダーは（）で書かず、色の付いた見出しでまとめる（2026-11-13） */
.hov-sec { display: block; margin: 4px 0 2px; padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; background: var(--bg-soft, #f1f4f9); color: var(--muted, #667); }
.hov-sec:first-child { margin-top: 0; }
.hov-sec-lead { background: var(--primary-weak, #e6efff); color: var(--primary); }
@media (hover: hover) {
  .hov:hover > .hov-card, .hov:focus-visible > .hov-card { display: block; }
}

/* 入力欄の横にボタン（Discord のチャンネル ID → 「Discord から読む」など） */
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row input { flex: 1; min-width: 0; }
.input-row .btn { flex: none; }

/* ── Web メール（2026-11-12 見直し：一覧は 1 通 1 行で件名が残りの幅を使う。宛先はチップ。差出人・署名を選べる） ── */
.wm-side-link { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 10px; color: var(--muted); }
.wm-side-link:hover { color: var(--primary); text-decoration: none; }
.wm-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.wm-item { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--border); transition: background .12s; }
.wm-item:last-child { border-bottom: 0; }
.wm-item:hover { background: var(--gray-weak); }
.wm-item:has(.wm-item-check:checked) { background: var(--primary-weak); }
.wm-item-check { flex: none; margin: 0; }
.wm-item-link { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 0; color: var(--text); }
.wm-item-link:hover { text-decoration: none; }
.wm-item-who, .wm-item-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-item-who { display: flex; align-items: center; gap: 6px; }
.wm-item-subject { color: var(--muted); }
.wm-item-meta { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.wm-unseen .wm-item-who, .wm-unseen .wm-item-subject { color: var(--text); font-weight: 700; }
.wm-unseen .wm-item-meta { color: var(--primary); font-weight: 600; }
.wm-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.wm-flag { color: var(--amber); margin-right: 4px; }
.wm-tools .btn-small { border-radius: 999px; }

.wm-msg { padding: 20px 22px; }
.wm-subject { font-size: 20px; line-height: 1.35; margin: 0 0 14px; }
.wm-head { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 12px; }
.wm-avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-weak); color: var(--primary); font-weight: 700; font-size: 16px; }
.wm-head-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wm-from-line { overflow-wrap: anywhere; }
.wm-to-line { overflow-wrap: anywhere; }
.wm-to-line > .muted { margin-right: 4px; }
.wm-head-date { flex: none; white-space: nowrap; }
.wm-more { display: inline; }
.wm-more > summary { display: inline; cursor: pointer; list-style: none; }
.wm-more > summary::-webkit-details-marker { display: none; }
.wm-more-n { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--gray-weak); color: var(--muted); font-size: 11px; line-height: 18px; margin-left: 4px; }
.wm-more[open] .wm-more-n { background: var(--primary-weak); color: var(--primary); }
.wm-more-list { margin: 6px 0 2px; padding: 8px 12px; list-style: none; background: var(--gray-weak); border-radius: 8px; display: flex; flex-direction: column; gap: 2px; }

.wm-compose-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.wm-compose-head h1 { margin: 0; font-size: 22px; }
.wm-compose-head .wm-back { align-self: center; }
.wm-compose-head h1 { flex: 1; }
.wm-compose { padding: 0; overflow: hidden; }
.wm-line { display: flex; align-items: center; gap: 10px; padding: 4px 16px; border-bottom: 1px solid var(--border); min-height: 46px; }
.wm-line-k { flex: none; width: 56px; color: var(--muted); font-size: 13px; margin: 0; }
.wm-line-v { flex: 1; min-width: 0; }
.wm-line-v > input[type=text], .wm-from select, .wm-from input { border: 0; box-shadow: none; padding: 8px 0; background: transparent; width: 100%; }
.wm-line-v > input:focus, .wm-from select:focus, .wm-from input:focus, .wm-rcpt-input:focus, .wm-compose-body:focus { outline: none; box-shadow: none; }
.wm-line:focus-within { background: color-mix(in srgb, var(--primary-weak) 35%, transparent); }
.wm-from { display: flex; gap: 10px; align-items: center; }
.wm-from select { flex: 0 1 auto; width: auto; max-width: 55%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; cursor: pointer; }
.wm-from input { flex: 1; min-width: 0; border-left: 1px solid var(--border); padding-left: 10px; }
.wm-subject-input { font-size: 15px; font-weight: 600; }
.wm-rcpt-row { display: flex; align-items: center; gap: 8px; }
.wm-rcpt { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px 0; cursor: text; }
.wm-rcpt-input { flex: 1; min-width: 160px; border: 0; padding: 4px 0; background: transparent; }
.wm-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--primary-weak); color: var(--primary); font-size: 13px; line-height: 20px; }
.wm-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-chip button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; width: 20px; height: 20px; border-radius: 50%; padding: 0; }
.wm-chip button:hover { background: rgba(0, 0, 0, .08); }
.wm-chip-bad { background: var(--danger-weak); color: var(--danger); }
.wm-cc-toggle { flex: none; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.wm-cc-toggle:hover { color: var(--primary); background: var(--gray-weak); }
.wm-compose .wm-compose-body { display: block; width: 100%; min-height: 360px; border: 0; border-radius: 0; padding: 14px 16px; resize: vertical; line-height: 1.7; font-family: inherit; }
.wm-fwd { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--border); }
.wm-compose-foot { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--gray-weak); flex-wrap: wrap; }
.wm-compose-foot .btn-primary { border-radius: 999px; padding-left: 20px; padding-right: 20px; }
.wm-attach-btn { position: relative; overflow: hidden; cursor: pointer; }
.wm-attach-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.wm-spacer { flex: 1; }
.mono-soft { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
@media (max-width: 760px) {
  .wm-item-link { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who meta" "sub sub"; gap: 2px 8px; }
  .wm-item-who { grid-area: who; }
  .wm-item-meta { grid-area: meta; }
  .wm-item-subject { grid-area: sub; }
  .wm-from { flex-direction: column; align-items: stretch; gap: 0; }
  .wm-from select { max-width: 100%; }
  .wm-from input { border-left: 0; border-top: 1px solid var(--border); padding-left: 0; }
  .wm-line { flex-wrap: wrap; }
  .wm-head { flex-wrap: wrap; }
  .wm-head-date { width: 100%; padding-left: 50px; }
}
.wm-rcpt input.wm-rcpt-input, .wm-rcpt input.wm-rcpt-input:focus { border: 0; box-shadow: none; outline: none; background: transparent; padding: 4px 0; width: auto; }
.wm-side-links { display: flex; flex-direction: column; }
/* メールの設定：アドレスごとの通知のスイッチ */
.wm-notify-list { list-style: none; margin: 0; padding: 0; }
.wm-notify-list li { border-bottom: 1px solid var(--border); }
.wm-notify-list li:last-child { border-bottom: 0; }
.wm-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; cursor: pointer; margin: 0; font-weight: normal; }
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; transition: background .15s; margin: 0; border: 0; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
input.switch:checked { background: var(--primary); }
input.switch:checked::after { transform: translateX(16px); }
input.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 宛先の候補 */
.wm-rcpt { position: relative; }
.wm-sug { position: absolute; left: 0; top: 100%; z-index: 30; min-width: min(420px, 100%); max-width: 100%; margin: 2px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(15, 23, 42, .12); }
.wm-sug li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: baseline; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.wm-sug li.on, .wm-sug li:hover { background: var(--primary-weak); }
.wm-sug-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-sug-mail { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-sug-note { color: var(--muted); font-size: 11px; white-space: nowrap; }
/* 管理者の画面のアドレス欄（転送先など）もチップ */
.form-row .wm-rcpt { border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; background: var(--surface); }
/* すべての受信箱・アドレスの色・未読の数・自動仕分け */
.wm-side-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.wm-side-row a { display: inline-flex; align-items: center; gap: 4px; }
.wm-acc { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.wm-acc .mono, .wm-acc .addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-acc-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--hue, 210) 65% 52%); }
.wm-acc-tag { display: inline-block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 8px; border-radius: 999px; font-size: 11px; line-height: 18px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: hsl(var(--hue, 210) 70% 94%); color: hsl(var(--hue, 210) 55% 32%); }
.wm-card-title { display: flex; align-items: center; gap: 8px; }
.wm-card-title .nav-count { margin-left: auto; }
.wm-filter-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wm-filter-form select, .wm-filter-form input { width: auto; min-width: 140px; }
.wm-filter-form input[name=value] { flex: 1 1 200px; }
@media (prefers-color-scheme: dark) { .wm-acc-tag { background: hsl(var(--hue, 210) 35% 22%); color: hsl(var(--hue, 210) 70% 80%); } }
/* アドレスの切り替え（専用のドロップダウン） */
.wm-acc-menu { position: relative; }
.wm-acc-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font: inherit; color: var(--text); text-align: left; }
.wm-acc-btn:hover { border-color: var(--primary); }
.wm-acc-btn[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.wm-acc-btn-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.wm-acc-chev { flex: none; color: var(--muted); transform: rotate(90deg); transition: transform .15s; }
.wm-acc-btn[aria-expanded="true"] .wm-acc-chev { transform: rotate(-90deg); }
.wm-acc-pop { position: absolute; left: 0; top: calc(100% + 4px); z-index: 40; width: max(100%, 300px); max-height: 70vh; overflow: auto; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .16); }
.wm-acc-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.wm-acc-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); }
.wm-acc-item:hover, .wm-acc-item:focus { background: var(--gray-weak); text-decoration: none; outline: none; }
.wm-acc-item.active { background: var(--primary-weak); }
.wm-acc-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wm-acc-item-main .mono, .wm-acc-item-main .addr { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-acc-item-main .small { margin: 0; }
.wm-acc-foot { border-top: 1px solid var(--border); margin-top: 6px; padding: 8px 10px 4px; }
.wm-scope a { white-space: nowrap; }
@media (max-width: 760px) { .wm-acc-pop { width: 100%; } }
/* メールの設定・テンプレート */
.wm-gear { display: inline-flex; align-items: center; gap: 6px; }
.wm-compose-head .wm-gear { margin-left: auto; }
.wm-set-acc { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.wm-set-acc .wm-acc-menu { min-width: 280px; }
.wm-set-links { display: inline-flex; gap: 12px; margin-left: auto; }
.wm-sig-area { min-height: 160px; }
.wm-tpl { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 14px; align-items: start; }
.wm-tpl-list { padding: 6px; }
.wm-tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 10px; }
.wm-tpl-item { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.wm-tpl-item:hover { background: var(--gray-weak); text-decoration: none; }
.wm-tpl-item.active { background: var(--primary-weak); }
.wm-tpl-name { font-weight: 600; }
.wm-tpl-body { min-height: 260px; }
.wm-body-tools { display: flex; align-items: center; gap: 10px; padding: 6px 16px; border-bottom: 1px solid var(--border); background: var(--gray-weak); }
.wm-body-tools select { width: auto; min-width: 220px; font-size: 13px; padding: 4px 8px; }
@media (max-width: 760px) { .wm-tpl { grid-template-columns: 1fr; } .wm-set-links { margin-left: 0; } }
/* 左の「すべての受信箱」（フォルダの上にいつも出す） */
.wm-all-nav a { font-weight: 600; }
.wm-all-nav .with-icon { gap: 8px; }
/* すべての受信箱：どのアドレスに届いたかを重く見る（受信アドレス → 差出人 → 件名 → 時刻。日付ごとの見出し） */
.wm-all-tools { align-items: flex-start; }
.wm-chipfs { display: flex; flex-wrap: wrap; gap: 6px; }
.wm-chipf { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.wm-chipf:hover { border-color: hsl(var(--hue, 215) 55% 55%); }
.wm-chipf.on { background: hsl(var(--hue, 215) 70% 94%); border-color: hsl(var(--hue, 215) 55% 55%); color: hsl(var(--hue, 215) 55% 28%); font-weight: 600; }
.wm-chipf-n { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.wm-row-head, .wm-row-link { display: grid; grid-template-columns: 48px 150px minmax(110px, 190px) minmax(0, 1fr); gap: 14px; align-items: center; }
.wm-row-head { padding: 0 14px 6px; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.wm-row-head span:first-child { text-align: left; }
.wm-list-all { padding: 0; }
.wm-list-all .wm-item { padding: 0 14px; }
.wm-day { position: sticky; top: 0; z-index: 1; padding: 6px 14px; background: var(--gray-weak); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.wm-row-link { flex: 1; min-width: 0; padding: 11px 0; color: var(--text); font-size: 14px; line-height: 1.4; }
.wm-row-link:hover { text-decoration: none; }
.wm-to { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; justify-self: start; padding: 2px 10px 2px 8px; border-radius: 6px; border-left: 3px solid hsl(var(--hue, 215) 60% 50%); background: hsl(var(--hue, 215) 70% 95%); color: hsl(var(--hue, 215) 55% 28%); font-size: 12.5px; font-weight: 700; letter-spacing: .01em; }
.wm-to-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-row-who { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.wm-row-subject { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); }
.wm-row-clip { flex: none; color: var(--muted); display: inline-flex; }
.wm-row-time { text-align: left; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.wm-unseen .wm-row-who { color: var(--text); font-weight: 700; }
.wm-unseen .wm-row-subject { font-weight: 700; }
.wm-unseen .wm-row-time { color: var(--primary); font-weight: 700; }
.wm-unseen .wm-to { box-shadow: inset 0 0 0 1px hsl(var(--hue, 215) 60% 75%); }
@media (prefers-color-scheme: dark) {
  .wm-to { background: hsl(var(--hue, 215) 35% 20%); color: hsl(var(--hue, 215) 70% 82%); }
  .wm-chipf.on { background: hsl(var(--hue, 215) 35% 22%); color: hsl(var(--hue, 215) 70% 85%); }
}
@media (max-width: 760px) {
  .wm-row-head { display: none; }
  .wm-row-link { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "time to" "who who" "sub sub"; gap: 3px 10px; }
  .wm-to { grid-area: to; } .wm-row-time { grid-area: time; } .wm-row-who { grid-area: who; } .wm-row-subject { grid-area: sub; }
}
@media (max-width: 760px) {
  .wm-chipfs { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: thin; }
  .wm-chipf { flex: none; }
  .wm-all-nav .with-icon { white-space: nowrap; }
}
/* 左の「設定」ボタン（署名・テンプレート・通知・自動仕分け・迷惑メールをまとめて） */
.wm-side-set { display: flex; justify-content: center; gap: 6px; width: 100%; color: var(--muted); }
.wm-side-set:hover { color: var(--primary); }
/* すべての受信箱のチェック（まとめて操作） */
.wm-list-all .wm-item { gap: 14px; }
.wm-list-all .wm-item-check { width: 16px; height: 16px; }
.wm-row-head { grid-template-columns: 16px 48px 150px minmax(110px, 190px) minmax(0, 1fr); }
/* 1 つのアドレスの受信箱：すべての受信箱と同じ形で、受信アドレスの列だけない */
.wm-list-one .wm-row-link { grid-template-columns: 48px minmax(120px, 220px) minmax(0, 1fr); }
.wm-row-head.wm-row-head-one { grid-template-columns: 16px 48px minmax(120px, 220px) minmax(0, 1fr); }
@media (max-width: 760px) {
  .wm-list-one .wm-row-link { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who time" "sub sub"; }
  .wm-row-head.wm-row-head-one { display: none; }
}
.wm-bulk { margin-top: 4px; }
@media (max-width: 760px) { .wm-list-all .wm-item { gap: 10px; } }

/* ── Web メール：スマートフォン（Gmail アプリにならう。2026-11-12） ──
 * 左のメニューは引き出し、一覧は差出人の丸いアイコン ＋ 2 行（差出人・時刻／件名）、選んでいるときだけ操作のバー、右下に「書く」 */
.wm-drawer-btn, .wm-drawer-x, .wm-fab, .wm-av-i, .wm-drawer-shade { display: none; }
.wm-av { display: inline-flex; align-items: center; flex: none; margin: 0; cursor: pointer; }
@media (max-width: 760px) {
  .wm-layout { display: block; }
  /* 引き出し */
  .wm-side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 300; width: min(84vw, 320px); padding: 52px 14px 20px; overflow-y: auto; background: var(--bg); box-shadow: 4px 0 24px rgba(15, 23, 42, .18); transform: translateX(-105%); transition: transform .2s ease; }
  body.wm-drawer-open .wm-side { transform: none; }
  body.wm-drawer-open { overflow: hidden; }
  .wm-drawer-shade:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 290; background: rgba(15, 23, 42, .38); }
  .wm-drawer-x { display: inline-flex; position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
  .wm-drawer-x:hover { background: var(--gray-weak); }
  .wm-side .wm-folders { flex-direction: column; }
  .wm-drawer-btn { display: inline-flex; flex: none; width: 40px; height: 40px; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; color: var(--text); cursor: pointer; margin: -4px 4px 0 -8px; }
  .wm-drawer-btn:active { background: var(--gray-weak); }
  .wm-drawer-btn .icon { width: 22px; height: 22px; }
  .wm-head-m { flex-wrap: nowrap; align-items: center; justify-content: flex-start; margin-bottom: 10px; }
  .wm-head-m > div { min-width: 0; }
  .wm-head-m .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wm-head-m h1 { font-size: 20px; margin: 0; }
  .wm-head-m .sub { font-size: 12px; }
  /* 右下の「書く」 */
  .wm-fab { display: inline-flex; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 250; align-items: center; gap: 8px; padding: 14px 20px; border-radius: 18px; background: var(--primary-weak); color: var(--primary); font-weight: 700; box-shadow: 0 4px 14px rgba(15, 23, 42, .22); }
  .wm-fab:hover { text-decoration: none; }
  .wm-fab .icon { width: 20px; height: 20px; }
  .wm-main { padding-bottom: 84px; }
  /* 一覧の 1 行：差出人の丸いアイコン（押すと選ぶ）＋ 2 行 */
  .wm-list .wm-item { gap: 12px; padding: 0 12px; }
  .wm-av { position: relative; width: 40px; height: 40px; }
  .wm-av .wm-item-check { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
  .wm-av-i { display: inline-flex; width: 40px; height: 40px; border-radius: 50%; align-items: center; justify-content: center; background: hsl(var(--hue, 215) 55% 52%); color: #fff; font-size: 17px; font-weight: 700; pointer-events: none; transition: background .12s; }
  .wm-av:has(.wm-item-check:checked) .wm-av-i { background: var(--primary); font-size: 0; }
  .wm-av:has(.wm-item-check:checked) .wm-av-i::after { content: ""; width: 9px; height: 16px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }
  .wm-item:has(.wm-item-check:checked) { background: var(--primary-weak); }
  .wm-item-link { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who meta" "sub sub"; gap: 2px 8px; padding: 12px 0; }
  .wm-item-who { font-size: 15px; }
  .wm-item-subject { font-size: 13.5px; }
  .wm-item-meta { font-size: 12px; }
  .wm-dot { display: none; }
  /* すべての受信箱：1 行目 差出人・時刻、2 行目 件名、3 行目 届いたアドレス */
  .wm-row-link { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who time" "sub sub" "to to"; gap: 2px 8px; padding: 12px 0; }
  .wm-row-time { text-align: right; font-size: 12px; }
  .wm-row-who { font-size: 15px; color: var(--text); }
  .wm-row-subject { font-size: 13.5px; }
  .wm-to { font-size: 11px; padding: 1px 8px 1px 6px; margin-top: 3px; }
  .wm-list-all .wm-item { gap: 12px; padding: 0 12px; }
  /* 操作のバーは、選んでいるときだけ上に出す */
  #wm-list > .wm-tools, [data-all-form] > .wm-bulk { display: none; }
  #wm-list:has(.wm-item-check:checked) > .wm-tools, [data-all-form]:has(.wm-item-check:checked) > .wm-bulk { display: flex; position: sticky; top: 0; z-index: 20; margin: 0 0 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 4px 12px rgba(15, 23, 42, .1); flex-wrap: nowrap; overflow-x: auto; }
  .wm-bulk .btn-small, #wm-list > .wm-tools .btn-small, .wm-bulk > label, #wm-list > .wm-tools > label, .wm-bulk > [data-all-picked] { flex: none; white-space: nowrap; }
  #wm-list > .wm-tools, .wm-bulk { align-items: center; }
  /* 検索は幅いっぱい */
  .wm-main > .filters, [data-all-inbox] > .filters { flex-direction: row; flex-wrap: nowrap; }
  .wm-main > .filters input[type=search], [data-all-inbox] > .filters input[type=search] { flex: 1; min-width: 0; border-radius: 999px; }
  /* 読む画面：上のボタンは横に流す */
  .wm-main > .wm-tools { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .wm-main > .wm-tools > * { flex: none; }
  .wm-msg { padding: 16px 14px; }
}
.wm-side-note { margin: 0; padding: 0 4px; line-height: 1.6; }
/* フォルダを作る（左のフォルダの一覧の下） */
.wm-newfolder { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.wm-newfolder > summary { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 6px; color: var(--muted); font-size: 13px; cursor: pointer; list-style: none; }
.wm-newfolder > summary::-webkit-details-marker { display: none; }
.wm-newfolder > summary:hover { background: var(--gray-weak); color: var(--primary); }
.wm-newfolder form { display: flex; gap: 6px; padding: 4px 6px 8px; }
.wm-newfolder input { flex: 1; min-width: 0; font-size: 13px; padding: 5px 8px; }
/* メール管理の表：列の幅をそろえる（2026-11-13）。スマートフォン（カード表示）では使わない */
@media (min-width: 761px) {
  .mail-tbl { table-layout: fixed; width: 100%; }
  .mail-tbl col.mc-12 { width: 12%; } .mail-tbl col.mc-15 { width: 15%; } .mail-tbl col.mc-22 { width: 22%; } .mail-tbl col.mc-24 { width: 24%; }
  .mail-tbl col.mc-30 { width: 30%; } .mail-tbl col.mc-34 { width: 34%; } .mail-tbl col.mc-36 { width: 36%; }
  .mail-tbl td { overflow-wrap: anywhere; vertical-align: top; }
}
/* 差出人などのアドレスを選ぶ欄（アドレスの切り替えと同じ専用のドロップダウン。2026-11-13） */
.wm-acc-menu-field { min-width: 240px; flex: 0 1 340px; }
.wm-acc-menu-field .wm-acc-btn { padding: 6px 10px; }
.wm-acc-menu-field .wm-acc-pop { min-width: 100%; }
button.wm-acc-item { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
button.wm-acc-item:hover, button.wm-acc-item:focus { background: var(--bg-soft, #f1f4f9); outline: none; }
.wm-acc-chev-txt { flex: none; color: var(--muted); font-size: 11px; }
.card-sub { background: var(--bg-soft, #f6f8fb); box-shadow: none; }
/* アンケートの回答へのコメント（2026-11-13） */
.resp-comments { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); display: grid; gap: 8px; }
.resp-comment { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; background: var(--bg-soft, #f6f8fb); border-radius: 8px; }
.resp-comment-form { display: grid; gap: 6px; }
/* スマートフォン：差出人の行が縦に伸びないように（縦並びでは flex-basis が高さとして効くため。2026-11-13 Pocket から連絡） */
@media (max-width: 760px) {
  .wm-from .wm-acc-menu-field { flex: none; min-width: 0; margin: 6px 0; }
}

/* ── Web メールを hub の新しい形にそろえた（v1.6.0）。Pocket の上のバー・下のタブに合わせる ── */
/* PC は hub の見出し（宛先が多いときは「他 N 人」）、スマートフォンは Pocket の 1 行（押すと宛先など） */
@media (min-width: 761px) { .wm-msg .gm-from { display: none; } }
@media (max-width: 760px) {
  .wm-msg .wm-head { display: none; }
  /* 引き出しは上の「YGR Pocket」のバーの下から出す（バーを隠さない） */
  .wm-side { top: 56px; padding-top: 52px; }
  .wm-drawer-shade:not([hidden]) { top: 56px; }
  /* 一覧の上の ☰・見出し・検索は、画面の端に付けない */
  .wm-main > .wm-head-m, .wm-main > .filters, .wm-main > .notice-bar, [data-all-inbox] > .filters, [data-all-inbox] > .wm-tools, [data-all-inbox] > .notice-bar, [data-all-inbox] > p { margin-left: 12px; margin-right: 12px; }
  .wm-main > .wm-head-m { margin-top: 4px; }
  /* 一覧の枠も画面の端に付けない（角の丸みが切れないように。v1.6.9） */
  .wm-main .wm-list, .wm-main #wm-list > .card, .wm-main .wm-pager { margin-left: 8px; margin-right: 8px; }
  /* 差出人の専用のドロップダウン：縦に並ぶので、幅の指定（flex の 340px）が高さにならないように（v1.7.1） */
  .wm-from .wm-acc-menu-field { flex: none; min-width: 0; margin: 6px 0; }
  /* 「書く」は下のタブの上に出す */
  .wm-fab { bottom: calc(var(--tabbar) + 14px + env(safe-area-inset-bottom, 0px)); }
}

/* ── PC・iPad（v1.6.4）：上のバーと左のメニューは動かさず、右の中身だけをスクロールする。
   iPad では画面全体が一緒に動いて（引っぱると跳ねて）左のメニューまでスクロールしていたため ── */
@media (min-width: 761px) {
  html, body { overscroll-behavior: none; }
  body.pocket { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
  body.pocket > .topbar { flex: none; }
  body.pocket > .layout { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  body.pocket .sidenav { position: static; height: auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  body.pocket .main { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
}
@media (min-width: 761px) and (display-mode: window-controls-overlay) {
  body.pocket > .layout { padding-top: env(titlebar-area-height, 40px); }
}

/* ヘッダーの自分のメニュー：名前の下のメイン組織（v1.7.0） */
.up-main { margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.up-row .up-badges { display: inline-flex; gap: 4px; flex: none; }
