/* verbena — 共通デザインシステム
   配色・字形はデザインイメージ（docs/design）に準拠。
   - 用紙: 暖色オフホワイト / カード: 白 / クローム: ダークネイビー
   - ワードマーク verbena はモノスペース＋広めの字間 */

:root {
  --bg:           #e7e4dd;
  --panel:        #f3f1ec;
  --card:         #ffffff;
  --navy:         #1b2433;
  --navy-deep:    #141c28;
  --ink:          #2b3240;
  /* 淡色テキスト。#8c8275 は白地3.8:1でWCAG AA未達だったため、
     トーンを保ちつつ白地5.8:1・淡背景4.7:1 の値に変更 */
  --muted:        #6d6457;
  --line:         #e4dfd5;
  --field-border: #d9d6cf;
  --field-bg:     #fbfaf8;
  --accent:       #2f3b8c;
  --danger:       #b00020;
  --radius-lg:    18px;
  --radius:       12px;
  --radius-sm:    8px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN",
          "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ── ワードマーク ─────────────────────────── */
.wordmark {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--navy);
  margin: 0;
}
.wordmark--sm      { font-size: 1.1rem; letter-spacing: 0.18em; }
.wordmark--inverse { color: #fff; }

/* ── ボタン ──────────────────────────────── */
.btn {
  font: inherit;
  font-weight: 700;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-deep); }
.btn--block { display: block; width: 100%; }

.btn--ghost-inverse {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.35);
  padding: 0.45rem 1rem;
}
.btn--ghost-inverse:hover { background: rgba(255,255,255,0.12); }

/* ── カード ──────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20,28,40,0.04), 0 8px 24px rgba(20,28,40,0.05);
}

/* ── フォーム部品 ─────────────────────────── */
.field { display: block; margin: 0 0 0.65rem; }
.field__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}
.field__input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
}
.field__input::placeholder { color: #b6b0a6; }
.field__input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,36,51,0.12);
}
/* 読取専用の値表示（field-flow 内で入力ボックスなしのテキスト表示） */
.field__value { display: block; font: inherit; overflow-wrap: anywhere; }
/* 値のリンク表示（電話 tel: / メール mailto: / URL。ui/README §3 --c-link） */
.field__link { color: var(--link, #2563eb); text-decoration: underline; text-underline-offset: 2px; }

/* フィールドを横に流すレイアウト（各フィールドは中身幅、改行divで行を区切る） */
.field-flow { display: flex; flex-wrap: wrap; gap: 0 1.1rem; align-items: flex-start; }
.field-flow .field { flex: 0 1 auto; }
.field-flow__break { flex-basis: 100%; height: 0; margin: 0; }
/* テキスト系入力は width:100% を解除し、input の size 属性（ネイティブ）で幅を決める */
.field-flow input.field__input[type="text"],
.field-flow input.field__input[type="email"],
.field-flow input.field__input[type="tel"],
.field-flow input.field__input[type="url"] { width: auto; max-width: 100%; }
/* date / number は size がネイティブに効かないので、size 値に合わせCSSで幅を与える
   （border-box・左右padding 0.85rem＋border＋ピッカー/スピナー分を加算） */
.field-flow input.field__input[type="date"][size="10"]  { width: calc(10ch + 3.4rem); }
.field-flow input.field__input[type="number"][size="6"] { width: calc(6ch + 2.9rem); }
.field-flow input.field__input[type="number"][size="4"] { width: calc(4ch + 2.9rem); }
/* select も size で幅が決まらないので中身幅にする */
.field-flow select.field__input { width: auto; max-width: 100%; }
/* モバイルでも1列に強制しない: field-flow は中身幅のまま自然に折り返す
   （狭幅は max-width:100% が入力欄のはみ出しを防ぐ。ui/README §8） */

.note {
  background: #ece7dd;
  color: var(--muted);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  margin: 0 0 1.25rem;
}

.alert { border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; margin: 0 0 1rem; font-size: 0.9rem; }
.alert--error { background: #fcebed; color: var(--danger); border: 1px solid #f3c6cc; }

/* ── ログイン画面 ─────────────────────────── */
.login-page { display: flex; flex-direction: column; min-height: 100%; }

.topbar {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  padding: 1.1rem 1.75rem;
}
.topbar__tagline { color: var(--muted); font-size: 0.85rem; }

.auth {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1.25rem 3rem;
}

.brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.65rem; }
.brand__mark {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  background: var(--navy);
  color: #fff;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.6rem;
  border-radius: 14px;
}
.brand .wordmark { font-size: 1.85rem; }
.brand__sub { color: var(--muted); font-size: 0.9rem; margin: 0; line-height: 1.5; }

.auth__card { width: 100%; max-width: 24rem; padding: 1.5rem; }
.auth__card .btn--block { margin-top: 0.25rem; }

.auth__foot { text-align: center; color: var(--muted); font-size: 0.82rem; }
.auth__foot p { margin: 0.15rem 0; }

/* ── ログイン後（アプリ内シェル）──────────────
   デスクトップ: 左ネイビーのサイドバー＋本文
   モバイル: 上部バー＋下部ナビ（サイドバーは隠す） */
.app-page { min-height: 100%; display: grid; grid-template-columns: 248px 1fr; }

/* サイドバー（デスクトップ） */
.sidebar {
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 1rem;
}
.sidebar__brand { padding: 0 0.55rem; }
.sidebar__brand .wordmark { font-size: 1.2rem; }
.sidebar__brand small {
  display: block;
  color: rgba(255,255,255,0.5);
  font-size: 0.72rem;
  margin-top: 0.3rem;
}

.sidebar__nav { display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar__heading {
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  padding: 0 0.65rem;
  margin-bottom: 0.4rem;
}

.navlink {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 0.92rem;
}
.navlink:hover { background: rgba(255,255,255,0.08); }
.navlink--active { background: rgba(255,255,255,0.14); color: #fff; font-weight: 600; }
.navlink svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }

.sidebar__user { margin-top: auto; display: flex; flex-direction: column; gap: 0.8rem; }
.userchip { display: flex; align-items: center; gap: 0.6rem; padding: 0 0.3rem; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.15);
  color: #fff;
  flex: none;
}
.avatar svg { width: 18px; height: 18px; }
.userchip__name { font-size: 0.88rem; line-height: 1.25; }
.userchip__role { font-size: 0.72rem; color: rgba(255,255,255,0.5); }
.btn--ghost-inverse.btn--block { text-align: center; }

/* 本文 */
.app-main { background: var(--bg); padding: 1rem 1.75rem 2rem; min-width: 0; }
/* 広幅モニタで本文が間延びしないよう、直下要素に上限幅を設ける（左寄せ） */
.app-main > * { max-width: 1200px; }
.app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0 1.5rem;
}
.app-title { font-size: 1.25rem; font-weight: 700; margin: 0; color: var(--ink); }

.welcome { max-width: 32rem; padding: 1.5rem; }
.welcome__hello { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.35rem; }
.welcome__id {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 1.1rem;
  color: var(--navy);
}
.roles { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.role-badge {
  background: #eef0f6;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
}

/* ── 文字アバター ───────────────────────────── */
.avatar--text {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sidebar .avatar--text { background: rgba(255,255,255,0.15); color: #fff; }
.app-main .avatar--text, .mobilebar .avatar--text {
  background: #e7eaf2; color: var(--accent);
}
.avatar--list { width: 38px; height: 38px; }

/* ── ボタン追加バリアント ─────────────────────── */
.btn--outline {
  background: var(--card);
  color: var(--ink);
  border-color: var(--field-border);
}
.btn--outline:hover { background: #f3f1ec; }
.btn--success { background: var(--success, #256f5d); color: #fff; }
.btn--success:hover { opacity: 0.92; }
.btn--danger-outline { background: var(--card); color: var(--danger); border-color: #f0c4ca; }
.btn--danger-outline:hover { background: #fcebed; }
.btn--sm { padding: 0.5rem 0.9rem; font-size: 0.85rem; }
:root { --success: #256f5d; }

/* ── ページ直下のアクション行（app-head の外・モバイルでも表示） ── */
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }

/* ── 見出し補助 ───────────────────────────────── */
.count-inline { font-size: 0.82rem; font-weight: 400; color: var(--muted); margin-left: 0.5rem; }
.result-count { color: var(--muted); font-size: 0.84rem; margin: 0 0 0.8rem; }
.result-count b { color: var(--ink); }

/* ── ツールバー（検索・フィルタ）─────────────────── */
.toolbar { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.8rem; }
.search {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.5rem 0.8rem;
}
/* 検索欄は input の outline を消しているため、枠側でフォーカスを可視化する */
.search:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,36,51,0.12);
}
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search__input { flex: 1; border: 0; background: none; font: inherit; color: var(--ink); outline: none; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.chip {
  display: inline-flex; align-items: center;
  border: 1px solid var(--field-border); background: var(--card);
  color: var(--ink); border-radius: 999px; padding: 0.4rem 0.95rem;
  font-size: 0.85rem; font-weight: 600; cursor: pointer; user-select: none;
}
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
/* チップの input は視覚的に隠すため、キーボードフォーカスはチップ側に出す */
.chip:focus-within { box-shadow: 0 0 0 3px rgba(27,36,51,0.25); }
.chip--on { background: var(--navy); color: #fff; border-color: var(--navy); }
.select {
  font: inherit; border: 1px solid var(--field-border); background: var(--card);
  color: var(--ink); border-radius: 999px; padding: 0.4rem 1rem; cursor: pointer;
}

/* ── テーブル（デスクトップ一覧）──────────────────── */
.table-card { padding: 0.25rem 0.5rem; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.6rem 0.75rem; vertical-align: middle; }
.table-wrap .table th, .table-wrap .table td { white-space: nowrap; }
.table thead th {
  font-size: 0.78rem; font-weight: 600; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.table tbody tr { border-top: 1px solid var(--line); }
.table tbody tr:first-child { border-top: 0; }
.row-link { cursor: pointer; }
.row-link:hover { background: #faf9f6; }
.cell-name { display: flex; align-items: center; gap: 0.7rem; }
.cell-name__text { display: flex; flex-direction: column; }
.cell-name__link { color: var(--ink); font-weight: 600; text-decoration: none; }
.cell-name__link:hover { text-decoration: underline; }
.cell-name__kana { color: var(--muted); font-size: 0.74rem; }
.cell-company { color: var(--accent); }
.cell-position { color: var(--accent); }
/* 操作セル（編集・完全削除）は横並び・右寄せ・中央揃え。フォーム既定マージンを消す */
.cell-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; }
.cell-actions form { margin: 0; }
/* 操作列を内容（ボタン幅）に詰める。width:1% で auto テーブルが最小幅に収め、
   nowrap でボタン文字の折り返しを防ぐ（.table-wrap 配下でないテーブルでも有効）。 */
.col-actions { width: 1%; white-space: nowrap; }

/* ── 在籍状態バッジ ──────────────────────────── */
.badge {
  display: inline-block; border-radius: 999px;
  padding: 0.2rem 0.7rem; font-size: 0.76rem; font-weight: 700; white-space: nowrap;
}
.badge--active    { background: #eef3ef; color: #256f5d; }
.badge--suspended { background: #eee0ca; color: #9a6b1e; }
.badge--withdrawn { background: #e4e1db; color: #6b6256; }
.badge--deleted   { background: #fcebed; color: var(--danger); }
.badge--muted     { background: #eef0f6; color: var(--accent); }

/* ── カードリスト（モバイル一覧）─────────────────── */
.cardlist { list-style: none; margin: 0; padding: 0; display: none; flex-direction: column; gap: 0.55rem; }
.memcard { position: relative; display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem 0.85rem; cursor: pointer; }

/* カード全面リンク: onclick でなく名前リンクの ::after をカード全体に広げる
   （長押しメニュー・新規タブ・キーボードフォーカスが効く）。
   カード内の個別リンク・操作ボタンは z-index で前面に置く。 */
a.stretched-link { color: inherit; text-decoration: none; }
a.stretched-link::after { content: ""; position: absolute; inset: 0; }
.memcard .cell-company__link, .memcard .cell-actions { position: relative; z-index: 1; }

/* 会社名の実リンク（一覧・カード内。リンク色＋下線で誤アフォーダンスを解消） */
.cell-company__link { color: var(--link, #2563eb); text-decoration: underline; text-underline-offset: 2px; }
.memcard__body { flex: 1; min-width: 0; }
.memcard__head { display: flex; align-items: center; gap: 0.5rem; }
.memcard__name { font-weight: 700; }
.memcard__kana { color: var(--muted); font-size: 0.74rem; display: block; }
.memcard__company { color: var(--accent); font-size: 0.9rem; margin-top: 0.15rem; }
.memcard__meta { color: var(--muted); font-size: 0.82rem; margin-top: 0.1rem; }
.memcard__chev { width: 18px; height: 18px; color: var(--muted); flex: none; }

.empty { padding: 2rem; text-align: center; color: var(--muted); }

/* 横スクロール可能なテーブル枠（管理画面など全幅で隠さない） */
.table-wrap { padding: 0.25rem 0.5rem; overflow-x: auto; }

/* 所属会員ミニリスト（会社詳細） */
.member-mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.member-mini { position: relative; display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem; border-radius: var(--radius-sm); cursor: pointer; }
.member-mini:hover { background: #faf9f6; }
.member-mini__name { font-weight: 600; }
.member-mini__pos { color: var(--muted); font-size: 0.85rem; margin-left: auto; }

/* ── 詳細ヘッダー戻りバー ─────────────────────── */
.app-head--detail { gap: 0.8rem; justify-content: flex-start; }
.backbtn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  text-decoration: none; flex: none;
}
.backbtn:hover { background: #f3f1ec; }
.backbtn svg { width: 18px; height: 18px; }

/* ── 会員詳細 ─────────────────────────────── */
.avatar--xl { width: 76px; height: 76px; font-size: 1.5rem; border-radius: 16px; }
.avatar--photo { object-fit: cover; }

.profile-head { display: flex; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.2rem; margin-bottom: 0.8rem; }
.profile-head__main { flex: 1; min-width: 0; }
.profile-head__title { display: flex; align-items: center; gap: 0.7rem; }
.profile-head__name { margin: 0; font-size: 1.4rem; }
.profile-head__kana { color: var(--muted); font-size: 0.82rem; margin: 0.15rem 0 0.6rem; }
.profile-head__meta { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin: 0; }
.profile-head__meta dt { color: var(--muted); font-size: 0.74rem; margin-bottom: 0.2rem; }
.profile-head__meta dd { margin: 0; font-weight: 600; }
.profile-head__meta .accent { color: var(--accent); }
.profile-head__edit { align-self: flex-start; white-space: nowrap; text-decoration: none; }

.tabs { display: flex; gap: 0.4rem; border-bottom: 1px solid var(--line); margin-bottom: 0.8rem; overflow-x: auto; }
.tab {
  padding: 0.7rem 1rem; color: var(--muted); text-decoration: none;
  font-weight: 600; font-size: 0.9rem; border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab--on { color: var(--ink); border-bottom-color: var(--navy); }

.detail-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
.section { padding: 0.95rem 1.05rem; }
.section__title { margin: 0 0 0.7rem; font-size: 1rem; }
.pill { background: #eef3ef; color: #256f5d; font-size: 0.7rem; font-weight: 700; border-radius: 999px; padding: 0.15rem 0.6rem; vertical-align: middle; }

/* ── マイページ（濃紺ヘッダー）─────────────────── */
.profile-head--navy { background: var(--navy); color: #fff; }
.profile-head--navy .profile-head__name { color: #fff; }
.avatar--on-navy { background: rgba(255,255,255,0.15); color: #fff; }
.profile-head__kana--inverse { color: rgba(255,255,255,0.6); }
.profile-head__meta--inverse dt { color: rgba(255,255,255,0.5); }
.profile-head__meta--inverse dd { color: #fff; }
.profile-head__actions { display: flex; gap: 0.5rem; align-self: flex-start; }
.note-inline { font-size: 0.74rem; font-weight: 400; color: var(--muted); margin-left: 0.5rem; }

/* ── フォーム見出し・状態変更バー ─────────────── */
.form-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7rem; }
.form-head .section__title { margin: 0; }
.form-head__actions { display: flex; gap: 0.5rem; }
.field textarea.field__input { resize: vertical; font-family: inherit; }

/* 長い編集フォームの保存バー: スクロールに追従して常に画面下部に見える */
.form-savebar {
  position: sticky;
  bottom: 0.75rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  z-index: 5;
}

.statusbar { padding: 0.8rem 1rem; margin-bottom: 0.8rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.statusbar__label { font-weight: 600; font-size: 0.9rem; }
.statusbar__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.statusbar__form { display: flex; align-items: center; gap: 0.4rem; }
.statusbar__reason { font: inherit; border: 1px solid var(--field-border); border-radius: var(--radius-sm); padding: 0.4rem 0.6rem; background: var(--field-bg); width: 11rem; max-width: 40vw; }

/* ── 組織画面 ─────────────────────────────── */
.org-units { display: flex; flex-direction: column; gap: 0.8rem; }
.org-units__group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.org-units__label { color: var(--muted); font-size: 0.78rem; min-width: 6rem; }
.chip-edit { font-size: 0.7rem; color: var(--link, #2563eb); text-decoration: none; margin-left: 0.3rem; }
.muted-text { color: var(--muted); }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1rem; }
.inline-input { width: auto; flex: 1; min-width: 8rem; }
.hist-sub { margin: 1rem 0 0.4rem; font-size: 0.85rem; color: var(--muted); }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.hist li { display: flex; flex-wrap: wrap; gap: 0.8rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.hist__label { font-weight: 600; min-width: 10rem; }
.hist__period { color: var(--muted); font-size: 0.85rem; }
.hist__extra { color: var(--muted); font-size: 0.85rem; }
.member-mini__pos { margin-left: auto; }

/* モバイル専用バー（デスクトップでは隠す） */
.mobilebar, .bottomnav { display: none; }

@media (max-width: 480px) {
  .topbar { padding: 1rem 1.25rem; flex-wrap: wrap; gap: 0.35rem; }
  .topbar__tagline { font-size: 0.78rem; }
}

/* タブレット以下: サイドバーを畳んで上部バー＋下部ナビ */
@media (max-width: 820px) {
  .app-page { grid-template-columns: 1fr; }
  .sidebar { display: none; }

  .mobilebar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem 0.4rem;
    background: var(--bg);
  }
  .mobilebar .app-title {
    font-size: 1.15rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobilebar .avatar {
    background: #eef0f6;
    color: var(--accent);
  }

  .app-head { display: none; }
  .app-main { padding: 0.4rem 0.85rem 5rem; }

  /* 一覧はテーブル→カードリストに切替（ui/README §8）。
     table-card を使う画面は必ず .cardlist の代替表示を対で持つこと。 */
  .table-card { display: none; }
  .cardlist { display: flex; }
  .detail-cols { grid-template-columns: 1fr; }

  /* 詳細ヒーロー: アクションボタンを下段全幅に落とし、本文の幅を確保する
     （actions が横に並ぶと氏名・メタが1文字ずつ折り返れる） */
  .profile-head { flex-wrap: wrap; }
  .profile-head__actions { width: 100%; order: 3; justify-content: flex-end; }
  .profile-head__meta { gap: 0.7rem 1.1rem; }

  /* 保存バーは固定ボトムナビの上に追従させる */
  .form-savebar { bottom: 72px; }

  .bottomnav {
    display: flex;
    position: fixed;
    inset: auto 0 0 0;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 0.35rem 0;
  }
  /* ログアウトのフォームも他タブと均等幅にする（右端密着・幅40pxの誤タップ対策） */
  .bottomnav form { flex: 1; display: flex; margin: 0; }
  .bottomnav form .bottomnav__item { width: 100%; }
  .bottomnav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.68rem;
    background: none;
    border: 0;
    font-family: inherit;
    cursor: pointer;
    padding: 0.25rem 0;
  }
  .bottomnav__item svg { width: 20px; height: 20px; }
  .bottomnav__item.active { color: var(--navy); font-weight: 600; }
}
