:root {
  --bg: #07111f;
  --bg-soft: #0d1b2e;
  --card: rgba(8, 16, 30, 0.82);
  --card-strong: rgba(10, 20, 36, 0.9);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #f7f9fc;
  --muted: #97a8c0;
  --accent: #f4c06c;
  --accent-soft: rgba(244, 192, 108, 0.16);
  --blue: #69c7ff;
  --success: #4cdb9d;
  --warning: #ffc56e;
  --danger: #ff7c7c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(105, 199, 255, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(244, 192, 108, 0.2), transparent 36%),
    linear-gradient(180deg, #081220 0%, #07111f 46%, #050b14 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 35%, rgba(255, 255, 255, 0.015) 65%, transparent),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 80px
    );
  opacity: 0.32;
}

.logistics-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 24px 18px 48px;
  display: grid;
  gap: 18px;
}

.hero-card,
.query-card,
.summary-card,
.timeline-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 22px;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -78px;
  top: -84px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 192, 108, 0.25), transparent 68%);
}

.hero-tag,
.section-tag {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-copy,
.promo-card,
.summary-head,
.section-head {
  position: relative;
  z-index: 1;
}

.hero-copy h1,
.summary-head h2,
.section-head h3 {
  margin: 12px 0 0;
  font-family: "Iowan Old Style", "Baskerville", "Songti SC", serif;
  letter-spacing: 0.01em;
}

.hero-copy h1 {
  font-size: 34px;
  line-height: 1.08;
}

.hero-desc {
  margin: 14px 0 0;
  max-width: 30em;
  line-height: 1.75;
  color: var(--muted);
}

.promo-card {
  background: linear-gradient(135deg, rgba(244, 192, 108, 0.14), rgba(105, 199, 255, 0.09));
  border: 1px solid rgba(244, 192, 108, 0.24);
  border-radius: 24px;
  padding: 16px;
  display: grid;
  width: min(100%, 320px);
  margin-inline: auto;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.promo-image-button {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 0;
  margin: 0 auto;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  box-shadow: none;
  min-height: 0;
}

.promo-image-button:hover,
.promo-image-button:focus-visible {
  transform: none;
  box-shadow: none;
}

.promo-image {
  display: block;
  width: min(100%, 240px);
  margin-inline: auto;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

.promo-primary {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.promo-secondary {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.query-card,
.summary-card,
.timeline-card {
  padding: 18px;
}

.query-form {
  display: grid;
  gap: 12px;
}

.field-label {
  font-size: 14px;
  color: #d8e3f1;
}

.input-row {
  display: grid;
  gap: 10px;
}

input,
button {
  font: inherit;
  border: 0;
  border-radius: 18px;
}

input {
  width: 100%;
  padding: 16px 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  outline: none;
}

input::placeholder {
  color: rgba(233, 243, 255, 0.42);
}

input:focus {
  border-color: rgba(244, 192, 108, 0.55);
  box-shadow: 0 0 0 4px rgba(244, 192, 108, 0.12);
}

button {
  min-height: 54px;
  padding: 0 18px;
  font-weight: 700;
  color: #07111f;
  background: linear-gradient(135deg, #f7cf89, #f4c06c);
  box-shadow: 0 16px 28px rgba(244, 192, 108, 0.22);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 20px 32px rgba(244, 192, 108, 0.28);
}

button:disabled {
  opacity: 0.78;
  cursor: wait;
}

.status-banner {
  margin-top: 14px;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid transparent;
}

.status-idle {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.status-loading {
  background: rgba(105, 199, 255, 0.12);
  border-color: rgba(105, 199, 255, 0.22);
  color: #dff5ff;
}

.status-success {
  background: rgba(76, 219, 157, 0.12);
  border-color: rgba(76, 219, 157, 0.24);
  color: #ddfff1;
}

.status-warning {
  background: rgba(255, 197, 110, 0.12);
  border-color: rgba(255, 197, 110, 0.22);
  color: #fff1ce;
}

.status-error {
  background: rgba(255, 124, 124, 0.12);
  border-color: rgba(255, 124, 124, 0.24);
  color: #ffdede;
}

.results {
  display: grid;
  gap: 18px;
}

.summary-head {
  display: grid;
  gap: 12px;
}

.summary-note {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.summary-grid {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.summary-item {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 8px;
}

.summary-item.accent {
  background: linear-gradient(135deg, rgba(244, 192, 108, 0.14), rgba(105, 199, 255, 0.08));
  border-color: rgba(244, 192, 108, 0.24);
}

.summary-item span,
.summary-item em {
  font-style: normal;
  color: var(--muted);
}

.summary-item strong {
  font-size: 20px;
  line-height: 1.35;
}

.trail-link {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(135deg, rgba(105, 199, 255, 0.16), rgba(244, 192, 108, 0.12));
  border: 1px solid rgba(105, 199, 255, 0.24);
}

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

.timeline-item {
  position: relative;
  padding: 16px 16px 16px 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 21px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(244, 192, 108, 0.14);
}

.timeline-time {
  display: block;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.03em;
}

.timeline-title {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
}

.timeline-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  word-break: break-word;
}

.timeline-empty {
  padding: 20px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  line-height: 1.8;
}

.image-preview-modal[hidden] {
  display: none;
}

.image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(3, 8, 15, 0.82);
  cursor: zoom-out;
  box-shadow: none;
}

.image-preview-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 540px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 16, 30, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.image-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  color: var(--text);
}

.image-preview-x {
  min-height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: none;
  font-size: 24px;
  line-height: 1;
}

.image-preview-full {
  display: block;
  width: 100%;
  height: auto;
}

@media (min-width: 720px) {
  .hero-card {
    grid-template-columns: minmax(0, 1.15fr) 280px;
    align-items: center;
  }

  .input-row {
    grid-template-columns: minmax(0, 1fr) 152px;
  }

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


/* History - matches progress query style */
.history-row { margin-top: 12px; display:flex; gap:8px; align-items:center; flex-wrap:wrap }
.history-label { color: var(--muted, #94a3b8); font-size: 13px }
#history-chips { display:flex; gap:6px; flex-wrap:wrap }
.history-chip { border:0; border-radius:999px; padding:8px 14px; cursor:pointer; font-weight:600; font-size:13px; background:linear-gradient(135deg, #2563eb, #7c3aed); color:#fff; transition:opacity 0.2s }
.history-chip:hover { opacity:0.85 }
.history-clear { border:0; border-radius:999px; padding:8px 14px; cursor:pointer; font-size:13px; background:rgba(0,0,0,0.06); color:#64748b }
.history-clear:hover { background:rgba(239,68,68,0.1); color:#ef4444 }
