:root {
  --brand: #7b61ff;
  --brand-dark: #5b3fe6;
  --brand-soft: #f1edff;
  --ok: #16a34a;
  --ok-dark: #15803d;
  --ok-soft: #e9f7ef;
  --ink: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --bg: #ffffff;
  --soft: #f4f4f5;
  --faint: #fafafa;
  --danger: #d9480f;
  --naver: #03c75a;
  --kakao: #fee500;
  --food: #e8590c;
  --cafe: #8d5524;
  --sight: #1c7ed6;
  --stay: #0c8599;
  --etc: #495057;
  --list-collapsed: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  letter-spacing: -0.01em;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none; /* no pull-to-refresh: dragging a sheet down closes it instead */
  background: var(--bg);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- map */

#map {
  position: fixed;
  inset: 0 0 calc(var(--list-collapsed) + var(--safe-bottom)) 0;
  background: var(--soft);
}

.map-msg {
  position: absolute;
  inset: 45% 24px auto;
  margin: 0;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

.pin {
  --c: var(--etc);
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 3px solid var(--c);
  border-radius: 50%;
  background: #fff;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.pin.cat-food { --c: var(--food); }
.pin.cat-cafe { --c: var(--cafe); }
.pin.cat-sight { --c: var(--sight); }
.pin.cat-stay { --c: var(--stay); }
.pin.st-wish { border-style: dashed; }
.pin.st-bad { opacity: 0.55; }
.pin.st-again::after {
  content: "❤";
  position: absolute;
  top: -7px;
  right: -7px;
  font-size: 12px;
  color: #e03131;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff;
}
.pin.sel { transform: scale(1.35); box-shadow: 0 0 0 4px rgba(123, 97, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.35); }

#map.far .pin { width: 14px; height: 14px; border-width: 2px; border-style: solid; border-color: #fff; background: var(--c); font-size: 0; }
#map.far .pin::after { display: none; }
#map.far .pin.sel { width: 20px; height: 20px; }

.me-dot {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #1c7ed6;
  box-shadow: 0 0 0 6px rgba(28, 126, 214, 0.25);
}

/* ---------- top bar */

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 0;
  pointer-events: none;
}
.top > * { pointer-events: auto; }

.searchbar {
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
}
.searchbar input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow);
  outline: none;
}
.account {
  flex: none;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow);
  font-weight: 600;
  font-size: 14px;
}
.account.in, .avatar { padding: 0; border-color: var(--brand); border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; letter-spacing: -0.04em; }
.avatar { flex: none; display: grid; place-items: center; width: 48px; height: 48px; font-size: 17px; }
#account .field-label { margin: 4px 0 6px; font-size: 14px; font-weight: 600; }
#account .more-edit { margin: 14px 0 4px; }
#account .more-edit[open] { padding-bottom: 12px; }
#account .wide { margin-top: 8px; }

.chips {
  display: flex;
  gap: 6px;
  max-width: 560px;
  margin: 10px auto 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 6px;
}
.chips::-webkit-scrollbar { display: none; }
.chip-group { display: contents; }

.chip, .chip-select {
  flex: none;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  white-space: nowrap;
}
.chip-select { padding-right: 8px; appearance: auto; }
.chip.on, .chip-select.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

/* visited segmented control: its own row under the chips (only inside a trip) */
.seg {
  display: flex;
  max-width: 560px;
  margin: 2px auto 0;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.seg:empty { display: none; }
.seg .chip { flex: 1; min-width: 0; justify-content: center; border-radius: 0; margin-left: -1px; box-shadow: none; }
.seg .chip:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.seg .chip:last-child { border-radius: 0 8px 8px 0; }
.seg .chip.on { position: relative; z-index: 1; }

/* ---------- bottom list */

.list-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  height: calc(var(--list-collapsed) + var(--safe-bottom));
  margin: 0 auto;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
  transition: height 0.25s ease;
}
.list-sheet.open { height: 62vh; }

.floating {
  position: absolute;
  right: 12px;
  bottom: calc(100% + 12px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.round {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--brand);
  box-shadow: var(--shadow);
}
.fab {
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 14px rgba(123, 97, 255, 0.4);
}

.list-head {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: var(--list-collapsed);
  padding: 8px 16px 0;
  border: 0;
  background: none;
}
.grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); }
.list-title { font-size: 14px; }
.list-title small { color: var(--muted); margin-left: 4px; }

.list-sheet .items {
  flex: 1;
  overflow-y: auto;
  padding-bottom: var(--safe-bottom);
}

/* ---------- list items (shared by the list and search results) */

.items { list-style: none; margin: 0; padding: 0; }
.items .empty { padding: 20px 16px; color: var(--muted); text-align: center; font-size: 14px; line-height: 1.6; }

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  border-top: 1px solid var(--soft);
  background: none;
  text-align: left;
}
.item:active { background: var(--soft); }
@media (hover: hover) { .item:hover { background: var(--faint); } }
.item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .st { display: grid; flex: none; }
.item .st .i { width: 18px; height: 18px; }
.item .dist { flex: none; color: var(--muted); font-size: 12px; }
.badge { flex: none; padding: 2px 7px; border-radius: 6px; background: var(--soft); color: var(--muted); font-size: 12px; }
.lock .i { width: 0.85em; height: 0.85em; color: var(--muted); vertical-align: -1px; }

.ico {
  --c: var(--etc);
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c) 14%, white);
  font-size: 18px;
}
.ico.big { width: 48px; height: 48px; border-radius: 12px; font-size: 24px; }
.ico.cat-food { --c: var(--food); }
.ico.cat-cafe { --c: var(--cafe); }
.ico.cat-sight { --c: var(--sight); }
.ico.cat-stay { --c: var(--stay); }

/* ---------- sheets */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.35);
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  max-width: 560px;
  max-height: 70vh;
  margin: 0 auto;
  padding: 8px 16px calc(16px + var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  animation: up 0.2s ease-out;
}
.sheet.tall { max-height: 90vh; min-height: 60vh; }
#detail { z-index: 25; }
#editor { z-index: 45; }
#login, #account { z-index: 50; }
.sheet[hidden], .scrim[hidden], .toast[hidden] { display: none; }

@keyframes up { from { transform: translateY(40px); opacity: 0; } }

.sheet-head {
  position: sticky;
  top: -8px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -8px -16px 8px;
  padding: 16px 16px 8px;
  background: var(--bg);
}
.sheet-head h2 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; }
.head-text { flex: 1; min-width: 0; }
.head-text h2 { font-size: 18px; }
.head-text p { margin: 2px 0 0; }
.x {
  flex: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 15px;
}

.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; margin: -4px 0 0; }

.status { display: inline-block; margin: 0 0 8px; padding: 4px 10px; border-radius: 6px; background: var(--soft); font-weight: 600; font-size: 13px; }
.status.st-again { background: #fff0f0; color: #c92a2a; }
.status.st-wish { background: #fff9db; color: #946200; }
.status.st-ok { background: var(--ok-soft); color: var(--ok-dark); }
.status.st-bad { background: #f1f3f5; color: #495057; }

.memo { margin: 4px 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--faint); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: 14px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; word-break: break-all; }
.meta a { color: var(--brand); }

.links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.links.routes { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: 8px; }
.row { display: flex; gap: 8px; margin-top: 8px; }
.row .btn { flex: 1; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.btn.naver { border-color: var(--naver); background: var(--naver); color: #fff; }
.btn.kakao { border-color: var(--kakao); background: var(--kakao); color: #191600; }
.btn.ghost { background: var(--soft); border-color: var(--soft); }
.btn.danger { border-color: #ffd8c2; color: var(--danger); background: #fff4ec; }

.by { margin: 14px 0 0; color: var(--muted); font-size: 12px; text-align: right; }

/* ---------- inline editing in the detail sheet (logged in) */

.quick { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
.quick .trip-tags { margin: 0; }
.sheet .chip { box-shadow: none; }
.st-chip:not(.on) .i { opacity: 0.9; }
.trip-tag.add { border-style: dashed; color: var(--muted); }
.trip-tag.add.open { border-style: solid; border-color: var(--brand); color: var(--brand-dark); }
.trip-pick { display: flex; flex-direction: column; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--faint); }
.trip-pick .primary { min-height: 44px; padding: 0 16px; }
.memo-input {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--faint);
  line-height: 1.55;
  resize: none;
  field-sizing: content;
  outline: none;
}
.memo-input:focus { border-color: var(--brand); background: var(--bg); box-shadow: 0 0 0 3px var(--brand-soft); }
.save-state { margin: -6px 2px 0; color: var(--muted); font-size: 12px; text-align: right; }
.save-state:empty { display: none; }

.more-edit { margin-top: 14px; border-top: 1px solid var(--line); }
.more-edit summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.more-edit summary::-webkit-details-marker { display: none; }
.more-edit summary .i { transition: transform 0.15s; }
.more-edit[open] summary .i { transform: rotate(180deg); }
.more-edit[open] { display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; }
.more-edit > .chip-row, .more-edit > label { margin: 0 2px; }
.inline-field { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.inline-field span { color: var(--muted); min-width: 44px; }
.inline-field input { flex: 1; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); outline: none; }
.inline-field input:focus { border-color: var(--brand); }

/* ---------- forms */

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.stack input:not([type=checkbox]):not([type=radio]), .stack textarea, .searchbox input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-weight: 400;
  outline: none;
}
.stack input:focus, .stack textarea:focus, .searchbox input:focus, .searchbar input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.stack textarea { resize: vertical; line-height: 1.5; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 6px; padding: 0; font-size: 14px; font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-radio > span {
  gap: 6px;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 400;
  font-size: 14px;
}
.chip-radio input:checked + span .i { color: inherit; }
.chip-radio input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.chip-radio input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.check { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-weight: 400 !important; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
#add > .check { margin: 10px 0 6px; }

.primary {
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}
.primary:disabled { opacity: 0.6; }
.form-actions { display: flex; gap: 8px; }
.form-actions .primary { flex: 1; }

.searchbox { display: flex; gap: 8px; }
.searchbox input { flex: 1; min-width: 0; }
#add .items { margin: 0 -16px; }
.more, .wide {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-weight: 600;
}

/* ---------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--list-collapsed) + var(--safe-bottom) + 80px);
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 10px;
  background: rgba(24, 24, 27, 0.92);
  color: #fff;
  font-size: 14px;
  transform: translateX(-50%);
  animation: up 0.2s ease-out;
}

/* ---------- Kakao import */

#import > .muted { margin: 0 0 12px; line-height: 1.5; }
#importPreview { margin-top: 16px; }
.import-summary { margin: 0; font-size: 16px; line-height: 1.6; }

/* ---------- trips */

#trips { z-index: 42; }
.trip-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; padding-bottom: 8px; }
.trip-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}
.trip-card .cover {
  position: relative;
  display: block;
  aspect-ratio: 1;
  margin-bottom: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  pointer-events: none;
}
.trip-card.on .cover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cover-map, .cover-map * { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.cover-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; color: var(--muted); }
.trip-card.new .cover { border: 2px dashed var(--line); background: var(--bg); }
.trip-card b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-card small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-card .cats { font-size: 12px; }

.dot {
  --c: var(--etc);
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.dot.cat-food { --c: var(--food); }
.dot.cat-cafe { --c: var(--cafe); }
.dot.cat-sight { --c: var(--sight); }
.dot.cat-stay { --c: var(--stay); }

/* visited check: list button, detail tags, pin badge */
.items li:has(> .visit) { display: flex; align-items: center; border-top: 1px solid var(--soft); }
.items li:has(> .visit) > .item { border-top: 0; }
.visit {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 14px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: transparent;
  font-weight: 700;
}
button.visit { color: var(--line); }
.visit.on { border-color: var(--ok); background: var(--ok); color: #fff; }

.trip-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.trip-tag {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  font-size: 13px;
}
.trip-tag.on { border-color: #bbe5c8; background: var(--ok-soft); color: var(--ok-dark); font-weight: 600; }

.pin.done::before {
  content: "✓";
  position: absolute;
  bottom: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
#map.far .pin.done::before { display: none; }

.new-trip { margin-top: 8px; }
#tripMenu { z-index: 42; }
#tripMenu > .muted { margin: 0 0 4px; }
.danger-text { color: var(--danger); }

/* ---------- line icons */

.i {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i.cat-food { color: var(--food); }
.i.cat-cafe { color: var(--cafe); }
.i.cat-sight { color: var(--sight); }
.i.cat-stay { color: var(--stay); }
.i.cat-etc { color: var(--etc); }
.i.st-wish { color: #e8a200; }
.i.st-again { color: #e03131; }
.i.st-ok { color: #0ca678; }
.i.st-bad { color: #868e96; }
.st .i.st-again, .status .i.st-again { fill: currentColor; }

.chip, .fab, .trip-tag, .wide { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.chip.on .i { color: inherit; }
.chip .i.i + span, .chip span + .i { margin-left: 0; }
.chip.icon-only { width: 32px; padding: 0; }
.chip .i:last-child:not(:first-child) { width: 14px; height: 14px; opacity: 0.8; }
.fab .i { width: 18px; height: 18px; stroke-width: 2.5; }
.x { display: grid; place-items: center; }
.x .i { width: 18px; height: 18px; }
.status { display: inline-flex; align-items: center; gap: 6px; }

/* pins: filled category circle with a white icon */
.pin { border: 2px solid #fff; background: var(--c); color: #fff; }
.pin .i { width: 17px; height: 17px; stroke-width: 2.2; }
.pin.st-wish { border-style: solid; }
.pin.st-again::after { content: "♥"; }

/* list icons: tinted circle, coloured icon */
.ico { color: var(--c); }
.ico .i { width: 20px; height: 20px; }
.ico.big .i { width: 24px; height: 24px; }

.visit .i { width: 18px; height: 18px; stroke-width: 3; }
button.visit { color: #ced4da; }
.visit.on { color: #fff; }
span.visit:not(.on) { color: transparent; }

.trip-tag .i { width: 15px; height: 15px; }
.trip-tag em { display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; padding-left: 8px; border-left: 1px solid currentColor; font-style: normal; opacity: 0.85; }
.trip-tag em .i { width: 13px; height: 13px; stroke-width: 3; }

.trip-card .cats { display: flex; gap: 8px; }
.trip-card .cats span { display: inline-flex; align-items: center; gap: 2px; }
.trip-card .cats .i { width: 13px; height: 13px; }
.cover-empty .i { width: 40px; height: 40px; stroke-width: 1.5; }

/* ---------- PC: sidebar on the left, map on the right */

@media (min-width: 900px) {
  :root { --side: 420px; }

  #map { inset: 0 0 0 var(--side); }

  .top {
    right: auto;
    width: var(--side);
    padding: 16px 16px 4px;
    background: var(--bg);
    border-right: 1px solid var(--line);
  }
  .searchbar input, .account { box-shadow: none; }
  .searchbar input { background: var(--faint); }
  .chips { flex-wrap: wrap; overflow: visible; margin-top: 12px; padding-bottom: 8px; }
  .chip, .chip-select { box-shadow: none; }

  .list-sheet {
    top: var(--top-h, 120px);
    right: auto;
    width: var(--side);
    max-width: none;
    height: auto;
    margin: 0;
    border-radius: 0;
    border-right: 1px solid var(--line);
    box-shadow: none;
    transition: none;
  }
  .list-sheet.open { height: auto; }
  .list-head { flex-direction: row; justify-content: flex-start; height: auto; padding: 10px 16px; border-top: 1px solid var(--line); cursor: default; }
  .grip { display: none; }
  .floating { position: fixed; right: 20px; bottom: 24px; }

  .sheet, .sheet.tall {
    top: 0;
    right: auto;
    width: var(--side);
    max-width: none;
    max-height: none;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    border-right: 1px solid var(--line);
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
    animation: none;
  }
  .scrim { left: var(--side); background: rgba(0, 0, 0, 0.15); }

  .toast { left: calc(var(--side) + (100% - var(--side)) / 2); bottom: 32px; }
}

/* far zoom: plain coloured dots, no icon */
#map.far .pin { background: var(--c); }
#map.far .pin .i { display: none; }

@media (min-width: 900px) {
  /* one row each: trip, visited, category */
  .chip-group { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
  .chip-group:empty { display: none; }
  /* the visited row sits between the trip row and the category row */
  .top { display: flex; flex-direction: column; }
  .searchbar { width: 100%; }
  #filters { display: contents; }
  #tripChips { order: 1; margin-top: 12px; }
  .seg { order: 2; width: 100%; margin: 6px 0 0; box-shadow: none; }
  #catChips { order: 3; margin-top: 6px; }
  #statusSel { order: 4; align-self: flex-start; margin: 6px 0 8px; }
  #tripChips .chip:first-child { flex: 1; justify-content: flex-start; min-width: 0; }
  #tripChips .chip:first-child span { flex: 1; overflow: hidden; text-overflow: ellipsis; text-align: left; }
}

/* rating: one row of four, icon above the label */
.rating { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rating .chip { flex-direction: column; gap: 4px; height: auto; min-width: 0; padding: 8px 2px; font-size: 12px; }
.rating .chip .i { width: 18px; height: 18px; }

/* ---------- detail: address / phone under the title */
.contact { display: flex; flex-direction: column; gap: 4px; margin: -4px 0 14px; font-size: 14px; }
.contact-row { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.contact-row > .i { width: 15px; height: 15px; color: var(--muted); }
.contact-row > span { flex: 1; min-width: 0; line-height: 1.4; }
.contact-row a { color: var(--brand-dark); text-decoration: none; }
.copy {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.copy .i { width: 13px; height: 13px; }
.copy:active { background: var(--soft); }

/* directions: TMAP is the main button */
.btn.tmap { gap: 8px; width: 100%; min-height: 50px; margin-bottom: 8px; border-color: var(--brand); background: var(--brand); color: #fff; font-size: 15px; }
.btn.tmap .i { width: 18px; height: 18px; fill: currentColor; }
.links + .links { margin-top: 8px; }
.visited-on { margin: -4px 0 12px; font-size: 13px; }

/* category: one row of five */
.cat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cat-row .chip { min-width: 0; gap: 4px; padding: 0 2px; font-size: 12px; }
.cat-row .chip .i { width: 15px; height: 15px; }

/* trips as #hashtags */
.trip-tag { border-color: transparent; background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.trip-tag em { font-weight: 400; }
.trip-tag.on { border-color: transparent; }
.trip-tag.add { border: 1px dashed var(--line); background: var(--bg); color: var(--muted); font-weight: 400; }
.chip-radio > span > span:only-child { font-weight: inherit; }

/* "어느 여행에 저장할까요?" */
#tripSave { z-index: 44; }
.save-list { list-style: none; margin: 0 0 4px; padding: 0; }
.save-list .empty { display: flex; flex-direction: column; gap: 4px; padding: 16px 4px; color: var(--muted); font-size: 14px; text-align: center; }
.save-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 2px; border: 0; border-top: 1px solid var(--soft); background: none; text-align: left; }
.save-list li:first-child .save-row { border-top: 0; }
.save-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.save-ico .i { width: 20px; height: 20px; }
.save-row .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.save-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-row small { color: var(--muted); font-size: 13px; }
.save-check { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--line); border-radius: 50%; color: transparent; }
.save-check .i { width: 15px; height: 15px; stroke-width: 3; }
.save-row.on .save-check { border-color: var(--brand); background: var(--brand); color: #fff; }
#tripSave .done { width: 100%; margin-top: 8px; }
