:root {
  --sidebar-width: 360px;
  --sidebar-bg: rgba(250, 250, 250, 0.98);
  --border: #dedede;
  --panel-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  --naver-green: #03c75a;
  --text-main: #111827;
  --text-sub: #5b6472;

  --pokestop-color: #00bfff;
  --gym-color: #a9a9a9;
  --powerspot-color: #eb408e;

  --selected-fill: #22c55e;
  --compare-fill: #7c3aed;

  --l14-base-stroke: 3;
  --l14-need-stroke: 6;
  --l14-max-stroke: 4.5;
  --l17-base-stroke: 1.5;
  --compare-line-stroke: 3;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, "Malgun Gothic", sans-serif;
  color: var(--text-main);
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  background: #fff;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#map {
  width: 100%;
  height: 100%;
}

#sidebarToggle {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2000;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--panel-shadow);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

#sidebar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1500;
  width: var(--sidebar-width);
  height: 100%;
  padding: 14px 14px 18px 14px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  box-shadow: var(--panel-shadow);
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.22s ease;
}

#app.sidebar-collapsed #sidebar {
  transform: translateX(calc(-1 * var(--sidebar-width) - 24px));
}

.brand {
  padding: 0 0 12px 50px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.made-by-btn {
  display: block;
  margin-top: 4px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  min-height: 0;
  border-radius: 0;
}

.made-by-btn:hover,
.made-by-btn:focus-visible {
  opacity: 1;
  text-decoration: none;
  outline: none;
}

.section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  margin-bottom: 12px;
  overflow: hidden;
}

.section-body {
  padding: 0 12px 12px 12px;
}

.section.collapsed .section-body {
  display: none;
}

.section-title {
  font-size: 13px;
  font-weight: 800;
  color: #374151;
}

.section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  padding: 12px;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  min-height: 48px;
}

.section:not(.collapsed) .section-toggle {
  border-bottom-color: #eef2f7;
}

.section-toggle-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-arrow {
  font-size: 12px;
  color: #6b7280;
  font-weight: 800;
}

.row {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.toolbar-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chip-row {
  display: grid;
  gap: 8px;
}

.chip-row-2 {
  grid-template-columns: 1fr 1fr;
}

.chip-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filter-label {
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #cfd6df;
  border-radius: 10px;
  background: #fff;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}

button {
  border: none;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.08s ease, background-color 0.12s ease;
  white-space: normal;
  word-break: keep-all;
  line-height: 1.15;
  min-height: 42px;
}

button:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--naver-green);
  color: white;
  font-weight: 700;
}

.btn-soft {
  background: #eef2f7;
  color: #1f2937;
  font-weight: 700;
}

.btn-toggle {
  background: #f3f4f6;
  color: #374151;
  font-weight: 700;
  border: 1px solid #d1d5db;
}

.btn-toggle.active {
  background: #111827;
  color: white;
  border-color: #111827;
}

.btn-toggle.small {
  padding: 8px 8px;
  font-size: 12px;
}

.chip-btn {
  min-height: 40px;
  padding: 9px 8px;
}

#reloadBtn,
#locBtn,
#searchInput,
#denseTargetType,
#denseRadiusInput,
#denseMinCount,
#denseCompactMinCount {
  font-size: 13px;
}

.btn-label-2line {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: #f3f4f6;
  margin-bottom: 10px;
}

.segmented-btn {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
}

.segmented-btn.active {
  background: #111827;
  color: #fff;
}

.list-count {
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 700;
}


.subsection {
  border-top: 1px solid #eef2f7;
  padding-top: 2px;
}

.subsection-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0 8px 0;
  background: transparent;
  border: none;
  min-height: 0;
}

.subsection-title {
  font-size: 13px;
  font-weight: 800;
  color: #374151;
}

.subsection-body {
  padding: 0 0 2px 0;
}

.dense-card-empty {
  color: var(--text-sub);
  text-align: center;
  font-size: 12px;
}

.route-join-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.route-join-label {
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
  white-space: nowrap;
}

.route-join-switch {
  flex: 1;
  margin-bottom: 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  margin-bottom: 8px;
}

.card .title {
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.3;
}

.dense-card .title {
  margin-bottom: 8px;
}

.meta {
  color: var(--text-sub);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.dense-distance {
  font-size: 13px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 6px;
}

.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin-right: 6px;
  font-weight: 700;
}

.pokestop {
  background: rgba(0, 191, 255, 0.12);
  color: #008ac2;
}

.gym {
  background: rgba(169, 169, 169, 0.18);
  color: #666666;
}

.powerspot {
  background: rgba(235, 64, 142, 0.12);
  color: #c3276d;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-actions button {
  flex: 1;
}

.hint {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.55;
}

.source-link {
  color: #2563eb;
  text-decoration: none;
  word-break: break-all;
  font-size: 12px;
  user-select: none;
  -webkit-user-select: none;
}

.info-window {
  position: relative;
  width: 294px;
  padding: 12px 12px 10px 12px;
  line-height: 1.5;
  color: #111827;
  user-select: none;
  -webkit-user-select: none;
}

.info-actions {
  position: absolute;
  top: 6px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.info-actions button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.plus-btn {
  background: #f3f4f6;
  color: #111827;
}

.plus-btn.active {
  background: #111827;
  color: #fff;
}

.close-btn {
  background: #f3f4f6;
  color: #111827;
}

.info-window .name {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 6px;
  padding-right: 66px;
}

.info-window .sub {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}

.info-window .desc {
  font-size: 13px;
  margin-bottom: 10px;
  white-space: normal;
  word-break: keep-all;
}

.info-window .nav-btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  background: var(--naver-green);
  color: white;
  font-weight: 800;
  padding: 9px 10px;
  cursor: pointer;
}

.dense-summary {
  min-height: 24px;
  padding: 4px 0 0 0;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  line-height: 1.45;
}

.dense-summary.muted {
  color: var(--text-sub);
}

#centerNotice {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2500;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.88);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  text-align: center;
  white-space: pre-line;
}

#centerNotice.show {
  opacity: 1;
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 320px;
  }
}

@media (max-width: 640px) {
  :root {
    --sidebar-width: 292px;
  }

  .toolbar-2,
  .toggle-grid,
  .chip-row-2,
  .chip-row-3 {
    grid-template-columns: 1fr 1fr;
  }

  .chip-row-3 button:last-child {
    grid-column: span 2;
  }
}


.list-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.list-tab-btn {
  background: #f3f4f6;
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
  min-height: 36px;
}

.list-tab-btn.active {
  background: #111827;
  color: #fff;
}

.list-panel {
  display: none;
}

.list-panel.active {
  display: block;
}

.dev-route-summary {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  color: #374151;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 8px;
}

.dev-panel-title {
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 8px;
}

.dev-login-error {
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.5;
}

.dev-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.38);
  padding: 20px;
}

.dev-modal {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  padding: 16px;
  border: 1px solid #e5e7eb;
}

.dev-modal-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 6px;
}

.dev-modal-subtitle {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.route-order-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.95);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -140%);
  white-space: nowrap;
}

.route-point-meta {
  display: grid;
  gap: 2px;
  color: #6b7280;
}

.route-stat-strong {
  color: #111827;
  font-weight: 800;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
