/* ============ Safarnama — sunny travel journal UI ============ */
:root {
  --bg: #FDF4E3;           /* warm sand */
  --bg-soft: #FAEBD2;      /* deeper sand */
  --card: #FFFFFF;
  --card-2: #FFFDF8;
  --ink: #1F3A54;          /* deep sea navy */
  --ink-dim: #52708D;
  --ink-faint: #8FA6BC;
  --accent: #FF6B4A;       /* coral */
  --accent-2: #FFB703;     /* sunshine */
  --accent-3: #0CA6A6;     /* sea teal */
  --sky: #5AC8E8;
  --gold: #B97F10;         /* amber text on light */
  --stamp: #E5484D;
  --radius: 18px;
  --shadow: 0 6px 20px rgba(31,58,84,.10);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100%;
  overscroll-behavior-y: none;
  background-image:
    radial-gradient(900px 380px at 85% -5%, rgba(255,183,3,.22), transparent 60%),
    radial-gradient(800px 400px at -10% 0%, rgba(90,200,232,.18), transparent 55%),
    radial-gradient(900px 420px at 50% 115%, rgba(12,166,166,.10), transparent 60%);
  background-attachment: fixed;
}

#app { max-width: 560px; margin: 0 auto; padding: 0 16px 96px; }

/* ---------- header ---------- */
.hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 2px 10px;
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(rgba(253,244,227,.96) 70%, transparent);
}
.hdr .brand { display: flex; align-items: baseline; gap: 8px; }
.hdr h1 {
  font-family: var(--serif); font-size: 26px; letter-spacing: .5px;
  background: linear-gradient(90deg, #FF6B4A, #F59E0B);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hdr .sub { font-size: 11px; color: var(--accent-3); letter-spacing: 2.5px; text-transform: uppercase; font-weight: 700; }
.offline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 8px rgba(12,166,166,.7); }
.offline-dot.off { background: var(--ink-faint); box-shadow: none; }

/* ---------- route ribbon ---------- */
.route-ribbon {
  display: flex; align-items: center; gap: 4px; overflow-x: auto;
  padding: 8px 2px 14px; scrollbar-width: none;
}
.route-ribbon::-webkit-scrollbar { display: none; }
.route-stop { display: flex; flex-direction: column; align-items: center; min-width: 58px; }
.route-stop .dot {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2.5px solid var(--ink-faint); background: var(--card);
}
.route-stop.done .dot { background: var(--accent-2); border-color: var(--accent-2); }
.route-stop.now .dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,107,74,.22); }
.route-stop .lbl { font-size: 10px; color: var(--ink-dim); margin-top: 5px; letter-spacing: .4px; }
.route-stop.now .lbl { color: var(--accent); font-weight: 700; }
.route-line { flex: 1; height: 2.5px; min-width: 14px; background: repeating-linear-gradient(90deg, var(--ink-faint) 0 5px, transparent 5px 10px); opacity: .5; border-radius: 2px; }
.route-line.done { background: var(--accent-2); opacity: 1; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid rgba(31,58,84,.07);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card h2 { font-family: var(--serif); font-size: 20px; margin-bottom: 4px; }
.card .muted, .muted { color: var(--ink-dim); font-size: 13px; line-height: 1.5; }

.hero-count {
  text-align: center; padding: 26px 18px;
  background: linear-gradient(160deg, #FFFDF6, #FFF4DC);
  border: 2px dashed rgba(245,158,11,.55);
}
.hero-count .big { font-family: var(--serif); font-size: 44px; color: #E28800; }
.hero-count .cap { letter-spacing: 3px; text-transform: uppercase; font-size: 11px; color: var(--ink-dim); margin-top: 6px; }

/* now / next */
.now-chip {
  display: inline-block; font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; font-weight: 700;
  background: rgba(255,107,74,.14); color: #E04E2E; border: 1px solid rgba(255,107,74,.4);
}
.now-chip.next { background: rgba(12,166,166,.10); color: #08807F; border-color: rgba(12,166,166,.35); }

/* ---------- day chips ---------- */
.day-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 14px; scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.day-chip {
  flex: 0 0 auto; text-align: center; padding: 8px 12px; border-radius: 14px;
  background: var(--card); border: 1px solid rgba(31,58,84,.08); cursor: pointer;
  color: var(--ink-dim); user-select: none; box-shadow: 0 2px 8px rgba(31,58,84,.06);
}
.day-chip .d { font-family: var(--serif); font-size: 18px; color: var(--ink); }
.day-chip .m { font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; }
.day-chip .c { font-size: 10px; margin-top: 2px; color: var(--ink-faint); }
.day-chip.active { background: linear-gradient(160deg, #FFE7C2, #FFD8A3); border-color: var(--accent-2); }
.day-chip.active .c { color: #C46A00; font-weight: 700; }
.day-chip.past { opacity: .55; }

/* ---------- timeline ---------- */
.day-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 12px; }
.day-head h2 { font-family: var(--serif); font-size: 22px; }
.day-head .who { font-size: 11px; color: var(--ink-faint); }
.stamp {
  font-family: var(--serif); font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--stamp); border: 2px solid var(--stamp); border-radius: 8px; padding: 3px 8px;
  transform: rotate(-8deg); opacity: .9; background: rgba(229,72,77,.06);
}
.tl { position: relative; padding-left: 26px; }
.tl::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2.5px;
  background: repeating-linear-gradient(180deg, #E8B45A 0 6px, transparent 6px 12px); opacity: .7; border-radius: 2px;
}
.tl-item { position: relative; margin-bottom: 12px; }
.tl-item::before {
  content: ""; position: absolute; left: -24px; top: 18px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--card); border: 2.5px solid var(--ink-faint);
}
.tl-item.type-flight::before, .tl-item.type-train::before, .tl-item.type-transport::before { border-color: var(--accent); }
.tl-item.type-food::before { border-color: var(--accent-2); }
.tl-item.type-hotel-checkin::before, .tl-item.type-hotel-checkout::before { border-color: #C15BB6; }
.tl-item.type-sightseeing::before, .tl-item.type-activity::before { border-color: var(--accent-3); }
.tl-card {
  background: var(--card); border: 1px solid rgba(31,58,84,.08); border-radius: 14px;
  padding: 12px 14px; box-shadow: 0 3px 10px rgba(31,58,84,.06);
}
.tl-card .top { display: flex; gap: 10px; align-items: baseline; }
.tl-card .time { font-family: var(--serif); font-size: 14px; color: #C46A00; min-width: 44px; font-weight: 700; }
.tl-card .ttl { font-weight: 700; font-size: 15px; flex: 1; }
.tl-card .ico { font-size: 16px; }
.tl-card .det { color: var(--ink-dim); font-size: 13px; line-height: 1.55; margin-top: 6px; }
.tl-card .tips { color: #08807F; font-size: 12px; line-height: 1.5; margin-top: 6px; font-style: italic; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.btn {
  border: none; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; padding: 8px 13px; border-radius: 999px;
  background: rgba(255,107,74,.12); color: #E04E2E; border: 1px solid rgba(255,107,74,.35);
}
.btn.teal { background: rgba(12,166,166,.10); color: #08807F; border-color: rgba(12,166,166,.32); }
.btn.pink { background: rgba(193,91,182,.10); color: #A83E9C; border-color: rgba(193,91,182,.32); }
.btn.solid { background: linear-gradient(90deg, #FF6B4A, #FFB703); color: #fff; border: none; box-shadow: 0 4px 12px rgba(255,107,74,.35); }
.btn:active { transform: scale(.97); }

/* ---------- wallet ---------- */
.wallet-group { margin-bottom: 20px; }
.wallet-group h3 { font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--ink-faint); margin: 0 2px 10px; }
.bpass {
  position: relative; overflow: hidden;
  background: var(--card);
  border: 1px solid rgba(31,58,84,.09); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.bpass::before, .bpass::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg); border: 1px solid rgba(31,58,84,.09);
  top: 50%; transform: translateY(-50%);
}
.bpass::before { left: -12px; } .bpass::after { right: -12px; }
.bpass .route { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bpass .port { font-family: var(--serif); font-size: 26px; }
.bpass .port small { display: block; font-family: var(--sans); font-size: 10px; color: var(--ink-faint); letter-spacing: 1px; }
.bpass .plane { color: var(--accent); font-size: 15px; }
.bpass .meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 8px; }
.bpass .meta div { font-size: 12px; color: var(--ink-faint); }
.bpass .meta b { display: block; color: var(--ink); font-size: 13px; }
.bpass .tag {
  position: absolute; top: 12px; right: 16px; font-size: 9px; letter-spacing: 2px;
  text-transform: uppercase; color: #fff; font-weight: 700;
  background: linear-gradient(90deg, var(--sky), var(--accent-3));
  padding: 3px 9px; border-radius: 999px;
}
.ref-pill {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: rgba(245,158,11,.12); color: var(--gold); border: 1px dashed rgba(185,127,16,.5);
  font-size: 12px; padding: 5px 10px; border-radius: 8px; margin: 8px 6px 0 0; font-weight: 600;
}

/* ---------- memories ---------- */
.mem-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.mem-day { margin-bottom: 22px; }
.mem-day h3 { font-family: var(--serif); font-size: 17px; margin-bottom: 2px; }
.mem-day .sub { font-size: 12px; color: var(--ink-faint); margin-bottom: 10px; }
.mem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mem-grid .ph {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--bg-soft); cursor: pointer; box-shadow: 0 2px 8px rgba(31,58,84,.10);
}
.mem-grid .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mem-grid .ph .fav { position: absolute; top: 4px; right: 6px; font-size: 13px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.mem-grid .ph .plc {
  position: absolute; left: 4px; bottom: 4px; font-size: 9px; font-weight: 700;
  background: rgba(31,58,84,.72); color: #fff; padding: 2px 6px; border-radius: 99px;
}
.gp-link { color: #08807F; font-weight: 700; text-decoration: none; font-size: 12px; }
.cloud-step { font-size: 13px; line-height: 1.55; color: var(--ink-dim); margin-bottom: 10px; }
.cloud-step b, .cloud-step i { color: var(--ink); }
.album-viewer { padding: 10px; }
.album-scroll { flex: 1; overflow-y: auto; background: #FDF4E3; border-radius: 14px; min-height: 0; }
.empty-mem { text-align: center; padding: 40px 20px; color: var(--ink-dim); }
.empty-mem .big { font-size: 40px; margin-bottom: 10px; }

/* photo viewer / modals */
.viewer {
  position: fixed; inset: 0; z-index: 100; background: rgba(31,58,84,.55);
  backdrop-filter: blur(6px);
  display: flex; flex-direction: column; padding: 14px;
}
.viewer img { flex: 1; object-fit: contain; min-height: 0; border-radius: 12px; }
.viewer .v-meta { padding: 12px 4px 4px; background: var(--card); border-radius: 14px; margin-top: 10px; padding: 12px; }
.viewer input[type="text"] {
  width: 100%; background: var(--bg); color: var(--ink); border: 1px solid rgba(31,58,84,.15);
  border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-top: 4px;
}
.viewer .v-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.viewer select {
  background: var(--bg); color: var(--ink); border: 1px solid rgba(31,58,84,.15);
  border-radius: 10px; padding: 8px 10px; font-size: 13px;
}

/* ---------- explore ---------- */
.xp-card { border-left: 4px solid var(--accent-3); }
.xp-card.hike { border-left-color: #6BAF3E; }
.xp-card.cycle { border-left-color: var(--accent-2); }
.xp-card.trip { border-left-color: var(--accent); }
.xp-card .kind { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-faint); font-weight: 700; }
.xp-card h3 { font-family: var(--serif); font-size: 18px; margin: 4px 0 6px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-around;
  background: rgba(255,253,248,.94); backdrop-filter: blur(14px);
  border-top: 1px solid rgba(31,58,84,.08);
  box-shadow: 0 -4px 16px rgba(31,58,84,.06);
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: var(--ink-faint); cursor: pointer;
  font-size: 10px; letter-spacing: .3px; padding: 4px 10px; border-radius: 12px; font-weight: 600;
}
.tab .ic { font-size: 20px; }
.tab.active { color: #E04E2E; }
.tab.active .ic { transform: translateY(-2px); }

.section-title { font-family: var(--serif); font-size: 24px; margin: 8px 2px 14px; }
.section-sub { color: var(--ink-dim); font-size: 13px; margin: -8px 2px 16px; line-height: 1.5; }

.toast {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #FFFDF6; font-size: 13px;
  padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(31,58,84,.3); z-index: 200; opacity: 0; transition: opacity .25s;
  pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ---------- budget ---------- */
.bud-bar { height: 8px; border-radius: 99px; background: rgba(31,58,84,.10); overflow: hidden; }
.bud-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-3), var(--accent-2)); transition: width .4s; }
.bud-fill.over { background: linear-gradient(90deg, #FF6B4A, #E5484D); }
.bud-cat { margin-bottom: 14px; }
.bud-cat:last-child { margin-bottom: 2px; }
.bud-row { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; font-weight: 600; }
.bud-row small { color: var(--ink-faint); font-weight: 400; }
.bud-over { color: #E5484D; font-weight: 800; }
.exp-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid rgba(31,58,84,.08); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(31,58,84,.05);
}
.exp-row.needs-price { border: 1.5px dashed rgba(185,127,16,.55); background: #FFFBF0; }
.exp-ico { font-size: 20px; }
.exp-mid { flex: 1; min-width: 0; }
.exp-note { font-size: 14px; font-weight: 700; }
.exp-sub { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.exp-amt { text-align: right; font-family: var(--serif); font-size: 15px; }
.exp-amt small { display: block; font-family: var(--sans); font-size: 10px; color: var(--ink-faint); }
.add-price { color: var(--gold); font-size: 12px; font-family: var(--sans); font-weight: 700; }
.exp-form { width: 100%; }
.exp-form input, .exp-form select {
  background: var(--bg); color: var(--ink); border: 1px solid rgba(31,58,84,.15);
  border-radius: 10px; padding: 11px 12px; font-size: 14px; width: 100%; margin-bottom: 8px;
}
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bud-inp { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13.5px; }
.bud-inp span { flex: 0 0 46%; color: var(--ink-dim); }
.bud-inp input {
  flex: 1; background: var(--bg); color: var(--ink); border: 1px solid rgba(31,58,84,.15);
  border-radius: 10px; padding: 9px 10px; font-size: 14px;
}
@media (max-width: 420px) { .tab { padding: 4px 6px; } }

/* ---------- weather ---------- */
.wx-card { padding: 14px 16px; background: linear-gradient(140deg, #FFFDF6, #EDF8F8); }
.wx-main { display: flex; align-items: center; gap: 14px; }
.wx-icon { font-size: 34px; }
.wx-main b { font-family: var(--serif); font-size: 20px; }
.wx-side { margin-left: auto; text-align: right; font-size: 12px; line-height: 1.6; }
.wx-chip {
  display: inline-block; font-size: 11.5px; font-weight: 700; color: #08807F;
  background: rgba(12,166,166,.10); border: 1px solid rgba(12,166,166,.3);
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}

.hidden { display: none !important; }
