:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1c2526;
  --muted: #6b7778;
  --line: #e7e1d8;
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --accent: #f59e0b;
  --today: #fff7e6;
  --chip: #eef6f5;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(15,118,110,.08);
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1416;
    --card: #132124;
    --text: #e8efef;
    --muted: #93a4a5;
    --line: #20343a;
    --brand: #2dd4bf;
    --brand-2: #0f766e;
    --today: #2a2414;
    --chip: #183036;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  padding-bottom: calc(84px + var(--safe-b));
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #0f766e 0%, #0e7490 55%, #f59e0b 140%);
  color: #fff;
  padding: calc(20px + var(--safe-t)) 20px 22px;
  border-radius: 0 0 28px 28px;
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.eyebrow { margin: 0; opacity: .85; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.hero h1 { margin: 4px 0 6px; font-size: 28px; letter-spacing: -.02em; }
.status { margin: 0 0 12px; font-size: 15px; opacity: .95; }
.progress { height: 6px; background: rgba(255,255,255,.25); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: #fff; border-radius: 99px; transition: width .6s ease; }

main { max-width: 720px; margin: 0 auto; padding: 16px; }
.loading { color: var(--muted); text-align: center; padding: 40px 0; }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 4px 10px; }

/* Day list */
.day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.day-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); text-decoration: none; border: 1px solid transparent;
  transition: transform .15s ease;
}
.day-card:active { transform: scale(.985); }
.day-card.is-today { background: var(--today); border-color: var(--accent); }
.day-card.is-past { opacity: .62; }
.date-chip {
  flex: 0 0 54px; text-align: center; border-radius: 14px; padding: 6px 0;
  background: var(--chip); color: var(--brand);
}
.date-chip .d { display: block; font-size: 22px; font-weight: 700; line-height: 1.1; }
.date-chip .m { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.date-chip .w { display: block; font-size: 11px; color: var(--muted); }
.day-body { flex: 1; min-width: 0; }
.route { font-weight: 650; font-size: 16px; margin: 0 0 2px; }
.route .arrow { color: var(--muted); font-weight: 400; margin: 0 4px; }
.summary { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.pill { background: var(--chip); color: var(--text); padding: 3px 8px; border-radius: 99px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pill.today { background: var(--accent); color: #1c1400; font-weight: 600; }
.pill.done { background: #dcfce7; color: #14532d; }
@media (prefers-color-scheme: dark) { .pill.done { background: #14532d; color: #dcfce7; } }
.emoji { font-size: 22px; }

/* Day detail */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); text-decoration: none; font-weight: 600; padding: 6px 0 10px; }
.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.detail-head .big-emoji { font-size: 40px; }
.detail-head h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.detail-head p { margin: 2px 0 0; color: var(--muted); }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 15px; color: var(--brand); }
.tip { background: var(--today); border-left: 4px solid var(--accent); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist input { width: 22px; height: 22px; accent-color: var(--brand); margin: 1px 0 0; flex: 0 0 auto; }
.checklist label { flex: 1; cursor: pointer; }
.checklist .done label { text-decoration: line-through; color: var(--muted); }
.checklist small { display: block; color: var(--muted); font-size: 12.5px; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--chip); color: var(--muted); margin-left: 4px; vertical-align: 1px; }
.map-link { text-decoration: none; font-size: 18px; padding: 0 4px; }

.hotel-name { font-size: 17px; font-weight: 650; margin: 0 0 2px; }
.hotel-area { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 14px;
  padding: 10px 14px; border-radius: 12px; flex: 1 1 auto;
}
@media (prefers-color-scheme: dark) { .btn { color: #062a27; } }
.btn.secondary { background: var(--chip); color: var(--text); }

textarea {
  width: 100%; min-height: 140px; resize: vertical; font: inherit; font-size: 16px; /* 16px evita lo zoom su iOS */
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.saved { font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 16px; }

.day-nav { display: flex; gap: 8px; margin-top: 4px; }
.day-nav .btn { flex: 1; }

/* Diary */
.diary-entry { white-space: pre-wrap; margin: 0; }
.empty { color: var(--muted); text-align: center; padding: 24px 8px; }

/* Tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; font-size: 11px; color: var(--muted); padding: 4px 0; }
.tabbar a .ico { font-size: 22px; filter: grayscale(1); opacity: .7; }
.tabbar a.active { color: var(--brand); font-weight: 600; }
.tabbar a.active .ico { filter: none; opacity: 1; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translate(-50%, 20px);
  background: #1c2526; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 20; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
