/* ==========================================================================
   Sangkwon Radar — components
   한 화면 = 레일(어디로) + 안내 줄(지금 어디) + 작업 면(지도 · 붙박이 패널).
   ========================================================================== */

::selection { background: var(--plate); color: var(--white); }
input, textarea { caret-color: var(--plate); }
* { scrollbar-width: thin; scrollbar-color: #A6A9A4 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #A6A9A4; border: 3px solid var(--paper); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---- shell -------------------------------------------------------------- */
.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  height: 100vh;
  min-height: 560px;
}
.stage {
  display: grid;
  grid-template-rows: var(--guide-h) minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
}

/* rail — 기와진회색 기둥, 기능 다섯 개 */
.rail {
  background: var(--rail);
  color: var(--rail-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 12px;
  gap: 4px;
  z-index: 30;
}
.mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: var(--r-lg);
  background: var(--plate);
  border: 3px solid var(--white);
  outline: 2px solid var(--plate);
  color: var(--white);
  font-weight: 800;
  font-size: 11px;
  line-height: 1.05;
  letter-spacing: .04em;
  text-align: center;
}
.mark:hover { color: var(--white); text-decoration: none; background: var(--plate-deep); }
.rail__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 72px;
  padding: 10px 2px 9px;
  border-radius: var(--r);
  color: var(--rail-dim);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}
.rail__link svg { width: 24px; height: 24px; }
.rail__link:hover { color: var(--white); background: var(--rail-deep); text-decoration: none; }
.rail__link.on { color: var(--ink); background: var(--ground); }
.rail__link.on svg { color: var(--plate); }
.rail__foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail__link--sm { font-size: 10.5px; padding: 8px 2px; }
.lang {
  display: flex;
  border: 2px solid #6B6F75;
  border-radius: var(--r);
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
}
.lang a { padding: 4px 8px; color: var(--rail-dim); }
.lang a:hover { color: var(--white); text-decoration: none; }
.lang a.on { background: var(--rail-ink); color: var(--rail); }

/* guide strip — 지금 보는 범위를 이어 붙인 안내 줄 */
.guide {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 20px;
  background: var(--white);
  border-bottom: 3px solid var(--rule);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 20;
}
.guide__crumb { padding: 0 14px; border-right: 1px solid var(--hair); overflow: hidden; text-overflow: ellipsis; }
.guide__crumb:first-child { padding-left: 0; }
.guide__crumb:last-of-type { border-right: 0; }
.guide__crumb b { font-weight: 800; }
.guide__crumb--now { color: var(--ink); font-weight: 800; }
.guide__crumb .ko { font-weight: 400; color: var(--ink-3); font-size: 13px; margin-left: 6px; }
.guide__asof { margin-left: auto; padding-left: 16px; font-size: 12.5px; font-weight: 400; color: var(--ink-3); }

.work { position: relative; min-height: 0; display: grid; }
.work--map-left  { grid-template-columns: 340px minmax(0, 1fr); }
.work--map-right { grid-template-columns: minmax(0, 1fr) 440px; }
.work--page { overflow: auto; padding: 24px 28px 32px; }

.sources {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 6px 20px;
  background: var(--ground);
  border-top: 1px solid var(--hair);
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- docked panel ------------------------------------------------------- */
.dock {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--paper);
  z-index: 10;
}
.dock--left { border-right: 3px solid var(--rule); }
.dock--right { border-left: 3px solid var(--rule); animation: sheet-in .32s cubic-bezier(.16, 1, .3, 1) both; }
.dock__scroll { flex: 1; overflow: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 20px; }
.dock__foot { padding: 14px 22px 16px; border-top: 1px solid var(--hair); background: var(--paper); display: flex; flex-direction: column; gap: 8px; }
.sec { display: flex; flex-direction: column; gap: 10px; }
.sec + .sec { padding-top: 18px; border-top: 1px solid var(--hair); }
.sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec__title { font-size: 15px; font-weight: 800; color: var(--ink); }
.sec__meta { font-size: 12px; color: var(--ink-3); }
.cap { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }

/* ---- map ---------------------------------------------------------------- */
.map { position: relative; min-width: 0; min-height: 0; background: #E7E8E3; }
.map__canvas { position: absolute; inset: 0; }
.map-float { position: absolute; z-index: 5; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  background: var(--white);
  border: 2px solid var(--rule);
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.chip--quiet { border-color: var(--hair); font-weight: 400; color: var(--ink-2); }
.swatch { width: 12px; height: 12px; border-radius: 2px; background: var(--heat-4); flex: none; }

.zoom { display: flex; flex-direction: column; background: var(--white); border: 2px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.zoom a { display: grid; place-items: center; width: 34px; height: 34px; color: var(--ink); }
.zoom a + a { border-top: 1px solid var(--hair); }
.zoom a:hover { background: var(--wash); text-decoration: none; }
.zoom svg { width: 16px; height: 16px; }

.legend {
  width: 236px;
  background: var(--white);
  border-top: 4px solid var(--rule);
  padding: 12px 14px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.legend__title { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.legend__title span { font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.legend__rows { display: flex; flex-direction: column; gap: 3px; }
.legend__row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend__sw { width: 22px; height: 12px; }
.legend__sw.h1 { background: var(--heat-1); } .legend__sw.h2 { background: var(--heat-2); }
.legend__sw.h3 { background: var(--heat-3); } .legend__sw.h4 { background: var(--heat-4); }
.legend__sw.h5 { background: var(--heat-5); }
.legend__note { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--hair); font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }

.cell-tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  padding: 5px 9px;
  background: var(--rail);
  color: var(--white);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--rail);
  color: var(--white);
  border-radius: var(--r);
  font-size: 12.5px;
  font-weight: 700;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--plate-line); animation: pulse 1.2s ease-in-out infinite; }

/* road-name plate — 고른 자리의 이름판 (지도 오버레이 · 패널 머리 공용) */
.plate {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 14px 8px 12px;
  background: var(--plate);
  color: var(--white);
  border: 3px solid var(--white);
  outline: 3px solid var(--plate);
  border-radius: var(--r-lg);
  white-space: nowrap;
  font-weight: 800;
  line-height: 1.05;
}
.plate__road { font-size: 19px; letter-spacing: -.005em; }
.plate__ko { font-family: var(--ko); font-weight: 400; font-size: 12px; opacity: .88; }
.plate--map { position: relative; translate: -22px calc(-100% - 22px); box-shadow: 0 5px 12px rgba(0, 0, 0, .22); animation: plate-in .36s cubic-bezier(.16, 1, .3, 1) both; }
.plate--map::after {
  content: "";
  position: absolute;
  left: 14px;
  bottom: -17px;
  border: 8px solid transparent;
  border-top-color: var(--plate);
}
.plate--pick { background: var(--rail); outline-color: var(--rail); }
.plate--pick::after { border-top-color: var(--rail); }
.plate--a, .plate--b { padding: 5px 10px; }
.plate--b { background: var(--rail); outline-color: var(--rail); }
.plate__tag { font-size: 11px; letter-spacing: .08em; opacity: .9; }

.spot-dot { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--plate); border: 3px solid var(--white); box-shadow: 0 0 0 2px var(--plate); }
.spot-dot--pick { background: var(--rail); box-shadow: 0 0 0 2px var(--rail); }

.ring-label {
  padding: 2px 7px;
  background: var(--white);
  border: 2px solid var(--plate);
  border-radius: var(--r-sm);
  color: var(--plate);
  font-size: 12px;
  font-weight: 800;
}

/* 동종 상가 점 (SVG) */
.dot-layer { overflow: visible; pointer-events: none; }
.dot { pointer-events: auto; cursor: pointer; }
.dot--in { fill: var(--rail); stroke: var(--white); stroke-width: 1.5; }
.dot--out { fill: #8E9196; stroke: var(--white); stroke-width: 1; opacity: .75; }
.dot--focus { fill: var(--dense); r: 9; }
.dot-halo { fill: none; stroke: var(--rail); stroke-width: 1.5; stroke-dasharray: 3 3; opacity: .55; }
.dot-label { font: 700 12px var(--ko); fill: var(--ink); paint-order: stroke; stroke: var(--white); stroke-width: 4px; stroke-linejoin: round; }

.saved-pin {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid var(--white);
  border-radius: var(--r);
  background: var(--rail);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  cursor: pointer;
}
.saved-pin svg { width: 14px; height: 14px; }

/* map popup — 누른 자리에서 무엇을 할지 */
.map-popup {
  position: relative;
  min-width: 230px;
  max-width: 290px;
  padding: 12px 14px 12px;
  background: var(--white);
  border: 2px solid var(--rule);
  border-radius: var(--r);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: normal;
}
.map-popup::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  margin-left: -8px;
  border: 8px solid transparent;
  border-bottom: 0;
  border-top-color: var(--rule);
}
.map-popup__x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: var(--ink-3);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.map-popup__x:hover { background: var(--wash); color: var(--ink); }
.map-popup__x svg { width: 14px; height: 14px; }
.map-popup__title { font-size: 14px; font-weight: 800; padding-right: 26px; }
.map-popup__text { font-size: 12.5px; color: var(--ink-3); }
.map-popup__actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ---- controls ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--plate);
  border-radius: var(--r);
  background: var(--white);
  color: var(--plate);
  font-weight: 800;
  font-size: 14.5px;
  line-height: 1.1;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease-out, color .15s ease-out;
}
.btn:hover { background: var(--plate-soft); color: var(--plate-deep); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn--primary { background: var(--plate); color: var(--white); }
.btn--primary:hover { background: var(--plate-deep); border-color: var(--plate-deep); color: var(--white); }
.btn--quiet { border-color: var(--hair); color: var(--ink); }
.btn--quiet:hover { border-color: var(--rule); background: var(--white); color: var(--ink); }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn--xs { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-width: 1.5px; }
.btn--block { width: 100%; }
.btn.is-saved { background: var(--white); color: var(--plate); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.segment { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 2px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--white); }
.segment__item { padding: 8px 0; text-align: center; font-weight: 800; font-size: 14px; color: var(--ink); }
.segment__item + .segment__item { border-left: 1px solid var(--hair); }
.segment__item:hover { background: var(--wash); text-decoration: none; color: var(--ink); }
.segment__item.on { background: var(--rule); color: var(--white); }

.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.select, .input {
  height: 38px;
  padding: 0 10px;
  border: 2px solid var(--hair);
  border-radius: var(--r);
  background: var(--white);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.select:hover, .input:hover { border-color: var(--rule); }
.select:focus, .input:focus { outline: none; border-color: var(--plate); }
.select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%233E4247' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 12px; }

/* industry picker — 3단 분류 */
.picker { display: grid; grid-template-columns: 1fr 1fr 1fr; border: 2px solid var(--rule); border-radius: var(--r); background: var(--white); overflow: hidden; height: 228px; }
.picker__col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.picker__col + .picker__col { border-left: 1px solid var(--hair); }
.picker__head { padding: 6px 8px; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--ink-3); background: var(--wash); text-transform: uppercase; }
.picker__list { overflow: auto; flex: 1; padding: 3px 0; }
.tree__item { display: block; width: 100%; padding: 6px 8px; border: 0; background: none; text-align: left; font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--ink-2); cursor: pointer; }
.tree__item:hover { background: var(--wash); color: var(--ink); }
.tree__item.on { background: var(--plate); color: var(--white); }
.tree__empty { padding: 8px; font-size: 12px; color: var(--ink-3); }
.picked { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.picked__path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked__up { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 1.5px solid var(--hair); border-radius: var(--r-sm); background: var(--white); font-size: 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.picked__up:hover { border-color: var(--rule); color: var(--ink); }
.picked__up svg { width: 12px; height: 12px; }

/* ---- figures ------------------------------------------------------------ */
.fig { font-size: var(--fig-l); font-weight: 800; line-height: 1; letter-spacing: -.01em; }
.fig--xl { font-size: var(--fig-xl); }
.fig--m { font-size: var(--fig-m); }
.fig--s { font-size: var(--fig-s); }
.fig__u { font-size: 14px; font-weight: 700; margin-left: 3px; letter-spacing: 0; }
.up { color: var(--roomy); }
.dn { color: var(--dense); }
.c-dense { color: var(--dense); }
.c-roomy { color: var(--roomy); }
.c-mute { color: var(--ink-3); }

.figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--rule); border-bottom: 1px solid var(--hair); }
.figs > div { padding: 12px 10px 12px 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.figs > div + div { padding-left: 12px; border-left: 1px solid var(--hair); }
.figs__label { font-size: 12px; color: var(--ink-3); line-height: 1.3; }

/* verdict sign — 공공 안내판처럼 한 줄로 단정 */
.sign {
  border-radius: var(--r-lg);
  padding: 4px;
  color: var(--white);
}
.sign__inner {
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: var(--r);
  padding: 12px 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sign__word { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.sign__word strong { font-size: 30px; font-weight: 800; letter-spacing: .02em; line-height: 1; text-transform: uppercase; }
html[lang="ko"] .sign__word strong { text-transform: none; letter-spacing: 0; }
.sign__rank { font-size: 13px; font-weight: 800; padding: 2px 8px; border: 1.5px solid var(--white); border-radius: var(--r-sm); white-space: nowrap; }
.sign__reason { font-size: 14.5px; line-height: 1.4; }
.sign__reason b { font-weight: 800; }
.sign--dense { background: var(--dense); }
.sign--roomy { background: var(--roomy); }
.sign--roomy .sign__inner { border-style: double; border-width: 4px; }
.sign--normal { background: var(--normal); }
.sign--normal .sign__inner { border-style: dashed; }

.vchip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 800; color: var(--white); white-space: nowrap; }
.vchip--dense { background: var(--dense); box-shadow: inset 0 0 0 1.5px var(--white), 0 0 0 1.5px var(--dense); }
.vchip--roomy { background: var(--roomy); outline: 3px double var(--roomy); outline-offset: 1px; }
.vchip--normal { background: var(--normal); box-shadow: inset 0 0 0 1px var(--white); outline: 1.5px dashed var(--normal); outline-offset: 1px; }
.struck { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 2px; }

/* 가로 막대 */
.bars { display: flex; flex-direction: column; gap: 5px; }
.bar { display: grid; grid-template-columns: 130px minmax(0, 1fr) 44px; align-items: center; gap: 10px; font-size: 13px; }
.bar__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar__track { height: 10px; background: var(--hair-soft); }
.bar__fill { display: block; height: 100%; background: var(--plate-line); }
.bar__v { text-align: right; font-weight: 700; }
.bar.on .bar__name, .bar.on .bar__v { font-weight: 800; color: var(--ink); }
.bar.on .bar__fill { background: var(--plate); }

/* 월별 개업 · 폐업 */
.monthly { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; }
.monthly__col { display: grid; grid-template-rows: 40px 2px 40px auto; gap: 0; }
.monthly__up { display: flex; align-items: flex-end; }
.monthly__down { display: flex; align-items: flex-start; }
.monthly__up b, .monthly__down b { display: block; width: 100%; }
.monthly__up b { background: var(--roomy); }
.monthly__down b { background: var(--dense); }
.monthly__axis { background: var(--rule); }
.monthly__m { padding-top: 4px; font-size: 11px; color: var(--ink-3); text-align: center; }
.key { display: inline-flex; gap: 12px; font-size: 12px; color: var(--ink-3); }
.key i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }

/* 표 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { position: sticky; top: 0; background: var(--wash); text-align: left; padding: 7px 8px; font-size: 11.5px; font-weight: 800; color: var(--ink-2); }
.table td { padding: 7px 8px; border-bottom: 1px solid var(--hair); }
.table td.num, .table th.num { text-align: right; }
.table tr[data-nearby] { cursor: pointer; }
.table tr[data-nearby]:hover td { background: var(--plate-soft); }
.table-wrap { max-height: 240px; overflow: auto; border: 1px solid var(--hair); background: var(--white); }

/* no-data — 데이터가 답할 수 없을 때 (취소선 상태) */
.nodata { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 2px dashed var(--hair); border-radius: var(--r); background: var(--white); }
.nodata__title { font-weight: 800; font-size: 13.5px; }
.nodata__title s { color: var(--ink-3); text-decoration-thickness: 2px; }

/* 저장한 위치 목록 */
.saved-list { display: flex; flex-direction: column; }
.saved-list li { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--hair); }
.saved-list a { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 0; color: var(--ink); }
.saved-list a:hover { text-decoration: none; color: var(--plate); }
.saved-list strong { font-size: 13.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-list span { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-3); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--wash); color: var(--ink); }
.icon-btn svg { width: 14px; height: 14px; }

.save-hint { font-size: 12px; color: var(--ink-3); text-align: center; }
.save-hint--error { color: var(--dense); }

.big-count { display: flex; align-items: baseline; gap: 6px; }

/* ---- states ------------------------------------------------------------- */
.state-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 400px;
  padding: 18px 20px;
  background: var(--white);
  border-top: 4px solid var(--rule);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .14);
}
.state-card h2 { font-size: 18px; }
.state-card p { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.state-card .code { font-size: 11.5px; color: var(--ink-4); }
.state-veil { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; background: rgba(236, 236, 232, .82); }
.skeleton { background: var(--hair-soft); border-radius: var(--r-sm); animation: pulse 1.4s ease-in-out infinite; }

/* first-visit guide — 처음 온 사람에게 한 번 */
.welcome {
  position: absolute;
  left: 20px;
  top: 20px;
  z-index: 7;
  width: 360px;
  background: var(--white);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  padding: 18px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: plate-in .4s cubic-bezier(.16, 1, .3, 1) both;
}
.welcome h2 { font-size: 20px; line-height: 1.2; }
.welcome p { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.welcome ol { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 8px; }
.welcome li { counter-increment: step; display: grid; grid-template-columns: 24px 1fr; gap: 8px; font-size: 13.5px; line-height: 1.35; }
.welcome li::before { content: counter(step); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--rail); color: var(--white); font-size: 12px; font-weight: 800; }
.welcome__actions { display: flex; gap: 8px; }
.welcome__actions .btn { flex: 1; }

/* ---- page layout (지도가 주인공이 아닌 화면) ------------------------------- */
.page-col { display: flex; flex-direction: column; gap: 20px; max-width: 1240px; width: 100%; margin: 0 auto; }
.push { margin-left: auto; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.field--inline { flex-direction: row; align-items: center; gap: 8px; }
.panel { background: var(--white); border-top: 3px solid var(--rule); padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel__title { font-size: 20px; line-height: 1.2; }
.state-card--inline { max-width: none; box-shadow: none; }

/* ---- compare ------------------------------------------------------------ */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.spot-panel { background: var(--white); border-top: 3px solid var(--rule); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.spot-panel__head { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.spot-panel__head .plate { flex-direction: row; align-items: baseline; gap: 10px; }
.place-search { position: relative; }
.place-search .input { width: 100%; padding-left: 34px; }
.place-search__i { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--ink-3); }
.place-search__results { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); background: var(--white); border: 2px solid var(--rule); border-radius: var(--r); box-shadow: 0 6px 16px rgba(0, 0, 0, .16); max-height: 300px; overflow: auto; }
.place-search__results a { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; color: var(--ink); border-bottom: 1px solid var(--hair); }
.place-search__results a:hover, .place-search__results a:focus { background: var(--plate-soft); text-decoration: none; }
.place-search__results strong { font-size: 13.5px; font-family: var(--ko); }
.place-search__results span { font-size: 12px; color: var(--ink-3); font-family: var(--ko); }
.place-search__empty { padding: 10px 12px; font-size: 12.5px; color: var(--ink-3); }
.saved-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.saved-chip { padding: 4px 9px; border: 1.5px solid var(--hair); border-radius: var(--r-sm); font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.saved-chip:hover { border-color: var(--rule); color: var(--ink); text-decoration: none; }
.saved-chip.on { background: var(--plate); border-color: var(--plate); color: var(--white); }
.compare-map { position: relative; height: 300px; background: #E7E8E3; display: grid; place-items: center; }

.duel { background: var(--white); border-top: 3px solid var(--rule); }
.duel__row { display: grid; grid-template-columns: 1fr minmax(220px, 300px) 1fr; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--hair); }
.duel__row--head { padding: 10px 24px; background: var(--wash); font-size: 13px; font-weight: 800; }
.duel__side { text-align: right; }
.duel__side--b { text-align: left; }
.duel__v { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; }
.duel__v--b { justify-content: flex-start; }
.duel__label { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.duel__label small { font-size: 11.5px; font-weight: 400; color: var(--ink-3); }
.duel__tag { align-self: center; padding: 2px 7px; border-radius: var(--r-sm); background: var(--roomy-soft); color: var(--roomy-deep); font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.duel__foot { display: flex; flex-direction: column; gap: 4px; padding: 14px 24px 16px; }
.duel__foot strong { font-size: 15px; }
.tone-better { color: var(--roomy); }
.tone-roomy { color: var(--roomy); }
.tone-dense { color: var(--dense); }

/* ---- survival ----------------------------------------------------------- */
.survival { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.survival__main, .survival__side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.curve { width: 100%; height: auto; display: block; }
.curve__axis { fill: var(--ink-3); font: 600 13px var(--sans); }
.curve__marker { fill: var(--white); font: 800 12px var(--sans); }
.stat { display: flex; flex-direction: column; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--hair); }
.ranks { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.rank-list { display: flex; flex-direction: column; }
.rank-list__title { font-size: 12.5px; font-weight: 800; padding-bottom: 6px; border-bottom: 2px solid var(--rule); }
.rank-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) 90px 44px; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.rank-row.on { font-weight: 800; background: var(--plate-soft); }
.rank-row__n { font-weight: 800; color: var(--ink-3); text-align: center; }
.rank-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row__bar { height: 8px; background: var(--hair-soft); }
.rank-row__bar b { display: block; height: 100%; }
.rank-row__bar .is-top { background: var(--roomy); }
.rank-row__bar .is-low { background: #9A9D98; }
.rank-row__bar .is-sel { background: var(--rail); }
.rank-row__v { text-align: right; font-weight: 800; }

/* ---- recommend ---------------------------------------------------------- */
.work--rec { grid-template-columns: 400px minmax(0, 1fr); }
.rules { display: flex; flex-direction: column; gap: 10px; }
.rule { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--white); border: 2px solid var(--hair); border-radius: var(--r); }
.rule__line { display: flex; align-items: center; gap: 6px; }
.rule__industry { flex: 1; min-width: 0; }
.rule__dir { width: 128px; }
.rule__particle:empty { display: none; }
.rule__particle { font-weight: 700; color: var(--ink-2); }
.weight { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.weight input { flex: 1; accent-color: var(--plate); }
.weight__v { width: 28px; text-align: right; font-weight: 800; color: var(--ink); }
.rule-foot { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.rec-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.rec-card { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 6px; border-bottom: 1px solid var(--hair); color: var(--ink); }
.rec-card:hover { background: var(--white); text-decoration: none; color: var(--ink); }
.rec-card.on { background: var(--plate-soft); }
.rec-card__n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-sm); background: var(--rail); color: var(--white); font-weight: 800; font-size: 13px; }
.rec-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rec-card__body strong { font-size: 14.5px; }
.rec-card__facts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rec-card__facts span { padding: 2px 6px; background: var(--wash); border-radius: var(--r-sm); font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.rec-card__score { display: flex; flex-direction: column; align-items: flex-end; }
.rec-card__score b { font-size: var(--fig-m); font-weight: 800; line-height: 1; color: var(--plate); }
.rec-card__score small { font-size: 11px; color: var(--ink-3); }
.rec-rank-badge { display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--white); border-radius: var(--r-sm); background: var(--rail); color: var(--white); font: 800 12px var(--sans); }
.map-popup--tip { pointer-events: none; }
.key { flex-wrap: wrap; } .key > span { white-space: nowrap; }
.sec__head { flex-wrap: wrap; }

/* ---- pipeline ----------------------------------------------------------- */
.pipe { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.pipe__main, .pipe__side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.jobs td { vertical-align: top; }
.jobs strong { display: block; font-weight: 800; }
.jobs__src { display: block; max-width: 340px; font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jobs tr.is-fail td { background: var(--dense-soft); }
.jobs__fail td { background: var(--white); }
.jobs__fail summary { display: flex; gap: 10px; align-items: baseline; cursor: pointer; font-size: 13px; }
.jobs__progress { display: inline-flex; align-items: center; gap: 8px; }
.progress { display: inline-block; width: 90px; height: 8px; background: var(--hair-soft); }
.progress b { display: block; height: 100%; background: var(--plate); }
.fail { display: grid; grid-template-columns: 48px 1fr; gap: 6px 12px; margin: 10px 0 8px; font-size: 13px; line-height: 1.5; }
.fail dt { font-weight: 800; }
.fail dd { margin: 0; color: var(--ink-2); }
.fail__raw summary { font-size: 12px; color: var(--ink-3); }
.fail__raw pre { margin: 6px 0 0; padding: 10px; background: var(--rail); color: var(--rail-ink); font-size: 11.5px; white-space: pre-wrap; overflow: auto; max-height: 180px; border-radius: var(--r-sm); }
.steps { margin: 0; padding: 10px 20px; border-top: 1px solid var(--hair); background: var(--paper); font-size: 12px; color: var(--ink-2); }
.steps__sep { margin: 0 6px; color: var(--ink-4); }
.perfs { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.perf { display: flex; flex-direction: column; gap: 10px; }
.perf__big { display: flex; align-items: baseline; }
.perf__bar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 70px; align-items: center; gap: 10px; font-size: 13px; }
.perf__bar b { text-align: right; }
.perf__bar .bar__track { height: 12px; }
.quality { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.quality__l { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; }
.pipe__side .table td:nth-child(n+2) { white-space: nowrap; }
.pipe__side .table td:first-child { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- bottom sheet grip (모바일에서만 보인다) --------------------------------- */
.dock__grip { display: none; }

/* ==========================================================================
   Narrow screens — 레일은 하단 탭으로, 붙박이 패널은 지도 위 바텀시트로.
   ========================================================================== */
@media (max-width: 760px) {
  :root { --guide-h: 44px; --tab-h: 62px; }
  .shell { grid-template-columns: minmax(0, 1fr); height: 100dvh; min-height: 0; }
  .rail {
    position: fixed; left: 0; right: 0; bottom: 0; height: var(--tab-h);
    flex-direction: row; justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    gap: 0;
  }
  .mark, .rail__foot .rail__link--sm { display: none; }
  .rail__link { width: auto; flex: 1; padding: 6px 2px; font-size: 10.5px; }
  .rail__link svg { width: 22px; height: 22px; }
  .rail__foot { margin: 0; flex: none; padding: 0 4px; }
  .lang { font-size: 11px; }
  .stage { padding-bottom: var(--tab-h); }
  .guide { padding: 0 14px; font-size: 13.5px; overflow-x: auto; scrollbar-width: none; }
  .guide__crumb { padding: 0 10px; overflow: visible; }
  .guide__asof, .sources { display: none; }

  .work--map-left, .work--map-right, .work--rec { grid-template-columns: minmax(0, 1fr); }
  .work--map-left .map, .work--rec .map { order: -1; }
  .map { min-height: 0; height: 100%; }

  /* 바텀시트 3단: peek(판정만) · half · full */
  .dock {
    position: fixed; left: 0; right: 0; bottom: var(--tab-h); z-index: 25;
    height: 52dvh; border: 0; border-top: 3px solid var(--rule);
    box-shadow: 0 -6px 18px rgba(0, 0, 0, .18);
    transition: height .3s cubic-bezier(.16, 1, .3, 1); animation: none;
  }
  .dock[data-sheet="peek"] { height: 168px; }
  .dock[data-sheet="full"] { height: calc(100dvh - var(--guide-h) - var(--tab-h)); }
  .dock--left, .dock--right { border-left: 0; border-right: 0; }
  .dock__grip {
    display: grid; place-items: center; width: 100%; height: 26px; flex: none;
    border: 0; background: none; cursor: pointer;
  }
  .dock__grip::before { content: ""; width: 44px; height: 5px; border-radius: 3px; background: #A6A9A4; }
  .dock__scroll { padding: 4px 18px 18px; gap: 16px; }
  .dock__foot { padding: 10px 18px 12px; }
  .map-float.legend, .map-float.chip--quiet { display: none; }
  .map-float.zoom { top: 12px; right: 12px; }
  .welcome { left: 12px; right: 12px; top: 12px; width: auto; }

  .work--page { padding: 16px 14px 24px; }
  .pair, .survival, .pipe, .perfs, .ranks { grid-template-columns: minmax(0, 1fr); }
  .duel__row { grid-template-columns: 1fr 1fr; padding: 10px 14px; gap: 6px 12px; }
  .duel__label { grid-column: 1 / -1; order: -1; }
  .duel__v, .duel__v--b { justify-content: center; }
  .duel__row--head { display: none; }
  .compare-map { height: 220px; }
  .bar { grid-template-columns: 110px minmax(0, 1fr) 40px; }
}

/* ---- screen index ------------------------------------------------------- */
.screen-list { display: flex; flex-direction: column; background: var(--white); border-top: 3px solid var(--rule); }
.screen { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px; border-bottom: 1px solid var(--hair); }
.screen h2 { font-size: 17px; }
.screen h2 a { color: var(--ink); }
.screen h2 a:hover { color: var(--plate); }
.screen .saved-chips { margin-top: 4px; }
.sec__title--lead { font-size: 21px; line-height: 1.2; }

/* first-visit guide as a road-plate sign (review fix) */
.welcome {
  background: var(--plate); color: var(--white);
  border: 3px solid var(--white); outline: 3px solid var(--plate);
  border-radius: var(--r-lg); box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
}
.welcome h2 { font-size: 23px; }
.welcome p, .welcome li { color: var(--white); }
.welcome li::before { background: var(--white); color: var(--plate); }
.welcome .btn--primary { background: var(--white); border-color: var(--white); color: var(--plate); }
.welcome .btn--primary:hover { background: var(--plate-soft); border-color: var(--plate-soft); color: var(--plate-deep); }
.welcome .btn--quiet { background: transparent; border-color: rgba(255, 255, 255, .85); color: var(--white); }
.welcome .btn--quiet:hover { background: var(--plate-deep); color: var(--white); }
.toolbar .select { max-width: 280px; }
