:root {
  --bg-glass: rgba(255, 255, 255, 0.94);
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --surface-hover: #ececef;
  --ink: #111113;
  --ink-2: #52525b;
  --ink-3: #8e8e93;
  --hairline: rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.14), 0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.09);

  --accent: #ff385c;
  --cat-flight: #0a84ff;
  --cat-hotel: #7c3aed;
  --cat-food: #ff6b2c;
  --cat-spot: #10b981;
  --cat-etc: #636366;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* Full-Bleed Map Canvas */
.canvas-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #e8ecef;
}

.full-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Floating Left Itinerary Sheet (Apple Maps / Airbnb feel) */
.floating-sheet {
  position: absolute;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: 400px;
  background: var(--bg-glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-top {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}

.sheet-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-line h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.days-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--surface-soft);
  padding: 3px 8px;
  border-radius: 999px;
}

.subtitle-line {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-3);
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a1a1aa;
  display: inline-block;
}

.sync-pill.live {
  background: #ecfdf5;
  color: #047857;
}

.sync-pill.live .sync-dot {
  background: #10b981;
}

.sync-pill.warn {
  background: #fffbeb;
  color: #b45309;
}

.sync-pill.warn .sync-dot {
  background: #f59e0b;
}

.top-icon-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-chip-btn {
  border: none;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 0 11px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.user-chip-btn:hover {
  background: var(--surface-hover);
}

.circle-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--surface-soft);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.circle-icon-btn svg {
  width: 16px;
  height: 16px;
}

.circle-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

/* Instant Search Pill */
.instant-search-wrap {
  position: relative;
  margin-top: 14px;
}

.search-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 5px 6px 5px 12px;
  border: 1.5px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.search-pill:focus-within {
  background: #fff;
  border-color: var(--ink);
}

.search-ico {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
  flex-shrink: 0;
}

.search-pill input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  height: 32px !important;
  line-height: 32px !important;
  font-size: 13px;
  padding: 0 4px !important;
}

.dist-chip {
  display: inline-block;
  margin-left: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-soft);
  padding: 1px 6px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.stepper-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stepper-row input {
  width: 56px;
  text-align: center;
  font-weight: 700;
  padding: 0 4px;
}

.step-btn {
  width: 34px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.step-btn:hover {
  background: var(--surface-hover);
}

.nights-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  margin-left: 2px;
}

.search-go-btn {
  border: none;
  background: var(--ink);
  color: #fff;
  border-radius: 9px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.search-plus-btn {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: none;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.quick-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
  border: 1px solid var(--hairline);
  max-height: 280px;
  overflow-y: auto;
  z-index: 600;
}

.q-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background 0.12s;
}

.q-result-item:hover {
  background: var(--surface-soft);
}

.q-result-item:last-child {
  border-bottom: none;
}

.q-res-title {
  font-weight: 700;
  font-size: 13.5px;
}

.q-res-meta {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.q-add-pill {
  flex-shrink: 0;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.api-status-line {
  margin-top: 7px;
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1.4;
}

.api-status-line.ok {
  background: #ecfdf5;
  color: #065f46;
}

.api-status-line.err {
  background: #fef2f2;
  color: #b91c1c;
}

/* Day Switcher */
.day-switcher {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  overflow-x: auto;
}

.day-btn {
  border: none;
  background: transparent;
  color: var(--ink-3);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.day-btn:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.day-btn.active {
  background: var(--ink);
  color: #fff;
}

/* Scrollable Timeline */
.sheet-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 24px;
}

.day-divider {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 16px 0 8px 4px;
}

.day-divider:first-child {
  margin-top: 2px;
}

.stop-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.stop-card:hover {
  background: var(--surface-soft);
}

.stop-card.selected {
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.stop-pin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.bg-flight { background: var(--cat-flight); }
.bg-hotel { background: var(--cat-hotel); }
.bg-food { background: var(--cat-food); }
.bg-spot { background: var(--cat-spot); }
.bg-etc { background: var(--cat-etc); }

.stop-main {
  flex: 1;
  min-width: 0;
}

.stop-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.stop-title {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.stop-time-cost {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.stop-time-cost strong {
  color: var(--ink);
  font-weight: 600;
}

.stop-memo {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.45;
}

.hover-tools {
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}

.stop-card:hover .hover-tools,
.stop-card.selected .hover-tools {
  opacity: 1;
}

.mini-ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
}

.mini-ico svg {
  width: 14px;
  height: 14px;
}

.mini-ico:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

/* Sleek Transit Connector (Flighty / KakaoMap Style) */
.transit-connector {
  display: flex;
  gap: 12px;
  padding: 2px 12px;
}

.transit-spine {
  width: 28px;
  display: flex;
  justify-content: center;
}

.transit-spine i {
  width: 2px;
  background: linear-gradient(180deg, rgba(17, 17, 19, 0.18), rgba(17, 17, 19, 0.08));
  border-radius: 2px;
}

.transit-card {
  flex: 1;
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 4px 0;
}

.transit-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.transit-times {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.transit-times span {
  color: var(--ink-3);
  font-weight: 500;
  margin: 0 4px;
}

.transit-fare {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--accent);
}

.transit-fare small {
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 3px;
}

.mode-pills {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.m-pill {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s;
}

.m-pill.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.transit-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  font-size: 11px;
  color: var(--ink-3);
}

.transit-sub a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.transit-sub a:hover {
  text-decoration: underline;
}

/* Floating Top-Right Navigation Dock */
.floating-nav-dock {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 500;
  display: flex;
  gap: 4px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 5px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.dock-btn {
  border: none;
  background: transparent;
  color: var(--ink-2);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.dock-btn:hover {
  color: var(--ink);
}

.dock-btn.active {
  background: var(--ink);
  color: #fff;
}

/* Floating Bottom-Center Dark Glass HUD */
.floating-hud {
  position: absolute;
  bottom: 20px;
  left: calc(416px + (100vw - 416px) / 2);
  transform: translateX(-50%);
  z-index: 450;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(17, 17, 19, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  white-space: nowrap;
}

.hud-sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.22);
}

.hud-cost small {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
}

/* Floating Map Tools (Bottom Right) */
.floating-map-tools {
  position: absolute;
  bottom: 20px;
  right: 16px;
  z-index: 450;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-tool-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  font-size: 10.5px;
  font-weight: 800;
}

.map-tool-btn svg {
  width: 17px;
  height: 17px;
}

.map-tool-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* Secondary Floating Drawer */
.secondary-drawer {
  position: absolute;
  top: 72px;
  right: 16px;
  bottom: 16px;
  width: 420px;
  background: var(--bg-glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  z-index: 510;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--hairline);
}

.drawer-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 28px;
}

.drawer-section {
  margin-bottom: 24px;
}

.drawer-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
}

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

.muted-sub {
  font-size: 12.5px;
  color: var(--ink-3);
}

.muted-num {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.clean-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.clean-list {
  display: flex;
  flex-direction: column;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}

.list-item:last-child {
  border-bottom: none;
}

.chips-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.member-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-soft);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}

.member-pill button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-3);
  padding: 0;
}

.settle-card {
  margin-top: 12px;
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.settle-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--hairline);
}

.settle-row:last-child {
  border-bottom: none;
}

/* Forms & Buttons */
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inline-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

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

input[type='text'],
input[type='number'],
input[type='time'],
input[type='password'],
select,
textarea {
  width: 100%;
  border: 1px solid var(--hairline);
  background: var(--surface-soft);
  border-radius: 11px;
  padding: 0 12px;
  font-size: 13.5px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s, border-color 0.15s;
}

input[type='text'],
input[type='number'],
input[type='time'],
input[type='password'],
select {
  height: 42px;
  line-height: 42px;
}

textarea {
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23636366' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  border-color: var(--ink);
}

/* Location Picker, Segmented Category, Map Pick Banner & In-Page Focus Card */
.loc-picker-box {
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 12px;
}

.loc-picker-box input {
  background: #fff;
}

.pick-map-btn {
  border: none;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.pick-map-btn:hover {
  background: var(--ink);
  color: #fff;
}

.loc-preview-badge {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.4;
}

.loc-preview-badge.set {
  color: #047857;
  font-weight: 600;
}

.cat-segment {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: 12px;
}

.cat-seg-btn {
  border: none;
  background: transparent;
  color: var(--ink-2);
  height: 34px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-seg-btn.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.or-divider {
  position: relative;
  text-align: center;
  margin: 16px 0 14px;
}

.or-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--hairline);
}

.or-divider span {
  position: relative;
  background: #fff;
  padding: 0 10px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.map-pick-banner {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.map-pick-banner .btn-soft {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
}

.canvas-root.pick-mode .full-map {
  cursor: crosshair !important;
}

.map-focus-card {
  position: absolute;
  bottom: 72px;
  left: calc(416px + (100vw - 416px) / 2);
  transform: translateX(-50%);
  z-index: 460;
  width: 320px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
}

.focus-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.focus-title {
  font-size: 15px;
  font-weight: 800;
}

.focus-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.focus-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--hairline);
}

.focus-ext-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}

.focus-ext-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.btn-dark {
  border: none;
  background: var(--ink);
  color: #fff;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-soft {
  border: none;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-soft:hover {
  background: var(--surface-hover);
}

.text-action {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.text-danger {
  border: none;
  background: transparent;
  color: #dc2626;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

/* Custom Map Markers & Curved Route Callouts */
.apple-pin {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  color: var(--ink);
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  transition: transform 0.15s;
}

.apple-pin.active {
  background: var(--ink);
  color: #fff;
  transform: scale(1.08);
}

.apple-pin-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.arc-badge {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  border: 1px solid rgba(17, 17, 19, 0.14);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
}

.arc-badge span {
  color: var(--accent);
  margin-left: 5px;
}

.gmap-arc-badge {
  background: rgba(255, 255, 255, 0.96);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(17, 17, 19, 0.16);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

/* Modals */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 2000;
  padding: 16px;
}

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
}

.modal-top h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.modal-content {
  padding: 18px 20px 20px;
}

.lbl {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 5px;
}

.api-box {
  background: var(--surface-soft);
  padding: 12px;
  border-radius: 14px;
}

.api-test-result {
  margin-top: 8px;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  line-height: 1.45;
}

.api-test-result.ok {
  background: #ecfdf5;
  color: #065f46;
}

.api-test-result.err {
  background: #fef2f2;
  color: #b91c1c;
}

.api-hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 3000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* Mobile Bottom-Sheet Grab Handle (hidden on desktop) */
.sheet-grab-bar {
  display: none;
}

@media (max-width: 900px) {
  .sheet-grab-bar {
    display: flex;
    justify-content: center;
    padding: 9px 0 4px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .grab-pill {
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
  }

  .floating-sheet {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 52dvh;
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: height 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .floating-sheet.sheet-collapsed {
    height: 152px;
  }

  .floating-sheet.sheet-expanded {
    height: 85dvh;
  }

  .sheet-top {
    padding: 6px 16px 12px;
  }

  .floating-nav-dock {
    top: calc(10px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .floating-nav-dock::-webkit-scrollbar {
    display: none;
  }

  .dock-btn {
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 12px;
  }

  /* Move map tools above bottom sheet so they are never covered */
  .floating-map-tools {
    top: calc(64px + env(safe-area-inset-top, 0px));
    bottom: auto;
    right: 10px;
  }

  .floating-hud {
    display: none;
  }

  .secondary-drawer {
    top: calc(62px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* Always show edit/delete/map buttons on touch devices */
  .hover-tools {
    opacity: 1;
  }

  /* Prevent iOS Safari auto-zoom on input focus */
  input[type='text'],
  input[type='number'],
  input[type='time'],
  input[type='password'],
  select,
  textarea {
    font-size: 16px;
  }
}
