:root {
  --ink: #17221f;
  --muted: #64716c;
  --line: #d7dfdc;
  --soft: #f4f7f5;
  --surface: #ffffff;
  --green: #0f6b5b;
  --green-dark: #095448;
  --green-soft: #e8f5f0;
  --blue: #246a9a;
  --blue-soft: #eaf3fa;
  --coral: #a64737;
  --coral-soft: #fff0ed;
  --amber: #805a00;
  --amber-soft: #fff6d8;
  --shadow: 0 6px 22px rgba(24, 48, 40, .08);
  --topbar-height: 58px;
  --bottom-nav-height: 64px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background: #f7f9f8;
  font-family: "Segoe UI", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); }
[hidden] { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  padding: 0 8px;
  color: #fff;
  background: var(--green);
  border-bottom: 1px solid var(--green-dark);
}
.brand {
  justify-self: center;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}
.back-button, .favorite-header {
  width: 40px;
  height: 40px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  font-size: 30px;
  cursor: pointer;
}
.favorite-header { grid-column: 3; font-size: 27px; }

main { min-height: calc(100vh - var(--topbar-height)); }
.screen { padding: 18px 14px calc(var(--bottom-nav-height) + 28px); }
h1, h2, h3 { margin: 0; letter-spacing: 0; line-height: 1.35; }
h1 { font-size: 23px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }

.loading-state {
  min-height: 60vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
}
.loader {
  width: 32px;
  height: 32px;
  border: 3px solid #c9dad4;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.home-screen { padding: 0 0 calc(var(--bottom-nav-height) + 28px); background: #fff; }
.home-intro {
  padding: 30px 18px 26px;
  background: #e9f3ef;
  border-bottom: 1px solid #cfe0da;
}
.home-kicker, .step-label { color: var(--green-dark); font-size: 12px; font-weight: 700; }
.home-intro h1 { max-width: 620px; margin-top: 5px; font-size: 30px; }
.home-lead { max-width: 660px; margin-top: 10px; color: #3f4d48; font-size: 15px; }
.data-date { margin-top: 12px; color: var(--muted); font-size: 11px; }
.home-section { padding: 24px 18px; border-bottom: 1px solid var(--line); }
.home-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.home-section-heading > img { width: 24px; height: 24px; opacity: .55; }
.home-section-heading h2 { margin-top: 2px; font-size: 20px; }
.disease-entry-grid { display: grid; gap: 10px; }
.disease-entry, .location-entry, .guide-entry {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  text-decoration: none;
}
.disease-entry:hover, .location-entry:hover, .guide-entry:hover { border-color: #91ada4; box-shadow: var(--shadow); }
.cancer-entry { border-left: 4px solid #b94e55; }
.other-entry { border-left: 4px solid var(--blue); }
.guide-entry { min-height: 82px; border-left: 4px solid var(--green); }
.entry-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); }
.cancer-entry .entry-icon { background: #fae9eb; }
.other-entry .entry-icon { background: var(--blue-soft); }
.entry-icon img { width: 23px; height: 23px; }
.entry-copy { min-width: 0; display: grid; gap: 2px; }
.entry-copy strong { font-size: 16px; }
.entry-copy small { color: var(--muted); font-size: 12px; }
.entry-arrow { width: 20px; height: 20px; opacity: .55; }
.location-entry { min-height: 72px; border-left: 4px solid var(--green); }
.home-notice {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  padding: 20px 18px;
  color: #4d3b09;
  background: var(--amber-soft);
  border-bottom: 1px solid #eadba6;
}
.home-notice > img { width: 24px; height: 24px; margin-top: 1px; }
.home-notice h2 { font-size: 16px; }
.home-notice p { max-width: 820px; margin-top: 6px; font-size: 13px; }
.home-about { padding: 24px 18px; }
.home-about > div { display: flex; align-items: center; gap: 9px; }
.home-about > div img { width: 22px; height: 22px; }
.home-about h2 { font-size: 18px; }
.home-about p { max-width: 820px; margin-top: 9px; color: #46524d; font-size: 13px; }
.home-about > a { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 13px; font-weight: 700; text-decoration: none; }
.home-about > a img { width: 16px; height: 16px; }

.guide-screen { background: #f7f9f8; }
.guide-shell { max-width: 880px; margin: 0 auto; }
.guide-header {
  margin: -2px -2px 14px;
  padding: 18px 2px 4px;
}
.guide-header h1 { margin-top: 4px; font-size: 24px; }
.guide-header p:not(.step-label) { max-width: 700px; margin-top: 8px; color: #46524d; font-size: 14px; }
.guide-summary-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.guide-summary-panel > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.guide-summary-panel span { color: var(--muted); font-size: 12px; }
.guide-summary-panel strong { color: var(--green-dark); font-size: 24px; }
.guide-selected { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-step {
  padding: 16px 0 18px;
  border-top: 1px solid var(--line);
}
.guide-step.disabled { opacity: .62; }
.guide-step-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 11px;
}
.guide-step-heading > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}
.guide-step-heading h2 { font-size: 18px; }
.guide-step-heading p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.guide-choice-grid { display: grid; gap: 8px; }
.guide-choice-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-choice-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-location-block { display: grid; gap: 8px; }
.guide-subheading {
  margin-top: 4px;
  color: #52625d;
  font-size: 12px;
  font-weight: 700;
}
.guide-subheading:first-child { margin-top: 0; }
.guide-choice {
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b9c8c2;
  border-radius: 7px;
  text-align: left;
  cursor: pointer;
}
.guide-choice.with-icon { grid-template-columns: 52px minmax(0, 1fr); }
.category-choice-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5ece9;
  border-radius: 13px;
  box-shadow: 0 3px 10px rgba(24, 48, 40, .06);
}
.category-choice-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.guide-choice.active {
  border-color: #6ba997;
  background: var(--green-soft);
  box-shadow: inset 3px 0 var(--green);
}
.guide-choice strong { display: block; font-size: 14px; line-height: 1.35; }
.guide-choice small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.guide-actions {
  position: sticky;
  bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px;
  padding: 12px 0 4px;
  background: linear-gradient(180deg, rgba(247, 249, 248, .72), #f7f9f8 32%);
}
.primary-action, .secondary-action {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
}
.primary-action { color: #fff; background: var(--green); border: 1px solid var(--green); }
.primary-action:disabled { opacity: .45; cursor: not-allowed; }
.secondary-action { color: var(--green-dark); background: #fff; border: 1px solid #91aaa3; }

.search-layout { display: grid; gap: 20px; }
.filters { min-width: 0; }
.section-heading { margin-bottom: 20px; }
.section-heading p, .simple-heading p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.field-group { margin: 0 0 20px; padding: 0; border: 0; }
.field-group legend, .field-group > label {
  display: block;
  margin-bottom: 7px;
  color: #35413d;
  font-size: 13px;
  font-weight: 700;
}
input[type="search"], select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b8c5c0;
  border-radius: 5px;
}
input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(36, 106, 154, .25);
  outline-offset: 2px;
}
.segment-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segment-control button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px;
  color: #48544f;
  background: #fff;
  border: 1px solid #aebcb7;
  cursor: pointer;
}
.segment-control button img { width: 18px; height: 18px; opacity: .75; }
.segment-control button.active img { filter: brightness(0) invert(1); opacity: 1; }
.segment-control button:first-child { border-radius: 5px 0 0 5px; }
.segment-control button:last-child { border-left: 0; border-radius: 0 5px 5px 0; }
.segment-control button.active { color: #fff; background: var(--green); border-color: var(--green); font-weight: 700; }
.category-list { display: flex; flex-wrap: wrap; gap: 7px; }
.category-list button, .filter-chip {
  min-height: 36px;
  padding: 6px 10px;
  color: #3b4843;
  background: #fff;
  border: 1px solid #bdc8c4;
  border-radius: 18px;
  cursor: pointer;
}
.category-list button.active { color: var(--green-dark); background: var(--green-soft); border-color: #74ac9d; font-weight: 700; }
.category-list small { margin-left: 4px; color: var(--muted); }
.location-button {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  padding: 8px 12px;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid #83b6a8;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
}
.location-button.compact { width: auto; min-width: 90px; margin: 0; }
.location-status { min-height: 18px; margin-top: 5px; color: var(--muted); font-size: 12px; }
.check-row { display: flex; align-items: center; gap: 9px; min-height: 44px; font-weight: 600; cursor: pointer; }
.check-row input { width: 19px; height: 19px; accent-color: var(--green); }

.results-panel { min-width: 0; }
.results-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); }
.results-toolbar strong { font-size: 18px; }
.results-toolbar span { display: block; color: var(--muted); font-size: 11px; }
.results-toolbar select { width: auto; min-width: 150px; min-height: 38px; padding: 6px 9px; font-size: 12px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; }
.active-filters:empty { display: none; }
.filter-chip { min-height: 30px; padding: 3px 9px; color: var(--green-dark); background: var(--green-soft); border-color: #9ac5ba; font-size: 12px; }
.trial-list { display: grid; gap: 10px; }
.trial-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.trial-card-link { display: block; padding: 14px 48px 14px 14px; color: inherit; text-decoration: none; }
.trial-card:hover { border-color: #9cb6ad; box-shadow: var(--shadow); }
.save-button {
  position: absolute;
  top: 8px;
  right: 7px;
  z-index: 2;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--amber);
  background: transparent;
  border: 0;
  font-size: 25px;
  cursor: pointer;
}
.trial-card-top { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-height: 25px; }
.status-badge, .tag, .facility-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid #9bc7b9;
  border-radius: 3px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 700;
}
.status-badge.active { color: var(--blue); background: var(--blue-soft); border-color: #a7c9df; }
.distance { color: var(--blue); font-size: 12px; font-weight: 700; }
.trial-card h2 { margin-top: 8px; font-size: 16px; }
.condition-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag { color: #44514c; background: var(--soft); border-color: #cbd5d1; font-weight: 500; }
.trial-facts { display: grid; gap: 3px; margin: 10px 0 0; }
.trial-facts div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
.trial-facts dt { color: var(--muted); font-size: 12px; }
.trial-facts dd { margin: 0; font-size: 12px; }
.facility-preview { margin-top: 10px; padding-top: 9px; border-top: 1px solid #e8eeeb; color: #46534e; font-size: 12px; }
.facility-preview strong { color: var(--green-dark); }
.empty-state { padding: 38px 18px; text-align: center; color: var(--muted); background: #fff; border: 1px solid var(--line); }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); }
.load-more { width: 100%; min-height: 44px; margin-top: 12px; color: var(--green); background: #fff; border: 1px solid #8ab5a9; border-radius: 5px; cursor: pointer; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  border-top: 1px solid #cfd8d4;
  box-shadow: 0 -5px 18px rgba(23, 48, 40, .08);
}
.bottom-nav a { display: grid; grid-template-rows: 25px 18px; place-items: center; align-content: center; color: #5f6c67; text-decoration: none; font-size: 11px; font-weight: 700; }
.bottom-nav a img { width: 21px; height: 21px; opacity: .62; }
.bottom-nav a.active { color: var(--green); box-shadow: inset 0 3px var(--green); }
.bottom-nav a.active img { opacity: 1; }

.map-screen { padding: 0 0 calc(var(--bottom-nav-height) + 12px); }
.map-toolbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.map-toolbar h1 { font-size: 19px; }
.map-toolbar p { color: var(--muted); font-size: 12px; }
.map-root-filter { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 10px; padding: 9px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.map-root-filter > span { color: var(--muted); font-size: 12px; font-weight: 700; }
.map-root-filter .segment-control button { min-height: 38px; padding: 6px; font-size: 12px; }
.map-canvas { width: 100%; height: min(58vh, 620px); min-height: 390px; background: #e7efec; }
.map-empty { padding: 45px 20px; text-align: center; color: var(--muted); background: #fff; }
.nearby-list { display: grid; gap: 0; background: #fff; border-top: 1px solid var(--line); }
.nearby-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #e7ecea; }
.nearby-item a { color: var(--ink); font-weight: 700; text-decoration: none; }
.nearby-item p { color: var(--muted); font-size: 12px; }
.nearby-item span { color: var(--blue); font-size: 12px; font-weight: 700; }

.detail-screen { padding: 0 0 calc(var(--bottom-nav-height) + 26px); background: #f7f9f8; }
.detail-header { padding: 18px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.detail-header h1 { margin-top: 9px; font-size: 21px; }
.original-title-detail {
  max-width: 820px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.original-title-detail summary {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  color: var(--blue);
  cursor: pointer;
  font-weight: 700;
}
.original-title-detail p {
  margin-top: 4px;
  line-height: 1.45;
}
.detail-header .nct { display: inline-block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.detail-body { display: grid; }
.detail-section { padding: 18px 14px; background: #fff; border-bottom: 8px solid #eef2f0; }
.detail-section h2 { margin-bottom: 11px; }
.detail-section p, .detail-section li { font-size: 14px; }
.detail-section .source-language { color: var(--muted); font-size: 11px; }
.detail-grid { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.detail-grid div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail-grid dt { color: var(--muted); font-size: 12px; }
.detail-grid dd { margin: 0; font-size: 13px; }
.facility-list { display: grid; gap: 10px; }
.facility-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facility-row:last-child { border-bottom: 0; }
.facility-row h3 { margin-bottom: 4px; }
.facility-name-link { color: var(--ink); text-decoration: none; }
.facility-name-link:hover { color: var(--green-dark); text-decoration: underline; }
.facility-row p { color: var(--muted); font-size: 12px; }
.facility-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.facility-actions a, .primary-link, .secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #88afa5;
  border-radius: 4px;
  color: var(--green-dark);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.primary-link { color: #fff; background: var(--green); border-color: var(--green); }
.detail-actions { display: grid; gap: 8px; margin-top: 12px; }
.criteria { max-height: 340px; overflow: auto; white-space: pre-wrap; padding: 12px; background: var(--soft); border: 1px solid var(--line); font-size: 12px; }
.notice { padding: 11px; color: #574300; background: var(--amber-soft); border-left: 4px solid #c89b24; font-size: 12px; }

.facility-screen { padding: 0 0 calc(var(--bottom-nav-height) + 26px); background: #f7f9f8; }
.facility-profile { padding: 22px 16px; background: #fff; border-bottom: 8px solid #eef2f0; }
.facility-profile-label { display: flex; align-items: center; gap: 7px; color: var(--green-dark); font-size: 12px; font-weight: 700; }
.facility-profile-label img { width: 20px; height: 20px; }
.facility-profile h1 { max-width: 820px; margin-top: 8px; font-size: 23px; }
.facility-profile > p { margin-top: 8px; color: var(--muted); font-size: 13px; }
.facility-profile-actions { margin-top: 14px; }
.facility-profile-actions a { gap: 6px; }
.facility-profile-actions img { width: 16px; height: 16px; }
.facility-trials-section { padding: 20px 14px 32px; }
.facility-trials-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.facility-trials-heading h2 { margin-top: 2px; font-size: 19px; }
.facility-trials-heading > strong { white-space: nowrap; color: var(--green-dark); font-size: 18px; }
.facility-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.facility-summary > span { padding: 6px 9px; color: #46534e; background: #fff; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; }
.facility-summary strong { color: var(--green-dark); }
.facility-trials-note { max-width: 820px; margin: 12px 0 14px; color: var(--muted); font-size: 12px; }
.facility-trial-list .facility-preview strong { color: var(--green-dark); }

.simple-heading { margin-bottom: 16px; }
.about-content { max-width: 760px; margin: 0 auto; }
.about-content > h1 { margin-bottom: 20px; }
.about-content section { padding: 17px 0; border-bottom: 1px solid var(--line); }
.about-content h2 { margin-bottom: 7px; }
.about-content p { color: #46524d; font-size: 14px; }
.about-content .source-meta p { color: var(--muted); font-size: 11px; }
.text-button { margin-top: 8px; padding: 0; color: var(--blue); background: none; border: 0; text-decoration: underline; cursor: pointer; }

.consent {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--bottom-nav-height) + 12px + env(safe-area-inset-bottom));
  z-index: 40;
  max-width: 680px;
  margin: 0 auto;
  padding: 14px;
  background: #fff;
  border: 1px solid #9faaa6;
  border-radius: 7px;
  box-shadow: 0 12px 36px rgba(23, 34, 31, .2);
}
.consent p { font-size: 12px; }
.consent > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.consent button { min-height: 38px; padding: 7px 12px; color: var(--green-dark); background: #fff; border: 1px solid #91aaa3; border-radius: 4px; cursor: pointer; }
.consent button.primary { color: #fff; background: var(--green); border-color: var(--green); }

@media (min-width: 900px) {
  :root { --bottom-nav-height: 0px; }
  .topbar { position: fixed; left: 0; right: 0; padding: 0 24px; grid-template-columns: 44px minmax(0, 1fr) 44px; }
  main { padding-top: var(--topbar-height); }
  .bottom-nav { top: var(--topbar-height); bottom: auto; left: 0; right: auto; width: 172px; height: calc(100vh - var(--topbar-height)); grid-template-columns: 1fr; grid-template-rows: repeat(5, 52px); align-content: start; padding: 12px; border-top: 0; border-right: 1px solid var(--line); box-shadow: none; background: #f1f5f3; }
  .bottom-nav a { grid-template-columns: 24px minmax(0, 1fr); grid-template-rows: 1fr; justify-items: start; gap: 10px; padding: 0 13px; border-radius: 4px; font-size: 13px; }
  .bottom-nav a.active { color: var(--green-dark); background: #dfeee9; box-shadow: inset 3px 0 var(--green); }
  .screen { margin-left: 172px; padding: 24px 28px 60px; }
  .home-screen { margin-left: 172px; padding: 0 0 60px; }
  .home-intro, .home-section, .home-notice, .home-about { padding-left: max(28px, calc((100% - 1040px) / 2)); padding-right: max(28px, calc((100% - 1040px) / 2)); }
  .home-intro { padding-top: 44px; padding-bottom: 36px; }
  .home-intro h1 { font-size: 36px; }
  .disease-entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .guide-choice-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .guide-actions { position: static; grid-template-columns: 140px 240px; justify-content: end; }
  .search-layout { max-width: 1200px; margin: 0 auto; grid-template-columns: 278px minmax(0, 1fr); align-items: start; }
  .filters { position: sticky; top: calc(var(--topbar-height) + 20px); max-height: calc(100vh - var(--topbar-height) - 40px); overflow: auto; padding-right: 10px; }
  .trial-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-screen { margin-left: 172px; padding: 0; }
  .map-root-filter { grid-template-columns: 90px 320px; }
  .map-canvas { height: calc(100vh - var(--topbar-height) - 131px); }
  .nearby-list { position: absolute; top: calc(var(--topbar-height) + 131px); right: 0; z-index: 5; width: 340px; max-height: calc(100vh - var(--topbar-height) - 131px); overflow: auto; border-left: 1px solid var(--line); box-shadow: -5px 0 16px rgba(23, 48, 40, .08); }
  .detail-screen { margin-left: 172px; }
  .facility-screen { margin-left: 172px; padding: 0 0 60px; }
  .facility-profile, .facility-trials-section { max-width: 1040px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }
  .facility-trial-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-header, .detail-body { max-width: 900px; margin: 0 auto; }
  .detail-body { grid-template-columns: minmax(0, 1fr); }
  .saved-screen .trial-list { max-width: 1000px; }
  .consent { bottom: 18px; }
}

@media (max-width: 420px) {
  .results-toolbar { align-items: flex-end; }
  .results-toolbar select { min-width: 132px; max-width: 47%; }
  .trial-card-link { padding-left: 12px; }
  .detail-grid div { grid-template-columns: 86px minmax(0, 1fr); }
}
