/* =========================================================
   不動産査定サイト デザイン（LINE風グリーン）
   Phase 2: 実デザイン適用
   ========================================================= */

:root {
  /* Brand: LINE-inspired green */
  --primary: #06C755;
  --primary-dark: #04A847;
  --primary-light: #E6F8EE;
  --primary-bg: #F0FBF4;

  /* Backgrounds */
  --bg-page: #E8F1FB;       /* 薄い水色背景（LINEトークルーム風） */
  --bg-header: #ffffff;
  --bg-card: #ffffff;

  /* Bubbles */
  --bubble-bot: #ffffff;
  --bubble-user: #06C755;
  --bubble-user-text: #ffffff;

  /* Text */
  --text: #1a1a1a;
  --text-muted: #5b6770;
  --text-light: #8e98a3;

  /* Borders */
  --border: #e3e8ee;
  --border-light: #eef2f6;
  --border-strong: var(--primary);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(20, 30, 50, 0.05);
  --shadow-md: 0 4px 12px rgba(20, 30, 50, 0.08);

  /* Sizing */
  --radius: 14px;
  --radius-bubble: 20px;
  --radius-sm: 10px;
  --space: 16px;
  --space-sm: 8px;
  --space-lg: 24px;
  --max-chat: 520px;
  --header-h: 84px;
}

* { box-sizing: border-box; }

/* hidden 属性を author CSS の display: で打ち消されないように強制 */
[hidden] { display: none !important; }

/* スクリーンリーダー専用（SEO 用に視覚的に隠した見出しなどに使用） */
.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;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; cursor: pointer; }

/* =========================================================
   ヘッダー
   ========================================================= */
/* =========================================================
   コンパクトヘッダー（規約・ポリシーページ用）
   ========================================================= */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}

.header__inner {
  max-width: var(--max-chat);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.header__logo {
  width: 52px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
  border: 1px solid var(--primary-light);
  border-radius: 12px;
  flex-shrink: 0;
  color: var(--primary);
}

.header__logo svg { width: 26px; height: 26px; }
.header__logo-text {
  font-size: 9px;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.header__text { flex: 1; min-width: 0; }

.header__title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.header__sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* =========================================================
   トップバー（スリム横一列）
   ========================================================= */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
}

.topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar__brand svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
  flex-shrink: 0;
}

.topbar__features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar__features li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  padding-right: 14px;
  white-space: nowrap;
}

.topbar__features li:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 14px;
  background: var(--border);
}

.topbar__features li svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

.topbar__achievement {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.topbar__laurel {
  width: 16px;
  height: 32px;
  flex-shrink: 0;
}

.topbar__achievement-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.topbar__achievement-num {
  font-size: 17px;
  color: var(--primary);
  font-weight: 800;
  margin: 0 2px;
  letter-spacing: -0.02em;
}

.topbar__cta {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 9px 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
  white-space: nowrap;
}

.topbar__cta:hover {
  background: var(--primary-dark);
}

.topbar__cta:active {
  transform: scale(0.97);
}

@media (max-width: 960px) {
  .topbar__features li { font-size: 12px; padding-right: 10px; }
  .topbar__features { gap: 10px; }
  .topbar__inner { gap: 12px; }
  .topbar__achievement-text { font-size: 12px; }
  .topbar__achievement-num { font-size: 15px; }
}

@media (max-width: 720px) {
  .topbar { padding: 8px 12px; }
  .topbar__inner {
    flex-wrap: wrap;
    gap: 8px 10px;
  }
  .topbar__features {
    flex: 1 1 100%;
    order: 3;
    justify-content: flex-start;
    gap: 8px;
  }
  .topbar__features li {
    font-size: 11px;
    padding-right: 8px;
  }
  .topbar__features li svg { width: 13px; height: 13px; }
  .topbar__achievement {
    margin-left: 0;
    order: 2;
  }
  .topbar__achievement-text { font-size: 11px; }
  .topbar__achievement-num { font-size: 13px; }
  .topbar__laurel { width: 11px; height: 22px; }
  .topbar__cta {
    order: 4;
    margin-left: auto;
    padding: 7px 14px;
    font-size: 13px;
  }
  .topbar__brand { font-size: 13px; order: 1; }
  .topbar__brand svg { width: 18px; height: 18px; }
}

/* =========================================================
   （旧）ヒーローセクション — 現在は未使用、後方互換のため残置
   ========================================================= */
.hero {
  position: relative;
  background: linear-gradient(180deg, #F2FBF4 0%, #EAF6EC 100%);
  border-bottom: 1px solid var(--primary-light);
  overflow: hidden;
  padding: 6px 18px 6px;
}

/* 背景の薄い装飾（右上に丸い緑のかたまりが薄く） */
.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 90% -20%, rgba(6, 199, 85, 0.18), transparent 40%),
    radial-gradient(circle at 110% 50%, rgba(6, 199, 85, 0.10), transparent 50%);
}

.hero__inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  align-items: stretch;
}

.hero__main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

/* ブランド行 */
.hero__brands {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid var(--primary-light);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(6, 199, 85, 0.08);
}

.hero__logo svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  background: var(--primary-bg);
  border: 1.5px solid var(--primary-light);
  color: var(--primary);
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* キャッチコピー */
.hero__catch {
  font-size: 16px;
  color: var(--primary);
  font-weight: 700;
  margin: 1px 0 0;
  letter-spacing: 0.01em;
}

/* メイン見出し */
.hero__title {
  font-size: clamp(24px, 5vw, 38px);
  font-weight: 800;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.hero__title-mark {
  background: linear-gradient(transparent 60%, #FFE26A 60%, #FFE26A 92%, transparent 92%);
  padding: 0 4px;
  font-weight: 800;
}

/* 信頼バッジ 3 点 */
.hero__features {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin: 2px 0 0;
  padding: 0;
}

.hero__features li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  padding-right: 14px;
}

.hero__features li:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 14px;
  background: var(--border);
}

.hero__features li svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

/* プライバシー注意書き */
.hero__privacy {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid var(--primary-light);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
}

.hero__privacy svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

/* ===== 右カラム（ビジュアル） ===== */
.hero__visual {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* 実績キャプション */
.hero__achievement {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.hero__laurel {
  width: 22px;
  height: 44px;
  flex-shrink: 0;
}

.hero__achievement-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.3;
}

.hero__achievement-sub {
  font-size: 11px;
  color: var(--text);
  font-weight: 600;
}

.hero__achievement-main {
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
}

.hero__achievement-num {
  font-size: 19px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 1px;
}

/* 人物写真エリア（header.png）— 縦の高さを抑える */
.hero__photo-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 65px;
  margin-top: 0;
}

.hero__photo {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background-image: url('../header.png');
  background-size: contain;
  background-position: center bottom;
  background-repeat: no-repeat;
  position: relative;
}

/* CTA バッジ（円形）— 元のサイズに戻す */
.hero__cta-badge {
  position: absolute;
  right: -8px;
  bottom: -16px;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  border: 4px solid #ffffff;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
  box-shadow: 0 8px 18px rgba(6, 199, 85, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
  padding: 0;
}

.hero__cta-badge:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 22px rgba(6, 199, 85, 0.45);
}

.hero__cta-badge:active {
  transform: scale(0.98);
}

.hero__cta-top { font-size: 11px; font-weight: 600; }
.hero__cta-mid {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 1px 0;
}
.hero__cta-btm { font-size: 11px; font-weight: 600; }

/* デスクトップは 2 カラム */
@media (min-width: 760px) {
  .hero {
    padding: 7px 24px 7px;
  }
  .hero__inner {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr);
    gap: 12px;
  }
  .hero__main {
    gap: 4px;
  }
  .hero__visual {
    align-items: stretch;
  }
  .hero__achievement {
    align-self: flex-end;
    margin-bottom: 2px;
  }
  .hero__photo-wrap {
    max-width: none;
    height: 90px;
  }
  .hero__cta-badge {
    width: 134px;
    height: 134px;
    right: -10px;
    bottom: -10px;
  }
  .hero__cta-mid { font-size: 24px; }
  .hero__features li { font-size: 14px; }
  .hero__catch { font-size: 18px; }
  .hero__privacy { font-size: 13px; padding: 10px 16px; }
}

/* =========================================================
   チャット領域
   ========================================================= */
.chat {
  max-width: var(--max-chat);
  margin: 0 auto;
  padding: 24px 18px 64px;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  animation: fadeIn 0.28s ease-out;
}

.bubble-row--bot { justify-content: flex-start; }
.bubble-row--user { justify-content: flex-end; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bot avatar */
.bubble__avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.bubble__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* レガシー：SVG + サポート テキスト構造（互換用フォールバック） */
.bubble__avatar svg { width: 18px; height: 18px; color: var(--primary); }
.bubble__avatar-text {
  font-size: 7px;
  margin-top: 2px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.04em;
}

/* Bubble bodies */
.bubble {
  max-width: 78%;
  padding: 13px 17px;
  border-radius: var(--radius-bubble);
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: var(--shadow-sm);
}

.bubble--bot {
  background: var(--bubble-bot);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.bubble--user {
  background: var(--bubble-user);
  color: var(--bubble-user-text);
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.bubble__meta {
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-bottom: 2px;
  flex-shrink: 0;
}

.bubble__time {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 6px;
  text-align: right;
}

.bubble--bot .bubble__time {
  text-align: left;
  color: var(--text-light);
}

.bubble--user .bubble__time {
  color: rgba(255,255,255,0.85);
}

/* =========================================================
   選択肢ボタン
   ========================================================= */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 6px 58px;
  animation: fadeIn 0.28s ease-out;
}

.choice-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.18s, background 0.18s, transform 0.1s;
  box-shadow: var(--shadow-sm);
}

.choice-btn:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.choice-btn:active {
  transform: scale(0.98);
}

.choice-btn__icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.choice-btn__icon svg { width: 22px; height: 22px; }

.choice-btn__label { flex: 1; }

.choice-btn__chevron {
  color: var(--primary);
  font-size: 18px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.choice-btn__chevron svg { width: 18px; height: 18px; }

/* 強調された主要選択肢（最初の選択） */
.choice-btn--primary {
  border-color: var(--primary);
  background: var(--primary-bg);
}

/* 物件種別カード（ステップ④） */
.choices--cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.choice-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 10px 18px;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: border-color 0.18s, background 0.18s, transform 0.1s;
  box-shadow: var(--shadow-sm);
  line-height: 1.45;
}

.choice-card:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.choice-card:active {
  transform: scale(0.98);
}

.choice-card__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--primary-bg);
  color: var(--primary);
}

.choice-card:hover .choice-card__icon {
  background: var(--bg-card);
}

.choice-card__icon svg { width: 30px; height: 30px; }

/* 横並びの小さなボタン群（築年数・期間など） */
.choices--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.choices--inline .choice-btn {
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 15px;
  box-shadow: none;
  border-width: 1.5px;
}

.choices--inline .choice-btn .choice-btn__chevron { display: none; }

/* =========================================================
   エリア確認カード（ステップ③）
   ========================================================= */
.area-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  margin: 6px 0 6px 58px;
  animation: fadeIn 0.28s ease-out;
  box-shadow: var(--shadow-sm);
}

.area-card__address {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  color: var(--text);
}

.area-card__pin {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  flex-shrink: 0;
}

.area-card__pin svg { width: 16px; height: 16px; }

.area-card__note {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 14px;
  padding-left: 36px;
}

.area-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
}

.area-card__actions .choice-btn {
  justify-content: center;
  padding: 13px;
  font-size: 15px;
  border-color: var(--border-light);
  background: transparent;
  box-shadow: none;
}

.area-card__actions .choice-btn:nth-child(2) {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.area-card__actions .choice-btn:nth-child(2):hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.area-card__actions .choice-btn:nth-child(1):hover {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
}

/* =========================================================
   数値入力（ステップ⑥）
   ========================================================= */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 6px 0 6px 58px;
  animation: fadeIn 0.28s ease-out;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 16px;
  transition: border-color 0.18s;
  box-shadow: var(--shadow-sm);
}

.input-row:focus-within {
  border-color: var(--primary);
}

.input-row input {
  flex: 1;
  padding: 14px 0;
  font-size: 17px;
  border: none;
  background: transparent;
  font-family: inherit;
  color: var(--text);
  outline: none;
}

.input-row__unit {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
}

.input-actions {
  display: flex;
  gap: 10px;
}

/* =========================================================
   連絡先フォーム（ステップ⑬）
   ========================================================= */
.contact-form {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin: 6px 0 6px 58px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.28s ease-out;
  box-shadow: var(--shadow-sm);
}

/* 現在地ボタン（住所入力フォーム冒頭） */
.address-form__geo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.address-form__geo:hover {
  background: var(--primary-light);
}

.address-form__geo:active { transform: translateY(1px); }

.address-form__geo svg { flex-shrink: 0; }

/* 区切り線（OR セパレータ） */
.address-form__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-light);
  font-size: 12px;
  margin: 2px 0;
}

.address-form__divider::before,
.address-form__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* カスケード選択：行（label + select／input 縦並び） */
.address-form__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.address-form__row input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.address-form__row input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.15);
}

/* カスケード選択：select 共通 */
.address-form__select {
  width: 100%;
  padding: 12px 36px 12px 14px;
  font-size: 16px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6770' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.address-form__select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.15);
}

.address-form__select:disabled {
  background-color: #f5f7fa;
  color: var(--text-light);
  cursor: not-allowed;
  opacity: 0.85;
}

/* 50音 optgroup の見た目（多くの市町村を視覚的にチャンクする） */
.address-form__select optgroup {
  font-weight: 700;
  font-style: normal;
  color: var(--primary-dark, #04A847);
  background: #f0faf3;
  padding: 4px 0;
}

.address-form__select optgroup option {
  font-weight: 400;
  color: var(--text);
  background: #ffffff;
  padding-left: 6px;
}

/* 段階表示：未表示の行を隠す（次の選択で順次出現） */
.address-form__row--hidden {
  display: none !important;
}

/* =========================================================
   ポップアップ式アドレスピッカー
   ========================================================= */
.address-form__picker {
  width: 100%;
  padding: 12px 36px 12px 14px;
  font-size: 16px;
  font-family: inherit;
  text-align: left;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--text);
  cursor: pointer;
  position: relative;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6770' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.address-form__picker:hover:not(:disabled) {
  border-color: var(--primary);
}
.address-form__picker:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.15);
}
.address-form__picker:disabled {
  background-color: #f5f7fa;
  color: var(--text-light);
  cursor: not-allowed;
  opacity: 0.85;
}
.address-form__picker--placeholder {
  color: var(--text-light);
  font-weight: 400;
}
.address-form__picker--loading {
  color: var(--text-light);
  cursor: wait;
}

/* オーバーレイ（背景） */
.picker-popup__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  animation: pickerOverlayFade 0.18s ease-out;
}
@keyframes pickerOverlayFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* パネル（ボトムシート / モーダル） */
.picker-popup__panel {
  background: #ffffff;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pickerPanelSlideUp 0.22s ease-out;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
}
@keyframes pickerPanelSlideUp {
  from { transform: translateY(40%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
@media (min-width: 600px) {
  .picker-popup__overlay { align-items: center; }
  .picker-popup__panel {
    border-radius: 16px;
    max-height: 80vh;
    animation: pickerPanelFade 0.18s ease-out;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
  }
  @keyframes pickerPanelFade {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
}

.picker-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.picker-popup__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.picker-popup__close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 50%;
  transition: background 0.12s ease;
}
.picker-popup__close:hover { background: #f5f7fa; }

/* オプション本体（縦スクロール） */
/* ※ JS側でスライド遷移時に inline で transition / opacity / transform を制御するため、
      ここでは指定しない。代わりに will-change だけ与えて GPU 合成にヒントする。 */
.picker-popup__body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 0 12px;
  will-change: opacity, transform;
}
.picker-popup__group-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark, #04A847);
  background: #f0faf3;
  padding: 8px 18px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.picker-popup__option {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 14px 18px;
  font-size: 16px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  border-bottom: 1px solid #f0f2f5;
  transition: background-color 0.12s ease;
}
.picker-popup__option:last-child { border-bottom: none; }
.picker-popup__option:hover,
.picker-popup__option:focus-visible {
  background: #f5fbf7;
  outline: none;
}
.picker-popup__option--current {
  background: #e6f8ee;
  color: var(--primary-dark, #04A847);
  font-weight: 700;
}

.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-form__label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
}

.contact-form__label .req {
  color: #ffffff;
  background: var(--primary);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.contact-form__label .req--either {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"] {
  padding: 14px 16px;
  font-size: 17px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.18s;
}

.contact-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.contact-form__methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.contact-form__methods label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 6px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text);
  transition: all 0.15s;
}

.contact-form__methods input { display: none; }

.contact-form__methods label:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.contact-form__methods label:has(input:checked) {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* 送信ステータス（ヒント／送信中／エラー） */
.contact-form__status {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0 2px;
  line-height: 1.6;
}

.contact-form__status--sending {
  color: var(--primary);
  font-weight: 600;
}

.contact-form__status--error {
  color: #C03030;
  font-weight: 600;
}

.contact-form input:disabled,
.contact-form input[readonly] {
  background: #F5F7FA;
  color: var(--text-muted);
  cursor: not-allowed;
}

.contact-form input[readonly]:focus { border-color: var(--border); }

/* ============================================
   ローディングドット（位置情報取得中・住所検索中）
   ============================================ */
.dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

.dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: dotBlink 1.2s infinite ease-in-out both;
}

.dots span:nth-child(1) { animation-delay: 0s; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBlink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
  40%           { opacity: 1;   transform: scale(1);    }
}

/* =========================================================
   ボタン
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

.btn--primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(6, 199, 85, 0.25);
}

.btn--primary:hover {
  background: var(--primary-dark);
  color: #ffffff;
  border-color: var(--primary-dark);
}

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

.btn--ghost:hover {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: transparent;
}

.btn--block { width: 100%; padding: 15px; font-size: 16px; }

.btn:disabled,
.btn[disabled] {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

/* 送信エラー時の Bot 吹き出し */
.bubble--alert {
  background: #FEF1F1;
  color: #C03030;
  border: 1.5px solid #F4B4B4;
}

.bubble--alert .bubble__time { color: #C03030; opacity: 0.7; }

/* =========================================================
   完了状態（ステップ⑭の入力確認カード）
   ========================================================= */
.summary-card {
  background: var(--bg-card);
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 6px 0 6px 58px;
  animation: fadeIn 0.28s ease-out;
  box-shadow: var(--shadow-sm);
}

.summary-card__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--primary);
}

.summary-card__toggle {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-weight: 500;
}

.summary-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}

.summary-card__list li {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  gap: 12px;
  line-height: 1.6;
}

.summary-card__list .k { color: var(--text-muted); flex-shrink: 0; font-weight: 500; }
.summary-card__list .v {
  color: var(--text);
  text-align: right;
  word-break: break-all;
  font-weight: 600;
}

/* =========================================================
   簡易査定結果カード
   ========================================================= */
.estimate-card {
  background: linear-gradient(135deg, var(--primary-bg), #ffffff);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px 22px;
  margin: 6px 0 6px 58px;
  box-shadow: 0 6px 18px rgba(6, 199, 85, 0.15);
  animation: fadeIn 0.4s ease-out;
}

.estimate-card__sub {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.estimate-card__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.estimate-card__price {
  margin: 18px 0 14px;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}

.estimate-card__price-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.estimate-card__price-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-right: 6px;
}

.estimate-card__price-sep {
  color: var(--text-muted);
  font-size: 18px;
  margin: 0 6px;
}

.estimate-card__score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
}

.estimate-card__score-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.estimate-card__stars {
  display: flex;
  gap: 3px;
}

.estimate-card__star {
  font-size: 22px;
  color: #d6d6d6;
  line-height: 1;
}

.estimate-card__star.is-filled {
  color: #f5a623;
}

.estimate-card__comments {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.estimate-card__comments li {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  padding-left: 22px;
  position: relative;
}

.estimate-card__comments li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: 700;
}

.estimate-card__note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  white-space: pre-wrap;
  line-height: 1.6;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

@media (max-width: 480px) {
  .estimate-card { padding: 20px 16px; }
  .estimate-card__price-num { font-size: 24px; }
  .estimate-card__price-unit { font-size: 14px; }
  .estimate-card__title { font-size: 17px; }
}

/* =========================================================
   レスポンシブ
   ========================================================= */
@media (min-width: 600px) {
  body { padding: 0; }
  .chat { padding: 28px 20px 64px; }
}

/* =========================================================
   フッター（チャット・規約ページ共通）
   ========================================================= */
.footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 18px 16px 24px;
  margin-top: 24px;
}

.footer__inner {
  max-width: var(--max-chat);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer__links a {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s;
}

.footer__links a:hover { color: var(--primary); }

.footer__copy {
  color: var(--text-light);
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* チャット内の同意文言 */
.consent-note {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 6px 58px;
  padding: 0 8px;
  line-height: 1.7;
}

.consent-note a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-note a:hover { color: var(--primary-dark); }

/* =========================================================
   規約・ポリシーページ
   ========================================================= */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 22px 16px;
  background: #ffffff;
}

.legal-page__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.15s;
}

.legal-page__back:hover { color: var(--primary); }

.legal-page__title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.legal-page__lead {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 28px;
  line-height: 1.7;
}

.legal-page__date {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.legal-page section { margin-bottom: 22px; }

.legal-page h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
  color: var(--text);
  line-height: 1.4;
}

.legal-page p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--text);
}

.legal-page ul,
.legal-page ol {
  margin: 6px 0 8px;
  padding-left: 24px;
}

.legal-page li {
  font-size: 14px;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 4px;
}

.legal-page a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-page__contact-box {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 600px) {
  .legal-page__title { font-size: 19px; }
}

/* =========================================================
   管理画面（admin/index.html）
   ========================================================= */
.admin {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: var(--bg-page);
}

.admin__sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border);
  padding: 20px 14px;
}

.admin__brand {
  font-weight: 700;
  font-size: 14px;
  padding: 12px;
  margin-bottom: 18px;
  background: var(--primary-bg);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--primary);
  line-height: 1.4;
}

.admin__brand small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 4px;
}

.admin__nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin__nav a {
  display: block;
  padding: 9px 12px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.admin__nav a:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.admin__nav a.is-active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(6, 199, 85, 0.25);
}

.admin__main {
  padding: 28px 32px;
  background: #ffffff;
}

.admin__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.admin__filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.admin__filters input,
.admin__filters select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #ffffff;
  font-family: inherit;
  color: var(--text);
}

.admin__filters input:focus,
.admin__filters select:focus {
  outline: none;
  border-color: var(--primary);
}

.admin__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.admin__table th,
.admin__table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.admin__table th {
  background: var(--primary-bg);
  font-weight: 700;
  color: var(--primary);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.admin__table tr:last-child td { border-bottom: none; }
.admin__table tr:hover { background: var(--primary-bg); }

.admin__table-contact {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: nowrap;
}

.admin__status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.admin__status--new {
  background: #FEF3E2;
  color: #B7791F;
  border-color: #FDE6BC;
}

.admin__status--progress {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary-light);
}

.admin__status--done {
  background: #F0F2F5;
  color: var(--text-muted);
  border-color: var(--border);
}

.admin__link {
  color: var(--primary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.admin__link:hover { text-decoration: underline; }

.admin__note {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px 14px;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.admin__note code {
  background: #ffffff;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
  font-size: 11px;
}

/* データソース表示 */
.admin__source {
  font-size: 11px;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin__source::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-light);
}

.admin__source--ok      { color: var(--primary); }
.admin__source--ok::before      { background: var(--primary); }
.admin__source--demo    { color: #B7791F; }
.admin__source--demo::before    { background: #E0A23C; }
.admin__source--loading { color: var(--text-muted); }
.admin__source--loading::before { background: var(--text-light); animation: pulse 1.4s infinite; }
.admin__source--error   { color: #C03030; }
.admin__source--error::before   { background: #C03030; }

@keyframes pulse {
  0%,100% { opacity: 0.4; }
  50%     { opacity: 1; }
}

.admin__empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-page);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* =========================================================
   詳細モーダル
   ========================================================= */
.admin-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 50, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn 0.18s ease-out;
}

.admin-modal.is-open {
  display: flex;
}

.admin-modal__inner {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  animation: modalIn 0.22s cubic-bezier(0.2, 0.9, 0.4, 1.05);
}

@keyframes modalIn {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.admin-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  font-size: 22px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
}

.admin-modal__close:hover {
  background: var(--bg-page);
  color: var(--text);
}

.admin-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding-right: 32px;
}

.admin-modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.admin-modal__list {
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 16px;
  font-size: 13px;
  line-height: 1.6;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

.admin-modal__list dt {
  color: var(--text-muted);
  font-weight: 600;
}

.admin-modal__list dd {
  margin: 0;
  color: var(--text);
  font-weight: 500;
  word-break: break-all;
}

.admin-modal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

@media (max-width: 600px) {
  .admin-modal__inner { padding: 20px; }
  .admin-modal__list { grid-template-columns: 90px 1fr; gap: 6px 12px; font-size: 12px; }
  .admin-modal__actions .btn { width: 100%; }
}

@media (max-width: 720px) {
  .admin { grid-template-columns: 1fr; }
  .admin__sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px;
  }
  .admin__main { padding: 18px; }
  .admin__table { font-size: 12px; }
  .admin__table th,
  .admin__table td { padding: 10px 8px; }
}

/* =========================================================
   ダッシュボード（admin/index.html 上部）
   ========================================================= */
.dashboard {
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard__panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.dashboard__heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}

/* サマリーカード */
.stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
}

.stat-card--pending::before  { background: #E8A23B; }
.stat-card--progress::before { background: var(--primary); }
.stat-card--done::before     { background: var(--text-light); }

.stat-card__label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stat-card__value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.stat-card__unit {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -4px;
}

/* 物件種別の内訳（横棒） */
.breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 200px 1fr 44px;
  align-items: center;
  gap: 10px;
}

.breakdown-row__label {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
  word-break: break-all;
}

.breakdown-row__bar-wrap {
  height: 18px;
  background: var(--bg-page);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
}

.breakdown-row__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 9px;
  transition: width 0.3s ease-out;
  min-width: 4px;
}

.breakdown-row__count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

/* 過去30日の推移（縦棒） */
.trend {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 110px;
  padding: 6px 0 22px;
  position: relative;
}

.trend-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  position: relative;
  cursor: default;
}

.trend-bar {
  width: 78%;
  min-height: 2px;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-radius: 3px 3px 0 0;
  transition: opacity 0.15s;
}

.trend-day[data-count="0"] .trend-bar {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  min-height: 0;
  height: 2px;
}

.trend-day:hover .trend-bar {
  opacity: 0.7;
}

.trend-day::after {
  content: attr(data-count);
  position: absolute;
  top: -16px;
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.15s;
}

.trend-day:hover::after {
  opacity: 1;
}

.trend-day__label {
  position: absolute;
  bottom: -18px;
  font-size: 9px;
  color: var(--text-light);
  white-space: nowrap;
}

/* 5日ごとに日付ラベル表示 */
.trend-day:not([data-show-label]) .trend-day__label { display: none; }

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .breakdown-row { grid-template-columns: 140px 1fr 40px; }
  .breakdown-row__label { font-size: 11px; }
  .trend { height: 80px; }
}

/* ログアウトボタン（サイドバー） */
.admin__logout {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.admin__logout:hover {
  background: var(--bg-page);
  color: var(--text);
  border-color: var(--text-light);
}

/* =========================================================
   ログイン画面（admin/index.html オーバーレイ）
   ========================================================= */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.login-card {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 32px 28px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modalIn 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.05);
}

.login-card__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.login-card__title {
  font-size: 17px;
  font-weight: 700;
  margin: 4px 0 0;
  color: var(--text);
  letter-spacing: -0.01em;
}

.login-card__sub {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

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

.login-card__field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.login-card__field input {
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s;
}

.login-card__field input:focus {
  outline: none;
  border-color: var(--primary);
}

.login-card__error {
  background: #FEF1F1;
  color: #C03030;
  border: 1px solid #F4B4B4;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.login-card__note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 4px 0 0;
  line-height: 1.6;
}
