/* ── PHOTO SOURCE SHEET ── */
.ps-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 300;
  display: none;
}
.ps-backdrop.open { display: block; }
.comm-sheet.ps-sheet { z-index: 301; }
.ps-src-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin-bottom: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ps-src-btn:active { background: var(--bg2); }

.login-badge {
  position: absolute;
  right: 14px;
  bottom: calc(var(--nav-h) + var(--nav-sb) + 10px);
  z-index: 90;
  display: flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(124,58,237,0.16);
  border: 1px solid rgba(124,58,237,0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0.85;
}
.login-badge[hidden] { display: none; }
.login-badge-main {
  padding: 6px 12px 6px 14px;
  background: none; border: none;
  color: var(--accent2); font-size: 12px; font-weight: 700;
  font-family: inherit; cursor: pointer;
}
.login-badge-x {
  padding: 6px 10px 6px 0;
  background: none; border: none;
  color: var(--text3); font-size: 15px; line-height: 1;
  font-family: inherit; cursor: pointer;
}

/* ── TRIP SETTINGS SHEET ── */
.ts-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 300;
  display: none;
}
.ts-backdrop.open { display: block; }

.comm-sheet.ts-sheet { z-index: 301; }

.ts-party-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ts-party-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: background 0.12s;
}
.ts-party-btn:active { background: var(--bg2); }
.ts-party-num {
  font-size: 20px; font-weight: 700;
  min-width: 24px; text-align: center;
  color: var(--text);
}
.ts-party-unit { font-size: 14px; color: var(--text3); }

/* ── LEDGER HEADER ACTIONS ── */
.ledger-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.log-pill {
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.log-pill:active { transform: scale(0.93); }
.log-pill--log {
  border-color: rgba(124,58,237,0.35);
  background: var(--accent-bg);
  color: var(--accent2);
}
@keyframes log-limit-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}
.log-pill-limit {
  animation: log-limit-blink 2.4s ease-in-out infinite;
  display: inline-block;
}

/* ── TRIP LOG DETAIL ── */
.trip-log-detail {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  /* 하단 탭 메뉴 뒤로 일정 카드가 깔리지 않도록 메뉴 높이만큼 비움 */
  bottom: calc(var(--nav-h) + var(--nav-sb));
  z-index: 80;
  flex-direction: column;
  background: var(--bg);
  padding-top: var(--safe-t);
  overflow: hidden;
  min-height: 0;
}
.trip-log-detail.open { display: flex; }
.trip-log-detail .scroll-area {
  flex: 1 1 0;
  min-height: 0;
  padding-bottom: 28px;
}
.log-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 8px;
  flex-shrink: 0;
}
.log-detail-tripbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px 6px;
  font-size: 13px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.log-detail-tripbar #log-detail-flag { font-size: 20px; }
.log-detail-tripbar #log-detail-country { font-weight: 700; color: var(--text); }
.log-detail-tripbar #log-detail-city,
.log-detail-tripbar #log-detail-companions { color: var(--text); }
.log-tripbar-sep { color: var(--text3); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 320;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-sheet {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg2);
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--border2);
  border-bottom: none;
  padding-bottom: var(--safe-b);
  max-height: 82vh;
  max-height: min(82vh, calc(100% - 8px));
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle {
  width: 36px; height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 10px;
  flex-shrink: 0;
}
.modal-header h2 { font-size: 18px; font-weight: 800; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 15px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-search {
  margin: 0 14px 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  flex-shrink: 0;
  font-family: inherit;
}
.modal-search::placeholder { color: var(--text3); }
.modal-search:focus { border-color: rgba(124,58,237,0.35); }

.modal-list {
  overflow-y: auto;
  padding: 0 10px 16px;
  -webkit-overflow-scrolling: touch;
}
.modal-list::-webkit-scrollbar { display: none; }

.modal-group {
  position: sticky; top: 0; z-index: 1; padding: 10px 12px 6px; margin-top: 4px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em; color: var(--accent2); background: var(--bg2);
}
.modal-item {
  display: flex; align-items: center;
  padding: 11px 12px;
  border-radius: 13px;
  cursor: pointer;
  gap: 11px;
  transition: background 0.1s;
}
.modal-item:active { background: var(--surface); }
.modal-item.selected { background: rgba(124,58,237,0.1); }

.modal-flag { font-size: 30px; flex-shrink: 0; }
.modal-info { flex: 1; min-width: 0; }
.modal-code { font-size: 16px; font-weight: 800; letter-spacing: -0.2px; }
.modal-name { font-size: 12px; color: var(--text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-check {
  width: 24px; height: 24px;
  border-radius: 8px;
  border: 2px solid var(--border2);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: all 0.15s;
}
.modal-item.selected .modal-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--nav-sb) + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(26,26,40,0.96);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #EEEEF8;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  white-space: nowrap;
  z-index: 200;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── LOADING LINE ── */
.load-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), #6366F1);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease, opacity 0.4s;
  z-index: 300;
  opacity: 0;
}
.load-bar.loading { transform: scaleX(0.7); opacity: 1; transition: transform 1.5s ease-out, opacity 0.2s; }
.load-bar.done { transform: scaleX(1); opacity: 0; transition: transform 0.2s ease, opacity 0.4s 0.1s; }

/* ── SECTION DIVIDER ── */
.section-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 8px;
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0 2px;
}
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── TRIP BAR ── */
#view-ledger .ledger-scroll {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  padding-bottom: 28px;
}

.trip-encourage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px 48px;
  min-height: 160px;
  pointer-events: none;
  position: relative;
  overflow: hidden;
}
.trip-encourage[hidden] { display: none; }
.trip-encourage-copy {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: 8px 6px 12px;
}
.trip-encourage-line {
  margin: 0;
  font-family: 'Nanum Pen Script', 'Segoe Print', 'Apple SD Gothic Neo', cursive;
  font-style: normal;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  min-height: 1.55em;
}
.trip-encourage-line--sub {
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.65;
  min-height: 1.65em;
}
.trip-write-text { display: inline; }
/* 카드가 많을 때: 첫 카드 위로 올라가고 글자는 20% 작게 */
.trip-encourage.is-top { flex: none; min-height: 0; padding: 6px 24px 2px; }
.trip-encourage.is-top .trip-encourage-copy { padding: 4px 6px 6px; }
.trip-encourage.is-top .trip-encourage-line { font-size: 20.8px; }
.trip-encourage.is-top .trip-encourage-line--sub { margin-top: 4px; font-size: 16px; }
.trip-ink {
  display: inline-block;
  background: linear-gradient(120deg, #c4b5fd 0%, var(--accent2) 42%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: tripInkIn 0.28s ease-out both;
}
:root[data-theme="light"] .trip-ink {
  background: linear-gradient(120deg, #6d28d9 0%, #7c3aed 45%, #4f46e5 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
@keyframes tripInkIn {
  from {
    opacity: 0;
    transform: translate(3px, 7px) rotate(-12deg) scale(0.72);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
.trip-pen {
  display: none;
  width: 9px;
  height: 9px;
  margin-left: 3px;
  vertical-align: middle;
  border-radius: 50% 50% 50% 4px;
  background: var(--accent2);
  box-shadow: 0 0 10px var(--accent-glow);
  transform: rotate(-38deg);
  animation: tripPenBob 0.38s ease-in-out infinite;
}
.trip-pen.is-writing { display: inline-block; }
@keyframes tripPenBob {
  0%, 100% { transform: rotate(-38deg) translate(0, 0); }
  50% { transform: rotate(-28deg) translate(1px, 3px); }
}
.trip-ink.is-wiped {
  animation: tripChalkWipe 0.22s ease-out forwards;
}
@keyframes tripChalkWipe {
  0% { opacity: 1; filter: none; }
  55% { opacity: 0.45; filter: blur(2px); transform: skewX(-16deg) scaleX(1.12); }
  100% { opacity: 0; filter: blur(5px); transform: skewX(-22deg) translateX(8px) scaleX(1.2); }
}
.trip-eraser {
  position: absolute;
  left: 0;
  top: 0;
  width: 62px;
  height: 34px;
  border-radius: 8px 8px 5px 5px;
  background:
    linear-gradient(#e8dcc4 0 10px, #7a5130 10px 12px, #5a3a22 12px 100%);
  box-shadow:
    0 4px 12px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.35);
  opacity: 0;
  z-index: 8;
  pointer-events: none;
  will-change: transform;
}
.trip-eraser::after {
  content: '';
  position: absolute;
  left: 6px; right: 6px; bottom: 5px;
  height: 8px;
  border-radius: 3px;
  background: repeating-linear-gradient(
    90deg,
    #3d2818 0 4px,
    #6b4a2e 4px 8px
  );
  opacity: 0.55;
}
.trip-encourage-line { position: relative; z-index: 1; }

.trip-meta-block {
  flex-shrink: 0;
}
.trip-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px;
}
.pack-chip-wrap {
  padding: 0 16px 8px;
}
.pack-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, #f59e0b 55%, var(--border2));
  background: color-mix(in srgb, #f59e0b 16%, var(--surface));
  color: #fbbf24;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pack-chip:active { transform: scale(0.97); }
.pack-chip-wrap.is-hidden { display: none; }
.pack-chip-wrap.is-floating {
  position: absolute; left: 14px; bottom: calc(var(--nav-h) + var(--nav-sb) + 10px);
  padding: 0; z-index: 90;
}
.pack-chip-wrap.is-floating .pack-chip { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28); padding: 8px 14px; }
.pack-chip--card { margin: 0 0 0 4px; padding: 2px 7px; font-size: 11px; vertical-align: middle; }
.pack-chip.is-full {
  border-color: color-mix(in srgb, #34d399 55%, var(--border2));
  background: color-mix(in srgb, #34d399 18%, var(--surface));
  color: #6ee7b7;
}
:root[data-theme="light"] .pack-chip { color: #b45309; }
:root[data-theme="light"] .pack-chip.is-full { color: #047857; }
.trip-extra {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 10px;
}
.trip-extra-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border2);
}
.trip-extra-field.has-value { border-color: rgba(124,58,237,0.3); }
.trip-extra-ico {
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}
.trip-extra-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  background: none;
  outline: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
}
.trip-extra-input::placeholder {
  color: var(--text3);
  font-weight: 500;
}
.trip-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.trip-chip--country { flex: 1.2; min-width: 0; max-width: 170px; overflow: hidden; }
.trip-chip--city { flex: 1; min-width: 0; max-width: 150px; overflow: hidden; }
.trip-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-chip:active { background: var(--surface2); }
.trip-chip.has-value { border-color: rgba(124,58,237,0.3); color: var(--text); }

.trip-party {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
}
.trip-party-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
  font-family: inherit;
}
.trip-party-btn:active { background: var(--surface2); }
.trip-party-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  min-width: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.trip-party-unit {
  font-size: 11px;
  color: var(--text3);
  margin-right: 2px;
}
.trip-add-btn {
  height: 28px;
  padding: 0 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-bg);
  border: 1.5px solid rgba(124,58,237,0.35);
  border-radius: 14px;
  color: var(--accent2);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.trip-add-btn:active { opacity: 0.7; transform: scale(0.95); }

/* ── TIME PICKER ── */
.time-picker {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
}

.time-period-btn {
  flex: 0 0 auto;
  min-width: 52px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.time-period-btn:active { opacity: 0.75; }
.time-period-btn.active {
  background: var(--accent-bg);
  border-color: var(--accent2);
  color: var(--accent2);
}

.time-select {
  flex: 1;
  min-width: 0;
  width: auto;
  margin-top: 0;
  padding: 10px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  color-scheme: dark;
}
.time-select:focus { border-color: rgba(124,58,237,0.5); }
.time-select:disabled { opacity: 0.45; cursor: default; }
:root[data-theme="light"] .time-select { color-scheme: light; }

/* ── TRIP LOG CARDS (main empty view + overlay) ── */
.trip-log-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 20px;
}
.trip-log-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 16px 14px;
  border-radius: 18px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transition: transform 0.12s, background 0.12s;
}
.trip-log-card:active { transform: scale(0.985); background: var(--surface2); }
.trip-log-card-flag {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
  width: 72px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.trip-log-card-flag--multi { font-size: 18px; gap: 3px; }
.tlc-flags { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 4px; line-height: 1.1; }
.tlc-flag { font-size: 18px; }
/* 3개국 이상: 국가명을 줄바꿈해서 보여 주고 카드 높이가 늘어난다 */
.trip-log-card-flag--multi.is-many .trip-log-card-country { white-space: normal; overflow: visible; text-overflow: clip; word-break: keep-all; }
.trip-log-card-country {
  max-width: 100%;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text2);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: keep-all;
}
.trip-log-card-title > :first-child.trip-dday,
.trip-log-card-title > :first-child.pack-chip { margin-left: 0; }
.trip-log-card-body { flex: 1; min-width: 0; }
.trip-log-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 16px;
  font-weight: 800;
}
.trip-log-card-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
}
.trip-log-card-title .trip-dday, .trip-log-card-title .pack-chip--card { flex: none; white-space: nowrap; }
.trip-log-card-brands { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.brand-chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 2px 8px 2px 3px; border-radius: 999px; border: 1px solid var(--border2); background: var(--surface);
  font-size: 11px; font-weight: 700; color: var(--text2);
}
.brand-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-chip .airline-logo.xs { margin-left: 0; width: 18px; height: 18px; border-radius: 50%; }
.log-detail-brands { padding: 2px 0 8px; }
.log-detail-brands .trip-log-card-brands { margin-top: 0; }
.brand-chip--more { padding: 2px 8px; }
.trip-log-card-meta {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.trip-log-card-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.trip-log-card-amt {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.trip-log-card-del {
  border: none;
  background: transparent;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0.9;
}
.trip-log-card-del:active { opacity: 0.55; }

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.confirm-overlay.open { opacity: 1; pointer-events: all; }
.confirm-sheet {
  width: min(300px, 100%);
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 26px 20px 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.confirm-msg {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
  margin: 0 0 22px;
}
.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.confirm-btn {
  height: 44px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}
.confirm-btn--cancel {
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
}
.confirm-btn--ok {
  border: none;
  background: var(--red);
  color: #fff;
}
.confirm-btn:active { transform: scale(0.97); }
.trip-log-card--empty {
  display: block;
  cursor: default;
  padding: 28px 20px;
  background: var(--accent-bg);
  border: 1.5px dashed rgba(124,58,237,0.35);
  box-shadow: none;
}
.trip-log-card--empty:active { transform: none; background: var(--accent-bg); }
.trip-log-card-empty-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--accent2);
  margin-bottom: 8px;
}
.trip-log-card-empty-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.trip-log-card-empty-sub {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.65;
}

/* ── TIMELINE ── */
.tl-date-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.2px;
  padding: 16px 2px 8px;
}
.tl-date-label {
  flex-shrink: 0;
}
.tl-place-country {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent2);
  cursor: pointer;
  line-height: 1.3;
}
.tl-place-country.is-empty {
  color: var(--text3);
  font-weight: 600;
}
.tl-place-city-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  color: var(--accent2);
}
.tl-place-paren {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent2);
}
.tl-place-city {
  field-sizing: content;
  width: auto;
  min-width: 0;
  max-width: 100%;
  border: none;
  background: none;
  outline: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent2);
  font-family: inherit;
}
.tl-place-city::placeholder {
  color: var(--text3);
  font-weight: 600;
}

.tl-group {
  position: relative;
  margin-bottom: 4px;
}
.tl-group::before {
  content: '';
  position: absolute;
  left: 57px;
  top: 8px;
  bottom: 8px;
  width: 1.5px;
  background: var(--border2);
  border-radius: 1px;
}

.tl-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
}

.tl-time {
  width: 48px;
  flex-shrink: 0;
  text-align: right;
  padding-right: 9px;
  padding-top: 7px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

.tl-time-col {
  width: 48px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 7px;
}
.tl-time-col .tl-time {
  width: auto;
  padding: 0;
  text-align: center;
}
.tl-time-col .tl-edit-btn {
  margin: 4px 0 0;
}
.tl-todo-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 5px 6px 6px;
  min-width: 42px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(160deg, #ff7a45 0%, #f43f5e 52%, #d946ef 100%);
  color: #fff;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1.15;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(244, 63, 94, 0.42);
  -webkit-tap-highlight-color: transparent;
}
.tl-todo-badge.has-items { box-shadow: 0 4px 12px rgba(217, 70, 239, 0.5); }
.tl-todo-badge.is-full {
  background: linear-gradient(160deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.4);
}
.tl-todo-badge:active { transform: scale(0.94); }
.tl-todo-n {
  margin-top: 2px;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
  opacity: 0.95;
}

.tl-dot-col {
  width: 18px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding-top: 7px;
  position: relative;
  z-index: 1;
}
.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  flex-shrink: 0;
}
:root[data-theme="light"] .tl-dot { border-color: var(--bg2); }
.tl-dot--plan  { background: var(--accent2); box-shadow: 0 0 0 2px var(--accent-glow); }
.tl-dot--green { background: var(--green); }
.tl-dot--red   { background: var(--red); }
.tl-dot--gray  { background: var(--text3); }

.tl-card {
  flex: 1;
  min-width: 0;
  margin-left: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 9px 12px 10px;
  transition: background 0.12s;
}
.tl-card:active { background: var(--surface2); }

.tl-card-top {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.tl-edit-btn {
  margin-left: auto;
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.tl-edit-btn:active {
  background: var(--accent-bg);
  color: var(--accent2);
  border-color: var(--accent2);
}
.tl-emoji { font-size: 15px; flex-shrink: 0; line-height: 1; }
.tl-cat-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.tl-detail-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-card-amts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
}
.tl-plan-val {
  font-size: 11px;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}
.tl-arr {
  font-size: 10px;
  color: var(--text3);
}
.tl-actual-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.tl-diff {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  margin-left: 2px;
}
.tl-diff--save { background: rgba(16,185,129,0.15); color: var(--green); }
.tl-diff--over { background: rgba(248,113,113,0.12); color: var(--red); }
.tl-badge-plan {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--accent-bg);
  color: var(--accent2);
  margin-right: 2px;
  vertical-align: middle;
}
.tl-badge-split {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  padding: 1px 6px;
  border-radius: 6px;
  line-height: 1.4;
}
.tl-badge-split--joint {
  background: var(--accent-bg);
  color: var(--accent2);
}
.tl-badge-split--solo {
  background: rgba(56,189,248,0.14);
  color: #38bdf8;
}

.spa-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}
.spa-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.3px;
}
.spa-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.spa-divider { height: 1px; background: var(--border); margin: 6px 0; }
.spa-diff-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 2px;
}
.spa-diff {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
}
.spa-diff--save { background: rgba(16,185,129,0.15); color: var(--green); }
.spa-diff--over { background: rgba(248,113,113,0.12); color: var(--red); }
.spa-avgs {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 8px;
}
.spa-avg {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--accent-bg);
  font-variant-numeric: tabular-nums;
}
.spa-avg-k {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent2);
  letter-spacing: 0.2px;
}
.spa-avg-v {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

/* ── 타임라인 변환 서브라인 (기준통화 · 1인당) ── */
.tl-per-person,
.tl-conv-row {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
  letter-spacing: 0.1px;
}

/* ── LEDGER SUMMARY ── */
.ledger-summary {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  padding: 16px 18px;
  margin-top: 14px;
  margin-bottom: 24px;
}

.trip-recap {
  margin: 10px 0 28px;
}
.trip-recap-end {
  display: flex;
  align-items: flex-start;
  margin: 6px 0 12px;
}
.trip-recap-end-copy {
  flex: 1;
  min-width: 0;
  margin-left: 8px;
  padding-top: 4px;
}
.trip-recap-end-lbl {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #2dd4bf;
}
.trip-recap-end-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.22);
  border: 2px solid var(--bg);
  flex-shrink: 0;
}
:root[data-theme="light"] .trip-recap-end-lbl { color: #0f766e; }
:root[data-theme="light"] .trip-recap-end-dot {
  background: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
  border-color: var(--bg2);
}
.trip-recap-totals { padding-bottom: 4px; }

.summary-cat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.summary-cat-emoji { font-size: 15px; flex-shrink: 0; }
.summary-cat-name { flex: 1; font-size: 13px; color: var(--text2); }

.summary-cat-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.summary-cat-total { font-size: 13px; font-weight: 700; color: var(--text); }
.summary-cat-pp    { font-size: 11px; font-weight: 600; color: var(--accent2); }
.summary-cat-count { font-size: 11px; color: var(--text3); }
.summary-cat-row.has-pp { align-items: flex-start; }

/* ── ENTRY SHEET ── */
.entry-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 115;
  display: none;
}
.entry-backdrop.open { display: block; }

.entry-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 430px;
  background: var(--bg2);
  border-radius: 24px 24px 0 0;
  border: 1px solid var(--border2);
  border-bottom: none;
  padding-bottom: calc(var(--safe-b) + 4px);
  z-index: 120;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  max-height: 92dvh;
  max-height: 92vh;
  overflow-y: auto;
}
.entry-sheet.open { transform: translateX(-50%) translateY(0); }

.entry-form {
  padding: 2px 20px 8px;
  flex: 1;
}
.entry-form::-webkit-scrollbar { display: none; }

.entry-field { margin-bottom: 14px; }

.entry-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.entry-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.entry-input:focus { border-color: rgba(124,58,237,0.5); }
.entry-input::placeholder { color: var(--text3); }
input[type="date"].entry-input { color-scheme: dark; }
:root[data-theme="light"] input[type="date"].entry-input { color-scheme: light; }

.entry-amt { flex: 1; min-width: 0; }
.entry-amt-pair {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.entry-amt-pair .entry-sub-field { margin-bottom: 0; }
.entry-amt-pair .entry-input { padding: 10px 10px; font-variant-numeric: tabular-nums; }

.entry-sub-field {
  flex: 1;
  min-width: 0;
}
.entry-sub-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 7px;
}

/* ── 금액 헤더 (레이블 + 통화 칩) ── */
.entry-amt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 7px;
}
.entry-amt-header label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0;
}
.entry-cur-chips { display: flex; gap: 4px; }
.entry-cur-chip {
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.entry-cur-chip.active {
  background: var(--accent-bg);
  border-color: var(--accent2);
  color: var(--accent2);
}

/* ── 공유/개인 토글 ── */
.split-toggle { display: flex; gap: 8px; }
.split-btn {
  flex: 1;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.split-btn.active {
  background: var(--accent-bg);
  border-color: var(--accent2);
  color: var(--accent2);
}
.split-btn:active { transform: scale(0.96); }

.cat-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: start;
}

.cat-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.cat-cell .cat-btn { width: 100%; }

.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 8px;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.cat-btn-emoji { font-size: 20px; }
.cat-btn-name { font-size: 10px; color: var(--text2); font-weight: 600; white-space: nowrap; }
.cat-btn:active { transform: scale(0.93); }
.cat-btn.active { background: var(--accent-bg); border-color: var(--accent2); }
.cat-btn.active .cat-btn-name { color: var(--accent2); }

.leg-chips {
  display: flex;
  flex-direction: row;
  gap: 5px;
  grid-column: 1 / -1;
  margin-top: 2px;
}
.leg-chips[hidden] { display: none !important; }
.leg-chip {
  flex: 1;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1.5px solid rgba(20,184,166,0.32);
  background: rgba(20,184,166,0.10);
  color: #2dd4bf;
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leg-chip:active { transform: scale(0.96); }
.leg-chip.active {
  background: rgba(20,184,166,0.28);
  border-color: #14b8a6;
  color: #99f6e4;
}
:root[data-theme="light"] .leg-chip {
  background: rgba(13,148,136,0.10);
  border-color: rgba(13,148,136,0.35);
  color: #0f766e;
}
:root[data-theme="light"] .leg-chip.active {
  background: rgba(13,148,136,0.22);
  border-color: #0d9488;
  color: #0f766e;
}
.tl-leg {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(124,58,237,0.12);
  color: var(--accent2);
}

.entry-actions {
  display: flex;
  gap: 10px;
  padding: 8px 20px 16px;
  flex-shrink: 0;
}

.entry-del-btn {
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid rgba(248,113,113,0.25);
  background: rgba(248,113,113,0.07);
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: all 0.12s;
}
.entry-del-btn:active { background: rgba(248,113,113,0.14); }

.entry-save-btn {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 12px var(--accent-glow);
  transition: all 0.12s;
}
.entry-save-btn:active { opacity: 0.88; transform: scale(0.98); }

/* ── 설치 배지 (모바일 폭 · 미설치 · 설치 가능할 때만) ── */
.install-badge {
  position: absolute;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--nav-sb) + 10px);
  transform: translateX(-50%);
  z-index: 91;
  display: flex; align-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  box-shadow: 0 6px 18px rgba(139,92,246,0.4);
}
.install-badge[hidden] { display: none; }
.install-badge-main {
  padding: 7px 8px 7px 14px; background: none; border: none;
  color: #fff; font-size: 12px; font-weight: 800; font-family: inherit; cursor: pointer;
  white-space: nowrap;
}
.install-badge-x {
  padding: 7px 11px 7px 4px; background: none; border: none;
  color: rgba(255,255,255,0.8); font-size: 15px; line-height: 1; font-family: inherit; cursor: pointer;
}
@media (min-width: 860px) { .install-badge { display: none !important; } }
html.is-pwa .install-badge { display: none !important; }

/* ── 설정 스위치 (위치 자동 측정) ── */
.switch { position: relative; flex-shrink: 0; width: 46px; height: 28px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border2); transition: background 0.2s;
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.3); transition: transform 0.2s;
}
.switch input:checked + .switch-track { background: linear-gradient(135deg, #8b5cf6, #ec4899); border-color: transparent; }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
#gps-row[hidden] { display: none; }

/* 일정 카드 위치 지점 버튼: 직접 측정 = 분홍, 자동 측정 = 파랑, 미기록 = 회색 */
.tl-time-col .tl-gps-btn { margin: 5px 0 0; }
.tl-gps-btn {
  width: 26px; height: 22px; padding: 0; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1.5px solid var(--border2); background: var(--surface);
  color: var(--text3); cursor: pointer; transition: all 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.tl-gps-btn:active { transform: scale(0.92); }
.tl-gps-btn--manual { color: #ec4899; border-color: rgba(236,72,153,0.55); background: rgba(236,72,153,0.12); }
.tl-gps-btn--auto   { color: #38bdf8; border-color: rgba(56,189,248,0.55); background: rgba(56,189,248,0.12); }
.summary-cat-total--plan { color: var(--text3); font-weight: 600; }

/* ── 종합 정리 (감성 문구 · 일정 요약 · 경비 요약) ── */
.rc-hero {
  position: relative; margin: 12px 0 12px; padding: 22px 18px 16px; border-radius: 22px; text-align: center;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, #8b5cf6 28%, transparent), transparent 60%),
    radial-gradient(110% 90% at 100% 100%, color-mix(in srgb, #ec4899 24%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent2) 30%, var(--border2));
}
.rc-hero-label { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; color: var(--accent2); margin-bottom: 8px; }
.rc-hero-text {
  font-family: 'Nanum Pen Script', 'Segoe Print', cursive;
  font-size: 27px; line-height: 1.3; color: var(--text); word-break: keep-all;
}
.rc-hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.rc-hero-chips span {
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--text2);
  background: color-mix(in srgb, var(--bg) 60%, transparent); border: 1px solid var(--border2);
}
.rc-card {
  margin: 0 0 12px; padding: 14px 14px 10px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border2);
}
.rc-card-title { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.rc-day { padding: 9px 0; border-top: 1px solid var(--border); }
.rc-day:first-of-type { border-top: none; }
.rc-day-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.rc-day-n { font-size: 12px; font-weight: 800; color: var(--accent2); }
.rc-day-date { font-size: 12px; font-weight: 600; color: var(--text2); }
.rc-day-city { font-size: 11px; color: var(--text3); }
.rc-items { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.rc-item {
  padding: 3px 9px; border-radius: 999px; font-size: 12px; color: var(--text2);
  background: var(--accent-bg); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-item--more { background: var(--surface2); color: var(--text3); }
.rc-sub {
  margin: 14px 0 6px; padding-top: 10px; border-top: 1px dashed var(--border2);
  font-size: 12px; font-weight: 800; color: var(--accent2); letter-spacing: 0.04em;
}
.rc-bar-row { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 8px; padding: 5px 0; }
.rc-bar-k { font-size: 12px; font-weight: 700; color: var(--text2); }
.rc-bar-track { height: 8px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.rc-bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.rc-bar-fill--plan { background: var(--text3); opacity: 0.5; }
.rc-bar-v { font-size: 12px; font-weight: 700; color: var(--text); text-align: right; display: flex; flex-direction: column; }
.rc-bar-v small { font-size: 10px; font-weight: 500; color: var(--text3); }
.rc-share-btn {
  width: 100%; margin: 4px 0 16px; padding: 13px; border: none; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899); color: #fff;
  font: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
  box-shadow: 0 8px 20px rgba(139,92,246,0.35); -webkit-tap-highlight-color: transparent;
}
.rc-share-btn:active { transform: scale(0.98); }
.rc-share-row { display: flex; gap: 8px; margin: 4px 0 16px; }
.rc-share-row .rc-share-btn { flex: 1; width: auto; margin: 0; min-width: 0; }
.rc-mine-btn {
  flex: none; padding: 0 14px; border-radius: 16px; font: inherit; font-size: 13px; font-weight: 800; white-space: nowrap;
  border: 1px solid var(--border2); background: var(--surface); color: var(--text); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rc-mine-btn:active { transform: scale(0.97); }
.sh-busy {
  position: fixed; inset: 0; z-index: 9999; display: none;
  align-items: center; justify-content: center; background: rgba(0,0,0,0.35);
}
.sh-busy.show { display: flex; }
.sh-spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.3); border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.entry-sub-field.is-locked { opacity: 0.45; }
.entry-sub-field.is-locked .entry-amt { pointer-events: none; }
.rc-share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 8px; padding: 8px 4px 6px; }
.rc-share-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0;
  background: none; border: none; font: inherit; color: var(--text2); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.rc-share-item:active { transform: scale(0.94); }
.rc-ico {
  width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.rc-ico--tg { background: #229ed9; }
.rc-ico--kk { background: #fee500; color: #3c1e1e; }
.rc-ico--fb { background: #1877f2; font-family: Georgia, serif; font-size: 26px; }
.rc-ico--x  { background: #111; }
.rc-ico--ln { background: #06c755; color: #fff; font-weight: 800; }
.rc-ico--dv { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.rc-ico--cp { background: var(--text3); }
.rc-share-name { font-size: 12px; font-weight: 700; }

/* ── 카드 메모 작성 시트 ── */
.nt-sheet { padding-top: 6px; max-height: 70vh; max-height: 70dvh; transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), bottom 0.1s; }
.nt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.nt-title { font-size: 14px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-count { flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--text3); }
.nt-input {
  width: 100%; min-height: 84px; max-height: 150px; resize: none; box-sizing: border-box;
  padding: 12px 14px; border-radius: 16px; outline: none;
  background:
    repeating-linear-gradient(to bottom, transparent 0 25px, color-mix(in srgb, var(--accent2) 14%, transparent) 25px 26px),
    var(--surface);
  border: 1.5px solid color-mix(in srgb, var(--accent2) 35%, var(--border2));
  color: var(--text); font: inherit; font-size: 16px; line-height: 26px;
}
.nt-input::placeholder { color: var(--text3); }
.nt-chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.nt-chips::-webkit-scrollbar { display: none; }
.nt-chip {
  flex-shrink: 0; padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 600;
  color: var(--text2); background: var(--accent-bg); border: 1px solid var(--border2); cursor: pointer;
  -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.nt-chip:active { transform: scale(0.95); }
.nt-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

/* 설정: 계정 행 (등급 칩 + 로그아웃) */
.acct-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.plan-chips[hidden] { display: none; }

/* 앱 업데이트 알림 */
.update-banner {
  position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 50%; transform: translateX(-50%);
  z-index: 3000; max-width: calc(100% - 24px);
}
.update-banner[hidden] { display: none; }
.update-banner-btn {
  padding: 10px 18px; border: none; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 800;
  color: #fff; cursor: pointer; background: linear-gradient(135deg, #8b5cf6, #ec4899);
  box-shadow: 0 8px 22px rgba(139,92,246,0.45); white-space: nowrap;
  -webkit-tap-highlight-color: transparent; animation: upd-pop 0.4s cubic-bezier(0.3, 1.5, 0.5, 1);
}
@keyframes upd-pop { 0% { transform: translateY(-20px) scale(0.9); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* 일행 줄 저장하기 버튼 */
.trip-extra-save {
  height: 32px; padding: 0 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px; background: var(--accent-bg); border: 1.5px solid rgba(124,58,237,0.35);
  color: var(--accent2); font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.trip-extra-save:active { opacity: 0.7; transform: scale(0.96); }
.trip-extra-save:disabled { opacity: 0.38; cursor: default; transform: none; }

/* 일정 목록 맨 아래 일정 추가 버튼 (여행이 끝나기 전) */
.tl-add-more {
  width: 100%; margin: 6px 0 18px; padding: 13px; border-radius: 14px;
  border: 1.5px dashed color-mix(in srgb, var(--accent2) 55%, var(--border2));
  background: var(--accent-bg); color: var(--accent2);
  font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.tl-add-more:active { transform: scale(0.98); opacity: 0.8; }
@keyframes tripCardBlink {
  0%, 100% { border-color: var(--border2); box-shadow: none; }
  50% { border-color: var(--accent2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent2) 35%, transparent); }
}
.trip-log-card.is-nearest { animation: tripCardBlink 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .trip-log-card.is-nearest { animation: none; border-color: var(--accent2); } }
.trip-encourage.is-cards .plan-empty-hand { display: none; }
.plan-lock-note {
  margin: 4px 0 10px; padding: 10px 12px; border-radius: 12px; font-size: 12px; font-weight: 700; line-height: 1.4;
  background: var(--accent-bg); color: var(--accent2);
}
.card-pager { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 6px 0 22px; }
.card-pager-track {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px;
  border-radius: 999px; border: 1px solid var(--border2);
  background: linear-gradient(180deg, var(--surface), transparent), var(--bg2);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.card-pager-btn {
  min-width: 34px; height: 34px; padding: 0 6px; border-radius: 999px; border: none;
  background: transparent; color: var(--text2);
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.card-pager-btn:active:not(:disabled) { transform: scale(0.88); }
.card-pager-btn:not(.is-active):not(:disabled):hover { background: var(--accent-bg); color: var(--accent2); }
.card-pager-btn.is-active {
  color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899);
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.5); transform: scale(1.08);
}
.card-pager-btn.is-arrow { color: var(--accent2); background: var(--accent-bg); }
.card-pager-btn:disabled { opacity: 0.3; cursor: default; background: transparent; }
.card-pager-gap { width: 4px; height: 4px; margin: 0 3px; border-radius: 50%; background: var(--text3); opacity: 0.6; }
.card-pager-count { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--text3); }
/* ── 항공사 로고 / 선택 ── */
.airline-logo {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 10px; background: #fff; overflow: hidden;
  border: 1px solid var(--border2); vertical-align: middle;
}
.airline-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.airline-logo-code { display: none; font-size: 11px; font-weight: 800; color: #475569; }
.airline-logo.is-fallback .airline-logo-code { display: block; }
.airline-logo.sm { width: 26px; height: 26px; border-radius: 8px; }
.airline-logo.xs { width: 22px; height: 22px; border-radius: 6px; margin-left: 4px; }
.airline-logo.xs .airline-logo-code, .airline-logo.sm .airline-logo-code { font-size: 9px; }
.airline-row { grid-column: 1 / -1; min-width: 0; width: 100%; margin-top: 2px; }
.airline-row[hidden] { display: none !important; }
.airline-pick-btn { min-width: 0; }
.airline-pick-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border-radius: 14px;
  border: 1.5px dashed var(--border2); background: var(--surface); color: var(--text2);
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-align: left;
}
.airline-pick-btn.has-value { border-style: solid; border-color: color-mix(in srgb, var(--accent2) 50%, var(--border2)); color: var(--text); }
.airline-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.airline-pick-x { color: var(--text3); }
.airline-picker { position: fixed; inset: 0; z-index: 600; }
.airline-picker-back { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.airline-picker-sheet {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 430px; max-height: 80vh; display: flex; flex-direction: column; gap: 10px;
  padding: 16px 16px calc(16px + var(--safe-b)); border-radius: 22px 22px 0 0; background: var(--bg2); border: 1px solid var(--border2); border-bottom: none;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
}
.airline-picker-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; }
.airline-picker-close { border: none; background: none; font-size: 24px; line-height: 1; color: var(--text3); cursor: pointer; }
.airline-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
.airline-group { margin: 8px 2px 2px; font-size: 12px; font-weight: 800; color: var(--accent2); }
.airline-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 14px;
  border: 1.5px solid var(--border2); background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; text-align: left;
}
.airline-item.is-on { border-color: var(--accent2); background: var(--accent-bg); }
.airline-item--none { justify-content: center; color: var(--text3); }
.airline-item-name { flex: 1; min-width: 0; }
.airline-item-code { font-size: 12px; color: var(--text3); font-weight: 800; }
.airline-empty { padding: 24px 0; text-align: center; color: var(--text3); font-size: 13px; }
.trip-dday {
  display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: 999px; vertical-align: middle;
  background: var(--accent-bg); color: var(--accent2); font-size: 11px; font-weight: 800; letter-spacing: 0.2px;
}
.trip-dday.is-now { background: linear-gradient(160deg, #ff7a45, #f43f5e); color: #fff; }
.trip-dday.is-past { background: var(--surface); color: var(--text3); border: 1px solid var(--border2); }
/* 일정 카드와 같은 x 영역(시간열 48 + 점열 18 + 여백 8 = 74px 안쪽)만 쓰고 우측 정렬 */
.tl-add-row { display: flex; justify-content: flex-end; gap: 8px; margin: 6px 0 18px 74px; }
.tl-add-row .tl-add-more { flex: none; width: auto; margin: 0; padding: 8px 14px; font-size: 12px; border-radius: 11px; }
.tl-todo-add {
  flex: none; padding: 8px 14px; border-radius: 11px; border: none;
  background: linear-gradient(160deg, #ff7a45 0%, #f43f5e 52%, #d946ef 100%); color: #fff;
  font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 10px rgba(244, 63, 94, 0.35);
}
.tl-todo-add.is-full { background: linear-gradient(160deg, #34d399 0%, #10b981 100%); box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35); }
.tl-todo-add:active { transform: scale(0.98); opacity: 0.85; }
.tl-todo-add .tl-todo-n { font-size: 10px; margin: 0 0 0 2px; }

.nt-actions { justify-content: space-between; align-items: center; }
.nt-ai { color: var(--accent2); }

/* 기준환율 안내. 출처 문구는 ExchangeRate-API 오픈 엔드포인트 표기 요건 */
.rate-disclaimer {
  margin: 4px 18px 2px; font-size: 11px; line-height: 1.5; color: var(--text3); text-align: center;
}
.rate-credit {
  margin: 0 18px 10px; font-size: 11px; line-height: 1.5; color: var(--text3); text-align: center;
}
.rate-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.scroll-area .rate-credit { margin: 14px 2px 0; }

/* ── Tripvia Plan ── */
#view-plan .plan-scroll {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  flex: 1 1 0;
  min-height: 0;
  padding: 4px 16px 28px;
}
html.is-pwa .plan-scroll { padding-bottom: 28px; }
.plan-empty-hand {
  margin: 18px 8px 0;
  font-family: 'Nanum Pen Script', 'Segoe Print', 'Apple SD Gothic Neo', cursive;
  font-style: normal;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, #c4b5fd 0%, var(--accent2) 42%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.plan-empty-hand--sub {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.65;
}
:root[data-theme="light"] .plan-empty-hand {
  background: linear-gradient(120deg, #6d28d9 0%, #7c3aed 45%, #4f46e5 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.tl-check-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0;
}
.tl-check-text {
  flex: 1; min-width: 0;
  border: none; outline: none; background: none;
  color: var(--text); font: inherit; font-size: 14px; font-weight: 600;
}
.tl-check-row.is-done .tl-check-text { text-decoration: line-through; color: var(--text3); font-weight: 500; }
span.tl-check-text { cursor: default; }
.tl-check-x {
  flex-shrink: 0; border: none; background: none;
  color: var(--text3); font-size: 16px; line-height: 1; cursor: pointer;
  padding: 4px 6px; -webkit-tap-highlight-color: transparent;
}
.tl-check-addrow {
  display: flex; gap: 8px; margin-top: 6px; align-items: center;
}
.tl-check-new {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; outline: none;
  background: var(--bg); border: 1.5px solid var(--border2); color: var(--text);
  font: inherit; font-size: 13px;
}
.tl-check-new:focus { border-color: var(--accent2); }
.tl-check-addbtn {
  flex-shrink: 0; padding: 8px 12px; border: none; border-radius: 10px;
  font: inherit; font-size: 12px; font-weight: 800; cursor: pointer;
  color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899);
  -webkit-tap-highlight-color: transparent;
}
.tl-check-addbtn:active { opacity: 0.8; }
.check-sheet { z-index: 130; }
#check-backdrop { z-index: 125; }
.check-sheet-list {
  padding: 4px 18px 8px;
  max-height: 48vh;
  overflow-y: auto;
}
.check-sheet-add { padding: 4px 18px 16px; }
.check-cheer {
  margin: 4px 18px 10px;
  padding: 12px 14px;
  border-radius: 16px;
  text-align: center;
  font-family: 'Nanum Pen Script', 'Segoe Print', 'Apple SD Gothic Neo', cursive;
  font-size: 22px;
  line-height: 1.45;
  background: linear-gradient(120deg, #fde68a 0%, #86efac 45%, #6ee7b7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(16,185,129,0.2));
}
.check-cheer[hidden] { display: none; }
:root[data-theme="light"] .check-cheer {
  background: linear-gradient(120deg, #d97706 0%, #059669 55%, #0d9488 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.entry-sheet.plan-mode .entry-amt-pair .entry-sub-field:nth-child(2) { display: none; }
.entry-sheet.cat-check .entry-amt-pair,
.entry-sheet.cat-check .split-toggle,
.entry-sheet.cat-check .entry-field:has(.split-toggle) { display: none; }
.entry-sheet.cat-packing .entry-field:has(#entry-date),
.entry-sheet.cat-packing .entry-field:has(#entry-time) { display: none; }
.tl-done {
  display: inline-flex; align-items: center; margin-right: 2px; flex-shrink: 0;
}
.tl-done input { width: 18px; height: 18px; accent-color: var(--accent); }
.tl-item.is-done .tl-detail-text,
.tl-item.is-done .tl-cat-lbl { text-decoration: line-through; color: var(--text3); }
.tl-item.is-moved { opacity: 0.55; }

/* ── 계획 공유 ── */
.sh-panel { margin: 14px 0 22px 74px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.sh-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.sh-btn {
  padding: 8px 14px; border-radius: 11px; border: 1.5px solid var(--border2); background: var(--surface); color: var(--text);
  font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.sh-btn:active { transform: scale(0.96); }
.sh-btn:disabled { opacity: 0.5; }
.sh-btn--main { border-color: transparent; color: #fff; background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.sh-btn--warn { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--border2)); }
.sh-btn.has-new { border-color: var(--accent2); color: var(--accent2); }
.sh-btn.is-dirty { border-color: var(--accent2); color: var(--accent2); animation: tripCardBlink 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .sh-btn.is-dirty { animation: none; } }
.sh-dialog { max-width: 420px; }
.sh-body { display: flex; flex-direction: column; gap: 10px; }
.sh-item { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border2); background: var(--surface); }
.sh-item-main { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text); min-width: 0; word-break: break-all; }
.sh-item-main small { color: var(--text3); font-size: 11px; }
.sh-item-act { display: flex; gap: 6px; justify-content: flex-end; }
.sh-empty { padding: 22px 0; text-align: center; color: var(--text3); font-size: 13px; }
.sh-count { font-size: 12px; font-weight: 800; color: var(--accent2); }
.sh-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--text2); }
.sh-f input, .sh-f select, .sh-f textarea {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border2); background: var(--surface);
  color: var(--text); font: inherit; font-size: 14px;
}
.sh-fixed { padding: 10px 12px; border-radius: 10px; background: var(--surface); font-size: 13px; color: var(--text); }
.sh-send { align-self: stretch; padding: 12px; font-size: 14px; }
/* 열람 화면 */
.sv-overlay { position: fixed; inset: 0; z-index: 1500; display: flex; flex-direction: column; background: var(--bg); color: var(--text); padding-top: var(--safe-t); }
.sv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 10px; border-bottom: 1px solid var(--border); }
.sv-title { font-size: 17px; font-weight: 800; }
.sv-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.sv-close { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--surface); color: var(--text2); font-size: 15px; cursor: pointer; }
.sv-body { flex: 1; overflow-y: auto; padding: 12px 16px calc(24px + var(--safe-b)); max-width: 430px; width: 100%; margin: 0 auto; }
.sv-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--accent-bg); color: var(--accent2); font-size: 12px; font-weight: 700; }
.sv-add { width: 100%; margin-bottom: 10px; padding: 11px; }
.sv-day { margin-bottom: 14px; }
.sv-day-head { font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.sv-item { display: flex; gap: 8px; margin-bottom: 6px; }
.sv-time { flex: none; width: 52px; padding-top: 10px; font-size: 10px; font-weight: 700; color: var(--text3); text-align: right; }
.sv-card { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); }
.sv-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.sv-amt { margin-left: auto; font-weight: 800; font-size: 12px; }
.sv-detail { margin-top: 4px; font-size: 13px; color: var(--text2); word-break: break-word; }
.sv-acts { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.sv-acts .sh-btn { padding: 5px 10px; font-size: 11px; }
.sv-todo, .sv-pack { padding: 8px 12px; margin: 4px 0 4px 60px; border-radius: 10px; background: var(--surface); font-size: 12px; color: var(--text2); }
.sv-pack { margin-left: 0; }
.sv-total { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--accent-bg); color: var(--accent2); font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.sv-total small { color: var(--text2); font-size: 12px; }

/* 일정 카드: 내용은 별도 줄(최대 2줄), 브랜드 뱃지는 아랫줄 */
.tl-card-top { flex-wrap: wrap; row-gap: 4px; }
.tl-card-brand { margin-top: 5px; }
.tl-detail-text.tl-detail-block {
  flex: none; margin-top: 5px; white-space: normal; word-break: break-word; overflow: visible;
}
/* 추가 버튼 줄의 날짜 표기, 새 날짜 전용 버튼 */
.tl-add-row { align-items: center; }
.tl-add-date { margin-right: auto; font-size: 11px; font-weight: 800; color: var(--text3); letter-spacing: 0.2px; }
.tl-add-row .tl-add-more.tl-add-newday { flex: 1; padding: 9px 14px; border-style: dashed; }

/* 공유: 받은 제안·표시 */
.sh-pending { margin: 4px 0 12px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, #f59e0b 55%, var(--border2)); background: color-mix(in srgb, #f59e0b 10%, var(--surface)); display: flex; flex-direction: column; gap: 8px; }
.sh-pending[hidden] { display: none; }
.sh-pending-title { font-size: 13px; font-weight: 800; color: #b45309; }
.tl-sug-mark { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; background: color-mix(in srgb, #f59e0b 22%, transparent); color: #b45309; }
.tl-sug-mark.is-del { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.tl-card.sug-del, .sv-card.sug-del { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--red) 55%, transparent); }
.tl-sug-by { padding: 2px 8px; border-radius: 999px; border: none; font: inherit; font-size: 10px; font-weight: 800; background: var(--accent-bg); color: var(--accent2); cursor: pointer; }
.sv-card.has-mine { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #f59e0b 60%, transparent); }
.sv-mine { margin-top: 6px; padding: 5px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; color: #b45309; background: color-mix(in srgb, #f59e0b 14%, transparent); word-break: break-word; }
.sv-mine.is-del { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.sv-mine-box { margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #f59e0b 10%, var(--surface)); font-size: 12px; color: var(--text2); display: flex; flex-direction: column; gap: 4px; }

/* ── GPS 지도 (종합 요약 위) ── */
.rc-map-wrap { margin: 0 0 14px; }
.rc-map-title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 8px; font-size: 13px; font-weight: 800; color: var(--text); }
.rc-map-title small { font-size: 11px; font-weight: 700; color: var(--text3); }
.rc-map { height: 240px; border-radius: 18px; overflow: hidden; border: 1px solid var(--border2); background: var(--surface); position: relative; z-index: 0; }
.rc-map--pending {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin: 0 0 14px; padding: 16px;
  height: 150px; text-align: center; border: 2px dashed var(--border2); background: transparent; color: var(--text3);
}
.rc-map--pending span { font-size: 26px; line-height: 1; }
.rc-map--pending p { margin: 0; font-size: 13px; font-weight: 700; line-height: 1.45; }
.rc-pin { background: none; border: none; }
.rc-map-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 2px 8px; scrollbar-width: none; }
.rc-map-tabs::-webkit-scrollbar { display: none; }
.rc-map-tab { flex: none; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border2); background: var(--surface); color: var(--text2); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.rc-map-tab.on { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.rc-map-grp { margin-top: 12px; }
.rc-map-grp-h { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 2px solid var(--gc); font-size: 13px; font-weight: 800; color: var(--text); }
.rc-map-grp-h i { width: 10px; height: 10px; border-radius: 50%; background: var(--gc); }
.rc-map-grp-h small { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--text3); }
.rc-map-row { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }
.rc-map-row--none { display: block; color: var(--text3); font-size: 12px; }
.rc-map-t { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text2); }
.rc-map-x { min-width: 0; line-height: 1.4; }

/* 등급 하락 유예 안내 */
.tier-notice {
  margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; font-size: 12px; font-weight: 700; line-height: 1.5;
  color: var(--accent2); background: var(--accent-bg); border: 1px solid color-mix(in srgb, var(--accent2) 30%, var(--border2));
}
.tier-notice[hidden] { display: none; }

/* ── 상세보기: 개요 · 일차 탭 ── */
.dtabs {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; padding: 8px 14px 8px; margin: 0 -2px 6px;
  overflow-x: auto; scrollbar-width: none; background: var(--bg);
}
.dtabs::-webkit-scrollbar { display: none; }
.dtab {
  flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border2); background: var(--surface);
  color: var(--text2); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.dtab.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, #8b5cf6, #ec4899); box-shadow: 0 3px 10px rgba(139, 92, 246, 0.35); }
.ov-sum { margin: 4px 16px 10px; font-size: 12px; font-weight: 800; color: var(--text3); }
.ov-day {
  margin: 0 14px 10px; padding: 12px 14px; border-radius: 18px; border: 1px solid var(--border2); background: var(--surface);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.ov-day:active { transform: scale(0.99); }
.ov-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 8px; }
.ov-head b { font-size: 15px; font-weight: 800; color: var(--accent2); }
.ov-date { font-size: 11px; font-weight: 700; color: var(--text3); white-space: normal; }
.ov-place { font-size: 11px; font-weight: 700; color: var(--text2); min-width: 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.ov-go { margin-left: auto; font-size: 18px; color: var(--text3); }
.ov-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; color: var(--text); }
.ov-time { flex: none; width: 54px; text-align: right; font-size: 10px; font-weight: 700; color: var(--text3); }
.ov-emoji { flex: none; font-size: 15px; }
.ov-txt { flex: 1; min-width: 0; line-height: 1.35; word-break: break-word; }
.ov-row.is-key .ov-txt { font-weight: 700; }
.ov-row .tl-leg { margin-left: 6px; }
.ov-more { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border2); font-size: 11px; font-weight: 700; color: var(--text3); text-align: right; }

/* 계획 하단 일자별 지도 */
.pm-card { margin: 14px 0 6px; padding: 12px; border-radius: 18px; border: 1px solid var(--border2); background: var(--surface); }
.pm-note { margin: 8px 2px 0; font-size: 11px; font-weight: 600; color: var(--text3); line-height: 1.5; }
.pm-pin { background: none; border: none; }
.pm-pin span { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.pm-legs { margin-top: 4px; }
.pm-leg-wait { margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--text3); }
.pm-leg { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; color: var(--text); }
.pm-leg-n { font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 800; color: var(--text3); }
.pm-leg-x { min-width: 0; line-height: 1.4; }
.pm-leg-d { font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 800; color: var(--text2); white-space: nowrap; }

/* 공유 열람 화면: 어두운 모드에서도 흰 배경으로 보인다 (링크를 연 사람이 읽기 쉽게) */
.sv-overlay {
  --bg: #ffffff; --bg2: #f4f4fb; --surface: rgba(0, 0, 0, 0.04); --surface2: rgba(0, 0, 0, 0.07);
  --border: rgba(0, 0, 0, 0.08); --border2: rgba(0, 0, 0, 0.14);
  --accent: #7c3aed; --accent2: #6d3df0; --accent-bg: rgba(124, 58, 237, 0.1);
  --text: #16163a; --text2: #54547a; --text3: #8888b0;
  background: #ffffff; color: #16163a; color-scheme: light;
}
.sv-promo { margin: 0 0 12px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border2); background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.08)); }
.sv-promo-t { font-size: 15px; font-weight: 800; color: var(--text); }
.sv-promo ul { margin: 8px 0 12px; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--text2); }
.sv-promo .sh-btn { width: 100%; padding: 11px; }
.sv-map-card { margin: 0 0 14px; padding: 12px; border-radius: 16px; border: 1px solid var(--border2); background: var(--surface); }
.sv-map-title { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 8px; font-size: 13px; font-weight: 800; color: var(--text); }
.sv-map-title small { font-size: 11px; font-weight: 700; color: var(--text3); }
.sv-map { height: 230px; }
.sv-map-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 11.5px; font-weight: 700; color: var(--text2); }
.sv-map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.sv-map-note { margin: 6px 2px 0; font-size: 11px; font-weight: 600; color: var(--text3); }

/* 열람 화면: 내 계획으로 가져오기 */
.sv-import { margin: 0 0 12px; }
.sv-import-btn { width: 100%; padding: 12px; }
.sv-import-note { margin: 6px 4px 0; font-size: 11.5px; font-weight: 600; line-height: 1.5; color: var(--text3); }

/* 계획(파랑) · 로그(초록) 화면 구분: 화면 안의 포인트 색만 바꾼다 */
#view-plan, #past-plan-overlay, #trip-log-detail.is-plan {
  --accent: #2563EB; --accent2: #3B82F6;
  --accent-bg: rgba(37,99,235,0.12); --accent-glow: rgba(37,99,235,0.25);
}
#view-ledger, #trip-log-detail.is-log {
  --accent: #059669; --accent2: #10B981;
  --accent-bg: rgba(5,150,105,0.12); --accent-glow: rgba(5,150,105,0.25);
}
#view-plan .app-header, #view-ledger .app-header { border-bottom: 2px solid var(--accent); }
#view-plan .header-sub, #view-ledger .header-sub { font-weight: 700; color: var(--accent2); }
#nav-plan.active { color: #3B82F6; }
#nav-plan.active .nav-icon-wrap { background: rgba(37,99,235,0.12); }
#nav-ledger.active { color: #10B981; }
#nav-ledger.active .nav-icon-wrap { background: rgba(5,150,105,0.12); }
#trip-log-detail.is-plan .app-header, #trip-log-detail.is-log .app-header { border-bottom: 2px solid var(--accent); }
.detail-back-btn { width: auto; min-width: 36px; padding: 0 10px 0 6px; gap: 2px; flex-shrink: 0; }
.detail-back-label { font-size: 12px; font-weight: 800; color: var(--accent2); white-space: nowrap; }
.detail-back-label:empty { display: none; }

/* 계획 화면: 페이지 번호 옆 [지난 계획] 버튼 + 모달 */
.card-pager-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; }
.card-pager-row .card-pager { margin-bottom: 22px; }
.past-plan-btn {
  justify-self: end; margin-top: 2px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 800; white-space: nowrap;
  color: var(--accent2); background: var(--accent-bg); border: 1px solid color-mix(in srgb, var(--accent2) 35%, transparent);
}
.past-plan-btn:active { transform: scale(0.95); }
.pp-item { margin-bottom: 8px; }
.pp-item .trip-log-card { margin-bottom: 0; opacity: 0.92; }
.pp-detail { margin: 4px 4px 0; padding: 12px 14px; border-radius: 0 0 14px 14px; background: var(--surface); border: 1px solid var(--border2); }
.pp-sec { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px dashed var(--border2); }
.pp-h { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--accent2); margin-bottom: 4px; }
.pp-row { display: flex; gap: 10px; font-size: 13px; line-height: 1.6; }
.pp-k { flex: 0 0 44px; color: var(--text3); font-weight: 700; }
.pp-v { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.pp-day { margin-top: 6px; font-size: 12px; font-weight: 800; color: var(--text2); }
.pp-sched { display: flex; gap: 8px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.pp-time { flex: 0 0 62px; color: var(--text3); font-size: 11.5px; }
.pp-none, .pp-empty { font-size: 12.5px; font-weight: 600; color: var(--text3); padding: 4px 0; }
.pp-empty { text-align: center; padding: 24px 0; }
.pp-log-btn {
  width: 100%; padding: 11px; border: none; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 800; color: #fff; background: #059669;
}

/* 로그 화면: 제목과 Log 버튼 사이의 [지난] 체크 */
.past-filter {
  margin: 0 auto; padding: 6px 10px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12px; font-weight: 800; color: var(--text2); border-radius: 999px; border: 1px solid var(--border2); background: var(--surface);
}
/* 작은 네모 체크: 기본 체크박스 대신 직접 그린다 */
.past-filter input {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; margin: 0; flex-shrink: 0; cursor: pointer;
  border: 1.5px solid var(--text3); border-radius: 3px; background: transparent;
  display: inline-grid; place-content: center; transition: background 0.12s, border-color 0.12s;
}
.past-filter input::after {
  content: ''; width: 3px; height: 6px; margin-top: -1px;
  border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) scale(0); transition: transform 0.12s;
}
.past-filter input:checked { background: var(--accent); border-color: var(--accent); }
.past-filter input:checked::after { transform: rotate(45deg) scale(1); }
.past-filter input:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.past-filter:has(input:checked) { color: var(--accent2); background: var(--accent-bg); border-color: var(--accent); }

/* 상세 화면 상단: 돌아가기·버튼은 윗줄, 제목은 아랫줄 전체 폭 (제목이 좁은 칸에서 글자 단위로 끊기지 않게) */
#trip-log-detail > .app-header { flex-wrap: wrap; row-gap: 8px; }
#trip-log-detail > .app-header > .detail-back-btn { order: 1; }
#trip-log-detail > .app-header > .log-detail-actions { order: 2; grid-template-columns: repeat(4, auto); }
#trip-log-detail > .app-header > div:nth-child(2) { order: 3; flex: 1 1 100%; margin-left: 0 !important; }
#trip-log-detail .header-title { word-break: keep-all; overflow-wrap: break-word; }

/* 처음 만든 계획: 상세 일정 작성 안내 + [+]·AI작성 깜빡임 */
.plan-guide { margin: 10px 0; padding: 12px 14px; border-radius: 14px; background: var(--accent-bg); border: 1px dashed color-mix(in srgb, var(--accent2) 55%, var(--border2)); }
.plan-guide p { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--text); }
.plan-guide p + p { margin-top: 6px; }
.plan-guide .pg-plus, .plan-guide .pg-ai { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 14px; font-weight: 800; color: #fff; background: var(--accent); }
.plan-guide .pg-ai { background: transparent; font-size: 15px; }
@keyframes guide-blink {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent2) 0%, transparent); transform: scale(1); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent2) 45%, transparent); transform: scale(1.08); }
}
.guide-blink { animation: guide-blink 1.2s ease-in-out infinite; border-color: var(--accent2) !important; }
@media (prefers-reduced-motion: reduce) { .guide-blink { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent2) 45%, transparent); } }
