/* ==========================================================================
   まちのわ（桜ヶ丘学区 町会・自治会公式アプリ プロトタイプ）
   設計方針：
   - IT不慣れ層への徹底配慮（UDフォント・文字サイズ切替・高コントラスト・48px以上タップ）
   - 静かでちゃんとした地域の公式インフラデザイン（和紙調オフホワイト × 常磐緑）
   ========================================================================== */

:root {
  --bg-page: #F6F5F0;
  --bg-surface: #FFFFFF;
  --bg-subtle: #ECEAE2;
  --bg-accent-soft: #E9F3EF;
  --bg-danger-soft: #FCEEEA;
  --bg-warn-soft: #FBF4E4;
  --bg-info-soft: #EBF2F7;

  --text-main: #1C2420;
  --text-sub: #4E5B55;
  --text-muted: #6A7670;
  --text-inverse: #FFFFFF;

  --border: #DCD9CE;
  --border-strong: #B9B5A7;

  --brand: #1F5446;
  --brand-hover: #174035;
  --brand-light: #2E6F5E;
  --danger: #B93827;
  --danger-hover: #962A1C;
  --ok: #216E4A;
  --warn: #8B5A14;
  --line: #06C755;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(24, 34, 29, 0.06);
  --shadow-md: 0 8px 24px rgba(24, 34, 29, 0.12);

  --font-sans: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  --font-serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --max-resident: 600px;
  --max-admin: 960px;
  --nav-height: 72px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html[data-font="lg"] {
  font-size: 18.5px;
}

html[data-font="xl"] {
  font-size: 21px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.65;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + 28px);
}

body.mode-admin {
  padding-bottom: 40px;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #D97706;
  outline-offset: 2px;
}

h1, h2, h3, h4, p {
  margin: 0;
}

/* ---------- プロトタイプ切替バー ---------- */
.proto-bar {
  background: #1A2B25;
  color: #F2F4F2;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.proto-bar__inner {
  max-width: var(--max-admin);
  margin: 0 auto;
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.proto-bar__left,
.proto-bar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.proto-badge {
  background: rgba(232, 194, 122, 0.2);
  color: #F3D99F;
  border: 1px solid rgba(232, 194, 122, 0.45);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.role-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 2px;
}

.role-switch__btn {
  border: none;
  background: transparent;
  color: #D5E0DB;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.78rem;
  min-height: 32px;
  transition: background 0.15s ease, color 0.15s ease;
}

.role-switch__btn[aria-selected="true"] {
  background: #FFFFFF;
  color: #1A2B25;
}

.proto-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.proto-action-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.proto-action-btn--line {
  background: rgba(6, 199, 85, 0.18);
  border-color: rgba(6, 199, 85, 0.65);
  color: #DFFCEB;
}

.line-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  display: inline-block;
}

/* ---------- 共通ヘッダー ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.app-header__inner {
  max-width: var(--max-admin);
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  border: none;
  background: transparent;
  padding: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  min-height: 44px;
}

.brand__logo {
  flex-shrink: 0;
  border-radius: 9px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand__sub {
  font-size: 0.72rem;
  color: var(--text-sub);
  font-weight: 700;
}

.brand__name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.04em;
}

.font-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 6px;
}

.font-control__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-sub);
  padding: 0 4px;
}

.font-control__btn {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 999px;
  min-height: 32px;
}

.font-control__btn[aria-pressed="true"] {
  background: var(--brand);
  color: var(--text-inverse);
}

/* ---------- メイン領域 ---------- */
.app-main {
  max-width: var(--max-resident);
  margin: 0 auto;
  padding: 16px 14px 28px;
}

body.mode-admin .app-main {
  max-width: var(--max-admin);
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.page-desc {
  font-size: 0.92rem;
  color: var(--text-sub);
}

/* ---------- カード・バッジ・共通部品 ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.card--accent {
  background: var(--bg-accent-soft);
  border-color: #B8D8CB;
}

.card--danger {
  background: var(--bg-danger-soft);
  border: 2px solid #DFA399;
}

.card--warn {
  background: var(--bg-warn-soft);
  border-color: #E2C994;
}

.card--subtle {
  background: var(--bg-subtle);
  border-color: var(--border);
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.badge--brand {
  background: var(--bg-accent-soft);
  color: var(--brand);
  border: 1px solid #B8D8CB;
}

.badge--danger {
  background: var(--danger);
  color: #FFFFFF;
}

.badge--danger-soft {
  background: var(--bg-danger-soft);
  color: var(--danger);
  border: 1px solid #E5AFA6;
}

.badge--ok {
  background: #E2F3EA;
  color: var(--ok);
  border: 1px solid #AED8C2;
}

.badge--warn {
  background: var(--bg-warn-soft);
  color: var(--warn);
  border: 1px solid #E2C994;
}

.badge--muted {
  background: var(--bg-subtle);
  color: var(--text-sub);
  border: 1px solid var(--border);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.96rem;
  line-height: 1.3;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.08s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--full {
  width: 100%;
}

.btn--lg {
  min-height: 58px;
  font-size: 1.08rem;
  padding: 14px 20px;
  border-radius: 12px;
}

.btn--sm {
  min-height: 40px;
  padding: 7px 13px;
  font-size: 0.86rem;
}

.btn--primary {
  background: var(--brand);
  color: var(--text-inverse);
}

.btn--primary:hover {
  background: var(--brand-hover);
}

.btn--secondary {
  background: var(--bg-surface);
  color: var(--brand);
  border-color: var(--brand);
}

.btn--secondary:hover {
  background: var(--bg-accent-soft);
}

.btn--ghost {
  background: transparent;
  color: var(--text-sub);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  background: var(--bg-subtle);
}

.btn--danger {
  background: var(--danger);
  color: #FFFFFF;
}

.btn--danger:hover {
  background: var(--danger-hover);
}

.btn--ok {
  background: var(--ok);
  color: #FFFFFF;
}

.btn--ok:hover {
  background: #18573A;
}

.btn--line {
  background: var(--line);
  color: #FFFFFF;
}

.btn--line:hover {
  background: #05AE4A;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- サブタブ・チップ ---------- */
.sub-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.sub-tab {
  flex: 1 0 auto;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 9px;
  white-space: nowrap;
}

.sub-tab[aria-selected="true"] {
  background: var(--bg-surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.86rem;
  font-weight: 700;
}

.chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

/* ---------- ホーム用クイックアクション ---------- */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.action-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 13px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 110px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.action-tile:hover {
  border-color: var(--brand);
  background: #FCFDFC;
}

.action-tile--wide {
  grid-column: 1 / -1;
  min-height: 82px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.action-tile__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-accent-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.action-tile__title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.action-tile__meta {
  font-size: 0.82rem;
  color: var(--text-sub);
}

/* ---------- お知らせ・回覧板リスト ---------- */
.list-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notice-card {
  width: 100%;
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.notice-card:hover {
  border-color: var(--brand);
}

.notice-card--unread {
  border-left: 5px solid var(--brand);
}

.notice-card--pinned {
  background: #FFFDF8;
  border-color: #E2D1AC;
}

.notice-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-sub);
}

.notice-card__title {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
}

.notice-card__excerpt {
  font-size: 0.9rem;
  color: var(--text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notice-detail__body {
  font-size: 1rem;
  line-height: 1.85;
  white-space: pre-line;
  color: var(--text-main);
}

/* ---------- 安否確認 ---------- */
.safety-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.safety-btn {
  min-height: 76px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  font-weight: 700;
}

.safety-btn__main {
  font-size: 1.2rem;
  display: block;
}

.safety-btn__sub {
  font-size: 0.84rem;
  font-weight: 400;
  opacity: 0.92;
  display: block;
  margin-top: 2px;
}

.safety-btn--ok {
  background: var(--ok);
  color: #FFFFFF;
}

.safety-btn--ok:hover {
  background: #1A593B;
}

.safety-btn--help {
  background: var(--danger);
  color: #FFFFFF;
}

.safety-btn--help:hover {
  background: var(--danger-hover);
}

.safety-btn--away {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.safety-btn--away:hover {
  background: var(--bg-subtle);
}

.safety-btn--selected {
  box-shadow: 0 0 0 3px #D97706;
}

/* ---------- グラフ・プログレスバー ---------- */
.progress-track {
  width: 100%;
  height: 12px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.progress-fill--ok {
  background: var(--ok);
}

.progress-fill--danger {
  background: var(--danger);
}

.progress-fill--warn {
  background: #B97A1B;
}

/* ---------- フォーム ---------- */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.field__hint {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.96rem;
}

.textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.94rem;
}

.checkbox-row input[type="checkbox"],
.checkbox-row input[type="radio"] {
  width: 22px;
  height: 22px;
  accent-color: var(--brand);
  flex-shrink: 0;
}

/* ---------- 施設予約カレンダー表 ---------- */
.slot-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px;
}

.slot-table th {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
  text-align: center;
  padding: 4px;
}

.slot-table td {
  text-align: center;
}

.slot-date-cell {
  text-align: left !important;
  font-weight: 700;
  font-size: 0.86rem;
  white-space: nowrap;
  padding-right: 4px;
}

.slot-btn {
  width: 100%;
  min-height: 46px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 6px 4px;
}

.slot-btn--open {
  background: var(--bg-accent-soft);
  border-color: #9CC7B7;
  color: var(--brand);
}

.slot-btn--open:hover {
  background: var(--brand);
  color: #FFFFFF;
}

.slot-btn--pending {
  background: var(--bg-warn-soft);
  border-color: #E2C994;
  color: var(--warn);
}

.slot-btn--booked {
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
}

.slot-btn--selected {
  background: var(--brand);
  color: #FFFFFF;
  box-shadow: 0 0 0 2px #D97706;
}

/* ---------- スポンサー（公式応援団） ---------- */
.sponsor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sponsor-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sponsor-card__name {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text-main);
}

.sponsor-coupon-box {
  background: var(--bg-warn-soft);
  border: 1px dashed #C79A4B;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sponsor-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.sponsor-roster__item {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.84rem;
}

/* ---------- 紙の回覧板（新聞・会報誌プレビュー） ---------- */
.newspaper {
  background: #FFFEF9;
  border: 2px solid #2A322E;
  padding: 20px 18px;
  color: #1A1E1C;
  box-shadow: var(--shadow-sm);
}

.newspaper__masthead {
  border-top: 4px double #1A1E1C;
  border-bottom: 2px solid #1A1E1C;
  padding: 10px 0;
  text-align: center;
  margin-bottom: 14px;
}

.newspaper__kicker {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: #46504B;
}

.newspaper__title {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 4px 0;
}

.newspaper__meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  border-top: 1px solid #B5B2A8;
  padding-top: 6px;
  margin-top: 6px;
  color: #3D4641;
}

.newspaper__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .newspaper__grid {
    grid-template-columns: 1.35fr 1fr;
  }
}

.newspaper__article {
  border-bottom: 1px solid #C8C5BA;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.newspaper__article:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.newspaper__headline {
  font-family: var(--font-serif);
  font-size: 1.06rem;
  font-weight: 700;
  margin-bottom: 5px;
  line-height: 1.4;
}

.newspaper__body {
  font-size: 0.85rem;
  line-height: 1.7;
  color: #2A322E;
}

.newspaper__sidebox {
  border: 1px solid #2A322E;
  padding: 12px;
  background: #FAF8F1;
}

.newspaper__footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #2A322E;
  font-size: 0.75rem;
  color: #46504B;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- 管理画面 KPI & レイアウト ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-card--highlight {
  background: var(--bg-accent-soft);
  border: 2px solid var(--brand);
}

.kpi-card__label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-sub);
}

.kpi-card__value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.kpi-card--highlight .kpi-card__value {
  color: var(--brand);
}

.kpi-card__sub {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.admin-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 780px) {
  .admin-two-col {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--text-sub);
  font-weight: 700;
  font-size: 0.8rem;
  background: var(--bg-page);
}

/* ---------- 役員間連絡ボード ---------- */
.msg-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.msg-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-sub);
}

.msg-card__author {
  font-weight: 700;
  color: var(--text-main);
}

/* ---------- 下部固定ナビ（住民画面） ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-strong);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(24, 34, 29, 0.06);
}

.bottom-nav__inner {
  max-width: var(--max-resident);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.nav-item {
  border: none;
  background: transparent;
  color: var(--text-sub);
  min-height: var(--nav-height);
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
  font-size: 0.72rem;
  font-weight: 700;
}

.nav-item__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.nav-item[aria-current="page"] {
  color: var(--brand);
  background: var(--bg-accent-soft);
}

.nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 3px;
  background: var(--brand);
  border-radius: 0 0 4px 4px;
}

.nav-dot {
  position: absolute;
  top: 7px;
  right: calc(50% - 19px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- モーダル & LINE通知デモ ---------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(18, 28, 24, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-root[hidden] {
  display: none;
}

.modal-dialog {
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.modal-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-head--line {
  background: #233044;
  color: #FFFFFF;
  border-bottom: none;
}

.modal-close {
  min-width: 40px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-weight: 700;
}

.modal-body {
  padding: 16px;
}

.line-chat-bg {
  background: #8CABD9;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.line-bubble {
  background: #FFFFFF;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.line-bubble__top {
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--brand);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.line-bubble__top--danger {
  background: var(--danger);
}

.line-bubble__body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.line-bubble__title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
}

.line-bubble__text {
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* ---------- トースト ---------- */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 16px);
  transform: translateX(-50%);
  z-index: 70;
  width: min(92vw, 460px);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.mode-admin .toast-root {
  bottom: 20px;
}

.toast {
  background: #1B2C26;
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  text-align: center;
}

/* ---------- ヘルパー ---------- */
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.row-gap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.text-sub {
  color: var(--text-sub);
  font-size: 0.9rem;
}

.text-sm {
  font-size: 0.84rem;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 印刷用CSS（紙の回覧板をそのままA4印刷可能） ---------- */
@media print {
  body {
    background: #FFFFFF !important;
    padding: 0 !important;
  }

  .no-print {
    display: none !important;
  }

  .app-main {
    max-width: none !important;
    padding: 0 !important;
  }

  .newspaper {
    border-width: 1.5px;
    box-shadow: none;
    page-break-inside: avoid;
  }
}
