:root {
  --ink: #171b20;
  --muted: #68717d;
  --line: #d9e1e7;
  --surface: #ffffff;
  --wash: #eef3f4;
  --nav: #111820;
  --nav-2: #1c2630;
  --teal: #08766e;
  --teal-dark: #075a55;
  --coral: #c8553d;
  --gold: #af7b16;
  --green: #3f7b56;
  --blue: #426fb3;
  --violet: #6652a3;
  --soft-teal: #e7f5f2;
  --soft-coral: #faebe6;
  --soft-gold: #fff5df;
  --soft-blue: #eaf0fb;
  --shadow: 0 22px 48px rgba(21, 32, 43, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 24% 0%, rgba(8, 118, 110, 0.13), transparent 34%),
    linear-gradient(135deg, #f7faf9 0%, var(--wash) 45%, #f5f0ea 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  color: #f7fbfb;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 28%),
    linear-gradient(160deg, var(--nav) 0%, var(--nav-2) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--coral), #df7b59);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  font-weight: 900;
}

.brand h1,
.brand p,
.workspace h2,
.panel h3,
.next-action h3 {
  margin: 0;
}

.brand h1 {
  font-size: 1.18rem;
  letter-spacing: 0;
}

.brand p {
  color: #aebbc6;
  font-size: 0.86rem;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #d9e8e7;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.76rem;
  font-weight: 850;
}

.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  width: max-content;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #d9e8e7;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
}

.new-trip-button,
.primary-button,
.secondary-button,
.icon-button,
.signal-toggle {
  border-radius: 8px;
  min-height: 42px;
  font-weight: 850;
}

.new-trip-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  color: #111820;
  background: #f8fbfb;
}

.trip-list {
  display: grid;
  gap: 12px;
}

.trip-card {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #eef6f6;
  text-align: left;
  background: rgba(255, 255, 255, 0.055);
}

.trip-card.is-active {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 3px 0 0 var(--teal);
}

.trip-city {
  font-weight: 900;
}

.trip-meta,
.trip-status {
  color: #b9c4cc;
  font-size: 0.86rem;
}

.trip-status {
  color: #9bded5;
}

.trip-status.muted {
  color: #e8c982;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 22px;
  max-width: 1440px;
}

.topbar h2 {
  font-size: clamp(1.9rem, 3.2vw, 3.2rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.trip-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.trip-kicker span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #4d5964;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  font-weight: 800;
}

.topbar-actions,
.action-row,
.chat-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-button {
  padding: 0 18px;
  border: 0;
  color: white;
  background: var(--teal);
  box-shadow: 0 12px 24px rgba(8, 118, 110, 0.22);
}

.primary-button:hover {
  background: var(--teal-dark);
}

.secondary-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.icon-button {
  display: grid;
  width: 42px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.icon-button.compact {
  width: 34px;
  min-height: 34px;
}

.small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.hero-grid,
.content-grid,
.live-strip,
.journey-map {
  display: grid;
  gap: 18px;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  margin-bottom: 18px;
}

.next-action,
.summary-panel,
.panel,
.live-strip article,
.journey-map {
  border: 1px solid rgba(189, 201, 211, 0.8);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.journey-map {
  margin-bottom: 18px;
  padding: 20px;
}

.journey-map > .panel-heading {
  margin-bottom: 14px;
}

.journey-map h3 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  letter-spacing: 0;
}

.map-canvas {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid #dfe7eb;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(8, 118, 110, 0.08), transparent 28%),
    linear-gradient(135deg, #f8fbfb, #eef5f5);
}

.map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(23, 27, 32, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 27, 32, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 96%);
}

.map-route {
  position: absolute;
  left: 9%;
  right: 8%;
  top: 48%;
  height: 72px;
  border-top: 4px solid rgba(8, 118, 110, 0.65);
  border-right: 4px solid rgba(8, 118, 110, 0.65);
  border-radius: 0 44px 0 0;
}

.map-route::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 63px;
  width: 34%;
  height: 4px;
  background: rgba(8, 118, 110, 0.65);
}

.journey-map.is-risk .map-route,
.journey-map.is-risk .map-route::after {
  border-color: rgba(200, 85, 61, 0.72);
  background: rgba(200, 85, 61, 0.72);
}

.map-node {
  position: absolute;
  display: grid;
  place-items: center;
  width: 76px;
  height: 46px;
  border: 1px solid rgba(23, 27, 32, 0.12);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  box-shadow: 0 14px 28px rgba(23, 27, 32, 0.12);
  font-weight: 950;
}

.map-node::before {
  content: "";
  position: absolute;
  top: -8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(8, 118, 110, 0.12);
}

.map-node.home {
  left: 6%;
  top: 38%;
}

.map-node.airport {
  left: 26%;
  top: 38%;
}

.map-node.flight {
  left: 49%;
  top: 38%;
}

.map-node.hotel {
  right: 18%;
  top: 66%;
}

.map-node.office {
  right: 5%;
  top: 66%;
}

.route-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.route-steps article {
  padding: 13px;
  border: 1px solid #e6ecef;
  border-radius: 8px;
  background: #fbfdfd;
}

.route-steps span {
  display: block;
  margin-bottom: 7px;
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 950;
}

.route-steps strong {
  display: block;
  margin-bottom: 4px;
}

.route-steps p {
  margin: 0;
  color: var(--muted);
  line-height: 1.38;
}

.next-action {
  position: relative;
  overflow: hidden;
  padding: 30px;
  min-height: 250px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(235, 247, 244, 0.92)),
    linear-gradient(135deg, rgba(200, 85, 61, 0.08), rgba(8, 118, 110, 0.1));
}

.next-action::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: 26px;
  width: min(42%, 360px);
  height: 88px;
  border-bottom: 2px dashed rgba(8, 118, 110, 0.38);
  border-left: 2px dashed rgba(200, 85, 61, 0.3);
  border-radius: 0 0 0 32px;
  pointer-events: none;
}

.next-action h3 {
  max-width: 720px;
  margin-bottom: 12px;
  font-size: clamp(1.65rem, 3vw, 2.7rem);
  line-height: 1;
  letter-spacing: 0;
}

.next-action p {
  max-width: 700px;
  margin: 0 0 24px;
  color: #52606c;
  line-height: 1.55;
}

.summary-panel {
  overflow: hidden;
  background: #172029;
  color: white;
}

.route-visual {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(8, 118, 110, 0.34), rgba(102, 82, 163, 0.3)),
    #172029;
}

.route-visual span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 950;
}

.route-line {
  height: 2px;
  background: rgba(255, 255, 255, 0.28);
}

.route-line i {
  display: block;
  width: 45%;
  height: 2px;
  background: #f8d386;
}

.summary-panel > div:not(.route-visual) {
  display: grid;
  gap: 5px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-label {
  color: #9fb0bf;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.live-strip article {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 12px;
  min-height: 128px;
  padding: 16px;
}

.live-strip strong {
  display: block;
  margin-bottom: 5px;
}

.live-strip p {
  min-height: 38px;
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.signal-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(8, 118, 110, 0.1);
}

.signal-dot.teal {
  background: var(--teal);
}

.signal-dot.gold {
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(175, 123, 22, 0.11);
}

.signal-dot.green {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(63, 123, 86, 0.11);
}

.signal-dot.blue {
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(66, 111, 179, 0.11);
}

.signal-card.is-risk {
  border-color: rgba(200, 85, 61, 0.42);
  background: #fff8f6;
}

.signal-card.is-risk .signal-dot {
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(200, 85, 61, 0.13);
}

.signal-toggle {
  min-height: 34px;
  margin-top: 12px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: #25313a;
  background: #fbfdfd;
  font-size: 0.78rem;
}

.content-grid {
  grid-template-columns: minmax(260px, 0.75fr) minmax(390px, 1.25fr) minmax(270px, 0.8fr);
  align-items: start;
}

.panel {
  padding: 20px;
}

.strategy-panel {
  grid-column: span 3;
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.strategy-panel .panel-heading {
  grid-column: span 2;
  margin-bottom: 0;
}

.positioning-quote {
  min-height: 100%;
  padding: 18px;
  border: 1px solid rgba(8, 118, 110, 0.18);
  border-radius: 8px;
  background: var(--soft-teal);
}

.positioning-quote strong {
  display: block;
  margin-bottom: 8px;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  line-height: 1.05;
}

.positioning-quote p {
  margin: 0;
  color: #4c615f;
  line-height: 1.45;
}

.strategy-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.strategy-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 13px;
  border: 1px solid #e6ecef;
  border-radius: 8px;
  background: #fbfdfd;
}

.strategy-list span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--teal);
  font-weight: 950;
}

.strategy-list strong {
  display: block;
  margin-bottom: 3px;
}

.strategy-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.38;
}

.timeline-panel {
  grid-row: span 2;
}

.assistant-panel {
  grid-column: span 2;
}

.ai-provider-panel {
  display: grid;
  gap: 14px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading h3 {
  font-size: 1.02rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  color: #5b6670;
  background: #edf2f3;
  font-size: 0.75rem;
  font-weight: 900;
}

.pill.green {
  color: var(--green);
  background: #e8f3ec;
}

.pill.amber {
  color: var(--gold);
  background: var(--soft-gold);
}

.pill.blue {
  color: var(--blue);
  background: var(--soft-blue);
}

.pill.coral {
  color: var(--coral);
  background: var(--soft-coral);
}

.provider-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4f4;
}

.provider-selector button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  color: #54616b;
  background: transparent;
  font-weight: 900;
}

.provider-selector button.is-selected {
  color: white;
  background: var(--teal);
  box-shadow: 0 10px 18px rgba(8, 118, 110, 0.18);
}

.provider-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

form {
  display: grid;
  gap: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: #5d6974;
  font-size: 0.8rem;
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfdfd;
}

input:focus,
select:focus {
  border-color: rgba(8, 118, 110, 0.62);
  outline: 3px solid rgba(8, 118, 110, 0.12);
}

.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 16px;
  padding: 0 0 24px;
}

.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 82px;
  top: 28px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}

.timeline time {
  color: var(--teal);
  font-weight: 950;
}

.timeline strong,
.meal-list strong {
  display: block;
  margin-bottom: 5px;
}

.timeline p,
.meal-list p,
.chat-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.check-list,
.reminder-list,
.receipt-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-list input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.meal-list {
  display: grid;
  gap: 16px;
}

.meal-list div,
.reminder-list li,
.receipt-list li {
  padding: 12px;
  border: 1px solid #e6ecef;
  border-radius: 8px;
  background: #fbfdfd;
}

.reminder-list li {
  display: grid;
  gap: 4px;
}

.reminder-list span,
.receipt-list span {
  color: var(--coral);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.receipt-list {
  margin-bottom: 16px;
}

.receipt-list span {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--teal);
}

.receipt-list p {
  margin: 3px 0 0;
  color: var(--muted);
}

.full {
  width: 100%;
}

.receipt-scan {
  margin-bottom: 10px;
}

.chat-box {
  display: grid;
  gap: 12px;
  min-height: 122px;
  max-height: 250px;
  overflow: auto;
  padding: 14px;
  border: 1px solid #e6ecef;
  border-radius: 8px;
  background: #fbfdfd;
}

.chat-input {
  margin-top: 12px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .trip-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid,
  .live-strip,
  .content-grid,
  .route-steps {
    grid-template-columns: 1fr 1fr;
  }

  .timeline-panel,
  .strategy-panel,
  .assistant-panel {
    grid-column: span 2;
  }

  .strategy-panel {
    grid-template-columns: 1fr;
  }

  .strategy-panel .panel-heading {
    grid-column: auto;
  }
}

@media (max-width: 740px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .topbar-actions,
  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .action-row {
    width: 100%;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .trip-list,
  .hero-grid,
  .live-strip,
  .content-grid,
  .route-steps {
    grid-template-columns: 1fr;
  }

  .map-canvas {
    min-height: 360px;
  }

  .map-route {
    left: 50%;
    right: auto;
    top: 15%;
    width: 4px;
    height: 68%;
    border-top: 0;
    border-right: 0;
    background: rgba(8, 118, 110, 0.65);
    border-radius: 8px;
  }

  .map-route::after {
    display: none;
  }

  .map-node.home,
  .map-node.airport,
  .map-node.flight,
  .map-node.hotel,
  .map-node.office {
    left: calc(50% - 38px);
    right: auto;
  }

  .map-node.home {
    top: 8%;
  }

  .map-node.airport {
    top: 28%;
  }

  .map-node.flight {
    top: 48%;
  }

  .map-node.hotel {
    top: 68%;
  }

  .map-node.office {
    top: 84%;
  }

  .timeline-panel,
  .strategy-panel,
  .assistant-panel {
    grid-column: auto;
  }

  .next-action {
    min-height: auto;
  }

  .next-action::after {
    display: none;
  }

  .timeline li {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .timeline li:not(:last-child)::after {
    left: 68px;
  }
}
