/* =============================================================
   テツナグ テーマ「グラファイト × エメラルド」
   -------------------------------------------------------------
   style.css の後に読み込み、見た目だけを上書きする。
   JS・HTML 構造には依存しすぎないよう、既存クラスへの上書きに限定。
   ============================================================= */

:root {
  /* サーフェス */
  --app-bg: #F1F4F8;
  --surface: #FFFFFF;
  --border-strong: #DDE3EB;
  --divider: #E4E9F0;
  --header-border: #1E293B;

  /* テキスト */
  --text-main: #0B1220;
  --text-sub: #334155;
  --text-muted: #64748B;
  --placeholder: #94A3B8;

  /* アクセント */
  --green-main: #059669;
  --green-dark: #047857;
  --green-glow: rgba(16, 185, 129, 0.35);
  --blue-main: #2563EB;

  /* サイドバー */
  --side-bg: #0B1220;
  --side-bg-2: #111A2E;
  --side-fg: #CBD5E1;
  --side-fg-muted: #64748B;
  --side-line: rgba(148, 163, 184, 0.14);

  /* バッジ */
  --badge-work-bg: #D1FAE5;
  --badge-work-fg: #047857;
  --badge-work-br: #A7F3D0;
  --badge-tomo-bg: #DBEAFE;
  --badge-tomo-fg: #1D4ED8;
  --badge-tomo-br: #BFDBFE;
  --badge-other-bg: #F1F5F9;
  --badge-other-fg: #334155;
  --badge-other-br: #E2E8F0;

  /* タブ */
  --tab-active-bg: #ECFDF5;
  --tab-active-fg: #047857;
  --tab-active-bar: #10B981;

  /* 入力欄 */
  --input-border: #CBD5E1;
  --input-focus: #10B981;
  --input-focus-shadow: rgba(16, 185, 129, 0.18);

  /* チャット */
  --chat-bg: #F1F4F8;
  --bubble-mine-bg: #DDF7EC;
  --bubble-mine-br: #B5EBD3;
  --bubble-other-bg: #FFFFFF;
  --bubble-other-br: #E2E8F0;

  /* 影 */
  --shadow-card:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 4px 16px -4px rgba(15, 23, 42, 0.08);
  --shadow-card-hover:
    0 2px 4px rgba(15, 23, 42, 0.06),
    0 16px 32px -8px rgba(15, 23, 42, 0.16);
  --shadow-header: 0 4px 20px rgba(2, 6, 23, 0.25);
  --overlay-bg: rgba(2, 6, 23, 0.6);
}

/* ---------- ベース ---------- */
body {
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-feature-settings: "palt";
  letter-spacing: 0.01em;
  background: var(--app-bg) !important;
  color: var(--text-main) !important;
}
.main-content {
  background:
    radial-gradient(1200px 400px at 100% -10%, rgba(16, 185, 129, 0.06), transparent 60%),
    var(--app-bg);
}

/* Tailwind の brand-600 を新しいエメラルドに揃える */
.text-brand-600 { color: var(--green-main) !important; }
.bg-brand-600 { background-color: var(--green-main) !important; }

/* ---------- サイドバー ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--side-bg-2) 0%, var(--side-bg) 100%);
  border-right: 1px solid #020617;
  color: var(--side-fg);
  width: 248px;
}
.sidebar .border-b,
.sidebar .border-t { border-color: var(--side-line) !important; }
.sidebar .text-gray-900 { color: #F8FAFC !important; }
.sidebar .text-gray-500 { color: var(--side-fg-muted) !important; }
.sidebar img { box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 6px 18px rgba(16,185,129,0.25); }
.sidebar > div:first-child .text-base {
  font-size: 17px;
  letter-spacing: 0.08em;
}
.sidebar > div:first-child .text-xs {
  letter-spacing: 0.12em;
  font-size: 10.5px;
}

.sidebar .menu-item {
  position: relative;
  color: var(--side-fg);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 500;
}
.sidebar .menu-item i { color: #7C8BA1; transition: color .15s; }
.sidebar .menu-item:hover {
  background: rgba(148, 163, 184, 0.10);
  color: #FFFFFF;
}
.sidebar .menu-item:hover i { color: #E2E8F0; }
.sidebar .menu-item.active {
  background: linear-gradient(90deg, rgba(16,185,129,0.22), rgba(16,185,129,0.04));
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(16,185,129,0.25);
}
.sidebar .menu-item.active i { color: #34D399; }
.sidebar .menu-item.active::before {
  content: "";
  position: absolute;
  left: -12px; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #34D399;
  box-shadow: 0 0 12px var(--green-glow);
}
.sidebar .bg-brand-100 {
  background: linear-gradient(135deg, #10B981, #047857) !important;
  color: #FFFFFF !important;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.25);
}
.sidebar #logout-btn { color: #FCA5A5 !important; }
.sidebar #logout-btn i { color: #F87171; }
.sidebar #logout-btn:hover { background: rgba(248, 113, 113, 0.10); color: #FECACA !important; }
.sidebar .thin-scroll::-webkit-scrollbar-thumb { background: #334155; }

/* ---------- スマホ用ヘッダー ---------- */
@media (max-width: 1024px) {
  .mobile-header {
    background: linear-gradient(90deg, var(--side-bg-2), var(--side-bg));
    color: #F8FAFC;
    border-bottom: 1px solid #020617;
  }
  .mobile-header .text-base { letter-spacing: 0.08em; }
  .mobile-header .btn-ghost { color: #E2E8F0; }
  .mobile-header .btn-ghost:hover:not(:disabled) { background: rgba(148,163,184,0.15); }
}

/* ---------- 見出し ---------- */
.main-content h1.font-bold {
  display: flex;
  align-items: center;
  letter-spacing: 0.04em;
  color: var(--text-main) !important;
}
.main-content h1 > i.fas:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  margin-right: 12px !important;
  border-radius: 11px;
  font-size: 17px;
  color: #FFFFFF !important;
  background: linear-gradient(135deg, #10B981 0%, #047857 100%);
  box-shadow: 0 6px 16px -4px var(--green-glow), inset 0 1px 0 rgba(255,255,255,0.25);
}
.card h2.text-sm {
  font-size: 13.5px;
  letter-spacing: 0.04em;
  color: var(--text-main) !important;
}

/* ---------- カード ---------- */
.card,
.summary-card {
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}
.card-hover:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: #A7F3D0;
  transform: translateY(-2px);
}

/* ---------- ホームのサマリカード ---------- */
.summary-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  min-height: 104px;
}
.summary-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 3px;
  background: var(--summary-accent, #94A3B8);
}
.summary-card::after {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 14px; top: 14px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 15px;
  color: var(--summary-accent, #64748B);
  background: var(--summary-tint, #F1F5F9);
}
.summary-card > .text-xs {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted) !important;
}
.summary-card > .text-2xl {
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.summary-card > .text-2xl > span { letter-spacing: 0; }
.summary-card > .text-base { margin-top: 14px !important; font-size: 15px; }

.summary-card[data-home-filter-kind="work"]     { --summary-accent: #10B981; --summary-tint: #ECFDF5; }
.summary-card[data-home-filter-kind="work"]::after     { content: "\f807"; }
.summary-card[data-home-filter-kind="tomorrow"] { --summary-accent: #3B82F6; --summary-tint: #EFF6FF; }
.summary-card[data-home-filter-kind="tomorrow"]::after { content: "\f783"; }
.summary-card[data-home-filter-kind="other"]    { --summary-accent: #64748B; --summary-tint: #F1F5F9; }
.summary-card[data-home-filter-kind="other"]::after    { content: "\f5fd"; }
.summary-card[data-unread-chat-link]            { --summary-accent: #EF4444; --summary-tint: #FEF2F2; }
.summary-card[data-unread-chat-link]::after            { content: "\f4ad"; }
.summary-card[data-home-filter-project-name]    { --summary-accent: #F59E0B; --summary-tint: #FFFBEB; }
.summary-card[data-home-filter-project-name]::after    { content: "\f133"; }

.summary-card-link:hover {
  border-color: var(--summary-accent, #10B981);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.summary-card-link:focus-visible { outline-color: rgba(16, 185, 129, 0.35); }

/* 最近のチャット行 */
.recent-chat-item {
  border-radius: 10px !important;
  padding: 10px 12px !important;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.recent-chat-item:hover {
  background: #F8FAFC;
  border-color: var(--divider);
}

/* ---------- ボタン ---------- */
.btn {
  border-radius: 10px;
  letter-spacing: 0.03em;
  transition: background .15s, box-shadow .15s, transform .1s, border-color .15s, color .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #10B981 0%, #059669 100%);
  border-color: #047857;
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 6px 14px -6px rgba(5,150,105,0.65);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 10px 20px -8px rgba(5,150,105,0.75);
}
.btn-secondary {
  border-color: var(--input-border);
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
}
.btn-secondary:hover:not(:disabled) { background: #F8FAFC; border-color: #94A3B8; }
.btn-danger { box-shadow: 0 6px 14px -8px rgba(220,38,38,0.7); }
.btn-lg { padding: 13px 24px; border-radius: 12px; }

/* ---------- フォーム ---------- */
.input, .select, .textarea {
  border-radius: 10px;
  background: #FFFFFF;
}
.input:hover, .select:hover, .textarea:hover { border-color: #94A3B8; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--input-focus); }

/* ---------- タブ ---------- */
.tabs { border-bottom-color: var(--divider); }
.tab { color: var(--text-muted); border-bottom-width: 2px; }
.tab:hover { color: var(--text-main); }
.tab.active {
  color: var(--tab-active-fg);
  background: linear-gradient(180deg, transparent 0%, var(--tab-active-bg) 100%);
}

/* ---------- バッジ ---------- */
.badge { font-weight: 700; letter-spacing: 0.04em; padding: 2px 9px; }

/* ---------- モーダル ---------- */
.modal, .modal-content {
  border-radius: 18px !important;
  box-shadow: 0 24px 64px -12px rgba(2, 6, 23, 0.45) !important;
}

/* ---------- ログイン画面 ---------- */
.login-bg {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(800px 500px at 15% 10%, rgba(16,185,129,0.28), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(37,99,235,0.18), transparent 60%),
    linear-gradient(160deg, #0B1220 0%, #111A2E 55%, #0B1220 100%);
}
.login-bg::before {
  /* 鉄筋を思わせる細いグリッド */
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148,163,184,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  pointer-events: none;
}
.login-bg > .card {
  position: relative;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 22px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(16,185,129,0.12);
  backdrop-filter: blur(8px);
}
.login-bg h1 { letter-spacing: 0.14em !important; }
.login-bg .text-sm.text-gray-500 { letter-spacing: 0.2em; font-size: 12px; }
.login-bg img { box-shadow: 0 10px 30px -8px rgba(16,185,129,0.55); }

/* 閉じたサイドバーの影が画面左端ににじまないよう、開いている時だけ影を付ける */
@media (max-width: 1024px) {
  .sidebar { box-shadow: none; }
  .sidebar.open { box-shadow: 8px 0 32px rgba(2, 6, 23, 0.45); }
}

/* =============================================================
   第2弾: ダッシュボード化・質感アップ
   ============================================================= */

/* 数字・英字ラベル用の書体 */
.font-num,
.summary-card > .text-2xl,
.home-hero-eyebrow {
  font-family: "Barlow", "Noto Sans JP", sans-serif;
}

/* メイン背景に控えめなドットグリッド */
.main-content {
  background:
    radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.07) 1px, transparent 0) 0 0 / 22px 22px,
    radial-gradient(1200px 420px at 100% -10%, rgba(16, 185, 129, 0.07), transparent 60%),
    var(--app-bg);
}

/* ページ切替時のふわっと表示 */
@keyframes tg-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.main-content > div > section,
.main-content > div > .grid,
.main-content .home-hero-stats > .summary-card {
  animation: tg-rise .45s cubic-bezier(.2,.7,.2,1) both;
}
.main-content > div > section:nth-of-type(2) { animation-delay: .05s; }
.main-content > div > section:nth-of-type(3) { animation-delay: .10s; }
.main-content > div > section:nth-of-type(4) { animation-delay: .15s; }
.main-content > div > .grid { animation-delay: .2s; }
.home-hero-stats > .summary-card:nth-child(2) { animation-delay: .04s; }
.home-hero-stats > .summary-card:nth-child(3) { animation-delay: .08s; }
.home-hero-stats > .summary-card:nth-child(4) { animation-delay: .12s; }
.home-hero-stats > .summary-card:nth-child(5) { animation-delay: .16s; }
@media (prefers-reduced-motion: reduce) {
  .main-content * { animation: none !important; }
}

/* ---------- ホーム ヒーロー ---------- */
.home-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 22px;
  color: #F8FAFC;
  background:
    radial-gradient(520px 260px at 0% 0%, rgba(16,185,129,0.30), transparent 70%),
    radial-gradient(480px 260px at 100% 100%, rgba(37,99,235,0.22), transparent 70%),
    linear-gradient(135deg, #0B1220 0%, #13203A 60%, #0B1220 100%);
  box-shadow: 0 24px 48px -24px rgba(2, 6, 23, 0.65), inset 0 1px 0 rgba(255,255,255,0.06);
}
.home-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148,163,184,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
  mask-image: linear-gradient(180deg, #000, transparent 85%);
  pointer-events: none;
}
.home-hero > * { position: relative; }
.home-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.home-hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: #34D399;
  margin-bottom: 6px;
}
.home-hero-title {
  font-size: clamp(19px, 2.6vw, 26px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: #FFFFFF;
}
.home-hero-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #CBD5E1;
  background: rgba(148,163,184,0.12);
  border: 1px solid rgba(148,163,184,0.18);
}
.home-hero-date i { color: #34D399; }
.home-hero-logo {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 12px 28px -8px rgba(16,185,129,0.6);
}
.home-hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
@media (max-width: 420px) {
  .home-hero { padding: 18px 16px; }
  .home-hero-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .home-hero-logo { width: 44px; height: 44px; border-radius: 13px; }
}

/* ヒーロー内のサマリカード（ダークガラス） */
.home-hero .summary-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  min-height: 112px;
}
.home-hero .summary-card::before { height: 2px; opacity: .9; box-shadow: 0 0 14px var(--summary-accent); }
.home-hero .summary-card::after {
  background: color-mix(in srgb, var(--summary-accent) 20%, transparent);
  color: color-mix(in srgb, var(--summary-accent) 70%, #FFFFFF);
}
.home-hero .summary-card > .text-xs { color: #94A3B8 !important; }
.home-hero .summary-card > .text-2xl { color: #FFFFFF !important; font-size: 40px; font-weight: 700; }
.home-hero .summary-card > .text-2xl.text-red-600 { color: #FCA5A5 !important; text-shadow: 0 0 18px rgba(239,68,68,0.45); }
.home-hero .summary-card > .text-2xl.text-gray-400 { color: #64748B !important; }
.home-hero .summary-card > .text-2xl > span { color: #94A3B8 !important; }
.home-hero .summary-card > .text-base { color: #F1F5F9 !important; }
.home-hero .summary-card-link:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: color-mix(in srgb, var(--summary-accent) 60%, transparent);
  box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--summary-accent) 70%, transparent);
}
.home-hero .summary-card-link:focus-visible { outline-color: rgba(52, 211, 153, 0.6); }

/* ---------- セクション見出しのアイコン ---------- */
.main-content h2 > i.fas:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  margin-right: 8px !important;
  border-radius: 8px;
  font-size: 12px;
  color: var(--green-main) !important;
  background: #ECFDF5;
  box-shadow: inset 0 0 0 1px #A7F3D0;
  vertical-align: middle;
}
.main-content section > h2 { display: flex; align-items: center; }

/* ---------- 最近のチャット アバター ---------- */
.recent-chat-avatar {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  background: linear-gradient(135deg, #1E293B, #334155);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 4px 10px -4px rgba(15,23,42,0.5);
}
.recent-chat-item:hover .recent-chat-avatar {
  background: linear-gradient(135deg, #10B981, #047857);
}

/* ---------- 案件カード（ホーム・一覧） ---------- */
.card.card-hover { position: relative; overflow: hidden; }
.card.card-hover::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #34D399, #059669);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .2s ease;
}
.card.card-hover:hover::before { transform: scaleY(1); }

/* ---------- サイドバー仕上げ ---------- */
/* スマホ幅では style.css の position: fixed を維持する（上書きするとメニュー分の余白が出る） */
@media (min-width: 1025px) {
  .sidebar { position: relative; }
}
.sidebar::after {
  /* 下部にうっすらエメラルドの光 */
  content: "";
  position: absolute;
  left: -40px; right: -40px; bottom: -60px;
  height: 200px;
  background: radial-gradient(closest-side, rgba(16,185,129,0.16), transparent);
  pointer-events: none;
}
.sidebar > * { position: relative; z-index: 1; }

/* ---------- 重要なお知らせ ---------- */
.announcement-card {
  background: linear-gradient(90deg, #EFF6FF 0%, #FFFFFF 55%);
  border: 1px solid #DBEAFE;
  border-left: 4px solid #2563EB;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}
.announcement-card.is-unread { border-color: #93C5FD; border-left-color: #2563EB; }
.announcement-section-header h2 { letter-spacing: 0.04em; }

/* =============================================================
   第3弾: スタイリッシュ化（整理・ヘアライン・アプリらしさ）
   ============================================================= */

/* ---------- スマホ下部タブバー ---------- */
.bottom-nav { display: none; }
@media (max-width: 1024px) {
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    flex-shrink: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, #111A2E, #0B1220);
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 -8px 24px -12px rgba(2, 6, 23, 0.5);
    z-index: 30;
  }
  .bottom-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 0 4px;
    border-radius: 12px;
    color: #7C8BA1;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s, background .15s;
  }
  .bottom-nav-item i { font-size: 18px; }
  .bottom-nav-item:active { background: rgba(148, 163, 184, 0.10); }
  .bottom-nav-item.active { color: #FFFFFF; }
  .bottom-nav-item.active i { color: #34D399; filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.55)); }
  .bottom-nav-item.active::before {
    content: "";
    position: absolute;
    top: -7px;
    width: 22px; height: 3px;
    border-radius: 0 0 3px 3px;
    background: #34D399;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.7);
  }
  /* タブバーがあるので本文下の余白は控えめに */
  .main-content { padding-bottom: 24px; }
  /* チャット画面は画面高に合わせて組まれているのでタブバーを出さない */
  .app-shell:has(#chat-area) .bottom-nav { display: none; }
}

/* ---------- ヒーローの集計を「計器盤」風のヘアライン区切りに ---------- */
.home-hero-stats {
  gap: 1px;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  overflow: hidden;
}
@media (max-width: 640px) {
  .home-hero-stats { grid-template-columns: 1fr 1fr; gap: 1px; }
}
.home-hero .summary-card {
  border: 0;
  border-radius: 0;
  background: rgba(8, 13, 25, 0.72);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  min-height: 108px;
  padding: 16px 16px 14px;
}
.home-hero .summary-card::before { display: none; }
.home-hero .summary-card::after {
  background: none;
  width: auto; height: auto;
  top: 16px; right: 16px;
  font-size: 13px;
  color: var(--summary-accent);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--summary-accent) 60%, transparent));
}
.home-hero .summary-card > .text-xs { font-size: 11.5px; letter-spacing: 0.14em; }
.home-hero .summary-card > .text-2xl { font-size: 42px; font-weight: 600; margin-top: 14px; }
.home-hero .summary-card-link:hover {
  background: rgba(20, 30, 52, 0.85);
  border-color: transparent;
  box-shadow: inset 0 -2px 0 var(--summary-accent);
  transform: none;
}
/* 「今日」は全幅のスリムな行にして、日付ピルと役割を分ける */
.home-hero .summary-card[data-home-filter-project-name] {
  grid-column: 1 / -1;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
}
.home-hero .summary-card[data-home-filter-project-name] > .text-base {
  margin-top: 0 !important;
  font-size: 13.5px;
  font-weight: 600;
  color: #CBD5E1 !important;
}
.home-hero .summary-card[data-home-filter-project-name] > .text-base::after {
  content: " の案件を見る";
  color: #64748B;
  font-weight: 500;
}
.home-hero .summary-card[data-home-filter-project-name]::after {
  content: "\f061";
  position: static;
  margin-left: auto;
  font-size: 12px;
  transition: transform .15s;
}
.home-hero .summary-card[data-home-filter-project-name]:hover::after { transform: translateX(3px); }
.home-hero-title { font-weight: 700; }

/* ---------- 「報告を新規作成」をタイル型に ---------- */
section[aria-label="報告を新規作成"] > div {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 12px !important;
}
#home-new-parking,
#home-new-work {
  flex-direction: column;
  gap: 10px;
  padding: 18px 12px 16px;
  white-space: normal;
  text-align: center;
  line-height: 1.45;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  background: linear-gradient(180deg, #FFFFFF, #F8FAFC);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
#home-new-parking i,
#home-new-work i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 14px;
  font-size: 18px;
  color: #FFFFFF;
  background: linear-gradient(135deg, #10B981, #047857);
  box-shadow: 0 8px 18px -8px rgba(5, 150, 105, 0.8), inset 0 1px 0 rgba(255,255,255,0.25);
}
#home-new-parking:hover:not(:disabled),
#home-new-work:hover:not(:disabled) {
  background: #FFFFFF;
  border-color: #6EE7B7;
  box-shadow: 0 12px 24px -12px rgba(5, 150, 105, 0.45);
  transform: translateY(-2px);
}

/* ---------- 見出しの絵文字をアイコンに統一 ---------- */
.announcement-section-header h2 { display: flex; align-items: center; }
.announcement-section-header h2 > span[aria-hidden="true"] { display: none; }
.announcement-section-header h2::before {
  content: "\f0a1";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  margin-right: 8px;
  border-radius: 8px;
  font-size: 12px;
  color: #2563EB;
  background: #EFF6FF;
  box-shadow: inset 0 0 0 1px #BFDBFE;
}

/* ---------- リストはヘアライン区切りで静かに ---------- */
.recent-chat-item {
  margin-top: 0 !important;
  border-radius: 12px !important;
}
.recent-chat-item + .recent-chat-item { position: relative; }
.recent-chat-item + .recent-chat-item::before {
  content: "";
  position: absolute;
  left: 58px; right: 12px; top: 0;
  height: 1px;
  background: var(--divider);
}
.recent-chat-item:hover::before,
.recent-chat-item:hover + .recent-chat-item::before { opacity: 0; }
.recent-chat-avatar { border-radius: 50%; }

/* 報告タイルの文言（PC では1行、タイルでは2段） */
#home-new-parking, #home-new-work { gap: 2px; }
#home-new-parking i, #home-new-work i { margin-bottom: 8px; }
.report-tile-label { font-size: 14px; font-weight: 700; white-space: nowrap; }
.report-tile-sub { font-size: 11.5px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }

/* =============================================================
   第4弾: 案件一覧・チャット画面をホームと同じ雰囲気に
   ============================================================= */

/* 共通: 濃紺のページヘッダー帯 */
#projects-page-root > .flex:first-child,
.chat-overview-head,
#project-chat-page > .border-b:first-child {
  background:
    radial-gradient(420px 200px at 0% 0%, rgba(16,185,129,0.24), transparent 70%),
    radial-gradient(420px 220px at 100% 100%, rgba(37,99,235,0.18), transparent 70%),
    linear-gradient(135deg, #0B1220 0%, #13203A 60%, #0B1220 100%);
  color: #F8FAFC;
}

/* ---------- 案件一覧 ---------- */
#projects-page-root > .flex:first-child {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border-radius: 20px;
  margin-bottom: 16px !important;
  box-shadow: 0 20px 40px -24px rgba(2, 6, 23, 0.65), inset 0 1px 0 rgba(255,255,255,0.06);
}
#projects-page-root > .flex:first-child::before {
  content: "PROJECTS";
  flex-basis: 100%;
  order: -1;
  margin-bottom: -4px;
  font-family: "Barlow", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: #34D399;
}
#projects-page-root > .flex:first-child h1.font-bold { color: #FFFFFF !important; }
#projects-page-root > .flex:first-child .btn-secondary,
#project-chat-page > .border-b:first-child .btn-secondary,
.chat-overview-head .btn-outline {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: #E2E8F0;
  box-shadow: none;
}
#projects-page-root > .flex:first-child .btn-secondary:hover:not(:disabled),
#project-chat-page > .border-b:first-child .btn-secondary:hover:not(:disabled),
.chat-overview-head .btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
}

/* 絞り込み: 塗りつぶし型の入力欄で静かに */
#projects-page-root > .card.p-3 { padding: 12px; border-radius: 18px; }
#projects-page-root > .card.p-3 .input,
#projects-page-root > .card.p-3 .select {
  background-color: #F4F6F9;
  border-color: transparent;
}
#projects-page-root > .card.p-3 .input:hover,
#projects-page-root > .card.p-3 .select:hover { border-color: #CBD5E1; }
#projects-page-root > .card.p-3 .input:focus,
#projects-page-root > .card.p-3 .select:focus { background-color: #FFFFFF; border-color: var(--input-focus); }

/* 案件カード: 種類ごとの色帯 */
[data-project-card] {
  position: relative;
  overflow: hidden;
  padding-left: 20px !important;
  --kind-accent: #94A3B8;
}
[data-project-card]:has(.badge-work)     { --kind-accent: #10B981; }
[data-project-card]:has(.badge-tomorrow) { --kind-accent: #3B82F6; }
[data-project-card]:has(.badge-other)    { --kind-accent: #64748B; }
[data-project-card]::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--kind-accent);
}
[data-project-card]:hover {
  border-color: color-mix(in srgb, var(--kind-accent) 45%, var(--border-strong));
  box-shadow: var(--shadow-card-hover);
}
[data-project-card] a.font-bold { font-size: 15.5px; letter-spacing: 0.02em; line-height: 1.45; }
[data-project-card] .text-xs.text-gray-600 { color: var(--text-muted); margin-top: 8px; }
[data-project-card] .text-xs.text-gray-600 i { color: #94A3B8; }
.unread-badge { box-shadow: 0 0 0 2px #FFFFFF, 0 4px 10px -2px rgba(220, 38, 38, 0.55); }

/* スマホ: 「詳細」を右端の丸い矢印ボタンに */
@media (max-width: 1023px) {
  [data-project-card] { flex-direction: row !important; align-items: center; }
  [data-project-card] > .flex.flex-shrink-0 .btn {
    width: 36px; height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    background: color-mix(in srgb, var(--kind-accent) 10%, #FFFFFF);
    border-color: color-mix(in srgb, var(--kind-accent) 30%, #FFFFFF);
    color: var(--kind-accent);
  }
  [data-project-card] > .flex.flex-shrink-0 .btn i { font-size: 13px; }
  [data-project-card] > .flex.flex-shrink-0 .btn i::before { content: "\f054"; }
}

/* ---------- チャット一覧 ---------- */
.chat-overview { background: transparent; }
.chat-overview-head {
  padding: 16px 16px 14px;
  border-bottom: 0;
  box-shadow: 0 12px 28px -18px rgba(2, 6, 23, 0.7);
}
.chat-overview-head::before {
  content: "CHAT";
  display: block;
  margin-bottom: 4px;
  font-family: "Barlow", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: #34D399;
}
.chat-overview-head .chat-unread-count { color: #CBD5E1; font-size: 14px; font-weight: 600; }
.chat-overview-head .chat-unread-count strong {
  font-family: "Barlow", sans-serif;
  font-size: 22px;
  color: #FCA5A5;
  text-shadow: 0 0 14px rgba(239, 68, 68, 0.45);
}
.chat-overview-head .input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
}
.chat-overview-head .input::placeholder { color: #64748B; }
.chat-overview-head .input:focus { background: rgba(255, 255, 255, 0.1); border-color: #34D399; }
.chat-overview-head .fa-search { color: #64748B !important; }
.chat-overview-head .chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #CBD5E1;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.chat-overview-head .chip:hover { background: rgba(255, 255, 255, 0.12); color: #FFFFFF; }
.chat-overview-head .chip-active,
.chat-overview-head .chip-active:hover {
  background: linear-gradient(180deg, #10B981, #059669);
  border-color: #10B981;
  color: #FFFFFF;
  box-shadow: 0 6px 16px -6px rgba(16, 185, 129, 0.7);
}

.chat-rows {
  margin: 14px 12px 20px;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.chat-rows:empty { display: none; }
@media (min-width: 1024px) {
  .chat-rows { margin: 18px auto 24px; max-width: 960px; }
}
.chat-row {
  --kind-accent: #64748B;
  padding: 14px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--divider);
}
.chat-row:last-child { border-bottom: 0; }
.chat-row:has(.badge-work)     { --kind-accent: #10B981; }
.chat-row:has(.badge-tomorrow) { --kind-accent: #3B82F6; }
.chat-row-icon {
  width: 42px; height: 42px;
  border-radius: 13px;
  color: #FFFFFF;
  background: linear-gradient(135deg, color-mix(in srgb, var(--kind-accent) 80%, #FFFFFF), var(--kind-accent));
  box-shadow: 0 8px 16px -8px var(--kind-accent), inset 0 1px 0 rgba(255,255,255,0.25);
}
.chat-row-title { font-size: 14.5px; letter-spacing: 0.02em; }
.chat-row-time { font-family: "Barlow", sans-serif; font-size: 12px; font-weight: 500; color: #94A3B8; }
.chat-row-msg { color: var(--text-muted); }
.chat-row:has(.unread-badge) .chat-row-title { font-weight: 800; color: var(--text-main); }
.chat-row:has(.unread-badge) .chat-row-msg { color: var(--text-sub); font-weight: 500; }
.chat-row:hover { background: #F8FAFC; }

/* ---------- チャット本体 ---------- */
#project-chat-page > .border-b:first-child {
  border-bottom: 0 !important;
  padding: 10px 12px;
  box-shadow: 0 10px 24px -16px rgba(2, 6, 23, 0.7);
  position: relative;
  z-index: 2;
}
#project-chat-page > .border-b:first-child .font-bold.text-gray-900 { color: #FFFFFF !important; letter-spacing: 0.02em; }
#project-chat-page > .border-b:first-child .text-gray-500 { color: #94A3B8 !important; }
#project-chat-page > .border-b:first-child .btn-ghost { color: #E2E8F0; }
#project-chat-page > .border-b:first-child .btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.1); }

.chat-area { background: transparent; }
.chat-messages,
.chat-messages.bg-slate-50 {
  background:
    radial-gradient(circle at 1px 1px, rgba(15, 23, 42, 0.06) 1px, transparent 0) 0 0 / 22px 22px,
    var(--app-bg) !important;
}
.chat-bubble {
  border-radius: 18px;
  padding: 10px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 14px -10px rgba(15, 23, 42, 0.25);
}
.chat-bubble.mine {
  background: linear-gradient(180deg, #E3F8EE, #D3F3E4);
  border-color: #B9EBD3;
  border-bottom-right-radius: 6px;
}
.chat-bubble.others {
  background: #FFFFFF;
  border-color: #E5EAF0;
  border-bottom-left-radius: 6px;
}
.chat-msg-meta { letter-spacing: 0.02em; }
.chat-day-separator-pill {
  background: rgba(15, 23, 42, 0.78);
  color: #E2E8F0;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 5px 14px;
  box-shadow: 0 6px 14px -8px rgba(2, 6, 23, 0.6);
}

.chat-compose {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--divider) !important;
  box-shadow: 0 -10px 24px -18px rgba(15, 23, 42, 0.35);
  padding: 10px;
}
.chat-input-field {
  border-radius: 16px;
  background: #F4F6F9;
  border-color: transparent;
}
.chat-input-field:focus {
  background: #FFFFFF;
  border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.chat-tool-btn {
  border-color: transparent;
  background: #F4F6F9;
  color: #475569;
  border-radius: 14px;
}
.chat-tool-btn:hover:not(:disabled) { background: #E9EDF3; color: var(--text-main); }
.chat-tool-send {
  background: linear-gradient(180deg, #10B981, #059669);
  border-color: #059669;
  color: #FFFFFF;
  box-shadow: 0 8px 18px -8px rgba(5, 150, 105, 0.75), inset 0 1px 0 rgba(255,255,255,0.25);
}
.chat-tool-send:hover:not(:disabled) {
  background: linear-gradient(180deg, #059669, #047857);
  color: #FFFFFF;
}

/* =============================================================
   第5弾: 残りの画面（報告・メンバー・設定・案件登録/詳細・お知らせ）
   ============================================================= */

/* ---------- 共通ページヘッダー帯 ----------
   パターンA: <div class="flex ..."><h1>…</h1><ボタン></div>
   パターンB: <h1>…</h1> が単独で先頭 */
.main-content > div > .flex:first-child:has(> h1),
.main-content > div > h1.font-bold:first-child {
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 18px 20px;
  margin-bottom: 16px !important;
  border-radius: 20px;
  color: #F8FAFC;
  background:
    radial-gradient(420px 200px at 0% 0%, rgba(16,185,129,0.24), transparent 70%),
    radial-gradient(420px 220px at 100% 100%, rgba(37,99,235,0.18), transparent 70%),
    linear-gradient(135deg, #0B1220 0%, #13203A 60%, #0B1220 100%);
  box-shadow: 0 20px 40px -24px rgba(2, 6, 23, 0.65), inset 0 1px 0 rgba(255,255,255,0.06);
}
.main-content > div > .flex:first-child:has(> h1) > h1.font-bold,
.main-content > div > h1.font-bold:first-child { color: #FFFFFF !important; }

/* 英字の小見出し（ページごと） */
.main-content > div > .flex:first-child:has(> h1)::before,
.main-content > div > h1.font-bold:first-child::before {
  flex-basis: 100%;
  order: -1;
  margin-bottom: -4px;
  font-family: "Barlow", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: #34D399;
}
.main-content > div > .flex:first-child:has(> h1 .fa-square-parking)::before { content: "PARKING"; }
.main-content > div > .flex:first-child:has(> h1 .fa-hard-hat)::before       { content: "WORK REPORTS"; }
.main-content > div > .flex:first-child:has(> h1 .fa-users)::before          { content: "MEMBERS"; }
.main-content > div > .flex:first-child:has(> h1 > span[aria-hidden])::before { content: "ANNOUNCEMENTS"; }
.main-content > div > .flex:first-child:has(> h1 .fa-pen)::before,
.main-content > div > .flex:first-child:has(> h1 .fa-plus)::before           { content: "ANNOUNCEMENT"; }
.main-content > div > h1.font-bold:first-child:has(.fa-gear)::before          { content: "SETTINGS"; }
.main-content > div > h1.font-bold:first-child:has(.fa-plus-square)::before   { content: "NEW PROJECT"; }
.main-content > div > h1.font-bold:first-child:has(.fa-pen-to-square)::before { content: "EDIT PROJECT"; }

/* お知らせ一覧の 📢 を他と同じアイコンチップに */
.main-content h1 > span[aria-hidden="true"] { display: none; }
.main-content h1:has(> span[aria-hidden="true"])::after {
  content: "\f0a1";
  order: -1;
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  margin-right: 12px;
  border-radius: 11px;
  font-size: 16px;
  color: #FFFFFF;
  background: linear-gradient(135deg, #10B981 0%, #047857 100%);
  box-shadow: 0 6px 16px -4px var(--green-glow), inset 0 1px 0 rgba(255,255,255,0.25);
}

/* 帯の中のボタン */
.main-content > div > .flex:first-child:has(> h1) .btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: #E2E8F0;
  box-shadow: none;
}
.main-content > div > .flex:first-child:has(> h1) .btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
}

/* ---------- 案件詳細 ---------- */
#project-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
}
#project-detail-back:hover { color: var(--green-dark); border-color: #A7F3D0; }

/* 案件の概要カードを濃紺のヒーローに */
.main-content .card:has(> .flex h1) {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  padding: 22px 22px 20px !important;
  color: #E2E8F0;
  background:
    radial-gradient(480px 240px at 0% 0%, rgba(16,185,129,0.26), transparent 70%),
    radial-gradient(480px 260px at 100% 100%, rgba(37,99,235,0.2), transparent 70%),
    linear-gradient(135deg, #0B1220 0%, #13203A 60%, #0B1220 100%);
  box-shadow: 0 24px 48px -24px rgba(2, 6, 23, 0.65), inset 0 1px 0 rgba(255,255,255,0.06);
}
.main-content .card:has(> .flex h1)::before {
  content: "PROJECT";
  display: block;
  margin-bottom: 6px;
  font-family: "Barlow", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: #34D399;
}
.main-content .card:has(> .flex h1) h1 { color: #FFFFFF !important; font-size: clamp(18px, 2.4vw, 22px); letter-spacing: 0.03em; }
.main-content .card:has(> .flex h1) .text-gray-500 { color: #A5B4C8 !important; }
.main-content .card:has(> .flex h1) .text-gray-400 { color: #34D399 !important; opacity: .8; }
.main-content .card:has(> .flex h1) .grid { margin-top: 14px; row-gap: 6px; }
.main-content .card:has(> .flex h1) .bg-gray-50 {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #E2E8F0;
}
.main-content .card:has(> .flex h1) .btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: #E2E8F0;
  box-shadow: none;
}
.main-content .card:has(> .flex h1) .btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.14); color: #FFFFFF; }

/* 詳細タブ: 白い角丸パネルと一体化 */
.main-content .tabs {
  border: 1px solid var(--border-strong);
  border-bottom-color: var(--divider);
  border-radius: 16px 16px 0 0;
  scrollbar-width: none;
}
.main-content .tabs::-webkit-scrollbar { display: none; }
.main-content .tabs .tab { padding: 13px 16px; font-size: 13.5px; }
.main-content .tabs .tab i { opacity: .75; }
.main-content .tabs .tab.active {
  border-bottom-color: #10B981;
  box-shadow: inset 0 -2px 0 #10B981, 0 6px 14px -10px rgba(16,185,129,0.8);
}
#tab-content {
  border-color: var(--border-strong) !important;
  border-radius: 0 0 16px 16px !important;
  box-shadow: var(--shadow-card);
}

/* ---------- メンバー管理 ---------- */
.main-content .divide-y > * { border-color: var(--divider); }
.main-content .w-10.h-10.rounded-full.bg-brand-100 {
  color: #FFFFFF !important;
  background: linear-gradient(135deg, #1E293B, #334155) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 4px 10px -4px rgba(15,23,42,0.5);
}
.main-content .divide-y > .flex:hover { background: #F8FAFC; }
.main-content .divide-y > .flex:hover .w-10.h-10.rounded-full.bg-brand-100 {
  background: linear-gradient(135deg, #10B981, #047857) !important;
}

/* ---------- 設定・フォーム ---------- */
/* アイコンの無いカード見出しに緑のアクセント線 */
.main-content .card > h2.font-bold:first-child:not(:has(> i)) {
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.04em;
}
.main-content .card > h2.font-bold:first-child:not(:has(> i))::before {
  content: "";
  width: 4px; height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, #34D399, #059669);
}
.main-content dl dt { letter-spacing: 0.06em; }
.main-content dl dd { font-weight: 600; margin-top: 2px; }
.main-content form.card .label { letter-spacing: 0.04em; }

/* 案件詳細ヒーロー: スマホでは編集・削除を情報の下に回して情報欄を全幅に */
@media (max-width: 639px) {
  .main-content .card:has(> .flex h1) > .flex > .min-w-0 { flex-basis: 100%; }
  .main-content .card:has(> .flex h1) > .flex > .flex-shrink-0 { width: 100%; justify-content: flex-end; }
}

/* =============================================================
   報告一覧（駐車場代・常用作業）: スマホで案件名が切れないように
   - 詳細／編集／削除 ボタンをカード下部の操作行へ回し、情報欄を全幅に
   - 案件名は 2 行まで折り返して表示
   （案件詳細の報告タブも同じ構造なので共通で効く）
   ============================================================= */
[data-report-card] { border-radius: 16px; }
@media (max-width: 639px) {
  [data-report-card] { flex-wrap: wrap; row-gap: 8px; }
  [data-report-card] > .flex-1.min-w-0 { flex-basis: 0; }
  [data-report-card] > .flex.gap-1.flex-shrink-0 {
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--divider);
  }
  [data-report-card] > .flex.gap-1.flex-shrink-0 .btn-icon {
    width: 40px; height: 34px;
    border-radius: 10px;
    background: #F4F6F9;
  }
  [data-report-card] > .flex.gap-1.flex-shrink-0 .btn-icon.text-red-600 { background: #FEF2F2; }
  [data-report-card] .text-sm.font-semibold.truncate {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.45;
  }
}

/* =============================================================
   チャット一覧（スマホ）: 上部をコンパクトにして案件を多く見せる
   - 「CHAT」小見出しを省略、余白・検索欄・絞り込みを小さく
   - 絞り込みは 1 行の横スクロール
   - 各行は種類バッジを本文の左に並べて 1 行ぶん詰める
   ============================================================= */
@media (max-width: 640px) {
  .chat-overview-head { padding: 10px 12px; }
  .chat-overview-head::before { display: none; }
  .chat-overview-head .chat-list-unread-toolbar { margin-bottom: 8px; flex-wrap: nowrap; }
  .chat-overview-head .chat-unread-count { font-size: 13px; line-height: 1.2; white-space: nowrap; }
  .chat-overview-head .chat-unread-count strong { font-size: 19px; }
  .chat-overview-head .chat-mark-all-read-btn {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: 9999px;
  }
  .chat-overview-head .relative.mb-2 { margin-bottom: 8px; }
  .chat-overview-head .input { padding-top: 7px; padding-bottom: 7px; font-size: 14px; border-radius: 9999px; }
  .chat-overview-head .chat-filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -12px;
    padding: 0 12px;
  }
  .chat-overview-head .chat-filter-tabs::-webkit-scrollbar { display: none; }
  .chat-overview-head .chip { padding: 5px 12px; white-space: nowrap; flex-shrink: 0; }

  .chat-rows { margin: 10px 8px 16px; border-radius: 16px; }
  .chat-row { padding: 11px 12px; gap: 10px; }
  .chat-row-icon { width: 36px; height: 36px; border-radius: 11px; font-size: 14px; }
  .chat-row-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 6px;
    align-items: center;
  }
  .chat-row-top { grid-column: 1 / -1; }
  .chat-row-kind { margin-top: 4px; }
  .chat-row-kind .badge { font-size: 10.5px; padding: 1px 7px; }
  .chat-row-msg-line { margin-top: 4px; align-items: center; }
}

/* スマホ: 上部バー（≡ テツナグ）は出さない。メニューは下部タブバー、
   チャット会話画面はヘッダーの「戻る」で移動する。
   会話画面の高さは app2.js が chat-area の上端から動的に計算するので追従する */
@media (max-width: 1024px) {
  .mobile-header { display: none; }
}
