:root {
  --bg: #f6f8fa;
  --card: #fff;
  --text: #1a1a1a;
  --muted: #555;
  --accent: #0b6e99;
  --border: #d8dee4;
}

* { box-sizing: border-box; }

body {
  font-family: "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  margin: 0;
  padding: 1rem 1rem calc(2rem + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body.has-income-sticky {
  padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
}

header, footer { max-width: 720px; margin: 0 auto 1rem; }

h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.sub { color: var(--muted); margin: 0; font-size: 0.9rem; }

.kenshin-bridge-banner {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: #e8f2fa;
  border: 1px solid #b8d4ea;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.journey-hooks {
  list-style: none;
  max-width: 720px;
  margin: 0.65rem auto 0.5rem;
  padding: 0.55rem 0.65rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  background: linear-gradient(180deg, #f8fbfd 0%, #f3f8fc 100%);
  border: 1px solid #d8e8f4;
  border-radius: 8px;
  font-size: 0.72rem;
}

.journey-hook {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.5rem;
  align-items: start;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
}

.journey-hook-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  background: #e8f2fa;
  flex-shrink: 0;
}

.journey-hook-short {
  display: block;
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--accent);
  line-height: 1.3;
}

.journey-hook-label {
  display: block;
  font-size: 0.68rem;
  line-height: 1.35;
}

.journey-hook.is-current {
  border-color: var(--accent);
  background: #e8f2fa;
  color: var(--text);
}

.journey-hook.is-current .journey-hook-index {
  color: #fff;
  background: var(--accent);
}

.journey-hook.is-done {
  border-color: #9fd4b5;
  background: #f3faf6;
}

.journey-hook.is-done .journey-hook-index {
  color: #fff;
  background: #2a7f4c;
}

.journey-hook.is-next {
  border-color: #e6c200;
  background: #fffdf5;
}

.journey-hook.is-next .journey-hook-short {
  color: #a34a1c;
}

.journey-hook-link {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.5rem;
  align-items: start;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.journey-hook-link:hover .journey-hook-short {
  text-decoration: underline;
}

.kenshin-collapsed {
  display: none !important;
}

.kenshin-prefill-edit {
  margin-top: 0.55rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

.kenshin-prefill-edit.hidden {
  display: none;
}

.kenshin-context-card {
  max-width: 720px;
  margin: 0.5rem auto 0.65rem;
  padding: 0.75rem 0.9rem;
  background: linear-gradient(180deg, #eef6fc 0%, #f8fbfd 100%);
  border: 1px solid #b8d4ea;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.5;
}

.context-card-title {
  margin: 0 0 0.5rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
}

.context-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.context-card-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: baseline;
  padding: 0.3rem 0;
  border-bottom: 1px dashed #d8e8f4;
}

.kenshin-disease-locked .disease-selector-title,
.kenshin-disease-locked .disease-selector-lead,
.kenshin-disease-locked .selector-group,
.kenshin-disease-locked .picker-axis-desc,
.kenshin-disease-locked #disease-suggest-list,
.kenshin-disease-locked .disease-fallback {
  display: none !important;
}

.kenshin-disease-locked {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

#input-section.is-collapsed #input-form-wrap {
  display: none;
}

#input-section.is-collapsed #input-collapsed-bar {
  display: flex;
}

.input-collapsed-bar {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.15rem 0;
}

.input-collapsed-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #2d3748;
}

.input-expand-btn {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

.map-first-lead {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.map-first-result-hint {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  line-height: 1.45;
}

.input-advanced-details {
  margin-top: 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  background: #fafbfc;
}

.input-advanced-details[open] {
  padding-bottom: 0.75rem;
}

.input-advanced-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: #2d3748;
}

#input-advanced-wrap {
  margin-top: 0.65rem;
}

#input-quick-wrap button[type="submit"] {
  width: 100%;
  margin-top: 0.15rem;
}

body.map-first-flow #hospitals,
body.map-first-flow #result {
  scroll-margin-top: 0.75rem;
}

body.map-first-flow #consent {
  display: none;
}

.flow-step.hidden {
  display: none;
}

.consent-block {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border-radius: 10px;
}

.consent-block .disclaimer {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.ranking-intro-lead,
.zip-step-lead {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.zip-selected-disease {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  background: #edf2f7;
  border-radius: 8px;
  font-size: 0.9rem;
}

.zip-selected-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

#step-zip form button[type="submit"] {
  width: 100%;
  margin-top: 0.5rem;
}

.sim-nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  padding: 0.55rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.sim-nav-bar.hidden {
  display: none;
}

.sim-nav-back-btn {
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 0.82rem;
  cursor: pointer;
}

.sim-nav-summary {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.disease-compare-bridge {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.disease-compare-action {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.disease-compare-open-btn {
  align-self: flex-start;
  width: 100%;
  max-width: 20rem;
}

.disease-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 0;
}

.disease-sheet-overlay.hidden {
  display: none;
}

.disease-sheet-panel {
  width: min(100%, 480px);
  max-height: min(88vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
}

.disease-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.disease-sheet-header h3 {
  margin: 0;
  font-size: 1rem;
}

.disease-sheet-body {
  overflow-y: auto;
  padding: 0.85rem 1rem 1.25rem;
}

.disease-sheet-current {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  background: #edf2f7;
  border-radius: 8px;
  font-size: 0.88rem;
}

.disease-sheet-current-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.disease-sheet-list .disease-suggest-ranked {
  margin: 0;
}

.disease-sheet-footnote {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
}

body.has-disease-sheet {
  overflow: hidden;
}

@media (min-width: 640px) {
  .disease-sheet-overlay {
    align-items: center;
    padding: 1rem;
  }

  .disease-sheet-panel {
    border-radius: 16px;
    max-height: min(85vh, 680px);
  }
}

.hospital-view-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0.5rem 0 0.65rem;
}

.hospital-view-tab {
  flex: 1;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid #c5d9ea;
  border-radius: 8px;
  background: #f7fafc;
  color: #4a5568;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.hospital-view-tab.is-active {
  background: #ebf4ff;
  border-color: #90b8e0;
  color: var(--accent);
}

.hospital-view-panel.hidden {
  display: none !important;
}

.map-help-fold {
  margin-bottom: 0.45rem;
}

.map-help-fold summary {
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
}

.map-osm-note {
  margin-top: 0.35rem;
  font-size: 0.75rem;
}

.context-card-list li:last-child {
  border-bottom: none;
}

.context-card-list .context-here {
  margin-top: 0.25rem;
  padding-top: 0.45rem;
  border-top: 1px solid #b8d4ea;
  border-bottom: none;
}

.context-card-list .context-here strong {
  color: var(--accent);
}

@media (max-width: 480px) {
  .journey-hooks {
    grid-template-columns: 1fr;
  }
}

.card {
  max-width: 720px;
  margin: 0 auto 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

input, select, button {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  font-size: 1rem;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.check { display: flex; align-items: flex-start; gap: 0.5rem; }
.check input { width: auto; margin-top: 0.2rem; }

.disclaimer { font-size: 0.85rem; color: var(--muted); }
.note, .hint { font-size: 0.85rem; color: var(--muted); display: block; margin-top: 0.25rem; }

.input-field-hint {
  margin: 0.35rem 0 0.85rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  line-height: 1.45;
  border-radius: 6px;
  color: #334155;
}

.input-field-hint--why {
  background: #f4f8fb;
  border-left: 3px solid #7ba7c9;
}

.input-field-hint--change {
  background: #f6faf6;
  border-left: 3px solid #6b9e6b;
  margin-top: 0.2rem;
}

.surgery-panel-inner .input-field-hint {
  margin-bottom: 0.65rem;
}

.hidden { display: none; }

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.stat-row-total {
  font-weight: 600;
  background: #f0f8fc;
  padding: 0.5rem;
  border-radius: 6px;
  border-bottom: none;
  margin-top: 0.25rem;
}

.stat-row-selected {
  background: #fff8e6;
  border-left: 3px solid #e6a800;
  padding-left: 0.35rem;
}

.fixed-cost-note {
  background: #f6f8fa;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
}

.cost-step-title {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 0.5rem;
}

.cost-step-subtitle {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.cost-step-section {
  margin-top: 1rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--border);
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  background: #e8f4fa;
  color: var(--accent);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

#hospital-list { list-style: none; padding: 0; margin: 0; }
#hospital-list li {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

#hospital-list li.section-head {
  border-bottom: none;
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  list-style: none;
}

.navii-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.navii-link::before { content: "↗ "; }

.highlight-box {
  background: #f0f8fc;
  border: 1px solid #b8d9ea;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.highlight-box h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--accent);
}

.highlight-box + .highlight-box { margin-top: 0.75rem; }

.disclaimer-badge {
  display: inline-block;
  margin-top: 0.35rem;
  font-weight: 600;
}

.highlight-lead {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.highlight-rank-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.highlight-rank-card {
  background: #fff;
  border: 1px solid #d4e8f2;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
}

.highlight-rank-badge {
  display: inline-block;
  margin: 0 0 0.35rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.highlight-rank-name {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.highlight-section-note {
  margin: 0.65rem 0 0;
}

/* --- Summary hero & visuals --- */
.summary-hero {
  background: linear-gradient(135deg, #f0f8fc 0%, #fff 100%);
  border: 1px solid #b8d9ea;
  border-radius: 12px;
  padding: 1.25rem 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.summary-hero-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.summary-hero-sub {
  font-size: 0.82rem;
  color: #4a5568;
  margin: 0 0 0.85rem;
}

.care-cost-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.5rem 0 0.75rem;
  text-align: left;
}

.care-cost-card {
  padding: 0.75rem 0.65rem;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  background: #fff;
}

.care-cost-inpatient {
  border-color: #4299e1;
  background: #f7fbff;
}

.care-cost-outpatient {
  border-color: #48bb78;
  background: #f0fff4;
}

.care-cost-tag {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4a5568;
}

.care-cost-amount {
  margin: 0.35rem 0 0.15rem;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.care-cost-outpatient .care-cost-amount {
  color: #2f855a;
}

.care-cost-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.45;
}

.care-cost-combined {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.95rem;
  color: #2d3748;
}

.care-cost-combined strong {
  font-size: 1.15rem;
  color: var(--accent);
}

.surgery-delta-chip {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #744210;
  background: #fef3c7;
  vertical-align: middle;
}

.care-cost-note-fold,
.surgery-impact-note-fold {
  margin: 0.35rem 0 0.5rem;
  text-align: left;
}

.care-cost-note-fold > summary,
.surgery-impact-note-fold > summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted);
  list-style: none;
}

.care-cost-note-fold > summary::-webkit-details-marker,
.surgery-impact-note-fold > summary::-webkit-details-marker {
  display: none;
}

.care-cost-note {
  margin: 0 0 0.75rem;
  text-align: left;
  font-size: 0.78rem;
}

.summary-hero-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0.15rem 0;
  line-height: 1.2;
  transition: color 0.2s;
}

.summary-hero-range {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0.5rem 0 0.75rem;
}

.summary-hero-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.summary-compare-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.compare-pill {
  flex: 1 1 140px;
  max-width: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
}

.compare-pill strong {
  display: block;
  font-size: 1rem;
  color: var(--accent);
  margin-top: 0.15rem;
}

.compare-pill.is-selected {
  border-color: #e6a800;
  background: #fff8e6;
}

.cost-bar-wrap {
  margin: 0.75rem 0 0.25rem;
  text-align: left;
}

.cost-bar {
  display: flex;
  height: 1.25rem;
  border-radius: 6px;
  overflow: hidden;
  background: #eee;
}

.cost-bar-seg {
  min-width: 2px;
  transition: width 0.35s ease-in-out;
}

.cost-bar-seg.medical { background: #3b82c4; }
.cost-bar-seg.meal { background: #3d9e6a; }
.cost-bar-seg.bed { background: #e67e22; }

.room-segment {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin: 1rem 0 0.65rem;
}

.room-segment--ranked {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.75rem 0 0.65rem;
}

.room-segment-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 0.25rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.room-segment-btn--ranked {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  padding: 0.55rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  font-size: 0.78rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.room-segment-btn--ranked:hover {
  border-color: #9cc5db;
  box-shadow: 0 2px 8px rgba(0, 60, 90, 0.06);
}

.room-segment-btn--ranked.is-active {
  border-color: var(--accent);
  background: #f0f8fc;
  box-shadow: 0 0 0 1px var(--accent);
  font-weight: 600;
}

.room-segment-rank {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

.room-segment-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  align-items: center;
}

.room-segment-btn--ranked .room-segment-label {
  font-size: 0.8rem;
  line-height: 1.25;
}

.room-segment-btn--ranked .room-segment-meta {
  font-size: 0.65rem;
}

.room-segment-btn--ranked .room-segment-badge {
  margin-top: 0.1rem;
  font-size: 0.62rem;
  padding: 0.12rem 0.35rem;
}

.room-segment-meta {
  font-size: 0.7rem;
  color: var(--muted);
}

.room-segment-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #fff0e8;
  color: #c45a00;
  white-space: nowrap;
}

.room-segment-btn--ranked.is-active .room-segment-badge {
  background: #ffe8d6;
  font-weight: 700;
}

.room-segment-btn:hover {
  border-color: #9cc5db;
  background: #fafcfe;
}

.room-segment-btn.is-active {
  border-color: var(--accent);
  background: #f0f8fc;
  font-weight: 600;
}

.room-segment-btn.is-active .room-segment-fee {
  color: #c45a00;
  font-weight: 700;
}

.room-segment-label { font-weight: 600; }

.room-segment-fee {
  font-size: 0.68rem;
  color: var(--muted);
}

.summary-hero-diff {
  font-size: 0.82rem;
  color: #c45a00;
  margin-top: 0.35rem;
  min-height: 1.25rem;
}

.cost-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.cost-bar-legend span::before {
  content: "";
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.legend-medical::before { background: #3b82c4; }
.legend-meal::before { background: #3d9e6a; }
.legend-bed::before { background: #e67e22; }

/* Timeline */
.timeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 1rem 0;
  overflow-x: visible;
  padding-bottom: 0.25rem;
}

.timeline--fit {
  gap: 0.25rem;
}

.timeline-step {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  position: relative;
  padding: 0 0.2rem;
}

.timeline-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -0.5rem;
  top: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-box {
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.3rem;
  font-size: 0.74rem;
  min-height: 4.25rem;
}

.timeline-step.is-active .timeline-box {
  background: #f0f8fc;
  border-color: var(--accent);
}

.timeline-num {
  display: inline-block;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.timeline-days {
  font-weight: 600;
  font-size: 0.82rem;
  margin-top: 0.25rem;
}

.timeline-cost {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.timeline-title {
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.3;
}

.timeline-subtitle {
  font-size: 0.68rem;
  color: var(--muted, #64748b);
  margin-top: 0.12rem;
  line-height: 1.3;
}

.misc-expense-note {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted, #64748b);
  background: rgba(100, 116, 139, 0.08);
  border-radius: 8px;
  text-align: left;
}

.misc-expense-icon {
  margin-right: 0.25rem;
  font-weight: 700;
}

.timeline-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

/* Accordion */
.accordion {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.65rem;
  overflow: hidden;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #fafbfc;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.accordion-trigger:hover { background: #f0f4f8; }

.accordion-icon {
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.accordion-panel {
  display: none;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.accordion-panel.open { display: block; }

/* Nearby hospital map (Leaflet + OpenStreetMap) */
.hospital-map-wrap { margin-bottom: 1rem; }

.hospitals-map-lead { margin-bottom: 0.5rem; }

.hospital-map {
  height: 280px;
  min-height: 280px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #e8eef2;
  z-index: 0;
  overflow: hidden;
}

.hospital-map .leaflet-container {
  height: 100%;
  width: 100%;
  border-radius: 8px;
}

.hospital-map-legend {
  margin: 0.65rem 0 0;
  padding-left: 0;
  list-style: none;
  font-size: 0.85rem;
  line-height: 1.5;
}

.hospital-map-legend li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.2rem;
}

.hospital-map-legend-home {
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.hospital-map-legend-note {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.hospital-map-legend-btn {
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin: 0;
  padding: 0.3rem 0.35rem;
  text-align: left;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.hospital-map-legend-btn:hover,
.hospital-map-legend-btn:focus-visible {
  background: #eef4fa;
  color: var(--primary, #1a6fb5);
  outline: none;
}

.map-popup-actions {
  margin: 0.55rem 0 0;
}

.leaflet-popup-content .btn-map-trial {
  width: 100%;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  white-space: normal;
  line-height: 1.35;
}

.leaflet-popup-content {
  margin: 10px 12px;
  line-height: 1.45;
  min-width: 180px;
}

.leaflet-div-icon {
  background: transparent;
  border: none;
}

.map-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.map-pin-home {
  background: var(--accent);
  color: #fff;
  width: 28px !important;
  height: 28px !important;
  font-size: 1rem;
}

.map-pin-hospital {
  color: #fff;
  width: 26px !important;
  height: 26px !important;
}

.map-pin-hospital--a { background: #2563eb; }
.map-pin-hospital--b { background: #059669; }
.map-pin-hospital--c { background: #7c3aed; }
.map-pin-hospital--d { background: #ea580c; }
.map-pin-hospital--e { background: #db2777; }

.map-pin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1;
  color: #fff;
  vertical-align: middle;
}

.map-pin-badge--a { background: #2563eb; }
.map-pin-badge--b { background: #059669; }
.map-pin-badge--c { background: #7c3aed; }
.map-pin-badge--d { background: #ea580c; }
.map-pin-badge--e { background: #db2777; }

.leaflet-container { font-family: inherit; }

/* Hospital mini cards */
.hospital-grid { list-style: none; padding: 0; margin: 0; }

.hospital-grid .section-head {
  grid-column: 1 / -1;
  border: none;
  padding: 1rem 0 0.35rem;
}

.hospital-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.hospital-card-mini {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: #fff;
}

.hospital-card-mini h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  line-height: 1.35;
}

.hospital-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.hospital-cost-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.hospital-cost-chip {
  flex: 1 1 7rem;
  background: #f6f8fa;
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
  font-size: 0.78rem;
}

.income-nudge-chip {
  text-decoration: none;
  color: inherit;
  border: 1px dashed #c5d9ea;
  background: #f0f6fb;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.income-nudge-chip:hover {
  background: #e8f2fa;
  border-color: var(--accent);
}

.income-nudge-chip strong {
  color: #2a7f4c;
  font-size: 0.82rem;
}

.income-nudge-inline {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
}

.income-nudge-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed #9ec5de;
}

.income-nudge-link:hover {
  border-bottom-color: var(--accent);
}

.income-loss-bar {
  margin: 0.75rem 0 0.5rem;
}

.income-nudge-card,
.income-nudge-compact {
  padding: 0.75rem 0.9rem;
  background: linear-gradient(180deg, #fff8f3 0%, #fffdf8 100%);
  border: 1px solid #e8c9b0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(26, 26, 26, 0.05);
}

.income-nudge-compact {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.income-nudge-card-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: #a34a1c;
}

.income-nudge-card-body,
.income-nudge-compact-text {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
}

.income-nudge-compact-text {
  margin: 0;
}

.income-nudge-btn,
.drawer-income-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  width: 100%;
}

.income-nudge-drawer {
  margin: 0.75rem 0 0.35rem;
  padding: 0.45rem 0.55rem;
  background: #fff8f3;
  border-left: 3px solid #e8c9b0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.drawer-consult .drawer-income-btn {
  margin-bottom: 0.5rem;
}

.income-sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
}

.income-sticky-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.income-sticky-lead {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}

.income-sticky-btn {
  width: 100%;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
}

.income-sticky-btn .btn-hint {
  color: rgba(255, 255, 255, 0.9);
}

@media (min-width: 721px) {
  .income-sticky-bar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    max-width: 720px;
    border-radius: 10px 10px 0 0;
  }
}

.hospital-cost-chip strong {
  display: block;
  font-size: 0.95rem;
  color: var(--accent);
  margin-top: 0.1rem;
}

.btn-secondary {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.5rem;
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-secondary:hover { background: #f0f8fc; }

.btn-primary {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.55rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover { opacity: 0.92; }

.hospital-performance-block {
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.65rem;
  background: #f0f8ff;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
}

.hospital-stat-head {
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.hospital-stat-head strong {
  font-size: 1.2rem;
  color: var(--accent);
}

.alos-compare {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.5rem;
  background: #fafbfc;
  border-radius: 8px;
}

.alos-compare-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr 2.5rem;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
}

.alos-compare-label { color: var(--muted); }

.alos-compare-track {
  height: 0.55rem;
  background: #e8ecef;
  border-radius: 4px;
  overflow: hidden;
}

.alos-compare-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.alos-compare-fill.is-national { background: #9aa5b1; }

.alos-compare-days {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.alos-compare-note {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.alos-compare-note.is-shorter { color: #0d9b7a; }
.alos-compare-note.is-longer { color: #c45a00; }

.bed-fee-formula {
  margin: 0.65rem 0 0;
  padding: 0.5rem 0.65rem;
  background: #fff8f0;
  border-radius: 6px;
  font-size: 0.88rem;
  text-align: center;
}

.bed-fee-formula strong { color: #c45a00; }

.summary-hospital-banner {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f0f8fc;
  border-radius: 6px;
  font-size: 0.85rem;
}

.card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.highlight-mini {
  background: #f0f8fc;
  border: 1px solid #b8d9ea;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.highlight-mini h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  color: var(--accent);
}

/* Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

.drawer-overlay.hidden { display: none; }

.drawer-panel {
  width: min(100%, 420px);
  max-height: 100vh;
  overflow-y: auto;
  background: var(--card);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}

.drawer-header h3 { margin: 0; font-size: 1rem; }

.drawer-close {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: #f0f4f8;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.drawer-content {
  padding: 1rem 1.25rem 1.5rem;
  font-size: 0.88rem;
}

/* --- 疾患サジェスト --- */
.disease-selector {
  margin: 0.5rem 0 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 12px;
}

.disease-selector-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.disease-selector-lead {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
}

.selector-group {
  margin-bottom: 0.65rem;
}

.selector-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.picker-segment {
  display: grid;
  gap: 0.35rem;
}

.picker-segment-2 {
  grid-template-columns: 1fr 1fr;
}

.picker-segment-wrap {
  grid-template-columns: repeat(5, 1fr);
}

.picker-segment-btn {
  padding: 0.45rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.picker-segment-btn:hover {
  border-color: #9cc5db;
  background: #fafcfe;
}

.picker-segment-btn.is-active {
  border-color: var(--accent);
  background: #f0f8fc;
  font-weight: 600;
  color: var(--accent-dark, #0a6e8c);
}

.picker-axis-desc {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.disease-suggest-list {
  margin: 0;
  padding: 0;
}

.disease-suggest-ranked {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.disease-suggest-item {
  margin: 0;
}

.disease-suggest-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.disease-suggest-btn:hover:not(:disabled) {
  border-color: #9cc5db;
  box-shadow: 0 2px 8px rgba(0, 60, 90, 0.06);
}

.disease-suggest-btn.is-selected {
  border-color: var(--accent);
  background: #f0f8fc;
  box-shadow: 0 0 0 1px var(--accent);
}

.disease-suggest-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.disease-suggest-rank {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.disease-suggest-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.disease-suggest-meta {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.disease-suggest-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #eef2f6;
  color: var(--muted);
  white-space: nowrap;
}

.disease-suggest-badge.is-high {
  background: #fff0e8;
  color: #c45a00;
}

.disease-suggest-badge.is-kenshin {
  background: #e8f4fc;
  color: #1a5f8a;
}

.disease-suggest-badge.is-planned {
  background: #f3f4f6;
  color: #6b7280;
}

.disease-fallback {
  margin-top: 0.85rem;
  font-size: 0.82rem;
}

.disease-fallback summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.disease-fallback label {
  display: block;
  margin-top: 0.5rem;
}

.next-steps-panel {
  padding: 0.85rem 0.95rem;
  background: linear-gradient(180deg, #eef6fc 0%, #f8fbfd 100%);
  border: 1px solid #b8d4ea;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(26, 26, 26, 0.06);
}

.next-steps-intro,
.next-steps-lead {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 0.75rem;
}

.cv-microcopy {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.cv-microcopy li::before {
  content: "✓ ";
  color: #2a8f5c;
}

.cv-btn {
  display: inline-block;
  width: 100%;
  max-width: 360px;
  text-align: center;
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.cv-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.cv-stub-note {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.8rem;
}

.next-steps-kenshin {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}

.next-kenshin-btn {
  text-decoration: none;
}

.next-kenshin-btn.btn-with-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.55rem 0.85rem;
}

.next-kenshin-btn .btn-hint {
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.85;
}

.next-kenshin-income.btn-primary {
  display: inline-flex;
  width: 100%;
  align-items: center;
  text-align: center;
  background: #c45c26;
  border: 1px solid #a34a1c;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
}

.next-kenshin-income.btn-primary .btn-hint {
  color: rgba(255, 255, 255, 0.9);
  opacity: 1;
}

.btn-with-hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  text-align: center;
  line-height: 1.35;
}

.btn-with-hint .btn-label {
  font-weight: 600;
}

.btn-with-hint .btn-hint {
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.88;
}

.drawer-consult {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.drawer-consult-btn {
  width: 100%;
  margin-top: 0.5rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

@media (max-width: 640px) {
  body {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  .card {
    padding: 1rem 0.85rem;
  }

  h1 {
    font-size: 1.35rem;
  }

  .journey-hooks {
    grid-template-columns: 1fr;
    font-size: 0.78rem;
  }

  .journey-hook-short,
  .journey-hook-label {
    font-size: 0.74rem;
  }

  button,
  .btn-primary,
  .btn-secondary,
  .disease-suggest-btn,
  .picker-segment-btn,
  .room-segment-btn,
  .surgery-compare-card,
  .hospital-map-legend-btn,
  .cv-btn,
  .next-kenshin-btn {
    min-height: 2.75rem;
    touch-action: manipulation;
  }

  .check input {
    width: 1.15rem;
    height: 1.15rem;
    min-width: 1.15rem;
    margin-top: 0.15rem;
  }

  input,
  select {
    min-height: 2.75rem;
    font-size: 16px;
  }

  #submit {
    min-height: 3rem;
    font-size: 1.02rem;
    font-weight: 600;
  }

  .picker-segment-wrap {
    grid-template-columns: repeat(3, 1fr);
  }

  .picker-segment-btn {
    padding: 0.55rem 0.35rem;
    font-size: 0.78rem;
  }

  .disease-suggest-btn {
    grid-template-columns: 2rem 1fr;
    grid-template-rows: auto auto;
    padding: 0.75rem 0.85rem;
  }

  .disease-suggest-badge {
    grid-column: 2;
    justify-self: start;
    margin-top: 0.15rem;
    white-space: normal;
  }

  .disease-suggest-name {
    font-size: 0.92rem;
  }

  .hospital-map {
    height: 300px;
    min-height: 300px;
  }

  .hospitals-map-lead {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .hospital-map-legend {
    font-size: 0.88rem;
  }

  .hospital-map-legend-btn {
    padding: 0.55rem 0.45rem;
  }

  .map-pin-hospital {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem;
  }

  .map-pin-home {
    width: 34px !important;
    height: 34px !important;
  }

  .leaflet-popup-content {
    min-width: 200px;
    font-size: 0.92rem;
  }

  .leaflet-popup-content .btn-map-trial {
    min-height: 2.75rem;
    font-size: 0.88rem;
  }

  .leaflet-popup-close-button {
    width: 2rem;
    height: 2rem;
    font: 700 1.35rem/2rem sans-serif;
  }

  .hospital-grid {
    grid-template-columns: 1fr;
  }

  .hospital-cost-row {
    flex-direction: column;
  }

  .hospital-cost-chip {
    flex: 1 1 auto;
    padding: 0.6rem 0.65rem;
    font-size: 0.82rem;
  }

  .hospital-cost-chip strong {
    font-size: 1.08rem;
  }

  .card-actions {
    gap: 0.5rem;
  }

  .summary-hero {
    padding: 1rem 0.75rem;
  }

  .summary-hero-amount {
    font-size: 1.85rem;
  }

  .summary-compare-pills {
    flex-direction: column;
    align-items: stretch;
  }

  .compare-pill {
    flex: 1 1 auto;
    max-width: none;
  }

  .stat-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.5rem 0;
  }

  .stat-row span:last-child {
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  .stat-row-total span:last-child {
    font-size: 1.08rem;
  }

  .summary-hospital-banner {
    font-size: 0.88rem;
    padding: 0.65rem 0.75rem;
  }

  .alos-compare-row {
    grid-template-columns: 3.5rem 1fr 2.25rem;
    font-size: 0.76rem;
  }

  .drawer-overlay {
    align-items: flex-end;
  }

  .drawer-panel {
    width: 100%;
    max-height: min(92vh, 100dvh);
    border-radius: 14px 14px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .drawer-close {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.5rem;
  }

  .drawer-header h3 {
    font-size: 0.95rem;
    line-height: 1.35;
    padding-right: 0.5rem;
  }

  .next-steps-kenshin {
    flex-direction: column;
  }

  .next-kenshin-btn,
  .next-kenshin-income.btn-primary {
    width: 100%;
    max-width: none;
  }

  .income-sticky-lead {
    font-size: 0.8rem;
  }

  .income-sticky-btn {
    min-height: 3rem;
    padding: 0.65rem 0.85rem;
  }
}

@media (max-width: 480px) {
  .summary-hero-amount { font-size: 1.65rem; }
  .timeline-step { min-width: 0; }
  .timeline-step:not(:last-child)::after { font-size: 0.75rem; right: -0.35rem; }
  .timeline-box { font-size: 0.7rem; padding: 0.45rem 0.25rem; }
  .timeline-title { font-size: 0.74rem; }
  .timeline-subtitle { font-size: 0.64rem; }
  .room-segment:not(.room-segment--ranked) { grid-template-columns: repeat(2, 1fr); }
  .room-segment--ranked { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .picker-segment-wrap { grid-template-columns: repeat(2, 1fr); }
  .picker-segment-2 { grid-template-columns: 1fr; }
  .surgery-compare-grid { grid-template-columns: 1fr; }
  .surgery-impact-grid {
    grid-template-columns: 1fr 1fr;
  }
  .surgery-impact-bridge {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.35rem 0;
    border-top: 1px dashed #e2e8f0;
    border-bottom: 1px dashed #e2e8f0;
  }
  .care-cost-dual { grid-template-columns: 1fr; }
  .care-cost-amount { font-size: 1.3rem; }
  .hospitals-lead { font-size: 0.82rem; line-height: 1.55; }
}

/* 手術・処置シナリオ（DPC全国統計） */
.surgery-panel-wrap {
  margin: 1rem 0 0.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid #d8e4f0;
  border-radius: 10px;
  background: #f7fafc;
}
.surgery-panel-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
}
.surgery-panel-stat {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.5;
}
.surgery-scenario-field {
  border: none;
  margin: 0;
  padding: 0;
}
.surgery-scenario-field legend {
  font-size: 0.82rem;
  color: #4a5568;
  margin-bottom: 0.35rem;
}
.surgery-scenario-opt {
  display: block;
  margin: 0.3rem 0;
  font-size: 0.86rem;
  cursor: pointer;
}

.surgery-scenario-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.surgery-scenario-btn.is-active {
  border-color: var(--accent);
  background: #f0f8fc;
  box-shadow: 0 0 0 1px var(--accent);
}

.surgery-scenario-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #2d3748;
}

.surgery-scenario-btn.is-active .surgery-scenario-name {
  color: var(--accent);
}

.surgery-scenario-pct {
  font-size: 0.82rem;
  color: var(--muted);
}

.surgery-scenario-btn.is-active .surgery-scenario-pct {
  color: #2c5282;
  font-weight: 600;
}

.surgery-scenario-days {
  font-size: 0.78rem;
  color: #718096;
}

.surgery-scenario-fallback {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.surgery-stat-badge,
.surgery-scenario-badge {
  background: #e8f2fb;
  color: #2c5282;
  font-size: 0.72rem;
}
.hospital-coeff-chip {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}
.surgery-stat-line {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.86rem;
  line-height: 1.5;
}
.surgery-compare-wrap {
  margin: 0.85rem 0 0.25rem;
  text-align: left;
}
.surgery-compare-wrap .cost-step-subtitle {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
}
.surgery-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.surgery-compare-card {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  font: inherit;
  color: inherit;
}
.surgery-compare-card:hover {
  border-color: #90cdf4;
  box-shadow: 0 2px 8px rgba(44, 82, 130, 0.08);
}
.surgery-compare-card.is-active {
  border-color: #4299e1;
  box-shadow: 0 0 0 1px #4299e1;
  background: #f7fbff;
}
.surgery-compare-hint {
  font-weight: normal;
  color: #718096;
  font-size: 0.78rem;
}
.surgery-compare-action {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: #3182ce;
  font-weight: 600;
}
.surgery-compare-card.is-active .surgery-compare-action {
  color: #2c5282;
}
.surgery-compare-label {
  margin: 0;
  font-size: 0.78rem;
  color: #4a5568;
}
.surgery-compare-pct,
.surgery-compare-days {
  margin: 0.15rem 0 0;
  font-size: 0.76rem;
  color: #718096;
}
.surgery-compare-amount {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: #2d3748;
}

.surgery-impact-panel {
  margin: 0.75rem 0 0.35rem;
  padding: 0.75rem 0.65rem;
  border: 1px solid #cbd5e0;
  border-radius: 10px;
  background: #fff;
  text-align: left;
}

.surgery-impact-panel .cost-step-subtitle {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  text-align: center;
}

.surgery-impact-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.45rem;
  align-items: stretch;
}

.surgery-impact-col {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #fafafa;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.surgery-impact-col.is-active {
  border-color: #4299e1;
  background: #f7fbff;
  box-shadow: 0 0 0 1px #4299e1;
}

.surgery-impact-head {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: #2d3748;
  line-height: 1.35;
}

.surgery-impact-head small {
  display: block;
  font-weight: 500;
  color: #718096;
  font-size: 0.68rem;
}

.surgery-impact-days {
  margin: 0.2rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
}

.surgery-impact-rows {
  margin: 0;
}

.surgery-impact-rows div {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  margin: 0.12rem 0;
  font-size: 0.72rem;
}

.surgery-impact-rows dt {
  margin: 0;
  color: #718096;
}

.surgery-impact-rows dd {
  margin: 0;
  font-weight: 700;
  color: #2d3748;
}

.surgery-impact-total dd {
  color: var(--accent);
  font-size: 0.82rem;
}

.surgery-impact-action {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #3182ce;
  text-align: center;
}

.surgery-impact-bridge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem 0.15rem;
  min-width: 3.4rem;
}

.surgery-impact-bridge-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #718096;
}

.surgery-impact-bridge-item {
  margin: 0;
  text-align: center;
  line-height: 1.25;
}

.surgery-impact-bridge-item small {
  display: block;
  font-size: 0.62rem;
  color: #a0aec0;
}

.surgery-impact-bridge-item strong {
  font-size: 0.72rem;
  color: #744210;
}

.surgery-impact-bridge-total strong {
  font-size: 0.82rem;
  color: #c05621;
}

.surgery-impact-reason {
  margin: 0.55rem 0 0.35rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #4a5568;
  text-align: center;
}

/* 手術あり/なし — コンパクト2ボタン */
.surgery-toggle-panel {
  margin: 0.55rem 0 0.35rem;
  padding: 0.55rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fafbfc;
  text-align: center;
}

.surgery-toggle-label {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4a5568;
}

.surgery-toggle-label small {
  font-weight: 400;
  color: #718096;
}

.surgery-toggle-stat {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  color: #4a5568;
  line-height: 1.35;
}

.surgery-toggle-stat strong {
  font-weight: 700;
  color: #2d3748;
}

.surgery-toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.surgery-toggle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  margin: 0;
  padding: 0.45rem 0.35rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.surgery-toggle-btn.is-active {
  border-color: #4299e1;
  background: #f7fbff;
  box-shadow: 0 0 0 1px #4299e1;
}

.surgery-toggle-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #718096;
}

.surgery-toggle-btn.is-active .surgery-toggle-name {
  color: #2c5282;
}

.surgery-toggle-pct {
  font-size: 0.68rem;
  font-weight: 600;
  color: #805ad5;
  line-height: 1.1;
}

.surgery-toggle-btn.is-active .surgery-toggle-pct {
  color: #553c9a;
}

.surgery-toggle-amt {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.surgery-toggle-sub {
  font-size: 0.65rem;
  color: #a0aec0;
  white-space: nowrap;
}

.surgery-toggle-delta {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: #744210;
}

.surgery-toggle-note {
  margin-top: 0.35rem;
  text-align: left;
}

.surgery-toggle-note > summary {
  cursor: pointer;
  font-size: 0.68rem;
  color: var(--muted);
  list-style: none;
}

.surgery-toggle-note > summary::-webkit-details-marker {
  display: none;
}

.care-cost-combined {
  margin: 0.35rem 0 0.25rem;
  font-size: 1rem;
  text-align: center;
}

.care-cost-combined strong {
  font-size: 1.25rem;
  color: var(--accent);
}

.long-stay-kogaku-panel {
  margin: 0.65rem 0 0.35rem;
  padding: 0.75rem 0.65rem;
  border: 1px solid #d6bcfa;
  border-radius: 10px;
  background: #faf5ff;
  text-align: left;
}

.long-stay-kogaku-title {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: #553c9a;
  text-align: center;
}

.long-stay-cap-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.45rem;
}

.long-stay-cap-col {
  padding: 0.45rem 0.4rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e9d8fd;
  text-align: center;
}

.long-stay-cap-col--after {
  border-color: #b794f4;
  background: #f3e8ff;
}

.long-stay-cap-label {
  margin: 0;
  font-size: 0.68rem;
  color: #718096;
}

.long-stay-cap-value {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2d3748;
}

.long-stay-cap-value small {
  font-size: 0.68rem;
  font-weight: 500;
}

.long-stay-cap-delta {
  margin: 0.1rem 0 0;
  font-size: 0.68rem;
  color: #6b46c1;
  font-weight: 600;
}

.long-stay-cap-arrow {
  font-size: 0.85rem;
  color: #9f7aea;
  font-weight: 700;
}

.long-stay-status,
.long-stay-savings {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #4a5568;
  text-align: center;
}

.long-stay-note-fold {
  margin-top: 0.35rem;
}

.long-stay-note-fold > summary {
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--muted);
  list-style: none;
}

.long-stay-note-fold > summary::-webkit-details-marker {
  display: none;
}

/* 横スワイプカルーセル（入院ツール共通） */
.ui-carousel-wrap {
  position: relative;
  margin: 0 -0.25rem 0.5rem;
}

.ui-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.25rem 0.25rem 0.65rem;
}

.ui-carousel::-webkit-scrollbar {
  display: none;
}

.ui-carousel-slide {
  flex: 0 0 88%;
  max-width: 340px;
  scroll-snap-align: center;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: #fff;
  box-shadow: 0 2px 8px rgba(44, 82, 130, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ui-carousel-slide.is-active {
  transform: scale(1.01);
  box-shadow: 0 4px 14px rgba(44, 82, 130, 0.12);
  border-color: #11caa0;
}

.ui-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.15rem 0 0.5rem;
}

.ui-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #cbd5e0;
  cursor: pointer;
}

.ui-carousel-dot.is-active {
  background: #11caa0;
  transform: scale(1.25);
}

.ui-carousel-hint {
  margin: 0 0 0.5rem;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
}

.ui-carousel-heading {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: #4a5568;
  font-weight: 600;
}

.ui-carousel-section--room .room-carousel-card,
.ui-carousel-section--surgery .surgery-carousel-card,
.ui-carousel-section--surgery-scenario .surgery-scenario-slide {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0.25rem;
}

.ui-carousel-section--room .room-segment-btn,
.ui-carousel-section--surgery .surgery-toggle-btn,
.ui-carousel-section--surgery-scenario .surgery-scenario-btn {
  width: 100%;
}

.ui-carousel-section--disease .disease-suggest-carousel-card {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.ui-carousel-section--disease .disease-suggest-btn {
  width: 100%;
}

.ui-carousel--timeline {
  gap: 10px;
}

.ui-carousel--timeline .timeline-step {
  flex: 0 0 85%;
  max-width: 300px;
  scroll-snap-align: center;
  min-width: auto;
}

.ui-carousel-wrap--timeline .timeline-step:not(:last-child)::after {
  display: none;
}

/* ミニキャラ＋セリフ（画面ガイド） */
.scene-guide {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  background: #fafbfd;
  border: 1px solid #e8edf2;
  border-radius: 12px;
}

.scene-guide--bridge {
  background: #f0f7fc;
  border-color: #c5deef;
}

.scene-guide-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  background: #fff5f2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.scene-guide--fp .scene-guide-icon {
  background: #fce4ec;
}

.scene-guide-bubble {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  flex: 1;
  min-width: 0;
}

.scene-guide-name {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted, #64748b);
  margin-bottom: 0.15rem;
}

.scene-guide--hero .scene-guide-text {
  display: block;
  border-left: 3px solid #ffb4a2;
  padding-left: 0.5rem;
}

.scene-guide--fp .scene-guide-text {
  display: block;
  border-left: 3px solid #7eb8e8;
  padding-left: 0.5rem;
}

@media (max-width: 480px) {
  .scene-guide-icon {
    width: 48px;
    height: 48px;
  }
  .scene-guide-bubble {
    font-size: 0.8rem;
  }
}

.disease-suggest-fallback {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tool-faq {
  max-width: 960px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.tool-faq-title {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.tool-faq-item {
  margin-bottom: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: #fff;
}

.tool-faq-item summary {
  cursor: pointer;
  font-weight: 600;
}

.tool-faq-answer {
  margin: 0.5rem 0 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.55;
}

.source-citation-note {
  font-size: 0.85rem;
  line-height: 1.5;
}
