@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600&display=swap');

/* ─── Reset & Base ─────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #ffffff;
  --bg-sub: #f7f7f7;
  --bg-hover: #f0f0f0;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --text-sub: #888888;
  --accent: #444444;
  --sidebar-w: 200px;
  --header-h: 56px;
  --radius: 8px;
  --trans: 160ms ease;
}

html,
body {
  height: 100%;
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input {
  font-family: inherit;
  font-size: 14px;
}

/* ─── App Shell ─────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  min-height: 100vh;
}

/* ─── Header ────────────────────────────────────────────── */
.header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}

.header-logo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
}

.header-spacer {
  flex: 1;
}

/* header avatar removed — moved to sidebar */

/* ─── Sidebar ───────────────────────────────────────────── */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 16px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}

/* ─── Sidebar User Block ────────────────────────────────────── */
.sidebar-user {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 10px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-sub);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--trans);
  user-select: none;
}

.sidebar-avatar:hover {
  border-color: #bbb;
}

/* ─── User Dropdown ─────────────────────────────────────────── */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 172px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  z-index: 200;
}

.user-dropdown.open {
  display: flex;
}

.dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.dropdown-btn {
  padding: 7px 10px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: opacity var(--trans);
  border: none;
  font-family: inherit;
}

.dropdown-btn:hover {
  opacity: 0.75;
}

.follow-btn {
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

.logout-btn {
  background: var(--text);
  color: var(--bg);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 400;
  transition: background var(--trans), color var(--trans);
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--bg-hover);
  color: var(--text);
  font-weight: 500;
}

.nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.55;
  flex-shrink: 0;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  opacity: 0.9;
}

/* ─── Main Content ──────────────────────────────────────── */
.main {
  padding: 28px 32px;
  background: var(--bg);
  min-height: calc(100vh - var(--header-h));
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* ─── Page Title Row (title + inline button) ────────────────── */
.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-title-row .page-title {
  margin-bottom: 0;
}

.logout-inline {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: color var(--trans), border-color var(--trans);
}

.logout-inline:hover {
  color: var(--text);
  border-color: #aaa;
}

/* ─── Tab Bar ───────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-sub);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--trans), border-color var(--trans);
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--text);
  font-weight: 500;
  border-bottom-color: var(--text);
}

/* ─── Card Grid ─────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.card {
  background: var(--bg-sub);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  font-size: 12px;
  transition: border-color var(--trans);
}

.card:hover {
  border-color: #bbb;
}

/* ─── User List ─────────────────────────────────────────── */
.user-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  transition: background var(--trans);
}

.user-row:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
}

.user-meta {
  font-size: 12px;
  color: var(--text-sub);
}

/* ─── Profile Block ─────────────────────────────────────── */
.profile-block {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-sub);
  margin-bottom: 24px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-name {
  font-size: 16px;
  font-weight: 600;
}

.profile-sub {
  font-size: 13px;
  color: var(--text-sub);
}

.profile-stats {
  display: flex;
  gap: 24px;
  margin-top: 8px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: default;
  transition: opacity var(--trans);
}

a.stat-item {
  cursor: pointer;
}

a.stat-item:hover {
  opacity: 0.65;
}

.stat-num {
  font-size: 15px;
  font-weight: 600;
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-sub);
}

/* ─── Section Divider ───────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sub);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 6px 12px 4px;
  margin-top: 8px;
}

/* ─── Empty State ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-sub);
  gap: 8px;
  min-height: 50vh;
  grid-column: 1 / -1;
  width: 100%;
}

.empty-icon {
  font-size: 28px;
  opacity: 0.4;
}

.empty-text {
  font-size: 13px;
}

/* ─── Login Page ────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sub);
}

.login-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
}

.form-input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--trans);
}

.form-input:focus {
  border-color: #aaa;
}

.form-btn {
  padding: 10px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: opacity var(--trans);
}

.form-btn:hover {
  opacity: 0.8;
}

.form-hint {
  font-size: 12px;
  color: var(--text-sub);
  text-align: center;
}

/* ─── Profile Name Edit ─────────────────────────────────── */
.profile-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  color: var(--text-sub);
  transition: background var(--trans), color var(--trans);
  flex-shrink: 0;
}

.edit-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.edit-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nickname-input {
  padding: 4px 9px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  color: var(--text);
  background: var(--bg);
  width: 160px;
  transition: border-color var(--trans);
}

.nickname-input:focus {
  border-color: #aaa;
}

.edit-save-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  transition: opacity var(--trans);
}

.edit-save-btn:hover {
  opacity: 0.75;
}

.edit-cancel-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color var(--trans), border-color var(--trans);
}

.edit-cancel-btn:hover {
  color: var(--text);
  border-color: #aaa;
}

/* ─── Back Button + Title Row ───────────────────────────── */
.back-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  color: var(--text-sub);
  transition: background var(--trans), color var(--trans);
  flex-shrink: 0;
}

.back-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.back-title-row .page-title {
  margin-bottom: 0;
}

/* ─── Trip Register Button (홈 우상단) ──────────────────────── */
.trip-register-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  transition: opacity var(--trans);
}

.trip-register-btn:hover {
  opacity: 0.78;
}

/* ─── Trip Cards (홈) ────────────────────────────────────────── */
.trip-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* 연도 구분 헤더 */
.year-divider {
  grid-column: 1 / -1;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  padding: 8px 0 4px;
  margin-top: 8px;
  border-bottom: 1px solid var(--border);
}

.trip-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--bg-sub);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow var(--trans), transform var(--trans);
  display: block;
}

.trip-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
  transform: translateY(-2px);
}

/* 썸네일 이미지 */
.trip-card-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 사진 없을 때 배경 */
.trip-card-nophoto {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
  font-size: 28px;
  opacity: 0.5;
}

/* 카드 상단 오버레이 */
.trip-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 10px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trip-card-period {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.2px;
}

.trip-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ─── Trip Form Common ───────────────────────────────────────── */
.trip-section {
  margin-bottom: 20px;
}

.trip-field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
  margin-bottom: 5px;
}

.trip-field-hint {
  font-size: 11px;
  font-weight: 400;
  color: #aaa;
  margin-left: 4px;
}

.trip-char-count {
  font-size: 11px;
  font-weight: 400;
  color: #bbb;
  margin-left: 6px;
}

.trip-period-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trip-period-sep {
  color: var(--text-sub);
  font-size: 14px;
}

.trip-date-input {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  color: var(--text);
  font-size: 13px;
  width: 130px;
  transition: border-color var(--trans);
}

.trip-date-input:focus {
  border-color: #aaa;
}

/* ─── Place Card ─────────────────────────────────────────────── */
.trip-place-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  background: var(--bg-sub);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trip-place-readonly {
  background: var(--bg);
}

.trip-place-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trip-place-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.trip-place-remove {
  font-size: 12px;
  color: var(--text-sub);
  padding: 2px 6px;
  border-radius: 4px;
  transition: background var(--trans), color var(--trans);
}

.trip-place-remove:hover {
  background: var(--bg-hover);
  color: #e55;
}

.trip-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.trip-field-row {
  display: flex;
  gap: 14px;
}

.trip-field-input {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  color: var(--text);
  background: var(--bg);
  font-size: 13px;
  transition: border-color var(--trans);
}

.trip-field-input:focus {
  border-color: #aaa;
}

.trip-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trip-time-input {
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  color: var(--text);
  background: var(--bg);
  font-size: 13px;
  width: 72px;
  transition: border-color var(--trans);
  text-align: center;
}

.trip-time-input:focus {
  border-color: #aaa;
}

.trip-textarea {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  color: var(--text);
  background: var(--bg);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  transition: border-color var(--trans);
  line-height: 1.6;
}

.trip-textarea:focus {
  border-color: #aaa;
}

/* ─── Photo Upload ───────────────────────────────────────────── */
.trip-photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.photo-thumb-wrap {
  position: relative;
  width: 100px;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.photo-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.photo-thumb-rm {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  background: #333;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  z-index: 2;
  border: none;
}

.photo-descr-input {
  width: 100%;
  font-size: 11px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  resize: vertical;
  background: var(--bg-sub);
  color: var(--text);
}

.photo-descr-btn {
  width: 100%;
  padding: 4px 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-sub);
  background: var(--bg-sub);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
}

.photo-descr-btn:hover {
  background: var(--border);
  color: var(--text);
}

/* ── Nearby Places Candidates ── */
.nearby-places-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 6px;
}

.nearby-place-item {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bg-sub);
  cursor: pointer;
  transition: background 0.15s;
}

.nearby-place-item:hover {
  background: #f0f0f0;
}

.nearby-place-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.nearby-place-addr {
  font-size: 11px;
  color: var(--text-sub);
}

.nearby-places-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 4px;
  padding-left: 4px;
}

.trip-photo-add-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-sub);
  transition: background var(--trans), color var(--trans);
}

.trip-photo-add-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ─── Add Place / Action Buttons ────────────────────────────── */
.trip-add-place-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-sub);
  width: 100%;
  justify-content: center;
  margin-bottom: 20px;
  transition: border-color var(--trans), color var(--trans), background var(--trans);
}

.trip-add-place-btn:hover {
  border-color: #aaa;
  color: var(--text);
  background: var(--bg-sub);
}

.trip-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.trip-cancel-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-sub);
  transition: color var(--trans), border-color var(--trans);
}

.trip-cancel-btn:hover {
  color: var(--text);
  border-color: #aaa;
}

.trip-submit-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  transition: opacity var(--trans);
}

.trip-submit-btn:hover {
  opacity: 0.78;
}

.trip-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─── Detail View ────────────────────────────────────────────── */
.trip-detail-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.trip-detail-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.trip-detail-lbl {
  font-size: 12px;
  color: var(--text-sub);
  min-width: 64px;
  flex-shrink: 0;
}

.trip-detail-val {
  font-size: 13px;
  color: var(--text);
}

.trip-detail-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.trip-edit-link {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-sub);
  transition: color var(--trans), border-color var(--trans);
}

.trip-edit-link:hover {
  color: var(--text);
  border-color: #aaa;
}

.trip-save-btn {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  transition: all var(--trans);
  cursor: pointer;
  color: var(--text-sub);
}

.trip-save-btn:hover {
  color: var(--text);
}

.trip-save-btn.saved {
  color: #fac608;
}

.trip-save-btn.saved svg {
  fill: #fac608;
  stroke: #fac608;
}

/* ─── Google Maps Link (상세 페이지) ─────────────────────────── */
.trip-map-link {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sub);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--trans);
}

.trip-map-link:hover {
  color: var(--text);
}

/* Autocomplete 드롭다운이 다른 요소 위에 표시되도록 */
.pac-container {
  z-index: 9999;
}

/* ── Transport Connector (장소 사이 이동수단 연결부) ── */
.transport-connector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  margin: 2px 0;
}

.tconn-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

.tconn-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tconn-label {
  font-size: 11px;
  color: var(--text-sub);
  white-space: nowrap;
}

.tconn-select {
  font-family: inherit;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}


/* ══════════════════════════════════════════════════════════════
   ── Mobile Responsive & Hamburger Menu ──────────────────────
══════════════════════════════════════════════════════════════ */

/* 햄버거 버튼 — 데스크탑에서는 숨김 */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  border: none;
  flex-shrink: 0;
  transition: background var(--trans);
}

.hamburger-btn:hover {
  background: var(--bg-hover);
}

.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.hamburger-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 사이드바 오버레이 (모바일) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  z-index: 98;
  backdrop-filter: blur(1px);
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 768px) {

  /* 앱 그리드를 단일 컬럼으로 */
  .app {
    grid-template-columns: 1fr;
  }

  /* 사이드바: 고정 패널로 변환 */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 220px;
    z-index: 99;
    background: var(--bg);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4, 0, .2, 1);
    padding-top: calc(var(--header-h) + 12px);
    overflow-y: auto;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  /* 메인 전체 폭 사용 */
  .main {
    width: 100%;
    padding: 16px 14px;
  }

  /* 햄버거 표시 */
  .hamburger-btn {
    display: flex;
  }

  /* 헤더 패딩 조절 */
  .header {
    padding: 0 14px;
  }
}

/* ══════════════════════════════════════════════════════════════
   ── Place Detail Layout (지도 좌측 정사각형 + 정보 우측) ────
══════════════════════════════════════════════════════════════ */
.place-detail-layout {
  display: grid;
  grid-template-columns: 1fr minmax(auto, 400px);
  gap: 16px;
  align-items: start;
}

.place-detail-map {
  width: 100%;
  max-width: 400px;
  height: 400px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  /* CSS filter 제거 — Maps styles API로 흑백 처리하여 마커 원본 색상 유지 */
}

.place-detail-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.place-detail-info .trip-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.place-detail-info .trip-detail-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-sub);
}

.place-detail-info .trip-detail-val {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.place-detail-info .trip-detail-desc {
  font-size: 12px;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

/* 등록/수정 페이지의 지도 — Maps styles API로 흑백 처리하므로 CSS filter 없음 */

@media (max-width: 600px) {
  .place-detail-layout {
    grid-template-columns: 1fr;
  }

  .place-detail-map {
    width: 100%;
    max-width: 100%;
    height: 260px;
  }
}

/* ── 태그 디자인 (노란색 알약 형태) ── */
.trip-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.trip-tag-pill {
  background-color: #FAC608;
  color: #1a1a1a;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ══════════════════════════════════════════════════════════════
   ── Photo Slider ─────────────────────────────────────────────
══════════════════════════════════════════════════════════════ */
.photo-slider {
  position: relative;
  width: 100%;
  max-width: 600px;
  user-select: none;
}

.slider-viewport {
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-sub);
  cursor: grab;
  position: relative;
  width: 100%;
}

.slider-viewport:active {
  cursor: grabbing;
}

.slider-track {
  display: flex;
  transition: transform 0.3s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}

.slider-item {
  width: 100%;
  min-width: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sub);
  min-height: 200px;
}

.slider-item img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  display: block;
  cursor: pointer;
  transition: opacity 0.15s;
  background: transparent;
}

.slider-item img:hover {
  opacity: 0.9;
}

/* PC 화살표 — slider-viewport 안에 있으므로 top:50% 기준이 이미지 영역 */
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.18s, opacity 0.18s;
  flex-shrink: 0;
  padding-bottom: 2px;
  padding-left: 2px;
}

.slider-nav:hover {
  background: rgba(0, 0, 0, 0.72);
}

.slider-prev {
  left: 8px;
  padding-right: 2px;
}

.slider-next {
  right: 8px;
  padding-left: 2px;
}

/* 모바일에서는 화살표 숨김 (스와이프로 작동) */
@media (max-width: 600px) {
  .slider-nav {
    display: none;
  }
}

/* 점 인디케이터 */
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
  flex-shrink: 0;
}

.slider-dot.active {
  background: var(--text);
  transform: scale(1.35);
}

/* 사진 1장일 때 — 정사각형 */
.single-photo-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  border-radius: 8px;
  cursor: pointer;
  display: block;
  background: var(--bg-sub);
  transition: opacity 0.15s;
  margin: 0 auto;
}

.single-photo-img:hover {
  opacity: 0.88;
}

/* ══════════════════════════════════════════════════════════════
   ── Places / Hashtag Search Results ──────────────────────────
══════════════════════════════════════════════════════════════ */
.places-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.place-card {
  display: flex;
  background: var(--bg-sub);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--trans), box-shadow var(--trans);
  text-decoration: none;
  color: inherit;
  align-items: stretch;
}

.place-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.place-photo {
  width: 120px;
  height: 120px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-hover);
}

.place-info {
  display: flex;
  flex-direction: column;
  padding: 14px;
  flex: 1;
  min-width: 0;
}

.place-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-sub {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

/* ══════════════════════════════════════════════════════════════
   ── Lightbox ─────────────────────────────────────────────────
══════════════════════════════════════════════════════════════ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lb-fade-in 0.15s ease;
}

@keyframes lb-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.lightbox-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 95vw;
  max-height: 95vh;
}

.lightbox-img {
  max-width: 80vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
  animation: lb-img-in 0.18s ease;
}

@keyframes lb-img-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2001;
  transition: background 0.18s, opacity 0.18s;
  line-height: 1;
  padding-bottom: 3px;
}

.lightbox-lp {
  left: 16px;
  padding-right: 2px;
}

.lightbox-rp {
  right: 16px;
  padding-left: 2px;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.32);
}

.lightbox-close {
  position: fixed;
  top: 14px;
  right: 18px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.3);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
  z-index: 2001;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lightbox-counter {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* 모바일 라이트박스 — 화살표 숨김, 이미지 전체 폭 */
@media (max-width: 600px) {
  .lightbox-img {
    max-width: 96vw;
  }

  .lightbox-nav {
    display: none;
  }
}

/* ─── Route Color Picker ─────────────────────────────────────── */
.route-color-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.color-input-box {
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: none;
  overflow: hidden;
}

.color-input-box::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input-box::-webkit-color-swatch {
  border: 1px solid var(--border);
  border-radius: 50%;
}

.hex-input {
  width: 110px;
  text-transform: uppercase;
}

.fav-colors-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.fav-color-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
}

.fav-color-btn:hover {
  transform: scale(1.15);
}

.fav-color-btn.wants-delete::after {
  content: "✕";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 14px;
  opacity: 0.6;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.fav-color-none {
  font-size: 13px;
  color: var(--text-sub);
}

.add-fav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px dashed var(--text-sub);
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: border-color 0.2s, color 0.2s;
}

.add-fav-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ═══════════════════════════════════════════════════════════
   ── 쿠키 동의 배너 ─────────────────────────────────────────
   ═══════════════════════════════════════════════════════════ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(20, 20, 20, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f0f0f0;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  animation: cookieSlideUp 0.3s cubic-bezier(.2, .8, .4, 1) both;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
}

@keyframes cookieSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-banner.hide {
  animation: cookieSlideDown 0.25s ease forwards;
}

@keyframes cookieSlideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }

  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

.cookie-text {
  flex: 1;
  font-size: 12.5px;
  line-height: 1.65;
  color: #d8d8d8;
  min-width: 220px;
}

.cookie-text strong {
  color: #fff;
  font-weight: 600;
}

.cookie-text a {
  color: #a8c4ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-text a:hover {
  color: #d0e4ff;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  border: none;
  font-family: inherit;
  white-space: nowrap;
}

.cookie-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.cookie-btn-accept {
  background: #ffffff;
  color: #111;
}

.cookie-btn-reject {
  background: transparent;
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.cookie-btn-reject:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* 쿠키 배너 떠있을 때 바닥 여백 */
body.cookie-visible {
  padding-bottom: 80px;
}

.nearby-filter-btn {
  background: var(--bg-sub);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s;
}

.nearby-filter-btn.active {
  background: #FAC608;
  border-color: #FAC608;
  color: #1a1a1a;
  font-weight: 600;
}