/* ========================================
   e-room モバイル専用CSS v3.0
   ブレイクポイント:
     480px — スマートフォン専用
     600px — 小型端末テーブル縦積み
   ※ 768px (タブレット) は style.css に任せる
   ======================================== */


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: 共通 — タッチ・余白・基本設定
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  html {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
  }
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    font-size: 14px;
    line-height: 1.7;
  }
  .container {
    padding: 10px 12px 64px;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* パンくず: 横スクロール・折り返さない */
  .breadcrumb {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0;
    font-size: .75rem;
  }
  .breadcrumb::-webkit-scrollbar { display: none; }
  .breadcrumb li { flex-shrink: 0; white-space: nowrap; }

  /* セクション共通 */
  .section-title {
    font-size: .85rem;
    margin-bottom: 6px;
    padding-left: 4px;
  }
  .mt-16 { margin-top: 8px; }
  .mt-24 { margin-top: 12px; }
  .mt-32 { margin-top: 16px; }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: ヘッダー・ナビ強化
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  .header-inner { height: 50px; }
  .logo-text { font-size: 1.15rem; }
  .site-logo img { height: 30px; }

  /* ハンバーガー: タップエリア拡大 */
  .nav-toggle {
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px;
  }
  .nav-toggle span { width: 22px; }

  /* ドロワーメニュー: 項目を大きく */
  .site-nav { top: 50px; }
  .site-nav > ul > li > a {
    padding: 15px 20px;
    font-size: .95rem;
    min-height: 50px;
    display: flex;
    align-items: center;
  }
  /* ドロップダウン項目はコンパクトに */
  .nav-dropdown > li > a {
    padding: 12px 32px;
    font-size: .88rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* パンくず */
  .breadcrumb-nav { padding: 4px 12px; }
  .breadcrumb { font-size: .7rem; }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: ヒーロー（TOPページ）検索セクション
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  /* ── ヒーロー全体: 上に詰める ── */
  .hero { padding: 16px 12px 16px; }
  .hero h1 { font-size: 1.1rem; margin-bottom: 4px; line-height: 1.45; }
  .hero p { font-size: .8rem; margin-bottom: 6px; line-height: 1.5; }
  .hero-filter-outer { margin-top: 4px; }

  /* ── 場所タブ（エリア/沿線/検索）: コンパクト均等幅 ── */
  .hero .loc-tab-group {
    overflow-x: visible; flex-wrap: nowrap;
    justify-content: center; gap: 2px; width: 100%;
  }
  .hero .loc-tab {
    flex: 1; min-height: 30px; padding: 5px 0;
    font-size: .68rem; border-radius: 6px 6px 0 0; justify-content: center;
  }

  /* ── 区ボタン: 3列グリッド＋コンパクト ── */
  .hero .filter-bar .sb-ward-row {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px;
  }
  .hero .filter-bar .sb-ward-btn {
    padding: 6px 0; font-size: .72rem; text-align: center;
    border-radius: 12px; min-height: 40px;
    display: flex; align-items: center; justify-content: center;
  }
  .hero .filter-bar .loc-panel-title {
    font-size: .72rem; margin-bottom: 4px;
  }
  .hero .filter-bar .loc-tab-panel {
    padding: 6px 8px;
  }
  /* パネル内の「この条件で検索」ボタン */
  .hero .filter-bar .loc-tab-panel > .btn-search-sm {
    margin-top: 8px; width: 100%; min-height: 32px; font-size: .76rem;
  }

  /* 町名・駅ピル: コンパクト */
  .hero .filter-bar .sb-town-pill,
  .hero .filter-bar .sb-station-pill {
    padding: 3px 8px; font-size: .64rem; border-radius: 12px;
  }

  /* ── 間取り: 折り返しグリッド（全項目見える） ── */
  .hero .filter-bar .layout-checks {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px; padding-bottom: 1px; width: 100%;
    overflow-x: visible;
  }
  .hero .filter-bar .layout-checks label {
    flex-shrink: 0;
    background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
    border-radius: 12px; padding: 4px 2px; min-height: 36px;
    color: rgba(255,255,255,.85); backdrop-filter: blur(4px);
    white-space: nowrap; font-size: .7rem; text-align: center;
    display: flex; align-items: center; justify-content: center; gap: 2px;
  }
  .hero .filter-bar .layout-checks label:has(input:checked) {
    background: var(--accent); border-color: var(--accent); color: #fff;
  }
  /* チェックボックス */
  .hero .filter-bar .layout-checks input[type="checkbox"] {
    width: 14px; height: 14px; margin: 0;
  }

  /* ── 沿線セレクト ── */
  .hero .filter-bar #sb-line,
  .hero-layout-sel, .line-sel-full {
    padding: 5px 8px; min-height: 30px; font-size: .72rem; width: 100%;
    max-width: 100% !important;
  }

  /* ── フィルターパネル（間取り・賃料・面積・徒歩/築年） ── */
  .hero .filter-bar .filter-panel {
    padding: 6px 8px 4px;
  }
  .hero .filter-bar .fp-grid {
    gap: 6px; margin-bottom: 6px;
  }
  .hero .filter-bar .fp-section-title {
    font-size: .62rem; margin-bottom: 8px; padding-bottom: 2px;
  }

  /* 駅徒歩・築年: 横2列 */
  .hero .filter-bar .fp-section:last-child .search-field {
    display: inline-flex; align-items: center; gap: 4px; width: 100%;
  }
  .hero .filter-bar .fp-section:last-child .search-field label {
    font-size: .64rem; flex-shrink: 0; min-width: 36px;
  }
  .hero .filter-bar .fp-section:last-child .search-field select {
    flex: 1; min-height: 28px; font-size: .68rem; padding: 2px 4px;
  }

  /* ── 賃料/面積ルーラー: コンパクト化 ── */
  .rent-ruler-outer { padding: 8px 0 10px; }
  .rent-ruler-track-wrap { height: 40px; margin: 0 10px; }
  .rent-thumb-max, .rent-thumb-min {
    border-left-width: 8px; border-right-width: 8px;
  }
  .rent-thumb-max { border-top-width: 12px; }
  .rent-thumb-min { border-bottom-width: 12px; }
  .rent-ruler-ticks { margin: 5px 10px 0; height: 14px; margin-bottom: 6px; }
  .rent-tick-lbl { font-size: .55rem; }
  .rent-ruler-display, .hero-rent-display {
    margin-top: 10px; padding: 2px 6px; gap: 2px;
  }
  .rent-rd-val { font-size: .66rem; min-width: 38px; }
  .rent-rd-sep { font-size: .6rem; }

  /* ── アクション行（こだわり+検索） ── */
  .hero .filter-bar .fp-actions {
    flex-direction: column; gap: 4px; align-items: stretch;
    margin-top: 6px; padding-top: 6px;
  }
  .hero .filter-bar .fp-actions .btn-kd-toggle {
    width: 100%; justify-content: center;
    padding: 5px 10px; font-size: .7rem;
  }
  .hero .filter-bar .fp-actions .btn-search,
  .hero .filter-bar .fp-actions-right .btn-search {
    width: 100%; padding: 7px; font-size: .78rem; min-height: 34px;
  }
  .hero .filter-bar .fp-actions-right {
    flex-direction: column; gap: 3px; margin-left: 0; width: 100%;
  }

  /* ── こだわりパネル: コンパクト ── */
  .hero .filter-bar .fp-kodawari { padding: 6px 0 2px; }
  .hero .filter-bar .fp-kd-grid {
    gap: 6px 8px;
  }
  .hero .filter-bar .fp-kd-grid .kd-cat { min-width: 0; flex: 1 1 100%; }
  .hero .filter-bar .kd-cat-name { font-size: .64rem; margin-bottom: 3px; }
  .hero .filter-bar .kd-checks {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px 4px;
  }
  .hero .filter-bar .kd-checks label { font-size: .64rem; }
  .hero .filter-bar .kd-search-row { margin-top: 6px; padding-top: 6px; }
  .hero .filter-bar .kd-search-row .btn-search {
    width: 100%; padding: 7px; min-height: 34px;
  }

  /* ── 下段コントロール ── */
  .hero-bottom-row { flex-direction: column; gap: 4px; margin-top: 6px; }
  .hero-check-row { gap: 8px; }
  .hero-check-row label { font-size: .74rem; min-height: 32px; }
  .search-submit-btn {
    width: 100%; padding: 11px; font-size: .88rem;
    border-radius: 8px; min-height: 42px;
  }

  /* テキスト切替ヘルパー */
  .hide-sp { display: none !important; }
  .show-sp { display: inline !important; }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: TOPページ セクション
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  .top-section { padding: 14px 12px; }
  .top-section-inner > h2 { font-size: .9rem; margin-bottom: 4px; }
  .section-title--sm { font-size: .82rem !important; margin-bottom: 4px !important; }
  .news-item {
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
  }
  .news-date {
    font-size: .7rem;
    min-width: unset;
  }
  .news-title { font-size: .82rem; }
  .news-body { font-size: .76rem; line-height: 1.6; margin-top: 2px; }

  /* エリアカード → 横並びコンパクト行 */
  .area-stat-grid {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
  }
  .area-stat-card {
    flex: 1 1 calc(50% - 2px);
    flex-direction: row; align-items: center; justify-content: flex-start;
    gap: 5px; padding: 6px 8px; border-radius: 8px;
  }
  .asc-icon { font-size: .85rem; margin-bottom: 0; }
  .asc-name { font-size: .7rem; margin-bottom: 0; }
  .asc-count {
    font-size: .7rem; font-weight: 700; margin-bottom: 0; margin-left: auto;
  }
  .asc-count span { font-size: .6rem; }
  .asc-count small { display: inline; font-size: .55rem; color: #999; }
  .asc-desc { display: none; }
  /* 新着物件: 縦型フルウィズカード（横並びやめる） */
  .top-section .property-grid,
  .property-grid--4col {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px;
    overflow-x: visible;
  }
  .top-section .property-card,
  .property-grid--4col .property-card {
    flex: none;
    width: 100%;
  }
  /* サムネイルをフルウィズ横長に */
  .top-section .card-thumb-wrap {
    aspect-ratio: 16/9;
    width: 100%;
    max-height: 200px;
  }

  /* 選ばれる理由: アイコン＋タイトルを横一行に固定 */
  .reason-grid { grid-template-columns: 1fr; gap: 10px; }
  .reason-card {
    display: grid;
    grid-template-columns: 2rem 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px; row-gap: 4px;
    padding: 14px; text-align: left;
    align-items: center;
  }
  .reason-icon {
    grid-column: 1; grid-row: 1;
    font-size: 1.5rem; margin-bottom: 0;
    line-height: 1;
  }
  .reason-card h3 {
    grid-column: 2; grid-row: 1;
    font-size: .92rem; margin-bottom: 0;
    align-self: center;
  }
  .reason-card p {
    grid-column: 2; grid-row: 2;
    font-size: .8rem;
  }

  /* エリアガイド */
  .area-guide-grid { grid-template-columns: 1fr; gap: 10px; }
  .area-guide-card { padding: 14px; }

  /* CTA */
  .section-cta-title { font-size: 1.05rem; }
  .cta-btn-row { flex-direction: column; gap: 8px; }
  .btn-cta-wide {
    width: 100%; padding: 14px; text-align: center;
    font-size: .92rem; min-height: 48px;
  }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: 検索・フィルター（properties.php）
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  /* ── 場所タブ: 均等幅コンパクト ── */
  .filter-summary-bar {
    flex-direction: column; gap: 2px; padding: 4px 6px 0;
  }
  .loc-tab-group {
    overflow-x: visible; flex-wrap: nowrap;
    gap: 2px; width: 100%;
  }
  .loc-tab {
    flex: 1; padding: 5px 0; font-size: .68rem;
    min-height: 30px; justify-content: center;
  }

  /* 検索ボタン（タブ横）: properties.phpはパネル内ボタンで代替するため非表示を維持 */
  .filter-summary-bar > .filter-bar-btns { display: none; }
  .filter-bar-btns { width: 100%; display: flex; gap: 4px; }
  .btn-search-sm { flex: 1; min-height: 28px; font-size: .68rem; }
  .btn-reset-sm  { font-size: .64rem; padding: 4px 8px; }

  /* ── 区ボタン: 3列グリッド ── */
  .sb-ward-row {
    display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 3px;
  }
  .sb-ward-btn {
    padding: 3px 0 !important; font-size: .66rem !important; text-align: center;
    min-height: 26px;
    display: flex; align-items: center; justify-content: center;
  }
  .loc-panel-title { font-size: .66rem; margin-bottom: 4px; }
  .loc-tab-panel { padding: 6px 8px; }
  .loc-tab-panel > .btn-search-sm {
    margin-top: 8px !important; width: 100%; min-height: 32px;
  }

  /* 町名・駅ピル: コンパクト */
  .sb-town-pill, .sb-station-pill {
    padding: 3px 8px; font-size: .64rem; border-radius: 12px;
  }

  /* ── スマホ折りたたみトグル ── */
  .sp-filter-toggle {
    display: block; width: 100%; padding: 10px; margin: 0 0 8px;
    background: linear-gradient(135deg, #d4572a 0%, #e8763c 100%);
    border: none; border-radius: 8px;
    font-size: .78rem; font-weight: 700;
    color: #fff; cursor: pointer; text-align: center;
    box-shadow: 0 2px 12px rgba(212,87,42,.25);
  }
  .sp-filter-toggle.open {
    border-radius: 8px 8px 0 0; margin-bottom: 0;
  }
  /* hero内（暗い背景） */
  .hero .sp-filter-toggle {
    background: rgba(255,255,255,.2);
    border: 2px solid rgba(255,255,255,.5);
    box-shadow: 0 2px 12px rgba(0,0,0,.2);
    margin: 4px 0 0;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
  }
  .sp-filter-collapsible {
    display: none !important;
  }
  .sp-filter-collapsible.sp-filter-open {
    display: block !important;
  }
  /* 折りたたみ時: filter-barの外枠を完全に消す */
  .filter-bar:has(.sp-filter-collapsible:not(.sp-filter-open)),
  .filter-bar.sp-collapsed,
  .hero .filter-bar:has(.sp-filter-collapsible:not(.sp-filter-open)),
  .hero .filter-bar.sp-collapsed {
    border: none !important; box-shadow: none !important;
    background: transparent !important; backdrop-filter: none !important;
  }
  /* 展開時: 外枠を完全に消してトグルと繋げる */
  .filter-bar:has(.sp-filter-collapsible.sp-filter-open),
  .filter-bar.sp-expanded,
  .hero .filter-bar:has(.sp-filter-collapsible.sp-filter-open),
  .hero .filter-bar.sp-expanded {
    border: none !important; box-shadow: none !important;
    border-top-left-radius: 0 !important; border-top-right-radius: 0 !important;
  }

  /* ── 展開パネル ── */
  .filter-panel { padding: 6px 8px 4px; }
  .fp-grid { grid-template-columns: 1fr; gap: 6px; margin-bottom: 6px; }
  .fp-section-title { font-size: .62rem; margin-bottom: 8px; padding-bottom: 2px; }

  /* ── 間取りチェック: 4列グリッド（全項目見える） ── */
  .layout-checks {
    display: grid !important; grid-template-columns: repeat(4, 1fr);
    gap: 3px; padding-bottom: 1px; overflow-x: visible;
  }
  .layout-checks label {
    font-size: .64rem; min-height: 24px;
    white-space: nowrap; border: 1px solid var(--border);
    border-radius: 12px; padding: 2px 1px; background: #f5f5f5;
    display: flex; align-items: center; justify-content: center; gap: 1px;
  }
  .layout-checks label:has(input:checked) {
    background: var(--accent); border-color: var(--accent); color: #fff;
  }
  .layout-checks input[type="checkbox"] {
    width: 10px; height: 10px; margin: 0;
  }

  /* ── 駅徒歩・築年数: 横並びラベル+セレクト ── */
  .fp-section:last-child .search-field {
    display: inline-flex; align-items: center; gap: 4px; width: 100%;
  }
  .fp-section:last-child .search-field label {
    font-size: .64rem; flex-shrink: 0; min-width: 36px;
  }
  .fp-section:last-child .search-field select {
    flex: 1; min-height: 28px; font-size: .68rem; padding: 2px 4px;
  }

  /* ── 賃料/面積ルーラー: properties用もコンパクト ── */
  .filter-bar .rent-ruler-outer { padding: 8px 0 10px; }
  .filter-bar .rent-ruler-track-wrap { height: 40px; margin: 0 10px; }
  .filter-bar .rent-ruler-display {
    margin-top: 2px; padding: 2px 6px; gap: 2px;
  }
  .filter-bar .rent-rd-val { font-size: .66rem; min-width: 38px; }
  .filter-bar .rent-rd-sep { font-size: .6rem; }

  /* ── クイックフィルター: 横スクロール ── */
  .quick-feat-row {
    overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    gap: 4px; padding: 4px 0 1px;
  }
  .quick-feat-row::-webkit-scrollbar { display: none; }
  .qf-btn { flex-shrink: 0; min-height: 28px; font-size: .66rem; padding: 4px 8px; }

  /* ── アクション行 ── */
  .fp-actions {
    flex-direction: column; gap: 4px; align-items: stretch;
    margin-top: 6px; padding-top: 6px;
  }
  .fp-actions-right {
    flex-direction: column; gap: 3px; margin-left: 0; width: 100%;
  }
  .fp-actions .btn-search,
  .fp-actions-right .btn-search {
    width: 100%; padding: 7px; font-size: .78rem; min-height: 34px;
  }
  .fp-actions .btn-reset,
  .fp-actions-right .btn-reset {
    width: 100%; text-align: center; padding: 5px; min-height: 30px;
    font-size: .7rem;
  }
  .btn-kd-toggle { width: 100%; justify-content: center; font-size: .7rem; padding: 5px 10px; }

  /* ── こだわりパネル ── */
  .kodawari-panel {
    position: static; width: 100%; left: 0;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 55vh;
  }
  .fp-kodawari { padding: 6px 0 2px; }
  .fp-kd-grid { gap: 6px 8px; }
  .fp-kd-grid .kd-cat { min-width: 0; flex: 1 1 100%; }
  .kd-cat-name { font-size: .7rem; margin-bottom: 4px; }
  /* 修正(2026-04-17 v2): 密度UP+1行強制（誤タップ防止しつつコンパクト） */
  .kd-checks {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px 6px;
  }
  .kd-checks label {
    font-size: .76rem; min-height: 28px; padding: 0;
    line-height: 1.3; align-items: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .kd-checks input[type="checkbox"] { width: 15px; height: 15px; }
  .kd-search-row { margin-top: 6px; padding-top: 6px; }
  .kd-search-row .btn-search {
    width: 100%; padding: 7px; min-height: 34px;
  }

  /* ソートバー: PC版非表示 → SP版セレクトに切替 */
  .sort-bar-pc { display: none !important; }
  .sort-bar-sp {
    display: flex !important; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  }
  .sort-bar-sp .sort-label {
    font-size: .72rem; flex-shrink: 0; white-space: nowrap;
    color: var(--text-muted); font-weight: 600; letter-spacing: .04em;
  }
  .sort-select {
    flex: 1; min-height: 40px; font-size: .82rem;
    padding: 8px 36px 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 20px; background: #fafafa;
    color: var(--ink); font-weight: 600;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
  }
  .sort-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212,87,42,.12);
  }

  /* 検索サマリーバー */
  .search-summary-bar { padding: 6px 8px; }
  .ssb-chips {
    overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; gap: 4px;
  }
  .ssb-chips::-webkit-scrollbar { display: none; }
  .ssb-chip { flex-shrink: 0; font-size: .64rem; padding: 3px 8px; }
  .ssb-edit-btn { font-size: .66rem; padding: 4px 10px; }

  /* ===== 物件カード: コンパクト版 ===== */
  .property-grid {
    display: flex !important; flex-direction: column;
    gap: 8px; overflow-x: visible;
  }
  .property-card {
    flex: none;
    flex-direction: column;
    border-radius: 8px;
  }
  /* サムネイル */
  .card-thumb-wrap {
    aspect-ratio: 3/2;
    width: 100%;
    max-height: 210px;
  }
  .card-body {
    padding: 6px 10px 4px; flex: 1; min-width: 0;
  }
  .card-name {
    font-size: .82rem; -webkit-line-clamp: 1; margin-bottom: 2px;
  }
  .card-badges { margin-bottom: 2px; }
  .card-badges .badge { font-size: .58rem; padding: 1px 4px; }
  .card-address { font-size: .68rem; margin-bottom: 1px; }
  .card-transit { font-size: .68rem; margin-bottom: 2px; }

  /* 部屋ミニリスト: さらに詰める */
  .card-rooms { padding: 0 8px 4px; }
  .card-rooms-hd { font-size: .58rem; padding: 3px 4px 2px; }
  .room-row { font-size: .66rem; padding: 3px 4px; }

  /* カードフッター */
  .card-footer { padding: 5px 10px 6px; }
  .card-meta { font-size: .68rem; }
  .room-rent { font-size: .84rem; }
  .btn-detail {
    padding: 7px 12px; font-size: .72rem; min-height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* ページネーション */
  .pagination { gap: 2px; margin-top: 16px; }
  .pagination a, .pagination span {
    padding: 7px 9px; font-size: .72rem;
    min-width: 34px; min-height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* 検索結果見出し+メタ */
  .search-result-heading { font-size: .82rem; margin-bottom: 2px; }
  .result-meta { font-size: .64rem; margin-bottom: 4px; }

  /* 代替候補 */
  .alt-props-grid { grid-template-columns: 1fr; }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: 建物詳細（property.php）
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  /* サマリーバー */
  .prop-summary-inner {
    padding: 8px 10px; flex-direction: column;
    align-items: flex-start; gap: 4px;
  }
  .psb-left { width: 100%; min-width: 0; }
  .psb-name { font-size: .88rem; }
  .psb-address { font-size: .68rem; line-height: 1.4; }

  /* ギャラリー */
  /* 物件ギャラリー: 横幅ベース正方形、画像全体表示 */
  .gallery-wrap.prop-gallery-main-wrap {
    height: auto;
    aspect-ratio: 1 / 1;
    width: 100%;
  }
  .gallery-arrow {
    width: 40px; height: 40px; font-size: 20px;
  }
  .gallery-arrow.prev { left: 6px; }
  .gallery-arrow.next { right: 6px; }
  .prop-gallery-thumbs { gap: 4px; padding: 6px 8px; }
  .prop-gallery-thumbs .gallery-thumb {
    width: 56px; height: 56px; max-width: 56px;
  }
  .gallery-tabs { padding: 0 2px; flex-wrap: nowrap; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .gallery-tabs::-webkit-scrollbar { display: none; }
  .gallery-tab { padding: 5px 6px; font-size: .66rem; flex-shrink: 0; min-width: 0; white-space: nowrap; }

  /* バッジ: 改行防止・1行表示（600px の wrap を上書き） */
  .prop-badge-row { flex-wrap: nowrap !important; gap: 4px; width: 100% !important; }
  .prop-badge {
    flex: 1 1 0 !important; min-width: 0;
    flex-direction: row !important;
    white-space: nowrap;
    font-size: .62rem; padding: 6px 4px;
    gap: 2px; border-width: 1px;
    overflow: hidden;
  }
  .prop-badge-icon { font-size: .72rem; }
  .prop-badge-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    min-width: 0;
  }
  .prop-badge strong { font-weight: 700; }

  /* 空室一覧ソートバー: 横スクロール化 */
  .prc-header { flex-direction: column; gap: 4px; }
  .prc-sort-bar {
    overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    width: 100%;
  }
  .prc-sort-bar::-webkit-scrollbar { display: none; }
  .prc-sort-btn {
    flex-shrink: 0; padding: 4px 10px; min-height: 28px;
    white-space: nowrap; font-size: .72rem;
  }

  /* 空室カード: 1列・コンパクト */
  .prop-room-list { grid-template-columns: 1fr; gap: 6px; }
  .prc-body { padding: 6px 8px; }
  .prc-roomno-top { font-size: .8rem; }
  .prc-table { font-size: .68rem; }
  .prc-table th { padding: 2px 4px 2px 0; }
  .prc-table td { padding: 2px 3px; }
  .prc-rent-cell { font-size: .84rem; }
  .prc-mgmt-inline { font-size: .66rem; }
  .prc-btn {
    display: flex; text-align: center; padding: 7px;
    font-size: .74rem; min-height: 34px;
    align-items: center; justify-content: center;
  }

  /* サイドバー: スティッキー解除 */
  .prop-sidebar-sticky { position: static; }
  .sidebar-card { padding: 10px; }
  .sidebar-card h3 { font-size: .78rem; }

  /* サイドバー空室リスト */
  .sb-room-link { padding: 10px 4px; }

  /* 問い合わせボタン */
  .btn-contact {
    padding: 10px; font-size: .88rem; min-height: 42px;
  }
  .btn-contact-sub {
    padding: 8px; font-size: .78rem; min-height: 38px;
  }

  /* スペックテーブル */
  .spec-table th { width: 72px; padding: 5px 8px; font-size: .68rem; }
  .spec-table td { padding: 5px 8px; font-size: .76rem; }

  /* 地図 */
  #osm-map { height: 220px !important; }

  /* エリア情報 */
  .area-info-head { padding: 12px; font-size: .88rem; }
  .area-info-head .aia-catch { display: none; }
  .area-info-body { padding: 12px; font-size: .8rem; }
  /* area-content アコーディオン版はstyle.css側で対応済み */

  /* 関連物件: 2列グリッド（other-rooms-grid 準拠） */
  .related-section { padding: 16px 0 20px; margin-top: 16px; }
  .related-section .rs-inner { padding: 0 10px; }
  .related-section .rs-heading { font-size: .86rem; margin-bottom: 10px; }
  .related-track { grid-template-columns: 1fr 1fr; gap: 8px; }
  .rel-card-img { aspect-ratio: 1/1; }
  .rel-card-body { padding: 6px 8px 8px; }
  .rel-card-name { font-size: .74rem; margin-bottom: 2px; }
  .rel-card-transit { font-size: .64rem; margin-bottom: 3px; }
  .rel-card-rent { font-size: .84rem; }
  .rel-card-rooms { font-size: .64rem; }

  /* 仲介手数料バナー（旧・互換用） */
  .brokerage-banner { padding: 8px 12px; font-size: .8rem; gap: 6px; }
  .brokerage-banner .bb-icon { font-size: 1.1rem; }
  .brokerage-banner--inline { padding: 8px 10px; border-radius: 6px; }

  /* 部屋詳細バッジバー */
  .room-badge-bar-inner { padding: 6px 10px; }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: 部屋詳細（room.php）
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  /* ヒーロー: 1列化 */
  .room-hero {
    grid-template-columns: 1fr; grid-template-rows: auto;
    padding: 4px 6px 0; gap: 6px;
  }
  .hero-plan { order: -1; } /* 間取りを上に */
  /* 間取り図・写真: 横幅ベース正方形、画像全体表示 */
  .hero-plan-imgwrap {
    min-height: auto;
    aspect-ratio: 1 / 1;
    width: 100%;
  }
  .hero-plan-label { font-size: .68rem; padding: 5px 8px; }
  .hero-plan-bld-cta { font-size: .66rem; padding: 3px 8px; margin-left: 4px; min-height: 22px; }
  .hero-plan-label-name { font-size: .74rem; }
  .hero-main-wrap {
    height: auto;
    aspect-ratio: 1 / 1;
    width: 100%;
    border-radius: 8px;
  }

  /* サムネイル */
  .hero-thumbs .gallery-thumb { width: 52px; height: 52px; }
  .plan-thumb { width: 48px; height: 48px; }

  /* スティッキーバー: スマホでは非表示（下のオレンジ固定バーに統一） */
  .room-sticky-bar { display: none !important; }

  /* タイトルバー */
  .room-title-bar-inner {
    padding: 8px 10px; flex-direction: column;
    align-items: flex-start; gap: 3px;
  }
  .rtb-name { font-size: .86rem; }
  .rtb-right { text-align: left; width: 100%; display: flex; align-items: baseline; gap: 6px; }
  .rtb-rent { font-size: 1.1rem; }

  /* メインコンテンツ: はみ出し防止 */
  .detail-main {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .tab-pane {
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
  }
  .property-detail-wrap {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* 詳細タブ: 均等幅で右端まで埋める */
  .detail-tabs {
    display: flex; gap: 2px;
    max-width: 100%; overflow-x: hidden;
  }
  .detail-tabs::-webkit-scrollbar { display: none; }
  .tab-btn {
    flex: 1; flex-shrink: 1; padding: 7px 4px; font-size: .7rem;
    min-height: 34px; white-space: nowrap; text-align: center;
  }

  /* 賃料グリッド: 2列折り返し */
  .info-cost-grid { flex-wrap: wrap; }
  .icg-item {
    min-width: calc(50% - 1px); border-bottom: 1px solid #f0ece8;
    padding: 6px 8px;
  }
  .icg-label { font-size: .66rem; }
  .icg-rent-val { font-size: .95rem; }

  /* スペックグリッド: 2列 */
  .info-spec-grid { flex-wrap: wrap; }
  .isg-item {
    min-width: calc(50% - 1px); border-bottom: 1px solid #ede8e2;
    padding: 5px 8px;
  }
  .isg-label { font-size: .66rem; }
  .isg-val { font-size: .74rem; }

  /* 入居条件: 2列 */
  .cond-grid-large { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .cond-item-large { padding: 7px 6px; font-size: .72rem; }

  /* 設備アイコン: コンパクト */
  .feat-icon-grid {
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 4px;
  }
  .feat-icon-item { padding: 5px 3px 4px; border-radius: 6px; }
  .feat-icon-item span { font-size: .54rem; }
  .feat-cat-nav { gap: 3px; margin-bottom: 6px; }
  .feat-cat-tag { font-size: .62rem; padding: 2px 6px; }

  /* 周辺施設: 1列 */
  .nf-grid { grid-template-columns: 1fr; gap: 8px; }
  .nf-cat { padding: 10px 12px; }

  /* 他の空室・おすすめ: 2列 */
  .other-rooms-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .orc-body { padding: 6px 8px 8px; }
  .orc-head { margin-bottom: 3px; }
  .orc-room-no { font-size: .88rem; }
  .orc-layout { font-size: .88rem; }
  .orc-rent { font-size: .84rem; }
  .orc-sub { font-size: .74rem; }
  .orc-bld-name { font-size: .74rem; }

  /* サイドバー */
  .room-sidebar-sticky { position: static; }
  .detail-sidebar .sidebar-card { padding: 14px; margin-bottom: 10px; }

  /* ライトボックス */
  .plan-lightbox img { max-width: 96vw; max-height: 85vh; }

  /* お気に入り */
  .btn-fav { padding: 10px; font-size: .88rem; min-height: 44px; }
  .fav-item { padding: 7px 0; font-size: .82rem; }
  .fav-remove {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
  }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: お問い合わせ（contact.php）
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  .contact-layout { grid-template-columns: 1fr; gap: 16px; padding: 12px 0 28px; }
  .contact-title { font-size: 1.1rem; }
  .cf-row-2 { grid-template-columns: 1fr; gap: 8px; }

  /* フォーム入力: 大きめタップ
     修正(2026-04-17): シニア配慮でフォントサイズ拡大
       - input: 0.9rem → 1rem (16px = iOS の自動ズーム抑止 + 老眼配慮)
       - label: 0.84rem → 0.95rem (見やすく) */
  .cf-group input[type=text],
  .cf-group input[type=email],
  .cf-group input[type=tel],
  .cf-group select,
  .cf-group textarea {
    padding: 12px; font-size: 1rem; min-height: 46px;
  }
  .cf-group label { font-size: .95rem; }
  .btn-submit {
    padding: 15px; font-size: 1rem; min-height: 50px; border-radius: 8px;
  }

  /* 会社情報カード */
  .cs-card { padding: 14px; }
  .cs-tel a { font-size: 1.3rem; }
  .cs-info { font-size: .76rem; }

  /* 電話CTAボタン（モバイル強調） */
  .contact-tel-cta {
    padding: 16px 18px;
    border-radius: 12px;
  }
  .contact-tel-cta__num { font-size: 1.6rem; }

  /* チェックボックスカード型: スマホで余白調整 */
  .cf-check-label {
    padding: 12px 10px;
    font-size: .86rem;
  }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: 会社概要（company.php）
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  .company-layout { grid-template-columns: 1fr; gap: 16px; }
  #company-map { height: 240px; }
  .license-box { padding: 12px 14px; font-size: .84rem; }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: フッター
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  .site-footer { margin-top: 32px; padding-bottom: 68px; }
  .footer-inner { padding: 28px 12px 16px; }
  .footer-cols { grid-template-columns: 1fr; gap: 14px; }
  .footer-col h3 {
    font-size: .76rem;
    cursor: pointer; display: flex; align-items: center;
    justify-content: space-between; padding-bottom: 8px;
  }
  .footer-col h3::after {
    content: '▾'; font-size: .6rem; color: #666; transition: transform .2s;
  }
  .footer-col p, .footer-col ul li a { font-size: .74rem; }
  .footer-col ul li a {
    padding: 4px 0; min-height: 34px;
    display: flex; align-items: center;
  }
  .footer-bottom { font-size: .7rem; padding-top: 14px; margin-top: 18px; }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: 固定バー強化
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  .sp-fixed-bar .sp-bar-btn {
    padding: 8px 0 calc(6px + env(safe-area-inset-bottom, 0px) / 4);
    min-height: 52px;
  }
  .sp-fixed-bar .sp-bar-icon { font-size: 1.25rem; }
  .sp-fixed-bar .sp-bar-label { font-size: .68rem; }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: ガイド型サジェスト（0件時）
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  .guide-suggest { padding: 16px 12px; }
  .guide-msg { font-size: .88rem; }
  .guide-cards {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .guide-card {
    min-height: 56px;
    padding: 12px 14px;
  }
  .guide-card-label { font-size: .85rem; }
  .guide-cat-title { font-size: .85rem; margin: 16px 0 8px; }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: 家賃相場（market.php）
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  .market-wrap { padding: 0 10px 40px; }

  /* ヒーロー: コンパクト化 */
  .market-hero {
    padding: 18px 16px;
    margin: 12px 0 18px;
    border-radius: 10px;
  }
  .market-hero h1 { font-size: 1.05rem; margin-bottom: 4px; }
  .market-hero p { font-size: .76rem; line-height: 1.5; }
  .market-hero p br { display: none; }
  .market-updated { font-size: .7rem; margin-top: 6px; }

  /* エリアタブ: 横スクロール */
  .market-area-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    margin-bottom: 18px;
    padding-bottom: 2px;
  }
  .market-area-tabs::-webkit-scrollbar { display: none; }
  .market-area-tab {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: .76rem;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }

  /* セクション */
  .market-section { margin-bottom: 28px; }
  .market-section h2 { font-size: .92rem; padding-left: 8px; margin-bottom: 10px; }
  .market-section h3 { font-size: .84rem; margin: 16px 0 8px; }

  /* テーブル: 横スクロール化 */
  .mkt-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    white-space: nowrap;
    font-size: .76rem;
  }
  .mkt-table thead, .mkt-table tbody { display: table; width: 100%; }
  .mkt-table th { padding: 7px 8px; font-size: .7rem; }
  .mkt-table td { padding: 7px 8px; }
  .mkt-avg { font-size: .8rem; }
  .mkt-sqm { font-size: .65rem; }
  .mkt-range { font-size: .68rem; }

  /* エリア比較カード: 2列 */
  .area-compare-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .area-compare-card { padding: 10px 12px; border-radius: 8px; }
  .area-compare-card .area-name { font-size: .72rem; }
  .area-compare-card .area-avg { font-size: 1rem; }
  .area-compare-card .area-cnt { font-size: .68rem; }

  /* 注釈 */
  .market-note { font-size: .7rem; padding: 8px 10px; line-height: 1.6; }

  /* CTA */
  .market-cta { padding: 18px 16px; border-radius: 10px; margin-top: 28px; }
  .market-cta p { font-size: .84rem; margin-bottom: 12px; }
  .market-cta a {
    padding: 10px 24px; font-size: .88rem; border-radius: 20px;
    display: block; text-align: center;
  }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   480px: エリア分析（レーダーチャート + テーブル）
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  .analysis-section {
    padding: 12px 0;
  }
  .analysis-title {
    font-size: .95rem;
  }
  .analysis-subtitle {
    font-size: .72rem;
    margin-bottom: 12px;
    display: none; /* スマホではタイトルのみ表示 */
  }

  /* レーダーチャート: 画面幅に収める + ラベルのクリップ防止 */
  .analysis-chart-wrap {
    margin-bottom: 16px;
    overflow: visible;
  }
  .radar-chart {
    width: 100%;
    max-width: 280px;
    height: auto;
    overflow: visible;
  }
  .radar-label {
    font-size: 13px;
  }
  .radar-score {
    font-size: 12px;
  }

  /* 評価テーブル: 縦積みカード形式に変換 */
  .analysis-table {
    display: block;
    font-size: .78rem;
  }
  .analysis-table thead {
    display: none; /* ヘッダー非表示 */
  }
  .analysis-table tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .analysis-table tr {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
  }
  .analysis-table td {
    border: none;
    padding: 2px 0;
  }
  /* 指標名: 左上 */
  .at-label {
    grid-column: 1 / -1;
    font-size: .82rem;
    margin-bottom: 2px;
  }
  /* この物件値: 左下 */
  .at-val {
    text-align: left !important;
    font-size: .82rem;
    font-weight: 600;
  }
  /* 中央値: 右下 */
  .at-median {
    text-align: right !important;
    font-size: .75rem;
    color: #888;
  }
  .at-median::before {
    content: '中央値 ';
    font-weight: 400;
    color: #aaa;
  }
  /* スコアバー: 全幅 */
  .at-score {
    grid-column: 1 / -1;
    gap: 4px;
  }
  .score-bar {
    flex: 1;
    width: auto;
  }
  .score-tag {
    font-size: .6rem;
    padding: 0 5px;
  }
  /* 評価テキスト: 全幅 */
  .at-eval {
    grid-column: 1 / -1;
    font-size: .72rem;
  }

  /* 注釈 */
  .analysis-note {
    font-size: .68rem;
  }

  /* 解説文 */
  .analysis-narrative {
    padding: 14px 14px;
    font-size: .8rem;
    line-height: 1.8;
  }
  .analysis-summary {
    font-size: .78rem;
  }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   600px: テーブル縦積み
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 600px) {
  .spec-table, .company-table { display: block; max-width: 100%; overflow-x: hidden; }
  .spec-table tbody, .company-table tbody { display: block; }
  .spec-table tr, .company-table tr {
    display: flex; flex-direction: column;
    border-bottom: 1px solid var(--border);
  }
  .spec-table th, .spec-table td,
  .company-table th, .company-table td {
    display: block; width: 100% !important; border: none;
    word-break: break-word; overflow-wrap: break-word;
    box-sizing: border-box;
  }
  .spec-table th, .company-table th {
    background: #f0f0f0; padding: 6px 12px;
    font-size: .76rem; color: var(--text-light);
  }
  .spec-table td, .company-table td {
    padding: 8px 12px 12px; font-size: .86rem;
  }
  /* 設備条件グリッド: はみ出し防止 */
  .cond-grid-large {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .setubi-section { max-width: 100%; overflow-x: hidden; }
  /* エリア・沿線: はみ出し防止 */
  .aia-header { flex-wrap: wrap; }
  .aia-catch { max-width: 100%; word-break: break-word; }
}


/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   タッチデバイス: ホバーエフェクト抑制
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (hover: none) {
  .property-card:hover,
  .area-stat-card:hover,
  .prop-room-card:hover,
  .other-room-card:hover,
  .rel-card:hover,
  .alt-prop-card:hover {
    transform: none;
    box-shadow: var(--shadow);
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Contextual Footer（モバイル）
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 480px) {
  .contextual-footer {
    margin: 28px 0 18px;
    padding: 18px 14px 16px;
    border-radius: 12px;
  }
  .contextual-footer-heading {
    font-size: .92rem;
    margin-bottom: 14px;
    padding-bottom: 10px;
  }
  .contextual-footer-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .contextual-footer .cf-title {
    font-size: .84rem;
    margin-bottom: 8px;
  }
  .contextual-footer .cf-list {
    gap: 6px;
  }
  .contextual-footer .cf-list a {
    font-size: .8rem;
    padding: 12px 12px 12px 26px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .link-station-lp {
    font-size: .7rem;
    padding: 0;
    min-height: auto;
    background: none;
    color: var(--accent);
    border-radius: 0;
    text-decoration: underline;
    margin-left: auto;
    float: right;
  }
  .link-station-lp .lp-full  { display: none; }
  .link-station-lp .lp-short { display: inline; }
}
