:root {
  color-scheme: light;
  --blue: #1f66d1;
  --blue-strong: #1555ba;
  --navy: #14355f;
  --mint: #75d5c0;
  --surface: #ffffff;
  --background: #f6f8fb;
  --line: #d8e1ec;
  --muted: #637389;
  --soft-blue: #edf4ff;
  --shadow: 0 20px 55px rgba(20, 53, 95, .14);
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; background: var(--background); color: #17283f; }
button, input { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.hybrid-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(250px, 320px) minmax(440px, 600px) minmax(270px, 360px); justify-content: center; background: #eef3f9; }

.category-rail, .context-panel { min-height: 100vh; background: rgba(255,255,255,.92); }
.category-rail { display: flex; flex-direction: column; padding: 26px 22px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 50px; height: 50px; border-radius: 8px; }
.brand span { display: grid; gap: 2px; }
.brand strong { color: var(--navy); font-size: 22px; }
.brand small { color: var(--muted); font-size: 12px; }
.rail-heading { margin: 42px 4px 20px; }
.rail-heading span, .context-head span { color: var(--blue); font-weight: 800; font-size: 13px; }
.rail-heading strong { display: block; margin-top: 8px; color: var(--navy); font-size: 24px; line-height: 1.35; }
.category-list { display: grid; gap: 5px; }
.category-button { min-height: 54px; display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 11px; border: 0; border-left: 3px solid transparent; background: transparent; color: #44556b; text-align: left; padding: 0 12px; }
.category-button svg { width: 20px; height: 20px; }
.category-button b { font-size: 11px; color: #6f7e91; background: #edf1f7; padding: 4px 7px; border-radius: 8px; }
.category-button:hover, .category-button.is-active { color: var(--blue); border-left-color: var(--blue); background: var(--soft-blue); font-weight: 800; }
.rail-footer { display: grid; gap: 12px; margin-top: auto; padding-top: 28px; border-top: 1px solid var(--line); }
.rail-footer a { display: flex; align-items: center; gap: 9px; color: #51647b; text-decoration: none; font-size: 13px; font-weight: 700; }
.rail-footer svg { width: 17px; }

.app-stage { min-width: 0; padding: 18px 24px; background: #e8edf4; }
.app-frame { position: relative; width: 100%; min-width: 0; display: flex; flex-direction: column; min-height: calc(100vh - 36px); overflow: hidden; background: var(--surface); border: 1px solid #cfd9e6; border-radius: 8px; box-shadow: var(--shadow); }
.app-frame > :not(.exact-app-copy):not(.explorer-copy) { display: none; }
.exact-app-copy { height: calc(100vh - 38px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b8c7dc transparent; background: #f6f8fb; }
.exact-app-copy img { display: block; width: 100%; height: auto; }
.explorer-copy { display: none; width: 100%; height: calc(100vh - 38px); border: 0; background: white; }
.app-frame.is-explorer .exact-app-copy { display: none; }
.app-frame.is-explorer .explorer-copy { display: block; }
.app-header { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid #e5ebf3; }
.app-brand { display: flex; align-items: center; gap: 10px; }
.app-brand img { width: 42px; height: 42px; border-radius: 8px; }
.app-brand div { display: grid; }
.app-brand strong { color: var(--navy); font-size: 20px; }
.app-brand span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.header-actions { display: flex; gap: 5px; }
.header-actions button, .map-toolbar button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: transparent; color: var(--navy); }
.header-actions svg { width: 21px; }
.location-strip { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; color: #40546c; background: #f8fbff; }
.location-strip span { min-width: 0; display: flex; align-items: center; gap: 7px; }
.location-strip svg { width: 16px; color: var(--blue); }
.location-strip small { white-space: nowrap; color: #77869a; }
.search-bar { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; margin: 12px 16px 8px; border: 1px solid #cbd7e6; border-radius: 8px; padding-left: 13px; background: #fff; }
.search-bar svg { width: 19px; color: #718198; }
.search-bar input { min-width: 0; height: 46px; border: 0; outline: 0; color: #253a54; }
.search-bar button { height: 46px; border: 0; padding: 0 18px; background: var(--blue); color: white; font-weight: 800; }
.quick-tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 16px 10px; border-bottom: 1px solid #e0e7f0; }
.quick-tabs button { height: 38px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #718198; font-weight: 700; }
.quick-tabs button.is-active { color: var(--blue); border-bottom-color: var(--blue); }

.map-viewport { position: relative; min-height: 290px; overflow: hidden; background: #dce7df; }
.map-viewport > img { position: absolute; width: 1440px; height: 1200px; max-width: none; top: -160px; left: -570px; object-fit: cover; filter: saturate(.88) contrast(.96); }
.map-viewport::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 -35px 38px rgba(20,53,95,.08); pointer-events: none; }
.map-toolbar { position: absolute; z-index: 2; right: 12px; top: 12px; display: grid; overflow: hidden; border: 1px solid #d5deea; background: white; box-shadow: 0 8px 22px rgba(20,53,95,.12); }
.map-toolbar button + button { border-top: 1px solid #e2e7ee; }
.map-pin { position: absolute; z-index: 3; width: 35px; height: 35px; display: grid; place-items: center; border: 3px solid white; border-radius: 50% 50% 50% 12%; transform: rotate(-45deg); background: var(--navy); color: white; box-shadow: 0 6px 16px rgba(20,53,95,.35); }
.map-pin span { transform: rotate(45deg); font-weight: 900; }
.map-pin.primary { background: var(--blue); }

.nearby-sheet { position: relative; z-index: 4; margin-top: -12px; padding: 9px 16px 12px; background: white; border-radius: 8px 8px 0 0; }
.sheet-handle { width: 40px; height: 4px; margin: 0 auto 11px; background: #c9d3df; border-radius: 4px; }
.sheet-title { display: flex; align-items: end; justify-content: space-between; padding-bottom: 9px; }
.sheet-title div { display: grid; gap: 3px; }
.sheet-title span { color: var(--blue); font-size: 12px; font-weight: 800; }
.sheet-title strong { color: var(--navy); font-size: 18px; }
.sheet-title button, .context-section header button { border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 800; }
.hospital-row { display: grid; grid-template-columns: 44px 1fr 20px; align-items: center; gap: 11px; min-height: 72px; border-top: 1px solid #edf1f6; }
.hospital-sign { width: 40px; height: 40px; display: grid; place-items: center; background: var(--soft-blue); color: var(--blue); border-radius: 8px; }
.hospital-sign svg { width: 21px; }
.hospital-sign.partner { background: var(--blue); color: white; font-weight: 900; }
.hospital-copy { min-width: 0; display: grid; gap: 2px; }
.hospital-copy strong { color: #243950; font-size: 14px; }
.hospital-copy span, .hospital-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #77869a; font-size: 11px; }
.hospital-copy small b { color: var(--blue); margin-right: 6px; }
.hospital-row > svg { width: 17px; color: #9aa8b8; }
.bottom-nav { margin-top: auto; min-height: 67px; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid #dce4ed; background: white; }
.bottom-nav button { display: grid; place-content: center; justify-items: center; gap: 4px; border: 0; background: transparent; color: #78879a; font-size: 10px; }
.bottom-nav svg { width: 20px; }
.bottom-nav button.is-active { color: var(--blue); font-weight: 800; }

.context-panel { padding: 28px 22px; border-left: 1px solid var(--line); }
.context-head strong { display: block; margin-top: 8px; color: var(--navy); font-size: 25px; }
.context-head p { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.context-section { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.context-section header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.context-section header strong { color: var(--navy); font-size: 16px; }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); }
.action-grid button { min-height: 84px; display: grid; place-content: center; justify-items: center; gap: 9px; border: 0; background: white; color: #3e536c; }
.action-grid button:nth-child(odd) { border-right: 1px solid var(--line); }
.action-grid button:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.action-grid button:hover { color: var(--blue); background: var(--soft-blue); }
.action-grid svg { width: 23px; }
.recovery-links > button { width: 100%; min-height: 62px; display: grid; grid-template-columns: 36px 1fr 18px; align-items: center; gap: 9px; border: 0; border-top: 1px solid #e6ebf2; background: transparent; color: #496078; text-align: left; }
.recovery-links > button > svg:first-child { width: 20px; color: var(--blue); }
.recovery-links > button > svg:last-child { width: 16px; color: #a1adbb; }
.recovery-links span { display: grid; gap: 3px; }
.recovery-links b { color: #29425d; }
.recovery-links small { color: #8491a2; }
.partner-banner { margin-top: 30px; padding: 20px; background: var(--navy); color: white; }
.partner-banner span { color: var(--mint); font-size: 12px; font-weight: 800; }
.partner-banner strong { display: block; margin-top: 8px; font-size: 17px; }
.partner-banner p { margin: 7px 0 16px; color: #ccdaeb; font-size: 12px; }
.partner-banner a { width: 100%; height: 41px; display: grid; place-items: center; border: 0; background: white; color: var(--navy); font-weight: 800; text-decoration: none; }

@media (max-width: 1100px) {
  .hybrid-shell { grid-template-columns: 220px minmax(440px, 580px); }
  .context-panel { display: none; }
}

@media (max-width: 740px) {
  .hybrid-shell { display: block; background: white; }
  .category-rail, .context-panel { display: none; }
  .app-stage { padding: 0; background: white; }
  .app-frame { max-width: 100vw; min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .exact-app-copy { height: auto; min-height: 100dvh; overflow: visible; }
  .explorer-copy { height: 100dvh; }
  .app-header { height: 64px; }
  .app-brand span { display: none; }
  .location-strip { min-height: 48px; font-size: 12px; }
  .location-strip small { display: none; }
  .map-viewport { min-height: 310px; }
  .map-viewport > img { left: -650px; top: -160px; }
  .nearby-sheet { margin-top: -9px; }
}
