/* inject_hidden_sidebar_css（DOM 同定・非表示） */
[data-testid="stSidebar"].st-sidebar-mirror,
section[data-testid="stSidebar"].st-sidebar-mirror {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* inject_global_ui_css フローティングナビ */
#lib-floating-nav-host {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99950;
}
#lib-floating-nav-host .lib-fn-btn {
  pointer-events: auto;
  position: fixed;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0.42rem 0.74rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 28, 46, 0.2);
  background: rgba(255, 255, 255, 0.94);
  color: #0f1c2e;
  box-shadow: 0 6px 22px rgba(15, 28, 46, 0.12);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}
#lib-floating-nav-host .lib-fn-btn:hover {
  background: #ffffff;
  border-color: rgba(201, 162, 77, 0.55);
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(15, 28, 46, 0.14);
}
#lib-floating-nav-host .lib-fn-btn:active {
  transform: translateY(0);
}
#lib-floating-nav-host .lib-fn-back {
  top: 4.85rem;
  right: clamp(0.55rem, 2.2vw, 1.15rem);
}
#lib-floating-nav-host .lib-fn-top {
  bottom: calc(1.05rem + env(safe-area-inset-bottom, 0px));
  right: clamp(0.55rem, 2.2vw, 1.15rem);
}
@media (max-width: 768px) {
  #lib-floating-nav-host .lib-fn-btn {
    font-size: 0.84rem;
    padding: 0.5rem 0.88rem;
    min-height: 2.65rem;
    border-radius: 11px;
  }
  #lib-floating-nav-host .lib-fn-back {
    top: 4.15rem;
  }
  #lib-floating-nav-host .lib-fn-top {
    bottom: calc(1.15rem + env(safe-area-inset-bottom, 0px));
  }
}

/* tanizawa_layout _TZK_CSS 抜粋 + 全幅 CTA ボタン */
.lib-tzk-fw-cta-h {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 0.35rem 0;
}
.lib-cta-fw-wrap {
  margin-top: 1.5rem;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, #0f1c2e, #182a46);
  border-radius: 16px;
  text-align: center;
  border: 1px solid rgba(201, 162, 77, 0.25);
}
.lib-cta-fw-wrap .lib-cta-fw-btn {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
  display: inline-flex;
  justify-content: center;
}

/* real_estate_trends._inject_trend_css_once と同等 + spotlight グリッド */
.lib-trend-wrap {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  color: #0f172a;
}
.lib-trend-note {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.65;
  margin: 0 0 1rem 0;
}
.lib-trend-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) {
  .lib-trend-spotlight-grid {
    grid-template-columns: 1fr;
  }
}
.lib-trend-details {
  margin: 0.5rem 0 1rem;
  border: 1px solid rgba(15, 28, 46, 0.12);
  border-radius: 12px;
  padding: 0.5rem 0.85rem;
  background: #fff;
}
.lib-trend-details summary {
  cursor: pointer;
  font-weight: 800;
  color: #0f1c2e;
}
.lib-trend-card {
  border: 1px solid rgba(15, 28, 46, 0.12);
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 1rem;
}
.lib-trend-card--spotlight {
  border-color: rgba(15, 28, 46, 0.22);
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 55%);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}
.lib-trend-clickable {
  cursor: pointer;
}
.lib-trend-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
.lib-trend-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.lib-trend-badge--new {
  background: #0f172a;
  color: #fff;
}
.lib-trend-badge--tier-ko {
  background: #ecfdf5;
  color: #065f46;
}
.lib-trend-badge--tier-gy {
  background: #eff6ff;
  color: #1e40af;
}
.lib-trend-badge--tier-oth {
  background: #f4f4f5;
  color: #3f3f46;
}
.lib-trend-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 0.55rem 0;
  color: #0f1c2e;
}
.lib-trend-card-sum {
  font-size: 0.9rem;
  line-height: 1.72;
  color: #334155;
  margin: 0 0 0.75rem 0;
}
.lib-trend-meta {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}
.lib-trend-score {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}
.lib-trend-linkwrap a {
  font-weight: 700;
  color: #0f1c2e;
}
.lib-trend-row {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 3fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(15, 28, 46, 0.08);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 0.5rem;
}
@media (max-width: 768px) {
  .lib-trend-row {
    grid-template-columns: 1fr;
  }
}
.lib-trend-row-title {
  font-weight: 650;
  font-size: 0.95rem;
  margin: 0;
  color: #0f1c2e;
}
.lib-trend-archive-month {
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  margin: 0.75rem 0 0.35rem 0;
}

/* メイン列レイアウト最終固定（streamlit-mirror と整合） */
.block-container {
  max-width: 1120px;
  margin: auto;
  padding: 2rem;
}
.st-columns {
  display: flex;
  gap: 1.5rem;
}
[data-testid="stVerticalBlock"] {
  gap: 0.82rem;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------------
 * TOP ページ（#app.st-app-view--top）: 幅・余白・タイポ・CTA・モバイル
 * mirror の #app.st-app-view .block-container より詳細度を上げて上書き
 * ------------------------------------------------------------------ */
#app.st-app-view.st-app-view--top {
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", Meiryo, sans-serif;
  color: var(--ink, #0f1c2e);
  -webkit-font-smoothing: antialiased;
}

#app.st-app-view.st-app-view--top .block-container {
  max-width: min(1080px, 100%) !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
  padding-left: clamp(16px, 3.6vw, 44px) !important;
  padding-right: clamp(16px, 3.6vw, 44px) !important;
  padding-top: clamp(1rem, 2.4vw, 1.65rem) !important;
  padding-bottom: clamp(2.1rem, 4.5vw, 3.5rem) !important;
}

/* セクション間の縦リズム（TOP は JSON 上単一 section 内に複数ブロックが続くため .st-sections で間隔を付与） */
#app.st-app-view.st-app-view--top .st-sections {
  display: flex;
  flex-direction: column;
  gap: clamp(1.35rem, 3.2vw, 2.15rem);
}

#app.st-app-view.st-app-view--top [data-testid="stVerticalBlock"] {
  gap: clamp(0.88rem, 2.2vw, 1.12rem);
}

#app.st-app-view.st-app-view--top .hr {
  margin: clamp(1.65rem, 3.8vw, 2.35rem) 0;
  background: rgba(15, 28, 46, 0.11);
}

#app.st-app-view.st-app-view--top h1,
#app.st-app-view.st-app-view--top h2,
#app.st-app-view.st-app-view--top h3 {
  color: var(--ink, #0f1c2e);
  letter-spacing: 0.02em;
}

#app.st-app-view.st-app-view--top h1 {
  font-size: clamp(1.75rem, 0.35rem + 2.6vw, 2.35rem);
  line-height: 1.22;
  margin-top: 0;
  margin-bottom: 0.65em;
}

#app.st-app-view.st-app-view--top h2 {
  font-size: clamp(1.28rem, 0.2rem + 2vw, 1.65rem);
  line-height: 1.28;
  margin-top: 1.35em;
  margin-bottom: 0.55em;
}

#app.st-app-view.st-app-view--top h3 {
  font-size: clamp(1.05rem, 0.12rem + 1.4vw, 1.22rem);
  line-height: 1.35;
  margin-top: 1.1em;
  margin-bottom: 0.45em;
}

/* 本文（ヒーロー内の p は下の .hero-copy-panel ルールで上書き） */
#app.st-app-view.st-app-view--top p,
#app.st-app-view.st-app-view--top li {
  font-size: clamp(1rem, 0.2vw + 0.96rem, 1.06rem);
  line-height: 1.82;
  color: #1f2937;
}

/* 全画面ヒーロー: キャッチ・英字・フッタ行を白（TOP 共通 p 色の上書き解除） */
#app.st-app-view.st-app-view--top .hero-visual.hero-visual--fullvp .hero-copy-panel p,
#app.st-app-view.st-app-view--top .hero-visual.hero-visual--fullvp .hero-copy-panel li {
  color: rgba(255, 255, 255, 0.96) !important;
}

#app.st-app-view.st-app-view--top .hero-visual.hero-visual--fullvp .hero-copy-panel .hero-tagline-jp,
#app.st-app-view.st-app-view--top .hero-visual.hero-visual--fullvp .hero-copy-panel .hero-micro-en,
#app.st-app-view.st-app-view--top .hero-visual.hero-visual--fullvp .hero-copy-panel .hero-footnote {
  color: #ffffff !important;
}

#app.st-app-view.st-app-view--top .hero-visual.hero-visual--fullvp .hero-copy-panel .hero-micro-en {
  font-weight: 700;
  letter-spacing: 0.22em;
}

#app.st-app-view.st-app-view--top .hero-visual.hero-visual--fullvp .hero-copy-panel .hero-footnote {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

#app.st-app-view.st-app-view--top .small {
  font-size: clamp(0.88rem, 0.15vw + 0.84rem, 0.96rem);
  color: #64748b;
  line-height: 1.75;
}

#app.st-app-view.st-app-view--top .kicker,
#app.st-app-view.st-app-view--top .badge {
  color: var(--gold, #c9a24d);
}

#app.st-app-view.st-app-view--top .card {
  border: 1px solid rgba(15, 28, 46, 0.1);
  border-radius: 16px;
  box-shadow:
    0 4px 6px rgba(15, 28, 46, 0.04),
    0 12px 32px rgba(15, 28, 46, 0.07);
  padding: clamp(1.15rem, 2.5vw, 1.45rem);
}

#app.st-app-view.st-app-view--top .hero {
  border-radius: 18px;
  padding: clamp(1.65rem, 4vw, 2.5rem) clamp(1.35rem, 3.5vw, 2.25rem);
  box-shadow:
    0 6px 14px rgba(15, 28, 46, 0.06),
    0 22px 48px rgba(15, 28, 46, 0.09);
}

#app.st-app-view.st-app-view--top .hero-visual:not(.hero-visual--fullvp) {
  margin: clamp(10px, 2vw, 16px) 0 clamp(10px, 2vw, 14px) 0;
  border-radius: clamp(14px, 2.5vw, 22px);
}

/* ナビ・理念カード列: 等高・ギャップ統一（配置の適正化） */
#app.st-app-view.st-app-view--top [data-testid="stHorizontalBlock"].st-columns,
#app.st-app-view.st-app-view--top .st-columns {
  align-items: stretch;
  gap: clamp(0.95rem, 2.2vw, 1.45rem);
}

#app.st-app-view.st-app-view--top [data-testid="column"] {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

#app.st-app-view.st-app-view--top [data-testid="column"] > [data-testid="stVerticalBlock"] {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

/* 理念カード列: 列内でカード高さを揃える */
#app.st-app-view.st-app-view--top [data-testid="column"] .lib-html:has(.lib-corp-pillar-card) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
}

#app.st-app-view.st-app-view--top .lib-corp-pillar-card {
  flex: 1 1 auto;
  min-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

#app.st-app-view.st-app-view--top [data-testid="column"] .st-nav-card-btn.lib-nav-card {
  flex: 1 1 auto;
  width: 100%;
  min-height: 118px;
}

#app.st-app-view.st-app-view--top .footer {
  margin-top: clamp(2.75rem, 6vw, 4rem);
  padding-top: clamp(1.1rem, 2.5vw, 1.45rem);
  font-size: clamp(0.86rem, 0.2vw + 0.82rem, 0.94rem);
  color: #64748b;
}

/* 全幅 CTA（谷沢レイアウト相当） */
#app.st-app-view.st-app-view--top .lib-cta-fw-wrap,
#app.st-app-view.st-app-view--top .lib-cta-band {
  margin-top: clamp(1.65rem, 4vw, 2.35rem);
  padding: clamp(1.35rem, 3.5vw, 1.95rem) clamp(1rem, 3vw, 1.65rem);
  border-radius: clamp(14px, 2vw, 18px);
  background: linear-gradient(165deg, #0b1528 0%, #152a48 42%, #0f1c2e 100%);
  border: 1px solid rgba(201, 162, 77, 0.32);
  box-shadow:
    0 4px 12px rgba(15, 28, 46, 0.12),
    0 24px 56px rgba(15, 28, 46, 0.22);
}

#app.st-app-view.st-app-view--top .lib-tzk-fw-cta-h,
#app.st-app-view.st-app-view--top .lib-cta-band .k {
  font-size: clamp(0.68rem, 0.15vw + 0.64rem, 0.76rem);
  letter-spacing: 0.32em;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 0.5rem;
}

#app.st-app-view.st-app-view--top .lib-cta-fw-wrap .lib-cta-fw-btn,
#app.st-app-view.st-app-view--top .lib-cta-fw-wrap .lib-btn--primary,
#app.st-app-view.st-app-view--top .lib-cta-band .lib-btn--primary {
  max-width: min(28rem, 100%);
  padding: clamp(0.72rem, 1.8vw, 0.95rem) clamp(1.25rem, 3vw, 1.75rem);
  border-radius: 11px;
  font-size: clamp(0.95rem, 0.25vw + 0.9rem, 1.05rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 2px solid rgba(201, 162, 77, 0.55);
  background: linear-gradient(180deg, #c9a24d 0%, #b8923f 100%);
  color: #0f1c2e !important;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.22) inset,
    0 6px 22px rgba(201, 162, 77, 0.35);
  transition: transform 0.15s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#app.st-app-view.st-app-view--top .lib-cta-fw-wrap .lib-cta-fw-btn:hover,
#app.st-app-view.st-app-view--top .lib-cta-fw-wrap .lib-btn--primary:hover,
#app.st-app-view.st-app-view--top .lib-cta-band .lib-btn--primary:hover {
  transform: translateY(-1px);
  border-color: rgba(201, 162, 77, 0.85);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.28) inset,
    0 10px 32px rgba(201, 162, 77, 0.45);
}

#app.st-app-view.st-app-view--top .lib-cta-fw-wrap .lib-cta-fw-btn:active,
#app.st-app-view.st-app-view--top .lib-cta-fw-wrap .lib-btn--primary:active,
#app.st-app-view.st-app-view--top .lib-cta-band .lib-btn--primary:active {
  transform: translateY(0);
}

/* ナビカード列: 狭い画面で縦積み（はみ出し防止） */
@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%;
  }
}

/* ---------- 全 SPA: 列内の min-content はみ出しでカードが重なるのを防ぐ ---------- */
#app.st-app-view .lib-st-columns-container,
#app.st-app-view [data-testid="stHorizontalBlock"].st-columns {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#app.st-app-view .lib-st-columns-container > [data-testid="column"],
#app.st-app-view [data-testid="stHorizontalBlock"].st-columns > [data-testid="column"] {
  min-width: 0 !important;
  max-width: 100%;
  box-sizing: border-box;
}

#app.st-app-view [data-testid="column"] [data-testid="stMarkdown"],
#app.st-app-view [data-testid="column"] [data-testid="stMarkdownContainer"] {
  min-width: 0;
  max-width: 100%;
}

#app.st-app-view [data-testid="column"] .lib-html--trusted,
#app.st-app-view [data-testid="column"] .card {
  max-width: 100%;
  box-sizing: border-box;
}

#app.st-app-view [data-testid="column"] .lib-metric .val,
#app.st-app-view [data-testid="column"] .lib-metric .lbl,
#app.st-app-view [data-testid="column"] .lib-corp-pillar-body,
#app.st-app-view [data-testid="column"] .lib-corp-pillar-h {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 理念エリア: 柱カード行のみ 3 列グリッド（KPI 4 列行は :has 不一致のまま flex） */
#app.st-app-view .lib-st-columns-container:has(.lib-corp-pillar-card) {
  display: grid !important;
  flex-wrap: unset !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(1rem, 2.2vw, 1.5rem);
}

#app.st-app-view .lib-st-columns-container:has(.lib-corp-pillar-card) > [data-testid="column"] {
  width: 100% !important;
  max-width: 100%;
  flex: unset !important;
}

@media (max-width: 900px) {
  #app.st-app-view .lib-st-columns-container:has(.lib-corp-pillar-card) {
    grid-template-columns: 1fr;
  }
}

/* TOP 理念: KPI 行は列数可変のため少し広めの gap */
#app.st-app-view--top .lib-top-section--philosophy .lib-st-columns-container:not(:has(.lib-corp-pillar-card)) {
  gap: clamp(0.85rem, 2vw, 1.2rem) !important;
}

/* TOP フッター帯（api-footer）: リボン行下の余白を詰める */
.lib-api-footer-strip .lib-footer-line--copyright {
  margin-top: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(15, 28, 46, 0.12);
  font-size: 0.88rem;
}

/* 価格の目利き: ゲート前の説明を折りたたみ */
details.lib-mekiki-open-hint-acc {
  border: 2px solid #c9a962;
  border-radius: 14px;
  margin: 0 0 1rem 0;
  background: rgba(255, 255, 255, 0.02);
}
details.lib-mekiki-open-hint-acc > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  color: #0f1c2e;
}
details.lib-mekiki-open-hint-acc > summary::-webkit-details-marker {
  display: none;
}
details.lib-mekiki-open-hint-acc .lib-mekiki-open-hint-body {
  padding: 0 1.1rem 1rem;
  border-top: 1px solid rgba(201, 169, 98, 0.4);
  line-height: 1.65;
  color: #1e293b;
}
details.lib-mekiki-open-hint-acc .lib-mekiki-open-hint-body strong {
  font-weight: 800;
  color: #0f1c2e;
}

/* 不動産鑑定士マッチング: ゲート前（案内＋免責）を折りたたみ */
details.lib-matching-open-hint-acc {
  border: 2px solid #c9a962;
  border-radius: 14px;
  margin: 0 0 1rem 0;
  background: rgba(255, 255, 255, 0.02);
}
details.lib-matching-open-hint-acc > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  color: #0f1c2e;
}
details.lib-matching-open-hint-acc > summary::-webkit-details-marker {
  display: none;
}
details.lib-matching-open-hint-acc .lib-matching-open-hint-body {
  padding: 0 1.1rem 1rem;
  border-top: 1px solid rgba(201, 169, 98, 0.4);
  line-height: 1.65;
  color: #1e293b;
}
details.lib-matching-open-hint-acc .lib-matching-open-hint-body strong {
  font-weight: 800;
  color: #0f1c2e;
}

/* ========== 価格の目利きページ（.lib-mekiki-page）: 画像 src / img インライン style は維持 ========== */
.lib-mekiki-page {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 0 2.5rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
}

.lib-mekiki-page > [data-testid="stMarkdown"]:first-child h1 {
  font-size: clamp(1.55rem, 3.6vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 0 0 0.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 3px solid #c9a24d;
  line-height: 1.25;
}

.lib-mekiki-page > [data-testid="stMarkdown"] h3 {
  margin: 1.35rem 0 0.55rem;
  font-size: clamp(1.05rem, 2.1vw, 1.22rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.lib-mekiki-page .lib-mekiki-story-lede {
  font-size: clamp(1.12rem, 2.65vw, 1.38rem);
  line-height: 1.78;
  font-weight: 500;
  color: #1e293b;
  margin: 0 0 2.5rem;
  padding: 0 0 0.35rem;
  letter-spacing: 0.01em;
}

.lib-mekiki-page > [data-testid="stMarkdown"] .stMarkdown {
  font-size: 0.96rem;
  line-height: 1.72;
  color: #334155;
}

.lib-mekiki-page [data-testid="stImage"] {
  margin: 0.35rem 0 1.35rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(15, 28, 46, 0.08);
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
  background: rgba(255, 255, 255, 0.55);
}

.lib-mekiki-page [data-testid="stImage"] img {
  display: block;
}

/* タブ説明: 枠なし・シンプル（ページ内のみ。マッチング用 .lib-matching-* は変更しない） */
.lib-mekiki-page details.lib-mekiki-open-hint-acc {
  border: none !important;
  border-radius: 0;
  margin: 0 0 1.4rem 0;
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
}
.lib-mekiki-page details.lib-mekiki-open-hint-acc > summary {
  padding: 0.2rem 0;
  font-weight: 650;
  color: #0f172a;
}
.lib-mekiki-page details.lib-mekiki-open-hint-acc .lib-mekiki-open-hint-body {
  border-top: none !important;
  padding: 0.55rem 0 0;
  margin: 0;
  line-height: 1.72;
  color: #334155;
}

.lib-mekiki-page details.lib-mekiki-open-hint-acc + [data-testid="stButton"] {
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
}

.lib-mekiki-page details.lib-mekiki-open-hint-acc + [data-testid="stButton"] button {
  min-height: 2.85rem;
  font-size: 1.02rem;
}

/* ツール表示中〜入力画面: 遷移後のブロック */
.lib-mekiki-postopen-wrap {
  margin: 1.5rem 0 0;
  padding: clamp(1.1rem, 2.8vw, 1.55rem);
  border-radius: 16px;
  background: linear-gradient(165deg, #fbfaf8 0%, #ffffff 52%, #faf8f5 100%);
  border: 1px solid rgba(15, 28, 46, 0.09);
  box-shadow: 0 6px 28px rgba(15, 23, 42, 0.06);
}
.lib-mekiki-toolbar {
  margin-top: 0.65rem;
}
.lib-mekiki-toolbar .stHorizontalBlock {
  align-items: center;
}
.lib-mekiki-analyzer-gate {
  margin-top: 1.1rem;
  padding-top: 1.05rem;
  border-top: 1px solid rgba(15, 28, 46, 0.08);
}
.lib-mekiki-inner-hint {
  margin-bottom: 0.95rem;
  line-height: 1.72;
  color: #475569;
  font-size: 0.98rem;
}
.lib-mekiki-analyzer-gate [data-testid="stButton"] {
  max-width: 22rem;
}
.lib-mekiki-analyzer-gate [data-testid="stButton"] button {
  min-height: 2.75rem;
  font-size: 1rem;
}

.lib-mekiki-page > .hr {
  margin: 1.75rem 0 1.15rem;
  border: 0;
  height: 0;
  border-top: 1px solid rgba(15, 28, 46, 0.1);
}

.lib-mekiki-status-banner {
  display: block;
  border: 1px solid rgba(201, 162, 77, 0.55);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.98) 0%, rgba(250, 245, 235, 0.92) 100%);
  color: #334155;
  font-weight: 600;
  line-height: 1.55;
}

.lib-mekiki-page .lib-mekiki-tabs-root.lib-mekiki-accordion-root:not(.lib-dcf-asset-dash) {
  margin-top: 1.5rem;
  padding: clamp(1rem, 2.8vw, 1.35rem);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #fbfaf8 48%, #f7f4ef 100%);
  border: 1px solid rgba(15, 28, 46, 0.1);
  box-shadow: 0 6px 28px rgba(15, 23, 42, 0.06);
}

.lib-mekiki-page .lib-mekiki-acc {
  border: 1px solid rgba(15, 28, 46, 0.1);
  border-radius: 12px;
  margin-bottom: 0.65rem;
  padding: 0.15rem 0.35rem 0.45rem;
  background: rgba(255, 255, 255, 0.72);
}

.lib-mekiki-page .lib-mekiki-acc[open] {
  box-shadow: inset 0 0 0 1px rgba(201, 162, 77, 0.14);
}

.lib-mekiki-page .lib-mekiki-acc > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.98rem;
  color: #0f172a;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border-left: 3px solid #c9a24d;
}

.lib-mekiki-page .lib-mekiki-acc > summary::-webkit-details-marker {
  display: none;
}

.lib-mekiki-page .lib-mekiki-acc [data-testid="stVerticalBlock"] {
  padding: 0.25rem 0.35rem 0.65rem;
}

/* Phase 27I: 貸家収益入力（折りたたみ） */
.lib-mekiki-page .lib-mekiki-leased-income {
  margin-top: 0.35rem;
}

.lib-mekiki-page .lib-mekiki-leased-hint {
  margin: 0.35rem 0 0.55rem;
  line-height: 1.45;
}

/* Phase 33F: 建物入力（折りたたみ） */
.lib-mekiki-page .lib-mekiki-building-input {
  margin-top: 0.35rem;
}

.lib-mekiki-page .lib-mekiki-building-hint {
  margin: 0.35rem 0 0.55rem;
  line-height: 1.45;
}

.lib-mekiki-page textarea,
.lib-mekiki-page input[type="text"],
.lib-mekiki-page input[type="number"],
.lib-mekiki-page select {
  border-radius: 10px !important;
  border: 1px solid rgba(15, 28, 46, 0.14) !important;
  padding: 0.5rem 0.65rem !important;
  font-size: 0.95rem;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.lib-mekiki-page textarea:focus,
.lib-mekiki-page input:focus,
.lib-mekiki-page select:focus {
  outline: none;
  border-color: rgba(201, 162, 77, 0.88) !important;
  box-shadow: 0 0 0 3px rgba(201, 162, 77, 0.2);
}

.lib-mekiki-page label {
  display: inline-block;
  margin: 0.35rem 0 0.2rem;
  font-weight: 650;
  font-size: 0.88rem;
  color: #334155;
}

.lib-mekiki-page .stHorizontalBlock {
  gap: 0.85rem;
}

.lib-mekiki-page .lib-mekiki-acc h3 {
  margin: 0.85rem 0 0.4rem;
  font-size: 1.02rem;
  color: #0f172a;
}

.lib-mekiki-page .small,
.lib-mekiki-page p.small {
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.65;
}

.lib-mekiki-page #mekiki_run_btn.lib-mekiki-run-delegated {
  width: 100%;
  max-width: 22rem;
  margin: 0.85rem auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.65rem 1.2rem;
  border-radius: 12px;
  font-weight: 800;
}

.lib-mekiki-page #mekiki_walk_cap_dyn.small {
  margin: 0.35rem 0 0.75rem;
}

.lib-mekiki-page .lib-alert {
  border-radius: 12px;
}

@media (max-width: 640px) {
  .lib-mekiki-page .stHorizontalBlock {
    flex-direction: column;
  }
}
