/* 사용자 모바일 웹/PWA 화면의 수첩형 모바일 우선 스타일을 정의하는 파일입니다. */
@import url("https://fonts.googleapis.com/css2?family=Gaegu:wght@400;700&display=swap");

:root {
  --ink: #2d3a32;
  --sub: #756b5b;
  --paper: #fffaf0;
  --paper-2: #fffdf7;
  --paper-line: #eadfcb;
  --green: #03c75a;
  --green-dark: #0a8f48;
  --green-soft: #e8f8ee;
  --gold: #ead18b;
  --clay: #d39172;
  --lavender: #9d91bf;
  --sky: #7fc7af;
  --line: rgba(94, 78, 54, 0.16);
  --shadow-soft: 0 14px 30px rgba(94, 78, 54, 0.12);
  --shell-max-width: 520px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-min-height: clamp(60px, 9dvh, 68px);
  --nav-height: clamp(64px, 10dvh, 76px);
  --nav-bottom-offset: 0px;
  --page-block: clamp(14px, 3.8vw, 18px);
  --page-inline-start: clamp(20px, 5vw, 28px);
  --page-inline-end: clamp(13px, 4vw, 18px);
  --content-gap: clamp(8px, 2.6vw, 12px);
  --panel-padding: clamp(12px, 3.6vw, 18px);
  --card-padding: clamp(10px, 3.2vw, 14px);
  --tap-size: clamp(40px, 11vw, 48px);
  --icon-size: clamp(38px, 10vw, 48px);
  color: var(--ink);
  font-family: "Gaegu", "Noto Sans KR", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-width: 320px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  word-break: keep-all;
  background:
    linear-gradient(135deg, rgba(3, 199, 90, 0.1), transparent 34%),
    linear-gradient(225deg, rgba(234, 209, 139, 0.22), transparent 36%),
    #f5efe2;
}

body,
button,
input,
select,
textarea {
  font: 700 18px/1.25 "Gaegu", "Noto Sans KR", system-ui, sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--green-dark);
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  position: relative;
  width: min(100%, var(--shell-max-width));
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: 0 22px 58px rgba(94, 78, 54, 0.16);
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: var(--header-min-height) 0 calc(var(--nav-height) + var(--safe-bottom));
  background: linear-gradient(var(--paper-line) 1px, transparent 1px) 0 17px / 100% 30px;
  opacity: 0.5;
  pointer-events: none;
}

.app-shell::after {
  content: "";
  position: absolute;
  top: var(--header-min-height);
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  left: var(--page-inline-start);
  width: 2px;
  background: rgba(211, 145, 114, 0.24);
  pointer-events: none;
}

.app-header,
.app-main,
.bottom-nav {
  position: relative;
  z-index: 1;
}

.app-header {
  min-height: var(--header-min-height);
  padding: clamp(12px, 3vw, 14px) var(--page-inline-end) clamp(10px, 2.8vw, 12px) var(--page-inline-start);
  display: flex;
  align-items: center;
  gap: var(--content-gap);
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.app-mark {
  width: clamp(32px, 8.5vw, 38px);
  height: clamp(32px, 8.5vw, 38px);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.2);
  font-family: system-ui, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 18px;
  line-height: 1;
}

.app-title-group {
  min-width: 0;
  flex: 1;
}

.app-eyebrow {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1;
}

.app-title {
  display: block;
  margin: 3px 0 0;
  overflow: hidden;
  color: #fff;
  font-size: 23px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-status {
  flex: 0 0 auto;
  display: grid;
  gap: 5px;
  justify-items: end;
}

.level-pill,
.system-status,
.map-provider-pill,
.category-tag,
.status-tag,
.distance-tag,
.state-chip,
.type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
}

.level-pill {
  padding: 6px 11px 7px;
  color: var(--green-dark);
  background: #fffdf5;
  font-size: 17px;
  line-height: 1;
}

.system-status {
  min-height: 20px;
  gap: 5px;
  padding: 3px 7px 4px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.18);
  font-size: 13px;
  line-height: 1;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

.status-dot--ok {
  background: #e8f8ee;
}

.status-dot--fallback {
  background: #ffe1d5;
}

.app-main {
  width: 100%;
  min-height: 0;
  flex: 1;
  padding: var(--page-block) var(--page-inline-end) calc(var(--nav-height) + var(--safe-bottom) + var(--page-block) + 16px) var(--page-inline-start);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.app-main::-webkit-scrollbar,
.chip-row::-webkit-scrollbar,
.stamp-row::-webkit-scrollbar {
  display: none;
}

.view-stack[hidden],
.view-panel[hidden],
.consent-panel[hidden],
.bottom-nav[hidden] {
  display: none;
}

.view-panel {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 0;
}

.view-stack,
.view-panel > section,
.hero-panel,
.consent-panel,
.profile-panel,
.recommendation-card,
.note-card,
.quest-column,
.badge-card,
.ggumdori-card,
.map-detail-card,
.feature-card,
.metric-card,
.stat-item,
.recent-badge-card,
.quest-row,
.map-place-button {
  min-width: 0;
  max-width: 100%;
}

.page-kicker {
  margin: 0 0 7px;
  color: var(--green-dark);
  font-size: 18px;
  line-height: 1;
}

.page-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.02;
}

.page-copy {
  margin: 9px 0 0;
  color: var(--sub);
  font-size: 19px;
  line-height: 1.22;
}

.section-title {
  margin: 18px 2px 10px;
  color: #5f523d;
  font-size: 20px;
  line-height: 1;
}

.hero-panel,
.consent-panel,
.profile-panel,
.recommendation-card,
.note-card,
.quest-column,
.badge-card,
.ggumdori-card,
.map-detail-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper-2);
  box-shadow: 0 6px 16px rgba(94, 78, 54, 0.05);
}

.hero-panel,
.consent-panel {
  border-radius: clamp(16px, 4vw, 22px);
  background: linear-gradient(145deg, rgba(232, 248, 238, 0.9), rgba(255, 253, 247, 0.95));
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  padding: var(--panel-padding);
}

.consent-panel {
  display: grid;
  gap: var(--content-gap);
  padding: var(--panel-padding);
}

.consent-check-list {
  display: grid;
  gap: 9px;
}

.consent-check {
  min-height: 38px;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--ink);
}

.consent-check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--green-dark);
}

.oauth-login-list {
  display: grid;
  gap: 8px;
}

.home-hero {
  display: grid;
  gap: 13px;
}

.profile-panel {
  display: grid;
  gap: var(--content-gap);
  padding: var(--card-padding);
  background: rgba(255, 253, 247, 0.92);
}

.profile-main {
  display: grid;
  grid-template-columns: clamp(60px, 17vw, 72px) minmax(0, 1fr);
  gap: var(--content-gap);
  align-items: center;
}

.ggumdori-figure,
.avatar-mark,
.card-icon,
.badge-symbol,
.map-badge,
.note-icon,
.quest-icon,
.metric-icon,
.featured-badge {
  font-family: system-ui, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

.avatar-mark,
.ggumdori-figure {
  display: grid;
  place-items: center;
  border: 1px solid rgba(10, 143, 72, 0.16);
  background: var(--green-soft);
  color: var(--green-dark);
}

.avatar-mark {
  width: clamp(60px, 17vw, 72px);
  height: clamp(60px, 17vw, 72px);
  border-radius: 24px;
  overflow: hidden;
}

.profile-main .ggumdori-figure {
  width: clamp(60px, 17vw, 72px);
  height: clamp(60px, 17vw, 72px);
}

.avatar-mark img,
.ggumdori-figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-name {
  margin: 0;
  overflow: hidden;
  font-size: 24px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-meta {
  margin: 5px 0 0;
  color: var(--sub);
  font-size: 17px;
  line-height: 1.1;
}

.selected-ggumdori-name {
  display: block;
  margin-top: 6px;
  color: var(--green-dark);
  font-size: 18px;
  line-height: 1;
}

.progress-caption,
.badge-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #7a6a4d;
  font-size: 16px;
  line-height: 1;
}

.progress-bar,
.progress-track {
  height: clamp(9px, 2.5vw, 12px);
  overflow: hidden;
  border-radius: 999px;
  background: #eadfc9;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--green-dark));
}

.stat-row,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: var(--content-gap);
}

.stat-row {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 108px), 1fr));
}

.stat-item,
.metric-card {
  min-width: 0;
  padding: var(--card-padding);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff8e5;
}

.stat-value,
.metric-card strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 21px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-label,
.metric-card span:not(.metric-icon) {
  display: block;
  margin-top: 4px;
  color: var(--sub);
  font-size: 15px;
  line-height: 1;
}

.metric-icon {
  display: block;
  margin-bottom: 6px;
  font-size: 19px;
  line-height: 1;
}

.hero-actions,
.card-actions,
.map-coordinate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr));
  gap: var(--content-gap);
}

.primary-action,
.secondary-action,
.card-action,
.ggumdori-select,
.social-login-button,
.map-secondary-button,
.chip-button {
  min-height: var(--tap-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px 10px;
  border-radius: 14px;
  line-height: 1;
  white-space: nowrap;
}

.card-action {
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.card-action:active:not([disabled]) {
  transform: translateY(1px);
}

.card-action.is-pending,
.card-action[aria-busy="true"] {
  cursor: progress;
  opacity: 0.82;
}

.primary-action,
.card-action--primary {
  color: #fff;
  background: var(--green-dark);
  box-shadow: 0 7px 14px rgba(10, 143, 72, 0.21);
}

.secondary-action,
.card-action--secondary,
.ggumdori-select,
.social-login-button,
.map-secondary-button,
.chip-button {
  border: 1px solid rgba(10, 143, 72, 0.22);
  color: var(--green-dark);
  background: #edf8f1;
}

.social-login-button {
  gap: 8px;
  box-shadow: 0 5px 12px rgba(94, 78, 54, 0.08);
}

#naver-login-button {
  color: #fff;
  background: #03c75a;
}

#google-login-button {
  border-color: rgba(45, 58, 50, 0.18);
  color: var(--ink);
  background: #fff;
}

.card-action[disabled],
.ggumdori-select[disabled],
.social-login-button[disabled] {
  color: #8a7f6e;
  cursor: not-allowed;
  background: #eee6d5;
  box-shadow: none;
}

.card-action.is-pending[disabled],
.card-action[aria-busy="true"][disabled] {
  cursor: progress;
  opacity: 0.82;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 156px), 1fr));
  gap: var(--content-gap);
}

.feature-card {
  min-height: clamp(110px, 31vw, 132px);
  padding: var(--card-padding);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: inherit;
  text-align: left;
  background: var(--paper-2);
  box-shadow: 0 6px 16px rgba(94, 78, 54, 0.05);
}

.feature-card:hover,
.quest-card:hover,
.recommendation-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 20px rgba(94, 78, 54, 0.08);
}

.card-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  display: grid;
  place-items: center;
  margin-bottom: 9px;
  border: 1px solid rgba(10, 143, 72, 0.16);
  border-radius: 15px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 20px;
  line-height: 1;
}

.feature-card strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.feature-card span:not(.card-icon) {
  display: block;
  margin-top: 6px;
  color: var(--sub);
  font-size: 16px;
  line-height: 1.15;
}

.recent-badge-list,
.card-list,
.note-list,
.badge-grid,
.ggumdori-grid,
.map-place-list,
.quest-board {
  display: grid;
  gap: var(--content-gap);
}

.compact-card-list .recommendation-card:nth-child(n + 3) {
  display: none;
}

.recent-badge-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.recent-badge-card {
  min-height: 94px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: center;
  background: #fff8e5;
}

.badge-symbol {
  display: grid;
  place-items: center;
  width: var(--icon-size);
  height: var(--icon-size);
  margin: 0 auto 8px;
  border-radius: 14px;
  background: var(--green-soft);
  font-size: 21px;
  line-height: 1;
}

.recent-badge-card strong {
  display: block;
  overflow: hidden;
  font-size: 17px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-badge-card span:not(.badge-symbol) {
  display: block;
  margin-top: 5px;
  color: var(--sub);
  font-size: 14px;
  line-height: 1;
}

.recommendation-card,
.note-card,
.quest-column {
  display: grid;
  gap: var(--content-gap);
  padding: var(--card-padding);
}

.card-topline,
.badge-topline,
.note-topline,
.ggumdori-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.category-tag,
.status-tag,
.distance-tag,
.state-chip,
.type-chip {
  min-height: 28px;
  padding: 5px 9px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 15px;
  line-height: 1;
}

.distance-tag,
.type-chip {
  color: #725d28;
  background: #fff4d2;
}

.status-tag--done {
  color: #fff;
  background: var(--green-dark);
}

.status-tag--accepted {
  color: #725d28;
  background: #f5e9bd;
}

.card-title,
.note-card h3,
.badge-card h3,
.ggumdori-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.05;
}

.card-place,
.card-description,
.empty-message,
.note-date {
  margin: 0;
  color: var(--sub);
  font-size: 16px;
  line-height: 1.2;
}

.reward-row,
.note-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reward-row span,
.note-badges span {
  padding: 5px 8px 6px;
  border-radius: 999px;
  color: #5f523d;
  background: #fff4d2;
  font-size: 15px;
  line-height: 1;
}

.evidence-panel {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px dashed rgba(10, 143, 72, 0.28);
  border-radius: 12px;
  background: rgba(237, 248, 241, 0.62);
}

.evidence-upload-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px 9px;
  border: 1px solid rgba(10, 143, 72, 0.24);
  border-radius: 12px;
  color: var(--green-dark);
  background: #fffdf7;
  cursor: pointer;
  line-height: 1;
}

.evidence-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.evidence-upload-button:has(input:disabled) {
  color: #8a7f6e;
  cursor: progress;
  background: #eee6d5;
}

.evidence-status {
  min-height: 19px;
  margin: 0;
  color: #5f655d;
  font-size: 15px;
  line-height: 1.2;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.chip-button {
  flex: 0 0 auto;
  background: var(--paper-2);
  color: #5f523d;
}

.chip-button.is-active {
  border-color: var(--green-dark);
  color: #fff;
  background: var(--green-dark);
}

.quest-column {
  background: rgba(255, 253, 247, 0.92);
}

.quest-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(10, 143, 72, 0.1);
  border-radius: 14px;
  background: #fff8e5;
}

.quest-row strong {
  display: block;
  overflow: hidden;
  font-size: 18px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quest-row p {
  margin: 4px 0 0;
  color: var(--sub);
  font-size: 15px;
  line-height: 1;
}

.planned-quest-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.planned-quest-view-toggle {
  align-self: stretch;
  width: 100%;
  text-align: center;
  white-space: normal;
}

.planned-quest-row {
  display: grid;
  /* minmax(0, 1fr): 그리드 아이템 기본 min-width(auto)를 낮춰서, 영문으로 텍스트가
     길어져도 카드 밖으로 넘치지 않고 이 칸 안에서 줄임표 처리되게 한다. */
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(10, 143, 72, 0.1);
  border-radius: 14px;
  background: #fff8e5;
  touch-action: none;
}

.planned-quest-row.is-dragging {
  position: relative;
  z-index: 10;
  box-shadow: 0 10px 18px rgba(45, 58, 50, 0.22);
  opacity: 0.95;
}

.planned-quest-row__handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--sub);
  cursor: grab;
  touch-action: none;
}

.planned-quest-row__handle:active {
  cursor: grabbing;
}

.planned-quest-row__index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.planned-quest-row__text {
  min-width: 0;
}

.planned-quest-row__text strong {
  display: block;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planned-quest-row__text p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--sub);
  font-size: 14px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--content-gap);
  align-items: center;
  margin-bottom: 12px;
}

.map-provider-pill {
  padding: 7px 10px 8px;
  color: #74633e;
  background: #f5e9bd;
  font-size: 15px;
  line-height: 1;
}

.map-provider-pill.is-ready {
  color: var(--green-dark);
  background: var(--green-soft);
}

.map-provider-pill.is-error {
  color: #9b3f2a;
  background: #fbe2db;
}

.map-tools {
  display: grid;
  gap: var(--content-gap);
  margin-bottom: 12px;
}

.map-position-status {
  min-height: 23px;
  margin: 0;
  color: #5f655d;
  font-size: 16px;
  line-height: 1.2;
}

.map-shell {
  position: relative;
  min-height: clamp(330px, 52dvh, 430px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.56) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.56) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(160deg, #e7f8ed 0%, #fffaf0 48%, #eef7e6 100%);
  box-shadow: var(--shadow-soft);
}

.map-canvas {
  position: relative;
  width: 100%;
  height: clamp(330px, 52dvh, 430px);
  min-height: 0;
  overflow: hidden;
}

.map-canvas.is-naver {
  background: #eef3ed;
}

.map-road {
  position: absolute;
  border-radius: 999px;
  background: rgba(135, 122, 96, 0.25);
}

.map-river {
  position: absolute;
  width: 190px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(90deg, #b5ded5, var(--sky));
  box-shadow: 0 0 0 9px rgba(3, 199, 90, 0.09);
}

.map-park {
  position: absolute;
  border: 1px dashed rgba(10, 143, 72, 0.36);
  border-radius: 22px;
  background: rgba(3, 199, 90, 0.15);
}

.map-label {
  position: absolute;
  color: #38704f;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}

.map-marker,
.naver-marker,
.current-location-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: inherit;
  background: transparent;
  filter: drop-shadow(0 6px 8px rgba(45, 58, 50, 0.16));
}

.map-marker,
.current-location-marker {
  position: absolute;
}

.naver-marker {
  position: relative;
}

.map-badge {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 999px 999px 999px 4px;
  color: #fff;
  background: var(--green-dark);
  font-size: 17px;
  line-height: 1;
  transform: rotate(-5deg);
}

.map-marker.is-selected .map-badge,
.naver-marker.is-selected .map-badge {
  outline: 4px solid rgba(3, 199, 90, 0.28);
  transform: translateY(-2px) rotate(-5deg);
}

/* 계획한 퀘스트 목록에 담긴 장소는 순번 뱃지를 금색으로 키워서, 마커가 많을 때도
   지도에서 경로를 바로 따라갈 수 있게 한다. */
.naver-marker.is-itinerary .map-badge {
  width: 22px;
  height: 22px;
  background: #e0a72b;
  font-family: var(--font-display, inherit);
  font-size: 12px;
  font-weight: 700;
}

.naver-marker.is-itinerary .naver-marker-label {
  font-weight: 700;
  background: #fff8e5;
}

.map-marker-label,
.naver-marker-label {
  max-width: 118px;
  overflow: hidden;
  padding: 4px 8px 5px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 245, 0.94);
  font-size: 15px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 6px 12px rgba(45, 58, 50, 0.12);
}

.current-location-marker {
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--green-dark);
  box-shadow: 0 0 0 9px rgba(3, 199, 90, 0.18);
}

.naver-position-marker {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: rgba(10, 143, 72, 0.18);
  box-shadow: 0 0 0 8px rgba(3, 199, 90, 0.16), 0 5px 12px rgba(45, 58, 50, 0.18);
}

.naver-position-marker span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green-dark);
}

.player-location-marker {
  position: relative;
  width: 88px;
  height: 104px;
  pointer-events: none;
  user-select: none;
}

.player-location-marker--mock {
  position: absolute;
  transform: translate(-44px, -76px);
  z-index: 1000;
}

.player-location-marker__ring {
  position: absolute;
  left: 22px;
  top: 66px;
  width: 44px;
  height: 20px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(3, 199, 90, 0.26);
  box-shadow: 0 0 0 3px #13864e;
  animation: player-location-pulse 2s ease-out infinite;
}

.player-location-marker__shadow {
  position: absolute;
  left: 29px;
  top: 71px;
  width: 30px;
  height: 10px;
  border-radius: 50%;
  background: rgba(36, 64, 42, 0.3);
  animation: player-location-shadow 1.6s ease-in-out infinite;
}

.player-location-marker .player-location-marker__character {
  position: absolute;
  left: 16px;
  top: 10px;
  display: block;
  width: 56px;
  height: 64px;
  max-width: none;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px #fff) drop-shadow(0 0 3px #fff);
  transform-origin: 50% 100%;
  animation: player-location-bounce 1.6s ease-in-out infinite;
}

.player-location-marker__label {
  position: absolute;
  left: 50%;
  top: 83px;
  transform: translateX(-50%);
  padding: 3px 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #14613c;
  color: #fff;
  font: 700 11px/1.2 sans-serif;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

@keyframes player-location-bounce {
  0%, 65%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-12px) scale(0.98, 1.03); }
  43% { transform: translateY(0) scale(1.06, 0.94); }
  54% { transform: translateY(-4px) scale(1); }
}

@keyframes player-location-shadow {
  0%, 65%, 100% { transform: scale(1); opacity: 0.8; }
  25% { transform: scale(0.65); opacity: 0.35; }
  43% { transform: scale(1.08); opacity: 0.85; }
  54% { transform: scale(0.85); opacity: 0.6; }
}

@keyframes player-location-pulse {
  from { transform: scale(0.9); opacity: 0.9; }
  to { transform: scale(1.8); opacity: 0; }
}

body[data-reduced-motion="true"] .player-location-marker__character,
body[data-reduced-motion="true"] .player-location-marker__shadow,
body[data-reduced-motion="true"] .player-location-marker__ring {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .player-location-marker__character,
  .player-location-marker__shadow,
  .player-location-marker__ring { animation: none !important; }
}

.map-detail {
  margin-top: 12px;
}

.map-detail-card {
  display: grid;
  gap: var(--content-gap);
  padding: var(--card-padding);
  /* 그리드 아이템의 기본 min-width는 auto라, 영문 버튼처럼 줄바꿈 없는 긴 텍스트가 있으면
     카드 전체가 화면 폭을 넘어 가로 스크롤이 생긴다. 0으로 낮춰 폭에 맞게 줄어들게 한다. */
  min-width: 0;
}

.map-detail-head {
  display: flex;
  align-items: center;
  gap: var(--content-gap);
  min-width: 0;
}

.map-detail-copy {
  min-width: 0;
  flex: 1;
}

.map-detail-title {
  overflow: hidden;
  font-size: 22px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-detail-sub {
  margin-top: 5px;
  color: var(--sub);
  font-size: 16px;
  line-height: 1.1;
}

/* 공용 .primary-action/.secondary-action은 좁은 칸에서 버튼 높이가 늘어나지 않도록
   white-space: nowrap + flex-shrink: 0을 쓰는데(stitch-theme.css), 여기 카드 안에서는
   짧은 국문 라벨("퀘스트 보기", "일정에 추가") 대신 영문으로 바뀌면 그 텍스트가 카드보다
   길어져 화면 밖으로 가로 넘침이 생긴다. 이 카드 맥락에서만 줄바꿈을 허용해 카드 폭 안에서
   위아래로만 늘어나게 한다. */
.map-detail-card .primary-action,
.map-detail-card .secondary-action {
  width: 100%;
  min-width: 0;
  white-space: normal;
  text-align: center;
  word-break: break-word;
}

.map-place-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--content-gap);
  padding: var(--card-padding);
  border: 1px solid var(--line);
  border-radius: 17px;
  color: inherit;
  text-align: left;
  background: var(--paper-2);
}

.map-place-button.is-selected {
  border-color: rgba(10, 143, 72, 0.42);
  background: rgba(232, 248, 238, 0.78);
}

.badge-hero {
  margin: calc(-1 * var(--page-block)) calc(-1 * var(--page-inline-end)) 0 calc(-1 * var(--page-inline-start));
  padding: clamp(20px, 5vw, 26px) var(--page-inline-end) clamp(18px, 5vw, 22px) var(--page-inline-start);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.17), transparent 28%),
    linear-gradient(160deg, var(--green), var(--green-dark) 72%);
}

.featured-badge {
  width: clamp(112px, 32vw, 132px);
  height: clamp(112px, 32vw, 132px);
  margin: 14px auto 13px;
  display: grid;
  place-items: center;
  border: 5px solid rgba(255, 255, 255, 0.88);
  border-radius: 40px;
  color: var(--green-dark);
  background: linear-gradient(145deg, #fffdf7, #e9faef);
  box-shadow: 0 18px 32px rgba(45, 58, 50, 0.18), 0 0 0 12px rgba(255, 255, 255, 0.13);
  font-size: 52px;
  line-height: 1;
  transform: rotate(-4deg);
}

.featured-badge img {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.badge-hero-label,
.badge-hero-title,
.badge-hero-sub {
  color: #fff;
}

.badge-hero-label {
  margin: 0;
  font-size: 16px;
  line-height: 1;
}

.badge-hero-title {
  margin: 0;
  font-size: 32px;
  line-height: 1;
}

.badge-hero-sub {
  margin: 7px 0 0;
  color: #eefbf3;
  font-size: 18px;
  line-height: 1.1;
}

.badge-card,
.ggumdori-card {
  display: grid;
  gap: var(--content-gap);
  min-height: clamp(110px, 30vw, 128px);
  padding: var(--card-padding);
}

.ggumdori-grid,
.badge-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 146px), 1fr));
}

.ggumdori-figure {
  width: clamp(54px, 16vw, 64px);
  height: clamp(54px, 16vw, 64px);
  border-radius: 20px;
  font-size: 23px;
  line-height: 1;
}

.ggumdori-card.is-locked {
  opacity: 0.48;
  filter: grayscale(1);
}

.note-card {
  grid-template-columns: var(--icon-size) minmax(0, 1fr);
  align-items: start;
}

.note-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  display: grid;
  place-items: center;
  border: 1px solid rgba(10, 143, 72, 0.16);
  border-radius: 16px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 21px;
  line-height: 1;
}

.note-copy {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.note-photo-panel {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(10, 143, 72, 0.24);
  border-radius: 14px;
  background: rgba(232, 248, 238, 0.56);
}

.note-photo-figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(94, 78, 54, 0.16);
  border-radius: 10px;
  background: #f3eee3;
}

.note-photo-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: contain;
  background: #ede6d8;
}

.note-photo-caption,
.note-photo-status,
.note-entry-empty,
.note-entry-updated,
.note-character-count,
.note-editor-status {
  margin: 0;
  color: var(--sub);
  font-size: 14px;
  line-height: 1.35;
}

.note-photo-caption {
  padding: 7px 9px;
  background: #fffdf7;
}

.note-photo-status {
  padding: 6px 4px;
}

.note-photo-status--error,
.note-editor-status--error {
  color: #9a352f;
}

.note-photo-link {
  width: 100%;
}

.note-entry-display,
.note-entry-empty {
  padding: 10px;
  border: 1px dashed rgba(10, 143, 72, 0.28);
  border-radius: 12px;
  background: rgba(255, 250, 240, 0.82);
}

.note-entry-display {
  display: grid;
  gap: 7px;
}

.note-entry-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.note-entry-rating {
  color: #ba7915;
  font-family: system-ui, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 17px;
  letter-spacing: 0.05em;
  line-height: 1;
}

.note-entry-title {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.note-entry-body {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.note-editor {
  overflow: hidden;
  border: 1px solid rgba(10, 143, 72, 0.24);
  border-radius: 12px;
  background: #fffdf7;
}

.note-editor-summary {
  min-height: var(--tap-size);
  display: flex;
  align-items: center;
  padding: 9px 11px;
  color: var(--green-dark);
  cursor: pointer;
  list-style-position: inside;
}

.note-editor[open] .note-editor-summary {
  border-bottom: 1px solid rgba(10, 143, 72, 0.18);
  background: var(--green-soft);
}

.note-entry-form {
  min-width: 0;
  display: grid;
  gap: 11px;
  padding: 11px;
}

.note-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.note-field-label {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.note-field input,
.note-field select,
.note-field textarea {
  width: 100%;
  min-width: 0;
  min-height: var(--tap-size);
  padding: 9px 10px;
  border: 1px solid rgba(94, 78, 54, 0.28);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}

.note-field textarea {
  min-height: 132px;
  line-height: 1.45;
  resize: vertical;
}

.note-field input::placeholder,
.note-field textarea::placeholder {
  color: #978d7d;
  opacity: 1;
}

.note-field input[disabled],
.note-field select[disabled],
.note-field textarea[disabled] {
  cursor: progress;
  opacity: 0.66;
}

.note-rating-field[hidden] {
  display: none;
}

.note-character-count {
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

.note-editor-status {
  min-height: 19px;
}

.note-editor-status:empty {
  display: none;
}

.note-editor-status--success {
  color: var(--green-dark);
}

.note-editor-status--pending {
  color: #725d28;
}

.note-save-button {
  width: 100%;
}

.note-empty-state {
  display: grid;
  gap: 8px;
  padding: clamp(20px, 7vw, 32px) var(--panel-padding);
  border: 1px dashed rgba(10, 143, 72, 0.3);
  border-radius: 18px;
  text-align: center;
  background: rgba(255, 253, 247, 0.88);
}

.note-empty-state h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.data-note {
  margin: 13px 0 0;
  padding: 11px 12px;
  border: 1px dashed rgba(10, 143, 72, 0.28);
  border-radius: 16px;
  color: #4d6b58;
  background: rgba(232, 248, 238, 0.72);
  font-size: 16px;
  line-height: 1.25;
}

.bottom-nav {
  position: fixed;
  z-index: 30;
  right: auto;
  bottom: var(--nav-bottom-offset);
  left: 50%;
  width: min(100vw, var(--shell-max-width));
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  transform: translateX(-50%);
  align-items: center;
  border-top: 1px solid rgba(94, 78, 54, 0.1);
  background: rgba(255, 253, 245, 0.97);
  box-shadow: 0 -12px 28px rgba(94, 78, 54, 0.08);
}

/* v1 하단 탭의 .nav-link 규칙은 제거했다.
   v2 의 .nav-link 는 우측 드로어의 카트리지 메뉴이며 stitch-theme.css 가 정의한다.
   특히 옛 규칙의 이모지 폰트 스택이 Material Symbols 아이콘을 덮어썼다. */

.action-dialog-overlay {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(45, 58, 50, 0.38);
}

.action-dialog {
  width: min(100%, 420px);
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(10, 143, 72, 0.18);
  border-radius: 18px;
  color: var(--ink);
  background: var(--paper-2);
  box-shadow: 0 22px 54px rgba(45, 58, 50, 0.24);
}

.action-dialog--warning {
  border-color: rgba(155, 63, 42, 0.24);
}

.action-dialog h2,
.action-dialog p {
  margin: 0;
}

.action-dialog h2 {
  font-size: 25px;
  line-height: 1.05;
}

.action-dialog p,
.action-dialog li {
  color: var(--sub);
  font-size: 17px;
  line-height: 1.2;
}

.action-dialog-details {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  list-style: none;
}

.action-dialog-details li {
  padding: 7px 9px 8px;
  border-radius: 10px;
  background: #fff4d2;
}

.primary-action:focus-visible,
.secondary-action:focus-visible,
.card-action:focus-visible,
.evidence-upload-button:focus-within,
.ggumdori-select:focus-visible,
.social-login-button:focus-visible,
.map-secondary-button:focus-visible,
.chip-button:focus-visible,
.feature-card:focus-visible,
.nav-link:focus-visible,
.map-marker:focus-visible,
.map-place-button:focus-visible {
  outline: 3px solid rgba(3, 199, 90, 0.34);
  outline-offset: 2px;
}

.note-editor-summary:focus-visible,
.note-field input:focus-visible,
.note-field select:focus-visible,
.note-field textarea:focus-visible,
.note-photo-link:focus-visible {
  outline: 3px solid rgba(3, 199, 90, 0.34);
  outline-offset: 2px;
}

@media (min-width: 720px) {
  :root {
    --nav-bottom-offset: 18px;
  }

  body {
    padding: 18px;
  }

  .app-shell {
    height: min(860px, calc(100vh - 36px));
    height: min(860px, calc(100dvh - 36px));
    border: 1px solid rgba(94, 78, 54, 0.1);
    border-radius: 30px;
  }

  .bottom-nav {
    width: min(var(--shell-max-width), calc(100vw - 36px));
    border-radius: 0 0 28px 28px;
  }
}

@media (max-width: 380px) {
  :root {
    --nav-height: 66px;
    --page-inline-start: 18px;
    --page-inline-end: 12px;
  }

  body,
  button,
  input,
  select,
  textarea {
    font-size: 17px;
  }

  .page-title {
    font-size: 30px;
  }

  .system-status span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
