/* トップ／検索シェルの Apple-inspired visual system。
   医療情報の可読性と既存の検索挙動を保ち、階層・余白・反応を整える。 */
:root {
  --ui-surface: #ffffff;
  --ui-surface-soft: #f7faf9;
  --ui-stroke: rgba(28, 65, 73, 0.13);
  --ui-shadow: 0 18px 48px rgba(24, 54, 61, 0.09), 0 2px 10px rgba(24, 54, 61, 0.05);
  --ui-shadow-soft: 0 9px 28px rgba(24, 54, 61, 0.08);
  --ui-radius-xl: 28px;
  --ui-radius-lg: 20px;
}

body {
  background:
    radial-gradient(circle at 8% 4%, rgba(118, 196, 185, 0.16), transparent 28rem),
    radial-gradient(circle at 92% 20%, rgba(118, 158, 196, 0.11), transparent 30rem),
    #f5f8f7;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans",
    "Yu Gothic UI", "Noto Sans JP", Meiryo, sans-serif;
  letter-spacing: 0.005em;
}

button,
input,
select { font: inherit; }

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.topbar {
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(28, 65, 73, 0.1);
  box-shadow: 0 1px 14px rgba(23, 53, 59, 0.05);
  -webkit-backdrop-filter: saturate(175%) blur(18px);
  backdrop-filter: saturate(175%) blur(18px);
}

.brand-home { gap: 10px; }
.brand-icon { width: 30px; height: 30px; }
.brand h1,
.brand .brand-title {
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.brand-sub {
  padding: 3px 9px;
  border-radius: 999px;
  background: #e7f3f1;
  color: var(--primary-dark);
  font-size: 11px;
}

.layout {
  grid-template-columns: minmax(360px, 0.86fr) minmax(0, 1.34fr);
  gap: 24px;
  max-width: 1380px;
  padding: 26px 28px 42px;
}

.pane-search {
  position: sticky;
  top: 80px;
  align-self: start;
  padding: 26px;
  border: 1px solid var(--ui-stroke);
  border-radius: var(--ui-radius-xl);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}

.search-intro { margin: 0 0 20px; }
.search-kicker,
.home-hero-kicker {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-title {
  margin: 0;
  color: #173842;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1.28;
}

.search-intro > p:last-child {
  margin: 8px 0 0;
  color: #68777d;
  font-size: 13px;
  line-height: 1.7;
}

.field-toggle {
  width: 100%;
  margin: 0 0 12px;
  padding: 3px;
  border: 0;
  border-radius: 12px;
  background: #eef2f1;
}

.ftbtn {
  flex: 1;
  min-height: 38px;
  border-radius: 9px;
  background: transparent;
  font-size: 12.5px;
}

.ftbtn + .ftbtn { border-left: 0; }
.ftbtn.on {
  background: #fff;
  color: #173842;
  box-shadow: 0 1px 5px rgba(23, 56, 66, 0.12);
}

.searchbox-row { gap: 10px; }
.searchbox {
  min-height: 54px;
  padding: 13px 42px 13px 16px;
  border: 1px solid #cbd7d7;
  border-radius: 16px;
  color: #173842;
  box-shadow: inset 0 1px 2px rgba(23, 56, 66, 0.03);
}

.searchbox::placeholder { color: #68777d; }
.searchbox:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.11);
}

.route-select {
  min-height: 54px;
  border-width: 1px;
  border-color: #cbd7d7;
  border-radius: 16px;
  padding: 0 12px;
  color: #43565d;
}

.chips { margin: 12px 0; }
.chip {
  min-height: 32px;
  border-color: #d9e2e1;
  background: #f8faf9;
}

.detail-empty {
  max-height: none;
  overflow: visible;
  padding: 5px 2px 26px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.home-hero { margin: 0 0 22px; padding: 4px 4px 0; }
.home-hero-kicker { display: flex; align-items: center; gap: 7px; }
.home-hero-kicker span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ba789;
  box-shadow: 0 0 0 4px rgba(43, 167, 137, 0.12);
}

.home-hero-title {
  max-width: 720px;
  margin: 0 0 10px;
  color: #173842;
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 790;
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.home-hero-sub {
  max-width: 760px;
  color: #607178;
  font-size: 14px;
  line-height: 1.85;
}

.home-nav {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.home-nav-card {
  position: relative;
  gap: 14px;
  border-color: var(--ui-stroke);
  color: #173842;
  transition: transform 140ms ease, border-color 180ms ease, box-shadow 180ms ease,
    background-color 180ms ease;
}

.home-nav-card--primary {
  min-height: 132px;
  align-items: flex-start;
  padding: 22px;
  border-radius: var(--ui-radius-lg);
  background: linear-gradient(145deg, #fff 40%, #eef8f6 100%);
  box-shadow: var(--ui-shadow-soft);
}

.home-nav-card--primary:nth-child(3) {
  grid-column: 1 / -1;
  min-height: 104px;
  align-items: center;
}

.home-nav-card--secondary {
  min-height: 72px;
  padding: 13px 16px;
  border-color: transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.64);
}

.home-nav-card--secondary:last-child { grid-column: 1 / -1; }
.home-nav-card .hn-ic {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: #e6f3f1;
  color: var(--primary-dark);
}

.home-nav-card--primary .hn-ic { width: 46px; height: 46px; border-radius: 15px; }
.home-nav-card .hn-ic svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.home-nav-card .hn-tx { gap: 5px; }
.home-nav-card .hn-tx b {
  color: #173842;
  font-size: 14px;
  letter-spacing: -0.015em;
}

.home-nav-card--primary .hn-tx b { font-size: 16px; }
.home-nav-card .hn-tx small { color: #6a797f; line-height: 1.5; }
.home-nav-card::after {
  content: "›";
  align-self: center;
  margin-left: auto;
  color: #7b9498;
  font-size: 24px;
  font-weight: 300;
}

.home-nav-card:active { transform: scale(0.985); }
.home-nav-card:focus-visible,
.home-nav-mobile a:focus-visible,
.home-chip:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.38);
  outline-offset: 3px;
}

.home-pop {
  margin-bottom: 26px;
  padding: 24px 4px 0;
  border-top: 1px solid var(--ui-stroke);
}

.home-pop-h { margin-top: 22px; color: #31525b; font-size: 12px; letter-spacing: 0.08em; }
.home-chip-row { gap: 8px; }
.home-chip {
  min-height: 36px;
  padding: 7px 13px;
  border-color: #d9e2e1;
  background: rgba(255, 255, 255, 0.72);
  color: #31525b;
}

.home-guide-list { gap: 4px; }
.home-guide-list a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  color: var(--primary-dark);
}

.home-guide-list a::before { content: "→"; margin-right: 8px; }

.site-footer {
  margin-top: 18px;
  padding: 40px 28px 24px;
  border-top-color: rgba(28, 65, 73, 0.1);
  background: #edf3f1;
}

.sf-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 24px 36px;
  max-width: 1220px;
}

.sf-nav { padding-top: 0; border-top: 0; }
.sf-nav-disclosure > summary {
  position: relative;
  display: block;
  min-height: 44px;
  margin: 0;
  padding: 11px 28px 9px 0;
  list-style: none;
  cursor: pointer;
}
.sf-nav-disclosure > summary::-webkit-details-marker { display: none; }
.sf-nav-disclosure > summary::after {
  content: "+";
  position: absolute;
  top: 8px;
  right: 4px;
  color: var(--primary);
  font-size: 19px;
  font-weight: 400;
}
.sf-nav-disclosure[open] > summary::after { content: "−"; }
.sf-nav-list-compact { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sf-nav-list-compact a { background: transparent; }
.sf-banners,
.sf-copy { grid-column: 1 / -1; }
.sf-reviewer,
.sf-faq { padding-top: 20px; border-top-color: rgba(28, 65, 73, 0.13); }
.sf-reviewer-more > summary {
  display: block;
  min-height: 44px;
  padding: 11px 0;
  color: var(--primary-dark);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.sf-faq-list { display: grid; gap: 2px; }
.sf-faq-item { border-bottom: 1px solid rgba(28, 65, 73, 0.11); }
.sf-faq-item > summary {
  position: relative;
  min-height: 42px;
  padding: 11px 30px 9px 0;
  color: #274850;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.55;
  list-style: none;
  cursor: pointer;
}
.sf-faq-item > summary::-webkit-details-marker { display: none; }
.sf-faq-item > summary::after {
  content: "+";
  position: absolute;
  top: 9px;
  right: 4px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 400;
}
.sf-faq-item[open] > summary::after { content: "−"; }
.sf-faq-item > p {
  margin: 0;
  padding: 0 28px 12px 0;
  color: #607178;
  font-size: 12px;
  line-height: 1.75;
}

@media (hover: hover) and (pointer: fine) {
  .home-nav-card:hover {
    transform: translateY(-3px);
    border-color: rgba(15, 118, 110, 0.34);
    box-shadow: 0 16px 34px rgba(24, 73, 72, 0.12);
  }

  .home-nav-card--secondary:hover { transform: translateY(-2px); background: #fff; }
}

@media (max-width: 860px) {
  body { background: linear-gradient(180deg, #f4f8f7 0, #fff 42rem); }
  .topbar { padding: 9px 14px; }
  .layout { display: block; padding: 14px 12px 28px; }
  .pane-search {
    position: static;
    padding: 20px;
    border-radius: 24px;
    box-shadow: 0 14px 38px rgba(24, 54, 61, 0.1);
  }

  .search-intro { margin-bottom: 16px; }
  .search-title { font-size: 24px; }
  .search-kicker { margin-bottom: 5px; }
  .field-toggle { margin-bottom: 10px; }
  .searchbox { min-height: 52px; font-size: 16px; }
  .route-select { min-height: 48px; }
  .home-nav-mobile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0 4px;
  }

  .home-nav-mobile a {
    min-height: 52px;
    justify-content: flex-start;
    gap: 9px;
    padding: 10px 12px;
    border-color: #dbe5e3;
    border-radius: 14px;
    background: #f8faf9;
    color: #264950;
    font-size: 12.5px;
  }

  .home-nav-mobile a:active { transform: scale(0.98); background: #e7f3f1; }
  .home-nav-mobile svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--primary);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .site-footer { margin-top: 10px; padding: 28px 16px 20px; }
  .sf-inner { display: flex; gap: 18px; }
  .sf-nav { padding-top: 16px; border-top: 1px solid rgba(28, 65, 73, 0.13); }
  .sf-nav-list-compact { grid-template-columns: 1fr 1fr; gap: 7px 10px; }
  .sf-nav-list-compact a { min-height: 34px; padding: 6px 0; border: 0; }
  .sf-reviewer-body {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    text-align: left;
  }

  .sf-reviewer-photo { width: 68px; height: 68px; }
  .sf-reviewer-more { grid-column: 1 / -1; }
  .sf-reviewer-more[open] .sf-reviewer-bio { display: block; padding-top: 4px; }
}

@media (max-width: 480px) {
  .pane-search { padding: 18px 16px; }
  .search-intro > p:last-child { font-size: 12.5px; }
  .searchbox-row { gap: 8px; }
  .sf-org-logo { width: 40px; height: 40px; }
  .sf-org-desc { line-height: 1.7; }
  .sf-banner-body { padding: 12px 14px; }
  .sf-faq-list dd { line-height: 1.65; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .home-nav-card--secondary,
  .home-chip { background: #fff; }
}

@media (prefers-contrast: more) {
  .pane-search,
  .searchbox,
  .route-select,
  .home-nav-card,
  .home-nav-mobile a,
  .home-chip { border-color: #526970; }
  .search-intro > p:last-child,
  .home-hero-sub,
  .home-nav-card .hn-tx small { color: #344b52; }
}

@media (prefers-reduced-motion: reduce) {
  .home-nav-card,
  .home-nav-mobile a,
  .home-chip { transition: none; }
  .home-nav-card:hover,
  .home-nav-card:active,
  .home-nav-mobile a:active { transform: none; }
}

@media print {
  .icon-sprite { display: none; }
}
