*{box-sizing:border-box}
:root{
  --bg:#f6f8fb;
  --panel:#fff;
  --line:#dce3ee;
  --line-strong:#c7d2e2;
  --text:#111827;
  --muted:#5f6f85;
  --soft:#eef3f8;
  --blue:#2563eb;
  --blue-soft:#e8f0ff;
  --green:#047857;
  --green-soft:#e7f7ef;
  --amber:#a16207;
  --amber-soft:#fff7df;
  --red:#b91c1c;
  --red-soft:#fff1f1;
}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  line-height:1.4;
}
a{color:inherit}
.trip-nav{
  height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:0 28px;
  background:#fff;
  border-bottom:1px solid var(--line);
}
.trip-logo{
  display:inline-flex;
  align-items:center;
  gap:9px;
  font-weight:850;
  text-decoration:none;
  color:#0f172a;
}
.trip-nav-links{display:flex;align-items:center;gap:8px}
.nav-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:0 12px;
  border:1px solid transparent;
  border-radius:8px;
  color:#334155;
  font-size:14px;
  font-weight:750;
  text-decoration:none;
}
.nav-link:hover{background:#f8fafc;border-color:var(--line)}
.nav-link.primary{background:#111827;color:#fff;border-color:#111827}
.trip-shell{
  width:min(1280px,100%);
  margin:0 auto;
  padding:22px 24px 42px;
}
.trip-top{
  display:grid;
  grid-template-columns:minmax(0,1fr) 320px;
  gap:16px;
  align-items:stretch;
}
.panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 8px 24px rgba(15,23,42,.04);
}
.scenario-panel{padding:18px}
.panel-title{
  margin:0 0 12px;
  font-size:15px;
  line-height:1.2;
  font-weight:850;
  color:#0f172a;
}
.scenario-input{
  width:100%;
  min-height:176px;
  resize:vertical;
  display:block;
  padding:13px 14px;
  border:1px solid var(--line-strong);
  border-radius:8px;
  background:#fbfdff;
  color:var(--text);
  font:inherit;
  font-size:14px;
  line-height:1.5;
}
.scenario-input:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
  background:#fff;
}
.run-panel{
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.control-label{
  display:block;
  margin:0 0 7px;
  color:#475569;
  font-size:11px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:0;
}
.segmented{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
  padding:4px;
  background:var(--soft);
  border:1px solid var(--line);
  border-radius:8px;
}
.segmented button{
  min-height:34px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:#475569;
  font:inherit;
  font-size:13px;
  font-weight:850;
  cursor:pointer;
}
.segmented button.active{
  background:#fff;
  color:#1746b7;
  box-shadow:0 1px 3px rgba(15,23,42,.13);
}
.select-field{
  width:100%;
  height:40px;
  padding:0 12px;
  border:1px solid var(--line-strong);
  border-radius:8px;
  background:#fff;
  color:var(--text);
  font:inherit;
  font-size:14px;
  font-weight:750;
}
.select-field:disabled{opacity:.5}
.run-button{
  width:100%;
  height:44px;
  border:0;
  border-radius:8px;
  background:var(--blue);
  color:#fff;
  font:inherit;
  font-size:14px;
  font-weight:900;
  cursor:pointer;
}
.run-button:hover{background:#1d4ed8}
.run-button:disabled{background:#94a3b8;cursor:not-allowed}
.source-row{display:flex;flex-wrap:wrap;gap:6px}
.source-chip{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:3px 8px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid var(--line);
  color:#475569;
  font-size:12px;
  font-weight:800;
}
.status{
  margin-top:14px;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid #bfdbfe;
  background:var(--blue-soft);
  color:#1e40af;
  font-size:13px;
  font-weight:750;
}
.status[hidden]{display:none}
.status.success{background:var(--green-soft);border-color:#a7f3d0;color:var(--green)}
.status.error{background:var(--red-soft);border-color:#fecaca;color:var(--red)}
.workspace{
  display:grid;
  grid-template-columns:minmax(0,1fr) 360px;
  gap:16px;
  align-items:start;
  margin-top:16px;
}
.results-panel{padding:16px;min-height:240px}
.result-empty{
  min-height:210px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  color:var(--muted);
  font-size:14px;
  text-align:center;
}
.result-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.result-title{
  margin:0;
  font-size:18px;
  line-height:1.25;
  font-weight:900;
}
.summary{
  margin:0 0 14px;
  max-width:920px;
  color:#334155;
  font-size:14px;
  line-height:1.55;
}
.meta-row{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 0}
.pill{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  max-width:100%;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#f8fafc;
  color:#475569;
  font-size:12px;
  font-weight:850;
  overflow-wrap:anywhere;
}
.section-title{
  margin:18px 0 9px;
  font-size:12px;
  line-height:1.2;
  font-weight:900;
  color:#0f172a;
  text-transform:uppercase;
  letter-spacing:0;
}
.option-list{display:grid;gap:10px}
.option-card{
  border:1px solid var(--line);
  border-radius:8px;
  background:#fbfdff;
  padding:12px;
}
.option-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.option-name{
  min-width:0;
  color:#0f172a;
  font-size:15px;
  line-height:1.3;
  font-weight:900;
  overflow-wrap:anywhere;
}
.rank-badge{
  flex:0 0 auto;
  padding:3px 8px;
  border-radius:999px;
  background:#dbeafe;
  color:#1d4ed8;
  font-size:12px;
  font-weight:900;
}
.option-body{
  margin-top:7px;
  color:#475569;
  font-size:13px;
  line-height:1.5;
  overflow-wrap:anywhere;
}
.fact-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.fact{
  display:inline-flex;
  max-width:100%;
  min-height:24px;
  padding:3px 7px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  color:#334155;
  font-size:12px;
  font-weight:750;
  overflow-wrap:anywhere;
}
.place-list{display:grid;gap:7px;margin-top:9px}
.place{
  padding:8px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}
.place-name{
  display:inline;
  color:#0f172a;
  font-size:13px;
  line-height:1.35;
  font-weight:900;
  overflow-wrap:anywhere;
}
a.place-name{color:#1746b7;text-decoration:none}
a.place-name:hover{text-decoration:underline}
.place-meta{
  margin-top:3px;
  color:#64748b;
  font-size:12px;
  line-height:1.35;
  font-weight:700;
  overflow-wrap:anywhere;
}
.link-row{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}
.provider-link{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  max-width:100%;
  padding:4px 8px;
  border:1px solid #bfdbfe;
  border-radius:6px;
  background:#eff6ff;
  color:#1746b7;
  font-size:12px;
  font-weight:900;
  text-decoration:none;
  overflow-wrap:anywhere;
}
.provider-link:hover{text-decoration:underline}
.source-grid{display:grid;gap:8px}
.source-block{
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  padding:10px;
}
.source-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.source-name{font-size:13px;font-weight:900;color:#0f172a;text-transform:capitalize}
.source-count{font-size:12px;font-weight:900;color:#64748b}
.source-text{
  margin-top:7px;
  color:#475569;
  font-size:12px;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.warning-list{display:grid;gap:7px}
.warning{
  padding:8px 10px;
  border:1px solid #fed7aa;
  border-radius:8px;
  background:var(--amber-soft);
  color:#7c2d12;
  font-size:13px;
  line-height:1.4;
}
.raw-details{
  margin-top:16px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#f8fafc;
}
.raw-details summary{
  cursor:pointer;
  padding:10px 12px;
  color:#334155;
  font-size:13px;
  font-weight:850;
}
.raw-details pre{
  margin:0;
  padding:12px;
  max-height:420px;
  overflow:auto;
  border-top:1px solid var(--line);
  color:#0f172a;
  font-size:12px;
  line-height:1.45;
  white-space:pre-wrap;
  word-break:break-word;
}
.side-panel{display:grid;gap:16px}
.activity-panel{padding:14px}
.activity-panel[hidden]{display:none}
.activity-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.activity-title{
  margin:0;
  font-size:14px;
  line-height:1.2;
  font-weight:900;
}
.activity-state{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:3px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#f8fafc;
  color:#475569;
  font-size:12px;
  font-weight:900;
  text-transform:capitalize;
}
.activity-list{
  display:grid;
  gap:8px;
  max-height:420px;
  overflow:auto;
  padding-right:2px;
}
.activity-item{
  position:relative;
  padding:9px 9px 9px 28px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}
.activity-item:before{
  content:"";
  position:absolute;
  top:12px;
  left:10px;
  width:8px;
  height:8px;
  border-radius:999px;
  background:#94a3b8;
}
.activity-item.running:before{background:var(--blue)}
.activity-item.done:before{background:var(--green)}
.activity-item.warn:before{background:#d97706}
.activity-item.error:before{background:var(--red)}
.activity-message{
  color:#0f172a;
  font-size:13px;
  line-height:1.35;
  font-weight:850;
  overflow-wrap:anywhere;
}
.activity-meta{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:6px;
}
.activity-chip{
  display:inline-flex;
  min-height:22px;
  max-width:100%;
  align-items:center;
  padding:2px 6px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#f8fafc;
  color:#64748b;
  font-size:11px;
  font-weight:800;
  overflow-wrap:anywhere;
}
.activity-empty{
  padding:14px 10px;
  color:#64748b;
  font-size:13px;
  text-align:center;
}
.chat-panel{padding:14px}
.chat-panel[hidden]{display:none}
.chat-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.chat-title{
  margin:0;
  font-size:14px;
  line-height:1.2;
  font-weight:900;
}
.share-link{
  color:#1746b7;
  font-size:12px;
  font-weight:850;
  text-decoration:none;
}
.share-link[hidden]{display:none}
.share-link:hover{text-decoration:underline}
.chat-messages{display:grid;gap:8px;max-height:520px;overflow:auto;padding-right:2px}
.message{
  border:1px solid var(--line);
  border-radius:8px;
  background:#f8fafc;
  padding:9px;
}
.message.user{background:#eff6ff;border-color:#bfdbfe}
.message.assistant{background:#fff}
.message-role{
  margin-bottom:4px;
  color:#64748b;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:0;
}
.message-text{
  color:#334155;
  font-size:13px;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.chat-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) 74px;
  gap:8px;
  margin-top:10px;
}
.chat-input{
  min-height:40px;
  padding:9px 10px;
  border:1px solid var(--line-strong);
  border-radius:8px;
  background:#fff;
  color:var(--text);
  font:inherit;
  font-size:13px;
}
.chat-input:focus{
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.chat-button{
  min-height:40px;
  border:0;
  border-radius:8px;
  background:#111827;
  color:#fff;
  font:inherit;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}
.chat-button:disabled{background:#94a3b8;cursor:not-allowed}
.small-note{
  margin:0;
  color:#64748b;
  font-size:12px;
  line-height:1.45;
}
.error-box{
  padding:12px;
  border:1px solid #fecaca;
  border-radius:8px;
  background:var(--red-soft);
  color:var(--red);
  font-size:14px;
  font-weight:750;
}
.loading-line{
  display:inline-block;
  width:100%;
  height:10px;
  border-radius:999px;
  overflow:hidden;
  background:#e2e8f0;
}
.loading-line:before{
  content:"";
  display:block;
  width:36%;
  height:100%;
  background:#93c5fd;
  animation:loadslide 1.15s ease-in-out infinite;
}
@keyframes loadslide{
  0%{transform:translateX(-100%)}
  100%{transform:translateX(300%)}
}
@media(max-width:980px){
  .trip-top,.workspace{grid-template-columns:1fr}
  .side-panel{grid-row:auto}
}
@media(max-width:640px){
  .trip-nav{height:auto;align-items:flex-start;padding:14px 16px;flex-direction:column}
  .trip-nav-links{width:100%;justify-content:space-between}
  .trip-shell{padding:14px 14px 30px}
  .scenario-panel,.run-panel,.results-panel,.activity-panel,.chat-panel{padding:14px}
  .scenario-input{min-height:220px}
  .result-head{display:block}
  .chat-form{grid-template-columns:1fr}
  .chat-button{width:100%}
}
