:root {
  --bg: #F6F5F0;
  --surface: #FFFFFF;
  --surface-soft: #F9F8F5;
  --ink: #141B29;
  --ink-secondary: #4B5568;
  --ink-muted: #7C8598;
  --line: rgba(20, 27, 41, 0.08);
  --line-strong: rgba(20, 27, 41, 0.14);
  --primary: #14213D;
  --accent-cd: #C85A32;
  --accent-sh: #2563EB;
  --accent-bj: #B45309;
  --tbd-bg: #FFFBEB;
  --tbd-border: #F59E0B;
  --tbd-ink: #92400E;
  --meeting: #0052D9;
  --meeting-soft: #EEF4FF;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 2px 10px rgba(20, 27, 41, 0.04), 0 1px 2px rgba(20, 27, 41, 0.04);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(82px + var(--safe-bottom));
}

/* Header */
.hero {
  background: linear-gradient(155deg, #121C33 0%, #1E2E4F 65%, #263A61 100%);
  color: #FFFFFF;
  padding: 20px 18px 18px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
}

.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34D399;
}

.hero-date {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  font-variant-numeric: tabular-nums;
}

.hero h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-sub {
  margin: 6px 0 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.74);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-box {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 10px;
}

.metric-box strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.metric-box span {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 2px;
}

/* Sticky day bar + filter */
.sticky-controls {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(246, 245, 240, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 10px 0 8px;
}

.day-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 14px 6px;
  scrollbar-width: none;
}

.day-strip::-webkit-scrollbar {
  display: none;
}

.day-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 12px;
  padding: 6px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.day-pill .dp-date {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.day-pill .dp-meta {
  font-size: 11px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.city-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.day-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(20, 33, 61, 0.18);
}

.day-pill.active .dp-meta {
  color: rgba(255, 255, 255, 0.78);
}

.filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 14px 2px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip.active {
  background: #E8EEF9;
  border-color: #93B4F5;
  color: #1640A3;
  font-weight: 600;
}

/* Main Content Views */
.view {
  display: none;
  padding: 14px 14px 24px;
}

.view.active {
  display: block;
}

/* Day Banner */
.day-section {
  margin-bottom: 22px;
}

.day-banner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}

.day-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.day-banner-date {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.city-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.day-banner-head {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 2px 0 4px;
}

.day-banner-sub {
  font-size: 12px;
  color: var(--ink-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

/* Timeline Card */
.timeline-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.node-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.node-card.type-interview {
  border-color: rgba(0, 82, 217, 0.22);
  background: linear-gradient(180deg, #F8FAFF 0%, #FFFFFF 34%);
}

.node-card.type-tbd {
  background: var(--tbd-bg);
  border: 1.5px dashed var(--tbd-border);
}

.node-card.type-transit {
  background: #FCFBF9;
  border-style: solid;
  border-color: rgba(20, 27, 41, 0.09);
}

.node-card.type-flight {
  background: linear-gradient(180deg, #F5F9FF 0%, #FFFFFF 45%);
  border-color: rgba(37, 99, 235, 0.22);
}

.node-card.type-meal {
  background: linear-gradient(180deg, #FFF8F4 0%, #FFFFFF 45%);
  border-color: rgba(200, 90, 50, 0.22);
}

.node-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.time-block {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.time-start {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.time-end {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.node-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: #EEF1F6;
  color: #334155;
  white-space: nowrap;
}

.node-badge.interview {
  background: var(--meeting-soft);
  color: var(--meeting);
}

.node-badge.flight {
  background: #DBEAFE;
  color: #1D4ED8;
}

.node-badge.meal {
  background: #FCE7DD;
  color: #B4411B;
}

.node-badge.tbd {
  background: #FEF3C7;
  color: #92400E;
}

.node-badge.person {
  background: #F1F5F9;
  color: #475569;
  font-weight: 500;
}

.node-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.35;
}

/* Timing 3-fact strip */
.timing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #F3F4F6;
  border-radius: 10px;
  padding: 8px 9px;
  margin: 8px 0;
}

.node-card.type-tbd .timing-grid {
  background: rgba(245, 158, 11, 0.1);
}

.timing-cell {
  display: flex;
  flex-direction: column;
}

.timing-label {
  font-size: 10.5px;
  color: var(--ink-muted);
  margin-bottom: 1px;
}

.timing-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

/* Alert / Client banners */
.inline-banner {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  margin: 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inline-banner.client {
  background: #FDF2EE;
  color: #A63A17;
  border: 1px solid #F7D4C6;
}

.inline-banner.alert {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}

/* Respondent Profile Box */
.profile-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 8px 0;
  font-size: 12.5px;
  color: var(--ink-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.profile-pill strong {
  color: var(--ink);
  font-weight: 600;
}

/* Address line */
.addr-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-secondary);
  margin: 7px 0;
  word-break: break-word;
}

.addr-row svg {
  flex: 0 0 15px;
  margin-top: 3px;
  color: var(--primary);
}

.addr-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loc-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.loc-addr {
  font-size: 12.5px;
  color: var(--ink-secondary);
  line-height: 1.4;
}

.node-note {
  font-size: 12.5px;
  color: var(--ink-secondary);
  margin: 6px 0 0;
  line-height: 1.5;
  white-space: pre-line;
}

/* Action buttons inside cards */
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-meeting {
  background: var(--meeting);
  border-color: var(--meeting);
  color: #FFFFFF;
}

.btn-nav {
  background: #EEF6F1;
  border-color: #B7DEC6;
  color: #146338;
}

.btn-call {
  background: #EFF5FF;
  border-color: #BFD7FE;
  color: #1D4ED8;
}

.btn-tbd {
  background: #FFFFFF;
  border-color: #F59E0B;
  color: #92400E;
}

/* Outline collapsible */
.outline-details {
  margin-top: 8px;
  border-top: 1px dashed var(--line-strong);
  padding-top: 7px;
}

.outline-details summary {
  font-size: 12px;
  color: var(--ink-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.outline-details summary::-webkit-details-marker {
  display: none;
}

.outline-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.outline-chip {
  font-size: 11px;
  background: #F1F5F9;
  color: #334155;
  padding: 2px 7px;
  border-radius: 6px;
}

/* Logistics & Contacts View */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 16px 2px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title:first-child {
  margin-top: 2px;
}

.section-hint {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-muted);
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}

.info-card.is-tbd {
  background: var(--tbd-bg);
  border: 1.5px dashed var(--tbd-border);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.info-row:last-of-type {
  border-bottom: none;
}

.info-label {
  color: var(--ink-muted);
  flex: 0 0 76px;
}

.info-val {
  color: var(--ink);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.info-val.empty {
  color: #B45309;
  font-style: italic;
}

.editable-input {
  width: 100%;
  border: 1px solid rgba(180, 83, 9, 0.35);
  background: #FFFFFF;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
  margin-top: 4px;
}

.edit-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.edit-field label {
  display: block;
  font-size: 11.5px;
  color: var(--ink-secondary);
  font-weight: 600;
}

/* Flights table */
.flight-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.flight-item:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

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

.flight-code {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.flight-route {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.flight-meta {
  font-size: 12px;
  color: var(--ink-secondary);
}

/* Checklist View */
.progress-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-bar-track {
  height: 8px;
  background: #E5E7EB;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #14213D, #2563EB);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.check-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}

.check-group h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 2px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.check-item:first-of-type {
  border-top: none;
}

.check-item input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: var(--primary);
  flex: 0 0 19px;
  cursor: pointer;
}

.check-text {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.45;
}

.check-item.done .check-text {
  color: var(--ink-muted);
  text-decoration: line-through;
}

/* Overview Table */
.overview-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  margin-bottom: 9px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.overview-name {
  font-size: 15px;
  font-weight: 700;
}

.overview-time {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-strong);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px calc(8px + var(--safe-bottom));
  z-index: 50;
}

.nav-btn {
  border: none;
  background: none;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
}

.nav-btn svg {
  width: 21px;
  height: 21px;
}

.nav-btn.active {
  color: var(--primary);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--safe-bottom));
  transform: translateX(-50%) translateY(16px);
  background: rgba(20, 27, 41, 0.92);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--ink-muted);
  font-size: 13.5px;
}

@media (max-width: 370px) {
  .timing-grid {
    grid-template-columns: 1fr;
  }
}
