/* ==========================================================================
   Kiatan TravelFlow (Initium v2.0.14) — Official Web & 1:1 Android PWA Styles
   Matches Color.kt, Theme.kt, Type.kt, and TravelFlowApp.kt
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

/* Theme palette: RGB triplets so colours work with opacity (rgb(var(--c-ink) / 0.08)) and with
   Tailwind's colour names (text-ink, bg-card ...; see the config in index.html). Light mode
   redefines these on html[data-theme="light"] (docs/LIGHT_MODE_PLAN.md). */
:root {
  --c-page: 8 20 37;
  --c-card: 21 32 49;
  --c-raised: 19 34 56;
  --c-ink: 255 255 255;
  --c-body: 176 190 197;
  --c-muted: 138 153 174;
  --c-subtle: 138 154 178;
  --c-accent: 45 212 191;
  --c-brand: 45 212 191;
  --c-on-brand: 0 55 49;
  --c-warm: 255 210 159;
  --c-mint: 94 234 212;
}

:root {
  /* Core Android Color.kt Palette */
  --bg-dark: rgb(var(--c-page));
  --surface-dark: rgb(var(--c-page));
  --surface-variant: #2A3548;
  --card-dark: rgb(var(--c-card));
  --card-elevated: #1E293B;
  --card-onboarding: rgb(var(--c-raised));
  --border-subtle: rgb(var(--c-ink) / 0.08);
  --border-card: rgb(var(--c-ink) / 0.14);
  --border-onboarding: #233654;

  /* Brand & Semantic Accents */
  --primary: rgb(var(--c-brand));
  --on-primary: rgb(var(--c-on-brand));
  --primary-container: rgba(45, 212, 191, 0.16);
  --secondary: #C0C1FF;
  --secondary-container: #3131C0;
  --tertiary: rgb(var(--c-warm));
  --tertiary-container: #FFAD3A;

  /* Text Hierarchy */
  --text-heading: rgb(var(--c-ink));
  --text-body: rgb(var(--c-body));
  --text-muted: rgb(var(--c-muted));
  --text-accent: rgb(var(--c-accent));

  /* Readiness Status Badges */
  --status-planning-bg: rgba(211, 47, 47, 0.22);
  --status-planning-fg: #FFB4AB;
  --status-partial-bg: rgba(253, 216, 53, 0.20);
  --status-partial-fg: #FFD29F;
  --status-booked-bg: rgba(56, 142, 60, 0.25);
  --status-booked-fg: #57F1DB;
  --status-completed-bg: rgba(117, 117, 117, 0.25);
  --status-completed-fg: #BDBDBD;

  /* Danger / Warning / Success */
  --danger: #EF4444;
  --warning: #F59E0B;
  --success: #10B981;
}

/* Dark-only UI: keep native controls (date/time pickers, select menus, scrollbars, autofill) dark
   regardless of the device's light/dark setting. */
:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Installed home-screen PWA: no pinch or double-tap zoom (class set by the inline script in index.html) */
html.kiatan-standalone,
html.kiatan-standalone body {
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-dark);
  color: var(--text-heading);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100dvh;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(8, 20, 37, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 191, 0.28);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(45, 212, 191, 0.5);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Surfaces & Cards */
.kiatan-surface {
  background-color: var(--bg-dark);
}

.kiatan-card {
  background-color: var(--card-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.kiatan-card:hover {
  border-color: rgba(45, 212, 191, 0.32);
}

.kiatan-card-elevated {
  background-color: var(--card-elevated);
  border: 1px solid var(--border-card);
  border-radius: 16px;
}

.kiatan-onboarding-card {
  background: linear-gradient(180deg, #1A2A44 0%, #0F1F35 100%);
  border: 1px solid var(--border-onboarding);
  border-radius: 20px;
}

.kiatan-glass {
  background: rgba(21, 32, 49, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgb(var(--c-ink) / 0.16);
}

/* Buttons & Interactive Controls */
.btn-teal {
  background-color: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  border-radius: 14px;
  transition: all 0.18s ease;
  box-shadow: 0 4px 18px rgba(45, 212, 191, 0.22);
}
.btn-teal:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(45, 212, 191, 0.34);
}
.btn-teal:active:not(:disabled) {
  transform: translateY(0);
}
.btn-teal:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-outline-glass {
  background: rgb(var(--c-ink) / 0.04);
  border: 1px solid rgb(var(--c-ink) / 0.16);
  color: rgb(var(--c-ink));
  font-weight: 600;
  border-radius: 14px;
  transition: all 0.18s ease;
}
.btn-outline-glass:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(45, 212, 191, 0.08);
}

/* Form Inputs matching Android OutlinedTextField */
.kiatan-input {
  width: 100%;
  background-color: #0D1B2E;
  border: 1px solid #2A3C58;
  border-radius: 14px;
  padding: 12px 15px;
  color: rgb(var(--c-ink));
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kiatan-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.16);
}
.kiatan-input::placeholder {
  color: var(--text-muted);
}

/* Native dropdown rows (Windows/Android render <option> with their own background) */
.kiatan-input option,
.kiatan-input optgroup {
  background-color: #0D1B2E;
  color: rgb(var(--c-ink));
}

/* Date / time picker icons: visible on the dark field */
.kiatan-input::-webkit-calendar-picker-indicator {
  opacity: 0.75;
  cursor: pointer;
}
.kiatan-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Browser autofill otherwise paints a light yellow/white field with dark text */
.kiatan-input:-webkit-autofill,
.kiatan-input:-webkit-autofill:hover,
.kiatan-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #FFFFFF;
  caret-color: #FFFFFF;
  -webkit-box-shadow: 0 0 0 1000px #0D1B2E inset;
  box-shadow: 0 0 0 1000px #0D1B2E inset;
  transition: background-color 9999s ease-out 0s;
}

/* Status Pills (JourneyListScreen.kt) */
.status-pill-planning {
  background: var(--status-planning-bg);
  color: var(--status-planning-fg);
  border: 1px solid rgba(255, 180, 171, 0.35);
}
.status-pill-partial {
  background: var(--status-partial-bg);
  color: var(--status-partial-fg);
  border: 1px solid rgba(255, 210, 159, 0.35);
}
.status-pill-booked {
  background: var(--status-booked-bg);
  color: var(--status-booked-fg);
  border: 1px solid rgba(87, 241, 219, 0.35);
}
.status-pill-completed {
  background: var(--status-completed-bg);
  color: var(--status-completed-fg);
  border: 1px solid rgba(189, 189, 189, 0.3);
}

/* Role Badges */
.role-badge-owner {
  background: rgba(99, 102, 241, 0.24);
  color: #C0C1FF;
  border: 1px solid rgba(192, 193, 255, 0.4);
}
.role-badge-editor {
  background: rgba(45, 212, 191, 0.18);
  color: rgb(var(--c-accent));
  border: 1px solid rgba(45, 212, 191, 0.4);
}
.role-badge-viewer {
  background: rgb(var(--c-ink) / 0.08);
  color: rgb(var(--c-body));
  border: 1px solid rgb(var(--c-ink) / 0.18);
}

/* ==========================================================================
   DESKTOP vs. MOBILE PWA ISOLATION (Rule #9 Strict Media Query Isolation)
   - Desktop (>= 768px): Left Glass Navigation Rail + Multi-Pane Workspace
   - Mobile & Installed Home-Screen PWA (< 768px): 1:1 Android App Clone with
     Floating Rounded-Pill Bottom Navigation Bar & Expandable FAB
   ========================================================================== */

@media (min-width: 768px) {
  .mobile-only-nav,
  .mobile-only-element {
    display: none !important;
  }
  .desktop-only-rail {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 280px !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow-y: auto !important;
    z-index: 40 !important;
  }
  .desktop-main-pane {
    margin-left: 280px !important;
    width: calc(100% - 280px) !important;
    min-width: 0 !important;
  }
  .app-main-content {
    padding-bottom: 32px;
  }
}

@media (max-width: 767px) {
  html, body {
    overflow-x: clip !important;
  }
  /* iOS zooms the page when a field under 16px is focused; !important beats Tailwind text-xs utilities */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  .desktop-only-rail,
  .desktop-only-element {
    display: none !important;
  }
  .mobile-only-nav {
    display: flex !important;
  }
  /* PWA & Mobile Persistent Top Header with Safe Area Inset (iOS Notch/Dynamic Island Parity) */
  .kiatan-top-header {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 45 !important;
    padding-top: max(env(safe-area-inset-top, 48px), 48px) !important;
    padding-bottom: 12px !important;
    padding-left: max(env(safe-area-inset-left, 16px), 16px) !important;
    padding-right: max(env(safe-area-inset-right, 16px), 16px) !important;
    background: rgb(var(--c-page) / 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgb(var(--c-ink) / 0.1) !important;
  }
  .mobile-safe-top {
    padding-top: max(env(safe-area-inset-top, 48px), 48px) !important;
  }
  .app-main-content {
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 12px));
  }

  /* 1:1 Android TravelFlowBottomBar (TravelFlowApp.kt) */
  .android-bottom-pill-bar {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(12px + env(safe-area-inset-bottom, 4px));
    height: 72px;
    border-radius: 32px;
    background: rgba(16, 26, 42, 0.86);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgb(var(--c-ink) / 0.22);
    box-shadow:
      0 0 28px rgba(45, 212, 191, 0.25),
      0 12px 32px rgba(0, 0, 0, 0.65);
    z-index: 50;
    transition: height 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                border-radius 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.24s ease;
  }

  /* Shrunk state on scroll down (matches TravelFlowBottomBar isShrunk = true) */
  .android-bottom-pill-bar.shrunk {
    height: 54px;
    border-radius: 24px;
    left: 28px;
    right: 28px;
  }
  .android-bottom-pill-bar.shrunk .nav-tab-label {
    display: none;
  }

  /* Floating Action Button positioned above bottom pill bar on mobile */
  .android-fab-container {
    bottom: calc(96px + env(safe-area-inset-bottom, 8px)) !important;
    right: 18px !important;
  }
}

/* Desktop FAB position */
@media (min-width: 768px) {
  .android-fab-container {
    bottom: 28px;
    right: 32px;
  }
}

/* Animations */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.45);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(45, 212, 191, 0);
  }
}

.pulse-teal {
  animation: pulseGlow 2.4s infinite;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-screen {
  animation: fadeInSlide 0.22s ease-out;
}

/* ==========================================================================
   Google Places Suppression & In-App Autocomplete Dropdown
   - Permanently eliminates stray .pac-container horizontal white lines
   - Matches Android 1:1 Dark Mode Outlined Autocomplete styling
   ========================================================================== */
.pac-container,
.pac-item,
.pac-logo {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  border: none !important;
  border-top: none !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

.kiatan-places-dropdown {
  /* Fully opaque so suggestions never blend with the form fields underneath */
  background-color: #132238;
  border: 1px solid rgba(45, 212, 191, 0.35) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85) !important;
}
.kiatan-places-dropdown .kiatan-place-option + .kiatan-place-option {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.kiatan-places-attribution {
  padding: 6px 14px 8px;
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   Kiatan 2.1 design foundation — calm, readable, one accent
   - Readable minimum text size (no 10–11px text) and calmer heading weight
   - Shared building blocks used by the redesigned screens
   ========================================================================== */
html .text-xs {
  font-size: 0.8125rem; /* 13px */
  line-height: 1.25rem;
}
html .text-\[10px\],
html .text-\[11px\] {
  font-size: 0.75rem !important; /* 12px floor */
  line-height: 1.1rem;
}
html .font-extrabold {
  font-weight: 700;
}
html .tracking-wider {
  letter-spacing: 0.02em;
}

/* Section heading above a group of cards */
.k-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-body);
  margin: 0;
}

/* Rounded icon tile used in list rows and cards */
.k-icon-tile {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(45, 212, 191, 0.12);
  color: rgb(var(--c-accent));
}
.k-icon-tile.is-muted {
  background: rgb(var(--c-ink) / 0.06);
  color: var(--text-body);
}

/* Tappable list row */
.k-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--card-elevated);
  border: 1px solid var(--border-subtle);
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
button.k-row:hover,
a.k-row:hover,
.k-row.is-clickable:hover {
  border-color: rgba(45, 212, 191, 0.35);
}
.k-row-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: rgb(var(--c-ink));
  line-height: 1.3;
}
.k-row-sub {
  font-size: 0.8125rem;
  color: var(--text-body);
  line-height: 1.35;
}

/* Segmented tabs */
.k-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.k-tabs::-webkit-scrollbar {
  display: none;
}
.k-tab {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-body);
  white-space: nowrap;
  border: 1px solid transparent;
}
.k-tab.is-active {
  background: rgba(45, 212, 191, 0.14);
  color: rgb(var(--c-accent));
  border-color: rgba(45, 212, 191, 0.3);
}

/* Quiet secondary button */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 600;
  color: var(--text-body);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-ghost:hover {
  background: rgb(var(--c-ink) / 0.06);
  color: rgb(var(--c-ink));
}
.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  color: #FCA5A5;
  font-weight: 700;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.26);
}

/* Round icon-only button */
.k-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-body);
  background: rgb(var(--c-ink) / 0.05);
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.k-icon-btn:hover {
  background: rgb(var(--c-ink) / 0.1);
  color: rgb(var(--c-ink));
}

/* Bottom sheet / dialog panel */
.k-sheet {
  width: 100%;
  max-width: 28rem;
  background: var(--card-dark);
  border: 1px solid var(--border-card);
  border-radius: 24px;
  padding: 20px;
}
@media (max-width: 639px) {
  .k-sheet.is-bottom {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

/* Progress bar */
.k-progress {
  height: 6px;
  border-radius: 999px;
  background: rgb(var(--c-ink) / 0.08);
  overflow: hidden;
}
.k-progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.3s ease;
}

/* Checklist item */
.k-check {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgb(var(--c-ink) / 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--on-primary);
}
.k-check.is-done {
  background: var(--primary);
  border-color: var(--primary);
}

/* Day-by-day itinerary timeline */
.k-day-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-body);
  padding: 4px 2px;
}
.k-time {
  width: 52px;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: rgb(var(--c-ink));
  font-variant-numeric: tabular-nums;
}
.k-time small {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Accordions (Help & guides) */
details.k-accordion {
  border-radius: 16px;
  background: var(--card-elevated);
  border: 1px solid var(--border-subtle);
}
details.k-accordion > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font-weight: 600;
  color: rgb(var(--c-ink));
}
details.k-accordion > summary::-webkit-details-marker {
  display: none;
}
details.k-accordion > summary .k-chevron {
  margin-left: auto;
  transition: transform 0.2s ease;
  color: var(--text-body);
}
details.k-accordion[open] > summary .k-chevron {
  transform: rotate(180deg);
}
details.k-accordion .k-accordion-body {
  padding: 0 16px 16px;
  color: var(--text-body);
  font-size: 0.875rem;
  line-height: 1.6;
}
details.k-accordion .k-accordion-body ol,
details.k-accordion .k-accordion-body ul {
  padding-left: 1.2rem;
  margin: 6px 0 0;
}
details.k-accordion .k-accordion-body ol { list-style: decimal; }
details.k-accordion .k-accordion-body ul { list-style: disc; }
details.k-accordion .k-accordion-body li + li { margin-top: 4px; }

/* ==========================================================================
   Kiatan identity (Android parity): one colour per category, cover photos,
   and divided lists so rows read as a clear sequence
   ========================================================================== */
.k-icon-tile.cat-transport { background: rgba(56, 189, 248, 0.15); color: #38BDF8; }
.k-icon-tile.cat-stay      { background: rgba(251, 146, 60, 0.16); color: #FDBA74; }
.k-icon-tile.cat-activity  { background: rgba(45, 212, 191, 0.15); color: rgb(var(--c-accent)); }
.k-icon-tile.cat-docs      { background: rgba(56, 189, 248, 0.15); color: #38BDF8; }
.k-icon-tile.cat-packing   { background: rgba(52, 211, 153, 0.15); color: #34D399; }
.k-icon-tile.cat-budget    { background: rgba(245, 158, 11, 0.16); color: #FBBF24; }
.k-icon-tile.cat-reminder  { background: rgba(167, 139, 250, 0.16); color: #C4B5FD; }
.k-icon-tile.cat-emergency { background: rgba(248, 113, 113, 0.16); color: #FCA5A5; }

/* Card that holds rows separated by hairline dividers */
.k-list {
  background: var(--card-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  overflow: hidden;
}
.k-list > .k-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
}
.k-list > .k-list-row + .k-list-row,
.k-list > .k-list-head + .k-list-row,
.k-list > .k-list-row + .k-list-head {
  border-top: 1px solid rgb(var(--c-ink) / 0.07);
}
.k-list > button.k-list-row:hover { background: rgb(var(--c-ink) / 0.03); }
.k-list > .k-list-head {
  padding: 10px 16px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgb(var(--c-accent));
  background: rgba(45, 212, 191, 0.05);
}
.k-list-time {
  width: 48px;
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: rgb(var(--c-ink));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Itinerary timeline (Android TableViewScreen look): a rail with a dot per item, card beside it */
.k-tl {
  display: flex;
  flex-direction: column;
}
.k-tl-item,
.k-tl-day,
.k-ov-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  text-align: left;
}
.k-tl > * { position: relative; }
.k-tl-rail {
  position: relative;
  display: block;
}
/* The line belongs to the row (buttons don't stretch their rail to full height) */
.k-tl > *::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(45, 212, 191, 0.35);
}
.k-tl > :first-child::before { top: 22px; }
.k-tl > :last-child::before { bottom: auto; height: 22px; }
.k-tl > :only-child::before { display: none; }
.k-tl-node,
.k-tl-daynode {
  position: absolute;
  left: 7px;
  top: 15px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgb(var(--c-page));
  border: 2px solid var(--node, rgb(var(--c-brand)));
}
.k-tl-node::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 999px;
  background: var(--node, rgb(var(--c-brand)));
}
.k-tl-daynode {
  left: 5px;
  top: 13px;
  width: 18px;
  height: 18px;
  border-color: rgb(var(--c-brand));
  background: #0F2236;
}
.k-tl-day.is-warn .k-tl-daynode { border-color: #FCD34D; }
.k-tl-daylabel {
  padding: 12px 0 6px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: rgb(var(--c-accent));
}
.k-tl-day.is-warn .k-tl-daylabel { color: #FCD34D; }
.k-tl-item { padding: 4px 0; }
.k-tl-item.is-transport { --node: #38BDF8; }
.k-tl-item.is-stay { --node: #FDBA74; }
.k-tl-item.is-activity { --node: #2DD4BF; }
.k-tl-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgb(var(--c-ink) / 0.04);
  border: 1px solid rgb(var(--c-ink) / 0.07);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
button.k-tl-item:hover .k-tl-card { background: rgb(var(--c-ink) / 0.07); }
.k-tl-item.is-next .k-tl-card {
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(45, 212, 191, 0.08);
}
.k-tl-item.is-next .k-tl-node { box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.2); }
.k-tl-time {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: rgb(var(--c-accent));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.k-tl-next {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(var(--c-accent));
  background: rgba(45, 212, 191, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.35);
}

/* Whole-journey itinerary: a card per stop that opens to its timeline */
.k-itin-stop {
  background: var(--card-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
}
.k-itin-stop-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
}
.k-itin-stop-head .k-chevron { display: inline-flex; transition: transform 0.2s ease; }
.k-itin-stop.is-open .k-chevron { transform: rotate(180deg); }
.k-itin-stop-body { padding: 0 12px 10px; }

/* Itinerary overview: one card per stop on the rail */
.k-ov-item { padding: 5px 0; }
.k-ov-item .k-tl-node { top: 18px; }
.k-ov-item.is-current .k-tl-node { box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.2); }
.k-tl > .k-ov-item:first-child::before { top: 25px; }
.k-tl > .k-ov-item:last-child::before { height: 25px; }
.k-ov-card {
  min-width: 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--card-dark);
  border: 1px solid var(--border-subtle);
}
.k-ov-item.is-current .k-ov-card { border-color: rgba(45, 212, 191, 0.45); }
.k-ov-section { margin-top: 10px; }
.k-ov-label {
  margin-bottom: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(var(--c-muted));
}
.k-ov-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: rgb(var(--c-ink) / 0.85);
}
.k-ov-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 7px;
}
.k-ov-dot.cat-transport { background: rgba(56, 189, 248, 0.15); color: #38BDF8; }
.k-ov-dot.cat-stay { background: rgba(251, 146, 60, 0.16); color: #FDBA74; }
.k-ov-dot.cat-activity { background: rgba(45, 212, 191, 0.15); color: rgb(var(--c-accent)); }

/* Flights page: boarding-pass card, alerts row and flight list */
.k-fl-pass { background: var(--card-dark); border: 1px solid var(--border-subtle); border-radius: 22px; overflow: hidden; }
.k-fl-top { padding: 16px 18px 14px; }
.k-fl-route { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: 18px; }
.k-fl-code { font-family: var(--font-display, inherit); font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; color: rgb(var(--c-ink)); }
.k-fl-time { font-size: 15px; font-weight: 600; color: rgb(var(--c-ink)); margin-top: 6px; font-variant-numeric: tabular-nums; }
.k-fl-city { font-size: 12px; color: var(--text-body); margin-top: 1px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-fl-route > .text-right .k-fl-city { margin-left: auto; }
.k-fl-mid { text-align: center; min-width: 0; }
.k-fl-line { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.k-fl-line > span { flex: 1; border-top: 1.5px dashed rgb(var(--c-ink) / 0.22); }
.k-fl-label { font-size: 11.5px; color: rgb(var(--c-subtle)); }
.k-fl-value { font-size: 14px; font-weight: 600; color: rgb(var(--c-ink)); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k-fl-value.is-muted { font-weight: 400; color: rgb(var(--c-subtle)); font-size: 13px; }
.k-fl-tear { position: relative; border-top: 1.5px dashed rgb(var(--c-ink) / 0.16); margin: 0 14px; }
.k-fl-tear::before, .k-fl-tear::after { content: ''; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg-dark); border: 1px solid var(--border-subtle); }
.k-fl-tear::before { left: -25px; }
.k-fl-tear::after { right: -25px; }
.k-fl-bottom { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.k-fl-details { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.k-fl-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgb(var(--c-ink) / 0.04); font-size: 13px; color: rgb(var(--c-ink)); }
.k-fl-badge { flex-shrink: 0; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.k-fl-badge.is-good { background: rgba(45, 212, 191, 0.14); color: rgb(var(--c-accent)); border-color: rgba(45, 212, 191, 0.3); }
.k-fl-badge.is-warn { background: rgba(253, 186, 116, 0.14); color: #FDBA74; border-color: rgba(253, 186, 116, 0.3); }
.k-fl-badge.is-bad { background: rgba(244, 63, 94, 0.14); color: #FDA4AF; border-color: rgba(244, 63, 94, 0.35); }
.k-fl-badge.is-info { background: rgba(56, 189, 248, 0.14); color: #7DD3FC; border-color: rgba(56, 189, 248, 0.3); }
.k-fl-badge.is-muted { background: rgb(var(--c-ink) / 0.06); color: rgb(var(--c-body)); }
.k-fl-alerts { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--border-subtle); background: var(--card-dark); }
.k-fl-list { border: 1px solid var(--border-subtle); border-radius: 18px; overflow: hidden; background: var(--card-dark); }
.k-fl-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; text-align: left; transition: background-color 0.15s ease; }
.k-fl-row + .k-fl-row { border-top: 1px solid rgb(var(--c-ink) / 0.07); }
.k-fl-row:hover { background: rgb(var(--c-ink) / 0.03); }
.k-fl-row.is-current { background: rgba(45, 212, 191, 0.06); }
.k-fl-row.is-past { opacity: 0.9; }
.k-fl-day { width: 40px; flex-shrink: 0; text-align: center; line-height: 1.1; }
.k-fl-day span { display: block; font-size: 11px; color: rgb(var(--c-body)); }
.k-fl-day b { display: block; font-size: 20px; color: rgb(var(--c-ink)); }
.k-fl-leg { padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgb(var(--c-ink) / 0.07); color: rgb(var(--c-body)); }
@media (max-width: 520px) {
  .k-fl-code { font-size: 28px; }
  .k-fl-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .k-fl-note { flex-direction: column; align-items: stretch; }
}

/* One content width for every page (the itinerary uses the same, with two columns inside) */
.k-page { width: 100%; max-width: 72rem; margin-left: auto; margin-right: auto; }

/* Desktop Safari: no rubber-band bounce that drags the whole page (sidebar included) off screen */
@media (min-width: 768px) {
  html, body { overscroll-behavior-y: none; }
}

/* Document "Shared" / "Only you" control */
.k-doc-vis { flex-shrink: 0; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: rgb(var(--c-body)); background: rgb(var(--c-ink) / 0.05); border: 1px solid rgb(var(--c-ink) / 0.08); }
button.k-doc-vis:hover { color: rgb(var(--c-ink)); border-color: rgb(var(--c-ink) / 0.18); }
.k-doc-vis.is-private { color: #FDBA74; background: rgba(253, 186, 116, 0.1); border-color: rgba(253, 186, 116, 0.3); }

/* Segmented choice (Theme: Match device / Light / Dark) */
.k-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgb(var(--c-ink) / 0.06); gap: 2px; flex-shrink: 0; }
.k-seg > button { padding: 6px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: rgb(var(--c-body)); white-space: nowrap; }
.k-seg > button.is-on { background: rgb(var(--c-card)); color: rgb(var(--c-ink)); box-shadow: 0 1px 3px rgb(0 0 0 / 0.18); }

/* Cover photo hero (journey cards and trip header) */
.k-cover {
  position: relative;
  background-color: #0F1F35;
  background-size: cover;
  background-position: center;
}
.k-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 20, 37, 0.15) 0%, rgba(8, 20, 37, 0.55) 55%, rgba(8, 20, 37, 0.95) 100%);
  pointer-events: none;
}
.k-cover > * { position: relative; z-index: 1; }
.k-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(8, 20, 37, 0.7);
  border: 1px solid rgb(var(--c-ink) / 0.16);
  color: rgb(var(--c-ink));
}
.k-chip.is-accent { background: rgba(45, 212, 191, 0.2); border-color: rgba(45, 212, 191, 0.45); color: rgb(var(--c-mint)); }
.k-chip.is-warm { background: rgba(255, 210, 159, 0.16); border-color: rgba(255, 210, 159, 0.4); color: rgb(var(--c-warm)); }

/* Installed app (iOS/Android): keep a solid strip behind the status bar so full-screen forms and
   pages never scroll their content up under the clock / Dynamic Island. */
html.kiatan-standalone body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top, 0px);
  background: rgb(var(--c-page));
  z-index: 9999;
  pointer-events: none;
}

/* iOS Safari gives date/time inputs a minimum width, so in a 2-column grid they spill past the
   edge. Let them shrink to the column and keep the value left-aligned like other fields. */
input[type='date'].kiatan-input,
input[type='time'].kiatan-input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
input[type='date'].kiatan-input::-webkit-date-and-time-value,
input[type='time'].kiatan-input::-webkit-date-and-time-value {
  text-align: left;
}
.grid > input[type='date'],
.grid > input[type='time'] {
  min-width: 0;
}

/* ---------- Wide screens ---------- */
/* Home: one column on phones (children ordered with style="order"), main + side columns from 1024px */
.home-layout { display: flex; flex-direction: column; gap: 1.25rem; }
.home-main, .home-side { display: contents; }
@media (min-width: 1024px) {
  .home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.5rem; align-items: start; }
  .home-main, .home-side { display: flex; flex-direction: column; gap: 1.25rem; }
  .home-side { position: sticky; top: 88px; }
  .home-tools {
    padding: 14px 8px; border-radius: 20px; flex-wrap: wrap; justify-content: space-around;
    background: rgb(var(--c-ink) / 0.03); border: 1px solid rgb(var(--c-ink) / 0.08);
  }
}
/* Full-screen create flows (travel type, transport, stay, activity): centred column on wide screens */
@media (min-width: 768px) {
  .k-flow > * { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; }
}

/* ---------- Pop-up forms: never cut off ---------- */
/* Centred pop-ups used align-items:center inside a scrolling backdrop, so a form taller than the
   screen lost its top half (unscrollable). Align to the top and centre with auto margins instead:
   short forms stay centred, tall forms scroll from the top. Bottom sheets stay at the bottom on phones. */
#modal-container > .fixed.inset-0:not(.flex-col) {
  overflow-y: auto;
  align-items: flex-start !important;
  overscroll-behavior: contain;
}
#modal-container > .fixed.inset-0:not(.flex-col) > * {
  margin-top: auto !important;
  margin-bottom: auto !important;
  flex-shrink: 0;
}
@media (max-width: 639px) {
  #modal-container > .fixed.inset-0.items-end:not(.flex-col) > * { margin-bottom: 0 !important; }
}

/* ---------- Step wizard (mountWizard) ---------- */
.k-wizard-progress { display: grid; gap: 8px; padding-top: 2px; }
.k-wizard-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.k-wizard-count { font-size: 12px; font-weight: 600; color: rgb(var(--c-muted)); letter-spacing: 0.02em; }
.k-wizard-title { font-size: 15px; font-weight: 700; color: rgb(var(--c-ink)); }
.k-wizard-bar { height: 6px; border-radius: 999px; background: rgb(var(--c-ink) / 0.08); overflow: hidden; }
.k-wizard-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2dd4bf, #38bdf8); transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.k-wizard-steps { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.k-wizard-steps::-webkit-scrollbar { display: none; }
.k-wizard-steps button {
  flex: none; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  color: rgb(var(--c-body)); background: rgb(var(--c-ink) / 0.04); border: 1px solid rgb(var(--c-ink) / 0.08);
}
.k-wizard-steps button.is-done { color: rgb(var(--c-accent)); border-color: rgba(45, 212, 191, 0.3); }
.k-wizard-steps button.is-current { color: #032b26; background: rgb(var(--c-brand)); border-color: rgb(var(--c-brand)); }
.k-wizard-steps button:disabled { opacity: 0.45; cursor: default; }
.k-step { animation: kStepIn 0.28s ease-out; }
@keyframes kStepIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.k-wizard-nav { display: flex; gap: 10px; padding-top: 4px; }
.k-wizard-nav > button { flex: 1; padding: 12px 16px; font-size: 14px; justify-content: center; }
.k-wizard-nav > button[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .k-step { animation: none; } .k-wizard-bar > span { transition: none; } }

/* ---------- Trip map ---------- */
.k-cover > .k-cover-map { position: absolute; inset: 0; z-index: 0; cursor: pointer; }
.k-cover.is-map-tap { cursor: pointer; }
/* Google Maps sets position:relative on its container, so size it explicitly */
.k-cover-map-canvas, .k-cover-map-canvas.k-gmap { position: absolute !important; inset: 0; width: 100%; height: 100%; }
.k-full-map, .k-full-map.k-gmap { position: absolute !important; inset: 0; width: 100%; height: 100%; }
/* Header maps aren't interactive: the tap opens the full map */
.k-cover-map-canvas.k-gmap { pointer-events: none; }
.k-cover.has-map { background-image: none !important; }
.k-cover.has-map::after { background: linear-gradient(180deg, rgba(8, 20, 37, 0.35) 0%, rgba(8, 20, 37, 0.1) 35%, rgba(8, 20, 37, 0.85) 100%); }
.k-cover::after { z-index: 0; }
.k-map-pin {
  width: 16px; height: 16px; border-radius: 50%; padding: 0; cursor: pointer;
  background: var(--pin, #2dd4bf); border: 3px solid #081425; box-shadow: 0 0 0 2px var(--pin, #2dd4bf), 0 4px 10px rgba(0, 0, 0, 0.5);
}
.k-map-origin { width: 10px; height: 10px; border-radius: 50%; background: #081425; border: 2.5px solid #2dd4bf; }
.k-map-arrow {
  width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-bottom: 16px solid #2dd4bf; filter: drop-shadow(0 0 6px rgba(45, 212, 191, 0.6));
}
.k-map-popup { display: grid; gap: 4px; font-size: 13px; min-width: 160px; color: #0f172a; }
.k-map-popup b { color: #0f172a; }
.k-map-popup span { color: #475569; font-size: 12px; }
.k-map-popup a { color: #0d6b63; font-weight: 600; margin-top: 2px; }

/* ---------- Settings: compact grouped rows ---------- */
.k-set-group { border-radius: 18px; overflow: hidden; background: rgb(var(--c-ink) / 0.03); border: 1px solid rgb(var(--c-ink) / 0.08); }
.k-set-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; min-height: 56px; border-bottom: 1px solid rgb(var(--c-ink) / 0.06); }
.k-set-row:last-child { border-bottom: 0; }
.k-set-row.is-clickable { cursor: pointer; transition: background 0.15s; }
.k-set-row.is-clickable:hover { background: rgb(var(--c-ink) / 0.04); }
.k-set-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(45, 212, 191, 0.1); color: rgb(var(--c-mint)); }
.k-set-icon.is-danger { background: rgba(244, 63, 94, 0.12); color: #fda4af; }
.k-switch { position: relative; width: 46px; height: 28px; border-radius: 999px; flex: none; background: rgba(255, 255, 255, 0.14); transition: background 0.2s; }
.k-switch > span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); transition: transform 0.2s; }
.k-switch.is-on { background: #2dd4bf; }
.k-switch.is-on > span { transform: translateX(18px); }
.k-set-row > select, .k-set-row > input { flex: 0 1 auto; min-width: 0; max-width: 48%; }
.k-set-row > label { min-width: 0; }

/* ---------- Home redesign (kh-*) ---------- */
.kh-greeting { font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -0.02em; color: rgb(var(--c-ink)); line-height: 1.15; }
.kh-section { font-size: 15px; font-weight: 700; color: #e2e8f0; letter-spacing: -0.01em; }
.kh-switch {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: rgb(var(--c-mint)); background: rgba(45, 212, 191, 0.08); border: 1px solid rgba(45, 212, 191, 0.3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kh-switch:hover { background: rgba(45, 212, 191, 0.14); }

.kh-hero {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; width: 100%; text-align: left;
  min-height: 240px; padding: 18px 20px 20px; border-radius: 24px; overflow: hidden; background-size: cover; background-position: center;
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.9); transition: transform 0.3s ease;
}
@media (min-width: 1024px) { .kh-hero { min-height: 300px; padding: 22px 26px 26px; } }
.kh-hero::after { background: linear-gradient(180deg, rgba(5, 12, 24, 0.25) 0%, rgba(5, 12, 24, 0.05) 35%, rgba(5, 12, 24, 0.88) 100%) !important; }
.kh-hero:hover { transform: translateY(-2px); }
.kh-hero-top { display: flex; gap: 6px; min-height: 26px; }
.kh-hero-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.kh-eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgb(var(--c-mint)); margin-bottom: 4px; }
.kh-title { display: block; font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; color: rgb(var(--c-ink)); }
.kh-dates { display: block; font-size: 13px; color: #cbd5e1; margin-top: 6px; }
.kh-count { display: flex; flex-direction: column; align-items: flex-end; flex: none; text-align: right; }
.kh-count-big { font-size: clamp(40px, 5vw, 56px); font-weight: 700; line-height: 0.95; letter-spacing: -0.04em; color: rgb(var(--c-ink)); }
.kh-count-small { font-size: 12px; color: #cbd5e1; margin-top: 4px; }
.kh-progress { display: block; height: 5px; border-radius: 999px; background: rgb(var(--c-ink) / 0.18); margin-top: 14px; overflow: hidden; }
.kh-progress > span { display: block; height: 100%; background: rgb(var(--c-brand)); border-radius: 999px; }
.k-photo-credit {
  position: absolute; right: 12px; bottom: 6px; z-index: 2; max-width: 60%; font-size: 9.5px; color: rgba(255, 255, 255, 0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.k-photo-credit:hover { color: #fff; }
.kh-hero .kh-hero-bottom { margin-bottom: 6px; }

.kh-alert {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border-radius: 18px; text-align: left; font-size: 14px;
  background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.32); transition: background 0.2s;
}
.kh-alert:hover { background: rgba(251, 191, 36, 0.13); }
.kh-alert-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: rgba(251, 191, 36, 0.16); color: #fcd34d; }
.kh-alert-cta { flex: none; font-size: 13px; font-weight: 700; color: #422006; background: #fcd34d; border-radius: 999px; padding: 6px 14px; }

.kh-card {
  display: block; width: 100%; text-align: left; padding: 16px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)); border: 1px solid rgb(var(--c-ink) / 0.08);
  transition: border-color 0.2s, background 0.2s;
}
button.kh-card:hover { border-color: rgba(45, 212, 191, 0.3); }
.kh-temp { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; color: rgb(var(--c-ink)); line-height: 1; }
.kh-money { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: rgb(var(--c-ink)); margin-top: 4px; }
.kh-bar { display: block; height: 6px; border-radius: 999px; background: rgb(var(--c-ink) / 0.08); margin-top: 10px; overflow: hidden; }
.kh-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2dd4bf, #38bdf8); }
.kh-bar > span.is-over { background: #fb7185; }
.kh-flight { display: grid; gap: 8px; }
.kh-flight-route { display: flex; align-items: center; gap: 12px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: rgb(var(--c-ink)); }
.kh-flight-line { flex: 1; display: flex; align-items: center; justify-content: center; color: #38bdf8; position: relative; }
.kh-flight-line::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed rgba(56, 189, 248, 0.35); }
.kh-flight-line > svg { position: relative; background: #0c1a2e; padding: 0 4px; box-sizing: content-box; }

.kh-tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 12px 6px; }
/* Phones: the five quick links in one row */
@media (max-width: 767px) {
  .kh-tools { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 10px 4px; }
  .kh-tool { font-size: 11px; padding: 8px 0; white-space: nowrap; }
}
.kh-tool { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 14px; font-size: 12px; font-weight: 600; color: rgb(var(--c-body)); transition: background 0.15s, color 0.15s; }
.kh-tool:hover { background: rgb(var(--c-ink) / 0.05); color: rgb(var(--c-ink)); }

.kh-empty { border-radius: 20px; border: 1px dashed rgb(var(--c-ink) / 0.14); overflow: hidden; }
.kh-empty-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid rgb(var(--c-ink) / 0.06); transition: background 0.15s; }
.kh-empty-row:last-child { border-bottom: 0; }
.kh-empty-row:hover { background: rgba(45, 212, 191, 0.05); }
.kh-add { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; color: rgb(var(--c-accent)); border: 1px solid rgba(45, 212, 191, 0.4); }

.kh-hero-top, .kh-hero-bottom { width: 100%; }
.kh-eyebrow, .kh-title, .kh-dates, .kh-count-big, .kh-count-small { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.5); }
.kh-eyebrow { color: #99f6e4; }

/* ---------- Journey cards (kj-*) ---------- */
.kj-card { border-radius: 22px; overflow: hidden; background: rgb(var(--c-ink) / 0.03); border: 1px solid rgb(var(--c-ink) / 0.08); transition: transform 0.25s ease, border-color 0.25s; }
.kj-card:hover { transform: translateY(-3px); border-color: rgba(45, 212, 191, 0.3); }
.kj-card.is-finished .kj-cover { filter: saturate(0.6); }
.kj-cover { display: flex; flex-direction: column; justify-content: space-between; width: 100%; min-height: 190px; padding: 14px 16px 16px; text-align: left; background-size: cover; background-position: center; }
.kj-cover::after { background: linear-gradient(180deg, rgba(5, 12, 24, 0.2) 0%, rgba(5, 12, 24, 0.05) 40%, rgba(5, 12, 24, 0.9) 100%) !important; }
.kj-cover-top { display: flex; gap: 6px; width: 100%; }
.kj-cover-bottom { display: block; width: 100%; }
.kj-title { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kj-foot { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; }
.kj-status { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.kj-status.is-good { color: rgb(var(--c-mint)); background: rgba(45, 212, 191, 0.12); }
.kj-status.is-warn { color: #fcd34d; background: rgba(251, 191, 36, 0.12); }
.kj-status.is-muted { color: #94a3b8; background: rgb(var(--c-ink) / 0.06); }
.kj-faces { display: flex; }
.kj-faces > span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: rgb(var(--c-mint)); background: rgb(var(--c-raised)); border: 2px solid #0b1626; margin-left: -8px; }
.kj-faces > span:first-child { margin-left: 0; }
/* A person's face: initials underneath, their photo (if any) on top */
.k-face { position: relative; overflow: hidden; flex-shrink: 0; }
.k-face > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.k-face.is-row { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: rgb(var(--c-mint)); background: rgb(var(--c-raised)); border: 1px solid rgb(var(--c-brand) / 0.4); }
.kj-faces.is-header { padding: 0; background: none; cursor: pointer; }
.kj-faces.is-header > span { width: 32px; height: 32px; font-size: 11px; border-color: rgba(0, 0, 0, 0.45); }

/* ---------- Profile: recent journeys ---------- */
.kp-trip { display: flex; flex-direction: column; justify-content: flex-end; min-height: 92px; padding: 10px; border-radius: 16px; text-align: left; background-size: cover; background-position: center; overflow: hidden; }
.kp-trip::after { background: linear-gradient(180deg, rgba(5, 12, 24, 0.05), rgba(5, 12, 24, 0.85)) !important; }
.kp-trip-name { display: block; font-size: 13px; font-weight: 700; color: #fff; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.kp-trip-when { display: block; font-size: 11px; color: #cbd5e1; }

/* ---------- Dropdowns: one look everywhere (no plain browser select) ---------- */
select.kiatan-input {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 36px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232DD4BF' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
select.kiatan-input option { background: #0f1f35; color: rgb(var(--c-ink)); }

/* ---------- Cost field with its own currency ---------- */
.k-cost { display: flex; gap: 8px; }
.k-cost > input { flex: 1; min-width: 0; }
.k-cost-cur {
  flex: none; width: 96px; border-radius: 14px; padding: 0 28px 0 12px; font-size: 14px; font-weight: 700; color: rgb(var(--c-mint)); cursor: pointer;
  background: rgba(45, 212, 191, 0.08) 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='%232DD4BF' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid rgba(45, 212, 191, 0.3); -webkit-appearance: none; appearance: none;
}
.k-cost-cur option, .k-cost-cur optgroup { background: #0f1f35; color: rgb(var(--c-ink)); }

/* Currency box shows just the code; the invisible native picker on top keeps the full list and accessibility */
.k-cost-cur { position: relative; display: inline-flex; align-items: center; width: 86px; padding: 0 26px 0 14px; }
.k-cost-cur > select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.k-cost-cur:focus-within { outline: 2px solid rgb(var(--c-brand)); outline-offset: 2px; }

/* ==========================================================================
   Light theme (docs/LIGHT_MODE_PLAN.md). Set by the inline script in index.html from
   Profile → Appearance and formats (Match my device / Light / Dark).
   Text over photos (.k-cover and friends) keeps its fixed colours.
   ========================================================================== */
html[data-theme="light"] {
  --c-page: 245 247 250;
  --c-card: 255 255 255;
  --c-raised: 238 242 246;
  --c-ink: 15 23 42;
  --c-body: 71 85 105;
  --c-muted: 91 106 126;
  --c-subtle: 91 106 126;
  --c-accent: 13 107 99;
  --c-brand: 45 212 191;
  --c-on-brand: 0 55 49;
  --c-warm: 194 65 12;
  --c-mint: 13 107 99;
  --surface-variant: #E2E8F0;
  --card-elevated: #F1F5F9;
  --border-onboarding: #CBD5E1;
  --border-subtle: rgb(15 23 42 / 0.09);
  --border-card: rgb(15 23 42 / 0.12);
  --secondary: #4F46E5;
  --status-planning-fg: #B91C1C;
  --status-partial-fg: #92400E;
  --status-booked-fg: #0F766E;
  --status-completed-fg: #475569;
  color-scheme: light;
}
html[data-theme="light"] ::-webkit-scrollbar-track { background: rgb(15 23 42 / 0.05); }
html[data-theme="light"] .kiatan-card { box-shadow: 0 1px 2px rgb(15 23 42 / 0.04); }
html[data-theme="light"] .kiatan-onboarding-card { background: #FFFFFF; }
html[data-theme="light"] .kiatan-glass { background: rgb(255 255 255 / 0.88); }
html[data-theme="light"] .kiatan-input, html[data-theme="light"] .kiatan-input option, html[data-theme="light"] .kiatan-input optgroup,
html[data-theme="light"] select.kiatan-input option, html[data-theme="light"] .k-cost-cur option, html[data-theme="light"] .k-cost-cur optgroup { background-color: #FFFFFF; }
html[data-theme="light"] .kiatan-input { border-color: #CBD5E1; }
html[data-theme="light"] .kiatan-input:-webkit-autofill, html[data-theme="light"] .kiatan-input:-webkit-autofill:hover, html[data-theme="light"] .kiatan-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0F172A; caret-color: #0F172A; -webkit-box-shadow: 0 0 0 1000px #FFFFFF inset; box-shadow: 0 0 0 1000px #FFFFFF inset;
}
html[data-theme="light"] .role-badge-owner { background: rgb(99 102 241 / 0.12); color: #4338CA; border-color: rgb(67 56 202 / 0.35); }
html[data-theme="light"] .android-bottom-pill-bar { background: rgb(255 255 255 / 0.92); border-color: rgb(15 23 42 / 0.1); box-shadow: 0 0 24px rgb(45 212 191 / 0.18), 0 10px 28px rgb(15 23 42 / 0.12); }
html[data-theme="light"] .kiatan-places-dropdown { background-color: #FFFFFF; }
html[data-theme="light"] .btn-danger { color: #B91C1C; }
html[data-theme="light"] .k-icon-tile.cat-transport, html[data-theme="light"] .k-icon-tile.cat-docs, html[data-theme="light"] .k-ov-dot.cat-transport { color: #0369A1; }
html[data-theme="light"] .k-icon-tile.cat-stay, html[data-theme="light"] .k-ov-dot.cat-stay { color: #C2410C; }
html[data-theme="light"] .k-icon-tile.cat-activity, html[data-theme="light"] .k-ov-dot.cat-activity { color: #0F766E; }
html[data-theme="light"] .k-icon-tile.cat-packing { color: #047857; }
html[data-theme="light"] .k-icon-tile.cat-budget { color: #B45309; }
html[data-theme="light"] .k-icon-tile.cat-reminder { color: #6D28D9; }
html[data-theme="light"] .k-icon-tile.cat-emergency, html[data-theme="light"] .k-set-icon.is-danger { color: #B91C1C; }
html[data-theme="light"] .k-tl-daynode { background: #FFFFFF; }
html[data-theme="light"] .k-tl-day.is-warn .k-tl-daynode { border-color: #D97706; }
html[data-theme="light"] .k-tl-day.is-warn .k-tl-daylabel, html[data-theme="light"] .kh-alert-icon, html[data-theme="light"] .kj-status.is-warn { color: #B45309; }
html[data-theme="light"] .k-fl-badge.is-warn, html[data-theme="light"] .k-doc-vis.is-private { color: #C2410C; }
html[data-theme="light"] .k-fl-badge.is-bad { color: #BE123C; }
html[data-theme="light"] .k-fl-badge.is-info { color: #0369A1; }
html[data-theme="light"] .k-fl-badge.is-good { color: #0F766E; }
html[data-theme="light"] .k-chip { background: rgb(15 23 42 / 0.05); }
html[data-theme="light"] .k-chip.is-warm { color: #C2410C; }
html[data-theme="light"] .k-switch { background: rgb(15 23 42 / 0.18); }
html[data-theme="light"] .kh-section { color: #1E293B; }
html[data-theme="light"] .kh-card { background: #FFFFFF; }
html[data-theme="light"] .kh-flight-line { color: #0369A1; }
html[data-theme="light"] .kh-flight-line > svg { background: #FFFFFF; }
html[data-theme="light"] .kj-status.is-muted { color: #64748B; }
html[data-theme="light"] .kj-faces > span { border-color: #FFFFFF; }
html[data-theme="light"] .kj-card { background: #FFFFFF; }

/* Tailwind colours used for warnings and badges: darker shades that read on white (not over photos) */
html[data-theme="light"] .text-rose-200:not(.k-cover *), html[data-theme="light"] .text-rose-300:not(.k-cover *), html[data-theme="light"] .text-rose-400:not(.k-cover *) { color: #BE123C; }
html[data-theme="light"] .text-purple-300:not(.k-cover *) { color: #6D28D9; }
html[data-theme="light"] .text-amber-100:not(.k-cover *), html[data-theme="light"] .text-amber-300:not(.k-cover *), html[data-theme="light"] .text-amber-400:not(.k-cover *) { color: #B45309; }
html[data-theme="light"] .text-emerald-300:not(.k-cover *) { color: #047857; }
html[data-theme="light"] .text-\[\#CBD5E1\]:not(.k-cover *) { color: #334155; }
html[data-theme="light"] .text-\[\#E2E8F0\]:not(.k-cover *) { color: #1E293B; }
html[data-theme="light"] .text-\[\#FCD34D\]:not(.k-cover *) { color: #B45309; }
html[data-theme="light"] .text-\[\#FDBA74\]:not(.k-cover *) { color: #C2410C; }
html[data-theme="light"] .text-\[\#38BDF8\]:not(.k-cover *), html[data-theme="light"] .text-\[\#7DD3FC\]:not(.k-cover *) { color: #0369A1; }
html[data-theme="light"] .text-\[\#C0C1FF\]:not(.k-cover *) { color: #4338CA; }
html[data-theme="light"] .text-\[\#FB7185\]:not(.k-cover *) { color: #BE123C; }
html[data-theme="light"] .border-\[\#334155\]:not(.k-cover *) { border-color: #CBD5E1; }

/* Over photos (covers, Home hero, journey cards, profile tiles) everything keeps the dark palette,
   so titles and labels stay light on the dark photo overlay in both themes */
html[data-theme="light"] .k-cover {
  --c-page: 8 20 37;
  --c-card: 21 32 49;
  --c-raised: 19 34 56;
  --c-ink: 255 255 255;
  --c-body: 176 190 197;
  --c-muted: 138 153 174;
  --c-subtle: 138 154 178;
  --c-accent: 45 212 191;
  --c-warm: 255 210 159;
  --c-mint: 94 234 212;
  --text-heading: #FFFFFF;
  --text-body: #B0BEC5;
  --text-muted: #8A99AE;
  --text-accent: #2DD4BF;
  --border-subtle: rgb(255 255 255 / 0.08);
  --border-card: rgb(255 255 255 / 0.14);
  color-scheme: dark;
}
html[data-theme="light"] .k-cover .k-chip { background: rgb(8 20 37 / 0.7); }
/* Same, for the !important (!text-…) variants used on chips */
html[data-theme="light"] .\!text-rose-200:not(.k-cover *), html[data-theme="light"] .\!text-rose-300:not(.k-cover *), html[data-theme="light"] .\!text-rose-400:not(.k-cover *) { color: #BE123C !important; }
html[data-theme="light"] .\!text-amber-300:not(.k-cover *), html[data-theme="light"] .\!text-amber-400:not(.k-cover *) { color: #B45309 !important; }


/* While any popup (help, forms, sheets) is open, the page behind it doesn't scroll. Every popup is
   drawn into #modal-container, which closeModal() empties. The gutter stops the page shifting
   sideways when the scrollbar goes away. */
html { scrollbar-gutter: stable; }
html:has(#modal-container > *),
html:has(#modal-container > *) body { overflow: hidden; overscroll-behavior: none; }
#modal-container > * { overscroll-behavior: contain; }

/* Pull to refresh (js/pull-refresh.js) */
.k-ptr {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) - 40px); z-index: 70;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; pointer-events: none;
  color: rgb(var(--c-accent)); background: rgb(var(--c-card)); border: 1px solid rgb(var(--c-ink) / 0.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); opacity: 0; transform: translate(-50%, 0);
}
.k-ptr svg { width: 20px; height: 20px; }
.k-ptr.is-animating { transition: transform 0.25s ease, opacity 0.25s ease; }
.k-ptr.is-ready { color: rgb(var(--c-on-brand)); background: rgb(var(--c-brand)); border-color: transparent; }
.k-ptr.is-busy svg { animation: k-ptr-spin 0.8s linear infinite; }
@keyframes k-ptr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .k-ptr.is-busy svg { animation: none; } .k-ptr.is-animating { transition: none; } }
/* Phones: the app's own pull-to-refresh replaces the browser's (which reloads the whole page).
   Not on iPhone/iPad (no class there): they have no built-in pull-to-refresh, and this setting on
   the page makes iOS home-screen apps misplace the pinned bars (docs/TRAPS.md T-1). */
html.k-ptr-own, html.k-ptr-own body { overscroll-behavior-y: contain; }

/* Community: cover photo preview on the publish screen */
.k-pub-cover { height: 140px; border-radius: 16px; background-color: rgb(var(--c-raised)); background-size: cover; background-position: center; border: 1px solid rgb(var(--c-ink) / 0.08); }

/* Press-and-hold menus (js/hold-menu.js): no text selection or iOS link callout while holding */
[data-hold] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
[data-hold].is-holding { transform: scale(0.985); transition: transform 0.35s ease; }
@media (prefers-reduced-motion: reduce) { [data-hold].is-holding { transform: none; } }

/* One-time "Get alerts" offer (app.maybeOfferAlerts) */
.k-alerts-offer {
  position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px;
  background: rgb(var(--c-card)); border: 1px solid rgb(var(--c-brand) / 0.45); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}
.k-alerts-offer-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; color: rgb(var(--c-accent)); background: rgb(var(--c-brand) / 0.14); }
@media (min-width: 768px) { .k-alerts-offer { left: auto; right: 24px; bottom: 24px; max-width: 460px; } }
@media (max-width: 420px) { .k-alerts-offer { flex-wrap: wrap; } .k-alerts-offer > span:last-child { width: 100%; justify-content: flex-end; } }

/* Guests: create your free account (app.renderGuestNotice) */
.k-guest-notice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px; border-radius: 18px; background: rgb(var(--c-brand) / 0.1); border: 1px solid rgb(var(--c-brand) / 0.35); max-width: 72rem; margin-left: auto; margin-right: auto; }
@media (max-width: 480px) { .k-guest-notice { flex-wrap: wrap; } .k-guest-notice > button { width: 100%; } }

/* Google's logo must stay visible: on header maps the title covers the bottom left, so it sits top middle */
.k-cover .k-cover-map-canvas.k-gmap div:has(> a[href^="https://maps.google.com/maps"]) { top: 8px !important; bottom: auto !important; left: 50% !important; transform: translateX(-50%); z-index: 2; }
