/**
 * TOP SPA-only visuals: hero overlay, nav cards, trends chart host, news scroller.
 * API / sections JSON unchanged; consumed with existing data-section hooks.
 */

/* Hero: Streamlit 互換の lib-sh-* は lib-sh-immersive.css（旧 hero_fullvp / .hero-visual は不使用） */

/* Streamlit ヒーロー内 CTA はガラス台無し（カード内に直接並ぶ） */
#app.lib-app--top .lib-top-section--hero .st-horizontal-block.lib-st-columns-container {
  margin-top: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

/* Streamlit .hero-pro-btn 相当 */
#app.lib-app--top .lib-top-section--hero .lib-btn {
  min-height: 60px;
  padding: 0 clamp(1.5rem, 4vw, 2.25rem);
  border-radius: 12px;
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  font-weight: 700;
  letter-spacing: normal;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

#app.lib-app--top .lib-top-section--hero .lib-btn--primary {
  color: #fff !important;
  background: #43a047 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}

#app.lib-app--top .lib-top-section--hero .lib-btn--primary:hover {
  background: #3d9450 !important;
  filter: saturate(0.94);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
}

#app.lib-app--top .lib-top-section--hero .lib-btn--secondary {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 2px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

#app.lib-app--top .lib-top-section--hero .lib-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

#app.lib-app--top .lib-top-section--hero .lib-btn:hover {
  transform: translateY(-1px);
}

/* ----- API 埋め込みヒーロー（lib-sh-card）: キッカー → 見出し → 補足 → CTA の段差 ----- */
#app.lib-app--top .lib-top-section--hero .lib-sh-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#app.lib-app--top .lib-top-section--hero .lib-sh-card > .lib-sh-kicker:first-of-type {
  margin-bottom: clamp(10px, 1.2vw, 14px);
}

#app.lib-app--top .lib-top-section--hero .lib-sh-card > .lib-sh-title {
  margin-bottom: clamp(0.55rem, 1.4vw, 0.85rem) !important;
  max-width: min(22em, 94vw);
}

/* タイトル直後の信頼1行とボタン帯の間を広げる（HTML インライン margin を上書き） */
#app.lib-app--top .lib-top-section--hero .lib-sh-card > p.lib-sh-kicker:nth-of-type(2) {
  margin-top: clamp(0.4rem, 1vw, 0.6rem) !important;
  margin-bottom: clamp(1.05rem, 2.6vh, 1.6rem) !important;
  max-width: min(36rem, 92vw);
  line-height: 1.55;
}

#app.lib-app--top .lib-top-section--hero .lib-sh-buttons {
  margin-top: 0 !important;
  width: 100%;
  max-width: min(36rem, 100%);
  gap: clamp(12px, 2vw, 18px);
  justify-content: center;
}

/* API ヒーロー（#page-host）: 「価格の目利き」等 CTA 行（.lib-sh-buttons）直下の不動産検定ブロック */
#page-host .lib-sh-card .lib-quiz-lead.lib-quiz-lead--hero,
#page-host .lib-quiz-lead.lib-quiz-lead--hero {
  padding: 0 !important;
  margin: clamp(0.55rem, 1.5vw, 0.95rem) 0 0;
  width: 100%;
  max-width: min(34rem, 100%);
  margin-inline: auto;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#page-host .lib-quiz-lead--hero .lib-quiz-lead-row {
  display: flex;
  justify-content: center;
  margin: 0;
}

/* Streamlit DSL ヒーロー: CTA 行の直下 */
#app.lib-app--top .lib-top-section--hero .lib-quiz-lead.lib-quiz-lead--hero {
  padding: 0 !important;
  margin: clamp(0.55rem, 1.5vw, 0.95rem) auto 0;
  width: 100%;
  max-width: min(34rem, 100%);
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#app.lib-app--top .lib-top-section--hero .lib-quiz-lead--hero .lib-quiz-lead-row {
  display: flex;
  justify-content: center;
  margin: 0;
}

/* スクロールヒント: ビューポート下端からの距離（親は lib-sh-inner position:relative） */
#app.lib-app--top .lib-top-section--hero .lib-sh-scroll {
  bottom: max(clamp(20px, 4.2vh, 42px), env(safe-area-inset-bottom, 0px));
  animation: lib-hero-scroll-hint-subtle 3s ease-in-out 3;
}

@keyframes lib-hero-scroll-hint-subtle {
  0%,
  100% {
    transform: translate(-50%, 0);
    opacity: 0.72;
  }
  50% {
    transform: translate(-50%, 4px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app.lib-app--top .lib-top-section--hero .lib-sh-scroll {
    animation: none !important;
    opacity: 0.88;
  }
}

/* ----- TOP ヒーロー刷新（画像URL・APIは変更しない。CSS のみ） ----- */
#app.lib-app--top .lib-top-section--hero .lib-sh-root.lib-hero-pro {
  background-position: center 22%;
}

/* 暗幕オーバーレイは透明（背景写真をそのまま見せる） */
#app.lib-app--top .lib-top-section--hero .lib-sh-root.lib-hero-pro::before {
  background: transparent !important;
}

#app.lib-app--top .lib-top-section--hero .lib-sh-inner {
  padding-bottom: max(
    clamp(72px, 10vh, 120px),
    calc(env(safe-area-inset-bottom, 0px) + 12px)
  );
}

#app.lib-app--top .lib-top-section--hero .lib-sh-card {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 32px 72px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  #app.lib-app--top .lib-top-section--hero .lib-sh-card {
    -webkit-backdrop-filter: blur(16px) saturate(1.12);
    backdrop-filter: blur(16px) saturate(1.12);
  }
}

#app.lib-app--top .lib-top-section--hero .lib-sh-card > .lib-sh-kicker:first-of-type {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
  letter-spacing: 0.14em;
}

#app.lib-app--top .lib-top-section--hero .lib-sh-card > .lib-sh-title {
  line-height: 1.16;
  letter-spacing: -0.02em;
  text-shadow:
    0 2px 28px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(0, 0, 0, 0.25);
}

#app.lib-app--top .lib-top-section--hero .lib-sh-card > p.lib-sh-kicker:nth-of-type(2) {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  letter-spacing: 0.035em;
  text-transform: none;
}

#app.lib-app--top .lib-top-section--hero .lib-sh-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

#app.lib-app--top .lib-top-section--hero .lib-sh-btn--primary:hover {
  background: #3d9450 !important;
  filter: saturate(0.94);
}

#app.lib-app--top .lib-top-section--hero .lib-sh-btn--primary:focus-visible {
  outline-color: rgba(165, 240, 180, 0.95);
}

#app.lib-app--top .lib-top-section--hero .lib-sh-btn--secondary:focus-visible {
  outline-color: rgba(255, 255, 255, 0.95);
}

/* Streamlit DSL ヒーロー（.lib-btn）: CTA のフォーカス・ホバーを API 埋め込みに近づける */
#app.lib-app--top .lib-top-section--hero .lib-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

#app.lib-app--top .lib-top-section--hero .lib-btn--primary:focus-visible {
  outline-color: rgba(165, 240, 180, 0.95);
}

#app.lib-app--top .lib-top-section--hero .lib-btn--secondary:focus-visible {
  outline-color: rgba(255, 255, 255, 0.95);
}

@media (max-width: 768px) {
  #app.lib-app--top .lib-top-section--hero .lib-sh-root.lib-hero-pro {
    min-height: min(100dvh, 880px);
  }

  #app.lib-app--top .lib-top-section--hero .lib-sh-btn {
    min-height: 48px;
    padding-left: clamp(1.2rem, 5vw, 1.85rem);
    padding-right: clamp(1.2rem, 5vw, 1.85rem);
  }
}

/* ----- Hero: Streamlit render_top_hero 相当（DSL 非変更・DOM クラスに合わせる） ----- */
/* 全画面背景・暗幕撤去後: セクション余白を詰め、縦リズムを整える */
#app.lib-app--top section.lib-top-section--hero.lib-section {
  padding-top: clamp(0.5rem, 1.5vw, 1rem);
  padding-bottom: clamp(1rem, 2.5vw, 1.75rem);
}

#app.lib-app--top .lib-top-section--hero {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

#app.lib-app--top .lib-top-section--hero > .st-section__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(1100px, 94vw);
  margin: 0 auto;
  padding: clamp(0.75rem, 2vw, 1.25rem) clamp(1rem, 3vw, 1.5rem) clamp(0.85rem, 2.2vw, 1.35rem);
  box-sizing: border-box;
}

/* Streamlit .hero-pro-card 相当（鑑定 app.py render_top_hero と同値） */
#app.lib-app--top .lib-top-section--hero .lib-fragment {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  color: #fff;
  padding: clamp(1.5rem, 3.5vw, 2.5rem) clamp(1.25rem, 3vw, 2.25rem);
  border-radius: 20px;
  border: 1px solid rgba(201, 162, 77, 0.28);
  background: rgba(15, 28, 46, 0.55);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
  box-sizing: border-box;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  #app.lib-app--top .lib-top-section--hero .lib-fragment {
    background: linear-gradient(
      155deg,
      rgba(15, 28, 46, 0.5) 0%,
      rgba(15, 28, 46, 0.36) 55%,
      rgba(24, 40, 62, 0.42) 100%
    );
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    backdrop-filter: blur(14px) saturate(1.1);
  }
}

#app.lib-app--top .lib-top-section--hero [data-testid="stVerticalBlock"] {
  gap: 0.35rem !important;
}

/* DSL 先頭 hr は Streamlit ヒーロー本文前に無いため非表示 */
#app.lib-app--top .lib-top-section--hero .lib-fragment > div[data-testid="stVerticalBlock"]:first-child {
  display: none;
}

/* Streamlit .hero-pro-kicker（鑑定 app.py と同一） */
#app.lib-app--top .lib-top-section--hero .lib-fragment > div[data-testid="stVerticalBlock"]:nth-child(2) p {
  margin: 0 0 12px;
  font-size: clamp(0.75rem, 1.6vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Streamlit .hero-pro-title（DSL .lib-hero-product-headline） */
#app.lib-app--top .lib-top-section--hero .lib-hero-product-headline {
  margin: 0 0 clamp(0.85rem, 2.2vw, 1.2rem) 0 !important;
  max-width: min(22em, 94vw);
  width: 100%;
  font-size: clamp(1.85rem, 5vw, 3rem) !important;
  font-weight: 800 !important;
  line-height: 1.28 !important;
  letter-spacing: 0.02em !important;
  color: #fff !important;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.45);
}

/* 将来用クラスも Streamlit タイトル系に合わせる */
#app.lib-app--top .lib-top-section--hero .hero-headline-main {
  font-size: clamp(1.85rem, 5vw, 3rem);
  line-height: 1.28;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.45);
}

#app.lib-app--top .lib-top-section--hero .hero-headline-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.9);
}

/* CTA: 横並び・中央（実 DOM は .st-columns / .lib-st-columns-container。.columns は予備） */
#app.lib-app--top .lib-top-section--hero .st-horizontal-block.st-columns,
#app.lib-app--top .lib-top-section--hero .columns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(14px, 2.2vw, 20px);
  margin-top: clamp(1rem, 2.6vh, 1.55rem);
}

#app.lib-app--top .lib-top-section--hero .lib-st-column-flex {
  flex: 0 1 auto;
  min-width: min(100%, 200px);
}

/* Streamlit .hero-pro-scroll（鑑定 app.py と同一 + lib-hero-scroll-bounce） */
@keyframes lib-hero-dsl-scroll-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

#app.lib-app--top .lib-top-section--hero .lib-fragment > div[data-testid="stVerticalBlock"]:last-child p.lib-muted {
  margin-top: clamp(0.5rem, 1.5vh, 1rem);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.88) !important;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
  animation: lib-hero-dsl-scroll-bounce 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  #app.lib-app--top .lib-top-section--hero .lib-fragment > div[data-testid="stVerticalBlock"]:last-child p.lib-muted {
    animation: none !important;
  }
}

/* ----- Nav cards: stronger hover lift ----- */
#app.lib-app--top .lib-top-section {
  position: relative;
}

#app.lib-app--top .lib-top-section .st-section__inner {
  position: relative;
}

#app.lib-app--top .lib-top-section--nav_cards .st-section__inner {
  padding: clamp(0.65rem, 1.8vw, 1rem) clamp(0.4rem, 1.2vw, 0.75rem);
}

/* ナビカード列: カード同士・行の間隔（ホバー lift / scale でも重ならない余裕） */
#app.lib-app--top .lib-top-section--nav_cards .st-horizontal-block.st-columns,
#app.lib-app--top .lib-top-section--nav_cards .lib-st-columns-container {
  gap: clamp(0.65rem, 1.8vw, 1.05rem) !important;
  row-gap: clamp(0.65rem, 1.75vw, 1rem) !important;
}

#app.lib-app--top .lib-top-section--nav_cards [data-testid="column"] {
  min-width: 0;
  box-sizing: border-box;
}

#app.lib-app--top .lib-top-section--nav_cards .lib-nav-card-pro.st-nav-card-btn {
  padding: clamp(0.65rem, 1.8vw, 0.85rem) clamp(0.5rem, 1.2vw, 0.65rem);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.12) inset,
    0 16px 40px rgba(15, 28, 46, 0.2);
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease,
    border-color 0.2s ease;
  will-change: transform;
}

#app.lib-app--top .lib-top-section--nav_cards .lib-nav-card-pro.st-nav-card-btn:hover {
  transform: translateY(-4px) scale(1.002);
  border-color: rgba(201, 162, 77, 0.55);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.18) inset,
    0 26px 56px rgba(15, 28, 46, 0.32);
}

#app.lib-app--top .lib-top-section--nav_cards .lib-nav-card-pro.st-nav-card-btn:active {
  transform: translateY(-2px) scale(1.01);
}

#app.lib-app--top .lib-top-section--nav_cards .lib-nav-card-pro .st-nav-card-label {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ----- Trends: Chart.js mount + existing shell ----- */
#app.lib-app--top .lib-trend-chart-host {
  position: relative;
  height: min(240px, 42vw);
  min-height: 200px;
  margin: 0 0 1rem 0;
  padding: 0.5rem 0.35rem 0.15rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, #fff 100%);
  border: 1px solid rgba(15, 28, 46, 0.08);
  box-shadow: 0 8px 28px rgba(15, 28, 46, 0.06);
}

#app.lib-app--top .lib-trend-chart-host canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Text fallback when Chart.js is missing or fails (same data as bar chart) */
#app.lib-app--top .lib-trend-chart-fallback {
  padding: 0.35rem 0.25rem 0.15rem;
  font-size: 0.92rem;
  color: #0f1c2e;
}

#app.lib-app--top .lib-trend-chart-fallback-head {
  margin: 0 0 0.5rem;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: #334155;
}

#app.lib-app--top .lib-trend-chart-fallback-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

#app.lib-app--top .lib-trend-chart-fallback-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(15, 28, 46, 0.08);
}

#app.lib-app--top .lib-trend-chart-fallback-title {
  flex: 1 1 12rem;
  min-width: 0;
  font-weight: 700;
  line-height: 1.35;
}

#app.lib-app--top .lib-trend-chart-fallback-score {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: #b45309;
  white-space: nowrap;
}

#app.lib-app--top .lib-top-section--trends .st-section__inner {
  background: #fff;
  border: 1px solid rgba(15, 28, 46, 0.1);
  border-radius: clamp(14px, 2vw, 18px);
  padding: clamp(0.65rem, 1.6vw, 0.95rem) clamp(0.7rem, 1.8vw, 1.1rem);
  box-shadow: 0 14px 44px rgba(15, 28, 46, 0.07);
}

#app.lib-app--top .lib-top-section--trends .lib-html--trusted {
  border-radius: 10px;
}

/* ----- News: card strip + horizontal scroll ----- */
#app.lib-app--top .lib-top-section--news .st-section__inner {
  background: #fff;
  border: 1px solid rgba(15, 28, 46, 0.1);
  border-radius: clamp(14px, 2vw, 18px);
  padding: clamp(0.65rem, 1.6vw, 0.95rem) clamp(0.7rem, 1.8vw, 1.1rem);
  box-shadow: 0 14px 44px rgba(15, 28, 46, 0.07);
}

/* API ニュース一覧（.news-item は ui_builders の html 断片） */
#app.lib-app--top .lib-top-section--news .news-item {
  padding: 0.55rem 0.65rem 0.6rem;
  margin: 0 0 0.4rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 28, 46, 0.07);
  background: rgba(248, 250, 252, 0.65);
  box-sizing: border-box;
}

#app.lib-app--top .lib-top-section--news .news-item:last-child {
  margin-bottom: 0;
}

#app.lib-app--top .lib-top-section--news .news-meta {
  margin-bottom: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  font-size: 0.78rem;
  color: #64748b;
}

#app.lib-app--top .lib-top-section--news .news-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #0f1c2e;
  margin: 0.15rem 0 0.2rem;
}

#app.lib-app--top .lib-top-section--news .news-body {
  font-size: 0.86rem;
  line-height: 1.55;
  color: #475569;
  margin: 0;
}

#app.lib-app--top .lib-top-section--news .lib-html--trusted {
  border-radius: 12px;
  overflow: hidden;
}

#app.lib-app--top .lib-top-section--news .lib-news-split-host {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.85rem;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.45rem;
  margin: 0 -0.25rem;
  scrollbar-width: thin;
}

#app.lib-app--top .lib-top-section--news .lib-news-split-host::-webkit-scrollbar {
  height: 8px;
}

#app.lib-app--top .lib-top-section--news .lib-news-split-host::-webkit-scrollbar-thumb {
  background: rgba(15, 28, 46, 0.22);
  border-radius: 999px;
}

#app.lib-app--top .lib-top-section--news .lib-news-split-left,
#app.lib-app--top .lib-top-section--news .lib-news-split-right {
  flex: 0 0 min(340px, 86vw);
  max-width: min(420px, 92vw);
  scroll-snap-align: start;
  min-width: min(300px, 86vw);
}

#app.lib-app--top .lib-top-section--news .lib-news-card {
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 28, 46, 0.08);
  border: 1px solid rgba(15, 28, 46, 0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

#app.lib-app--top .lib-top-section--news .lib-news-card:hover {
  box-shadow: 0 16px 40px rgba(15, 28, 46, 0.12);
  transform: translateY(-2px);
}

/* 価格ライン / AIツール: カード列の余白 */
#app.lib-app--top .lib-top-section--price_line_cards .st-section__inner,
#app.lib-app--top .lib-top-section--ai_tools .st-section__inner {
  padding: clamp(0.7rem, 1.9vw, 1.05rem) clamp(0.55rem, 1.5vw, 0.85rem);
}

#app.lib-app--top .lib-top-section--price_line_cards .st-horizontal-block.st-columns,
#app.lib-app--top .lib-top-section--ai_tools .st-horizontal-block.st-columns,
#app.lib-app--top .lib-top-section--price_line_cards .lib-st-columns-container,
#app.lib-app--top .lib-top-section--ai_tools .lib-st-columns-container {
  gap: clamp(0.9rem, 2.2vw, 1.25rem) !important;
}

#app.lib-app--top .lib-top-section--price_line_cards [data-testid="column"],
#app.lib-app--top .lib-top-section--ai_tools [data-testid="column"] {
  min-width: 0;
  box-sizing: border-box;
}

#app.lib-app--top .lib-top-section--price_line_cards .st-node--title,
#app.lib-app--top .lib-top-section--ai_tools .st-node--title {
  margin-bottom: 0.35rem !important;
}

#app.lib-app--top .lib-top-section--price_line_cards .st-node--text,
#app.lib-app--top .lib-top-section--ai_tools .st-node--text {
  margin-bottom: 0.4rem !important;
}

#app.lib-app--top .lib-top-section--price_line_cards .st-node--image,
#app.lib-app--top .lib-top-section--ai_tools .st-node--image {
  margin-bottom: 0.35rem;
}

@media (max-width: 720px) {
  #app.st-app-view.st-app-view--top .st-columns {
    flex-direction: column;
    gap: 1rem;
  }
  #app.st-app-view.st-app-view--top [data-testid="column"] {
    flex: 1 1 auto !important;
    min-width: 0;
    width: 100%;
  }
}

/* ----- Hero: 視線誘導・可読性・CTA（追加・既存より後段で上書き） ----- */
#app.lib-app--top .lib-top-section--hero {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
  padding: 40px 20px;
}

#app.lib-app--top .lib-top-section--hero .hero-headline-main {
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

#app.lib-app--top .lib-top-section--hero .hero-headline-sub {
  font-size: 1rem;
  opacity: 0.85;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

#app.lib-app--top .lib-top-section--hero .lib-fragment > * {
  margin-bottom: 14px;
}

#app.lib-app--top .lib-top-section--hero .st-horizontal-block.st-columns,
#app.lib-app--top .lib-top-section--hero .columns {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 20px;
}

#app.lib-app--top .lib-top-section--hero button,
#app.lib-app--top .lib-top-section--hero .lib-btn {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

/* 価格の目利き（1列目）を業務内容と同系のガラス枠ボタンに統一 */
#app.lib-app--top .lib-top-section--hero button:first-child,
#app.lib-app--top .lib-top-section--hero .lib-st-column-flex:first-child .lib-btn--primary {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
  font-weight: 700 !important;
  border: 2px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
}

#app.lib-app--top .lib-top-section--hero button:first-child:hover,
#app.lib-app--top .lib-top-section--hero .lib-st-column-flex:first-child .lib-btn--primary:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

#app.lib-app--top .lib-top-section--hero button:hover,
#app.lib-app--top .lib-top-section--hero .lib-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

#app.lib-app--top .lib-top-section--hero .lib-hero-scroll-hint {
  margin-top: 30px;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ----- Hero: 奥行き・フェード・ガラスCTA・スクロール誘導（追加のみ） ----- */
#app.lib-app--top .lib-top-section--hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.8)),
    url("/image/ai_realestate_bg.jpg") center / cover no-repeat;
}

#app.lib-app--top .lib-top-section--hero .lib-fragment > *:not(:first-child):not(:last-child) {
  opacity: 0;
  transform: translateY(20px);
  animation: lib-hero-fade-up 0.8s ease forwards;
}

#app.lib-app--top .lib-top-section--hero .lib-fragment > *:nth-child(2) {
  animation-delay: 0.1s;
}
#app.lib-app--top .lib-top-section--hero .lib-fragment > *:nth-child(3) {
  animation-delay: 0.2s;
}
#app.lib-app--top .lib-top-section--hero .lib-fragment > *:nth-child(4) {
  animation-delay: 0.3s;
}
#app.lib-app--top .lib-top-section--hero .lib-fragment > *:nth-child(5) {
  animation-delay: 0.4s;
}

@keyframes lib-hero-fade-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#app.lib-app--top .lib-top-section--hero .st-horizontal-block.st-columns,
#app.lib-app--top .lib-top-section--hero .columns {
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.08);
  padding: 16px 24px;
  border-radius: 10px;
}

#app.lib-app--top .lib-top-section--hero button:first-child,
#app.lib-app--top .lib-top-section--hero .lib-st-column-flex:first-child .lib-btn--primary {
  box-shadow: 0 8px 20px rgba(201, 166, 75, 0.3);
}

#app.lib-app--top .lib-top-section--hero button:hover,
#app.lib-app--top .lib-top-section--hero .lib-btn:hover {
  transform: translateY(-3px) scale(1.02);
}

#app.lib-app--top .lib-top-section--hero .lib-hero-scroll-hint,
#app.lib-app--top .lib-top-section--hero .lib-fragment > div[data-testid="stVerticalBlock"]:last-child p.lib-muted {
  animation: lib-hero-product-bounce 1.6s ease-in-out infinite;
}

@keyframes lib-hero-product-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

@media (max-width: 768px) {
  #app.lib-app--top .lib-top-section--hero .hero-headline-main {
    font-size: 2rem;
  }

  #app.lib-app--top .lib-top-section--hero .st-horizontal-block.st-columns,
  #app.lib-app--top .lib-top-section--hero .columns {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app.lib-app--top .lib-top-section--hero .lib-fragment > *:not(:first-child):not(:last-child) {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  #app.lib-app--top .lib-top-section--hero .lib-hero-scroll-hint,
  #app.lib-app--top .lib-top-section--hero .lib-fragment > div[data-testid="stVerticalBlock"]:last-child p.lib-muted {
    animation: none !important;
  }
}

/* ----- News: カード UI（サムネ小＋横並び・最大3件＋アーカイブ行） ----- */
#app.lib-app--top .lib-top-section--news .news-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  margin-bottom: 12px;
  max-width: 100%;
  box-sizing: border-box;
}

#app.lib-app--top .lib-top-section--news .news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

#app.lib-app--top .lib-top-section--news .news-image {
  flex: 0 0 88px;
  width: 88px;
  min-width: 88px;
  align-self: stretch;
  background: #f1f5f9;
}

#app.lib-app--top .lib-top-section--news .news-image img {
  width: 100%;
  height: 100%;
  min-height: 72px;
  max-height: 88px;
  object-fit: cover;
  display: block;
}

/* 画像 404 等: onerror でサムネ列を隠し、本文だけのカードにする（空白枠を出さない） */
#app.lib-app--top .lib-top-section--news .news-card.lib-news-card--noimg .news-image {
  display: none;
}

#app.lib-app--top .lib-top-section--news .news-content {
  flex: 1;
  min-width: 0;
  padding: 10px 12px 10px 14px;
}

#app.lib-app--top .lib-top-section--news .news-category {
  font-size: 0.75rem;
  color: #c9a64b;
  margin-bottom: 6px;
}

#app.lib-app--top .lib-top-section--news .news-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.35;
  color: #0f1c2e;
}

#app.lib-app--top .lib-top-section--news .news-title a {
  color: inherit;
  text-decoration: none;
}

#app.lib-app--top .lib-top-section--news .news-title a:hover {
  text-decoration: underline;
}

#app.lib-app--top .lib-top-section--news .news-body {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
  line-height: 1.55;
}

#app.lib-app--top .lib-top-section--news .news-date {
  font-size: 0.8rem;
  color: #aaa;
}

@media (max-width: 768px) {
  #app.lib-app--top .lib-top-section--news .lib-tzk-news-item-shell.st-news-split__right {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 520px) {
  #app.lib-app--top .lib-top-section--news .news-card {
    flex-direction: column;
  }
  #app.lib-app--top .lib-top-section--news .news-image {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-height: 140px;
  }
  #app.lib-app--top .lib-top-section--news .news-image img {
    max-height: 140px;
    min-height: 120px;
    width: 100%;
  }
}

/* ===== Hero: Pixel-match with Streamlit (final) ===== */

/* ① 背景オーバーレイ（Streamlitと同一トーン：0.6→0.85） */
#app.lib-app--top .lib-top-section--hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.85) 100%),
    url("/image/ai_realestate_bg.jpg") center / cover no-repeat;
}

/* ② コンテンツを前面に固定 */
#app.lib-app--top .lib-top-section--hero > * {
  position: relative;
  z-index: 1;
}

/* ③ 中央カード（Streamlit hero-pro-card 再現） */
#app.lib-app--top .lib-top-section--hero .lib-fragment {
  max-width: 880px;
  margin: 0 auto;
  padding: 36px 28px;
  border-radius: 14px;
  backdrop-filter: blur(14px);
  background: rgba(0, 0, 0, 0.35);
}

/* ④ キッカー（hero-pro-kicker） */
#app.lib-app--top .lib-top-section--hero .lib-fragment > *:nth-child(2) {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 14px;
}

/* ⑤ メイン見出し（完全一致） */
#app.lib-app--top .hero-headline-main,
#app.lib-app--top .lib-hero-product-headline {
  font-size: clamp(2.6rem, 5.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
  color: #fff;
}

/* ⑥ CTA領域（hero-pro-buttons） */
#app.lib-app--top .lib-top-section--hero .columns,
#app.lib-app--top .lib-top-section--hero .st-horizontal-block.st-columns {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 22px;
}

/* ⑦ ボタン（完全一致調整） */
#app.lib-app--top .lib-top-section--hero button,
#app.lib-app--top .lib-top-section--hero .lib-btn {
  padding: 14px 30px;
  font-size: 0.95rem;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* プライマリ */
#app.lib-app--top .lib-top-section--hero button:first-child,
#app.lib-app--top .lib-top-section--hero .lib-btn--primary {
  background: #c9a64b;
  color: #000;
  box-shadow: 0 10px 24px rgba(201, 166, 75, 0.35);
}

/* セカンダリ */
#app.lib-app--top .lib-top-section--hero button:nth-child(2),
#app.lib-app--top .lib-top-section--hero .lib-btn--secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
}

/* hover */
#app.lib-app--top .lib-top-section--hero button:hover,
#app.lib-app--top .lib-top-section--hero .lib-btn:hover {
  transform: translateY(-3px);
}

/* ⑧ スクロール誘導（hero-pro-scroll） */
#app.lib-app--top .lib-hero-scroll-hint,
#app.lib-app--top .lib-top-section--hero .lib-fragment > *:last-child {
  margin-top: 30px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  animation: hero-bounce 1.6s ease-in-out infinite;
}

@keyframes hero-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

/* ⑨ フェード（競合回避済） */
#app.lib-app--top .lib-top-section--hero .lib-fragment > *:not(:first-child):not(:last-child) {
  opacity: 0;
  transform: translateY(20px);
  animation: hero-fade 0.7s ease forwards;
}

@keyframes hero-fade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ⑩ モバイル最適化 */
@media (max-width: 768px) {
  #app.lib-app--top .hero-headline-main {
    font-size: 2.1rem;
  }

  #app.lib-app--top .lib-top-section--hero .lib-fragment {
    padding: 28px 18px;
  }

  #app.lib-app--top .lib-top-section--hero .columns {
    flex-direction: column;
  }
}

/* ⑪ アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
  #app.lib-app--top .lib-top-section--hero * {
    animation: none !important;
    transform: none !important;
  }
}

/* =============================================================================
   TOP 全体: 縦リズム・区切り・幅（lib-commercial-top より後に読み込む）
   ============================================================================= */

/* フラット TOP: ヒーロー埋め込みとその下の帯の間隔を詰める */
body:has(#app.lib-app--top) #page-host .lib-top-html-embed {
  margin-bottom: 0.15rem;
}

#app.st-app-view--top.lib-app .block-container {
  max-width: min(1120px, 100%);
  margin-inline: auto;
}

/* lib-commercial のセクション 80px を、ヒーロー以外ではやや詰めてリズムを揃える */
#app.lib-app--top .st-sections > .lib-top-section:not(.lib-top-section--hero) {
  padding-top: clamp(0.85rem, 2.2vw, 1.5rem);
  padding-bottom: clamp(0.85rem, 2.2vw, 1.5rem);
  border-top: 1px solid rgba(15, 28, 46, 0.065);
}

/* PHILOSOPHY / 地価: 下の段との間隔を詰める */
#app.lib-app--top .st-sections > .lib-top-section--philosophy,
#app.lib-app--top .st-sections > .lib-top-section--chika {
  padding-bottom: clamp(0.4rem, 1.1vw, 0.65rem);
}

/* フラット TOP ヒーロー（#page-host）: CTA ボタン左右の見た目を #app 側と同じ寸法感に */
body:has(#app.lib-app--top) #page-host .lib-sh-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: stretch;
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
}
body:has(#app.lib-app--top) #page-host .lib-sh-btn {
  box-sizing: border-box;
  min-width: min(12.5rem, 46vw);
  min-height: 60px;
  text-align: center;
}
body:has(#app.lib-app--top) #page-host .lib-sh-btn--primary {
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}
body:has(#app.lib-app--top) #page-host .lib-sh-btn--secondary {
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* =============================================================================
   TOP ヒーロー（#page-host）: キッカー / h1 / リード文のデザイン階層
   ============================================================================= */
body:has(#app.lib-app--top) #page-host .lib-sh-card {
  position: relative;
  padding: clamp(1.65rem, 3.8vw, 2.35rem) clamp(1.15rem, 3.2vw, 2.1rem);
}
body:has(#app.lib-app--top) #page-host .lib-sh-root[lang="ja"] .lib-sh-kicker {
  text-transform: none;
  display: inline-block;
  margin: 0 auto 0.9rem;
  padding: 0.38rem 1rem 0.42rem;
  max-width: 100%;
  box-sizing: border-box;
  font-size: clamp(0.78rem, 1.45vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.45;
  color: #f8f3e8;
  background: linear-gradient(145deg, rgba(201, 162, 77, 0.28) 0%, rgba(201, 162, 77, 0.08) 100%);
  border: 1px solid rgba(228, 197, 111, 0.5);
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.15) inset,
    0 6px 20px rgba(0, 0, 0, 0.25);
}
body:has(#app.lib-app--top) #page-host .lib-sh-root[lang="en"] .lib-sh-kicker {
  text-transform: uppercase;
  display: inline-block;
  margin: 0 auto 0.9rem;
  padding: 0.38rem 0.95rem 0.42rem;
  font-size: clamp(0.7rem, 1.3vw, 0.8rem);
  letter-spacing: 0.1em;
  color: rgba(255, 248, 240, 0.92);
  background: linear-gradient(145deg, rgba(201, 162, 77, 0.25) 0%, rgba(201, 162, 77, 0.09) 100%);
  border: 1px solid rgba(201, 162, 77, 0.42);
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}
body:has(#app.lib-app--top) #page-host h1.lib-sh-title.lib-sh-title--h1seo {
  position: relative;
  margin: 0 auto 0.2rem;
  padding-bottom: 0.9rem;
  line-height: 1.18;
  font-size: clamp(2.15rem, 6.5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.4),
    0 4px 24px rgba(0, 0, 0, 0.35),
    0 10px 40px rgba(0, 0, 0, 0.5);
}
body:has(#app.lib-app--top) #page-host h1.lib-sh-title.lib-sh-title--h1seo::after {
  content: "";
  display: block;
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(4.5rem, 28vw);
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(201, 162, 77, 0.15), #e4c56f, rgba(201, 162, 77, 0.15));
  box-shadow: 0 0 12px rgba(228, 197, 111, 0.5);
}
body:has(#app.lib-app--top) #page-host .lib-sh-card > h1.lib-sh-title.lib-sh-title--h1seo {
  max-width: min(28em, 96vw);
}
body:has(#app.lib-app--top) #page-host .lib-sh-sub {
  margin: 1.15rem auto 0.2rem;
  max-width: 40rem;
  padding: 1.05rem 1.2rem 1.15rem;
  text-align: left;
  font-size: clamp(0.86rem, 1.8vw, 0.95rem);
  line-height: 1.8;
  font-weight: 500;
  color: rgba(255, 252, 245, 0.94);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  background: linear-gradient(165deg, rgba(4, 8, 16, 0.42) 0%, rgba(10, 18, 32, 0.38) 100%);
  border: 1px solid rgba(201, 162, 77, 0.2);
  border-left: 3px solid rgba(201, 162, 77, 0.75);
  border-radius: 0 12px 12px 0;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
}
body:has(#app.lib-app--top) #page-host .lib-sh-buttons {
  margin-top: 1.35rem;
}
@media (max-width: 520px) {
  body:has(#app.lib-app--top) #page-host .lib-sh-sub {
    text-align: left;
    padding: 0.9rem 1rem;
  }
  body:has(#app.lib-app--top) #page-host h1.lib-sh-title.lib-sh-title--h1seo {
    font-size: clamp(1.8rem, 7.2vw, 2.45rem);
  }
}

#app.lib-app--top .st-sections > .lib-top-section--hero {
  border-top: none;
}

#app.lib-app--top .lib-top-section:not(.lib-top-section--hero) > .st-section__inner {
  max-width: min(1040px, 100%);
  margin-inline: auto;
}

/* 業務カード・AI ツール帯だけ、ページ地色から軽く浮かせる */
#app.lib-app--top .lib-top-section--services,
#app.lib-app--top .lib-top-section--ai_tools {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(247, 245, 242, 0.98) 72%, #f4f1ec 100%);
}

/* ニュース／トレンドはカード面を主役にし、地色はページ背景に近づける */
#app.lib-app--top .lib-top-section--news .st-section__inner,
#app.lib-app--top .lib-top-section--trends .st-section__inner {
  box-shadow: 0 12px 36px rgba(15, 28, 46, 0.065);
}

/* ナビカード群: セクション内の左右余白をヒーロー直下と揃える感覚に */
#app.lib-app--top .lib-top-section--nav_cards > .st-section__inner {
  padding-inline: clamp(0.75rem, 2.5vw, 1.25rem);
}

@media (max-width: 600px) {
  #app.lib-app--top .st-sections > .lib-top-section:not(.lib-top-section--hero) {
    padding-top: clamp(1rem, 3.5vw, 1.6rem);
    padding-bottom: clamp(1rem, 3.5vw, 1.6rem);
  }
}

/* =============================================================================
   TOP カード列: 間隔・min-width（重なり防止）
   ============================================================================= */

#app.lib-app--top .lib-top-card-col {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#app.lib-app--top .lib-api-top-services .lib-st-columns-container,
#app.lib-app--top .lib-svc-grid-wrap .lib-st-columns-container {
  gap: clamp(0.7rem, 1.8vw, 1.1rem) !important;
  row-gap: clamp(0.7rem, 1.7vw, 1.05rem);
}

#app.lib-app--top .lib-api-top-services .lib-metric.card,
#app.lib-app--top .lib-svc-grid-wrap .lib-metric.card {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

#app.lib-app--top .lib-api-top-services .lib-metric.card:hover,
#app.lib-app--top .lib-svc-grid-wrap .lib-metric.card:hover {
  transform: translateY(-4px);
}

#app.lib-app--top .lib-trends-rail .lib-st-columns-container {
  gap: 0.8rem;
}

/* スマホ: 不動産トレンド枠内が長いときは縦スクロール */
@media (max-width: 768px) {
  #app.lib-app--top [data-section="trends"] .lib-api-trends {
    max-height: min(70vh, 480px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 0.25rem;
  }
}

#app.lib-app--top .lib-top-section--philosophy [data-testid="column"] {
  min-width: 0;
  box-sizing: border-box;
}

/* =============================================================================
   TOP: 価格の目線・AIツール帯のコンパクト化・コンタクト帯削除後の余白
   ============================================================================= */

#app.lib-app--top .lib-top-section--price_line_cards > .st-section__inner,
#app.lib-app--top .lib-top-section--ai_tools > .st-section__inner {
  padding: clamp(0.45rem, 1.2vw, 0.65rem) clamp(0.4rem, 1.2vw, 0.55rem);
}

#app.lib-app--top .lib-top-section--price_line_cards h2.lib-h3,
#app.lib-app--top .lib-top-section--price_line_cards .lib-h3,
#app.lib-app--top .lib-top-section--ai_tools h2.lib-h3,
#app.lib-app--top .lib-top-section--ai_tools .lib-h3 {
  margin: 0 0 0.45rem;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
}

#app.lib-app--top .lib-price-line-card {
  background: #fff;
  border: 1px solid rgba(15, 28, 46, 0.1);
  border-radius: 14px;
  padding: 0.65rem 0.7rem 0.7rem;
  box-sizing: border-box;
  height: 100%;
}

#app.lib-app--top .lib-price-line-card__h {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f1c2e;
}

#app.lib-app--top .lib-price-line-card__p {
  margin: 0 0 0.45rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #475569;
}

#app.lib-app--top .lib-price-line-card__img {
  width: 100%;
  display: block;
  border-radius: 10px;
}

#app.lib-app--top .lib-top-ai-tools-wrap .lib-top-ai-tool-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  width: 100%;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid rgba(15, 28, 46, 0.1);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  min-height: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

#app.lib-app--top .lib-top-ai-tools-wrap .lib-top-ai-tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(15, 28, 46, 0.1);
}

#app.lib-app--top .lib-top-ai-tool-card__name {
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.3;
  color: #0f1c2e;
}

#app.lib-app--top .lib-top-ai-tool-card__desc {
  font-size: 0.8rem;
  line-height: 1.42;
  color: #64748b;
}

#app.lib-app--top .lib-top-section--cta_footer > .st-section__inner {
  padding-top: clamp(0.5rem, 1.5vw, 0.85rem);
  padding-bottom: clamp(0.15rem, 0.55vw, 0.3rem);
}

#app.lib-app--top .lib-top-section--cta_footer {
  padding-bottom: 0;
}

/* ----- スクロール連動: セクションのインビュー表示（ヒーロー除く） ----- */
#app.lib-app--top .lib-scroll-reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

#app.lib-app--top .lib-scroll-reveal.is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

#app.lib-app--top .lib-scroll-reveal--static {
  opacity: 1;
  transform: none;
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  #app.lib-app--top .lib-scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ----- フッター CTA（コンバージョン帯） ----- */
#app.lib-app--top .lib-api-footer-strip.lib-api-footer-strip--cta {
  margin-top: 0.25rem;
  margin-bottom: 0.2rem;
}

#app.lib-app--top .lib-api-footer-cta--pro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding: clamp(1rem, 2.4vw, 1.35rem) clamp(1rem, 2.8vw, 1.6rem);
  border-radius: 16px;
  background: linear-gradient(125deg, #0c1524 0%, #152a45 48%, #122038 100%);
  border: 1px solid rgba(201, 162, 77, 0.38);
  box-shadow:
    0 4px 0 rgba(255, 255, 255, 0.06) inset,
    0 20px 48px rgba(8, 15, 28, 0.35);
  box-sizing: border-box;
}

#app.lib-app--top .lib-api-footer-cta--pro .lib-api-footer-cta-k {
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  font-weight: 700;
  line-height: 1.5;
  color: rgba(248, 250, 252, 0.96);
  max-width: min(520px, 100%);
}

#app.lib-app--top .lib-api-footer-cta--pro .lib-api-footer-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.78rem 1.45rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #0f1c2e !important;
  background: linear-gradient(180deg, #e4c56f 0%, #c9a24d 45%, #b8923f 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
  white-space: nowrap;
}

#app.lib-app--top .lib-api-footer-cta--pro .lib-api-footer-cta-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

#app.lib-app--top .lib-api-footer-cta--pro .lib-api-footer-cta-btn:active {
  transform: translateY(0);
}

/* TOP ページのカード型ナビに「TOP」自身は不要（ヘッダー／フッターのTOPリンクは別要素のため残す） */
#app.st-app-view--top .st-section[data-section="nav_cards"] [data-testid="stHorizontalBlock"] .stColumn:has(
    [data-nav-target="top"]
  ) {
  display: none;
}

/* Real estate trends cards (/api/trends) */
#app.lib-app--top .lib-retrends-wrap {
  margin-top: 0.85rem;
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

#app.lib-app--top .lib-retrends-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  pointer-events: auto;
}

#app.lib-app--top .lib-retrends-card {
  background: #fff;
  border: 1px solid rgba(15, 28, 46, 0.1);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  box-shadow: 0 8px 24px rgba(15, 28, 46, 0.06);
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

#app.lib-app--top .lib-retrends-card > * {
  position: relative;
  z-index: 3;
}

#app.lib-app--top .lib-retrends-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 12px;
  text-decoration: none;
}

#app.lib-app--top .lib-retrends-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 0.3rem;
}

#app.lib-app--top .lib-retrends-cat {
  font-weight: 700;
  color: #0f1c2e;
}

#app.lib-app--top .lib-retrends-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.4;
  color: #0f1c2e;
}

#app.lib-app--top .lib-retrends-summary {
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #475569;
}

#app.lib-app--top .lib-retrends-bottom {
  margin-top: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.8rem;
}

#app.lib-app--top .lib-retrends-impact {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-weight: 700;
  text-transform: lowercase;
  border: 1px solid transparent;
}

#app.lib-app--top .lib-retrends-impact--positive {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.24);
  color: #15803d;
}

#app.lib-app--top .lib-retrends-impact--neutral {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.26);
  color: #334155;
}

#app.lib-app--top .lib-retrends-impact--negative {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.26);
  color: #b91c1c;
}

#app.lib-app--top .lib-retrends-score {
  font-weight: 800;
  color: #0f1c2e;
}

#app.lib-app--top .lib-retrends-link {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1d4ed8;
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 4;
}

#app.lib-app--top .lib-retrends-link:hover {
  text-decoration: underline;
}

#app.lib-app--top .lib-retrends-empty {
  margin: 0.35rem 0 0;
  color: #64748b;
  font-size: 0.92rem;
}

#app.lib-app--top .lib-retrends-source-note {
  margin: 0.45rem 0 0;
  color: #64748b;
  font-size: 0.78rem;
}

@media (max-width: 980px) {
  #app.lib-app--top .lib-retrends-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #app.lib-app--top .lib-retrends-grid {
    grid-template-columns: 1fr;
  }
}
