/* =====================================================
   REMAX COMPASS 物件ポータル
   Design tokens — REMAX Brand Identity Manual (2026 edition)
   Layout language — 余白・ヘアライン・左寄せ見出しの編集的レイアウト
   ===================================================== */
:root {
  /* REMAX official palette — do not alter these values */
  --red: #FF1200;
  --blue: #0043FF;
  --cream: #F7F5EE;
  --black: #000000;
  --white: #FFFFFF;
  --dark-red: #650000;
  --dark-blue: #000B35;
  --bridge-red: #AA1120;
  --bridge-blue: #0C2249;
  --sky-blue: #A3D4F2;
  --charcoal: #232323;

  /* Functional aliases */
  --text: var(--charcoal);
  --text-muted: #5c5c5c;
  --bg: var(--white);
  --bg-alt: var(--cream);
  --bg-dark: var(--dark-blue);
  --line: rgba(0, 0, 0, 0.12);
  --line-strong: rgba(0, 0, 0, 0.24);
  --line-light: rgba(255, 255, 255, 0.22);
  --radius: 2px;
  --container-w: 1280px;
  --header-h: 76px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;

  font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Montserrat", "Zen Kaku Gothic New", -apple-system, BlinkMacSystemFont,
    "Hiragino Kaku Gothic ProN", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.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;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--dark-blue); color: var(--white); padding: 12px 20px;
}
.skip-link:focus { left: 0; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ===== Typography helpers ===== */
.section-eyebrow {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em;
  color: var(--red); margin: 0 0 var(--space-2); text-transform: uppercase;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800;
  line-height: 1.4; margin: 0 0 var(--space-3); letter-spacing: 0.01em;
}
.section-title-sm {
  font-size: 1.15rem; font-weight: 800; margin: 0 0 var(--space-4);
  letter-spacing: 0.04em;
}
.section-lead { color: var(--text-muted); margin: 0 0 var(--space-5); max-width: 68ch; }
.page-title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; margin: 0 0 var(--space-3); }
.page-lead { color: var(--text-muted); max-width: 72ch; margin: 0 0 var(--space-6); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 13px 28px; border-radius: var(--radius); font-weight: 700;
  font-size: 0.92rem; letter-spacing: 0.01em; border: 1px solid transparent;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-primary { background: var(--red); color: var(--black); }
.btn-primary:hover { background: var(--dark-red); color: var(--white); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--cream); border-color: var(--charcoal); }
.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

.link-cta {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 0.9rem; letter-spacing: 0.02em; white-space: nowrap;
}
.link-cta::before {
  content: ""; width: 22px; height: 1px; background: var(--red);
  transition: width 0.2s ease;
}
.link-cta:hover::before { width: 34px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white); border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s ease;
}
.site-header.is-scrolled { box-shadow: 0 2px 14px rgba(0, 0, 0, 0.07); }
.header-inner {
  display: flex; align-items: center; gap: var(--space-4);
  min-height: var(--header-h);
}
.logo { flex-shrink: 0; display: flex; align-items: center; }
/* 2段ロゴ（1200x600、上下に余白を含む）。高さ基準で合わせる */
.logo-img { height: 60px; width: auto; }

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: var(--space-4); }
.main-nav a {
  font-size: 0.86rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 6px 0; border-bottom: 2px solid transparent; display: block;
}
.main-nav a:hover { border-bottom-color: var(--red); }

.header-cta { display: flex; align-items: center; gap: var(--space-3); }
.header-fav {
  position: relative; font-size: 0.8rem; font-weight: 700;
  padding: 6px 4px; white-space: nowrap;
}
.header-fav:hover { color: var(--red); }
.fav-count {
  display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 5px;
  background: var(--red); color: var(--black); border-radius: 10px;
  font-size: 0.7rem; font-weight: 700; text-align: center; line-height: 20px;
}
.header-tel { display: none; line-height: 1.3; }
.tel-label { display: block; font-size: 0.66rem; color: var(--text-muted); letter-spacing: 0.04em; }
.tel-number { display: block; font-size: 1.02rem; font-weight: 800; letter-spacing: 0.01em; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; background: none; border: 1px solid var(--line);
  border-radius: var(--radius); cursor: pointer; padding: 0 10px;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%; background: var(--charcoal);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Demo notice ===== */
.demo-notice {
  margin: 0; padding: 10px var(--space-4); text-align: center;
  background: var(--cream); border-bottom: 1px solid var(--line);
  font-size: 0.78rem; color: var(--text-muted); letter-spacing: 0.01em;
}

/* ===== Breadcrumb ===== */
.breadcrumb { padding: var(--space-4) 0 var(--space-3); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.76rem; color: var(--text-muted); }
.breadcrumb li:not(:last-child)::after { content: "／"; margin-left: 8px; opacity: 0.6; }
.breadcrumb a:hover { color: var(--red); }

/* ===== Hero + search ===== */
.portal-hero {
  background: var(--dark-blue); color: var(--white);
  background-image: linear-gradient(rgba(0, 11, 53, 0.86), rgba(0, 11, 53, 0.94)), url("../images/Global-Map2_42427853a8.avif");
  background-size: cover; background-position: center;
}
.portal-hero-inner { padding: var(--space-8) var(--space-4) var(--space-7); }
.portal-hero .hero-eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em;
  color: var(--sky-blue); margin: 0 0 var(--space-3);
}
.portal-hero-title {
  font-size: clamp(1.9rem, 4.6vw, 3.1rem); font-weight: 800; line-height: 1.35;
  margin: 0 0 var(--space-3); letter-spacing: 0.005em;
}
.portal-hero-sub {
  color: rgba(255, 255, 255, 0.82); max-width: 62ch; margin: 0 0 var(--space-6);
  font-size: 0.98rem;
}

.hero-search {
  background: var(--white); color: var(--text); padding: var(--space-4);
  border-radius: var(--radius); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}
.hero-search-row {
  display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: var(--space-3);
  align-items: end;
}
.hs-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hs-field label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted); }
.hs-submit { height: 46px; }
.hs-count { font-size: 0.78rem; font-weight: 700; }

input[type="text"], input[type="email"], input[type="tel"], input[type="search"],
input[type="number"], select, textarea {
  width: 100%; padding: 11px 12px; font-size: 0.9rem; font-family: inherit;
  color: var(--text); background: var(--white);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--charcoal) 50%),
    linear-gradient(135deg, var(--charcoal) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
textarea { line-height: 1.7; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9a9a9a; }

.hero-quick {
  display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4);
}
.hero-quick a {
  display: inline-block; padding: 7px 15px; font-size: 0.8rem; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 999px;
  color: var(--white);
}
.hero-quick a:hover { background: var(--white); color: var(--dark-blue); }

/* ===== Type nav ===== */
.type-nav { padding: var(--space-7) 0 var(--space-6); border-bottom: 1px solid var(--line); }
.type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-3); }
.type-item a {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: var(--space-4) var(--space-2); border: 1px solid var(--line);
  border-radius: var(--radius); text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.type-item a:hover { border-color: var(--red); transform: translateY(-2px); }
.type-icon svg { fill: var(--dark-blue); }
.type-label { font-weight: 700; font-size: 0.92rem; }
.type-count { font-size: 0.75rem; color: var(--text-muted); }

/* ===== Listing blocks ===== */
.listing-block { padding: var(--space-7) 0; }
.listing-block-alt { background: var(--cream); }
.block-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap;
}
.block-head .section-title { margin-bottom: 0; }

.p-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }

/* ===== Property card ===== */
.p-card {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.p-card:hover { border-color: var(--line-strong); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08); }
.p-card-link { display: flex; flex-direction: column; height: 100%; }
.p-card-media { position: relative; aspect-ratio: 3 / 2; background: var(--dark-blue); }
.p-card-media img { width: 100%; height: 100%; object-fit: cover; }
.p-card-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }

.badge {
  display: inline-block; padding: 3px 10px; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.04em; border-radius: var(--radius);
}
.badge-new { background: var(--red); color: var(--black); }
.badge-deal { background: var(--dark-blue); color: var(--white); }
.badge-deal-sale { background: var(--cream); color: var(--dark-blue); border: 1px solid var(--dark-blue); }
.badge-available { background: var(--white); color: var(--dark-blue); border: 1px solid var(--line); }
.badge-negotiating { background: var(--charcoal); color: var(--white); }
.badge-closed { background: #6f6f6f; color: var(--white); }
.badge-type { background: rgba(0, 11, 53, 0.86); color: var(--white); }

.p-card-body { padding: var(--space-3) var(--space-3) var(--space-4); flex: 1; display: flex; flex-direction: column; }
.p-card-title {
  font-size: 1rem; font-weight: 700; line-height: 1.55; margin: 0 0 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.p-card-access { font-size: 0.78rem; color: var(--text-muted); margin: 0 0 var(--space-3); }
.p-card-rent {
  margin: 0 0 var(--space-3); padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line); display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px;
}
.rent-value { font-size: 1.45rem; font-weight: 800; color: var(--red); letter-spacing: 0.005em; }
.rent-unit { font-size: 0.78rem; color: var(--text-muted); }
.p-card-unit { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); }

.p-card-spec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 var(--space-3); }
.p-card-spec div { display: flex; flex-direction: column; gap: 2px; }
.p-card-spec dt { font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.04em; }
.p-card-spec dd { margin: 0; font-size: 0.85rem; font-weight: 700; }

.p-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.p-card-tags li {
  font-size: 0.7rem; padding: 2px 8px; background: var(--cream);
  border: 1px solid var(--line); border-radius: 999px; color: var(--text-muted);
}

.fav-btn {
  position: absolute; top: 10px; right: 10px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line);
  border-radius: 50%; cursor: pointer; padding: 0;
  transition: background-color 0.2s ease;
}
.fav-btn svg { fill: none; stroke: var(--charcoal); stroke-width: 1.6; }
.fav-btn:hover { background: var(--white); }
.fav-btn.is-active svg { fill: var(--red); stroke: var(--red); }

.fav-btn-wide.is-active { border-color: var(--red); color: var(--red); }
.fav-btn-wide.is-active::before { content: "★ "; }

/* ===== Area grid ===== */
.area-block { padding: var(--space-7) 0; background: var(--cream); }
.area-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: var(--space-2); }
.area-item a, .area-item span {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 13px var(--space-3); background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.88rem;
}
.area-item a:hover { border-color: var(--red); }
/* 「さいたま市」など長い市名でもタイル内で折り返さないようにする */
.area-name { font-weight: 700; white-space: nowrap; }
.area-count { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.area-item.is-empty span { opacity: 0.45; }

/* 一都三県：都県ごとにまとめて並べる */
.area-groups { display: grid; gap: var(--space-5); }
.area-group-title {
  display: flex; align-items: baseline; gap: var(--space-2);
  font-size: 0.86rem; font-weight: 800; letter-spacing: 0.06em;
  margin: 0 0 var(--space-3); padding-bottom: 8px;
  border-bottom: 1px solid var(--line-strong);
}
.area-group-title a { display: flex; align-items: baseline; gap: var(--space-2); }
.area-group-title a:hover { color: var(--red); }
.area-group-count { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); }
/* 都県内の小見出し（東京都の 23区／多摩・市部 など） */
.area-sub-label {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-muted); margin: 0 0 var(--space-2);
}
.area-sub-label:not(:first-of-type) { margin-top: var(--space-3); }

/* ===== Why block ===== */
.why-block { padding: var(--space-8) 0; }
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); margin-bottom: var(--space-6); }
.why-card { border-top: 2px solid var(--charcoal); padding-top: var(--space-3); }
.why-num { font-size: 0.78rem; font-weight: 800; color: var(--red); letter-spacing: 0.1em; margin: 0 0 6px; }
.why-card h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 8px; }
.why-card p { margin: 0; font-size: 0.88rem; color: var(--text-muted); }
.why-actions { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }

/* ===== Search page layout ===== */
.page-search { padding-bottom: var(--space-8); }
.search-layout { display: grid; grid-template-columns: 300px 1fr; gap: var(--space-6); align-items: start; }

.filter-panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-4); position: sticky; top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto;
}
.filter-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.filter-head h2 { font-size: 1rem; font-weight: 800; margin: 0; letter-spacing: 0.04em; }
.filter-close { display: none; background: none; border: none; font-family: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }

.filter-group { border: none; margin: 0 0 var(--space-4); padding: 0 0 var(--space-4); border-bottom: 1px solid var(--line); }
.filter-group:last-of-type { border-bottom: none; }
.filter-label {
  display: block; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.06em;
  margin: 0 0 var(--space-2); padding: 0;
}

/* 賃貸／売買のセグメント切り替え */
.deal-segment { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
.deal-segment label { position: relative; display: block; cursor: pointer; }
.deal-segment input {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.deal-segment span {
  display: block; padding: 10px 8px; text-align: center;
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text-muted); background: var(--white);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.deal-segment label:first-child span { border-right-width: 0; }
.deal-segment label:hover span { color: var(--text); background: var(--cream); }
.deal-segment input:checked + span {
  background: var(--dark-blue); border-color: var(--dark-blue); color: var(--white);
}
.deal-segment input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }

.deal-segment-hero { max-width: 340px; margin-bottom: var(--space-3); }
.deal-segment-hero span { padding: 11px 10px; font-size: 0.88rem; }

.check-list { display: flex; flex-direction: column; gap: 2px; }
.check-list-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 10px; }

/* 都県ごとに見出しを付けたチェックリスト（エリア絞り込み） */
.check-groups { display: grid; gap: var(--space-3); }

/* 沿線・駅 */
.line-picker { display: grid; gap: var(--space-2); }
.filter-hint { margin: 0; font-size: 0.74rem; color: var(--text-muted); }
.check-group-label {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em;
  color: var(--text-muted); margin: 0 0 4px; padding-bottom: 3px;
  border-bottom: 1px solid var(--line);
}
.check-sub-label {
  font-size: 0.7rem; font-weight: 700; color: var(--text-muted);
  margin: var(--space-2) 0 2px; opacity: 0.8;
}
.check-sub-label:first-of-type { margin-top: 6px; }
.check-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 4px;
  font-size: 0.83rem; cursor: pointer; border-radius: var(--radius);
}
.check-item:hover { background: var(--cream); }
.check-item input { width: 16px; height: 16px; accent-color: var(--red); flex-shrink: 0; margin: 0; }
.check-text { flex: 1; min-width: 0; }
.check-count { font-size: 0.7rem; color: var(--text-muted); }

.range-row { display: flex; align-items: center; gap: 8px; }
.range-sep { color: var(--text-muted); font-size: 0.85rem; }

.filter-actions { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-2); }
.filter-apply { display: none; }

/* ===== Results ===== */
.results-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4);
  padding-bottom: var(--space-3); border-bottom: 1px solid var(--line);
}
.results-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 4px; }
.results-count p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.results-tools { display: flex; align-items: center; gap: var(--space-3); }
.filter-open { display: none; }
.sort-field { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.sort-field select { width: auto; min-width: 150px; padding: 8px 30px 8px 10px; font-size: 0.83rem; }

.active-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-4); }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px;
  background: var(--cream); border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.78rem; font-family: inherit; cursor: pointer; color: var(--text);
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip span[aria-hidden] { font-size: 0.9rem; line-height: 1; }

.p-grid-results { margin-bottom: var(--space-6); }

.empty-state {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-7) var(--space-4); text-align: center; background: var(--cream);
}
.empty-state h1, .empty-state h2 { font-size: 1.2rem; font-weight: 800; margin: 0 0 var(--space-2); }
.empty-state p { margin: 0 auto var(--space-4); color: var(--text-muted); max-width: 56ch; font-size: 0.9rem; }
.empty-actions { display: flex; justify-content: center; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.empty-state-page { margin: var(--space-8) auto; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-btn {
  min-width: 42px; height: 42px; padding: 0 12px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.page-btn:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.page-btn.is-current { background: var(--dark-blue); color: var(--white); border-color: var(--dark-blue); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.filter-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 110;
}

/* ===== CTA band ===== */
.cta-band { background: var(--dark-blue); color: var(--white); margin-top: var(--space-8); padding: var(--space-6) 0; }
.cta-band-inline { margin: var(--space-7) 0 0; padding: var(--space-6) var(--space-5); }
.cta-band-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5); flex-wrap: wrap;
}
.cta-band h2 { font-size: 1.3rem; font-weight: 800; margin: 0 0 6px; }
.cta-band p { margin: 0; color: rgba(255, 255, 255, 0.8); font-size: 0.9rem; max-width: 62ch; }

/* ===== Detail page ===== */
.page-detail { padding-bottom: var(--space-8); }
.detail-head { padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); margin-bottom: var(--space-5); }
.detail-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: var(--space-2); }
.detail-id { font-size: 0.74rem; color: var(--text-muted); letter-spacing: 0.06em; }
.detail-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; line-height: 1.4; margin: 0 0 8px; }
.detail-address { margin: 0; font-size: 0.88rem; color: var(--text-muted); }

.detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: var(--space-6); align-items: start; }

/* 成約済 */
.closed-notice {
  background: var(--cream); border: 1px solid var(--line-strong);
  border-left: 4px solid var(--charcoal); border-radius: var(--radius);
  padding: var(--space-4); margin-bottom: var(--space-5);
}
.closed-notice h2 { font-size: 1.05rem; font-weight: 800; margin: 0 0 6px; }
.closed-notice p { margin: 0 0 var(--space-3); font-size: 0.88rem; color: var(--text-muted); }
.closed-actions { display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.side-closed {
  margin: 0; padding: 10px; text-align: center; font-size: 0.84rem; font-weight: 700;
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius);
}
.p-card-closed .p-card-media img { filter: grayscale(0.65); opacity: 0.75; }

.detail-gallery { margin: 0 0 var(--space-6); }
.gallery-stage { position: relative; }
.detail-gallery #gallery-main {
  width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius); background: var(--dark-blue);
}
.detail-gallery figcaption { font-size: 0.74rem; color: var(--text-muted); margin-top: 8px; }
.gallery-note { font-size: 0.72rem; color: var(--text-muted); margin: 6px 0 0; line-height: 1.7; }
.fee-note {
  margin: var(--space-4) 0 0; padding: var(--space-3);
  background: var(--cream); border-left: 3px solid var(--red);
  font-size: 0.84rem; line-height: 1.8;
}

/* 前へ／次へ。写真が2枚以上あるときだけ描画される */
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line-strong);
  border-radius: 50%; cursor: pointer; font-size: 1.4rem; line-height: 1;
  color: var(--dark-blue); font-family: inherit; padding: 0 0 3px;
}
.gallery-nav:hover { background: var(--white); border-color: var(--charcoal); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-counter {
  position: absolute; right: 12px; bottom: 12px; margin: 0;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(0, 11, 53, 0.78); color: var(--white);
  font-size: 0.72rem; font-weight: 700;
}

.gallery-thumbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: var(--space-2); margin-top: var(--space-2);
}
.gallery-thumb {
  display: block; width: 100%; padding: 0; cursor: pointer; background: none;
  border: 2px solid transparent; border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.15s ease, opacity 0.15s ease;
  opacity: 0.72;
}
.gallery-thumb img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.is-current { border-color: var(--red); opacity: 1; }

/* 地図 */
.detail-map {
  position: relative; aspect-ratio: 16 / 9; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; background: var(--cream);
}
.detail-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.detail-map-fallback {
  position: absolute; inset: 0; margin: 0; display: flex; align-items: center;
  justify-content: center; text-align: center; padding: var(--space-4);
  font-size: 0.84rem; color: var(--text-muted);
}
.detail-map-note {
  display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap;
  margin: var(--space-3) 0 0; font-size: 0.82rem; color: var(--text-muted);
}

.detail-section { margin-bottom: var(--space-7); }
.detail-section h2 {
  font-size: 1.15rem; font-weight: 800; margin: 0 0 var(--space-3);
  padding-bottom: 10px; border-bottom: 2px solid var(--charcoal);
}
.detail-desc { margin: 0 0 var(--space-3); font-size: 0.94rem; }

.feature-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.feature-tags li {
  font-size: 0.78rem; font-weight: 700; padding: 5px 13px;
  background: var(--cream); border: 1px solid var(--line); border-radius: 999px;
}

.spec-table th, .spec-table td,
.company-table th, .company-table td {
  border-bottom: 1px solid var(--line); padding: 12px var(--space-3);
  text-align: left; vertical-align: top; font-size: 0.87rem;
}
.spec-table th, .company-table th {
  width: 34%; background: var(--cream); font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.02em;
}
.company-table th { width: 38%; font-size: 0.8rem; }
.company-table td { font-size: 0.82rem; }

.flow-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.flow-list-wide { grid-template-columns: repeat(4, 1fr); }
.flow-list li { border-top: 2px solid var(--line-strong); padding-top: var(--space-3); }
.flow-step { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; color: var(--red); }
.flow-list h3 { font-size: 0.98rem; font-weight: 800; margin: 4px 0 6px; }
.flow-list p { margin: 0; font-size: 0.84rem; color: var(--text-muted); }

/* Detail sidebar */
.detail-side { position: sticky; top: calc(var(--header-h) + 16px); }
.side-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-3); background: var(--white);
}
.side-card + .side-card { margin-top: var(--space-4); }
.side-card h2 { font-size: 0.95rem; font-weight: 800; margin: 0; }
.side-rent { margin: 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.side-spec { margin: 0; display: grid; gap: 8px; }
.side-spec div { display: flex; justify-content: space-between; gap: var(--space-3); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.side-spec dt { font-size: 0.78rem; color: var(--text-muted); }
.side-spec dd { margin: 0; font-size: 0.86rem; font-weight: 700; text-align: right; }
.side-tel {
  display: flex; flex-direction: column; gap: 2px; padding-top: var(--space-2);
  border-top: 1px solid var(--line); text-align: center;
}
.side-tel span { font-size: 0.72rem; color: var(--text-muted); }
.side-tel strong { font-size: 1.35rem; font-weight: 800; letter-spacing: 0.01em; }
.side-tel small { font-size: 0.72rem; color: var(--text-muted); }
.side-note { margin: 0; font-size: 0.78rem; color: var(--text-muted); }

/* ===== Forms ===== */
.inquiry-form {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5);
}
.form-row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-row-full { grid-column: 1 / -1; }
.form-row label { font-size: 0.8rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.required, .optional {
  font-size: 0.64rem; font-weight: 700; padding: 2px 7px; border-radius: var(--radius); letter-spacing: 0.04em;
}
.required { background: var(--red); color: var(--black); }
.optional { background: var(--cream); color: var(--text-muted); border: 1px solid var(--line); }
.field-hint { margin: 6px 0 0; font-size: 0.76rem; color: var(--text-muted); }
.field-error { margin: 0; font-size: 0.76rem; color: var(--bridge-red); font-weight: 700; min-height: 1em; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bridge-red); }

.trust-signals { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-3); }
.trust-signals li { font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.trust-signals li::before { content: "✓"; color: var(--red); font-weight: 800; }

/* 同意チェック */
.consent-row { margin-top: calc(var(--space-2) * -1); }
.consent-label {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  font-size: 0.86rem; line-height: 1.7;
}
.consent-label input { width: 18px; height: 18px; margin: 4px 0 0; flex-shrink: 0; }
.consent-label a { text-decoration: underline; font-weight: 700; }
.consent-label a:hover { color: var(--red); }
.consent-label .required { margin-left: 8px; }

/* プライバシーポリシー */
.policy-list { display: grid; gap: 8px; margin: 0 0 var(--space-3); }
.policy-list li { padding-left: 1.1em; position: relative; }
.policy-list li::before { content: "・"; position: absolute; left: 0; color: var(--red); }
.spec-note { font-size: 0.78rem; color: var(--text-muted); }
.policy-small { font-size: 0.78rem; color: var(--text-muted); }
.policy-date { font-size: 0.8rem; color: var(--text-muted); margin-top: var(--space-4); }

.status-sub { display: block; margin-top: 6px; font-size: 0.78rem; font-weight: 400; text-decoration: underline; }
.form-status { margin: var(--space-3) 0 0; font-size: 0.84rem; font-weight: 700; }
.form-status.is-error { color: var(--bridge-red); }
.form-status.is-success { color: var(--bridge-blue); }

.detail-inquiry { padding-top: var(--space-4); }
.fav-attach { margin: 0 0 8px; font-size: 0.84rem; font-weight: 700; }
.fav-attach-list { display: grid; gap: 4px; }
.fav-attach-list a { font-size: 0.8rem; color: var(--text-muted); }
.fav-attach-list a:hover { color: var(--red); }

/* ===== Simple pages ===== */
.page-simple { padding-bottom: var(--space-8); }
.contact-layout { display: grid; grid-template-columns: 1fr 340px; gap: var(--space-6); align-items: start; }
.contact-side { position: sticky; top: calc(var(--header-h) + 16px); }
.owner-section { margin-bottom: var(--space-8); }
.fav-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-6); }

/* ===== Footer ===== */
.site-footer { background: var(--dark-blue); color: rgba(255, 255, 255, 0.82); margin-top: var(--space-8); padding: var(--space-7) 0 var(--space-4); }
.footer-inner { display: flex; justify-content: space-between; gap: var(--space-7); flex-wrap: wrap; padding-bottom: var(--space-6); }
.footer-logo { height: 68px; width: auto; margin-bottom: var(--space-2); }
.footer-company { font-weight: 700; color: var(--white); margin: 0 0 6px; font-size: 0.9rem; }
.footer-address { margin: 0; font-size: 0.78rem; line-height: 1.9; }
.footer-nav { display: flex; gap: var(--space-7); }
.footer-nav h3 { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; color: var(--white); margin: 0 0 var(--space-3); }
.footer-nav ul { display: grid; gap: 8px; }
.footer-nav a { font-size: 0.82rem; }
.footer-nav a:hover { color: var(--white); text-decoration: underline; }
/* 宅建業法・表示規約に基づく共通表示 */
.footer-legal {
  border-top: 1px solid var(--line-light);
  padding: var(--space-3) var(--space-4);
  font-size: 0.74rem; line-height: 1.9;
}
.footer-legal p { margin: 0 0 6px; }
.footer-legal p:last-child { margin-bottom: 0; }
.footer-legal strong { color: var(--white); }

.footer-bottom {
  display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap;
  border-top: 1px solid var(--line-light); padding-top: var(--space-3);
  font-size: 0.72rem;
}
.footer-bottom p { margin: 0; }
.footer-note { opacity: 0.7; }

/* =====================================================
   Responsive
   ===================================================== */
@media (min-width: 1100px) {
  .header-tel { display: block; }
}

@media (max-width: 1180px) {
  .hero-search-row { grid-template-columns: repeat(2, 1fr); }
  .hs-submit { grid-column: 1 / -1; }
}

@media (max-width: 1024px) {
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto; background: var(--white);
    border-bottom: 1px solid var(--line); transform: translateY(-120%);
    transition: transform 0.25s ease; z-index: 90; max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .main-nav.is-open { transform: translateY(0); }
  .main-nav ul { flex-direction: column; gap: 0; padding: var(--space-3) var(--space-4); }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .main-nav li:last-child a { border-bottom: none; }
  .nav-toggle { display: flex; }
  .header-cta { margin-left: auto; }
  .header-cta .btn { display: none; }

  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .p-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .flow-list-wide { grid-template-columns: repeat(2, 1fr); }

  .detail-layout, .contact-layout { grid-template-columns: 1fr; }
  .detail-side, .contact-side { position: static; }

  /* 絞り込みはドロワー化 */
  .search-layout { grid-template-columns: 1fr; }
  .filter-panel {
    position: fixed; inset: 0 auto 0 0; width: min(360px, 88vw); z-index: 120;
    background: var(--white); transform: translateX(-100%); transition: transform 0.25s ease;
    max-height: none; height: 100%; border-radius: 0; border-width: 0 1px 0 0;
    padding-bottom: var(--space-8);
  }
  .filter-panel.is-open { transform: translateX(0); }
  .filter-close { display: block; }
  .filter-open { display: inline-flex; }
  .filter-apply { display: flex; }
  .filter-actions {
    position: sticky; bottom: 0; background: var(--white);
    padding: var(--space-3) 0; border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  :root { --header-h: 64px; }

  /* エリアタイルは2列。幅が足りないので市区名と件数を縦に積む */
  .area-grid { grid-template-columns: repeat(2, 1fr); }
  .area-item a, .area-item span {
    flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px;
  }

  .logo-img { height: 50px; }
  .footer-logo { height: 58px; }
  .header-fav { font-size: 0.74rem; }

  .portal-hero-inner { padding: var(--space-6) var(--space-4) var(--space-5); }
  .hero-search { padding: var(--space-3); }
  .hero-search-row { grid-template-columns: 1fr; }

  .type-grid { grid-template-columns: repeat(2, 1fr); }
  .p-grid { grid-template-columns: 1fr; }

  .results-head { align-items: flex-start; }
  .results-tools { width: 100%; justify-content: space-between; }
  .sort-field select { min-width: 0; }

  .inquiry-form { grid-template-columns: 1fr; padding: var(--space-4) var(--space-3); }
  .flow-list, .flow-list-wide { grid-template-columns: 1fr; }
  .gallery-thumbs { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
  .gallery-nav { width: 34px; height: 34px; font-size: 1.15rem; }
  .detail-map { aspect-ratio: 4 / 3; }

  .footer-inner { flex-direction: column; gap: var(--space-5); }
  .footer-nav { gap: var(--space-6); }
  .cta-band-inner { flex-direction: column; align-items: flex-start; }
  .cta-band-inline { padding: var(--space-5) var(--space-4); }
}

/* ---------- 404ページ ---------- */
.notfound { max-width: 640px; text-align: center; }
.notfound-lead { margin: var(--space-3) 0 var(--space-5); line-height: 2; color: var(--text-muted); }
.notfound-actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }
.notfound-help { margin-top: var(--space-5); font-size: 0.86rem; color: var(--text-muted); }

/* REMAXフランチャイズの必須表記 */
.footer-franchise { font-size: 0.72rem; letter-spacing: 0.04em; opacity: 0.85; }

/* お問い合わせフォームの補足文 */
.form-note { margin: 6px 0 0; font-size: 0.78rem; color: var(--text-muted); }
