:root {
  --navy: #1a3a5c;
  --navy-light: #234b73;
  --accent: #5ba4f5;
  --accent-hover: #4a93e4;
  --bg: #f5f7fa;
  --white: #ffffff;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --green: #16a34a;
  --yellow: #ca8a04;
  --red: #dc2626;
  --orange: #ea580c;
  --purple: #7c3aed;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
}
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background: var(--bg); color: var(--gray-800); line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.header {
  background: var(--navy); color: var(--white);
  position: sticky; top: 0; z-index: 10000;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; height: 56px;
}
.logo { display:flex; align-items:center; color:var(--white); font-size:1.3rem; font-weight:700; text-decoration:none; }
.logo-accent { color:var(--accent); }
.nav { display: flex; gap: 20px; }
.nav a { color: rgba(255,255,255,.8); font-size: .88rem; font-weight: 500; }
.nav a:hover { color: var(--white); }
.nav a i { margin-right: 3px; font-size: .82rem; }
.lang-switch {
  display:flex; gap:2px; margin-left:8px; align-items:center;
  background:rgba(255,255,255,.1); border-radius:6px; padding:2px;
}
.lang-btn {
  background:none; border:none; color:rgba(255,255,255,.5); font-size:.7rem; font-weight:700;
  padding:3px 7px; border-radius:4px; cursor:pointer; transition:all .15s;
}
.lang-btn.active { background:var(--accent); color:var(--white); }
.lang-btn:hover { color:var(--white); }
.nav-toggle { display:none; background:none; border:none; color:var(--white); font-size:1.4rem; cursor:pointer; }

.container { max-width: 1400px; margin: 0 auto; padding: 24px 20px; }

.page-title { margin-bottom: 16px; color: var(--navy); }

.summary-scroll { margin-bottom: 16px; }
.summary-row { display: flex; gap: 12px; flex-wrap: wrap; }
.summary-card {
  flex: 1 1 130px; background: var(--white); border-radius: var(--radius);
  padding: 14px 10px; box-shadow: var(--shadow); text-align: center;
}
.summary-card .label { font-size: .72rem; color: var(--gray-600); margin-bottom: 2px; }
.summary-card .value { font-size: 1.4rem; font-weight: 700; color: var(--navy); }
.summary-card .value.accent { color: var(--accent); }

.filter-bar {
  background: var(--white); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 24px;
}
.filter-grid {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
}
.filter-field { display: flex; flex-direction: column; gap: 2px; flex: 1 1 140px; }
.filter-field label { font-size: .75rem; font-weight: 600; color: var(--gray-600); }
.filter-field select, .filter-field input {
  padding: 7px 10px; border: 1px solid var(--gray-200); border-radius: var(--radius);
  font-size: .88rem; background: var(--white);
}
.filter-range { display: flex; gap: 4px; align-items: center; }
.filter-range input { width: 50%; }
.filter-range-sep { font-size: .75rem; color: var(--gray-400); flex-shrink: 0; }
.filter-actions {
  display: flex; gap: 8px; margin-top: 12px;
}
.filter-actions .btn { flex: 1; text-align: center; }
.btn {
  display: inline-block; padding: 8px 20px; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; cursor: pointer; border: none;
  transition: background .2s;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }

.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th { background: var(--navy); color: var(--white); padding: 10px 12px; text-align: left; white-space: nowrap; font-weight: 600; font-size: .8rem; }
td { padding: 10px 12px; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
tr:hover td { background: var(--gray-100); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: .7rem; font-weight: 600; white-space: nowrap;
}
.badge-green { background: #bbf7d0; color: #15803d; }
.badge-yellow { background: #fde68a; color: #a16207; }
.badge-red { background: #fecaca; color: #b91c1c; }
.badge-orange { background: #fed7aa; color: #c2410c; }
.badge-purple { background: #e9d5ff; color: #6d28d9; }
.badge-blue { background: #bfdbfe; color: var(--navy); }
.badge-navy { background: var(--navy); color: var(--white); }
.badge-accent { background: var(--accent); color: var(--white); }
.badge-hot { background: #b91c1c; color: var(--white); font-weight: 700; }
.badge-sold { background: var(--gray-600); color: var(--white); font-weight: 600; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-block; padding: 6px 12px; border-radius: var(--radius);
  font-size: .85rem; border: 1px solid var(--gray-200);
}
.pagination a { background: var(--white); color: var(--gray-800); }
.pagination a:hover { background: var(--accent); color: var(--white); border-color: var(--accent); }
.pagination .current { background: var(--accent); color: var(--white); border-color: var(--accent); font-weight: 600; }

.detail-header { margin-bottom: 24px; }
.detail-header h1 { font-size: 1.3rem; color: var(--navy); }
.detail-header .sub { color: var(--gray-600); font-size: .88rem; margin-top: 4px; }
.metric-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.metric-card {
  flex: 1 1 140px; background: var(--white); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); text-align: center; border-top: 3px solid var(--accent);
}
.metric-card .label { font-size: .75rem; color: var(--gray-600); }
.metric-card .val { font-size: 1.4rem; font-weight: 700; color: var(--navy); margin-top: 4px; }
.info-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.info-table th { background: var(--gray-100); color: var(--gray-800); text-align: left; padding: 10px 14px; width: 30%; font-size: .85rem; }
.info-table td { padding: 10px 14px; font-size: .9rem; border-bottom: 1px solid var(--gray-200); }
.banner {
  background: linear-gradient(135deg, #16a34a, #22c55e); color: var(--white);
  padding: 14px 20px; border-radius: var(--radius); margin-bottom: 20px;
  font-weight: 700; font-size: .95rem; text-align: center;
}
.actions { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.btn-outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--white); }

.footer {
  background: var(--navy); color: var(--gray-400); padding: 24px 20px;
  text-align: center; font-size: .82rem; margin-top: 40px;
}
.footer-links { margin-top: 8px; display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--gray-400); font-size: .75rem; }
.footer-links a:hover { color: var(--white); }

.btn-clear {
  background: var(--gray-200); color: var(--gray-600);
  text-align: center; line-height: 1.4;
}
.btn-clear:hover { background: var(--gray-400); color: var(--white); }

.area-tsubo { font-size: .72rem; color: var(--gray-400); }

.btn-bit {
  background: linear-gradient(135deg, #1a5276, #1a3a5c); color: var(--white);
  padding: 10px 24px; font-weight: 700; letter-spacing: .3px;
}
.btn-bit:hover { background: linear-gradient(135deg, #1f6f9f, #1a5276); color: var(--white); }
.btn-bit.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* 詳細ページ物件画像 — 鮮明表示 */
.prop-image-wrap {
  margin-bottom: 20px; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: #e8ecf1;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 16px 0;
}
.prop-image {
  max-width: 100%; max-height: 360px; object-fit: contain; display: block;
  border-radius: 4px;
}
.prop-image-credit {
  width: 100%; padding: 8px 0; font-size: .68rem; color: var(--gray-400);
  text-align: right;
}

/* BITリンクカード */
.bit-link-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px; text-align: center;
  border: 2px solid var(--navy);
}
.bit-link-hint {
  margin-top: 10px; font-size: .78rem; color: var(--gray-600);
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.copy-btn {
  display: inline-block; padding: 2px 10px; border-radius: 4px;
  background: var(--gray-200); color: var(--gray-600); border: none;
  font-size: .7rem; font-weight: 600; cursor: pointer; transition: background .2s;
}
.copy-btn:hover { background: var(--accent); color: var(--white); }

/* 一覧サムネイル */
.th-img { width: 72px; }
.td-img { padding: 4px 6px !important; }
.list-thumb {
  width: 64px; height: 48px; object-fit: cover;
  border-radius: 4px; display: block;
}
.thumb-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 64px; height: 48px; gap: 1px;
  background: var(--gray-100); border-radius: 4px; color: var(--gray-400);
  font-size: .7rem; flex-shrink: 0;
}

.bit-notice {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-top: 24px; border-left: 4px solid #1a5276;
}
.bit-notice-inner { display: flex; gap: 14px; align-items: flex-start; }
.bit-notice-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.bit-notice-title { font-weight: 700; color: var(--navy); font-size: .95rem; margin-bottom: 6px; }
.bit-notice p { font-size: .85rem; color: var(--gray-600); line-height: 1.7; margin: 0; }
.bit-notice-source {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--gray-200);
  font-size: .72rem; color: var(--gray-400);
}

/* 関連物件カード */
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.related-card {
  display: block; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .2s, transform .15s;
  text-decoration: none; color: var(--gray-800);
}
.related-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.related-img { width: 100%; height: 100px; object-fit: cover; display: block; }
.related-body { padding: 10px 12px; }
.related-addr { font-size: .78rem; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-price { font-size: .9rem; font-weight: 700; color: var(--navy); margin: 2px 0; }

.countdown-red { color: var(--red); font-weight: 700; }
.countdown-orange { color: var(--orange); font-weight: 600; }

.badge-tepban {
  background: linear-gradient(135deg, #f59e0b, #eab308);
  color: #fff; font-weight: 700; letter-spacing: .5px;
  box-shadow: 0 1px 3px rgba(245,158,11,.3);
}

.fav-btn {
  background: none; border: none; cursor: pointer; font-size: 1.2rem;
  color: var(--gray-400); transition: color .15s, transform .15s;
  padding: 2px 4px; line-height: 1;
}
.fav-btn:hover { transform: scale(1.2); }
.fav-btn.active { color: #f59e0b; }
.fav-btn-lg { font-size: 1.5rem; }
.nav-badge {
  display:inline-block; min-width:18px; height:18px; line-height:18px;
  background:#f59e0b; color:#fff; border-radius:9px; font-size:.68rem;
  font-weight:700; text-align:center; padding:0 5px;
  margin-left:4px; vertical-align:middle;
}
.nav-badge:empty { display:none; }

/* PC/SP 出し分け */
.sp-only { display: none; }
.pc-only { display: block; }

/* ===== スマホ専用カード ===== */
.property-card {
  display: block; text-decoration: none; color: var(--gray-800);
  background: var(--white); border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.07), 0 4px 24px rgba(0,0,0,.05);
  margin-bottom: 20px;
  transition: box-shadow .2s, transform .15s;
}
.property-card:active { transform: scale(.985); }
.property-card__img-wrap {
  position: relative; width: 100%;
  aspect-ratio: 16 / 9; background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  overflow: hidden;
}
.property-card__img-wrap.no-img { aspect-ratio: 4 / 1; }
.property-card__img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.property-card__img-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-300); font-size: 1.6rem;
}
.property-card__img-placeholder::after { content: '🏠'; }
.property-card__badges {
  position: absolute; top: 10px; left: 10px;
  display: flex; gap: 5px; flex-wrap: wrap;
}
.property-card__badges .badge {
  font-size: .72rem; padding: 3px 10px;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.property-card__body { padding: 16px 18px 14px; }
.property-card__price {
  font-size: 1.2rem; font-weight: 800; color: var(--navy);
  letter-spacing: -.02em; margin-bottom: 4px;
}
.property-card__addr {
  font-size: .82rem; color: var(--gray-600); line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.property-card__meta {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  font-size: .74rem; color: var(--gray-400); margin-bottom: 14px;
  line-height: 1.6;
}
.property-card__btn {
  display: block; width: 100%; text-align: center;
  padding: 12px; border-radius: 10px;
  background: var(--accent); color: var(--white);
  font-size: .92rem; font-weight: 700; letter-spacing: .02em;
}

@media (max-width: 768px) {
  .container { padding: 12px 10px; max-width: 100vw; overflow-x: hidden; }
  td { white-space: normal; word-break: break-word; overflow-wrap: anywhere; }
  .page-title { font-size: 1.1rem; margin-bottom: 10px; }
  .nav { display:none; flex-direction:column; position:absolute; top:56px; left:0; right:0;
    background:var(--navy); padding:16px 20px; gap:12px;
    box-shadow:0 8px 32px rgba(0,0,0,.3); z-index:10001; }
  .nav.open { display:flex; }
  .nav a { padding:8px 0; font-size:.95rem; }
  .nav-toggle { display:block; }

  /* ===== 統計: 横スクロール帯 ===== */
  .summary-scroll {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    margin: 0 -10px 10px; padding: 0 10px;
    scrollbar-width: none;
  }
  .summary-scroll::-webkit-scrollbar { display: none; }
  .summary-row { display: flex; flex-wrap: nowrap; gap: 8px; }
  .summary-card {
    flex: 0 0 auto; min-width: 90px; padding: 8px 10px;
    border-radius: 10px;
  }
  .summary-card .label { font-size: .62rem; margin-bottom: 1px; }
  .summary-card .value { font-size: 1.05rem; }

  /* ===== フォーム: 2列グリッド凝縮 ===== */
  .filter-bar {
    background: #f8fafc; border: 1px solid var(--gray-200);
    border-radius: 12px; padding: 10px; margin-bottom: 14px;
    box-shadow: none;
  }
  .filter-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
  }
  .filter-field { gap: 1px; }
  .filter-field label { font-size: .68rem; }
  .filter-field select, .filter-field input {
    padding: 6px 8px; font-size: .82rem;
    border-radius: 6px;
  }
  .filter-range { gap: 3px; }
  .filter-range input { padding: 6px 6px; }
  .filter-range-sep { font-size: .7rem; }
  .filter-actions { margin-top: 8px; gap: 6px; }
  .filter-actions .btn { padding: 9px 12px; font-size: .85rem; border-radius: 8px; }

  /* ===== 詳細ページ系 ===== */
  .metric-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
  .detail-header h1 { font-size: 1.05rem; }
  .prop-image-wrap { padding: 6px 6px 0; border-radius: 12px; }
  .bit-link-card { padding: 12px; border-radius: 12px; }
  .bit-link-card .btn-lg { padding: 11px 18px; font-size: .85rem; }
  .related-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .related-body { padding: 8px 10px; }
  .pagination { margin-top: 8px; }

  /* PC/SP 出し分け */
  .pc-only { display: none !important; }
  .sp-only { display: block !important; }
}

/* ===== 小型スマホ (480px以下) ===== */
@media (max-width: 480px) {
  .container { padding: 8px 6px; }
  .header-inner { padding: 0 10px; height: 48px; }
  .logo { font-size: 1.1rem; }
  .lang-switch { gap: 1px; padding: 1px; margin-left: 4px; }
  .lang-btn { padding: 2px 5px; font-size: .6rem; }
  .page-title { font-size: .95rem; }

  /* カード・ボタンの余白圧縮 */
  .summary-card { padding: 6px 8px; }
  .summary-card .label { font-size: .58rem; }
  .summary-card .value { font-size: 1rem; }
  .btn { padding: 6px 14px; font-size: .82rem; }
  .btn-sm { padding: 4px 10px; font-size: .75rem; }

  /* 詳細ページ */
  .metric-card { padding: 10px; }
  .metric-card .val { font-size: 1.1rem; }
  .analysis-card { padding: 12px; }
  .info-table th { width: 35%; padding: 8px 10px; font-size: .78rem; }
  .info-table td { padding: 8px 10px; font-size: .82rem; }

  /* プロパティカード */
  .property-card__body { padding: 12px 14px 10px; }
  .property-card__price { font-size: 1.05rem; }
  .property-card__addr { font-size: .78rem; }
  .property-card__meta { font-size: .68rem; }
  .property-card__btn { padding: 10px; font-size: .85rem; }

  /* フィルター */
  .filter-bar { padding: 8px; }
  .filter-field select, .filter-field input { padding: 5px 6px; font-size: .8rem; }

  /* 比較テーブル */
  .compare-table td { min-width: 120px; padding: 8px 10px; font-size: .75rem; }
  .compare-table th { padding: 8px 10px; font-size: .72rem; min-width: 70px; }

  /* ピックアップカード */
  .spotlight-card { flex: 0 0 200px; }

  /* フッター */
  .footer { padding: 16px 10px; font-size: .75rem; }
  .footer-links { gap: 10px; font-size: .68rem; }
}
